diff --git a/server/drivers/glcd_font5x8.h b/server/drivers/glcd_font5x8.h index 20dacb0..94a3601 100644 --- a/server/drivers/glcd_font5x8.h +++ b/server/drivers/glcd_font5x8.h @@ -1776,79 +1776,82 @@ unsigned char glcd_iso8859_1[256][8] = { }; static int -glcd_icon5x8(Driver *drvthis, int x, int y, int icon) +glcd_icon5x8(int icon) { + int icon_char; + switch (icon) { case ICON_BLOCK_FILLED: - drvthis->chr(drvthis, x, y, 0x98); + icon_char = 0x98; break; case ICON_HEART_FILLED: - drvthis->chr(drvthis, x, y, 0x80); + icon_char = 0x80; break; case ICON_HEART_OPEN: - drvthis->chr(drvthis, x, y, 0x81); + icon_char = 0x81; break; case ICON_ARROW_UP: - drvthis->chr(drvthis, x, y, 0x82); + icon_char = 0x82; break; case ICON_ARROW_DOWN: - drvthis->chr(drvthis, x, y, 0x83); + icon_char = 0x83; break; case ICON_ARROW_LEFT: - drvthis->chr(drvthis, x, y, 0x84); + icon_char = 0x84; break; case ICON_ARROW_RIGHT: - drvthis->chr(drvthis, x, y, 0x85); + icon_char = 0x85; break; case ICON_CHECKBOX_OFF: - drvthis->chr(drvthis, x, y, 0x86); + icon_char = 0x86; break; case ICON_CHECKBOX_ON: - drvthis->chr(drvthis, x, y, 0x87); + icon_char = 0x87; break; case ICON_CHECKBOX_GRAY: - drvthis->chr(drvthis, x, y, 0x88); + icon_char = 0x88; break; case ICON_SELECTOR_AT_LEFT: - drvthis->chr(drvthis, x, y, 0x89); + icon_char = 0x89; break; case ICON_SELECTOR_AT_RIGHT: - drvthis->chr(drvthis, x, y, 0x8a); + icon_char = 0x8a; break; case ICON_ELLIPSIS: - drvthis->chr(drvthis, x, y, 0x8b); + icon_char = 0x8b; break; case ICON_STOP: - drvthis->chr(drvthis, x, y, 0x8c); + icon_char = 0x8c; break; case ICON_PAUSE: - drvthis->chr(drvthis, x, y, 0x8d); + icon_char = 0x8d; break; case ICON_PLAY: - drvthis->chr(drvthis, x, y, 0x89); + icon_char = 0x89; break; case ICON_PLAYR: - drvthis->chr(drvthis, x, y, 0x8a); + icon_char = 0x8a; break; case ICON_FF: - drvthis->chr(drvthis, x, y, 0xab); + icon_char = 0xab; break; case ICON_FR: - drvthis->chr(drvthis, x, y, 0xbb); + icon_char = 0xbb; break; case ICON_NEXT: - drvthis->chr(drvthis, x, y, 0x8e); + icon_char = 0x8e; break; case ICON_PREV: - drvthis->chr(drvthis, x, y, 0x8f); + icon_char = 0x8f; break; case ICON_REC: - drvthis->chr(drvthis, x, y, 0xac); + icon_char = 0xac; break; default: - return -1; + icon_char = -1; } - return 0; + + return icon_char; } #endif diff --git a/server/drivers/i2500vfd.c b/server/drivers/i2500vfd.c index 9f3bbc6..d896a69 100644 --- a/server/drivers/i2500vfd.c +++ b/server/drivers/i2500vfd.c @@ -411,11 +411,17 @@ i2500vfd_hbar(Driver *drvthis, int x, int y, int len, int promille, int pattern) } ///////////////////////////////////////////////////////////////// -// Reprogrammes character dest to contain an icon given by -// which. Calls set_char() to do this. +// Gets an icon character from the font definition and calls +// chr() to draw it. // MODULE_EXPORT int i2500vfd_icon (Driver *drvthis, int x, int y, int icon) { - return (glcd_icon5x8(drvthis, x, y, icon)); + int icon_char; + + if ((icon_char = glcd_icon5x8(icon)) != -1) { + i2500vfd_chr(drvthis, x, y, icon_char); + return 0; + } + return -1; } diff --git a/server/drivers/mdm166a.c b/server/drivers/mdm166a.c index b4841c4..1b7c680 100644 --- a/server/drivers/mdm166a.c +++ b/server/drivers/mdm166a.c @@ -576,7 +576,13 @@ mdm166a_hbar(Driver *drvthis, int x, int y, int len, int promille, int pattern) MODULE_EXPORT int mdm166a_icon(Driver *drvthis, int x, int y, int icon) { - return (glcd_icon5x8(drvthis, x, y, icon)); + int icon_char; + + if ((icon_char = glcd_icon5x8(icon)) != -1) { + mdm166a_chr(drvthis, x, y, icon_char); + return 0; + } + return -1; } diff --git a/server/drivers/sed1520.c b/server/drivers/sed1520.c index cc2ad0f..6cac7cc 100644 --- a/server/drivers/sed1520.c +++ b/server/drivers/sed1520.c @@ -512,5 +512,11 @@ sed1520_hbar(Driver *drvthis, int x, int y, int len, int promille, int options) MODULE_EXPORT int sed1520_icon(Driver * drvthis, int x, int y, int icon) { - return (glcd_icon5x8(drvthis, x, y, icon)); + int icon_char; + + if ((icon_char = glcd_icon5x8(icon)) != -1) { + sed1520_chr(drvthis, x, y, icon_char); + return 0; + } + return -1; } diff --git a/server/drivers/t6963.c b/server/drivers/t6963.c index 5c3d8ec..97d7dad 100644 --- a/server/drivers/t6963.c +++ b/server/drivers/t6963.c @@ -448,9 +448,14 @@ t6963_hbar(Driver *drvthis, int x, int y, int len, int promille, int options) MODULE_EXPORT int t6963_icon(Driver *drvthis, int x, int y, int icon) { + int icon_char; debug(RPT_DEBUG, "T6963: set icon %d", icon); - return (glcd_icon5x8(drvthis, x, y, icon)); + if ((icon_char = glcd_icon5x8(icon)) != -1) { + t6963_chr(drvthis, x, y, icon_char); + return 0; + } + return -1; } /* EOF */