More formatting changes, new tags file.

This commit is contained in:
William Ferrell
2000-04-03 22:13:57 +00:00
parent 0d703c5864
commit 6a115b4446
64 changed files with 8950 additions and 8950 deletions
+152 -152
View File
@@ -35,100 +35,100 @@ static char icon_char = '@';
int
curses_drv_init (struct lcd_logical_driver *driver, char *args)
{
char *argv[64];
int argc;
int i, j;
char *argv[64];
int argc;
int i, j;
argc = get_args (argv, args, 64);
argc = get_args (argv, args, 64);
for (i = 0; i < argc; i++) {
if (0 == strcmp (argv[i], "-f") || 0 == strcmp (argv[i], "--forecolor")) {
if (i + 1 > argc) {
fprintf (stderr, "curses_init: %s requires an argument\n", argv[i]);
return -1;
}
// TODO: color display in curses driver!
printf ("Sorry, colors not yet implemented...\n");
//strcpy(device, argv[++i]);
} else if (0 == strcmp (argv[i], "-b") || 0 == strcmp (argv[i], "--backcolor")) {
if (i + 1 > argc) {
fprintf (stderr, "curses_init: %s requires an argument\n", argv[i]);
return -1;
}
// TODO: color display in curses driver!
printf ("Sorry, colors not yet implemented...\n");
//strcpy(device, argv[++i]);
} else if (0 == strcmp (argv[i], "-B") || 0 == strcmp (argv[i], "--backlight")) {
if (i + 1 > argc) {
fprintf (stderr, "curses_init: %s requires an argument\n", argv[i]);
return -1;
}
// TODO: color display in curses driver!
printf ("Sorry, colors not yet implemented...\n");
//strcpy(device, argv[++i]);
} else if (0 == strcmp (argv[i], "-h") || 0 == strcmp (argv[i], "--help")) {
printf ("LCDproc [n]curses driver\n" "\t-f\t--forecolor\tChange the foreground color\n" "\t-b\t--backcolor\tChange the backlight's \"off\" color\n" "\t-B\t--backlight\tChange the backlight's \"on\" color\n" "\t-h\t--help\t\tShow this help information\n");
return -1;
} else {
printf ("Invalid parameter: %s\n", argv[i]);
}
for (i = 0; i < argc; i++) {
if (0 == strcmp (argv[i], "-f") || 0 == strcmp (argv[i], "--forecolor")) {
if (i + 1 > argc) {
fprintf (stderr, "curses_init: %s requires an argument\n", argv[i]);
return -1;
}
// TODO: color display in curses driver!
printf ("Sorry, colors not yet implemented...\n");
//strcpy(device, argv[++i]);
} else if (0 == strcmp (argv[i], "-b") || 0 == strcmp (argv[i], "--backcolor")) {
if (i + 1 > argc) {
fprintf (stderr, "curses_init: %s requires an argument\n", argv[i]);
return -1;
}
// TODO: color display in curses driver!
printf ("Sorry, colors not yet implemented...\n");
//strcpy(device, argv[++i]);
} else if (0 == strcmp (argv[i], "-B") || 0 == strcmp (argv[i], "--backlight")) {
if (i + 1 > argc) {
fprintf (stderr, "curses_init: %s requires an argument\n", argv[i]);
return -1;
}
// TODO: color display in curses driver!
printf ("Sorry, colors not yet implemented...\n");
//strcpy(device, argv[++i]);
} else if (0 == strcmp (argv[i], "-h") || 0 == strcmp (argv[i], "--help")) {
printf ("LCDproc [n]curses driver\n" "\t-f\t--forecolor\tChange the foreground color\n" "\t-b\t--backcolor\tChange the backlight's \"off\" color\n" "\t-B\t--backlight\tChange the backlight's \"on\" color\n" "\t-h\t--help\t\tShow this help information\n");
return -1;
} else {
printf ("Invalid parameter: %s\n", argv[i]);
}
}
}
curses_drv = driver;
curses_drv = driver;
// Init curses...
initscr ();
cbreak ();
noecho ();
nodelay (stdscr, TRUE);
nonl ();
intrflush (stdscr, FALSE);
keypad (stdscr, TRUE);
// Init curses...
initscr ();
cbreak ();
noecho ();
nodelay (stdscr, TRUE);
nonl ();
intrflush (stdscr, FALSE);
keypad (stdscr, TRUE);
curses_drv_clear ();
curses_drv_clear ();
// Override output functions...
driver->clear = curses_drv_clear;
driver->string = curses_drv_string;
driver->chr = curses_drv_chr;
driver->vbar = curses_drv_vbar;
driver->init_vbar = NULL;
driver->hbar = curses_drv_hbar;
driver->init_hbar = NULL;
driver->num = curses_drv_num;
driver->init_num = curses_drv_init_num;
// Override output functions...
driver->clear = curses_drv_clear;
driver->string = curses_drv_string;
driver->chr = curses_drv_chr;
driver->vbar = curses_drv_vbar;
driver->init_vbar = NULL;
driver->hbar = curses_drv_hbar;
driver->init_hbar = NULL;
driver->num = curses_drv_num;
driver->init_num = curses_drv_init_num;
driver->init = curses_drv_init;
driver->close = curses_drv_close;
driver->flush = curses_drv_flush;
driver->flush_box = curses_drv_flush_box;
driver->contrast = NULL;
driver->backlight = NULL;
driver->set_char = NULL;
driver->icon = curses_drv_icon;
driver->draw_frame = curses_drv_draw_frame;
driver->init = curses_drv_init;
driver->close = curses_drv_close;
driver->flush = curses_drv_flush;
driver->flush_box = curses_drv_flush_box;
driver->contrast = NULL;
driver->backlight = NULL;
driver->set_char = NULL;
driver->icon = curses_drv_icon;
driver->draw_frame = curses_drv_draw_frame;
driver->getkey = curses_drv_getkey;
driver->getkey = curses_drv_getkey;
// Change the character used for padding the title bars...
PAD = '#';
// Change the character used for "..."
ELLIPSIS = '~';
// Change the character used for padding the title bars...
PAD = '#';
// Change the character used for "..."
ELLIPSIS = '~';
return 200; // 200 is arbitrary. (must be 1 or more)
return 200; // 200 is arbitrary. (must be 1 or more)
}
void
curses_drv_close ()
{
// Close curses
clear ();
move (0, 0);
refresh ();
endwin ();
// Close curses
clear ();
move (0, 0);
refresh ();
endwin ();
drv_base_close ();
drv_base_close ();
}
@@ -138,7 +138,7 @@ curses_drv_close ()
void
curses_drv_clear ()
{
clear ();
clear ();
}
@@ -149,21 +149,21 @@ curses_drv_clear ()
void
curses_drv_string (int x, int y, char string[])
{
int i;
unsigned char *c;
int i;
unsigned char *c;
for (i = 0; string[i]; i++) {
c = &string[i];
switch (*c) {
case 0:
*c = icon_char;
break;
case 255:
*c = '#';
break;
}
}
mvaddstr (y - 1, x - 1, string);
for (i = 0; string[i]; i++) {
c = &string[i];
switch (*c) {
case 0:
*c = icon_char;
break;
case 255:
*c = '#';
break;
}
}
mvaddstr (y - 1, x - 1, string);
}
/////////////////////////////////////////////////////////////////
@@ -173,16 +173,16 @@ curses_drv_string (int x, int y, char string[])
void
curses_drv_chr (int x, int y, char c)
{
switch (c) {
case 0:
c = icon_char;
break;
case -1:
c = '#';
break;
}
switch (c) {
case 0:
c = icon_char;
break;
case -1:
c = '#';
break;
}
mvaddch (y - 1, x - 1, c);
mvaddch (y - 1, x - 1, c);
}
/////////////////////////////////////////////////////////////////
@@ -199,15 +199,15 @@ curses_drv_init_num ()
void
curses_drv_num (int x, int num)
{
char c;
int y, dx;
char c;
int y, dx;
c = '0' + num;
c = '0' + num;
// printf(&c,"%1d",num);
for (y = 1; y < 5; y++)
for (dx = 0; dx < 3; dx++)
curses_drv_chr (x + dx, y, c);
for (y = 1; y < 5; y++)
for (dx = 0; dx < 3; dx++)
curses_drv_chr (x + dx, y, c);
}
/////////////////////////////////////////////////////////////////
@@ -216,17 +216,17 @@ curses_drv_num (int x, int num)
void
curses_drv_vbar (int x, int len)
{
char map[] = "_.,,ooO8";
char map[] = "_.,,ooO8";
int y;
for (y = lcd.hgt; y > 0 && len > 0; y--) {
if (len >= lcd.cellhgt)
curses_drv_chr (x, y, '8');
else
curses_drv_chr (x, y, map[len - 1]);
int y;
for (y = lcd.hgt; y > 0 && len > 0; y--) {
if (len >= lcd.cellhgt)
curses_drv_chr (x, y, '8');
else
curses_drv_chr (x, y, map[len - 1]);
len -= lcd.cellhgt;
}
len -= lcd.cellhgt;
}
// move(4-len/lcd.cellhgt, x-1);
// vline(0, len/lcd.cellhgt);
@@ -239,14 +239,14 @@ curses_drv_vbar (int x, int len)
void
curses_drv_hbar (int x, int y, int len)
{
for (; x <= lcd.wid && len > 0; x++) {
if (len >= lcd.cellwid)
curses_drv_chr (x, y, '=');
else
curses_drv_chr (x, y, '-');
for (; x <= lcd.wid && len > 0; x++) {
if (len >= lcd.cellwid)
curses_drv_chr (x, y, '=');
else
curses_drv_chr (x, y, '-');
len -= lcd.cellwid;
}
len -= lcd.cellwid;
}
// move(y-1, x-1);
// hline(0, len/lcd.cellwid);
@@ -258,18 +258,18 @@ curses_drv_hbar (int x, int y, int len)
void
curses_drv_icon (int which, char dest)
{
if (dest == 0)
switch (which) {
case 0:
icon_char = '+';
break;
case 1:
icon_char = '*';
break;
default:
icon_char = '#';
break;
}
if (dest == 0)
switch (which) {
case 0:
icon_char = '+';
break;
case 1:
icon_char = '*';
break;
default:
icon_char = '#';
break;
}
}
@@ -279,13 +279,13 @@ curses_drv_icon (int which, char dest)
void
curses_drv_flush ()
{
curses_drv_draw_frame (curses_drv->framebuf);
curses_drv_draw_frame (curses_drv->framebuf);
}
void
curses_drv_flush_box (int lft, int top, int rgt, int bot)
{
curses_drv_flush ();
curses_drv_flush ();
}
void
@@ -293,29 +293,29 @@ curses_drv_draw_frame (char *dat)
{
// border(0, 0, 0, 0, 0, 0, lcd.wid+1, lcd.hgt+1);
refresh ();
refresh ();
}
char
curses_drv_getkey ()
{
int i;
int i;
i = getch ();
i = getch ();
if (i == KEY_LEFT)
return 'D';
if (i == KEY_UP)
return 'B';
if (i == KEY_DOWN)
return 'C';
if (i == KEY_RIGHT)
return 'A';
if (i == KEY_LEFT)
return 'D';
if (i == KEY_UP)
return 'B';
if (i == KEY_DOWN)
return 'C';
if (i == KEY_RIGHT)
return 'A';
if (i != ERR)
return i;
else
return 0;
if (i != ERR)
return i;
else
return 0;
}