Re: New drivers

Scott Meharg <[email protected]> Mon, 28 Jan 2013 11:55:36 -0600
Newsgroups gmane.comp.sysutils.lcdproc
Message-ID <CAOgbcjTiW2Obm=Nxyv3a9mCNSJwwrfOvCmCeagNnWK43hdcKrA@mail.gmail.com>
Here is the patch and file for glcd-x11 driver. The way I modified
automake's files, the following files are expected to be in the same
location as glcd-x11.c.

libX11.a libxcb.a libXau.a libXdmcp.a

These files might be found in /usr/lib/i386-linux-gnu/.

If there is a better way to setup automake for this please feel free
to do so and let me know.


On Sat, Jan 26, 2013 at 2:24 PM, Chris Jones <[email protected]> wrote:
> Hi
>
> Scott Meharg <ssmeharg <at> gmail.com> writes:
>> I am currently working on a couple of drivers.  One is a X11 window
>> driver to simulate an LCD.  Like the
>
> Did anything come of the X11 window driver? I find it very helpful with
> lcd4linux to use the X11 driver for rapid testing, particularly when I am
> not in the same room as my LCD :)
>
> Cheers,
>
> Chris Jones
>
> _______________________________________________
> LCDproc mailing list
> [email protected]
> http://lists.omnipotent.net/mailman/listinfo/lcdproc

_______________________________________________
LCDproc mailing list
[email protected]
http://lists.omnipotent.net/mailman/listinfo/lcdproc
glcd-x11.c (text/x-csrc, 12.1 KB)
/** \file server/drivers/glcd-x11.c
 * This driver writes the framebuffer content to an X11 window.
 * Written to mimic X11 driver written for lcd4linux. Except this one does not
 * have graphical buttons or cell gaps.  Written to represent a graphical LCD
 * only.
 */

/*-
  * Copyright (c) 2012 Scott Meharg <[email protected]>
 *
 * This file is released under the GNU General Public License. Refer to the
 * COPYING file distributed with this package.
 */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <stdlib.h>
#include <errno.h>
#include <stdio.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <signal.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xresource.h>

#include "lcd.h"
#include "report.h"
#include "glcd-low.h"

#define X11_DEF_PIXEL_SIZE		"3+1"
#define X11_DEF_PIXEL_COLOR		0x000000
#define X11_DEF_BACKLIGHT_COLOR		0x80FF80
#define X11_DEF_BORDER			20
#define X11_DEF_INVERTED		0

/** Private data for the X11 connection type */
typedef struct glcd_x11_data {
	int pixel;
	int pgap;
	int border;
	unsigned long bgcolor;
	unsigned long fgcolor;
	unsigned char inverted;
	
	Display *dp;
	int sc;
	Window w,rw;
	Visual *vi;
	GC gc;

	int dimx,dimy;
	Atom wmDeleteMessage;
	
	unsigned char *backingstore;
} CT_x11_data;

/* Prototypes */
void glcd_x11_blit(PrivateData *p);
void glcd_x11_close(PrivateData *p);
unsigned char glcd_x11_pollkeys(PrivateData *p);
void glcd_x11_set_backlight(PrivateData *p, int state);
void x11w_adj_contrast_brightness(unsigned long *pfgc, unsigned long *pbgc, int contrast, int brightness);
void x11w_draw_pixel(CT_x11_data *ct_data, int x, int y, unsigned long fgc, unsigned long bgc, int backlightstate);

/**
 * Draws the LCD pixel in the X11 window.
 * \param ct_data	Connection type's private data.
 * \param x			LCD x position.
 * \param y			LCD y posiition.
 * \param fgc		Foreground color.
 * \param bgc		Background color
 */
void
x11w_draw_pixel(CT_x11_data *ct_data, int x, int y, unsigned long fgc, unsigned long bgc, int backlightstate)
{
	int pxlsize = ct_data->pixel + ct_data->pgap;
	int xoffset = ct_data->border + (x * pxlsize);
	int yoffset = ct_data->border + (y * pxlsize);

	/* The basically erases the area beneath LCD pixel being drawned. */
	XSetForeground(ct_data->dp, ct_data->gc, bgc);
	XFillRectangle(ct_data->dp, ct_data->w, ct_data->gc, xoffset, yoffset,
		pxlsize, pxlsize);
	
	/* Only draw if fgc is different from bgc.  No need to draw the same
	 * area twice.
	 */
	if (fgc != bgc) {
		XSetForeground(ct_data->dp, ct_data->gc, fgc);
		XFillRectangle(ct_data->dp, ct_data->w, ct_data->gc, xoffset,
			yoffset, ct_data->pixel, ct_data->pixel);
	}
}

/**
 * Adjusts the foreground color and background color for contrast and
 * brightness.
 * \param pfgc		Pointer to foreground color that will be updated.
 * \param pbgc		Pointer to background color that will be updated.
 * \param contrast	The contrast value between 0 - 1000.
 * \param brightness	The brightness value between 0 - 1000.
 */
void
x11w_adj_contrast_brightness(unsigned long *pfgc, unsigned long *pbgc, int contrast, int brightness)
{
	float adjf = 0;

	unsigned long fgc = *pfgc;
	unsigned long bgc = *pbgc;

	unsigned char fgr = (fgc >> 16);
	unsigned char fgg = ((fgc << 8) >> 16);
	unsigned char fgb = ((fgc << 16) >> 16);

	unsigned char bgr = (bgc >> 16);
	unsigned char bgg = ((bgc << 8) >> 16);
	unsigned char bgb = ((bgc << 16) >> 16);

	/* Adjust contrast */
	adjf = ((1000 - contrast) / (float)1000);

	fgr += ((bgr - fgr) * adjf);
	fgg += ((bgg - fgg) * adjf);
	fgb += ((bgb - fgb) * adjf);


	/* Adjust the brightness */
	adjf = ((1000 - brightness) / (float)1000);

	bgr -= (bgr * adjf);
	bgg -= (bgg * adjf);
	bgb -= (bgb * adjf);

	fgr -= (fgr * adjf);
	fgg -= (fgg * adjf);
	fgb -= (fgb * adjf);

	fgc = (fgr << 16) + (fgg << 8) + fgb;
	bgc = (bgr << 16) + (bgg << 8) + bgb;

	*pfgc = fgc;
	*pbgc = bgc;
}

/**
 * API: Initialize the connection type driver.
 * \param drvthis  Pointer to driver structure.
 * \retval 0       Success.
 * \retval <0      Error.
 */
int
glcd_x11_init(Driver *drvthis)
{
	PrivateData *p = (PrivateData *)drvthis->private_data;
	CT_x11_data *ct_data;
	char buf[256];

	report(RPT_INFO, "GLCD/x11: intializing");

	/* Set up connection type low-level functions */
	p->glcd_functions->blit = glcd_x11_blit;
	p->glcd_functions->close = glcd_x11_close;
	p->glcd_functions->poll_keys = glcd_x11_pollkeys;
	p->glcd_functions->set_backlight = glcd_x11_set_backlight;

	/* Allocate memory structures */
	ct_data = (CT_x11_data *) calloc(1, sizeof(CT_x11_data));
	if (ct_data == NULL) {
		report(RPT_ERR, "GLCD/x11: error allocating connection data");
		return -1;
	}
	p->ct_data = ct_data;
	
	ct_data->backingstore = malloc(p->framebuf.size);
	if (ct_data->backingstore == NULL) {
		report(RPT_ERR, "GLCD/x11: unable to allocate backing store");
		return -1;
	}
	memset(ct_data->backingstore, 0x00, p->framebuf.size);
	
	ct_data->border = 20;
	ct_data->bgcolor = 0x80FF80;
	ct_data->fgcolor = 0x000000;
	
	/* Get PixelSize */
	strncpy(buf, drvthis->config_get_string(drvthis->name, "x11_PixelSize",
		0, X11_DEF_PIXEL_SIZE),sizeof(buf));
	buf[sizeof(buf)-1] = '\0';

	if ( (sscanf(buf, "%d+%d", &ct_data->pixel, &ct_data->pgap) != 2) ||
	     (ct_data->pixel <= 0) || (ct_data->pgap < 0) ) {
		report(RPT_WARNING, "GLCD/x11: Cannot read/use PixelSize: %s; using default %s",
			buf, X11_DEF_PIXEL_SIZE);
		strncpy(buf,X11_DEF_PIXEL_SIZE,sizeof(buf));
		buf[sizeof(buf)-1] = '\0';
		/* this assumes X11_DEF_PIXEL_SIZE is usable */
		sscanf(buf,"%d+%d",&ct_data->pixel, &ct_data->pgap);
	}
	
	/* Get Pixel Color (pixel on color) */
	ct_data->fgcolor = drvthis->config_get_int(drvthis->name,
		"x11_PixelColor", 0, X11_DEF_PIXEL_COLOR);

	/* Get Backligh Color (pixel off color) */
	ct_data->bgcolor = drvthis->config_get_int(drvthis->name,
		"x11_BacklightColor", 0, X11_DEF_BACKLIGHT_COLOR);
	
	/* Get Border size in pixels */
	ct_data->border = drvthis->config_get_int(drvthis->name,
		"x11_Border", 0, X11_DEF_BORDER);
	
	/* Get inverted setting */
	ct_data->inverted = drvthis->config_get_bool(drvthis->name, "x11_Inverted", 0, X11_DEF_INVERTED);
	
	XSetWindowAttributes wa;
	XSizeHints sh;
	XEvent ev;

	if ((ct_data->dp = XOpenDisplay(NULL)) == NULL) {
		report(RPT_ERR, "GLCD/x11: can't open display");
		return -1;
	}

	ct_data->sc = DefaultScreen(ct_data->dp);
	ct_data->gc = DefaultGC(ct_data->dp, ct_data->sc);
	ct_data->vi = DefaultVisual(ct_data->dp, ct_data->sc);
	ct_data->rw = DefaultRootWindow(ct_data->dp);
	
	ct_data->dimx = (p->framebuf.px_width * (ct_data->pixel +
		ct_data->pgap))+ (ct_data->border * 2);
	ct_data->dimy = (p->framebuf.px_height * (ct_data->pixel +
		ct_data->pgap)) + (ct_data->border * 2);
		
	wa.event_mask = ExposureMask | KeyPressMask | KeyReleaseMask |
		ButtonPressMask | ButtonReleaseMask;

	sh.min_width = sh.max_width = ct_data->dimx;
	sh.min_height = sh.max_height = ct_data->dimy;
	sh.flags = PPosition | PSize | PMinSize | PMaxSize;

	if (sh.min_width > DisplayWidth(ct_data->dp, ct_data->sc) ||
		sh.min_height > DisplayHeight(ct_data->dp, ct_data->sc)) {
		report(RPT_WARNING, "GLCD/x11: Warning: X11-Window with dimensions (%d,%d) is greater than display (%d,%d)!",
		    sh.min_width, sh.min_height, DisplayWidth(ct_data->dp,
			ct_data->sc), DisplayHeight(ct_data->dp, ct_data->sc));
		if (sh.min_width > 32767 || sh.min_height > 32676) {
			report(RPT_ERR,
				"GLCD/x11: XProtocol data size exceeded");
			return -1;
		}
	}

	ct_data->w = XCreateWindow(ct_data->dp, ct_data->rw, 0, 0, sh.min_width,
	       sh.min_height, 0, 0, InputOutput, ct_data->vi, CWEventMask, &wa);

	XSetWMProperties(ct_data->dp, ct_data->w, NULL, NULL, NULL, 0, &sh,
		NULL, NULL);
	ct_data->wmDeleteMessage = XInternAtom(ct_data->dp, "WM_DELETE_WINDOW",
		False);
	XSetWMProtocols(ct_data->dp, ct_data->w, &ct_data->wmDeleteMessage, 1);

	XSetWindowBackground(ct_data->dp, ct_data->w, ct_data->bgcolor);
	XClearWindow(ct_data->dp, ct_data->w);

	XStoreName(ct_data->dp, ct_data->w, "GLCD/x11");
	XMapWindow(ct_data->dp, ct_data->w);

	XFlush(ct_data->dp);

	while (1) {
		XNextEvent(ct_data->dp, &ev);
		if (ev.type == Expose && ev.xexpose.count == 0)
			break;
	}
	
	debug(RPT_DEBUG, "GLCD/x11: init() done");

	return 0;
}

/**
 * API: Write the framebuffer to the display
 * \param p  Pointer to glcd driver's private date structure.
 */
void
glcd_x11_blit(PrivateData *p)
{
	CT_x11_data *ct_data = (CT_x11_data *) p->ct_data;
	
	/* Check if framebufer has changed. If not there's nothing to do */
	if (memcmp(p->framebuf.data, ct_data->backingstore, p->framebuf.size)
		== 0)
		return;
	
	unsigned long fgc = ct_data->fgcolor;
	unsigned long bgc = ct_data->bgcolor;
	int y;
	int x;

	/* Adjust colors for contrast and brightness */
	if (p->backlightstate == 0) {
		x11w_adj_contrast_brightness(&fgc, &bgc, p->contrast,
			p->offbrightness);
	}
	else {
		x11w_adj_contrast_brightness(&fgc, &bgc, p->contrast,
			p->brightness);
	}

	/* Draw each LCD pixel on the X11 window. */
	for (y = 0; y < p->framebuf.px_height; y++) {
		for (x = 0; x < p->framebuf.px_width; x++) {
			if ((fb_get_pixel(&p->framebuf, x, y) ^ ct_data->inverted) == FB_BLACK)
				x11w_draw_pixel(ct_data, x, y, fgc, bgc, p->backlightstate);
			else
				x11w_draw_pixel(ct_data, x, y, bgc, bgc, p->backlightstate);
			/*
			if (fb_get_pixel(&p->framebuf, x, y) == FB_BLACK) {
				if (ct_data->inverted)
					x11w_draw_pixel(ct_data, x, y, bgc, bgc);
				else
					x11w_draw_pixel(ct_data, x, y, fgc, bgc);
			}
			else {
				if (ct_data->inverted)
					x11w_draw_pixel(ct_data, x, y, fgc, bgc);
				else
					x11w_draw_pixel(ct_data, x, y, bgc, bgc);
			}
			*/
		}
	}
		
	XFlush(ct_data->dp);
	memcpy(ct_data->backingstore, p->framebuf.data, p->framebuf.size);

}

/**
 * API: Release low-level resources.
 * \param p  Pointer to glcd driver's private date structure.
 */
void
glcd_x11_close(PrivateData *p)
{
	if (p->ct_data != NULL) {
		CT_x11_data *ct_data = (CT_x11_data *) p->ct_data;
		
		if (ct_data->dp != NULL) {
			XCloseDisplay(ct_data->dp);
		}

		if (ct_data->backingstore != NULL)
			free(ct_data->backingstore);

		free(p->ct_data);
		p->ct_data = NULL;
	}
}

/**
 * API: Poll for keypresses.
 * \param p  Pointer to glcd driver's private data structure.
 */
unsigned char
glcd_x11_pollkeys(PrivateData *p)
{
	CT_x11_data *ct_data = (CT_x11_data *) p->ct_data;
	unsigned char rv = 0;

	XEvent ev;
	KeySym key;

	if (XCheckWindowEvent(ct_data->dp, ct_data->w, KeyPressMask |
		KeyReleaseMask | ButtonPressMask | ButtonReleaseMask, &ev) == 0
		&& XCheckTypedWindowEvent(ct_data->dp, ct_data->w,
		ClientMessage, &ev) == 0)
		return 0;

	switch (ev.type) {
		case KeyPress:
			key = XLookupKeysym(&ev.xkey, 0);

			switch (key) {
				case XK_Up:
					rv = 1;
					break;
				case XK_Down:
					rv = 2;
					break;
				case XK_Left:
					rv = 3;
					break;
				case XK_Right:
					rv = 4;
				case XK_Escape:
					rv = 6;
					break;
				case XK_Return:
					rv = 5;
					break;
			}

			break;

		case ClientMessage:
			if ((Atom)(ev.xclient.data.l[0]) ==
				ct_data->wmDeleteMessage) {
				p->glcd_functions->drv_report(RPT_INFO,
				    "GLCD/x11: Window closed by WindowManager");

				if (raise(SIGTERM) != 0) {
					p->glcd_functions->drv_report(RPT_ERR,
					      "GLCD/x11: Error rasing SIGTERM");
				}
			}
			else {
				p->glcd_functions->drv_report(RPT_DEBUG,
				"GLCD/x11: Get XClient message 0x!lx %lx %lx %lx %lx",
				    ev.xclient.data.l[0], ev.xclient.data.l[1],
				    ev.xclient.data.l[2], ev.xclient.data.l[3],
				    ev.xclient.data.l[4]);
			}
			break;
	}

	return rv;
}

/**
 * API: Switch backlight on and off.
 * \param p		Pointer to glcd driver's private data structure.
 * \param state		State of backglight.
 */
void
glcd_x11_set_backlight(PrivateData *p, int state)
{
	CT_x11_data *ct_data = p->ct_data;
	
	unsigned long fgc = ct_data->fgcolor;
	unsigned long bgc = ct_data->bgcolor;
	
	if (state == 0) {	
		x11w_adj_contrast_brightness(&fgc, &bgc, p->contrast,
			p->offbrightness);
		XSetWindowBackground(ct_data->dp, ct_data->w, bgc);
	}
	else {
		x11w_adj_contrast_brightness(&fgc, &bgc, p->contrast,
			p->brightness);
		XSetWindowBackground(ct_data->dp, ct_data->w, bgc);
	}

	XClearWindow(ct_data->dp, ct_data->w);
	memset(ct_data->backingstore, 0, p->framebuf.size);
}
glcd-x11.patch (application/octet-stream, 8.3 KB)
Index: lcdproc/LCDd.conf
===================================================================
RCS file: /cvsroot/lcdproc/lcdproc/LCDd.conf,v
retrieving revision 1.166
diff -u -r1.166 LCDd.conf
--- lcdproc/LCDd.conf	17 Jan 2013 22:15:45 -0000	1.166
+++ lcdproc/LCDd.conf	28 Jan 2013 17:26:10 -0000
@@ -431,6 +431,26 @@
 # Important: The value must be quoted as it contains equal signs!
 #serdisp_options="INVERT=1"
 
+# x11: Options
+
+# PixelSize is size of each dot in pixels + a pixel gap. [default: 3+1]
+#x11_PixelSize=3+1
+
+# Colors are in RRGGBB format prefixed with "0x".
+# PixelColor the color of each dot at full contrast. [default: 0x000000]
+#x11_PixelColor=0x000000
+
+# BacklightColor: the color of the backlight as full brightness.
+# [default: 0x80FF80]
+#x11_BacklightColor=0x80FF80
+
+# Border: Adds a border around the LCD portion of X11 window. [default: 20]
+#x11_Border=20
+
+# Inverted: inverts the pixels [default: no; legal: yes, no]
+#x11_Inverted=no
+
+# x11: End of options
 
 
 ## glcdlib meta driver for graphical LCDs ##
Index: lcdproc/acinclude.m4
===================================================================
RCS file: /cvsroot/lcdproc/lcdproc/acinclude.m4,v
retrieving revision 1.128
diff -u -r1.128 acinclude.m4
--- lcdproc/acinclude.m4	27 Jan 2013 11:44:43 -0000	1.128
+++ lcdproc/acinclude.m4	28 Jan 2013 17:26:10 -0000
@@ -186,6 +186,14 @@
 				])
 			])
 			AC_SUBST(LIBSERDISP)
+			AC_CHECK_HEADERS([X11/Xlib.h],[
+				AC_DEFINE(HAVE_X11LIBS,[1],[Define to 1 if you have X11 support])
+				LIBX11_A="libX11.a libxcb.a libXau.a libXdmcp.a"
+				GLCD_DRIVERS="$GLCD_DRIVERS glcd-glcd-x11.o"
+			],[
+				AC_MSG_WARN([X11 support not found])
+			])
+			AC_SUBST(LIBX11_A)
 			DRIVERS="$DRIVERS glcd${SO}"
 			actdrivers=["$actdrivers glcd"]
 			;;
Index: lcdproc/docs/lcdproc-user/drivers/glcd.docbook
===================================================================
RCS file: /cvsroot/lcdproc/lcdproc/docs/lcdproc-user/drivers/glcd.docbook,v
retrieving revision 1.3
diff -u -r1.3 glcd.docbook
--- lcdproc/docs/lcdproc-user/drivers/glcd.docbook	4 Dec 2011 10:14:22 -0000	1.3
+++ lcdproc/docs/lcdproc-user/drivers/glcd.docbook	28 Jan 2013 17:26:10 -0000
@@ -80,6 +80,26 @@
 </para>
 </sect3>
 
+<sect3 id="glcd-ct-x11">
+<title>Connection type X11</title>
+<para>
+This connection type draws the frame buffer on a X window.
+This device features and adjustable LCD pixel size, pixel color, backglight
+color and simulates contrast and brightness. PC keyboard is used to simulate
+buttons.
+</para>
+</sect3>
+
+<sect3 id="glcd-ct-x11">
+<title>Connection type X11</title>
+<para>
+This connection type draws the frame buffer on a X window.
+This device features and adjustable LCD pixel size, pixel color, backglight
+color and simulates contrast and brightness. PC keyboard is used to simulate
+buttons.
+</para>
+</sect3>
+
 <!--
 <sect3 id="glcd-ct-xyz">
 <title>Connection type xyz</title>
@@ -107,6 +127,7 @@
     <parameter><literal>glcd2usb</literal></parameter> |
     <parameter><literal>png</literal></parameter> |
     <parameter><literal>serdisplib</literal></parameter>
+    <parameter><literal>x11</literal></parameter>
     }
   </term>
   <listitem><para>
@@ -419,6 +440,96 @@
 </varlistentry>
 </variablelist>
 
+<variablelist>
+<title>Settings for the x11 connection type</title>
+<varlistentry>
+  <term>
+    <property>x11_PixelSize</property>
+  </term>
+  <listitem><para>
+    Each LCD dot is draw in the X window as a filled rectanlge of this size plus
+    a gap between each filled rectangle.  A PixelSize of 3+1 would draw a 3x3
+    filled rectangle with a gap of 1 pixel to the right and bottom.  Effectively
+    using a 4x4 area of the window.
+    Default is 3+1.
+  </para></listitem>
+</varlistentry>
+<varlistentry>
+  <term>
+    <property>x11_PixelColor</property>
+  </term>
+  <listitem><para>
+    Formatted as 0xRRGGBB.
+    The color used to draw each LCD dot at full contrast and full brightness.
+    Default is 0x000000.
+  </para></listitem>
+</varlistentry>
+<varlistentry>
+  <term>
+    <property>x11_BacklightColor</property>
+  </term>
+  <listitem><para>
+    Formatted as 0xRRGGBB.
+    The color used for the backlight at full brightness.
+    Default is 0x80FF80.
+  </para></listitem>
+</varlistentry>
+<varlistentry>
+  <term>
+    <property>x11_Border</property>
+  </term>
+  <listitem><para>
+    Extra space in pixels around the LCD portion of the X window.
+    Default is 20.
+  </para></listitem>
+</varlistentry>
+</variablelist>
+
+<variablelist>
+<title>Settings for the x11 connection type</title>
+<varlistentry>
+  <term>
+    <property>x11_PixelSize</property>
+  </term>
+  <listitem><para>
+    Each LCD dot is draw in the X window as a filled rectanlge of this size plus
+    a gap between each filled rectangle.  A PixelSize of 3+1 would draw a 3x3
+    filled rectangle with a gap of 1 pixel to the right and bottom.  Effectively
+    using a 4x4 area of the window.
+    Default is 3+1.
+  </para></listitem>
+</varlistentry>
+<varlistentry>
+  <term>
+    <property>x11_PixelColor</property>
+  </term>
+  <listitem><para>
+    Formatted as 0xRRGGBB.
+    The color used to draw each LCD dot at full contrast and full brightness.
+    Default is 0x000000.
+  </para></listitem>
+</varlistentry>
+<varlistentry>
+  <term>
+    <property>x11_BacklightColor</property>
+  </term>
+  <listitem><para>
+    Formatted as 0xRRGGBB.
+    The color used for the backlight at full brightness.
+    Default is 0x80FF80.
+  </para></listitem>
+</varlistentry>
+<varlistentry>
+  <term>
+    <property>x11_Border</property>
+  </term>
+  <listitem><para>
+    Extra space in pixels around the LCD portion of the X window.
+    Default is 20.
+  </para></listitem>
+</varlistentry>
+</variablelist>
+
 </sect3>
 </sect2>
 </sect1>
Index: lcdproc/server/drivers/Makefile.am
===================================================================
RCS file: /cvsroot/lcdproc/lcdproc/server/drivers/Makefile.am,v
retrieving revision 1.110
diff -u -r1.110 Makefile.am
--- lcdproc/server/drivers/Makefile.am	27 Jan 2013 11:44:43 -0000	1.110
+++ lcdproc/server/drivers/Makefile.am	28 Jan 2013 17:26:10 -0000
@@ -44,7 +44,7 @@
 curses_LDADD =       @LIBCURSES@
 CwLnx_LDADD =        libLCD.a libbignum.a
 g15_LDADD =          @LIBG15@
-glcd_LDADD =         libLCD.a @GLCD_DRIVERS@ @FT2_LIBS@ @LIBPNG_LIBS@ @LIBSERDISP@ @LIBUSB_LIBS@
+glcd_LDADD =         libLCD.a @GLCD_DRIVERS@ @FT2_LIBS@ @LIBPNG_LIBS@ @LIBSERDISP@ @LIBUSB_LIBS@ @LIBX11_A@
 glcd_DEPENDENCIES =  @GLCD_DRIVERS@ glcd-glcd-render.o
 glcdlib_LDADD =      @LIBGLCD@
 glk_LDADD =          libbignum.a
@@ -91,7 +91,7 @@
 EyeboxOne_SOURCES =  lcd.h lcd_lib.h EyeboxOne.c EyeboxOne.h report.h
 g15_SOURCES =        lcd.h lcd_lib.h g15.h g15-num.c g15.c report.h
 glcd_SOURCES =       lcd.h report.h glcd_drv.c glcd_drv.h glcd-low.h glcd-drivers.h glcd-render.c glcd-render.h
-EXTRA_glcd_SOURCES = glcd-t6963.c t6963_low.c t6963_low.h glcd-png.c glcd-serdisp.c glcd-glcd2usb.c glcd-glcd2usb.h
+EXTRA_glcd_SOURCES = glcd-t6963.c t6963_low.c t6963_low.h glcd-png.c glcd-serdisp.c glcd-glcd2usb.c glcd-glcd2usb.h glcd-x11.c
 glcdlib_SOURCES =    lcd.h lcd_lib.h glcdlib.h glcdlib.c report.h
 glk_SOURCES =        lcd.h glk.c glk.h glkproto.c glkproto.h report.h
 hd44780_SOURCES =    lcd.h lcd_lib.h hd44780.h hd44780.c hd44780-drivers.h hd44780-low.h hd44780-charmap.h report.h adv_bignum.h
Index: lcdproc/server/drivers/glcd-drivers.h
===================================================================
RCS file: /cvsroot/lcdproc/lcdproc/server/drivers/glcd-drivers.h,v
retrieving revision 1.4
diff -u -r1.4 glcd-drivers.h
--- lcdproc/server/drivers/glcd-drivers.h	27 Nov 2011 10:36:51 -0000	1.4
+++ lcdproc/server/drivers/glcd-drivers.h	28 Jan 2013 17:26:10 -0000
@@ -25,6 +25,9 @@
 #ifdef HAVE_LIBUSB
 int glcd2usb_init(Driver *drvthis);
 #endif
+#ifdef HAVE_X11LIBS
+int glcd_x11_init(Driver *drvthis);
+#endif
 
 /* symbolic names for connection types */
 #define GLCD_CT_UNKNOWN		0
@@ -32,6 +35,7 @@
 #define GLCD_CT_PNG		2
 #define GLCD_CT_SERDISP		3
 #define GLCD_CT_GLCD2USB	4
+#define GLCD_CT_X11		5
 
 /** Structure linking symbolic names to initialization routines */
 typedef struct ConnectionMapping {
@@ -59,6 +63,9 @@
 #ifdef HAVE_LIBUSB
 	{"glcd2usb", GLCD_CT_GLCD2USB, glcd2usb_init},
 #endif
+#ifdef HAVE_X11LIBS
+	{"x11", GLCD_CT_X11, glcd_x11_init},
+#endif
 	/* default, end of structure element (do not delete) */
 	{NULL, GLCD_CT_UNKNOWN, NULL}
 };