aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--PalmPilot.c21
-rw-r--r--Raster.c35
-rw-r--r--SIN.c21
-rw-r--r--Skeleton.c20
-rw-r--r--display.c18
-rw-r--r--display.h30
6 files changed, 118 insertions, 27 deletions
diff --git a/PalmPilot.c b/PalmPilot.c
index 9527dfe..92d2d88 100644
--- a/PalmPilot.c
+++ b/PalmPilot.c
@@ -1,4 +1,4 @@
-/* $Id: PalmPilot.c,v 1.9 2003/07/24 04:48:09 reinelt Exp $
+/* $Id: PalmPilot.c,v 1.10 2003/08/17 12:11:58 reinelt Exp $
*
* driver for 3Com Palm Pilot
*
@@ -20,6 +20,9 @@
*
*
* $Log: PalmPilot.c,v $
+ * Revision 1.10 2003/08/17 12:11:58 reinelt
+ * framework for icons prepared
+ *
* Revision 1.9 2003/07/24 04:48:09 reinelt
* 'soft clear' needed for virtual rows
*
@@ -85,7 +88,6 @@
#include "bar.h"
#include "pixmap.h"
-#define BARS ( BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2 | BAR_V2 | BAR_T)
static LCD Lcd;
static char *Port=NULL;
@@ -313,6 +315,19 @@ int Palm_quit (void)
}
LCD PalmPilot[] = {
- { "PalmPilot",0,0,0,0,BARS,0,Palm_init,Palm_clear,Palm_put,Palm_bar,NULL,Palm_flush,Palm_quit },
+ { name: "PalmPilot",
+ rows: 0,
+ cols: 0,
+ xres: 0,
+ yres: 0,
+ bars: BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2 | BAR_V2 | BAR_T,
+ gpos: 0,
+ init: Palm_init,
+ clear: Palm_clear,
+ put: Palm_put,
+ bar: Palm_bar,
+ gpo: NULL,
+ flush: Palm_flush,
+ quit: Palm_quit },
{ NULL }
};
diff --git a/Raster.c b/Raster.c
index 39d9e7c..65b7f63 100644
--- a/Raster.c
+++ b/Raster.c
@@ -1,4 +1,4 @@
-/* $Id: Raster.c,v 1.23 2003/07/29 04:56:13 reinelt Exp $
+/* $Id: Raster.c,v 1.24 2003/08/17 12:11:58 reinelt Exp $
*
* driver for raster formats
*
@@ -20,6 +20,9 @@
*
*
* $Log: Raster.c,v $
+ * Revision 1.24 2003/08/17 12:11:58 reinelt
+ * framework for icons prepared
+ *
* Revision 1.23 2003/07/29 04:56:13 reinelt
* disable Raster driver automagically if gd.h not found
*
@@ -151,8 +154,6 @@
#include "bar.h"
#include "pixmap.h"
-#define BARS ( BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2 | BAR_V2 | BAR_T )
-
static LCD Lcd;
static int pixel=-1;
@@ -410,10 +411,34 @@ int Raster_bar (int type, int row, int col, int max, int len1, int len2)
LCD Raster[] = {
#ifdef WITH_PPM
- { "PPM",0,0,0,0,BARS,0,Raster_init,Raster_clear,Raster_put,Raster_bar,NULL,PPM_flush },
+ { name: "PPM",
+ rows: 0,
+ cols: 0,
+ xres: 0,
+ yres: 0,
+ bars: BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2 | BAR_V2 | BAR_T,
+ gpos: 0,
+ init: Raster_init,
+ clear: Raster_clear,
+ put: Raster_put,
+ bar: Raster_bar,
+ gpo: NULL,
+ flush: PPM_flush },
#endif
#ifdef WITH_PNG
- { "PNG",0,0,0,0,BARS,0,Raster_init,Raster_clear,Raster_put,Raster_bar,NULL,PNG_flush },
+ { name: "PNG",
+ rows: 0,
+ cols: 0,
+ xres: 0,
+ yres: 0,
+ bars: BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2 | BAR_V2 | BAR_T,
+ gpos: 0,
+ init: Raster_init,
+ clear: Raster_clear,
+ put: Raster_put,
+ bar: Raster_bar,
+ gpo: NULL,
+ flush: PNG_flush },
#endif
{ NULL }
};
diff --git a/SIN.c b/SIN.c
index ca8c1b8..52312c6 100644
--- a/SIN.c
+++ b/SIN.c
@@ -1,4 +1,4 @@
-/* $Id: SIN.c,v 1.10 2003/08/17 08:25:30 reinelt Exp $
+/* $Id: SIN.c,v 1.11 2003/08/17 12:11:58 reinelt Exp $
*
* driver for SIN router displays
*
@@ -20,6 +20,9 @@
*
*
* $Log: SIN.c,v $
+ * Revision 1.11 2003/08/17 12:11:58 reinelt
+ * framework for icons prepared
+ *
* Revision 1.10 2003/08/17 08:25:30 reinelt
* preparations for liblcd4linux; minor bugs in SIN.c and Skeleton.c
*
@@ -88,7 +91,6 @@
#define XRES 1
#define YRES 1
-#define BARS ( BAR_L | BAR_R )
static LCD Lcd;
static char *Port=NULL;
@@ -280,6 +282,19 @@ int SIN_quit (void)
}
LCD SIN[] = {
- { "SIN",8,40,XRES,YRES,BARS,0,SIN_init,SIN_clear,SIN_put,SIN_bar,NULL,SIN_flush,SIN_quit },
+ { name: "SIN",
+ rows: 8,
+ cols: 40,
+ xres: XRES,
+ yres: YRES,
+ bars: BAR_L | BAR_R,
+ gpos: 0,
+ init: SIN_init,
+ clear: SIN_clear,
+ put: SIN_put,
+ bar: SIN_bar,
+ gpo: NULL,
+ flush: SIN_flush,
+ quit: SIN_quit },
{ NULL }
};
diff --git a/Skeleton.c b/Skeleton.c
index cc9c733..7e9b0d9 100644
--- a/Skeleton.c
+++ b/Skeleton.c
@@ -1,4 +1,4 @@
-/* $Id: Skeleton.c,v 1.9 2003/08/17 08:25:30 reinelt Exp $
+/* $Id: Skeleton.c,v 1.10 2003/08/17 12:11:58 reinelt Exp $
*
* skeleton driver for new display modules
*
@@ -20,6 +20,9 @@
*
*
* $Log: Skeleton.c,v $
+ * Revision 1.10 2003/08/17 12:11:58 reinelt
+ * framework for icons prepared
+ *
* Revision 1.9 2003/08/17 08:25:30 reinelt
* preparations for liblcd4linux; minor bugs in SIN.c and Skeleton.c
*
@@ -122,6 +125,19 @@ int Skel_quit (void)
LCD Skeleton[] = {
- { "Skeleton",4,20,5,8,BAR_L|BAR_R,0,Skel_init,Skel_clear,Skel_put,Skel_bar,Skel_gpo,Skel_flush, Skel_quit },
+ { name: "Skeleton",
+ rows: 4,
+ cols: 20,
+ xres: 5,
+ yres: 8,
+ bars: BAR_L|BAR_R,
+ gpo: 0,
+ init: Skel_init,
+ clear: Skel_clear,
+ put: Skel_put,
+ bar: Skel_bar,
+ gpo: Skel_gpo,
+ flush: Skel_flush,
+ quit: Skel_quit },
{ NULL }
};
diff --git a/display.c b/display.c
index 89b6f86..038dcf4 100644
--- a/display.c
+++ b/display.c
@@ -1,4 +1,4 @@
-/* $Id: display.c,v 1.35 2003/07/24 04:48:09 reinelt Exp $
+/* $Id: display.c,v 1.36 2003/08/17 12:11:58 reinelt Exp $
*
* framework for device drivers
*
@@ -20,6 +20,9 @@
*
*
* $Log: display.c,v $
+ * Revision 1.36 2003/08/17 12:11:58 reinelt
+ * framework for icons prepared
+ *
* Revision 1.35 2003/07/24 04:48:09 reinelt
* 'soft clear' needed for virtual rows
*
@@ -341,10 +344,21 @@ int lcd_bar (int type, int row, int col, int max, int len1, int len2)
if (!(type & BAR_T))
len2=(double)max*log(len2+1)/log(max);
}
- if (Lcd->put==NULL) return 0;
+ if (Lcd->bar==NULL) return 0;
return Lcd->bar (type & BAR_HV, row-1, col-1, max, len1, len2);
}
+int lcd_icon (int num, int row, int col, unsigned char *bitmap)
+{
+ if (num<1 || num>Lcd->icons) return -1;
+ if (row<1 || row>Lcd->rows) return -1;
+ if (col<1 || col>Lcd->cols) return -1;
+ if (Lcd->icon==NULL) return 0;
+
+ // Fixme: ToDo!
+ return 0;
+}
+
int lcd_gpo (int num, int val)
{
if (num<1 || num>Lcd->gpos) return -1;
diff --git a/display.h b/display.h
index 374ede6..68087ea 100644
--- a/display.h
+++ b/display.h
@@ -1,4 +1,4 @@
-/* $Id: display.h,v 1.16 2003/07/24 04:48:09 reinelt Exp $
+/* $Id: display.h,v 1.17 2003/08/17 12:11:58 reinelt Exp $
*
* framework for device drivers
*
@@ -20,6 +20,9 @@
*
*
* $Log: display.h,v $
+ * Revision 1.17 2003/08/17 12:11:58 reinelt
+ * framework for icons prepared
+ *
* Revision 1.16 2003/07/24 04:48:09 reinelt
* 'soft clear' needed for virtual rows
*
@@ -97,14 +100,16 @@ typedef struct LCD {
int xres;
int yres;
int bars;
+ int icons;
int gpos;
- int (*init) (struct LCD *Self);
+ int (*init) (struct LCD *Self);
int (*clear) (int full);
- int (*put) (int x, int y, char *text);
- int (*bar) (int type, int x, int y, int max, int len1, int len2);
- int (*gpo) (int num, int val);
+ int (*put) (int x, int y, char *text);
+ int (*bar) (int type, int x, int y, int max, int len1, int len2);
+ int (*icon) (int num, int row, int col, unsigned char *bitmap);
+ int (*gpo) (int num, int val);
int (*flush) (void);
- int (*quit) (void);
+ int (*quit) (void);
} LCD;
typedef struct {
@@ -112,14 +117,15 @@ typedef struct {
LCD *Model;
} FAMILY;
-int lcd_list (void);
-int lcd_init (char *driver);
+int lcd_list (void);
+int lcd_init (char *driver);
int lcd_query (int *rows, int *cols, int *xres, int *yres, int *bars, int *gpos);
int lcd_clear (int full);
-int lcd_put (int row, int col, char *text);
-int lcd_bar (int type, int row, int col, int max, int len1, int len2);
-int lcd_gpo (int num, int val);
+int lcd_put (int row, int col, char *text);
+int lcd_bar (int type, int row, int col, int max, int len1, int le2);
+int lcd_icon (int num, int row, int col, unsigned char *bitmap);
+int lcd_gpo (int num, int val);
int lcd_flush (void);
-int lcd_quit (void);
+int lcd_quit (void);
#endif