- Added some icons.

- Made sure all icon and vbar functions are not the old API functions.
- Removed heartbeat functions from drivers that did standard heartbeat.
This commit is contained in:
robijn
2002-05-23 18:03:36 +00:00
parent 450d05274f
commit dc4c049721
41 changed files with 355 additions and 560 deletions
+6
View File
@@ -460,6 +460,12 @@ driver_alt_icon( Driver * drv, int x, int y, int icon )
case ICON_ARROW_DOWN: ch1 = 'v'; break; case ICON_ARROW_DOWN: ch1 = 'v'; break;
case ICON_ARROW_LEFT: ch1 = '<'; break; case ICON_ARROW_LEFT: ch1 = '<'; break;
case ICON_ARROW_RIGHT: ch1 = '>'; break; case ICON_ARROW_RIGHT: ch1 = '>'; break;
case ICON_CHECKBOX_OFF: ch1 = 'N'; break;
case ICON_CHECKBOX_ON: ch1 = 'Y'; break;
case ICON_CHECKBOX_GRAY: ch1 = 'o'; break;
case ICON_SELECTOR_AT_LEFT: ch1 = '>'; break;
case ICON_SELECTOR_AT_RIGHT: ch1 = '<'; break;
case ICON_ELLIPSIS: ch1 = '_'; break;
case ICON_STOP: ch1 = '['; ch2 = ']'; break; case ICON_STOP: ch1 = '['; ch2 = ']'; break;
case ICON_PAUSE: ch1 = '|'; ch2 = '|'; break; case ICON_PAUSE: ch1 = '|'; ch2 = '|'; break;
case ICON_PLAY: ch1 = '>'; ch2 = ' '; break; case ICON_PLAY: ch1 = '>'; ch2 = ' '; break;
+10 -3
View File
@@ -297,10 +297,17 @@ drivers_icon( int x, int y, int icon )
report( RPT_INFO, "drivers_icon( x=%d, y=%d, icon=ICON_%s )", x, y, widget_icon_to_iconname (icon) ); report( RPT_INFO, "drivers_icon( x=%d, y=%d, icon=ICON_%s )", x, y, widget_icon_to_iconname (icon) );
ForAllDrivers(drv) { ForAllDrivers(drv) {
if( drv->icon ) /* Does the driver have the icon function ? */
drv->icon( drv, x, y, icon ); if( drv->icon ) {
else /* Try driver call */
if (drv->icon( drv, x, y, icon ) == -1) {
/* do alternative call if driver's function does not know the icon */
driver_alt_icon( drv, x, y, icon );
}
} else {
/* Also do alternative call if the driver does not have icon function */
driver_alt_icon( drv, x, y, icon ); driver_alt_icon( drv, x, y, icon );
}
} }
} }
+3 -42
View File
@@ -598,17 +598,6 @@ CFontz_hbar (Driver * drvthis, int x, int y, int len, int promille, int options)
} }
/////////////////////////////////////////////////////////////////
// Writes a big number.
//
MODULE_EXPORT void
CFontz_num (Driver * drvthis, int x, int num)
{
char out[5];
snprintf (out, sizeof(out), "%c%c%c%c", 28, 0, x-1, num+48);
write (fd, out, 4);
}
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// Sets a custom character from 0-7... // Sets a custom character from 0-7...
// //
@@ -644,7 +633,7 @@ CFontz_set_char (Driver * drvthis, int n, char *dat)
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// Places an icon on screen // Places an icon on screen
// //
MODULE_EXPORT void MODULE_EXPORT int
CFontz_icon (Driver * drvthis, int x, int y, int icon) CFontz_icon (Driver * drvthis, int x, int y, int icon)
{ {
char icons[3][6 * 8] = { char icons[3][6 * 8] = {
@@ -699,9 +688,9 @@ CFontz_icon (Driver * drvthis, int x, int y, int icon)
CFontz_chr( drvthis, x, y, 0 ); CFontz_chr( drvthis, x, y, 0 );
break; break;
default: default:
report( RPT_WARNING, "CFontz_icon: unknown or unsupported icon: %d", icon ); return -1;
} }
return 0;
} }
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
@@ -741,31 +730,3 @@ CFontz_string (Driver * drvthis, int x, int y, char string[])
framebuf[(y * width) + x + i] = string[i]; framebuf[(y * width) + x + i] = string[i];
} }
} }
/////////////////////////////////////////////////////////////
// Does the heartbeat...
//
MODULE_EXPORT void
CFontz_heartbeat (Driver *drvthis, int type)
{
static int timer = 0;
int whichIcon;
static int saved_type = HEARTBEAT_ON;
if (type)
saved_type = type;
if (type == HEARTBEAT_ON) {
/* Set this to pulsate like a real heart beat... */
if( ((timer + 4) & 5))
whichIcon = ICON_HEART_OPEN;
else
whichIcon = ICON_HEART_FILLED;
/* place the icon */
CFontz_icon (drvthis, width, 1, whichIcon);
}
timer++;
timer &= 0x0f;
}
+1 -3
View File
@@ -24,9 +24,7 @@ MODULE_EXPORT void CFontz_chr (Driver * drvthis, int x, int y, char c);
MODULE_EXPORT void CFontz_vbar (Driver * drvthis, int x, int y, int len, int promille, int options); MODULE_EXPORT void CFontz_vbar (Driver * drvthis, int x, int y, int len, int promille, int options);
MODULE_EXPORT void CFontz_hbar (Driver * drvthis, int x, int y, int len, int promille, int options); MODULE_EXPORT void CFontz_hbar (Driver * drvthis, int x, int y, int len, int promille, int options);
MODULE_EXPORT void CFontz_num (Driver * drvthis, int x, int num); MODULE_EXPORT int CFontz_icon(Driver * drvthis, int x, int y, int icon);
MODULE_EXPORT void CFontz_heartbeat (Driver *drvthis, int type);
MODULE_EXPORT void CFontz_icon(Driver * drvthis, int x, int y, int icon);
MODULE_EXPORT void CFontz_set_char (Driver * drvthis, int n, char *dat); MODULE_EXPORT void CFontz_set_char (Driver * drvthis, int n, char *dat);
+3 -33
View File
@@ -681,7 +681,7 @@ send_bytes_message(fd, 9, CF633_Set_LCD_Special_Character_Data , out);
/* /*
* Places an icon on screen * Places an icon on screen
*/ */
MODULE_EXPORT void MODULE_EXPORT int
CFontz633_icon (Driver * drvthis, int x, int y, int icon) CFontz633_icon (Driver * drvthis, int x, int y, int icon)
{ {
char icons[3][6 * 8] = { char icons[3][6 * 8] = {
@@ -733,8 +733,9 @@ CFontz633_icon (Driver * drvthis, int x, int y, int icon)
CFontz633_chr( drvthis, x, y, 0 ); CFontz633_chr( drvthis, x, y, 0 );
break; break;
default: default:
report( RPT_WARNING, "CFontz633_icon: unknown or unsupported icon: %d", icon ); return -1; /* Let the core do other icons */
} }
return 0;
} }
@@ -777,34 +778,3 @@ CFontz633_string (Driver * drvthis, int x, int y, char string[])
framebuf[(y * width) + x + i] = string[i]; framebuf[(y * width) + x + i] = string[i];
} }
} }
/*
* Does the heartbeat...
*/
MODULE_EXPORT void
CFontz633_heartbeat (Driver *drvthis, int type)
{
static int timer = 0;
static int saved_type = HEARTBEAT_ON;
int whichIcon;
if (type)
saved_type = type;
if (type == HEARTBEAT_ON) {
/* Set this to pulsate like a real heart beat... */
if( ((timer + 4) & 5))
whichIcon = ICON_HEART_OPEN;
else
whichIcon = ICON_HEART_FILLED;
/* place the icon */
CFontz633_icon (drvthis, width, 1, whichIcon);
}
timer++;
timer &= 0x0f;
}
+1 -2
View File
@@ -24,8 +24,7 @@ MODULE_EXPORT void CFontz633_chr (Driver * drvthis, int x, int y, char c);
MODULE_EXPORT void CFontz633_vbar (Driver * drvthis, int x, int y, int len, int promille, int options); MODULE_EXPORT void CFontz633_vbar (Driver * drvthis, int x, int y, int len, int promille, int options);
MODULE_EXPORT void CFontz633_hbar (Driver * drvthis, int x, int y, int len, int promille, int options); MODULE_EXPORT void CFontz633_hbar (Driver * drvthis, int x, int y, int len, int promille, int options);
MODULE_EXPORT void CFontz633_num (Driver * drvthis, int x, int num); MODULE_EXPORT void CFontz633_num (Driver * drvthis, int x, int num);
MODULE_EXPORT void CFontz633_heartbeat (Driver *drvthis, int type); MODULE_EXPORT int CFontz633_icon(Driver * drvthis, int x, int y, int icon);
MODULE_EXPORT void CFontz633_icon(Driver * drvthis, int x, int y, int icon);
MODULE_EXPORT void CFontz633_set_char (Driver * drvthis, int n, char *dat); MODULE_EXPORT void CFontz633_set_char (Driver * drvthis, int n, char *dat);
+8 -28
View File
@@ -192,7 +192,6 @@ typedef struct p {
int contrast; /* static data from set/get_contrast */ int contrast; /* static data from set/get_contrast */
int backlightenabled; int backlightenabled;
MtxOrb_type_type MtxOrb_type; MtxOrb_type_type MtxOrb_type;
int timer; /* static data from MtxOrb_heartbeat */
char pause_key; char pause_key;
char back_key; char back_key;
char forward_key; char forward_key;
@@ -278,7 +277,6 @@ MtxOrb_init (Driver *drvthis, char *args)
p->backlightenabled = DEFAULT_BACKLIGHT; p->backlightenabled = DEFAULT_BACKLIGHT;
p->old = NULL; p->old = NULL;
p->MtxOrb_type = MTXORB_LKD; /* Assume it's an LCD w/keypad */ p->MtxOrb_type = MTXORB_LKD; /* Assume it's an LCD w/keypad */
p->timer = 0; /* static data from MtxOrb_heartbeat */
p->pause_key = MTXORB_DEFAULT_PAUSE_KEY; p->pause_key = MTXORB_DEFAULT_PAUSE_KEY;
p->back_key = MTXORB_DEFAULT_BACK_KEY; p->back_key = MTXORB_DEFAULT_BACK_KEY;
p->forward_key = MTXORB_DEFAULT_FORWARD_KEY; p->forward_key = MTXORB_DEFAULT_FORWARD_KEY;
@@ -1189,10 +1187,15 @@ MtxOrb_set_char (Driver *drvthis, int n, char *dat)
/* TODO: This is not yet my idea of icon frame buffer but it work well. /* TODO: This is not yet my idea of icon frame buffer but it work well.
*/ */
MODULE_EXPORT void MODULE_EXPORT int
MtxOrb_icon (Driver *drvthis, int x, int y, int icon) MtxOrb_icon (Driver *drvthis, int x, int y, int icon)
{ {
MtxOrb_chr (drvthis, x, y, MtxOrb_ask_bar (drvthis, icon)); MtxOrb_chr (drvthis, x, y, MtxOrb_ask_bar (drvthis, icon));
return 0;
/* We return 0, however many icons are not supported
* TODO...
*/
} }
/* TODO: Recover the code for I2C connectivity to MtxOrb /* TODO: Recover the code for I2C connectivity to MtxOrb
@@ -1204,6 +1207,8 @@ MtxOrb_icon (Driver *drvthis, int x, int y, int icon)
* (A-Z) on success, 0 on failure... * (A-Z) on success, 0 on failure...
*/ */
/* TODO implement for new API call (get_key) that returns a string */
MODULE_EXPORT char MODULE_EXPORT char
MtxOrb_getkey (Driver *drvthis) MtxOrb_getkey (Driver *drvthis)
{ {
@@ -1345,31 +1350,6 @@ MtxOrb_ask_bar (Driver *drvthis, int type)
return (pos); return (pos);
} }
/******************************
* Does the heartbeat...
*/
MODULE_EXPORT void
MtxOrb_heartbeat (Driver *drvthis, int type)
{
int whichIcon;
PrivateData * p = drvthis->private_data;
if (type == HEARTBEAT_ON) {
/* Set this to pulsate like a real heart beat... */
whichIcon = (! ((p->timer + 4) & 5));
/* Ask for the right heartbeat icon... */
MtxOrb_icon (drvthis, p->width, 1, whichIcon);
/* change display... */
MtxOrb_flush (drvthis);
}
p->timer++;
p->timer &= 0x0f;
}
/****************************** /******************************
* Sets up a well known character for use. * Sets up a well known character for use.
*/ */
+1 -2
View File
@@ -12,7 +12,6 @@ MODULE_EXPORT void MtxOrb_flush (Driver *drvthis);
MODULE_EXPORT void MtxOrb_string (Driver *drvthis, int x, int y, char *string); MODULE_EXPORT void MtxOrb_string (Driver *drvthis, int x, int y, char *string);
MODULE_EXPORT void MtxOrb_chr (Driver *drvthis, int x, int y, char c); MODULE_EXPORT void MtxOrb_chr (Driver *drvthis, int x, int y, char c);
MODULE_EXPORT void MtxOrb_heartbeat (Driver *drvthis, int type);
MODULE_EXPORT void MtxOrb_set_char (Driver *drvthis, int n, char *dat); MODULE_EXPORT void MtxOrb_set_char (Driver *drvthis, int n, char *dat);
MODULE_EXPORT int MtxOrb_get_contrast (Driver *drvthis); MODULE_EXPORT int MtxOrb_get_contrast (Driver *drvthis);
@@ -25,7 +24,7 @@ MODULE_EXPORT char * MtxOrb_get_info (Driver *drvthis);
MODULE_EXPORT void MtxOrb_num (Driver *drvthis, int x, int num); MODULE_EXPORT void MtxOrb_num (Driver *drvthis, int x, int num);
MODULE_EXPORT void MtxOrb_icon (Driver *drvthis, int x, int y, int icon); MODULE_EXPORT int MtxOrb_icon (Driver *drvthis, int x, int y, int icon);
MODULE_EXPORT void MtxOrb_vbar (Driver * drvthis, int x, int y, int len, int promille, int options); MODULE_EXPORT void MtxOrb_vbar (Driver * drvthis, int x, int y, int len, int promille, int options);
MODULE_EXPORT void MtxOrb_hbar (Driver * drvthis, int x, int y, int len, int promille, int options); MODULE_EXPORT void MtxOrb_hbar (Driver * drvthis, int x, int y, int len, int promille, int options);
+4 -1
View File
@@ -780,14 +780,17 @@ bayrad_hbar(Driver * drvthis, int x, int y, int len, int promille, int options)
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// Places an icon on screen // Places an icon on screen
// //
MODULE_EXPORT void MODULE_EXPORT int
bayrad_icon(Driver * drvthis, int x, int y, int icon) bayrad_icon(Driver * drvthis, int x, int y, int icon)
{ {
switch( icon ) { switch( icon ) {
case ICON_BLOCK_FILLED: case ICON_BLOCK_FILLED:
bayrad_chr( drvthis, x, y, 0xFF ); bayrad_chr( drvthis, x, y, 0xFF );
break; break;
default:
return -1; /* Let the core do other icons */
} }
return 0;
} }
+1 -1
View File
@@ -21,7 +21,7 @@ MODULE_EXPORT void bayrad_chr(Driver * drvthis, int x, int y, char c);
MODULE_EXPORT void bayrad_vbar(Driver * drvthis, int x, int y, int len, int promille, int options); MODULE_EXPORT void bayrad_vbar(Driver * drvthis, int x, int y, int len, int promille, int options);
MODULE_EXPORT void bayrad_hbar(Driver * drvthis, int x, int y, int len, int promille, int options); MODULE_EXPORT void bayrad_hbar(Driver * drvthis, int x, int y, int len, int promille, int options);
MODULE_EXPORT void bayrad_icon(Driver * drvthis, int x, int y, int icon); MODULE_EXPORT int bayrad_icon(Driver * drvthis, int x, int y, int icon);
MODULE_EXPORT void bayrad_set_char(Driver * drvthis, int n, char *dat); MODULE_EXPORT void bayrad_set_char(Driver * drvthis, int n, char *dat);
+7 -14
View File
@@ -540,7 +540,7 @@ curses_drv_hbar (Driver *drvthis, int x, int y, int len, int promille, int optio
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// Sets character 0 to an icon... // Sets character 0 to an icon...
// //
MODULE_EXPORT void MODULE_EXPORT int
curses_drv_icon (Driver *drvthis, int x, int y, int icon) curses_drv_icon (Driver *drvthis, int x, int y, int icon)
{ {
char ch1 = '?'; char ch1 = '?';
@@ -550,19 +550,11 @@ curses_drv_icon (Driver *drvthis, int x, int y, int icon)
case ICON_BLOCK_FILLED: ch1 = ACS_BLOCK; break; case ICON_BLOCK_FILLED: ch1 = ACS_BLOCK; break;
case ICON_HEART_OPEN: ch1 = '-'; break; case ICON_HEART_OPEN: ch1 = '-'; break;
case ICON_HEART_FILLED: ch1 = '+'; break; case ICON_HEART_FILLED: ch1 = '+'; break;
case ICON_ARROW_UP: ch1 = '^'; break; /* or does curses do real arrows ? */ case ICON_ARROW_UP: ch1 = ACS_UARROW; break;
case ICON_ARROW_DOWN: ch1 = 'v'; break; case ICON_ARROW_DOWN: ch1 = ACS_DARROW; break;
case ICON_ARROW_LEFT: ch1 = '<'; break; case ICON_ARROW_LEFT: ch1 = ACS_LARROW; break;
case ICON_ARROW_RIGHT: ch1 = '>'; break; case ICON_ARROW_RIGHT: ch1 = ACS_RARROW; break;
case ICON_STOP: ch1 = '['; ch2 = ']'; break; default: return -1; /* Let the core do it */
case ICON_PAUSE: ch1 = '|'; ch2 = '|'; break;
case ICON_PLAY: ch1 = '>'; ch2 = ' '; break;
case ICON_PLAYR: ch1 = '<'; ch2 = ' '; break;
case ICON_FF: ch1 = '>'; ch2 = '>'; break;
case ICON_FR: ch1 = '<'; ch2 = '<'; break;
case ICON_NEXT: ch1 = '>'; ch2 = '|'; break;
case ICON_PREV: ch1 = '|'; ch2 = '<'; break;
case ICON_REC: ch1 = '('; ch2 = ')'; break;
} }
curses_drv_chr( drvthis, x, y, ch1); curses_drv_chr( drvthis, x, y, ch1);
if (ch2) { if (ch2) {
@@ -572,6 +564,7 @@ curses_drv_icon (Driver *drvthis, int x, int y, int icon)
/* There was something with placing PAD /* There was something with placing PAD
* What wasthat ever for ? * What wasthat ever for ?
*/ */
return 0;
} }
////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////
+1 -1
View File
@@ -16,7 +16,7 @@ MODULE_EXPORT void curses_drv_vbar (Driver *drvthis, int x, int y, int len, int
MODULE_EXPORT void curses_drv_hbar (Driver *drvthis, int x, int y, int len, int promille, int options); MODULE_EXPORT void curses_drv_hbar (Driver *drvthis, int x, int y, int len, int promille, int options);
MODULE_EXPORT void curses_drv_num (Driver *drvthis, int x, int num); MODULE_EXPORT void curses_drv_num (Driver *drvthis, int x, int num);
MODULE_EXPORT void curses_drv_heartbeat (Driver *drvthis, int type); MODULE_EXPORT void curses_drv_heartbeat (Driver *drvthis, int type);
MODULE_EXPORT void curses_drv_icon (Driver *drvthis, int x, int y, int icon); MODULE_EXPORT int curses_drv_icon (Driver *drvthis, int x, int y, int icon);
MODULE_EXPORT void curses_drv_backlight (Driver *drvthis, int on); MODULE_EXPORT void curses_drv_backlight (Driver *drvthis, int on);
+1 -1
View File
@@ -238,7 +238,7 @@ debug_hbar (Driver *drvthis, int x, int y, int len, int promille, int options)
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// Sets character 0 to an icon... // Sets character 0 to an icon...
// //
MODULE_EXPORT void MODULE_EXPORT int
debug_icon (Driver *drvthis, int x, int y, int icon) debug_icon (Driver *drvthis, int x, int y, int icon)
{ {
report (RPT_INFO, "icon(%i,%i,%i)", x, y, icon); report (RPT_INFO, "icon(%i,%i,%i)", x, y, icon);
+1 -1
View File
@@ -15,7 +15,7 @@ MODULE_EXPORT void debug_chr (Driver *drvthis, int x, int y, char c);
MODULE_EXPORT void debug_vbar (Driver *drvthis, int x, int y, int len, int promille, int options); MODULE_EXPORT void debug_vbar (Driver *drvthis, int x, int y, int len, int promille, int options);
MODULE_EXPORT void debug_hbar (Driver *drvthis, int x, int y, int len, int promille, int options); MODULE_EXPORT void debug_hbar (Driver *drvthis, int x, int y, int len, int promille, int options);
MODULE_EXPORT void debug_num (Driver *drvthis, int x, int num); MODULE_EXPORT void debug_num (Driver *drvthis, int x, int num);
MODULE_EXPORT void debug_icon (Driver *drvthis, int x, int y, int icon); MODULE_EXPORT int debug_icon (Driver *drvthis, int x, int y, int icon);
MODULE_EXPORT void debug_set_char (Driver *drvthis, int n, char *dat); MODULE_EXPORT void debug_set_char (Driver *drvthis, int n, char *dat);
+10 -4
View File
@@ -502,7 +502,7 @@ glk_set_char(Driver *drvthis, int n, char *dat)
// Draws a vertical bar, from the bottom of the screen up. // Draws a vertical bar, from the bottom of the screen up.
// //
MODULE_EXPORT void MODULE_EXPORT void
glk_vbar(Driver *drvthis, int x, int len) glk_old_vbar(Driver *drvthis, int x, int len)
{ {
int y = height ; int y = height ;
@@ -533,7 +533,7 @@ glk_vbar(Driver *drvthis, int x, int len)
// Draws a horizontal bar to the right. // Draws a horizontal bar to the right.
// //
MODULE_EXPORT void MODULE_EXPORT void
glk_hbar(Driver *drvthis, int x, int y, int len) glk_old_hbar(Driver *drvthis, int x, int y, int len)
{ {
// printf( "glk_hbar( %d, %d, %d )\n", x, y, len ); // printf( "glk_hbar( %d, %d, %d )\n", x, y, len );
while( len > cellwidth ) { while( len > cellwidth ) {
@@ -561,8 +561,11 @@ glk_hbar(Driver *drvthis, int x, int y, int len)
// Sets character 0 to an icon... // Sets character 0 to an icon...
// //
MODULE_EXPORT void MODULE_EXPORT void
glk_icon(Driver *drvthis, int which, char dest) glk_old_icon(Driver *drvthis, int which, int dest)
{ {
/* TODO IMPLEMENTATION OF NEW API */
/* any volonteers ? */
unsigned char old, new ; unsigned char old, new ;
unsigned char * p ; unsigned char * p ;
unsigned char * q ; unsigned char * q ;
@@ -610,8 +613,11 @@ glk_icon(Driver *drvthis, int which, char dest)
// Return 0 for "nothing available". // Return 0 for "nothing available".
// //
MODULE_EXPORT char MODULE_EXPORT char
glk_getkey(Driver *drvthis) glk_old_getkey(Driver *drvthis)
{ {
/* NOTE THAT THIS CODE IS NOT USED IN THE NEW API */
/* It uses get_key instead, returning a string */
int c ; int c ;
static int key = -1 ; static int key = -1 ;
static struct timeval lastkey ; static struct timeval lastkey ;
+3 -3
View File
@@ -12,10 +12,10 @@ MODULE_EXPORT void glk_flush(Driver *drvthis);
MODULE_EXPORT void glk_string(Driver *drvthis, int x, int y, char string[]); MODULE_EXPORT void glk_string(Driver *drvthis, int x, int y, char string[]);
MODULE_EXPORT void glk_chr(Driver *drvthis, int x, int y, char c); MODULE_EXPORT void glk_chr(Driver *drvthis, int x, int y, char c);
MODULE_EXPORT void glk_vbar(Driver *drvthis, int x, int len); MODULE_EXPORT void glk_old_vbar(Driver *drvthis, int x, int len);
MODULE_EXPORT void glk_hbar(Driver *drvthis, int x, int y, int len); MODULE_EXPORT void glk_old_hbar(Driver *drvthis, int x, int y, int len);
MODULE_EXPORT void glk_num(Driver *drvthis, int x, int num); MODULE_EXPORT void glk_num(Driver *drvthis, int x, int num);
MODULE_EXPORT void glk_icon(Driver *drvthis, int which, char dest); MODULE_EXPORT void glk_old_icon(Driver *drvthis, int which, int dest);
MODULE_EXPORT void glk_set_char(Driver *drvthis, int n, char *dat); MODULE_EXPORT void glk_set_char(Driver *drvthis, int n, char *dat);
+75 -33
View File
@@ -921,36 +921,6 @@ HD44780_num (Driver *drvthis, int x, int num)
} }
} }
/////////////////////////////////////////////////////////////
// Does the heartbeat...
//
MODULE_EXPORT void
HD44780_heartbeat (Driver *drvthis, int type)
{
PrivateData *p = (PrivateData *) drvthis->private_data;
static int timer = 0;
int whichIcon;
static int saved_type = HEARTBEAT_ON;
if (type)
saved_type = type;
if (type == HEARTBEAT_ON) {
/* Set this to pulsate like a real heart beat... */
if( ((timer + 4) & 5))
whichIcon = ICON_HEART_OPEN;
else
whichIcon = ICON_HEART_FILLED;
/* place the icon */
HD44780_icon (drvthis, p->width, 1, whichIcon);
}
timer++;
timer &= 0x0f;
}
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// Sets a custom character from 0-7... // Sets a custom character from 0-7...
// //
@@ -986,7 +956,7 @@ HD44780_set_char (Driver *drvthis, int n, char *dat)
///////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////
// Set default icon into a userdef char // Set default icon into a userdef char
// //
MODULE_EXPORT void MODULE_EXPORT int
HD44780_icon (Driver *drvthis, int x, int y, int icon) HD44780_icon (Driver *drvthis, int x, int y, int icon)
{ {
char heart_open[] = { char heart_open[] = {
@@ -998,7 +968,6 @@ HD44780_icon (Driver *drvthis, int x, int y, int icon)
1, 0, 0, 0, 1, 1, 0, 0, 0, 1,
1, 1, 0, 1, 1, 1, 1, 0, 1, 1,
1, 1, 1, 1, 1 }; 1, 1, 1, 1, 1 };
char heart_filled[] = { char heart_filled[] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 0, 1, 0, 1, 1, 0, 1, 0, 1,
@@ -1008,7 +977,53 @@ HD44780_icon (Driver *drvthis, int x, int y, int icon)
1, 0, 1, 0, 1, 1, 0, 1, 0, 1,
1, 1, 0, 1, 1, 1, 1, 0, 1, 1,
1, 1, 1, 1, 1 }; 1, 1, 1, 1, 1 };
char arrow_up[] = {
0, 0, 1, 0, 0,
0, 1, 1, 1, 0,
1, 0, 1, 0, 1,
0, 0, 1, 0, 0,
0, 0, 1, 0, 0,
0, 0, 1, 0, 0,
0, 0, 1, 0, 0,
0, 0, 0, 0, 0 };
char arrow_down[] = {
0, 0, 1, 0, 0,
0, 0, 1, 0, 0,
0, 0, 1, 0, 0,
0, 0, 1, 0, 0,
1, 0, 1, 0, 1,
0, 1, 1, 1, 0,
0, 0, 1, 0, 0,
0, 0, 0, 0, 0 };
char checkbox_off[] = {
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
1, 1, 1, 1, 1,
1, 0, 0, 0, 1,
1, 0, 0, 0, 1,
1, 0, 0, 0, 1,
1, 1, 1, 1, 1,
0, 0, 0, 0, 0 };
char checkbox_on[] = {
0, 0, 1, 0, 0,
0, 0, 1, 0, 0,
1, 1, 1, 0, 1,
1, 0, 1, 1, 0,
1, 0, 1, 0, 1,
1, 0, 0, 0, 1,
1, 1, 1, 1, 1,
0, 0, 0, 0, 0 };
char checkbox_gray[] = {
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
1, 1, 1, 1, 1,
1, 0, 1, 0, 1,
1, 1, 0, 1, 1,
1, 0, 1, 0, 1,
1, 1, 1, 1, 1,
0, 0, 0, 0, 0 };
/* Yes I know, this is a VERY BAD implementation */
switch( icon ) { switch( icon ) {
case ICON_BLOCK_FILLED: case ICON_BLOCK_FILLED:
HD44780_chr( drvthis, x, y, 255 ); HD44780_chr( drvthis, x, y, 255 );
@@ -1021,9 +1036,36 @@ HD44780_icon (Driver *drvthis, int x, int y, int icon)
HD44780_set_char( drvthis, 0, heart_open ); HD44780_set_char( drvthis, 0, heart_open );
HD44780_chr( drvthis, x, y, 0 ); HD44780_chr( drvthis, x, y, 0 );
break; break;
case ICON_ARROW_UP:
HD44780_set_char( drvthis, 1, arrow_up );
HD44780_chr( drvthis, x, y, 1 );
break;
case ICON_ARROW_DOWN:
HD44780_set_char( drvthis, 2, arrow_down );
HD44780_chr( drvthis, x, y, 2 );
break;
case ICON_ARROW_LEFT:
HD44780_chr( drvthis, x, y, 0x7F );
break;
case ICON_ARROW_RIGHT:
HD44780_chr( drvthis, x, y, 0x7E );
break;
case ICON_CHECKBOX_OFF:
HD44780_set_char( drvthis, 3, checkbox_off );
HD44780_chr( drvthis, x, y, 3 );
break;
case ICON_CHECKBOX_ON:
HD44780_set_char( drvthis, 4, checkbox_on );
HD44780_chr( drvthis, x, y, 4 );
break;
case ICON_CHECKBOX_GRAY:
HD44780_set_char( drvthis, 5, checkbox_gray );
HD44780_chr( drvthis, x, y, 5 );
break;
default: default:
report( RPT_WARNING, "HD44780_icon: unknown or unsupported icon: %d", icon ); return -1; /* Let the core do other icons */
} }
return 0;
} }
///////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////
+1 -2
View File
@@ -30,8 +30,7 @@ MODULE_EXPORT void HD44780_chr (Driver *drvthis, int x, int y, char ch);
MODULE_EXPORT void HD44780_vbar (Driver *drvthis, int x, int y, int len, int promille, int options); MODULE_EXPORT void HD44780_vbar (Driver *drvthis, int x, int y, int len, int promille, int options);
MODULE_EXPORT void HD44780_hbar (Driver *drvthis, int x, int y, int len, int promille, int options); MODULE_EXPORT void HD44780_hbar (Driver *drvthis, int x, int y, int len, int promille, int options);
MODULE_EXPORT void HD44780_num (Driver *drvthis, int x, int num); MODULE_EXPORT void HD44780_num (Driver *drvthis, int x, int num);
MODULE_EXPORT void HD44780_heartbeat (Driver *drvthis, int type); MODULE_EXPORT int HD44780_icon (Driver *drvthis, int x, int y, int icon);
MODULE_EXPORT void HD44780_icon (Driver *drvthis, int x, int y, int icon);
MODULE_EXPORT void HD44780_set_char (Driver *drvthis, int n, char *dat); MODULE_EXPORT void HD44780_set_char (Driver *drvthis, int n, char *dat);
+3 -12
View File
@@ -353,7 +353,7 @@ icp_a106_num (Driver *drvthis, int x, int num)
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// Sets character 0 to an icon... // Sets character 0 to an icon...
// //
MODULE_EXPORT void MODULE_EXPORT int
icp_a106_icon (Driver *drvthis, int x, int y, int icon) icp_a106_icon (Driver *drvthis, int x, int y, int icon)
{ {
switch( icon ) switch( icon )
@@ -366,16 +366,7 @@ icp_a106_icon (Driver *drvthis, int x, int y, int icon)
case ICON_HEART_OPEN: case ICON_HEART_OPEN:
break; break;
default: default:
report( RPT_WARNING, "icp_a106_icon: unknown or unsupported icon: %d", icon ); return -1;
} }
return 0;
} }
/////////////////////////////////////////////////////////////
// Does the heartbeat...
//
MODULE_EXPORT void
icp_a106_heartbeat (Driver *drvthis, int type)
{
}
+1 -2
View File
@@ -44,8 +44,7 @@ MODULE_EXPORT void icp_a106_chr (Driver *drvthis, int x, int y, char ch);
MODULE_EXPORT void icp_a106_vbar (Driver *drvthis, int x, int y, int len, int promille, int options); MODULE_EXPORT void icp_a106_vbar (Driver *drvthis, int x, int y, int len, int promille, int options);
MODULE_EXPORT void icp_a106_hbar (Driver *drvthis, int x, int y, int len, int promille, int options); MODULE_EXPORT void icp_a106_hbar (Driver *drvthis, int x, int y, int len, int promille, int options);
MODULE_EXPORT void icp_a106_num (Driver *drvthis, int x, int num); MODULE_EXPORT void icp_a106_num (Driver *drvthis, int x, int num);
MODULE_EXPORT void icp_a106_heartbeat (Driver *drvthis, int type); MODULE_EXPORT int icp_a106_icon (Driver *drvthis, int x, int y, int icon);
MODULE_EXPORT void icp_a106_icon (Driver *drvthis, int x, int y, int icon);
#define DEFAULT_DEVICE "/dev/lcd" #define DEFAULT_DEVICE "/dev/lcd"
+37 -38
View File
@@ -601,45 +601,44 @@ LB216_set_char(Driver * drvthis, int n, char *dat)
} }
} }
MODULE_EXPORT void MODULE_EXPORT int
LB216_icon(Driver * drvthis, int which, char dest) LB216_icon(Driver * drvthis, int x, int y, int icon)
{ {
char icons[3][8*8] = { static char heart_open[] = {
{ 1, 1, 1, 1, 1,
1,1,1,1,1, // Empty Heart 1, 0, 1, 0, 1,
1,0,1,0,1, 0, 0, 0, 0, 0,
0,0,0,0,0, 0, 0, 0, 0, 0,
0,0,0,0,0, 0, 0, 0, 0, 0,
0,0,0,0,0, 1, 0, 0, 0, 1,
1,0,0,0,1, 1, 1, 0, 1, 1,
1,1,0,1,1, 1, 1, 1, 1, 1 };
1,1,1,1,1,
},
{ static char heart_filled[] = {
1,1,1,1,1, // Filled Heart 1, 1, 1, 1, 1,
1,0,1,0,1, 1, 0, 1, 0, 1,
0,1,0,1,0, 0, 1, 0, 1, 0,
0,1,1,1,0, 0, 1, 1, 1, 0,
0,1,1,1,0, 0, 1, 1, 1, 0,
1,0,1,0,1, 1, 0, 1, 0, 1,
1,1,0,1,1, 1, 1, 0, 1, 1,
1,1,1,1,1, 1, 1, 1, 1, 1 };
},
{ switch( icon )
0,0,0,0,0, // Ellipsis {
0,0,0,0,0, case ICON_BLOCK_FILLED:
0,0,0,0,0, LB216_chr( drvthis, x, y, 255 );
0,0,0,0,0, break;
0,0,0,0,0, case ICON_HEART_FILLED:
0,0,0,0,0, LB216_set_char( drvthis, 0, heart_filled );
0,0,0,0,0, LB216_chr( drvthis, x, y, 0 );
1,0,1,0,1, break;
}, case ICON_HEART_OPEN:
LB216_set_char( drvthis, 0, heart_open );
}; LB216_chr( drvthis, x, y, 0 );
break;
if(custom==bign) custom=beat; default:
LB216_set_char(drvthis, dest, &icons[which][0]); return -1;
}
return 0;
} }
+3 -3
View File
@@ -12,10 +12,10 @@ MODULE_EXPORT void LB216_flush(Driver * drvthis);
MODULE_EXPORT void LB216_string (Driver * drvthis, int x, int y, char string[]); MODULE_EXPORT void LB216_string (Driver * drvthis, int x, int y, char string[]);
MODULE_EXPORT void LB216_chr(Driver * drvthis, int x, int y, char c) ; MODULE_EXPORT void LB216_chr(Driver * drvthis, int x, int y, char c) ;
MODULE_EXPORT void LB216_vbar(Driver * drvthis, int x, int len); MODULE_EXPORT void LB216_old_vbar(Driver * drvthis, int x, int len);
MODULE_EXPORT void LB216_hbar(Driver * drvthis, int x, int y, int len); MODULE_EXPORT void LB216_old_hbar(Driver * drvthis, int x, int y, int len);
MODULE_EXPORT void LB216_num(Driver * drvthis, int x, int num); MODULE_EXPORT void LB216_num(Driver * drvthis, int x, int num);
MODULE_EXPORT void LB216_icon(Driver * drvthis, int which, char dest); MODULE_EXPORT int LB216_icon(Driver * drvthis, int x, int y, int icon);
MODULE_EXPORT void LB216_set_char(Driver * drvthis, int n, char *dat); MODULE_EXPORT void LB216_set_char(Driver * drvthis, int n, char *dat);
+32 -9
View File
@@ -14,6 +14,10 @@
* There should be no further interaction between driver and server core * There should be no further interaction between driver and server core
* other that via this API. * other that via this API.
* *
* Driver writer notes
* ~~~~~~~~~~~~~~~~~~~
* See documentation in the docs/lcdproc-devel directory.
*
* DO NOT MIX DRIVER ALLOCATED AND CORE ALLOCATED MEMORY. * DO NOT MIX DRIVER ALLOCATED AND CORE ALLOCATED MEMORY.
* With this I mean that the server core should NEVER WRITE in memory * With this I mean that the server core should NEVER WRITE in memory
* allocated by the driver, and vice versa. Also the driver resp. core * allocated by the driver, and vice versa. Also the driver resp. core
@@ -42,6 +46,9 @@
#define BACKLIGHT_WARNING 2 #define BACKLIGHT_WARNING 2
#define BACKLIGHT_RED_ALERT 3 #define BACKLIGHT_RED_ALERT 3
/* Icons. If a driver does not support an icon, it can return -1 from the
* icon function, and let the core place a replacement character.
*/
/* Icons below are one character wide */ /* Icons below are one character wide */
#define ICON_BLOCK_FILLED 0x100 #define ICON_BLOCK_FILLED 0x100
#define ICON_HEART_OPEN 0x108 #define ICON_HEART_OPEN 0x108
@@ -50,6 +57,12 @@
#define ICON_ARROW_DOWN 0x111 #define ICON_ARROW_DOWN 0x111
#define ICON_ARROW_LEFT 0x112 #define ICON_ARROW_LEFT 0x112
#define ICON_ARROW_RIGHT 0x113 #define ICON_ARROW_RIGHT 0x113
#define ICON_CHECKBOX_OFF 0x120
#define ICON_CHECKBOX_ON 0x121
#define ICON_CHECKBOX_GRAY 0x122
#define ICON_SELECTOR_AT_LEFT 0x128
#define ICON_SELECTOR_AT_RIGHT 0x129
#define ICON_ELLIPSIS 0x130
/* Icons below are two characters wide */ /* Icons below are two characters wide */
#define ICON_STOP 0x200 /* should look like [] */ #define ICON_STOP 0x200 /* should look like [] */
@@ -62,17 +75,27 @@
#define ICON_PREV 0x207 /* should look like |< */ #define ICON_PREV 0x207 /* should look like |< */
#define ICON_REC 0x208 /* should look like () */ #define ICON_REC 0x208 /* should look like () */
/* Heartbeat data, taken from render.h */ /* Icon numbers from 0 to 0x0FF could be used for client defined chars.
/* ??? What does OPEN mean here ? */ * However this is not implemented and there are no crystalized ideas
* about how to do it. get_free_chars and set_char should be used, but a
* lot of things in that area might need to be changed.
*/
/* Heartbeat data */
#define HEARTBEAT_OFF 0 #define HEARTBEAT_OFF 0
#define HEARTBEAT_ON 1 #define HEARTBEAT_ON 1
#define HEARTBEAT_OPEN 2
/* Patterns for hbar / vbar */ /* Patterns for hbar / vbar, mostly (if not all) UNIMPLEMENTED */
#define BAR_POS 0x001 /* default */ #define BAR_POS 0x001 /* default
#define BAR_NEG 0x002 Promilles allowed: 0 to 1000
#define BAR_POS_AND_NEG 0x003 The zero-point is at the left or bottom */
#define BAR_PATTERN_FILLED 0x000 #define BAR_NEG 0x002 /* the bar grows in negative direction
Promilles allowed: -1000 to 0
The zero-point is at the left or top */
#define BAR_POS_AND_NEG 0x003 /* the bars can grow in both directions
Promilles allowed: -1000 to 1000
The zero-point is in the center */
#define BAR_PATTERN_FILLED 0x000 /* default */
#define BAR_PATTERN_OPEN 0x010 #define BAR_PATTERN_OPEN 0x010
#define BAR_PATTERN_STRIPED 0x020 #define BAR_PATTERN_STRIPED 0x020
#define BAR_WITH_PERCENTAGE 0x100 #define BAR_WITH_PERCENTAGE 0x100
@@ -122,7 +145,7 @@ typedef struct lcd_logical_driver {
void (*hbar) (struct lcd_logical_driver* drvthis, int x, int y, int len, int promille, int pattern); void (*hbar) (struct lcd_logical_driver* drvthis, int x, int y, int len, int promille, int pattern);
void (*num) (struct lcd_logical_driver* drvthis, int x, int num); void (*num) (struct lcd_logical_driver* drvthis, int x, int num);
void (*heartbeat) (struct lcd_logical_driver* drvthis, int state); void (*heartbeat) (struct lcd_logical_driver* drvthis, int state);
void (*icon) (struct lcd_logical_driver* drvthis, int x, int y, int icon); int (*icon) (struct lcd_logical_driver* drvthis, int x, int y, int icon);
void (*cursor) (struct lcd_logical_driver* drvthis, int x, int y, int state); void (*cursor) (struct lcd_logical_driver* drvthis, int x, int y, int state);
/* Userdef characters, are those still supported ? */ /* Userdef characters, are those still supported ? */
-37
View File
@@ -113,43 +113,6 @@ insert_chr_framebuf (struct lcd_logical_driver *driver, int x, int y, char c) {
} }
*/ */
void
output_heartbeat (struct lcd_logical_driver *driver, int type) {
static int timer = 0;
int whichIcon;
static int saved_type = HEARTBEAT_ON;
if (type)
saved_type = type;
if (type == HEARTBEAT_ON) {
// Set this to pulsate like a real heart beat...
if ( (timer + 4) & 5 ) {
whichIcon = ICON_HEART_OPEN;
}
else {
whichIcon = ICON_HEART_FILLED;
}
driver->icon (driver, driver->width(driver), 1, whichIcon);
/* OLD CODE
// This defines a custom character EVERY time...
// not efficient... is this necessary?
driver->icon (driver, whichIcon, 0);
// Put character on screen...
driver->chr (driver, driver->wid, 1, 0);
*/
// change display...
//driver->flush (driver);
}
timer++;
timer &= 0x0f;
}
void void
lib_hbar_static (Driver *drvthis, int x, int y, int len, int promille, int options, int cellwidth, int cc_offset) lib_hbar_static (Driver *drvthis, int x, int y, int len, int promille, int options, int cellwidth, int cc_offset)
-1
View File
@@ -7,7 +7,6 @@
int new_framebuf (struct lcd_logical_driver *driver, char *oldbuf); int new_framebuf (struct lcd_logical_driver *driver, char *oldbuf);
void output_heartbeat (struct lcd_logical_driver *driver, int type);
void lib_hbar_static (Driver *drvthis, int x, int y, int len, int promille, int options, int cellwidth, int cc_offset); void lib_hbar_static (Driver *drvthis, int x, int y, int len, int promille, int options, int cellwidth, int cc_offset);
void lib_vbar_static (Driver *drvthis, int x, int y, int len, int promille, int options, int cellheight, int cc_offset); void lib_vbar_static (Driver *drvthis, int x, int y, int len, int promille, int options, int cellheight, int cc_offset);
+6 -93
View File
@@ -78,47 +78,6 @@ MODULE_EXPORT int stay_in_foreground = 0;
MODULE_EXPORT int supports_multiple = 0; MODULE_EXPORT int supports_multiple = 0;
MODULE_EXPORT char *symbol_prefix = "lcdm001_"; MODULE_EXPORT char *symbol_prefix = "lcdm001_";
static char num_icon [10][4][3] = {{{' ','_',' '}, /*0*/
{'|',' ','|'},
{'|','_','|'},
{' ',' ',' '}},
{{' ',' ',' '},/*1*/
{' ',' ','|'},
{' ',' ','|'},
{' ',' ',' '}},
{{' ','_',' '},/*2*/
{' ','_','|'},
{'|','_',' '},
{' ',' ',' '}},
{{' ','_',' '},/*3*/
{' ','_','|'},
{' ','_','|'},
{' ',' ',' '}},
{{' ',' ',' '},/*4*/
{'|','_','|'},
{' ',' ','|'},
{' ',' ',' '}},
{{' ','_',' '},/*5*/
{'|','_',' '},
{' ','_','|'},
{' ',' ',' '}},
{{' ','_',' '},/*6*/
{'|','_',' '},
{'|','_','|'},
{' ',' ',' '}},
{{' ','_',' '},/*7*/
{' ',' ','|'},
{' ',' ','|'},
{' ',' ',' '}},
{{' ','_',' '},/*8*/
{'|','_','|'},
{'|','_','|'},
{' ',' ',' '}},
{{' ','_',' '},/*9*/
{'|','_','|'},
{' ','_','|'},
{' ',' ',' '}}};
static void lcdm001_cursorblink (Driver *drvthis, int on); static void lcdm001_cursorblink (Driver *drvthis, int on);
static char lcdm001_parse_keypad_setting ( Driver *drvthis, char * keyname, char * default_value ); static char lcdm001_parse_keypad_setting ( Driver *drvthis, char * keyname, char * default_value );
@@ -399,7 +358,7 @@ lcdm001_output (Driver *drvthis, int state)
// Draws a vertical bar, from the bottom of the screen up. // Draws a vertical bar, from the bottom of the screen up.
// //
MODULE_EXPORT void MODULE_EXPORT void
lcdm001_vbar(Driver *drvthis, int x, int len) lcdm001_old_vbar(Driver *drvthis, int x, int len)
{ {
int y = 4; int y = 4;
@@ -423,7 +382,7 @@ lcdm001_vbar(Driver *drvthis, int x, int len)
// Draws a horizontal bar to the right. // Draws a horizontal bar to the right.
// //
MODULE_EXPORT void MODULE_EXPORT void
lcdm001_hbar(Driver *drvthis, int x, int y, int len) lcdm001_old_hbar(Driver *drvthis, int x, int y, int len)
{ {
ValidX(x); ValidX(x);
@@ -449,28 +408,11 @@ lcdm001_hbar(Driver *drvthis, int x, int y, int len)
return; return;
} }
/////////////////////////////////////////////////////////////////
// Writes a big number.
//
MODULE_EXPORT void
lcdm001_num (Driver *drvthis, int x, int num)
{
int y, dx;
debug (RPT_DEBUG, "LCDM001: Writing big number \"%d\" at x = %d", num, x);
/*This function uses an ASCII emulation of big numbers*/
for (y = 1; y < 5; y++)
for (dx = 0; dx < 3; dx++)
lcdm001_chr (drvthis, x + dx, y, num_icon[num][y-1][dx]);
}
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// Sets character 0 to an icon... // Sets character 0 to an icon...
// //
MODULE_EXPORT void MODULE_EXPORT void
lcdm001_icon (Driver *drvthis, int which, char dest) lcdm001_old_icon (Driver *drvthis, int which, char dest)
{ {
/*Heartbeat workaround: /*Heartbeat workaround:
@@ -497,6 +439,9 @@ lcdm001_icon (Driver *drvthis, int which, char dest)
// //
// Return 0 for "nothing available". // Return 0 for "nothing available".
// //
/* TODO: write for net API function (get_key) that returns a string */
MODULE_EXPORT char MODULE_EXPORT char
lcdm001_getkey (Driver *drvthis) lcdm001_getkey (Driver *drvthis)
{ {
@@ -514,35 +459,3 @@ lcdm001_getkey (Driver *drvthis)
/*debug: if(in) fprintf(stderr,"key: %c",in); */ /*debug: if(in) fprintf(stderr,"key: %c",in); */
return in; return in;
} }
/////////////////////////////////////////////////////////////
// Does the heartbeat...
//
MODULE_EXPORT void
lcdm001_heartbeat (Driver *drvthis, int type)
{
static int timer = 0;
int whichIcon;
static int saved_type = HEARTBEAT_ON;
if (type)
saved_type = type;
if (type == HEARTBEAT_ON) {
// Set this to pulsate like a real heart beat...
whichIcon = (! ((timer + 4) & 5));
// This defines a custom character EVERY time...
// not efficient... is this necessary?
lcdm001_icon (drvthis, whichIcon, 0);
// Put character on screen...
lcdm001_chr (drvthis, width, 1, 0);
// change display...
lcdm001_flush (drvthis);
}
timer++;
timer &= 0x0f;
}
+3 -4
View File
@@ -42,11 +42,10 @@ MODULE_EXPORT void lcdm001_flush (Driver *drvthis);
MODULE_EXPORT void lcdm001_string (Driver *drvthis, int x, int y, char *string); MODULE_EXPORT void lcdm001_string (Driver *drvthis, int x, int y, char *string);
MODULE_EXPORT void lcdm001_chr (Driver *drvthis, int x, int y, char c); MODULE_EXPORT void lcdm001_chr (Driver *drvthis, int x, int y, char c);
MODULE_EXPORT void lcdm001_vbar (Driver *drvthis, int x, int len); MODULE_EXPORT void lcdm001_old_vbar (Driver *drvthis, int x, int len);
MODULE_EXPORT void lcdm001_hbar (Driver *drvthis, int x, int y, int len); MODULE_EXPORT void lcdm001_old_hbar (Driver *drvthis, int x, int y, int len);
MODULE_EXPORT void lcdm001_num (Driver *drvthis, int x, int num); MODULE_EXPORT void lcdm001_num (Driver *drvthis, int x, int num);
MODULE_EXPORT void lcdm001_icon (Driver *drvthis, int which, char dest); MODULE_EXPORT void lcdm001_old_icon (Driver *drvthis, int which, char dest);
MODULE_EXPORT void lcdm001_heartbeat (Driver *drvthis, int type);
MODULE_EXPORT void lcdm001_output (Driver *drvthis, int on); MODULE_EXPORT void lcdm001_output (Driver *drvthis, int on);
+3 -27
View File
@@ -718,7 +718,7 @@ lcterm_num (Driver *drvthis, int x, int num)
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// Sets character 0 to an icon... // Sets character 0 to an icon...
// //
MODULE_EXPORT void MODULE_EXPORT int
lcterm_icon (Driver *drvthis, int x, int y, int icon) lcterm_icon (Driver *drvthis, int x, int y, int icon)
{ {
static char heart_open[] = { static char heart_open[] = {
@@ -755,32 +755,8 @@ lcterm_icon (Driver *drvthis, int x, int y, int icon)
lcterm_chr( drvthis, x, y, 0 ); lcterm_chr( drvthis, x, y, 0 );
break; break;
default: default:
report( RPT_WARNING, "lcterm_icon: unknown or unsupported icon: %d", icon ); return -1;
} }
} return 0;
/////////////////////////////////////////////////////////////
// Does the heartbeat...
//
MODULE_EXPORT void
lcterm_heartbeat (Driver *drvthis, int type)
{
PrivateData *p = (PrivateData *) drvthis->private_data;
static int timer = 0;
int whichIcon;
if (type == HEARTBEAT_ON)
{
/* Set this to pulsate like a real heart beat... */
if( ((timer + 4) & 5))
whichIcon = ICON_HEART_OPEN;
else
whichIcon = ICON_HEART_FILLED;
/* place the icon */
lcterm_icon (drvthis, p->width, 1, whichIcon);
}
timer++;
} }
+1 -2
View File
@@ -39,8 +39,7 @@ MODULE_EXPORT void lcterm_chr (Driver *drvthis, int x, int y, char ch);
MODULE_EXPORT void lcterm_vbar (Driver *drvthis, int x, int y, int len, int promille, int options); MODULE_EXPORT void lcterm_vbar (Driver *drvthis, int x, int y, int len, int promille, int options);
MODULE_EXPORT void lcterm_hbar (Driver *drvthis, int x, int y, int len, int promille, int options); MODULE_EXPORT void lcterm_hbar (Driver *drvthis, int x, int y, int len, int promille, int options);
MODULE_EXPORT void lcterm_num (Driver *drvthis, int x, int num); MODULE_EXPORT void lcterm_num (Driver *drvthis, int x, int num);
MODULE_EXPORT void lcterm_heartbeat (Driver *drvthis, int type); MODULE_EXPORT int lcterm_icon (Driver *drvthis, int x, int y, int icon);
MODULE_EXPORT void lcterm_icon (Driver *drvthis, int x, int y, int icon);
MODULE_EXPORT void lcterm_set_char (Driver *drvthis, int n, char *dat); MODULE_EXPORT void lcterm_set_char (Driver *drvthis, int n, char *dat);
#define DEFAULT_DEVICE "/dev/lcd" #define DEFAULT_DEVICE "/dev/lcd"
+41 -37
View File
@@ -419,7 +419,7 @@ sed1520_set_char (Driver *drvthis, int n, char *dat)
// framebuffer at 1-based position x. len is given in pixels. // framebuffer at 1-based position x. len is given in pixels.
// //
MODULE_EXPORT void MODULE_EXPORT void
sed1520_vbar (Driver *drvthis, int x, int len) sed1520_old_vbar (Driver *drvthis, int x, int len)
{ {
int i, j, k; int i, j, k;
x--; x--;
@@ -452,7 +452,7 @@ sed1520_vbar (Driver *drvthis, int x, int len)
// x,y into the framebuffer. len is given in pixels. // x,y into the framebuffer. len is given in pixels.
// //
MODULE_EXPORT void MODULE_EXPORT void
sed1520_hbar (Driver *drvthis, int x, int y, int len) sed1520_old_hbar (Driver *drvthis, int x, int y, int len)
{ {
int i; int i;
x--; x--;
@@ -469,41 +469,45 @@ sed1520_hbar (Driver *drvthis, int x, int y, int len)
// Reprogrammes character dest to contain an icon given by // Reprogrammes character dest to contain an icon given by
// which. Calls set_char() to do this. // which. Calls set_char() to do this.
// //
MODULE_EXPORT void MODULE_EXPORT int
sed1520_icon (Driver *drvthis, int which, char dest) sed1520_icon (Driver *drvthis, int x, int y, int icon)
{ {
char icons[3][6 * 8] = { static char heart_open[] = {
{ 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, // Empty Heart 1, 0, 1, 0, 1,
1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1,
1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1,
1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1 };
1, 1, 1, 1, 1, 1,}
, static char heart_filled[] = {
{ 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, // Filled Heart 1, 0, 1, 0, 1,
1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0,
0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0,
0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0,
0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1,
1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1,
1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1 };
1, 1, 1, 1, 1, 1,}
, switch( icon )
{ {
0, 0, 0, 0, 0, 0, // Ellipsis case ICON_BLOCK_FILLED:
0, 0, 0, 0, 0, 0, sed1520_chr( drvthis, x, y, 255 );
0, 0, 0, 0, 0, 0, break;
0, 0, 0, 0, 0, 0, case ICON_HEART_FILLED:
0, 0, 0, 0, 0, 0, sed1520_set_char( drvthis, 0, heart_filled );
0, 0, 0, 0, 0, 0, sed1520_chr( drvthis, x, y, 0 );
0, 0, 0, 0, 0, 0, break;
1, 0, 1, 0, 1, 0,} case ICON_HEART_OPEN:
, sed1520_set_char( drvthis, 0, heart_open );
}; sed1520_chr( drvthis, x, y, 0 );
sed1520_set_char (drvthis, dest, &icons[which][0]); break;
default:
return -1;
}
return 0;
} }
+3 -3
View File
@@ -12,10 +12,10 @@ MODULE_EXPORT void sed1520_flush (Driver *drvthis);
MODULE_EXPORT void sed1520_string (Driver *drvthis, int x, int y, char string[]); MODULE_EXPORT void sed1520_string (Driver *drvthis, int x, int y, char string[]);
MODULE_EXPORT void sed1520_chr (Driver *drvthis, int x, int y, char c); MODULE_EXPORT void sed1520_chr (Driver *drvthis, int x, int y, char c);
MODULE_EXPORT void sed1520_vbar (Driver *drvthis, int x, int len); MODULE_EXPORT void sed1520_old_vbar (Driver *drvthis, int x, int len);
MODULE_EXPORT void sed1520_hbar (Driver *drvthis, int x, int y, int len); MODULE_EXPORT void sed1520_old_hbar (Driver *drvthis, int x, int y, int len);
MODULE_EXPORT void sed1520_num (Driver *drvthis, int x, int num); MODULE_EXPORT void sed1520_num (Driver *drvthis, int x, int num);
MODULE_EXPORT void sed1520_icon (Driver *drvthis, int which, char dest); MODULE_EXPORT int sed1520_icon (Driver *drvthis, int x, int y, int icon);
MODULE_EXPORT void sed1520_set_char (Driver *drvthis, int n, char *dat); MODULE_EXPORT void sed1520_set_char (Driver *drvthis, int n, char *dat);
+3 -3
View File
@@ -601,7 +601,7 @@ stv5730_num (Driver *drvthis, int x, int num)
// framebuffer at 1-based position x. len is given in pixels. // framebuffer at 1-based position x. len is given in pixels.
// //
MODULE_EXPORT void MODULE_EXPORT void
stv5730_vbar (Driver *drvthis, int x, int len) stv5730_old_vbar (Driver *drvthis, int x, int len)
{ {
int i; int i;
@@ -633,7 +633,7 @@ stv5730_vbar (Driver *drvthis, int x, int len)
// It uses the STV5730 'channel-tuning' chars(0x64-0x68) to do // It uses the STV5730 'channel-tuning' chars(0x64-0x68) to do
// this. // this.
MODULE_EXPORT void MODULE_EXPORT void
stv5730_hbar (Driver *drvthis, int x, int y, int len) stv5730_old_hbar (Driver *drvthis, int x, int y, int len)
{ {
int i; int i;
x--; x--;
@@ -665,7 +665,7 @@ stv5730_hbar (Driver *drvthis, int x, int y, int len)
// limited, it doesn't even contain a '%' char. But wait... // limited, it doesn't even contain a '%' char. But wait...
// It contains a heartbeat char ! :-) // It contains a heartbeat char ! :-)
MODULE_EXPORT void MODULE_EXPORT void
stv5730_icon (Driver *drvthis, int which, char dest) stv5730_old_icon (Driver *drvthis, int which, char dest)
{ {
switch (which) switch (which)
{ {
+3 -3
View File
@@ -13,9 +13,9 @@ MODULE_EXPORT void stv5730_clear (Driver *drvthis);
MODULE_EXPORT void stv5730_flush (Driver *drvthis); MODULE_EXPORT void stv5730_flush (Driver *drvthis);
MODULE_EXPORT void stv5730_string (Driver *drvthis, int x, int y, char string[]); MODULE_EXPORT void stv5730_string (Driver *drvthis, int x, int y, char string[]);
MODULE_EXPORT void stv5730_chr (Driver *drvthis, int x, int y, char c); MODULE_EXPORT void stv5730_chr (Driver *drvthis, int x, int y, char c);
MODULE_EXPORT void stv5730_vbar (Driver *drvthis, int x, int len); MODULE_EXPORT void stv5730_old_vbar (Driver *drvthis, int x, int len);
MODULE_EXPORT void stv5730_hbar (Driver *drvthis, int x, int y, int len); MODULE_EXPORT void stv5730_old_hbar (Driver *drvthis, int x, int y, int len);
MODULE_EXPORT void stv5730_num (Driver *drvthis, int x, int num); MODULE_EXPORT void stv5730_num (Driver *drvthis, int x, int num);
MODULE_EXPORT void stv5730_icon (Driver *drvthis, int which, char dest); MODULE_EXPORT void stv5730_old_icon (Driver *drvthis, int which, char dest);
#endif #endif
-20
View File
@@ -434,26 +434,6 @@ svgalib_drv_hbar (Driver *drvthis, int x, int y, int len, int promille, int patt
} }
} }
/******************************************************************************
* Sets character 0 to an icon...
*/
MODULE_EXPORT void
svgalib_drv_icon (Driver *drvthis, int which, char dest)
{
if (dest == 0)
switch (which) {
case 0:
icon_char = '+';
break;
case 1:
icon_char = '*';
break;
default:
icon_char = '#';
break;
}
}
/****************************************************************************** /******************************************************************************
* Return a keypress * Return a keypress
*/ */
-1
View File
@@ -13,7 +13,6 @@ MODULE_EXPORT void svgalib_drv_chr (Driver *drvthis, int x, int y, char c);
MODULE_EXPORT void svgalib_drv_vbar (Driver *drvthis, int x, int y, int len, int promille, int pattern); MODULE_EXPORT void svgalib_drv_vbar (Driver *drvthis, int x, int y, int len, int promille, int pattern);
MODULE_EXPORT void svgalib_drv_hbar (Driver *drvthis, int x, int y, int len, int promille, int pattern); MODULE_EXPORT void svgalib_drv_hbar (Driver *drvthis, int x, int y, int len, int promille, int pattern);
MODULE_EXPORT void svgalib_drv_num (Driver *drvthis, int x, int num); MODULE_EXPORT void svgalib_drv_num (Driver *drvthis, int x, int num);
MODULE_EXPORT void svgalib_drv_icon (Driver *drvthis, int which, char dest);
MODULE_EXPORT char * svgalib_drv_get_key (Driver *drvthis); MODULE_EXPORT char * svgalib_drv_get_key (Driver *drvthis);
+4 -27
View File
@@ -392,10 +392,10 @@ t6963_hbar (Driver *drvthis, int x, int y, int len, int promille, int options)
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// Sets an icon... // Sets an icon...
// //
MODULE_EXPORT void MODULE_EXPORT int
t6963_icon (Driver *drvthis, int x, int y, int icon) t6963_icon (Driver *drvthis, int x, int y, int icon)
{ {
debug (RPT_DEBUG, "T6963: set icon %d", icon); debug (RPT_DEBUG, "T6963: set icon %d", icon);
switch( icon ) { switch( icon ) {
case ICON_BLOCK_FILLED: case ICON_BLOCK_FILLED:
t6963_chr( drvthis, x, y, 220 ); t6963_chr( drvthis, x, y, 220 );
@@ -407,32 +407,9 @@ t6963_icon (Driver *drvthis, int x, int y, int icon)
t6963_chr( drvthis, x, y, 4 ); t6963_chr( drvthis, x, y, 4 );
break; break;
default: default:
report (RPT_WARNING, "T6963: icon type not supported!"); return -1;
} }
} return 0;
/////////////////////////////////////////////////////////////////
// Does the heartbeat
//
MODULE_EXPORT void
t6963_heartbeat (Driver *drvthis, int type)
{
static int timer;
int whichIcon;
static int saved_type = HEARTBEAT_ON;
if (type)
saved_type = type;
if (type == HEARTBEAT_ON) {
// Set this to pulsate like a real heartbeat...
whichIcon = (! ((timer + 4) & 5));
// Put character on screen...
t6963_chr (drvthis, width, 1, 3+whichIcon);
}
timer++;
timer &= 0x0f;
} }
/* ---------------------- internal functions ------------------------------------- */ /* ---------------------- internal functions ------------------------------------- */
+1 -2
View File
@@ -113,8 +113,7 @@ MODULE_EXPORT void t6963_chr (Driver *drvthis, int x, int y, char c);
MODULE_EXPORT void t6963_vbar (Driver *drvthis, int x, int y, int len, int promille, int options); MODULE_EXPORT void t6963_vbar (Driver *drvthis, int x, int y, int len, int promille, int options);
MODULE_EXPORT void t6963_hbar (Driver *drvthis, int x, int y, int len, int promille, int options); MODULE_EXPORT void t6963_hbar (Driver *drvthis, int x, int y, int len, int promille, int options);
MODULE_EXPORT void t6963_num (Driver *drvthis, int x, int num); MODULE_EXPORT void t6963_num (Driver *drvthis, int x, int num);
MODULE_EXPORT void t6963_icon (Driver *drvthis, int x, int y, int icon); MODULE_EXPORT int t6963_icon (Driver *drvthis, int x, int y, int icon);
MODULE_EXPORT void t6963_heartbeat (Driver *drvthis, int type);
MODULE_EXPORT void t6963_set_char (Driver *drvthis, int n, char *dat); MODULE_EXPORT void t6963_set_char (Driver *drvthis, int n, char *dat);
-7
View File
@@ -13,13 +13,6 @@ MODULE_EXPORT void text_string (Driver *drvthis, int x, int y, char string[]);
MODULE_EXPORT void text_chr (Driver *drvthis, int x, int y, char c); MODULE_EXPORT void text_chr (Driver *drvthis, int x, int y, char c);
MODULE_EXPORT void text_set_contrast (Driver *drvthis, int promille); MODULE_EXPORT void text_set_contrast (Driver *drvthis, int promille);
MODULE_EXPORT void text_backlight (Driver *drvthis, int on); MODULE_EXPORT void text_backlight (Driver *drvthis, int on);
//MODULE_EXPORT void text_init_vbar (Driver *drvthis);
//MODULE_EXPORT void text_init_hbar (Driver *drvthis);
//MODULE_EXPORT void text_init_num (Driver *drvthis);
MODULE_EXPORT void text_vbar (Driver *drvthis, int x, int y, int len, int promille, int options);
MODULE_EXPORT void text_hbar (Driver *drvthis, int x, int y, int len, int promille, int options);
MODULE_EXPORT void text_num (Driver *drvthis, int x, int num);
//MODULE_EXPORT void text_set_char (Driver *drvthis, int n, char *dat);
#endif #endif
+18 -4
View File
@@ -435,7 +435,7 @@ sli_init_hbar (Driver *drvthis)
for me to add */ for me to add */
MODULE_EXPORT void MODULE_EXPORT void
sli_vbar (Driver *drvthis, int x, int len) sli_old_vbar (Driver *drvthis, int x, int len)
{ {
char map[9] = { 32, 1, 2, 3, 4, 5, 6, 7, 255 }; char map[9] = { 32, 1, 2, 3, 4, 5, 6, 7, 255 };
@@ -455,7 +455,7 @@ sli_vbar (Driver *drvthis, int x, int len)
// Draws a horizontal bar to the right. // Draws a horizontal bar to the right.
// //
MODULE_EXPORT void MODULE_EXPORT void
sli_hbar (Driver *drvthis, int x, int y, int len) sli_old_hbar (Driver *drvthis, int x, int y, int len)
{ {
char map[6] = { 32, 1, 2, 3, 4, 255 }; char map[6] = { 32, 1, 2, 3, 4, 255 };
@@ -513,7 +513,7 @@ sli_set_char (Driver *drvthis, int n, char *dat)
} }
MODULE_EXPORT void MODULE_EXPORT void
sli_icon (Driver *drvthis, int which, char dest) sli_old_icon (Driver *drvthis, int x, int y, int icon)
{ {
char icons[3][5 * 8] = { char icons[3][5 * 8] = {
{ {
@@ -553,6 +553,20 @@ sli_icon (Driver *drvthis, int which, char dest)
if (custom == bign) if (custom == bign)
custom = beat; custom = beat;
sli_set_char (drvthis, dest, &icons[which][0]); switch( icon ) {
case ICON_BLOCK_FILLED:
CFontz_chr( drvthis, x, y, 255 );
break;
case ICON_HEART_FILLED:
CFontz_set_char( drvthis, 0, icons[1] );
CFontz_chr( drvthis, x, y, 0 );
break;
case ICON_HEART_OPEN:
CFontz_set_char( drvthis, 0, icons[0] );
CFontz_chr( drvthis, x, y, 0 );
break;
default:
return -1;
}
} }
+3 -3
View File
@@ -18,10 +18,10 @@ MODULE_EXPORT void sli_flush (Driver *drvthis);
MODULE_EXPORT void sli_string (Driver *drvthis, int x, int y, char *string); MODULE_EXPORT void sli_string (Driver *drvthis, int x, int y, char *string);
MODULE_EXPORT void sli_chr (Driver *drvthis, int x, int y, char c); MODULE_EXPORT void sli_chr (Driver *drvthis, int x, int y, char c);
MODULE_EXPORT void sli_vbar (Driver *drvthis, int x, int len); MODULE_EXPORT void sli_old_vbar (Driver *drvthis, int x, int len);
MODULE_EXPORT void sli_hbar (Driver *drvthis, int x, int y, int len); MODULE_EXPORT void sli_old_hbar (Driver *drvthis, int x, int y, int len);
MODULE_EXPORT void sli_num (Driver *drvthis, int x, int num); MODULE_EXPORT void sli_num (Driver *drvthis, int x, int num);
MODULE_EXPORT void sli_icon (Driver *drvthis, int which, char dest); MODULE_EXPORT void sli_old_icon (Driver *drvthis, int which, char dest);
MODULE_EXPORT void sli_set_char (Driver *drvthis, int n, char *dat); MODULE_EXPORT void sli_set_char (Driver *drvthis, int n, char *dat);
+6 -1
View File
@@ -48,7 +48,12 @@ struct icontable {
{ICON_ARROW_DOWN, "ARROW_DOWN"}, {ICON_ARROW_DOWN, "ARROW_DOWN"},
{ICON_ARROW_LEFT, "ARROW_LEFT"}, {ICON_ARROW_LEFT, "ARROW_LEFT"},
{ICON_ARROW_RIGHT, "ARROW_RIGHT"}, {ICON_ARROW_RIGHT, "ARROW_RIGHT"},
{ICON_STOP, "STOP"}, {ICON_CHECKBOX_OFF, "CHECKBOX_OFF"},
{ICON_CHECKBOX_ON, "CHECKBOX_ON"},
{ICON_CHECKBOX_GRAY, "CHECKBOX_GRAY"},
{ICON_SELECTOR_AT_LEFT, "SELECTOR_AT_LEFT"},
{ICON_SELECTOR_AT_RIGHT, "SELECTOR_AT_RIGHT"},
{ICON_ELLIPSIS, "ELLIPSIS"},
{ICON_PAUSE, "PAUSE"}, {ICON_PAUSE, "PAUSE"},
{ICON_PLAY, "PLAY"}, {ICON_PLAY, "PLAY"},
{ICON_PLAYR, "PLAYR"}, {ICON_PLAYR, "PLAYR"},