- 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:
@@ -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_LEFT: 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_PAUSE: ch1 = '|'; ch2 = '|'; break;
|
||||
case ICON_PLAY: ch1 = '>'; ch2 = ' '; break;
|
||||
|
||||
+10
-3
@@ -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) );
|
||||
|
||||
ForAllDrivers(drv) {
|
||||
if( drv->icon )
|
||||
drv->icon( drv, x, y, icon );
|
||||
else
|
||||
/* Does the driver have the icon function ? */
|
||||
if( drv->icon ) {
|
||||
/* 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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-42
@@ -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...
|
||||
//
|
||||
@@ -644,7 +633,7 @@ CFontz_set_char (Driver * drvthis, int n, char *dat)
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// Places an icon on screen
|
||||
//
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT int
|
||||
CFontz_icon (Driver * drvthis, int x, int y, int icon)
|
||||
{
|
||||
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 );
|
||||
break;
|
||||
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];
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
// 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;
|
||||
}
|
||||
|
||||
@@ -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_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 void CFontz_heartbeat (Driver *drvthis, int type);
|
||||
MODULE_EXPORT void CFontz_icon(Driver * drvthis, int x, int y, int icon);
|
||||
MODULE_EXPORT int CFontz_icon(Driver * drvthis, int x, int y, int icon);
|
||||
|
||||
MODULE_EXPORT void CFontz_set_char (Driver * drvthis, int n, char *dat);
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
*
|
||||
* THINGS TO DO:
|
||||
* + make the caching at least for heartbeat icon
|
||||
* +
|
||||
* +
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -306,7 +306,7 @@ memcpy(&old[width], &framebuf[width], width);
|
||||
}
|
||||
|
||||
/*
|
||||
* Prints a character on the lcd display, at position (x,y).
|
||||
* Prints a character on the lcd display, at position (x,y).
|
||||
* The upper-left is (1,1), and the lower right should be (16,2).
|
||||
*/
|
||||
MODULE_EXPORT void
|
||||
@@ -383,7 +383,7 @@ static void
|
||||
CFontz633_no_live_report ()
|
||||
{
|
||||
char out[2]= {0, 0};
|
||||
|
||||
|
||||
for (out[0]=0; out[0]<8; out[0]++)
|
||||
send_bytes_message(fd, 2, CF633_Set_Up_Live_Fan_or_Temperature_Display , out);
|
||||
}
|
||||
@@ -681,7 +681,7 @@ send_bytes_message(fd, 9, CF633_Set_LCD_Special_Character_Data , out);
|
||||
/*
|
||||
* Places an icon on screen
|
||||
*/
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT int
|
||||
CFontz633_icon (Driver * drvthis, int x, int y, int icon)
|
||||
{
|
||||
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 );
|
||||
break;
|
||||
default:
|
||||
report( RPT_WARNING, "CFontz633_icon: unknown or unsupported icon: %d", icon );
|
||||
return -1; /* Let the core do other icons */
|
||||
}
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
@@ -766,7 +767,7 @@ CFontz633_string (Driver * drvthis, int x, int y, char string[])
|
||||
int i;
|
||||
|
||||
/* Convert 1-based coords to 0-based... */
|
||||
x -= 1;
|
||||
x -= 1;
|
||||
y -= 1;
|
||||
|
||||
for (i = 0; string[i]; i++) {
|
||||
@@ -777,34 +778,3 @@ CFontz633_string (Driver * drvthis, int x, int y, char string[])
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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_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_heartbeat (Driver *drvthis, int type);
|
||||
MODULE_EXPORT void CFontz633_icon(Driver * drvthis, int x, int y, int icon);
|
||||
MODULE_EXPORT int CFontz633_icon(Driver * drvthis, int x, int y, int icon);
|
||||
|
||||
MODULE_EXPORT void CFontz633_set_char (Driver * drvthis, int n, char *dat);
|
||||
|
||||
|
||||
+13
-33
@@ -71,7 +71,7 @@
|
||||
#define IS_VFD_DISPLAY (p->MtxOrb_type == MTXORB_VFD)
|
||||
#define IS_VKD_DISPLAY (p->MtxOrb_type == MTXORB_VKD)
|
||||
|
||||
/*
|
||||
/*
|
||||
* The MtxOrb driver do not use a lot of hardware feature.
|
||||
* We try to replace them by more flexible software version.
|
||||
* That's why vbar/hbar/bignum are using Matrix Orbital build-in function.
|
||||
@@ -191,8 +191,7 @@ typedef struct p {
|
||||
int fd; /* The LCD file descriptor */
|
||||
int contrast; /* static data from set/get_contrast */
|
||||
int backlightenabled;
|
||||
MtxOrb_type_type MtxOrb_type;
|
||||
int timer; /* static data from MtxOrb_heartbeat */
|
||||
MtxOrb_type_type MtxOrb_type;
|
||||
char pause_key;
|
||||
char back_key;
|
||||
char forward_key;
|
||||
@@ -278,7 +277,6 @@ MtxOrb_init (Driver *drvthis, char *args)
|
||||
p->backlightenabled = DEFAULT_BACKLIGHT;
|
||||
p->old = NULL;
|
||||
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->back_key = MTXORB_DEFAULT_BACK_KEY;
|
||||
p->forward_key = MTXORB_DEFAULT_FORWARD_KEY;
|
||||
@@ -961,7 +959,7 @@ static void MtxOrb_mold_vbar (Driver *drvthis, int x, int y, int len)
|
||||
{ barw, baru1, baru2, baru3, baru4, bigfonte, baru6, baru7, barb };
|
||||
/* bard5 = bigfontf ... The cache can benefit from it. */
|
||||
/*
|
||||
unsigned char mapd[9] =
|
||||
unsigned char mapd[9] =
|
||||
{ barw, bard1, bard2, bard3, bard4, bigfontf, bard6, bard7, barb };
|
||||
*/
|
||||
|
||||
@@ -1071,7 +1069,7 @@ MtxOrb_vbar (Driver * drvthis, int x, int y, int len, int promille, int options)
|
||||
* Ideally it should use the library but then the library
|
||||
* need to be enhanced with the idea privately exchange
|
||||
* between David & Joris.
|
||||
*/
|
||||
*/
|
||||
|
||||
MtxOrb_mold_vbar (drvthis, x, y, total_pixels);
|
||||
}
|
||||
@@ -1099,7 +1097,7 @@ MtxOrb_hbar (Driver * drvthis, int x, int y, int len, int promille, int options)
|
||||
* Ideally it should use the library but then the library
|
||||
* need to be enhanced with the idea privately exchange
|
||||
* between David & Joris.
|
||||
*/
|
||||
*/
|
||||
|
||||
MtxOrb_old_hbar (drvthis, x, y, total_pixels);
|
||||
}
|
||||
@@ -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.
|
||||
*/
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT int
|
||||
MtxOrb_icon (Driver *drvthis, int x, int y, int 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
|
||||
@@ -1204,6 +1207,8 @@ MtxOrb_icon (Driver *drvthis, int x, int y, int icon)
|
||||
* (A-Z) on success, 0 on failure...
|
||||
*/
|
||||
|
||||
/* TODO implement for new API call (get_key) that returns a string */
|
||||
|
||||
MODULE_EXPORT char
|
||||
MtxOrb_getkey (Driver *drvthis)
|
||||
{
|
||||
@@ -1345,31 +1350,6 @@ MtxOrb_ask_bar (Driver *drvthis, int type)
|
||||
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.
|
||||
*/
|
||||
|
||||
@@ -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_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 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_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_hbar (Driver * drvthis, int x, int y, int len, int promille, int options);
|
||||
|
||||
|
||||
@@ -780,14 +780,17 @@ bayrad_hbar(Driver * drvthis, int x, int y, int len, int promille, int options)
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// Places an icon on screen
|
||||
//
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT int
|
||||
bayrad_icon(Driver * drvthis, int x, int y, int icon)
|
||||
{
|
||||
switch( icon ) {
|
||||
case ICON_BLOCK_FILLED:
|
||||
bayrad_chr( drvthis, x, y, 0xFF );
|
||||
break;
|
||||
default:
|
||||
return -1; /* Let the core do other icons */
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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_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);
|
||||
|
||||
|
||||
@@ -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...
|
||||
//
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT int
|
||||
curses_drv_icon (Driver *drvthis, int x, int y, int icon)
|
||||
{
|
||||
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_HEART_OPEN: ch1 = '-'; break;
|
||||
case ICON_HEART_FILLED: ch1 = '+'; break;
|
||||
case ICON_ARROW_UP: ch1 = '^'; break; /* or does curses do real arrows ? */
|
||||
case ICON_ARROW_DOWN: ch1 = 'v'; break;
|
||||
case ICON_ARROW_LEFT: ch1 = '<'; break;
|
||||
case ICON_ARROW_RIGHT: ch1 = '>'; break;
|
||||
case ICON_STOP: ch1 = '['; ch2 = ']'; break;
|
||||
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;
|
||||
case ICON_ARROW_UP: ch1 = ACS_UARROW; break;
|
||||
case ICON_ARROW_DOWN: ch1 = ACS_DARROW; break;
|
||||
case ICON_ARROW_LEFT: ch1 = ACS_LARROW; break;
|
||||
case ICON_ARROW_RIGHT: ch1 = ACS_RARROW; break;
|
||||
default: return -1; /* Let the core do it */
|
||||
}
|
||||
curses_drv_chr( drvthis, x, y, ch1);
|
||||
if (ch2) {
|
||||
@@ -572,6 +564,7 @@ curses_drv_icon (Driver *drvthis, int x, int y, int icon)
|
||||
/* There was something with placing PAD
|
||||
* What wasthat ever for ?
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -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_num (Driver *drvthis, int x, int num);
|
||||
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);
|
||||
|
||||
|
||||
@@ -238,7 +238,7 @@ debug_hbar (Driver *drvthis, int x, int y, int len, int promille, int options)
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// Sets character 0 to an icon...
|
||||
//
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT int
|
||||
debug_icon (Driver *drvthis, int x, int y, int icon)
|
||||
{
|
||||
report (RPT_INFO, "icon(%i,%i,%i)", x, y, icon);
|
||||
|
||||
@@ -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_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_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);
|
||||
|
||||
|
||||
+10
-4
@@ -502,7 +502,7 @@ glk_set_char(Driver *drvthis, int n, char *dat)
|
||||
// Draws a vertical bar, from the bottom of the screen up.
|
||||
//
|
||||
MODULE_EXPORT void
|
||||
glk_vbar(Driver *drvthis, int x, int len)
|
||||
glk_old_vbar(Driver *drvthis, int x, int len)
|
||||
{
|
||||
int y = height ;
|
||||
|
||||
@@ -533,7 +533,7 @@ glk_vbar(Driver *drvthis, int x, int len)
|
||||
// Draws a horizontal bar to the right.
|
||||
//
|
||||
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 );
|
||||
while( len > cellwidth ) {
|
||||
@@ -561,8 +561,11 @@ glk_hbar(Driver *drvthis, int x, int y, int len)
|
||||
// Sets character 0 to an icon...
|
||||
//
|
||||
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 * p ;
|
||||
unsigned char * q ;
|
||||
@@ -610,8 +613,11 @@ glk_icon(Driver *drvthis, int which, char dest)
|
||||
// Return 0 for "nothing available".
|
||||
//
|
||||
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 ;
|
||||
static int key = -1 ;
|
||||
static struct timeval lastkey ;
|
||||
|
||||
@@ -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_chr(Driver *drvthis, int x, int y, char c);
|
||||
|
||||
MODULE_EXPORT void glk_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_vbar(Driver *drvthis, int x, 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_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);
|
||||
|
||||
|
||||
+75
-33
@@ -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...
|
||||
//
|
||||
@@ -986,7 +956,7 @@ HD44780_set_char (Driver *drvthis, int n, char *dat)
|
||||
/////////////////////////////////////////////////////////////
|
||||
// Set default icon into a userdef char
|
||||
//
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT int
|
||||
HD44780_icon (Driver *drvthis, int x, int y, int icon)
|
||||
{
|
||||
char heart_open[] = {
|
||||
@@ -998,7 +968,6 @@ HD44780_icon (Driver *drvthis, int x, int y, int icon)
|
||||
1, 0, 0, 0, 1,
|
||||
1, 1, 0, 1, 1,
|
||||
1, 1, 1, 1, 1 };
|
||||
|
||||
char heart_filled[] = {
|
||||
1, 1, 1, 1, 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, 1, 0, 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 ) {
|
||||
case ICON_BLOCK_FILLED:
|
||||
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_chr( drvthis, x, y, 0 );
|
||||
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:
|
||||
report( RPT_WARNING, "HD44780_icon: unknown or unsupported icon: %d", icon );
|
||||
return -1; /* Let the core do other icons */
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -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_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_heartbeat (Driver *drvthis, int type);
|
||||
MODULE_EXPORT void HD44780_icon (Driver *drvthis, int x, int y, int icon);
|
||||
MODULE_EXPORT int HD44780_icon (Driver *drvthis, int x, int y, int icon);
|
||||
|
||||
MODULE_EXPORT void HD44780_set_char (Driver *drvthis, int n, char *dat);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
separate commands. Unfortunately, the device runs at slow 1200bps and the
|
||||
LCD does not allow user-defined characters, so the bargraphs do not look
|
||||
very nice.
|
||||
|
||||
|
||||
Copyright (C) 2002 Michael Schwingen <michael@schwingen.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
|
||||
This driver is mostly based on the HD44780 and the LCDM001 driver.
|
||||
(Hopefully I have NOT forgotten any file I have stolen code from.
|
||||
@@ -218,11 +218,11 @@ icp_a106_flush (Driver *drvthis)
|
||||
static struct timeval tv_old; /* time of last update */
|
||||
int line;
|
||||
static char cmd[] = "\x4D\x0c\x00\x14";
|
||||
|
||||
|
||||
gettimeofday(&tv, 0);
|
||||
timersub(&tv, &tv_old, &tv2);
|
||||
|
||||
if (tv2.tv_sec ==0 && tv2.tv_usec < 500000) // less than 0.5s
|
||||
if (tv2.tv_sec ==0 && tv2.tv_usec < 500000) // less than 0.5s
|
||||
return;
|
||||
tv_old = tv;
|
||||
|
||||
@@ -279,7 +279,7 @@ icp_a106_vbar (Driver *drvthis, int x, int y, int len, int promille, int options
|
||||
int total_pixels = ((long) 2 * len * LCD_DEFAULT_CELLHEIGHT + 1 ) * promille / 2000;
|
||||
int pos;
|
||||
static char map[] = " __---=#";
|
||||
|
||||
|
||||
for (pos = 0; pos < len; pos ++ ) {
|
||||
|
||||
int pixels = total_pixels - LCD_DEFAULT_CELLHEIGHT * pos;
|
||||
@@ -353,7 +353,7 @@ icp_a106_num (Driver *drvthis, int x, int num)
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// Sets character 0 to an icon...
|
||||
//
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT int
|
||||
icp_a106_icon (Driver *drvthis, int x, int y, int icon)
|
||||
{
|
||||
switch( icon )
|
||||
@@ -366,16 +366,7 @@ icp_a106_icon (Driver *drvthis, int x, int y, int icon)
|
||||
case ICON_HEART_OPEN:
|
||||
break;
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
separate commands. Unfortunately, the device runs at slow 1200bps and the
|
||||
LCD does not allow user-defined characters, so the bargraphs do not look
|
||||
very nice.
|
||||
|
||||
|
||||
Copyright (C) 2002 Michael Schwingen <michael@schwingen.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
|
||||
This driver is mostly based on the HD44780 and the LCDM001 driver.
|
||||
(Hopefully I have NOT forgotten any file I have stolen code from.
|
||||
@@ -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_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_heartbeat (Driver *drvthis, int type);
|
||||
MODULE_EXPORT void icp_a106_icon (Driver *drvthis, int x, int y, int icon);
|
||||
MODULE_EXPORT int icp_a106_icon (Driver *drvthis, int x, int y, int icon);
|
||||
|
||||
#define DEFAULT_DEVICE "/dev/lcd"
|
||||
|
||||
|
||||
+37
-38
@@ -601,45 +601,44 @@ LB216_set_char(Driver * drvthis, int n, char *dat)
|
||||
}
|
||||
}
|
||||
|
||||
MODULE_EXPORT void
|
||||
LB216_icon(Driver * drvthis, int which, char dest)
|
||||
MODULE_EXPORT int
|
||||
LB216_icon(Driver * drvthis, int x, int y, int icon)
|
||||
{
|
||||
char icons[3][8*8] = {
|
||||
{
|
||||
1,1,1,1,1, // Empty Heart
|
||||
1,0,1,0,1,
|
||||
0,0,0,0,0,
|
||||
0,0,0,0,0,
|
||||
0,0,0,0,0,
|
||||
1,0,0,0,1,
|
||||
1,1,0,1,1,
|
||||
1,1,1,1,1,
|
||||
},
|
||||
static char heart_open[] = {
|
||||
1, 1, 1, 1, 1,
|
||||
1, 0, 1, 0, 1,
|
||||
0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0,
|
||||
1, 0, 0, 0, 1,
|
||||
1, 1, 0, 1, 1,
|
||||
1, 1, 1, 1, 1 };
|
||||
|
||||
{
|
||||
1,1,1,1,1, // Filled Heart
|
||||
1,0,1,0,1,
|
||||
0,1,0,1,0,
|
||||
0,1,1,1,0,
|
||||
0,1,1,1,0,
|
||||
1,0,1,0,1,
|
||||
1,1,0,1,1,
|
||||
1,1,1,1,1,
|
||||
},
|
||||
static char heart_filled[] = {
|
||||
1, 1, 1, 1, 1,
|
||||
1, 0, 1, 0, 1,
|
||||
0, 1, 0, 1, 0,
|
||||
0, 1, 1, 1, 0,
|
||||
0, 1, 1, 1, 0,
|
||||
1, 0, 1, 0, 1,
|
||||
1, 1, 0, 1, 1,
|
||||
1, 1, 1, 1, 1 };
|
||||
|
||||
{
|
||||
0,0,0,0,0, // Ellipsis
|
||||
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,1,0,1,
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
if(custom==bign) custom=beat;
|
||||
LB216_set_char(drvthis, dest, &icons[which][0]);
|
||||
switch( icon )
|
||||
{
|
||||
case ICON_BLOCK_FILLED:
|
||||
LB216_chr( drvthis, x, y, 255 );
|
||||
break;
|
||||
case ICON_HEART_FILLED:
|
||||
LB216_set_char( drvthis, 0, heart_filled );
|
||||
LB216_chr( drvthis, x, y, 0 );
|
||||
break;
|
||||
case ICON_HEART_OPEN:
|
||||
LB216_set_char( drvthis, 0, heart_open );
|
||||
LB216_chr( drvthis, x, y, 0 );
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -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_chr(Driver * drvthis, int x, int y, char c) ;
|
||||
|
||||
MODULE_EXPORT void LB216_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_vbar(Driver * drvthis, int x, 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_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);
|
||||
|
||||
|
||||
+32
-9
@@ -14,6 +14,10 @@
|
||||
* There should be no further interaction between driver and server core
|
||||
* 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.
|
||||
* 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
|
||||
@@ -42,6 +46,9 @@
|
||||
#define BACKLIGHT_WARNING 2
|
||||
#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 */
|
||||
#define ICON_BLOCK_FILLED 0x100
|
||||
#define ICON_HEART_OPEN 0x108
|
||||
@@ -50,6 +57,12 @@
|
||||
#define ICON_ARROW_DOWN 0x111
|
||||
#define ICON_ARROW_LEFT 0x112
|
||||
#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 */
|
||||
#define ICON_STOP 0x200 /* should look like [] */
|
||||
@@ -62,17 +75,27 @@
|
||||
#define ICON_PREV 0x207 /* should look like |< */
|
||||
#define ICON_REC 0x208 /* should look like () */
|
||||
|
||||
/* Heartbeat data, taken from render.h */
|
||||
/* ??? What does OPEN mean here ? */
|
||||
/* Icon numbers from 0 to 0x0FF could be used for client defined chars.
|
||||
* 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_ON 1
|
||||
#define HEARTBEAT_OPEN 2
|
||||
|
||||
/* Patterns for hbar / vbar */
|
||||
#define BAR_POS 0x001 /* default */
|
||||
#define BAR_NEG 0x002
|
||||
#define BAR_POS_AND_NEG 0x003
|
||||
#define BAR_PATTERN_FILLED 0x000
|
||||
/* Patterns for hbar / vbar, mostly (if not all) UNIMPLEMENTED */
|
||||
#define BAR_POS 0x001 /* default
|
||||
Promilles allowed: 0 to 1000
|
||||
The zero-point is at the left or bottom */
|
||||
#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_STRIPED 0x020
|
||||
#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 (*num) (struct lcd_logical_driver* drvthis, int x, int num);
|
||||
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);
|
||||
|
||||
/* Userdef characters, are those still supported ? */
|
||||
|
||||
@@ -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
|
||||
lib_hbar_static (Driver *drvthis, int x, int y, int len, int promille, int options, int cellwidth, int cc_offset)
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
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_vbar_static (Driver *drvthis, int x, int y, int len, int promille, int options, int cellheight, int cc_offset);
|
||||
|
||||
|
||||
@@ -78,47 +78,6 @@ MODULE_EXPORT int stay_in_foreground = 0;
|
||||
MODULE_EXPORT int supports_multiple = 0;
|
||||
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 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.
|
||||
//
|
||||
MODULE_EXPORT void
|
||||
lcdm001_vbar(Driver *drvthis, int x, int len)
|
||||
lcdm001_old_vbar(Driver *drvthis, int x, int len)
|
||||
{
|
||||
int y = 4;
|
||||
|
||||
@@ -423,7 +382,7 @@ lcdm001_vbar(Driver *drvthis, int x, int len)
|
||||
// Draws a horizontal bar to the right.
|
||||
//
|
||||
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);
|
||||
@@ -449,28 +408,11 @@ lcdm001_hbar(Driver *drvthis, int x, int y, int len)
|
||||
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...
|
||||
//
|
||||
MODULE_EXPORT void
|
||||
lcdm001_icon (Driver *drvthis, int which, char dest)
|
||||
lcdm001_old_icon (Driver *drvthis, int which, char dest)
|
||||
{
|
||||
|
||||
/*Heartbeat workaround:
|
||||
@@ -497,6 +439,9 @@ lcdm001_icon (Driver *drvthis, int which, char dest)
|
||||
//
|
||||
// Return 0 for "nothing available".
|
||||
//
|
||||
|
||||
/* TODO: write for net API function (get_key) that returns a string */
|
||||
|
||||
MODULE_EXPORT char
|
||||
lcdm001_getkey (Driver *drvthis)
|
||||
{
|
||||
@@ -514,35 +459,3 @@ lcdm001_getkey (Driver *drvthis)
|
||||
/*debug: if(in) fprintf(stderr,"key: %c",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;
|
||||
}
|
||||
|
||||
@@ -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_chr (Driver *drvthis, int x, int y, char c);
|
||||
|
||||
MODULE_EXPORT void lcdm001_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_vbar (Driver *drvthis, int x, 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_icon (Driver *drvthis, int which, char dest);
|
||||
MODULE_EXPORT void lcdm001_heartbeat (Driver *drvthis, int type);
|
||||
MODULE_EXPORT void lcdm001_old_icon (Driver *drvthis, int which, char dest);
|
||||
|
||||
MODULE_EXPORT void lcdm001_output (Driver *drvthis, int on);
|
||||
|
||||
|
||||
+10
-34
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
This is the LCDproc driver for the "LCTerm" serial LCD terminal
|
||||
from Helmut Neumark Elektronik, www.neumark.de
|
||||
|
||||
|
||||
Copyright (C) 2002 Michael Schwingen <michael@schwingen.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
|
||||
This driver is mostly based on the HD44780 and the LCDM001 driver.
|
||||
(Hopefully I have NOT forgotten any file I have stolen code from.
|
||||
@@ -98,11 +98,11 @@ lcterm_init (Driver *drvthis, char *args)
|
||||
sizeof(device));
|
||||
device[sizeof(device)-1]=0;
|
||||
report (RPT_INFO,"LCTERM: Using device: %s", device);
|
||||
|
||||
|
||||
{
|
||||
char *s;
|
||||
int w,h;
|
||||
|
||||
|
||||
// Get and parse size
|
||||
s = drvthis->config_get_string( drvthis->name, "size", 0, "16x2" );
|
||||
fprintf( stderr, "lcterm_init: size: %s\n", s );
|
||||
@@ -241,14 +241,14 @@ lcterm_flush (Driver *drvthis)
|
||||
escape *every* character */
|
||||
dp = buf;
|
||||
sp = p->framebuf;
|
||||
|
||||
|
||||
*dp++ = 0x1E; // cursor home
|
||||
|
||||
|
||||
for(line = p->height; line>0; line--)
|
||||
{
|
||||
for(i=p->width; i>0; i--)
|
||||
{
|
||||
if((c = *sp++) < 0x08) // need to escape used-defined characters
|
||||
if((c = *sp++) < 0x08) // need to escape used-defined characters
|
||||
*dp++ = 0x1B;
|
||||
*dp++ = c;
|
||||
}
|
||||
@@ -718,7 +718,7 @@ lcterm_num (Driver *drvthis, int x, int num)
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// Sets character 0 to an icon...
|
||||
//
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT int
|
||||
lcterm_icon (Driver *drvthis, int x, int y, int icon)
|
||||
{
|
||||
static char heart_open[] = {
|
||||
@@ -755,32 +755,8 @@ lcterm_icon (Driver *drvthis, int x, int y, int icon)
|
||||
lcterm_chr( drvthis, x, y, 0 );
|
||||
break;
|
||||
default:
|
||||
report( RPT_WARNING, "lcterm_icon: unknown or unsupported icon: %d", icon );
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
// 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++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
This is the LCDproc driver for the "LCTerm" serial LCD terminal
|
||||
from Helmut Neumark Elektronik, www.neumark.de
|
||||
|
||||
|
||||
Copyright (C) 2002 Michael Schwingen <michael@schwingen.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
|
||||
This driver is mostly based on the HD44780 and the LCDM001 driver.
|
||||
(Hopefully I have NOT forgotten any file I have stolen code from.
|
||||
@@ -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_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_heartbeat (Driver *drvthis, int type);
|
||||
MODULE_EXPORT void lcterm_icon (Driver *drvthis, int x, int y, int icon);
|
||||
MODULE_EXPORT int lcterm_icon (Driver *drvthis, int x, int y, int icon);
|
||||
MODULE_EXPORT void lcterm_set_char (Driver *drvthis, int n, char *dat);
|
||||
|
||||
#define DEFAULT_DEVICE "/dev/lcd"
|
||||
|
||||
+41
-37
@@ -419,7 +419,7 @@ sed1520_set_char (Driver *drvthis, int n, char *dat)
|
||||
// framebuffer at 1-based position x. len is given in pixels.
|
||||
//
|
||||
MODULE_EXPORT void
|
||||
sed1520_vbar (Driver *drvthis, int x, int len)
|
||||
sed1520_old_vbar (Driver *drvthis, int x, int len)
|
||||
{
|
||||
int i, j, k;
|
||||
x--;
|
||||
@@ -452,7 +452,7 @@ sed1520_vbar (Driver *drvthis, int x, int len)
|
||||
// x,y into the framebuffer. len is given in pixels.
|
||||
//
|
||||
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;
|
||||
x--;
|
||||
@@ -469,41 +469,45 @@ sed1520_hbar (Driver *drvthis, int x, int y, int len)
|
||||
// Reprogrammes character dest to contain an icon given by
|
||||
// which. Calls set_char() to do this.
|
||||
//
|
||||
MODULE_EXPORT void
|
||||
sed1520_icon (Driver *drvthis, int which, char dest)
|
||||
MODULE_EXPORT int
|
||||
sed1520_icon (Driver *drvthis, int x, int y, int icon)
|
||||
{
|
||||
char icons[3][6 * 8] = {
|
||||
{
|
||||
1, 1, 1, 1, 1, 1, // Empty Heart
|
||||
1, 0, 1, 0, 1, 1,
|
||||
0, 0, 0, 0, 0, 1,
|
||||
0, 0, 0, 0, 0, 1,
|
||||
0, 0, 0, 0, 0, 1,
|
||||
1, 0, 0, 0, 1, 1,
|
||||
1, 1, 0, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1,}
|
||||
,
|
||||
{
|
||||
1, 1, 1, 1, 1, 1, // Filled Heart
|
||||
1, 0, 1, 0, 1, 1,
|
||||
0, 1, 0, 1, 0, 1,
|
||||
0, 1, 1, 1, 0, 1,
|
||||
0, 1, 1, 1, 0, 1,
|
||||
1, 0, 1, 0, 1, 1,
|
||||
1, 1, 0, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1,}
|
||||
,
|
||||
{
|
||||
0, 0, 0, 0, 0, 0, // Ellipsis
|
||||
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,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
1, 0, 1, 0, 1, 0,}
|
||||
,
|
||||
};
|
||||
sed1520_set_char (drvthis, dest, &icons[which][0]);
|
||||
static char heart_open[] = {
|
||||
1, 1, 1, 1, 1,
|
||||
1, 0, 1, 0, 1,
|
||||
0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0,
|
||||
1, 0, 0, 0, 1,
|
||||
1, 1, 0, 1, 1,
|
||||
1, 1, 1, 1, 1 };
|
||||
|
||||
static char heart_filled[] = {
|
||||
1, 1, 1, 1, 1,
|
||||
1, 0, 1, 0, 1,
|
||||
0, 1, 0, 1, 0,
|
||||
0, 1, 1, 1, 0,
|
||||
0, 1, 1, 1, 0,
|
||||
1, 0, 1, 0, 1,
|
||||
1, 1, 0, 1, 1,
|
||||
1, 1, 1, 1, 1 };
|
||||
|
||||
switch( icon )
|
||||
{
|
||||
case ICON_BLOCK_FILLED:
|
||||
sed1520_chr( drvthis, x, y, 255 );
|
||||
break;
|
||||
case ICON_HEART_FILLED:
|
||||
sed1520_set_char( drvthis, 0, heart_filled );
|
||||
sed1520_chr( drvthis, x, y, 0 );
|
||||
break;
|
||||
case ICON_HEART_OPEN:
|
||||
sed1520_set_char( drvthis, 0, heart_open );
|
||||
sed1520_chr( drvthis, x, y, 0 );
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -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_chr (Driver *drvthis, int x, int y, char c);
|
||||
|
||||
MODULE_EXPORT void sed1520_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_vbar (Driver *drvthis, int x, 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_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);
|
||||
|
||||
|
||||
@@ -601,7 +601,7 @@ stv5730_num (Driver *drvthis, int x, int num)
|
||||
// framebuffer at 1-based position x. len is given in pixels.
|
||||
//
|
||||
MODULE_EXPORT void
|
||||
stv5730_vbar (Driver *drvthis, int x, int len)
|
||||
stv5730_old_vbar (Driver *drvthis, int x, int len)
|
||||
{
|
||||
|
||||
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
|
||||
// this.
|
||||
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;
|
||||
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...
|
||||
// It contains a heartbeat char ! :-)
|
||||
MODULE_EXPORT void
|
||||
stv5730_icon (Driver *drvthis, int which, char dest)
|
||||
stv5730_old_icon (Driver *drvthis, int which, char dest)
|
||||
{
|
||||
switch (which)
|
||||
{
|
||||
|
||||
@@ -13,9 +13,9 @@ MODULE_EXPORT void stv5730_clear (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_chr (Driver *drvthis, int x, int y, char c);
|
||||
MODULE_EXPORT void stv5730_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_vbar (Driver *drvthis, int x, 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_icon (Driver *drvthis, int which, char dest);
|
||||
MODULE_EXPORT void stv5730_old_icon (Driver *drvthis, int which, char dest);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
/*
|
||||
This is a hack of the curses driver. It's my first attempt at SVGALIB
|
||||
This is a hack of the curses driver. It's my first attempt at SVGALIB
|
||||
programming so please send comments to <smh@remove_this@dr.com>.
|
||||
|
||||
|
||||
Simon Harrison. 27 Dec 1999.
|
||||
|
||||
IMPORTANT NOTE: In order to make this work properly LCDd should not be
|
||||
allowed to fork (-f option), otherwise k/b input won't work.
|
||||
|
||||
|
||||
Changes:
|
||||
9 Jan 2000: Figured out svgalib driver needs a hack to main.c just like
|
||||
curses. Maybe this should be fixed with another function call
|
||||
added to the API?
|
||||
4 Jan 2000: Added 5x7 font, fixed flicker.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
@@ -170,7 +170,7 @@ const unsigned char simple_font5x7[] = {
|
||||
/* <end user defineable!!!> */
|
||||
|
||||
/* No, I don't understand SVGALIB key mappings or a neat way of doing this
|
||||
* Cursor keys manifest themselves as 3 byte excapes in svgalib: 27,91
|
||||
* Cursor keys manifest themselves as 3 byte excapes in svgalib: 27,91
|
||||
* followed by one of the codes below.
|
||||
*/
|
||||
#define VGAKEY_UP 65
|
||||
@@ -186,11 +186,11 @@ void *SVGALIB_highfont; /* highlighted font (not used yet) */
|
||||
void *SVGALIB_warnfont; /* warning font (not used yet) */
|
||||
|
||||
/*
|
||||
Setting SVGALIB_figure_mappings will trap all keypresses and write the
|
||||
Setting SVGALIB_figure_mappings will trap all keypresses and write the
|
||||
vga_getkey() codes out to a file. You can then mod the getkey() function
|
||||
at the bottom of the file to your liking.
|
||||
|
||||
Ahem... don't do this unless you can get to another console to kill the
|
||||
Ahem... don't do this unless you can get to another console to kill the
|
||||
process after.
|
||||
*/
|
||||
int SVGALIB_figure_mappings = 0;
|
||||
@@ -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
|
||||
*/
|
||||
@@ -492,7 +472,7 @@ svgalib_drv_get_key (Driver *drvthis)
|
||||
}
|
||||
break;
|
||||
|
||||
/*
|
||||
/*
|
||||
Change this bit to your liking. I only set these values because
|
||||
they tie in with my keypads use of the keyboard controller chip
|
||||
see http://www.gofree.co.uk/home/smh/mp3 for details.
|
||||
|
||||
@@ -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_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_icon (Driver *drvthis, int which, char dest);
|
||||
|
||||
MODULE_EXPORT char * svgalib_drv_get_key (Driver *drvthis);
|
||||
|
||||
|
||||
+18
-41
@@ -66,7 +66,7 @@ t6963_init (Driver *drvthis, char *args)
|
||||
int w, h, p;
|
||||
|
||||
char size[200] = DEFAULT_SIZE;
|
||||
|
||||
|
||||
debug(RPT_INFO, "T6963: init(%p,%s)", drvthis, args );
|
||||
|
||||
t6963_display_mode = 0;
|
||||
@@ -78,7 +78,7 @@ t6963_init (Driver *drvthis, char *args)
|
||||
t6963_graph_line[5] = 0x3F;
|
||||
|
||||
debug(RPT_DEBUG, "T6963: reading config file...");
|
||||
|
||||
|
||||
/* Read config file */
|
||||
|
||||
/* -------------------------- Which size --------------------------------------*/
|
||||
@@ -92,8 +92,8 @@ t6963_init (Driver *drvthis, char *args)
|
||||
} else {
|
||||
width = w;
|
||||
height = h;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* --------------------------- Which port --------------------------------------*/
|
||||
p = drvthis->config_get_int ( drvthis->name, "Port", 0, DEFAULT_PORT);
|
||||
if(0x200 <= p && p <= 0x400) {
|
||||
@@ -102,9 +102,9 @@ t6963_init (Driver *drvthis, char *args)
|
||||
t6963_out_port = DEFAULT_PORT;
|
||||
report (RPT_WARNING, "T6963_init: Port value must be between 0x200 and 0x400. Using default value.\n");
|
||||
}
|
||||
|
||||
|
||||
bidirectLPT = drvthis->config_get_bool ( drvthis->name, "ECPlpt", 0, 0 );
|
||||
|
||||
|
||||
/* ------------------ Get permission to parallel port --------------------------------------------*/
|
||||
|
||||
debug (RPT_DEBUG, "T6963: Getting permission to parallel port %d...", t6963_out_port);
|
||||
@@ -151,7 +151,7 @@ t6963_init (Driver *drvthis, char *args)
|
||||
report (RPT_ERR, "T6963: No memory for double buffering!");
|
||||
t6963_close (drvthis);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------- I N I T I A L I Z A T I O N ----------------------- */
|
||||
debug (RPT_DEBUG, "T6963: Sending init to display...");
|
||||
@@ -181,7 +181,7 @@ t6963_init (Driver *drvthis, char *args)
|
||||
t6963_clear (drvthis);
|
||||
t6963_graphic_clear (drvthis, 0, 0, width, cellheight * height);
|
||||
t6963_flush(drvthis);
|
||||
|
||||
|
||||
debug (RPT_DEBUG, "T6963: Initialization done!");
|
||||
|
||||
return 0; // 200 is arbitrary. (must be 1 or more)
|
||||
@@ -377,7 +377,7 @@ 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)
|
||||
{
|
||||
lib_hbar_static(drvthis, x, y, len, promille, options, cellwidth, 220);
|
||||
lib_hbar_static(drvthis, x, y, len, promille, options, cellwidth, 220);
|
||||
/* int stop = x + len/cellwidth;
|
||||
DEBUG4 ("Drawing horizontal bar x: %i, y: %i, len:%i, stop: %i...", x, y, len, stop);
|
||||
for (; x < stop; x++)
|
||||
@@ -392,10 +392,10 @@ t6963_hbar (Driver *drvthis, int x, int y, int len, int promille, int options)
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// Sets an icon...
|
||||
//
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT int
|
||||
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 ) {
|
||||
case ICON_BLOCK_FILLED:
|
||||
t6963_chr( drvthis, x, y, 220 );
|
||||
@@ -403,36 +403,13 @@ t6963_icon (Driver *drvthis, int x, int y, int icon)
|
||||
case ICON_HEART_FILLED:
|
||||
t6963_chr( drvthis, x, y, 3 );
|
||||
break;
|
||||
case ICON_HEART_OPEN:
|
||||
case ICON_HEART_OPEN:
|
||||
t6963_chr( drvthis, x, y, 4 );
|
||||
break;
|
||||
default:
|
||||
report (RPT_WARNING, "T6963: icon type not supported!");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// 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;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ---------------------- internal functions ------------------------------------- */
|
||||
@@ -456,8 +433,8 @@ t6963_low_set_control(char wr, char ce, char cd, char rd)
|
||||
status &= 0xf7;
|
||||
else if(rd == 0)
|
||||
status |= 0x08;
|
||||
port_out(T6963_CONTROL_PORT, status);
|
||||
|
||||
port_out(T6963_CONTROL_PORT, status);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
@@ -477,7 +454,7 @@ t6963_low_dsp_ready (void)
|
||||
} while (i < 50000 && (input & 3)!=3);
|
||||
T6963_DATAOUT;
|
||||
} else {
|
||||
for(i=0; i<3; i++)
|
||||
for(i=0; i<3; i++)
|
||||
port_out(0x80, 0x00); /* wait 1ms */
|
||||
}
|
||||
}
|
||||
@@ -500,7 +477,7 @@ t6963_low_command (u8 byte)
|
||||
{
|
||||
t6963_low_dsp_ready();
|
||||
// port_out(0x80, 0x00);
|
||||
|
||||
|
||||
port_out(T6963_DATA_PORT, byte); // present data to LCD on PC's port pins
|
||||
|
||||
t6963_low_set_control(1, 1, 1, 1);
|
||||
|
||||
@@ -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_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_icon (Driver *drvthis, int x, int y, int icon);
|
||||
MODULE_EXPORT void t6963_heartbeat (Driver *drvthis, int type);
|
||||
MODULE_EXPORT int t6963_icon (Driver *drvthis, int x, int y, int icon);
|
||||
|
||||
MODULE_EXPORT void t6963_set_char (Driver *drvthis, int n, char *dat);
|
||||
|
||||
|
||||
@@ -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_set_contrast (Driver *drvthis, int promille);
|
||||
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
|
||||
|
||||
@@ -435,7 +435,7 @@ sli_init_hbar (Driver *drvthis)
|
||||
for me to add */
|
||||
|
||||
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 };
|
||||
|
||||
@@ -455,7 +455,7 @@ sli_vbar (Driver *drvthis, int x, int len)
|
||||
// Draws a horizontal bar to the right.
|
||||
//
|
||||
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 };
|
||||
|
||||
@@ -513,7 +513,7 @@ sli_set_char (Driver *drvthis, int n, char *dat)
|
||||
}
|
||||
|
||||
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] = {
|
||||
{
|
||||
@@ -553,6 +553,20 @@ sli_icon (Driver *drvthis, int which, char dest)
|
||||
|
||||
if (custom == bign)
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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_chr (Driver *drvthis, int x, int y, char c);
|
||||
|
||||
MODULE_EXPORT void sli_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_vbar (Driver *drvthis, int x, 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_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);
|
||||
|
||||
|
||||
+6
-1
@@ -48,7 +48,12 @@ struct icontable {
|
||||
{ICON_ARROW_DOWN, "ARROW_DOWN"},
|
||||
{ICON_ARROW_LEFT, "ARROW_LEFT"},
|
||||
{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_PLAY, "PLAY"},
|
||||
{ICON_PLAYR, "PLAYR"},
|
||||
|
||||
Reference in New Issue
Block a user