From a64e6fe1fc676771b589503916bde0f857401119 Mon Sep 17 00:00:00 2001 From: reinelt <> Date: Fri, 24 Mar 2000 11:36:56 +0000 Subject: [lcd4linux @ 2000-03-24 11:36:56 by reinelt] new syntax for raster configuration changed XRES and YRES to be configurable PPM driver works nice --- XWindow.c | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 87 insertions(+), 16 deletions(-) (limited to 'XWindow.c') diff --git a/XWindow.c b/XWindow.c index e332f0b..d3bbc22 100644 --- a/XWindow.c +++ b/XWindow.c @@ -1,4 +1,4 @@ -/* $Id: XWindow.c,v 1.2 2000/03/23 07:24:48 reinelt Exp $ +/* $Id: XWindow.c,v 1.3 2000/03/24 11:36:56 reinelt Exp $ * * driver for X11 * @@ -20,6 +20,12 @@ * * * $Log: XWindow.c,v $ + * Revision 1.3 2000/03/24 11:36:56 reinelt + * + * new syntax for raster configuration + * changed XRES and YRES to be configurable + * PPM driver works nice + * * Revision 1.2 2000/03/23 07:24:48 reinelt * * PPM driver up and running (but slow!) @@ -42,6 +48,7 @@ #include #include +#include #include "cfg.h" #include "display.h" @@ -49,19 +56,62 @@ #define BARS ( BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2 | BAR_V2 ) +static int pixel=-1; +static int pgap=0; +static int rgap=0; +static int cgap=0; +static int border=0; + +static int foreground=0; +static int halfground=0; +static int background=0; + static DISPLAY Display; int X_flush (void) { - int r, c; + int xsize, ysize, row, col; + unsigned char *buffer; + unsigned char R[3], G[3], B[3]; + + xsize=2*border+(Display.cols-1)*cgap+Display.cols*Display.xres*(pixel+pgap); + ysize=2*border+(Display.rows-1)*rgap+Display.rows*Display.yres*(pixel+pgap); + + if ((buffer=malloc(xsize*ysize*sizeof(*buffer)))==NULL) + return -1; - for (r=0; r>16; + G[0]=0xff&background>>8; + B[0]=0xff&background; + + R[1]=0xff&halfground>>16; + G[1]=0xff&halfground>>8; + B[1]=0xff&halfground; + + R[2]=0xff&foreground>>16; + G[2]=0xff&foreground>>8; + B[2]=0xff&foreground; + + for (row=0; rowrows=rows; Self->cols=cols; + Self->xres=xres; + Self->yres=yres; Display=*Self; pix_clear(); @@ -114,6 +185,6 @@ int X_bar (int type, int row, int col, int max, int len1, int len2) DISPLAY XWindow[] = { - { "X11", 0, 0, XRES, YRES, BARS, X_init, X_clear, X_put, X_bar, X_flush }, + { "X11", 0, 0, 0, 0, BARS, X_init, X_clear, X_put, X_bar, X_flush }, { "" } }; -- cgit v1.2.3