-/* $Id: BeckmannEgle.c,v 1.15 2003/08/24 05:17:58 reinelt Exp $
+/* $Id: BeckmannEgle.c,v 1.16 2003/09/13 06:45:43 reinelt Exp $
*
* driver for Beckmann+Egle mini terminals
*
*
*
* $Log: BeckmannEgle.c,v $
+ * Revision 1.16 2003/09/13 06:45:43 reinelt
+ * icons for all remaining drivers
+ *
* Revision 1.15 2003/08/24 05:17:58 reinelt
* liblcd4linux patch from Patrick Schemitz
*
#include "lock.h"
#include "display.h"
#include "bar.h"
+#include "icon.h"
#define XRES 5
#define YRES 8
static char *Port=NULL;
static int Device=-1;
static int Type=-1;
+static int Icons;
static char *FrameBuffer1=NULL;
static char *FrameBuffer2=NULL;
{
memset (FrameBuffer1, ' ', Lcd.rows*Lcd.cols*sizeof(char));
+
+ icon_clear();
bar_clear();
if (full) {
BE_write (buffer, 4); // select display type
BE_write ("\033&D", 3); // cursor off
- bar_init(rows, cols, XRES, YRES, CHARS);
+ if (cfg_number("Icons", 0, 0, CHARS, &Icons)<0) return -1;
+ if (Icons>0) {
+ debug ("reserving %d of %d user-defined characters for icons", Icons, CHARS);
+ icon_init(Lcd.rows, Lcd.cols, XRES, YRES, CHARS, Icons, BE_define_char);
+ Self->icons=Icons;
+ Lcd.icons=Icons;
+ }
+
+ bar_init(rows, cols, XRES, YRES, CHARS-Icons);
bar_add_segment( 0, 0,255, 32); // ASCII 32 = blank
bar_add_segment(255,255,255,255); // ASCII 255 = block
}
+int BE_icon (int num, int seq, int row, int col)
+{
+ return icon_draw (num, seq, row, col);
+}
+
+
int BE_flush (void)
{
int row, col, pos1, pos2;
for (row=0; row<Lcd.rows; row++) {
for (col=0; col<Lcd.cols; col++) {
c=bar_peek(row, col);
+ if (c==-1) c=icon_peek(row, col);
if (c!=-1) {
FrameBuffer1[row*Lcd.cols+col]=(char)c;
}
xres: XRES,
yres: YRES,
bars: BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2,
+ icons: 0,
gpos: 0,
init: BE_init,
clear: BE_clear,
put: BE_put,
bar: BE_bar,
+ icon: BE_icon,
gpo: NULL,
flush: BE_flush,
quit: BE_quit
-/* $Id: Crystalfontz.c,v 1.14 2003/09/09 06:54:43 reinelt Exp $
+/* $Id: Crystalfontz.c,v 1.15 2003/09/13 06:45:43 reinelt Exp $
*
* driver for display modules from Crystalfontz
*
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log: Crystalfontz.c,v $
+ * Revision 1.15 2003/09/13 06:45:43 reinelt
+ * icons for all remaining drivers
+ *
* Revision 1.14 2003/09/09 06:54:43 reinelt
* new function 'cfg_number()'
*
#include "lock.h"
#include "display.h"
#include "bar.h"
+#include "icon.h"
#define XRES 5
#define YRES 8
static char *Port=NULL;
static speed_t Speed;
static int Device=-1;
+static int Icons;
static int GPO;
static char *FrameBuffer1=NULL;
static int CF_clear (int full)
{
memset (FrameBuffer1, ' ', Lcd.rows*Lcd.cols*sizeof(char));
+
+ icon_clear();
bar_clear();
GPO=0;
Device=CF_open();
if (Device==-1) return -1;
- bar_init(Lcd.rows, Lcd.cols, XRES, YRES, CHARS);
+ if (cfg_number("Icons", 0, 0, CHARS, &Icons)<0) return -1;
+ if (Icons>0) {
+ debug ("reserving %d of %d user-defined characters for icons", Icons, CHARS);
+ icon_init(Lcd.rows, Lcd.cols, XRES, YRES, CHARS, Icons, CF_define_char);
+ Self->icons=Icons;
+ Lcd.icons=Icons;
+ }
+
+ bar_init(Lcd.rows, Lcd.cols, XRES, YRES, CHARS-Icons);
bar_add_segment( 0, 0,255, 32); // ASCII 32 = blank
bar_add_segment(255,255,255,255); // ASCII 255 = block
}
+int CF_icon (int num, int seq, int row, int col)
+{
+ return icon_draw (num, seq, row, col);
+}
+
+
static int CF_flush (void)
{
int row, col, pos1, pos2;
for (row=0; row<Lcd.rows; row++) {
for (col=0; col<Lcd.cols; col++) {
c=bar_peek(row, col);
+ if (c==-1) c=icon_peek(row, col);
if (c!=-1) {
if (c!=32) c+=128; //blank
FrameBuffer1[row*Lcd.cols+col]=(char)c;
xres: XRES,
yres: YRES,
bars: BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2,
+ icons: 0,
gpos: 0,
init: CF_init,
clear: CF_clear,
put: CF_put,
bar: CF_bar,
+ icon: CF_icon,
gpo: NULL,
flush: CF_flush,
quit: CF_quit
xres: XRES,
yres: YRES,
bars: BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2,
+ icons: 0,
gpos: 0,
init: CF_init,
clear: CF_clear,
put: CF_put,
bar: CF_bar,
+ icon: CF_icon,
gpo: NULL,
flush: CF_flush,
quit: CF_quit
xres: XRES,
yres: YRES,
bars: BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2,
+ icons: 0,
gpos: 0,
init: CF_init,
clear: CF_clear,
put: CF_put,
bar: CF_bar,
+ icon: CF_icon,
gpo: NULL,
flush: CF_flush,
quit: CF_quit
xres: XRES,
yres: YRES,
bars: BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2,
+ icons: 0,
gpos: 0,
init: CF_init,
clear: CF_clear,
put: CF_put,
bar: CF_bar,
+ icon: CF_icon,
gpo: NULL,
flush: CF_flush,
quit: CF_quit
-/* $Id: Cwlinux.c,v 1.13 2003/09/09 06:54:43 reinelt Exp $
+/* $Id: Cwlinux.c,v 1.14 2003/09/13 06:45:43 reinelt Exp $
*
* driver for Cwlinux serial display modules
*
*
*
* $Log: Cwlinux.c,v $
+ * Revision 1.14 2003/09/13 06:45:43 reinelt
+ * icons for all remaining drivers
+ *
* Revision 1.13 2003/09/09 06:54:43 reinelt
* new function 'cfg_number()'
*
#include "lock.h"
#include "display.h"
#include "bar.h"
+#include "icon.h"
#define CHARS 8
static char *Port = NULL;
static speed_t Speed;
static int Device = -1;
+static int Icons;
static char *FrameBuffer1=NULL;
static char *FrameBuffer2=NULL;
{
memset (FrameBuffer1, ' ', Lcd.rows*Lcd.cols*sizeof(char));
+
+ icon_clear();
bar_clear();
if (full) {
// backlight brightness
CW_Brightness();
- bar_init(Lcd.rows, Lcd.cols, Lcd.xres, Lcd.yres, CHARS);
+ if (cfg_number("Icons", 0, 0, CHARS, &Icons)<0) return -1;
+ if (Icons>0) {
+ debug ("reserving %d of %d user-defined characters for icons", Icons, CHARS);
+ icon_init(Lcd.rows, Lcd.cols, Lcd.xres, Lcd.yres, CHARS, Icons, CW12232_define_char);
+ Self->icons=Icons;
+ Lcd.icons=Icons;
+ }
+
+ bar_init(Lcd.rows, Lcd.cols, Lcd.xres, Lcd.yres, CHARS-Icons);
bar_add_segment( 0, 0,255, 32); // ASCII 32 = blank
return 0;
}
+int CW_icon (int num, int seq, int row, int col)
+{
+ return icon_draw (num, seq, row, col);
+}
+
+
int CW_flush(void)
{
int row, col, pos1, pos2;
for (row = 0; row < Lcd.rows; row++) {
for (col = 0; col < Lcd.cols; col++) {
c=bar_peek(row, col);
+ if (c==-1) c=icon_peek(row, col);
if (c!=-1) {
if (c!=32) c++; //blank
FrameBuffer1[row*Lcd.cols+col]=(char)c;
LCD Cwlinux[] = {
- {name: "CW12232",
- rows: 4,
- cols: 20,
- xres: 6,
- yres: 8,
- bars: BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2,
- gpos: 0,
- init: CW_init,
- clear: CW_clear,
- put: CW_put,
- bar: CW_bar,
- gpo: NULL,
- flush: CW12232_flush,
- quit: CW_quit
+ { name: "CW12232",
+ rows: 4,
+ cols: 20,
+ xres: 6,
+ yres: 8,
+ bars: BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2,
+ icons: 0,
+ gpos: 0,
+ init: CW_init,
+ clear: CW_clear,
+ put: CW_put,
+ bar: CW_bar,
+ icon: CW_icon,
+ gpo: NULL,
+ flush: CW12232_flush,
+ quit: CW_quit
},
- {name: "CW1602",
- rows: 2,
- cols: 16,
- xres: 5,
- yres: 8,
- bars: BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2,
- gpos: 0,
- init: CW_init,
- clear: CW_clear,
- put: CW_put,
- bar: CW_bar,
- gpo: NULL,
- flush: CW1602_flush,
- quit: CW_quit
+ { name: "CW1602",
+ rows: 2,
+ cols: 16,
+ xres: 5,
+ yres: 8,
+ bars: BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2,
+ icons: 0,
+ gpos: 0,
+ init: CW_init,
+ clear: CW_clear,
+ put: CW_put,
+ bar: CW_bar,
+ icon: CW_icon,
+ gpo: NULL,
+ flush: CW1602_flush,
+ quit: CW_quit
},
{NULL}
};
-/* $Id: MatrixOrbital.c,v 1.40 2003/09/11 04:09:53 reinelt Exp $
+/* $Id: MatrixOrbital.c,v 1.41 2003/09/13 06:45:43 reinelt Exp $
*
* driver for Matrix Orbital serial display modules
*
*
*
* $Log: MatrixOrbital.c,v $
+ * Revision 1.41 2003/09/13 06:45:43 reinelt
+ * icons for all remaining drivers
+ *
* Revision 1.40 2003/09/11 04:09:53 reinelt
* minor cleanups
*
#include "cfg.h"
#include "lock.h"
#include "display.h"
-#include "icon.h"
#include "bar.h"
+#include "icon.h"
#define XRES 5
#define YRES 8
}
-int MO_icon_old (int num, int row, int col, unsigned char *bitmap)
-{
- // icons use last ascii codes
- char ascii=CHARS-num;
-
- MO_define_char (ascii, bitmap);
- MO_goto(row, col);
- MO_write(&ascii, 1);
- FrameBuffer1[row*Lcd.cols+col]=(char)ascii;
- FrameBuffer2[row*Lcd.cols+col]=(char)ascii;
-
- return 0;
-}
-
-
int MO_icon (int num, int seq, int row, int col)
{
return icon_draw (num, seq, row, col);
-/* $Id: PalmPilot.c,v 1.12 2003/09/09 06:54:43 reinelt Exp $
+/* $Id: PalmPilot.c,v 1.13 2003/09/13 06:45:43 reinelt Exp $
*
* driver for 3Com Palm Pilot
*
*
*
* $Log: PalmPilot.c,v $
+ * Revision 1.13 2003/09/13 06:45:43 reinelt
+ * icons for all remaining drivers
+ *
* Revision 1.12 2003/09/09 06:54:43 reinelt
* new function 'cfg_number()'
*
#include "lock.h"
#include "display.h"
#include "bar.h"
+#include "icon.h"
#include "pixmap.h"
static int rgap=0;
static int cgap=0;
static int border=0;
+static int icons;
static int Palm_open (void)
{
return -1;
}
+ if (cfg_number("Icons", 0, 0, 8, &icons) < 0) return -1;
+ if (icons>0) {
+ info ("allocating %d icons", icons);
+ icon_init(rows, cols, xres, yres, 8, icons, pix_icon);
+ }
+
+
Self->rows=rows;
Self->cols=cols;
Self->xres=xres;
Self->yres=yres;
+ Self->icons=icons;
Lcd=*Self;
// Device=open ("PalmOrb.dat", O_WRONLY | O_CREAT | O_TRUNC, 0644);
return pix_bar (type, row, col, max, len1, len2);
}
+int Palm_icon (int num, int seq, int row, int col)
+{
+ return icon_draw (num, seq, row, col);
+}
+
int Palm_quit (void)
{
debug ("closing port %s", Port);
xres: 0,
yres: 0,
bars: BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2 | BAR_V2 | BAR_T,
+ icons: 0,
gpos: 0,
init: Palm_init,
clear: Palm_clear,
put: Palm_put,
bar: Palm_bar,
+ icon: Palm_icon,
gpo: NULL,
flush: Palm_flush,
quit: Palm_quit },
-/* $Id: SIN.c,v 1.12 2003/08/24 05:17:58 reinelt Exp $
+/* $Id: SIN.c,v 1.13 2003/09/13 06:45:43 reinelt Exp $
*
* driver for SIN router displays
*
*
*
* $Log: SIN.c,v $
+ * Revision 1.13 2003/09/13 06:45:43 reinelt
+ * icons for all remaining drivers
+ *
* Revision 1.12 2003/08/24 05:17:58 reinelt
* liblcd4linux patch from Patrick Schemitz
*
xres: XRES,
yres: YRES,
bars: BAR_L | BAR_R,
+ icons: 0,
gpos: 0,
init: SIN_init,
clear: SIN_clear,
put: SIN_put,
bar: SIN_bar,
+ icon: NULL,
gpo: NULL,
flush: SIN_flush,
quit: SIN_quit },
-/* $Id: Skeleton.c,v 1.10 2003/08/17 12:11:58 reinelt Exp $
+/* $Id: Skeleton.c,v 1.11 2003/09/13 06:45:43 reinelt Exp $
*
* skeleton driver for new display modules
*
*
*
* $Log: Skeleton.c,v $
+ * Revision 1.11 2003/09/13 06:45:43 reinelt
+ * icons for all remaining drivers
+ *
* Revision 1.10 2003/08/17 12:11:58 reinelt
* framework for icons prepared
*
return 0;
}
+int Skel_icon (int num, int seq, int row, int col)
+{
+ return 0;
+}
+
int Skel_gpo (int num, int val)
{
return 0;
xres: 5,
yres: 8,
bars: BAR_L|BAR_R,
- gpo: 0,
+ icons: 0,
+ gpos: 0,
init: Skel_init,
clear: Skel_clear,
put: Skel_put,
bar: Skel_bar,
+ icon: Skel_icon,
gpo: Skel_gpo,
flush: Skel_flush,
quit: Skel_quit },
-/* $Id: T6963.c,v 1.10 2003/08/16 07:31:35 reinelt Exp $
+/* $Id: T6963.c,v 1.11 2003/09/13 06:45:43 reinelt Exp $
*
* driver for display modules based on the Toshiba T6963 chip
*
*
*
* $Log: T6963.c,v $
+ * Revision 1.11 2003/09/13 06:45:43 reinelt
+ * icons for all remaining drivers
+ *
* Revision 1.10 2003/08/16 07:31:35 reinelt
* double buffering in all drivers
*
#include "cfg.h"
#include "display.h"
#include "bar.h"
+#include "icon.h"
#include "parport.h"
#include "udelay.h"
#include "pixmap.h"
#define YRES 8
static LCD Lcd;
+static int Icons;
unsigned char *Buffer1, *Buffer2;
return -1;
}
+ if (cfg_number("Icons", 0, 0, 8, &Icons) < 0) return -1;
+ if (Icons>0) {
+ info ("allocating %d icons", Icons);
+ icon_init(Lcd.rows, Lcd.cols, Lcd.xres, Lcd.yres, 8, Icons, pix_icon);
+ Self->icons=Icons;
+ Lcd.icons=Icons;
+ }
+
Buffer1=malloc(Lcd.cols*Lcd.rows*Lcd.yres);
if (Buffer1==NULL) {
error ("T6963: malloc(%d) failed: %s", Lcd.cols*Lcd.rows*Lcd.yres, strerror(errno));
}
+int T6_icon (int num, int seq, int row, int col)
+{
+ return icon_draw (num, seq, row, col);
+}
+
+
int T6_flush (void)
{
int i, j, e;
xres: 6,
yres: 8,
bars: BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2 | BAR_V2 | BAR_T,
+ icons: 0,
gpos: 0,
init: T6_init,
clear: T6_clear,
put: T6_put,
bar: T6_bar,
+ icon: T6_icon,
gpo: NULL,
flush: T6_flush,
quit: T6_quit
xres: 8,
yres: 8,
bars: BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2 | BAR_V2 | BAR_T,
+ icons: 0,
gpos: 0,
init: T6_init,
clear: T6_clear,
put: T6_put,
bar: T6_bar,
+ icon: T6_icon,
gpo: NULL,
flush: T6_flush,
quit: T6_quit
-/* $Id: Text.c,v 1.10 2003/08/24 05:17:58 reinelt Exp $
+/* $Id: Text.c,v 1.11 2003/09/13 06:45:43 reinelt Exp $
*
* pure ncurses based text driver
*
*
*
* $Log: Text.c,v $
+ * Revision 1.11 2003/09/13 06:45:43 reinelt
+ * icons for all remaining drivers
+ *
* Revision 1.10 2003/08/24 05:17:58 reinelt
* liblcd4linux patch from Patrick Schemitz
*
xres: 1,
yres: 1,
bars: BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2,
+ icons: 0,
gpos: 0,
init: Text_init,
clear: Text_clear,
put: Text_put,
bar: Text_bar,
+ icon: NULL,
gpo: NULL,
flush: Text_flush,
quit: Text_quit