]> git.webhop.me Git - lcd4linux.git/commitdiff
[lcd4linux @ 2003-08-17 12:11:58 by reinelt]
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Sun, 17 Aug 2003 12:11:58 +0000 (12:11 +0000)
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Sun, 17 Aug 2003 12:11:58 +0000 (12:11 +0000)
framework for icons prepared

git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@221 3ae390bd-cb1e-0410-b409-cd5a39f66f1f

PalmPilot.c
Raster.c
SIN.c
Skeleton.c
display.c
display.h

index 9527dfe041bf17f4159a5199082a5843c9ba8c6b..92d2d88fcd2a3b68f10c6157e3242f339dec8f64 100644 (file)
@@ -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 }
 };
index 39d9e7c849b97647353e1916d1709eabe7a39598..65b7f63e007baad618096170f38af11328e0f274 100644 (file)
--- 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
  *
 #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 ca8c1b8bce5a5216cd35ea3da6d2622dbee28ce2..52312c635f690834a75cfddfd3ee4bd1fa673ae5 100644 (file)
--- 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 }
 };
index cc9c733ba60fd92a3a7eac7a743084eafd9f578d..7e9b0d9461aaf65a504911d780fa116c1dd64847 100644 (file)
@@ -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 }
 };
index 89b6f864917438a4b36749bd44e2d5aac112bc8d..038dcf47ec834c7b5eee8161d6ac6a183601f152 100644 (file)
--- 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;
index 374ede61aa5dfb5e56286e985c6454f809ab36c4..68087ea8e368f6bec13e8ee53e6b0d0035961830 100644 (file)
--- 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