From c9c3bfa9a9f5eba990bd3c303572c40d03fcd23b Mon Sep 17 00:00:00 2001 From: mmdolze Date: Sat, 4 May 2013 14:31:14 +0000 Subject: [PATCH] glcd driver: Add the 'x11' connection type that draws the screen to a X window (by S. Meharg). --- ChangeLog | 1 + LCDd.conf | 37 ++- acinclude.m4 | 3 + configure.ac | 23 ++ docs/lcdproc-user/drivers/glcd.docbook | 69 ++++ server/drivers/Makefile.am | 6 +- server/drivers/glcd-drivers.h | 7 + server/drivers/glcd-x11.c | 440 +++++++++++++++++++++++++ server/drivers/glcd_drv.c | 4 +- 9 files changed, 578 insertions(+), 12 deletions(-) create mode 100755 server/drivers/glcd-x11.c diff --git a/ChangeLog b/ChangeLog index 29fa9c4..68e662b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,7 @@ v0.5dev (ongoing development) + hd44780: Add support for FreeBSD's iic I2C framework + hd44780: New connection type 'piplate' (J. Brogdon) * lcdproc client: Add option to turn off title and heartbeat on OldTime screen + + glcd driver: Connection type 'x11' that draws to a X window (S. Meharg) v0.5.6 - Remove deprecated CFontz633 driver. Use CFontzPacket with Model=633 instead! diff --git a/LCDd.conf b/LCDd.conf index 8306b35..c2b2eb6 100644 --- a/LCDd.conf +++ b/LCDd.conf @@ -407,32 +407,55 @@ KeyMap_B=Down KeyMap_C=Enter KeyMap_D=Escape -# t6963: Parallel port to use [default: 0x378; legal: 0x200 - 0x400] +# --- t6963 options --- + +# Parallel port to use [default: 0x378; legal: 0x200 - 0x400] #Port=0x378 -# t6963: Use LPT port in bi-directional mode. This should work on most LPT port +# Use LPT port in bi-directional mode. This should work on most LPT port # and is required for proper timing! [default: yes; legal: yes, no] #bidirectional=yes -# t6963: Insert additional delays into reads / writes. [default: no; -# legal: yes, no] +# Insert additional delays into reads / writes. [default: no; legal: yes, no] #delayBus=no -# serdisplib: Name of the underlying serdisplib driver, e.g. ctinclud. See +# --- serdisplib options --- + +# Name of the underlying serdisplib driver, e.g. ctinclud. See # serdisplib documentation for details. serdisp_name=t6963 -# serdisplib: The display device to use, e.g. serraw:/dev/ttyS0, +# The display device to use, e.g. serraw:/dev/ttyS0, # parport:/dev/parport0 or USB:07c0/1501. serdisp_device=/dev/ppi0 -# serdisplib: Options string to pass to serdisplib during initialization. Use +# Options string to pass to serdisplib during initialization. Use # this to set any display related options (e.g. wiring). The display size is # always set based on the Size configured above! By default, no options are # set. # 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 (empty space) around the LCD portion of X11 window. +# [default: 20] +#x11_Border=20 + +# Inverted: inverts the pixels [default: no; legal: yes, no] +#x11_Inverted=no + ## glcdlib meta driver for graphical LCDs ## diff --git a/acinclude.m4 b/acinclude.m4 index 3fe1325..f6ce63a 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -186,6 +186,9 @@ dnl else ]) ]) AC_SUBST(LIBSERDISP) + if test "$enable_libX11" = yes ; then + GLCD_DRIVERS="$GLCD_DRIVERS glcd-glcd-x11.o" + fi DRIVERS="$DRIVERS glcd${SO}" actdrivers=["$actdrivers glcd"] ;; diff --git a/configure.ac b/configure.ac index 1fde957..abd5099 100644 --- a/configure.ac +++ b/configure.ac @@ -316,6 +316,29 @@ fi AC_SUBST(LIBFTDI_LIBS) AC_SUBST(LIBFTDI_CFLAGS) +dnl ###################################################################### +dnl X11 library support +dnl ###################################################################### +AC_MSG_CHECKING([if X11 support has been enabled]); +AC_ARG_ENABLE(libX11, + [AS_HELP_STRING([--disable-libX11],[disable X11 support])], + [ if test "$enableval" != "no"; then + enable_libX11=yes + fi ], + [ enable_libX11=yes ] +) +AC_MSG_RESULT($enable_libX11) + +if test "$enable_libX11" = "yes"; then + ifdef([PKG_CHECK_MODULES], + [PKG_CHECK_MODULES([LIBX11], [x11], + [AC_DEFINE(HAVE_LIBX11, [1], [Define to 1 if you have X11 library])], + [ enable_libX11=no ])], + [AC_MSG_WARN([pkg-config not (fully) installed; drivers requiring X11 may not be built])]) +fi +AC_SUBST(LIBX11_LIBS) +AC_SUBST(LIBX11_CFLAGS) + dnl ###################################################################### dnl libhid support dnl ###################################################################### diff --git a/docs/lcdproc-user/drivers/glcd.docbook b/docs/lcdproc-user/drivers/glcd.docbook index 585b741..9800fa5 100644 --- a/docs/lcdproc-user/drivers/glcd.docbook +++ b/docs/lcdproc-user/drivers/glcd.docbook @@ -80,6 +80,15 @@ ignored as the size reported by the device is used. + +Connection type x11 + +This connection type draws the frame buffer to a X window. It features +adjustable LCD pixel size, pixel color, backlight color and simulates +contrast and brightness. PC keyboard is used to simulate buttons. + + +