diff options
author | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2003-08-17 12:11:58 +0000 |
---|---|---|
committer | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2003-08-17 12:11:58 +0000 |
commit | a7a01e3ffef0fdb4c3bb51afb2928c3f6828ccc9 (patch) | |
tree | c4478b210add468e37a2cf01444356130df0cb09 | |
parent | 425f0326d5960a40f264a64b625747d99bd59b4b (diff) | |
download | lcd4linux-a7a01e3ffef0fdb4c3bb51afb2928c3f6828ccc9.tar.gz |
[lcd4linux @ 2003-08-17 12:11:58 by reinelt]
framework for icons prepared
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@221 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to '')
-rw-r--r-- | PalmPilot.c | 21 | ||||
-rw-r--r-- | Raster.c | 35 | ||||
-rw-r--r-- | SIN.c | 21 | ||||
-rw-r--r-- | Skeleton.c | 20 | ||||
-rw-r--r-- | display.c | 18 | ||||
-rw-r--r-- | display.h | 30 |
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 } }; @@ -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 } }; @@ -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 } }; @@ -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 } }; @@ -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; @@ -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 |