lcdproc-0.5.7/000755 001751 000000 00000000000 12330423234 013746 5ustar00mmdolzewheel000000 000000 lcdproc-0.5.7/Makefile.am000644 001751 000000 00000002110 11506112607 015777 0ustar00mmdolzewheel000000 000000 ## Process this file with automake to produce Makefile.in ## set automake strictness to 'foreign' AUTOMAKE_OPTIONS = foreign SUBDIRS = shared clients server docs scripts sysconf_DATA = LCDd.conf EXTRA_DIST = $(sysconf_DATA) CREDITS contrib dist-hook: rm -rf `find $(distdir)/contrib -name CVS` ## convenience targets .PHONY: $(SUBDIRS) install-server install-clients $(SUBDIRS): $(MAKE) -C $@ clients server: shared install-server: server $(MAKE) -C server install $(MAKE) -C docs install-server-man install-clients: clients $(MAKE) -C clients install $(MAKE) -C docs install-client-man .PHONY: install-html-guides install-html-developerguide install-html-userguide install-html-guides: install-html-developerguide install-html-userguide install-html-developerguide: $(MAKE) -C docs $@ install-html-userguide: $(MAKE) -C docs $@ .PHONY: dox topleveltags dox: $(MAKE) -C docs $@ topleveltags: $(CTAGS) --format=1 -f - --languages=C --c-kinds=f --recurse=yes server shared clients \ | perl -p -e 's/^([^\t]+)\t[^\t]+\/([^\t\/]+)\t(.*)$/$1\t$2\t$3/' > tags ## EOF lcdproc-0.5.7/acinclude.m4000644 001751 000000 00000105220 12313532717 016147 0ustar00mmdolzewheel000000 000000 dnl dnl Define function/macro for driver selection using the --enable-drivers=... option dnl AC_DEFUN([LCD_DRIVERS_SELECT], [ AC_MSG_NOTICE([checking which drivers to compile...]) AC_ARG_ENABLE(drivers, [ --enable-drivers= compile drivers for LCDs in ,] [ which is a comma-separated list of drivers.] [ Possible drivers are:] [ bayrad,CFontz,CFontzPacket,curses,CwLnx,ea65,] [ EyeboxOne,g15,glcd,glcdlib,glk,hd44780,i2500vfd,] [ icp_a106,imon,imonlcd,IOWarrior,irman,irtrans,] [ joy,lb216,lcdm001,lcterm,lirc,lis,MD8800,mdm166a,] [ ms6931,mtc_s16209x,MtxOrb,mx5000,NoritakeVFD,] [ picolcd,pyramid,rawserial,sdeclcd,sed1330,sed1520,] [ serialPOS,serialVFD,shuttleVFD,sli,stv5730,SureElec,] [ svga,t6963,text,tyan,ula200,vlsys_m428,xosd] [ ] [ 'all' compiles all drivers;] [ 'all,!xxx,!yyy' de-selects previously selected drivers], drivers="$enableval", drivers=[bayrad,CFontz,CFontzPacket,curses,CwLnx,glk,lb216,lcdm001,MtxOrb,pyramid,text]) allDrivers=[bayrad,CFontz,CFontzPacket,curses,CwLnx,ea65,EyeboxOne,g15,glcd,glcdlib,glk,hd44780,i2500vfd,icp_a106,imon,imonlcd,IOWarrior,irman,irtrans,joy,lb216,lcdm001,lcterm,lirc,lis,MD8800,mdm166a,ms6931,mtc_s16209x,MtxOrb,mx5000,NoritakeVFD,picolcd,pyramid,sdeclcd,sed1330,sed1520,serialPOS,serialVFD,shuttleVFD,sli,stv5730,SureElec,svga,t6963,text,tyan,ula200,vlsys_m428,xosd,rawserial] if test "$debug" = yes; then allDrivers=["${allDrivers},debug"] fi dnl replace special keyword "all" in a secure manner drivers=[" $drivers "] drivers=`echo " $drivers " | sed -e "s/ all,/ ${allDrivers} /"` drivers=`echo " $drivers " | sed -e "s/ all / ${allDrivers} /"` drivers=`echo $drivers | sed -e 's/,/ /g'` dnl ignore unwanted drivers selectdrivers=" " for driver in $drivers ; do case $driver in !*) driver=`echo "$driver" | sed -e 's/^.//'` selectdrivers=[`echo " $selectdrivers " | sed -e "s/ $driver / /g"`] ;; *) selectdrivers=["$selectdrivers $driver "] ;; esac done dnl check for wanted drivers and their dependencies for driver in $selectdrivers ; do case "$driver" in bayrad) DRIVERS="$DRIVERS bayrad${SO}" actdrivers=["$actdrivers bayrad"] ;; CFontz) DRIVERS="$DRIVERS CFontz${SO}" actdrivers=["$actdrivers CFontz"] ;; CFontzPacket) DRIVERS="$DRIVERS CFontzPacket${SO}" actdrivers=["$actdrivers CFontzPacket"] AC_CHECK_FUNCS(select, [ AC_CHECK_HEADERS(sys/select.h) ],[ AC_MSG_WARN([The CFontzPacket driver needs the select() function]) ]) ;; curses) AC_CHECK_HEADERS(ncurses.h curses.h) AC_CHECK_LIB(ncurses, main, [ AC_CHECK_HEADER(ncurses.h, [ dnl We have ncurses.h and libncurses, add driver. LIBCURSES="-lncurses" DRIVERS="$DRIVERS curses${SO}" actdrivers=["$actdrivers curses"] ],[ dnl else AC_MSG_WARN([Could not find ncurses.h])], []) ],[ dnl else AC_CHECK_LIB(curses, main, [ AC_CHECK_HEADER(curses.h, [ dnl We have curses.h and libcurses, add driver. LIBCURSES="-lcurses" DRIVERS="$DRIVERS curses${SO}" actdrivers=["$actdrivers curses"] ],[ dnl else AC_MSG_WARN([Could not find curses.h])], []) ],[ dnl else AC_MSG_WARN([The curses driver needs the curses (or ncurses) library.])], []) ]) AC_CURSES_ACS_ARRAY AC_CACHE_CHECK([for redrawwin() in curses], ac_cv_curses_redrawwin, [oldlibs="$LIBS" LIBS="$LIBS $LIBCURSES" AC_TRY_LINK_FUNC(redrawwin, ac_cv_curses_redrawwin=yes, ac_cv_curses_redrawwin=no) LIBS="$oldlibs" ]) if test "$ac_cv_curses_redrawwin" = yes; then AC_DEFINE(CURSES_HAS_REDRAWWIN,[1],[Define to 1 if you have the redrawwin function in the curses library]) fi AC_CACHE_CHECK([for wcolor_set() in curses], ac_cv_curses_wcolor_set, [oldlibs="$LIBS" LIBS="$LIBS $LIBCURSES" AC_TRY_LINK_FUNC(wcolor_set, ac_cv_curses_wcolor_set=yes, ac_cv_curses_wcolor_set=no) LIBS="$oldlibs" ]) if test "$ac_cv_curses_wcolor_set" = yes; then AC_DEFINE(CURSES_HAS_WCOLOR_SET,[1],[Define to 1 if you have the wcolor_set function in the curses library]) fi ;; CwLnx) DRIVERS="$DRIVERS CwLnx${SO}" actdrivers=["$actdrivers CwLnx"] ;; debug) DRIVERS="$DRIVERS debug${SO}" actdrivers=["$actdrivers debug"] ;; ea65) DRIVERS="$DRIVERS ea65${SO}" actdrivers=["$actdrivers ea65"] ;; EyeboxOne) DRIVERS="$DRIVERS EyeboxOne${SO}" actdrivers=["$actdrivers EyeboxOne"] ;; g15) AC_CHECK_HEADERS([g15daemon_client.h],[ AC_CHECK_LIB(g15daemon_client, new_g15_screen,[ LIBG15="-lg15daemon_client" ],[ dnl else AC_MSG_WARN([The g15 driver needs libg15daemon_client-1.2 or better]) ], [-lg15daemon_client] ) ],[ dnl else AC_MSG_WARN([The g15 driver needs g15daemon_client.h]) ]) AC_CHECK_HEADERS([libg15render.h],[ AC_CHECK_LIB(g15render, g15r_initCanvas,[ LIBG15="$LIBG15 -lg15render" DRIVERS="$DRIVERS g15${SO}" actdrivers=["$actdrivers g15"] ],[ dnl else AC_MSG_WARN([the g15 driver needs libg15render]) ], [-lg15render] ) ],[ dnl else AC_MSG_WARN([The g15driver needs libg15render.h]) ]) ;; glcd) GLCD_DRIVERS="" if test "$ac_cv_port_have_lpt" = yes ; then GLCD_DRIVERS="$GLCD_DRIVERS glcd-glcd-t6963.o t6963_low.o" fi if test "$enable_libpng" = yes ; then GLCD_DRIVERS="$GLCD_DRIVERS glcd-glcd-png.o" fi if test "$enable_libusb" = yes ; then GLCD_DRIVERS="$GLCD_DRIVERS glcd-glcd-glcd2usb.o glcd-glcd-picolcdgfx.o" fi AC_CHECK_HEADERS([serdisplib/serdisp.h],[ AC_CHECK_LIB(serdisp, serdisp_nextdisplaydescription,[ AC_DEFINE(HAVE_SERDISPLIB,[1],[Define to 1 if you have working serdisplib]) LIBSERDISP="-lserdisp" GLCD_DRIVERS="$GLCD_DRIVERS glcd-glcd-serdisp.o" ],[ AC_MSG_WARN([serdisp library not working]) ]) ]) 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"] ;; glcdlib) AC_CHECK_HEADERS([glcdproclib/glcdprocdriver.h],[ AC_CHECK_LIB(glcdprocdriver, main,[ LIBGLCD="-lglcddrivers -lglcdgraphics -lglcdprocdriver" DRIVERS="$DRIVERS glcdlib${SO}" actdrivers=["$actdrivers glcdlib"] ],[ dnl else AC_MSG_WARN([The glcdlib driver needs the glcdprocdriver library]) ], [-lglcddrivers -lglcdgraphics -lglcdprocdriver] ) ],[ dnl else AC_MSG_WARN([The glcdlib driver needs glcdproclib/glcdprocdriver.h]) ]) ;; glk) DRIVERS="$DRIVERS glk${SO}" actdrivers=["$actdrivers glk"] ;; hd44780) HD44780_DRIVERS="hd44780-hd44780-serial.o hd44780-hd44780-lis2.o hd44780-hd44780-usblcd.o" if test "$ac_cv_port_have_lpt" = yes ; then HD44780_DRIVERS="$HD44780_DRIVERS hd44780-hd44780-4bit.o hd44780-hd44780-ext8bit.o hd44780-lcd_sem.o hd44780-hd44780-winamp.o hd44780-hd44780-serialLpt.o" fi if test "$enable_libusb" = yes ; then HD44780_DRIVERS="$HD44780_DRIVERS hd44780-hd44780-bwct-usb.o hd44780-hd44780-lcd2usb.o hd44780-hd44780-uss720.o hd44780-hd44780-usbtiny.o hd44780-hd44780-usb4all.o" fi if test "$enable_libftdi" = yes ; then HD44780_DRIVERS="$HD44780_DRIVERS hd44780-hd44780-ftdi.o" fi if test "$enable_ethlcd" = yes ; then HD44780_DRIVERS="$HD44780_DRIVERS hd44780-hd44780-ethlcd.o" AC_DEFINE(WITH_ETHLCD,[1],[Define to 1 if you want to build hd44780 driver with ethlcd support]) fi if test "$x_ac_have_i2c" = yes; then HD44780_DRIVERS="$HD44780_DRIVERS hd44780-hd44780-i2c.o" HD44780_DRIVERS="$HD44780_DRIVERS hd44780-hd44780-piplate.o" fi if test "$x_ac_have_spi" = yes; then HD44780_DRIVERS="$HD44780_DRIVERS hd44780-hd44780-spi.o hd44780-hd44780-pifacecad.o" fi dnl The hd4470-rpi driver only works on a Raspberry Pi, dnl which is an ARM platform. Require people to compile on dnl (or for) ARM to get it. case $host in arm*-*-linux*) HD44780_DRIVERS="$HD44780_DRIVERS hd44780-hd44780-rpi.o" AC_DEFINE([WITH_RASPBERRYPI],[1],[Define if you are using a Raspberry Pi.]) ;; esac DRIVERS="$DRIVERS hd44780${SO}" actdrivers=["$actdrivers hd44780"] ;; i2500vfd) if test "$enable_libftdi" = yes ; then DRIVERS="$DRIVERS i2500vfd${SO}" actdrivers=["$actdrivers i2500vfd"] else AC_MSG_WARN([The i2500vfd driver needs the ftdi library]) fi ;; icp_a106) DRIVERS="$DRIVERS icp_a106${SO}" actdrivers=["$actdrivers icp_a106"] ;; imon) DRIVERS="$DRIVERS imon${SO}" actdrivers=["$actdrivers imon"] ;; imonlcd) DRIVERS="$DRIVERS imonlcd${SO}" actdrivers=["$actdrivers imonlcd"] ;; IOWarrior) if test "$enable_libusb" = yes ; then DRIVERS="$DRIVERS IOWarrior${SO}" actdrivers=["$actdrivers IOWarrior"] else AC_MSG_WARN([The IOWarrior driver needs the libusb library.]) fi ;; irman) AC_CHECK_LIB(irman, main,[ LIBIRMAN="-lirman" DRIVERS="$DRIVERS irman${SO}" actdrivers=["$actdrivers irman"] ],[ dnl else AC_MSG_WARN([The irman driver needs the irman library.]) ]) ;; irtrans) DRIVERS="$DRIVERS irtrans${SO}" actdrivers=["$actdrivers irtrans"] ;; joy) AC_CHECK_HEADER(linux/joystick.h, [ DRIVERS="$DRIVERS joy${SO}" actdrivers=["$actdrivers joy"] ],[ dnl else AC_MSG_WARN([The joy driver needs header file linux/joystick.h.]) ]) ;; lb216) DRIVERS="$DRIVERS lb216${SO}" actdrivers=["$actdrivers lb216"] ;; lcdm001) DRIVERS="$DRIVERS lcdm001${SO}" actdrivers=["$actdrivers lcdm001"] ;; lcterm) DRIVERS="$DRIVERS lcterm${SO}" actdrivers=["$actdrivers lcterm"] ;; lirc) AC_CHECK_LIB(lirc_client, main,[ LIBLIRC_CLIENT="-llirc_client" DRIVERS="$DRIVERS lirc${SO}" actdrivers=["$actdrivers lirc"] ],[ dnl else AC_MSG_WARN([The lirc driver needs the lirc client library]) ]) ;; lis) AC_CHECK_HEADERS([pthread.h],[ AC_CHECK_LIB(pthread, pthread_create,[ LIBPTHREAD_LIBS="-lpthread" ac_cv_lis_pthread=yes ],[ dnl else ac_cv_lis_pthread=no AC_MSG_WARN([The lis driver needs the pthread library and pthread_create() from it]) ]) ],[ dnl else ac_cv_lis_pthread=no AC_MSG_WARN([The lis driver needs pthread.h]) ]) if test "$enable_libftdi" = yes ; then if test "$enable_libusb" = yes; then if test "$ac_cv_lis_pthread" = yes; then DRIVERS="$DRIVERS lis${SO}" actdrivers=["$actdrivers lis"] else AC_MSG_WARN([The lis driver needs the pthread library]) fi else AC_MSG_WARN([The lis driver needs the usb library]) fi else AC_MSG_WARN([The lis driver needs the ftdi library]) fi ;; MD8800) DRIVERS="$DRIVERS MD8800${SO}" actdrivers=["$actdrivers MD8800"] ;; mdm166a) if test "$enable_libhid" = yes ; then DRIVERS="$DRIVERS mdm166a${SO}" actdrivers=["$actdrivers mdm166a"] else AC_MSG_WARN([The mdm166a driver needs the hid library]) fi ;; ms6931) DRIVERS="$DRIVERS ms6931${SO}" actdrivers=["$actdrivers ms6931"] ;; mtc_s16209x) DRIVERS="$DRIVERS mtc_s16209x${SO}" actdrivers=["$actdrivers mtc_s16209x"] ;; MtxOrb) DRIVERS="$DRIVERS MtxOrb${SO}" actdrivers=["$actdrivers MtxOrb"] ;; mx5000) AC_CHECK_HEADERS([libmx5000/mx5000.h],[ AC_CHECK_LIB(mx5000, mx5000_sc_new_static,[ LIBMX5000="-lmx5000" DRIVERS="$DRIVERS mx5000${SO}" actdrivers=["$actdrivers mx5000"] ],[ dnl else AC_MSG_WARN([The mx5000 driver needs the mx5000tools library]) ]) ],[ dnl else AC_MSG_WARN([The mx5000 driver needs libmx5000/mx5000.h]) ]) ;; NoritakeVFD) DRIVERS="$DRIVERS NoritakeVFD${SO}" actdrivers=["$actdrivers NoritakeVFD"] ;; rawserial) DRIVERS="$DRIVERS rawserial${SO}" actdrivers=["$actdrivers rawserial"] ;; picolcd) if test "$enable_libusb" = yes ; then DRIVERS="$DRIVERS picolcd${SO}" actdrivers=["$actdrivers picolcd"] if test "$enable_libusb_1_0" = yes ; then AC_MSG_RESULT([The picolcd driver is using the libusb-1.0 library.]) else AC_MSG_RESULT([The picolcd driver is using the libusb-0.1 library.]) fi else AC_MSG_WARN([The picolcd driver needs the libusb library.]) fi ;; pyramid) DRIVERS="$DRIVERS pyramid${SO}" actdrivers=["$actdrivers pyramid"] ;; sdeclcd) if test "$ac_cv_port_have_lpt" = yes then DRIVERS="$DRIVERS sdeclcd${SO}" actdrivers=["$actdrivers sdeclcd"] else AC_MSG_WARN([The sdeclcd driver needs a parallel port.]) fi ;; sed1330) if test "$ac_cv_port_have_lpt" = yes then DRIVERS="$DRIVERS sed1330${SO}" actdrivers=["$actdrivers sed1330"] else AC_MSG_WARN([The sed1330 driver needs a parallel port.]) fi ;; sed1520) if test "$ac_cv_port_have_lpt" = yes then DRIVERS="$DRIVERS sed1520${SO}" actdrivers=["$actdrivers sed1520"] else AC_MSG_WARN([The sed1520 driver needs a parallel port.]) fi ;; serialPOS) DRIVERS="$DRIVERS serialPOS${SO}" actdrivers=["$actdrivers serialPOS"] ;; serialVFD) DRIVERS="$DRIVERS serialVFD${SO}" actdrivers=["$actdrivers serialVFD"] ;; shuttleVFD) if test "$enable_libusb" = yes ; then DRIVERS="$DRIVERS shuttleVFD${SO}" actdrivers=["$actdrivers shuttleVFD"] else AC_MSG_WARN([The shuttleVFD driver needs the libusb library.]) fi ;; sli) DRIVERS="$DRIVERS sli${SO}" actdrivers=["$actdrivers sli"] ;; stv5730) if test "$ac_cv_port_have_lpt" = yes then DRIVERS="$DRIVERS stv5730${SO}" actdrivers=["$actdrivers stv5730"] else AC_MSG_WARN([The stv5730 driver needs a parallel port.]) fi ;; SureElec) DRIVERS="$DRIVERS SureElec${SO}" actdrivers=["$actdrivers SureElec"] ;; svga) AC_CHECK_HEADER([vga.h], [ AC_CHECK_HEADER([vgagl.h],[ AC_CHECK_LIB(vga, main,[ LIBSVGA="-lvga -lvgagl" DRIVERS="$DRIVERS svga${SO}" actdrivers=["$actdrivers svga"] ],[ dnl else AC_MSG_WARN([The svga driver needs the vga library]) ]) ],[ dnl else AC_MSG_WARN([The svga driver needs vgagl.h]) ]) ],[ dnl else AC_MSG_WARN([The svga driver needs vga.h]) ]) ;; t6963) if test "$ac_cv_port_have_lpt" = yes then DRIVERS="$DRIVERS t6963${SO}" actdrivers=["$actdrivers t6963"] else AC_MSG_WARN([The sed1330 driver needs a parallel port.]) fi ;; text) DRIVERS="$DRIVERS text${SO}" actdrivers=["$actdrivers text"] ;; tyan) DRIVERS="$DRIVERS tyan${SO}" actdrivers=["$actdrivers tyan"] ;; ula200) if test "$enable_libftdi" = yes ; then DRIVERS="$DRIVERS ula200${SO}" actdrivers=["$actdrivers ula200"] else AC_MSG_WARN([The ula200 driver needs the ftdi library]) fi ;; vlsys_m428) DRIVERS="$DRIVERS vlsys_m428${SO}" actdrivers=["$actdrivers vlsys_m428"] ;; xosd) AC_PATH_PROG([LIBXOSD_CONFIG], [xosd-config], [no]) if test "$LIBXOSD_CONFIG" = "no"; then AC_MSG_WARN([The xosd driver needs the xosd library]) else LIBXOSD_CFLAGS=`$LIBXOSD_CONFIG --cflags` LIBXOSD_LIBS=`$LIBXOSD_CONFIG --libs` AC_SUBST(LIBXOSD_CFLAGS) AC_SUBST(LIBXOSD_LIBS) DRIVERS="$DRIVERS xosd${SO}" actdrivers=["$actdrivers xosd"] fi ;; *) AC_MSG_ERROR([Unknown driver $driver]) ;; esac done AC_MSG_RESULT([---------------------------------------]) AC_MSG_RESULT([LCDd will be compiled with the drivers:]) for driver in $actdrivers; do AC_MSG_RESULT([ - $driver]) done AC_MSG_RESULT([---------------------------------------]) AC_SUBST(LIBCURSES) AC_SUBST(LIBIRMAN) AC_SUBST(LIBLIRC_CLIENT) AC_SUBST(LIBSVGA) AC_SUBST(DRIVERS) AC_SUBST(HD44780_DRIVERS) AC_SUBST(GLCD_DRIVERS) AC_SUBST(LIBG15) AC_SUBST(LIBGLCD) AC_SUBST(LIBFTDI) AC_SUBST(LIBXOSD) AC_SUBST(LIBPTHREAD_LIBS) AC_SUBST(LIBMX5000) ]) dnl dnl Curses test to check if we use _acs_char* or acs_map* dnl AC_DEFUN([AC_CURSES_ACS_ARRAY], [ AC_CACHE_CHECK([for acs_map in curses.h], ac_cv_curses_acs_map, [AC_TRY_COMPILE([#include ], [ char map = acs_map['p'] ], ac_cv_curses_acs_map=yes, ac_cv_curses_acs_map=no)]) if test "$ac_cv_curses_acs_map" = yes then AC_DEFINE(CURSES_HAS_ACS_MAP,[1],[Define to 1 if defines the acs_map array]) else AC_CACHE_CHECK([for _acs_char in curses.h], ac_cv_curses__acs_char, [AC_TRY_COMPILE([#include ], [ char map = _acs_char['p'] ], ac_cv_curses__acs_char=yes, ac_cv_curses__acs_char=no)]) if test "$ac_cv_curses__acs_char" = yes then AC_DEFINE(CURSES_HAS__ACS_CHAR,[1],[Define to 1 if defines the _acs_char array]) fi fi ]) dnl dnl Find out where is the mounted filesystem table dnl AC_DEFUN([AC_FIND_MTAB_FILE], [ AC_CACHE_CHECK([for your mounted filesystem table], ac_cv_mtab_file, [ dnl Linux if test -f "/etc/mtab"; then ac_cv_mtab_file=/etc/mtab else dnl Solaris if test -f "/etc/mnttab"; then ac_cv_mtab_file=/etc/mnttab else dnl BSD if test -f "/etc/fstab"; then ac_cv_mtab_file=/etc/fstab fi fi fi ]) if test ! -z "$ac_cv_mtab_file"; then AC_DEFINE_UNQUOTED([MTAB_FILE], ["$ac_cv_mtab_file"], [Location of your mounted filesystem table file]) fi ]) dnl dnl Filesystem information detection dnl dnl To get information about the disk, mount points, etc. dnl dnl This code is stolen from mc-4.5.41, which in turn has stolen it dnl from GNU fileutils-3.12. dnl AC_DEFUN([AC_GET_FS_INFO], [ AC_CHECK_HEADERS(fcntl.h sys/dustat.h sys/param.h sys/statfs.h sys/fstyp.h) AC_CHECK_HEADERS(mnttab.h mntent.h utime.h sys/statvfs.h sys/vfs.h) AC_CHECK_HEADERS(sys/filsys.h sys/fs_types.h) AC_CHECK_HEADERS(sys/mount.h, [], [], [#if HAVE_SYS_PARAM_H #include #endif ]) AC_CHECK_FUNCS(getmntinfo) AC_MSG_NOTICE([checking how to get filesystem space usage...]) space=no # Here we'll compromise a little (and perform only the link test) # since it seems there are no variants of the statvfs function. if test $space = no; then # SVR4 AC_CHECK_FUNCS(statvfs) if test $ac_cv_func_statvfs = yes; then space=yes AC_DEFINE(STAT_STATVFS,[1],[Define to 1 if you have the statvfs function]) fi fi if test $space = no; then # DEC Alpha running OSF/1 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)]) AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1, [AC_TRY_RUN([ #include #include #include main () { struct statfs fsd; fsd.f_fsize = 0; exit (statfs (".", &fsd, sizeof (struct statfs))); }], fu_cv_sys_stat_statfs3_osf1=yes, fu_cv_sys_stat_statfs3_osf1=no, fu_cv_sys_stat_statfs3_osf1=no)]) AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1) if test $fu_cv_sys_stat_statfs3_osf1 = yes; then space=yes AC_DEFINE(STAT_STATFS3_OSF1,[1],[Define to 1 if you have the 3-argument statfs function (DEC OSF/1)]) fi fi if test $space = no; then # AIX AC_MSG_CHECKING([for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)]) AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize, [AC_TRY_RUN([ #ifdef HAVE_SYS_PARAM_H #include #endif #ifdef HAVE_SYS_MOUNT_H #include #endif #ifdef HAVE_SYS_VFS_H #include #endif main () { struct statfs fsd; fsd.f_bsize = 0; exit (statfs (".", &fsd)); }], fu_cv_sys_stat_statfs2_bsize=yes, fu_cv_sys_stat_statfs2_bsize=no, fu_cv_sys_stat_statfs2_bsize=no)]) AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize) if test $fu_cv_sys_stat_statfs2_bsize = yes; then space=yes AC_DEFINE(STAT_STATFS2_BSIZE,[1],[Define to 1 if you have the two-argument statfs function with statfs.bsize member (AIX, 4.3BSD)]) fi fi if test $space = no; then # SVR3 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)]) AC_CACHE_VAL(fu_cv_sys_stat_statfs4, [AC_TRY_RUN([#include #include main () { struct statfs fsd; exit (statfs (".", &fsd, sizeof fsd, 0)); }], fu_cv_sys_stat_statfs4=yes, fu_cv_sys_stat_statfs4=no, fu_cv_sys_stat_statfs4=no)]) AC_MSG_RESULT($fu_cv_sys_stat_statfs4) if test $fu_cv_sys_stat_statfs4 = yes; then space=yes AC_DEFINE(STAT_STATFS4,[1],[Define to 1 if you have the four-argument statfs function (AIX-3.2.5, SVR3)]) fi fi if test $space = no; then # 4.4BSD and NetBSD AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl member (4.4BSD and NetBSD)]) AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize, [AC_TRY_RUN([#include #ifdef HAVE_SYS_PARAM_H #include #endif #ifdef HAVE_SYS_MOUNT_H #include #endif main () { struct statfs fsd; fsd.f_fsize = 0; exit (statfs (".", &fsd)); }], fu_cv_sys_stat_statfs2_fsize=yes, fu_cv_sys_stat_statfs2_fsize=no, fu_cv_sys_stat_statfs2_fsize=no)]) AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize) if test $fu_cv_sys_stat_statfs2_fsize = yes; then space=yes AC_DEFINE(STAT_STATFS2_FSIZE,[1],[Define to 1 if you have the two-argument statfs function with statfs.fsize member (4.4BSD and NetBSD)]) fi fi if test $space = no; then # Ultrix AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)]) AC_CACHE_VAL(fu_cv_sys_stat_fs_data, [AC_TRY_RUN([ #include #ifdef HAVE_SYS_PARAM_H #include #endif #ifdef HAVE_SYS_MOUNT_H #include #endif #ifdef HAVE_SYS_FS_TYPES_H #include #endif main () { struct fs_data fsd; /* Ultrix's statfs returns 1 for success, 0 for not mounted, -1 for failure. */ exit (statfs (".", &fsd) != 1); }], fu_cv_sys_stat_fs_data=yes, fu_cv_sys_stat_fs_data=no, fu_cv_sys_stat_fs_data=no)]) AC_MSG_RESULT($fu_cv_sys_stat_fs_data) if test $fu_cv_sys_stat_fs_data = yes; then space=yes AC_DEFINE(STAT_STATFS2_FS_DATA,[1],[Define to 1 if you have the two-argument statfs function with struct fs_data (Ultrix)]) fi fi dnl Not supported dnl if test $space = no; then dnl # SVR2 dnl AC_TRY_CPP([#include ], dnl AC_DEFINE(STAT_READ_FILSYS) space=yes) dnl fi ]) dnl 1.1 (2001/07/26) -- Miscellaneous @ ac-archive-0.5.32 dnl Warren Young dnl This macro checks for the SysV IPC header files. It only checks dnl that you can compile a program with them, not whether the system dnl actually implements working SysV IPC. dnl http://ac-archive.sourceforge.net/Miscellaneous/etr_sysv_ipc.html AC_DEFUN([ETR_SYSV_IPC], [ AC_CACHE_CHECK([for System V IPC headers], ac_cv_sysv_ipc, [ AC_TRY_COMPILE( [ #include #include #include #include #include ],, ac_cv_sysv_ipc=yes, ac_cv_sysv_ipc=no) ]) if test x"$ac_cv_sysv_ipc" = "xyes" then AC_DEFINE(HAVE_SYSV_IPC, 1, [ Define if you have System V IPC ]) fi ]) dnl ETR_SYSV_IPC dnl 1.1 (2001/07/26) -- Miscellaneous @ ac-archive-0.5.32 dnl Warren Young dnl This macro checks to see if sys/sem.h defines union semun. Some dnl systems do, some systems don't. Your code must be able to deal with dnl this possibility; if HAVE_STRUCT_SEMUM isn't defined for a given system, dnl you have to define this structure before you can call functions dnl like semctl(). dnl You should call ETR_SYSV_IPC before this macro, to separate the check dnl for System V IPC headers from the check for struct semun. dnl http://ac-archive.sourceforge.net/Miscellaneous/etr_struct_semun.html AC_DEFUN([ETR_UNION_SEMUN], [ AC_CACHE_CHECK([for union semun], ac_cv_union_semun, [ AC_TRY_COMPILE( [ #include #include #include ], [ union semun s ], ac_cv_union_semun=yes, ac_cv_union_semun=no) ]) if test x"$ac_cv_union_semun" = "xyes" then AC_DEFINE(HAVE_UNION_SEMUN, 1, [ Define if your system's sys/sem.h file defines union semun ]) fi ]) dnl ETR_UNION_SEMUN dnl Loadable modules determination. dnl Joris Robijn, 2002 dnl I choose not to use libtool. dnl If your platform does not compile or link the modules correctly, add dnl appropriate flags here. AC_DEFUN([AC_MODULES_INFO], [ dnl $SO is the extension of shared libraries (including the dot!) dnl It is available in the program code as MODULE_EXTENSION AC_MSG_CHECKING(module extension) case $host in hp*|HP*) SO=.sl;; *cygwin*) SO=.dll;; *) SO=.so;; esac AC_DEFINE_UNQUOTED(MODULE_EXTENSION,"$SO",[Set to the extension for dynamically loaded modules]) AC_MSG_RESULT($SO) dnl CCSHARED are the flags used to compile the sources for the shared library dnl LDSHARED are the flags used to create shared library. dnl By default assume a GNU compatible build system CCSHARED="-fPIC" LDSHARED="-shared" dnl Now override flags that should be different case "$host" in SunOS/4*) LDSHARED="" ;; SunOS/5*) if test ! "$GCC" = "yes" ; then LDSHARED="-G"; fi ;; hp*|HP*) if test ! "$GCC" = "yes"; then CCSHARED="+z"; LDSHARED="-b" fi ;; *cygwin*) CCSHARED="-DUSE_DL_IMPORT" LDSHARED="-shared -Wl,--enable-auto-image-base" ;; BSD/OS*/4*) CCSHARED="-fpic" ;; *darwin*) LDSHARED="-bundle -flat_namespace -undefined suppress" ;; esac dnl checks for libraries AC_CHECK_LIB(dl, dlopen) # Dynamic linking for Linux, *BSD, SunOS/Solaris and SYSV AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX AC_SUBST(SO) AC_SUBST(CCSHARED) AC_SUBST(LDSHARED) dnl End of loadable modules determination ]) dnl AC_MODULES_INFO dnl stolen from cppunit project (http://cppunit.sourceforge.net/) AC_DEFUN([BB_ENABLE_DOXYGEN], [ AC_ARG_ENABLE(doxygen, [AS_HELP_STRING([--enable-doxygen], [enable documentation generation with doxygen (auto)])]) AC_ARG_ENABLE(dot, [AS_HELP_STRING([--enable-dot], [use 'dot' to generate graphs in doxygen (auto)])]) AC_ARG_ENABLE(html-dox, [AS_HELP_STRING([--enable-html-dox], [enable HTML generation with doxygen (yes)])], [], [enable_html_dox=yes]) AC_ARG_ENABLE(latex-dox, [AS_HELP_STRING([--enable-latex-dox], [enable LaTeX documentation generation with doxygen (no)])], [], [enable_latex_dox=no]) if test "x$enable_doxygen" = xno; then enable_dox=no else AC_PATH_PROG(DOXYGEN, doxygen, , $PATH) if test "x$DOXYGEN" = x; then if test "x$enable_doxygen" = xyes; then AC_MSG_ERROR([could not find doxygen]) fi enable_dox=no else enable_dox=yes AC_PATH_PROG(DOT, dot, , $PATH) fi fi AM_CONDITIONAL(DOX, test x$enable_dox = xyes) if test x$DOT = x; then if test "x$enable_dot" = xyes; then AC_MSG_ERROR([could not find dot]) fi enable_dot=no else enable_dot=yes fi AC_SUBST(enable_dot) AC_SUBST(enable_html_dox) AC_SUBST(enable_latex_dox) ]) dnl Check if a given flag is understood and add it to CFLAGS. dnl From http://www.gnu.org/software/autoconf-archive/ax_cflags_gcc_option.html dnl Copyright (c) 2008 Guido U. Draheim dnl serial 12 dnl Note: This is the last version released under GPLv2. AC_DEFUN([AX_CFLAGS_GCC_OPTION_OLD], [dnl AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl AS_VAR_PUSHDEF([VAR],[ax_cv_cflags_gcc_option_$2])dnl AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for gcc m4_ifval($2,$2,-option)], VAR,[AS_VAR_SET([VAR],["no, unknown"]) AC_LANG_SAVE AC_LANG_C ac_save_[]FLAGS="$[]FLAGS" for ac_arg dnl in "-pedantic -Werror % m4_ifval($2,$2,-option)" dnl GCC "-pedantic % m4_ifval($2,$2,-option) %% no, obsolete" dnl new GCC # do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` AC_TRY_COMPILE([],[return 0;], [AS_VAR_SET([VAR],[`echo $ac_arg | sed -e 's,.*% *,,'`]); break]) done FLAGS="$ac_save_[]FLAGS" AC_LANG_RESTORE ]) m4_ifdef([AS_VAR_COPY],[AS_VAR_COPY([var],[VAR])],[var=AS_VAR_GET([VAR])]) case ".$var" in .ok|.ok,*) m4_ifvaln($3,$3) ;; .|.no|.no,*) m4_ifvaln($4,$4) ;; *) m4_ifvaln($3,$3,[ if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $var " 2>&1 >/dev/null then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $var]) else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $var"]) m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $var" fi ]) ;; esac AS_VAR_POPDEF([VAR])dnl AS_VAR_POPDEF([FLAGS])dnl ]) dnl the only difference - the LANG selection... and the default FLAGS AC_DEFUN([AX_CXXFLAGS_GCC_OPTION_OLD], [dnl AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl AS_VAR_PUSHDEF([VAR],[ax_cv_cxxflags_gcc_option_$2])dnl AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for gcc m4_ifval($2,$2,-option)], VAR,[AS_VAR_SET([VAR],["no, unknown"]) AC_LANG_SAVE AC_LANG_CPLUSPLUS ac_save_[]FLAGS="$[]FLAGS" for ac_arg dnl in "-pedantic -Werror % m4_ifval($2,$2,-option)" dnl GCC "-pedantic % m4_ifval($2,$2,-option) %% no, obsolete" dnl new GCC # do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` AC_TRY_COMPILE([],[return 0;], [AS_VAR_SET([VAR],[`echo $ac_arg | sed -e 's,.*% *,,'`]); break]) done FLAGS="$ac_save_[]FLAGS" AC_LANG_RESTORE ]) m4_ifdef([AS_VAR_COPY],[AS_VAR_COPY([var],[VAR])],[var=AS_VAR_GET([VAR])]) case ".$var" in .ok|.ok,*) m4_ifvaln($3,$3) ;; .|.no|.no,*) m4_ifvaln($4,$4) ;; *) m4_ifvaln($3,$3,[ if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $var " 2>&1 >/dev/null then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $var]) else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $var"]) m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $var" fi ]) ;; esac AS_VAR_POPDEF([VAR])dnl AS_VAR_POPDEF([FLAGS])dnl ]) dnl ------------------------------------------------------------------------- AC_DEFUN([AX_CFLAGS_GCC_OPTION_NEW], [dnl AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl AS_VAR_PUSHDEF([VAR],[ax_cv_cflags_gcc_option_$1])dnl AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for gcc m4_ifval($1,$1,-option)], VAR,[AS_VAR_SET([VAR],["no, unknown"]) AC_LANG_SAVE AC_LANG_C ac_save_[]FLAGS="$[]FLAGS" for ac_arg dnl in "-pedantic -Werror % m4_ifval($1,$1,-option)" dnl GCC "-pedantic % m4_ifval($1,$1,-option) %% no, obsolete" dnl new GCC # do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` AC_TRY_COMPILE([],[return 0;], [AS_VAR_SET([VAR],[`echo $ac_arg | sed -e 's,.*% *,,'`]); break]) done FLAGS="$ac_save_[]FLAGS" AC_LANG_RESTORE ]) m4_ifdef([AS_VAR_COPY],[AS_VAR_COPY([var],[VAR])],[var=AS_VAR_GET([VAR])]) case ".$var" in .ok|.ok,*) m4_ifvaln($3,$3) ;; .|.no|.no,*) m4_ifvaln($4,$4) ;; *) m4_ifvaln($3,$3,[ if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $var " 2>&1 >/dev/null then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $var]) else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $var"]) m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $var" fi ]) ;; esac AS_VAR_POPDEF([VAR])dnl AS_VAR_POPDEF([FLAGS])dnl ]) dnl the only difference - the LANG selection... and the default FLAGS AC_DEFUN([AX_CXXFLAGS_GCC_OPTION_NEW], [dnl AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl AS_VAR_PUSHDEF([VAR],[ax_cv_cxxflags_gcc_option_$1])dnl AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for gcc m4_ifval($1,$1,-option)], VAR,[AS_VAR_SET([VAR],["no, unknown"]) AC_LANG_SAVE AC_LANG_CPLUSPLUS ac_save_[]FLAGS="$[]FLAGS" for ac_arg dnl in "-pedantic -Werror % m4_ifval($1,$1,-option)" dnl GCC "-pedantic % m4_ifval($1,$1,-option) %% no, obsolete" dnl new GCC # do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` AC_TRY_COMPILE([],[return 0;], [AS_VAR_SET([VAR],[`echo $ac_arg | sed -e 's,.*% *,,'`]); break]) done FLAGS="$ac_save_[]FLAGS" AC_LANG_RESTORE ]) m4_ifdef([AS_VAR_COPY],[AS_VAR_COPY([var],[VAR])],[var=AS_VAR_GET([VAR])]) case ".$var" in .ok|.ok,*) m4_ifvaln($3,$3) ;; .|.no|.no,*) m4_ifvaln($4,$4) ;; *) m4_ifvaln($3,$3,[ if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $var " 2>&1 >/dev/null then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $var]) else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $var"]) m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $var" fi ]) ;; esac AS_VAR_POPDEF([VAR])dnl AS_VAR_POPDEF([FLAGS])dnl ]) AC_DEFUN([AX_CFLAGS_GCC_OPTION],[ifelse(m4_bregexp([$2],[-]),-1, [AX_CFLAGS_GCC_OPTION_NEW($@)],[AX_CFLAGS_GCC_OPTION_OLD($@)])]) AC_DEFUN([AX_CXXFLAGS_GCC_OPTION],[ifelse(m4_bregexp([$2],[-]),-1, [AX_CXXFLAGS_GCC_OPTION_NEW($@)],[AX_CXXFLAGS_GCC_OPTION_OLD($@)])]) dnl dnl Check if system has SA_RESTART defined. Copied from GNUs make configure. dnl AC_DEFUN([LCD_SA_RESTART], [ AC_CACHE_CHECK([for SA_RESTART], lcd_cv_sa_restart, [ AC_TRY_COMPILE([#include ], [return SA_RESTART;], lcd_cv_sa_restart=yes, lcd_cv_sa_restart=no)]) if test "$lcd_cv_sa_restart" != no; then AC_DEFINE([HAVE_SA_RESTART], [1], [Define to 1 if defines the SA_RESTART constant.]) fi ]) dnl dnl Check for PNG library dnl AC_DEFUN([LCD_PNG_LIB], [ AC_MSG_CHECKING([if PNG support has been enabled]); AC_ARG_ENABLE(libpng, [AS_HELP_STRING([--disable-libpng],[disable PNG support using libpng])], [ if test "$enableval" != "no"; then enable_libpng=yes fi ], [ enable_libpng=yes ] ) AC_MSG_RESULT($enable_libpng) if test "$enable_libpng" = "yes"; then AC_PATH_PROG([_png_config], [libpng-config]) _libpng_save_libs=$LIBS _libpng_save_cflags=$CFLAGS if test x$_png_config != "x" ; then _libpng_try_libs=`$_png_config --ldflags` _libpng_try_cflags=`$_png_config --cflags` fi LIBS="$LIBS $_libpng_try_libs" CFLAGS="$CFLAGS $_libpng_try_cflags" AC_MSG_CHECKING([whether libpng is present and sane]) AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ],[ png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); ])],enable_libpng=yes,enable_libpng=no) AC_MSG_RESULT([$enable_libpng]) if test "$enable_libpng" = "yes" ; then AC_DEFINE(HAVE_LIBPNG, [1], [Define to 1 if you have libpng]) AC_SUBST(LIBPNG_CFLAGS, $_libpng_try_cflags) AC_SUBST(LIBPNG_LIBS, $_libpng_try_libs) fi LIBS=$_libpng_save_libs CFLAGS=$_libpng_save_cflags unset _libpng_save_libs unset _libpng_save_cflags unset _libpng_try_libs unset _libpng_try_cflags unset _png_config fi ]) lcdproc-0.5.7/configure.ac000644 001751 000000 00000037245 12330422561 016251 0ustar00mmdolzewheel000000 000000 # -*- mode: m4; -*- dnl Process this file with autoconf 2.61 (or higher) to produce a configure script. AC_PREREQ(2.61) AC_INIT([lcdproc], [0.5.7], [lcdproc@lists.omnipotent.net]) AC_CONFIG_SRCDIR([clients/lcdproc/batt.c]) AM_INIT_AUTOMAKE AC_CONFIG_HEADERS(config.h) AC_CANONICAL_HOST case "$host" in *-*-*linux*) dnl i586-pc-linux-gnu AC_DEFINE([LINUX],[1],[Define if you're using Linux.]) ac_system_host=Linux ;; *-*-*solaris*) AC_DEFINE([SOLARIS],[1],[Define if you're using Solaris.]) ac_system_host=Solaris ;; *-*-*openbsd*) dnl i386-unknown-openbsd3.0 AC_DEFINE([OPENBSD],[1],[Define if you're using OpenBSD.]) ac_system_host=OpenBSD ;; *-*-*netbsd*) AC_DEFINE([NETBSD],[1],[Define if you're using NetBSD.]) ac_system_host=NetBSD ;; *-*-*freebsd*) AC_DEFINE([FREEBSD],[1],[Define if you're using FreeBSD.]) ac_system_host=FreeBSD ;; *-*-*darwin*) AC_DEFINE([DARWIN],[1],[Define if you're using Darwin/Mac OS X.]) ac_system_host=Darwin ;; esac AC_DEFINE_UNQUOTED([SYSTEM_HOST], [$ac_system_host], [Set this to your system host (Linux, Solaris, OpenBSD, NetBSD, FreeBSD or Darwin)]) dnl treat Darwin special in Makefiles AM_CONDITIONAL(DARWIN, test x$ac_system_host = xDarwin) AC_MSG_CHECKING([whether to enable debugging]) AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug], [show debug information])], [ if test "$enableval" != "no"; then AC_DEFINE(DEBUG, [1], [Define to 1 to show debug information]) debug="yes" else debug="no" fi ], [ debug=no ] ) AC_MSG_RESULT($debug) if test $debug = "yes"; then dnl Enable debugging information with minimal optimisation if not set differently dnl (the spaces before $CFLAGS and -O are significant) CFLAGS="$CFLAGS -g" if ! echo " $CFLAGS" | grep -q -- " -O" ; then CFLAGS="$CFLAGS -O" fi else dnl Maximum optimisation if not already set dnl (the spaces before $CFLAGS and -O are significant) if ! echo " $CFLAGS" | grep -q -- " -O" ; then CFLAGS="$CFLAGS -O3" fi fi dnl Checks for programs used in building AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL AC_PROG_RANLIB AM_PROG_CC_C_O AC_PATH_PROG([XMLTO], [xmlto], [no]) dnl Avoid unused static function warnings CFLAGS="-Wall $CFLAGS" AX_CFLAGS_GCC_OPTION(-Wno-unused-function) AX_CFLAGS_GCC_OPTION(-ftrampolines) export CFLAGS dnl Solaris AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)]) AC_CHECK_FUNC(connect,,[AC_CHECK_LIB(socket,connect)]) AC_CHECK_FUNC(inet_aton,,[AC_CHECK_LIB(resolv,inet_aton)]) AC_CHECK_LIB(kstat, kstat_open) AC_CHECK_LIB(posix4, nanosleep) AC_CHECK_FUNCS(getloadavg swapctl) AC_CHECK_HEADERS(procfs.h sys/procfs.h sys/loadavg.h utmpx.h) dnl Some versions of Solaris require -lelf for -lkvm AC_CHECK_LIB(kvm, kvm_open,[ LIBS="-lkvm $LIBS" ],[AC_MSG_CHECKING([for kvm_open in -lkvm with -lelf]) AC_CACHE_VAL(ac_cv_lib_kvm_with_elf, [ac_save_LIBS="$LIBS" LIBS="-lkvm -lelf $LIBS" AC_LINK_IFELSE([AC_LANG_PROGRAM([[char kvm_open();]], [[kvm_open()]])],[ac_cv_lib_kvm_with_elf=yes],[ac_cv_lib_kvm_with_elf=no]) LIBS="$ac_save_LIBS" ]) if test "$ac_cv_lib_kvm_with_elf" = "yes"; then AC_MSG_RESULT(yes) LIBS="-lkvm -lelf $LIBS" else AC_MSG_RESULT(no) fi ]) dnl NetBSD, OpenBSD and FreeBSD AC_CHECK_HEADERS(sched.h sys/types.h machine/pio.h machine/sysarch.h sys/cpuvar.h machine/apm_bios.h) ETR_SYSV_IPC ETR_UNION_SEMUN dnl machine/cpufunc.h needs additional header on FreeBSD AC_CHECK_HEADERS([machine/cpufunc.h], [], [], [[#if HAVE_SYS_TYPES_H # include #endif ]]) dnl sched_setscheduler on OpenBSD AC_CHECK_FUNCS(sched_setscheduler) AC_CHECK_LIB(posix4, sched_setscheduler, [ AC_DEFINE([HAVE_SCHED_SETSCHEDULER], [1], [Define if you have the sched_setscheduler function.]) ]) AC_CHECK_LIB(rt, sched_setscheduler, [ AC_DEFINE([HAVE_SCHED_SETSCHEDULER], [1], [Define if you have the sched_setscheduler function.]) ]) dnl i386_get_ioperm on NetBSD&OpenBSD AC_CHECK_LIB(i386, i386_get_ioperm, LIBS="-li386 $LIBS" AC_DEFINE([HAVE_I386_IOPERM_NETBSD], [1], [Define if you have the NetBSD&OpenBSD version of i386_ioperm functions.]),[ dnl i386_get_ioperm on FreeBSD AC_CHECK_LIB(c, i386_get_ioperm, AC_DEFINE([HAVE_I386_IOPERM_FREEBSD],[1], [Define if you have the FreeBSD version of the i386_ioperm functions.]), [])] ) AC_CHECK_FUNCS(iopl) AC_CHECK_FUNCS(ioperm) AC_CHECK_HEADERS(sys/io.h) dnl Check if we support this parallel (LPT) port dnl IMPORTANT: we must do all the checks used in port.h before doing this test! AC_CACHE_CHECK([for a parallel port], ac_cv_port_have_lpt, [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "${srcdir}/server/drivers/port.h"]], [[char val = port_in(0x350)]])], [ac_cv_port_have_lpt=yes],[ac_cv_port_have_lpt=no])]) if test "$ac_cv_port_have_lpt" = yes; then AC_DEFINE([HAVE_PCSTYLE_LPT_CONTROL], [1], [Define if you have a parallel port and LCDproc knows how to talk to it.]) else AC_MSG_WARN([Cannot talk to the parallel port, disabling drivers that use it.]) fi x_ac_have_i2c=no AC_CHECK_HEADERS([linux/i2c-dev.h dev/iicbus/iic.h], [x_ac_have_i2c=yes]) if test "$x_ac_have_i2c" = yes; then AC_DEFINE(HAVE_I2C,[1],[Define to 1 if you have the i2c headers]) fi x_ac_have_spi=no AC_CHECK_HEADERS([linux/spi/spidev.h], [x_ac_have_spi=yes]) if test "$x_ac_have_spi" = yes; then AC_DEFINE(HAVE_SPI,[1],[Define to 1 if you have the spi headers]) fi dnl Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h unistd.h sys/io.h errno.h) AC_CHECK_HEADERS(limits.h kvm.h sys/param.h sys/dkstat.h stdbool.h) dnl check sys/sysctl.h seperately, as it requires other headers on at least OpenBSD AC_CHECK_HEADERS([sys/sysctl.h], [], [], [[#if HAVE_SYS_PARAM_H # include #endif ]]) dnl On FreeBSD >= 8 checking sys/pcpu.h fails without sys/param.h and kvm.h AC_CHECK_HEADERS([sys/pcpu.h], [], [], [[#if HAVE_SYS_PARAM_H # include #endif #if HAVE_KVM_H # include #endif ]]) dnl Check for particular preprocessor macros LCD_SA_RESTART dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_TYPE_SIZE_T AC_HEADER_TIME AC_STRUCT_TM AC_TYPE_UID_T dnl Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_TYPE_SIGNAL AC_CHECK_FUNCS(select socket strdup strerror strtol uname cfmakeraw snprintf) dnl Many people on non-GNU/Linux systems don't have getopt AC_CONFIG_LIBOBJ_DIR(shared) AC_CHECK_FUNC(getopt, [ AC_ARG_WITH(included-getopt, [AS_HELP_STRING([--with-included-getopt], [Use the included getopt rather than glibc's])], with_getopt=$withval, with_getopt=$no) if test "x$with_getopt" = xyes; then AC_LIBOBJ(getopt) AC_LIBOBJ(getopt1) fi ], [ AC_LIBOBJ(getopt) AC_LIBOBJ(getopt1) ]) dnl Check how to find the mtab file and how to get filesystem staticstics AC_FIND_MTAB_FILE AC_GET_FS_INFO dnl Check for various defines and features AC_ARG_WITH(lcdport, [AS_HELP_STRING([--with-lcdport=], [the server port [13666]])], LCDPORT=$withval, LCDPORT="13666" ) AC_DEFINE_UNQUOTED(LCDPORT, $LCDPORT, [Set default port where LCDd should listen]) AC_DEFINE_UNQUOTED(PROTOCOL_VERSION, "0.3", [Define version of lcdproc client-server protocol]) AC_DEFINE_UNQUOTED(API_VERSION, "0.5", [Define version of lcdproc API]) dnl Check compiler flags to dynamically load modules AC_MODULES_INFO dnl ###################################################################### dnl libusb support dnl ###################################################################### AC_MSG_CHECKING([if libusb support has been enabled]); AC_ARG_ENABLE(libusb, [AS_HELP_STRING([--disable-libusb],[disable USB support using libusb])], [ if test "$enableval" != "no"; then enable_libusb=yes fi ], [ enable_libusb=yes ] ) AC_MSG_RESULT($enable_libusb) if test "$enable_libusb" = "yes"; then ifdef([PKG_CHECK_MODULES], [PKG_CHECK_MODULES(LIBUSB, libusb, [AC_DEFINE(HAVE_LIBUSB, [1], [Define to 1 if you have libusb])], [ enable_libusb=no ])], [AC_MSG_WARN([pkg-config not (fully) installed; drivers requiring libusb may not be built])]) fi AC_SUBST(LIBUSB_LIBS) AC_SUBST(LIBUSB_CFLAGS) dnl ###################################################################### dnl libusb-1.0 support dnl ###################################################################### AC_MSG_CHECKING([if libusb-1-0 support has been enabled]); AC_ARG_ENABLE(libusb_1_0, [AS_HELP_STRING([--disable-libusb-1-0],[disable USB support using libusb-1.0])], [ if test "$enableval" != "no"; then enable_libusb_1_0="yes" fi ], [ enable_libusb_1_0=yes ] ) AC_MSG_RESULT($enable_libusb_1_0) if test "$enable_libusb_1_0" = "yes"; then ifdef([PKG_CHECK_MODULES], [PKG_CHECK_MODULES(LIBUSB_1_0, libusb-1.0 >= 1.0, [AC_DEFINE(HAVE_LIBUSB_1_0, [1], [Define to 1 if you have libusb-1.0])], [ enable_libusb_1_0=no ])], [AC_MSG_WARN([pkg-config not (fully) installed; drivers requiring libusb-1.0 may not be built])]) fi AC_SUBST(LIBUSB_1_0_LIBS) AC_SUBST(LIBUSB_1_0_CFLAGS) dnl ###################################################################### dnl libftdi support dnl ###################################################################### AC_MSG_CHECKING([if libftdi support has been enabled]); AC_ARG_ENABLE(libftdi, [AS_HELP_STRING([--disable-libftdi],[disable FTDI support using libftdi])], [ if test "$enableval" != "no"; then enable_libftdi=yes fi ], [ enable_libftdi=yes ] ) AC_MSG_RESULT($enable_libftdi) if test "$enable_libftdi" = "yes"; then ifdef([PKG_CHECK_MODULES], [PKG_CHECK_MODULES(LIBFTDI, libftdi >= 0.8, [AC_DEFINE(HAVE_LIBFTDI, [1], [Define to 1 if you have libftdi])], [ enable_libftdi=no ])], [AC_MSG_WARN([pkg-config not (fully) installed; drivers requiring libftdi may not be built])]) 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 ###################################################################### AC_MSG_CHECKING([if libhid support has been enabled]); AC_ARG_ENABLE(libhid, [AS_HELP_STRING([--disable-libhid],[disable HID support using libhid])], [ if test "$enableval" != "no"; then enable_libhid=yes fi ], [ enable_libhid=yes ] ) AC_MSG_RESULT($enable_libhid) if test "$enable_libhid" = "yes"; then ifdef([PKG_CHECK_MODULES], [PKG_CHECK_MODULES(LIBHID, libhid >= 0.2.16, [AC_DEFINE(HAVE_LIBHID, [1], [Define to 1 if you have libhid])], [ enable_libhid=no ])], [AC_MSG_WARN([pkg-config not (fully) installed; drivers requiring libhid may not be built])]) fi AC_SUBST(LIBHID_LIBS) AC_SUBST(LIBHID_CFLAGS) # PNG library LCD_PNG_LIB dnl ###################################################################### dnl freetype support dnl ###################################################################### AC_MSG_CHECKING([if freetype support has been enabled]); AC_ARG_ENABLE(freetype, [AS_HELP_STRING([--disable-freetype],[disable freetype support])], [ if test "$enableval" != "no"; then enable_freetype=yes fi ], [ enable_freetype=yes ] ) AC_MSG_RESULT($enable_freetype) if test "$enable_freetype" = "yes"; then ifdef([AC_CHECK_FT2], [AC_CHECK_FT2([], [AC_DEFINE(HAVE_FT2, [1], [Define to 1 if you have freetype])], [enable_freetype=no])], [AC_MSG_WARN([freetype does not seem to be installed])]) fi AC_SUBST([FT2_CFLAGS]) AC_SUBST([FT2_LIBS]) dnl ###################################################################### dnl ethlcd support dnl ###################################################################### AC_MSG_CHECKING([if ethlcd support has been enabled]); AC_ARG_ENABLE(ethlcd, [AS_HELP_STRING([--disable-ethlcd],[disable ethlcd connection type for HD44780])], [ if test "$enableval" != "no"; then enable_ethlcd=yes fi ], [ enable_ethlcd=yes ] ) AC_MSG_RESULT($enable_ethlcd) # check for doxygen BB_ENABLE_DOXYGEN # Select drivers to build LCD_DRIVERS_SELECT # directory for PID files pidfiledir=/var/run # make sure the directory exists if test ! -d $pidfiledir ; then pidfiledir=`eval echo ${sysconfdir}` case $pidfiledir in NONE/*) pidfiledir=`echo $pidfiledir | sed "s~NONE~$ac_default_prefix~"` ;; esac fi AC_ARG_WITH(pidfile-dir, [AS_HELP_STRING([--with-pidfile-dir=PATH], [specify location of pid files [/var/run]])], [ if test -n "$withval" && test "x$withval" != "xno" && \ test "x${withval}" != "xyes"; then pidfiledir=$withval if test ! -d $pidfiledir ; then AC_MSG_WARN([** no $pidfiledir directory on this system **]) fi fi ] ) AC_SUBST(pidfiledir) # Features applicable to the server AC_ARG_ENABLE(seamless-hbars, [AS_HELP_STRING([--enable-seamless-hbars], [no gaps in horizontal bar graphs (if HW supports it)])], [ if test "$enableval" != "no" ; then AC_DEFINE(SEAMLESS_HBARS, [1], [Define to 1 to avoid gaps in horizontal bar graphs (if HW supports it)]) fi ] ) AC_ARG_ENABLE(testmenus, [AS_HELP_STRING([--enable-testmenus], [enable server test menus])], [ if test "$enableval" != "no" ; then AC_DEFINE(LCDPROC_TESTMENUS, [1], [Define to 1 to enable server test menus]) fi ] ) AC_ARG_ENABLE(permissive_menu_goto, [AS_HELP_STRING([--enable-permissive-menu-goto], [allow transitions between different client's menus])], [ if test "$enableval" != "no" ; then AC_DEFINE(LCDPROC_PERMISSIVE_MENU_GOTO, [1], [Define to 1 to allow transitions between different client's menus]) fi ] ) dnl Features applicable to the lcdproc client AC_ARG_ENABLE(lcdproc-menus, [AS_HELP_STRING([--enable-lcdproc-menus], [enable menu support in lcdproc client])], [ if test "$enableval" != "no" ; then AC_DEFINE(LCDPROC_MENUS, [1], [Define to 1 to enable menu support in lcdproc client]) fi ] ) AC_ARG_ENABLE(stat-nfs, [AS_HELP_STRING([--enable-stat-nfs], [display NFS filesystem stats in lcdproc client])], [ if test "$enableval" != "no" ; then AC_DEFINE(STAT_NFS, [1], [Define to 1 to display NFS filesystem stats in lcdproc client]) fi ] ) AC_ARG_ENABLE(stat-smbfs, [AS_HELP_STRING([--enable-stat-smbfs], [display SMBFS filesystem stats in lcdproc client])], [ if test "$enableval" != "no" ; then AC_DEFINE(STAT_SMBFS, [1], [Define to 1 to display SMBFS filesystem stats in lcdproc client]) fi ] ) AC_ARG_ENABLE(extra-charmaps, [AS_HELP_STRING([--enable-extra-charmaps], [enable additional character mapping tables in drivers])], [ if test "$enableval" != "no" ; then AC_DEFINE(EXTRA_CHARMAPS, [1], [Define to 1 to enable additional charmaps in drivers]) fi ] ) AC_CONFIG_FILES([Makefile shared/Makefile server/Makefile server/commands/Makefile server/drivers/Makefile clients/Makefile clients/lcdproc/Makefile clients/lcdexec/Makefile clients/lcdvc/Makefile clients/examples/Makefile clients/metar/Makefile docs/Makefile docs/Doxyfile docs/lcdproc-dev/Makefile docs/lcdproc-user/Makefile docs/lcdproc-user/drivers/Makefile scripts/Makefile scripts/init-LCDd.LSB scripts/init-lcdproc.LSB scripts/init-lcdexec.LSB scripts/init-lcdvc.LSB scripts/init-LCDd.debian scripts/init-lcdproc.debian scripts/init-lcdexec.debian scripts/init-lcdvc.debian scripts/init-LCDd.rpm scripts/init-lcdproc.rpm]) AC_OUTPUT lcdproc-0.5.7/COPYING000644 001751 000000 00000043070 07024034003 015001 0ustar00mmdolzewheel000000 000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. lcdproc-0.5.7/ChangeLog000644 001751 000000 00000063502 12313535265 015537 0ustar00mmdolzewheel000000 000000 Recent changes: Key: - Something removed + Something added * Something changed / fixed v0.5.7 * Fix using the left key to change the ring and checkbox menu items * sed1520: Add an option for inverted segment mapping (idea by R. Buchert) * Fix build if compiled with --enable-permissive-menu-goto (#3599609) * glcd driver: Add direct support for framebuffer with paged memory layout + hd44780: Added 'raspberrypi' connection type (P. Corner) * Build system: Rename configure.in to configure.ac + hd44780: Add support for FreeBSD's iic I2C framework + hd44780: New connection type 'piplate' (J. Brogdon) * lcdproc client: Add option to turn off title on OldTime screen + glcd driver: Connection type 'x11' that draws to a X window (S. Meharg) + glcd driver: 'picolcdgfx' for picoLCD 256x64 from Mini-Box.com (S. Meharg) * picolcd: Improvements to IR processing (M. Jones) + hd44780: Added 'spi' connection type (S. Dawson) * hd55780/serial: Change data escape handling (G. Smith) + hd44780: New connection type 'pifacecad' (T. Preston) + new driver: rawserial - dump framebuffer to serial port (C. Wolf) v0.5.6 - Remove deprecated CFontz633 driver. Use CFontzPacket with Model=633 instead! + new driver: glcd unified graphic display driver (M. Dolze) + new driver: vlsys_m428 driver for Moneual MonCaso 320 (W. Hauck) * hd44780/serial: Fix handling of keys for LoS-Panel (M. Kirchner) * hd44780/serial: Change backlight handling (see commit message) + glcd driver: Add FreeType 2 rendering support (B. Walle and M. Dolze) + glcd driver: New connection type 'png', writes framebuffer as PNG image + hd44780: Fix vBars and block icon not working correctly on the same screen * Build system: Link LCDd itself with pthread library if available * lcdproc client: Unbreak build on OpenBSD non-i386 (E. Barrett) * lcdproc client: Fix core dumps on FreeBSD if started as non-root + glcd driver: new connection type 'serdisplib' + glcd driver: new connection type 'glcd2usb' * lcdproc client: On FreeBSD show only unique processes in 'S' screen * picolcd: Use libusb-1.0 asynchronous transfers to fix missed keys (M. Jones) * sed1520: Make it work without using an external inverter * lis driver: Make the last pixel row work (add lastline option parsing) * hd44780/ftdi: Fix error in setting backlight and add backlight for 4bit mode + new driver: sdeclcd for Watchguard FireBox appliances (F. Mertz) + hd44780: Added 'usb4all' connection type (T. Mohaupt) * Fix RPM init script hanging on recent OS (#3488223) * lcdproc client: Fix build on OpenBSD >= 5.0 * hd44780/serial: Add support for adjustable backlight * Build system: Fix build with automake >= 1.11.3 (#3494755) * Fix clang compiler warnings about obsolete GNU designated initializers * Fix crash when adding a menu item without text and options (S. Dawson) v0.5.5 + sed1330 driver: Add support for HG25504 (L. Lagendijk) * Build system: Fix xosd detection * Reset ccmode on screen clear for NoritakeVFD, tyan driver * All drivers: Refactor CGmode enum into lcd.h * hd44780: New (possible faster) screen update algorithm + Add an option to start LCDd with screen rotation disabled (M. Zanetti) * Rewrite of the t6963 driver fixing several problems (see commit note). * picolcd: Add OffBrightness (S. Crane), more icons and fix bignum * lcdproc: Fix a single dot appearing on line 5 of the D screen * lcdproc: Make the iface screen more readable on 2x16 displays * All drivers: sync functions with prototypes * Port remaining drivers to 0.5 API (glk, lcdm001, stv5730) * Pyramid: Only send LED state changes, doxygen-ize * sed1520: Make it work with 68-family style interface, convert to 0.5 API * hd44780/imon: Add charmap for NEC uPD16314 and make it configurable * Pyramid: Convert set_char to 8 byte bitmap, add support for bignum * Convert set_char of drivers bayrad, lb216, lcterm, mtc_s16209x, wirz-sli * CFontzPacket: Fix not using select() even if its available * CFontzPacket: Use cellwidth = 5 on CFA-631 and CFA-635 too * t6963: Convert font to 8 byte bitmap * convert i2500vfd and mdm166a driver to use 8 byte bitmap custom character * ula200: convert custom characters to 8 byte bitmap * Build system: Fix trying to install svga driver twice + imon: Add bignum support (Y. Scheglyuk) * hd44780/ethlcd: fix LCDd hang up on network error (exits now) (M. Bialonczyk) + New common 5x8 font for t6963, sed1520, mdm166a and i2500vfd * t6963: Size has now to be configured in pixels instead of characters + Build system: --enable-extra-charmaps option adds language specific charmaps * imonlcd: Fix spinning of disc icon (E. Pooch) * SureElec: Change port initialization (SF 3212891) * curses: Fix missed keystrokes (from Debian) * curses: Correct the name of the info function. * Update LCDd.conf to be better understood by Config::Model (D. Dumont) * CFontz: Fix display of bars v0.5.4 * Update driver includes and LDFLAGS (fixed glk and bayrad binding error) * Modify all drivers to use server/drivers/report.h instead of shared/report.h * Make all drivers using parallel port fail if they cannot get IO permission * Include instead of everywhere (found by S. Klauer) * configure: Fix de-selecting of drivers * Build system: Add a check testing if SA_RESTART flag is available. * picolcd driver: Fix RC-5 for picoLCD 20x2 (A. van Schie) * Introduce shared/defines.h to collect commonly used macros + new driver: SureElec for devices made by SURE Electronics (Laurent Latil) * hd44780-4bit: Fix bug not checking for keypad rows 7-10 correctly * Modify serial drivers to use cfmakeraw + hd44780: Add a 'none' charmap which does not replace any character * hd44780: Change mapping for spanish 'n with tilde' characters * hd44780: Exclude pin for switchable backlight from keypad scanning * server core: New network input buffering * hd44780: Extended subdriver API and performance improvement for lcd2usb * hd44780: Add KOI8-R character mapping (Yura Scheglyuk) * shuttleVFD: Add support for devices with USB VID 0x1308 again * CFontzPacket: Add CFA-533. Use HD44780 character mapping for CFA533/633. * CFontzPacket: Report cell size correctly, use block character for icon. * CFontz633: Deprecate this driver. Use CFontzPacket with Model=633 instead! - Remove native win32 support. * picolcd: Use module output function to control key LEDs (Martin Jones) + hd44780: Added 'usbtiny' connection type (Siarhei Herasimchuk) * SureElec: Fix stall on startup + new driver: MDM166A for Futaba/Targa USB VFD (Christoph Rasim) * picolcd: Fix backlight and contrast handling (M. T. Jones) * picolcd: Fix heartbeat icon messing up with vbar * imonlcd: Fix possible lockup in output (icons) function (E. Pooch) * pyramid: Fix buffer overflow in set_leds, incorrect escaping, and icons v0.5.3 + lcdexec: notification when called program finishes + xosd driver: offset from top-left corner + LCDd: Hello= config option for startup message * glk driver: bignum support fixed * update local snprintf to the last one, which is GPL - server core: cleanup - remove unnecessary cruft * server core: refactor rendering code + LCDd: config options TitleSpeed= and Heartbeat= * overhauled CwLnx driver (Dave Platt) * overhauled picolcd driver (Nicu Pavel) + add ServerScreen=blank option value * MtxOrb driver: fix VFD/VKD support (Ethan Dicks) + new driver lis for VLSystem L.I.S VFD (Daryl Fonseca-Holt) * serialPOS driver: input support, cleanup (Eric Pooch) + new driver shuttleVFD for USB-based Shuttle VFDs (Thien Vu) * enable building lcdproc client on FreeBSD AMD64 platform (M. Dolze) * Autoconf fixes for Net/FreeBSD (M. Dolze) * fixes for the lcpdroc client iface screen on *BSD (M.Dolze) + key support for hd44780/lcd2usb (M. Dolze) + option Priority for NoritakeVFD (idea: Richard Muratti) * overhauled NoritakeVFD driver (idea: Richard Muratti) * allow wrapping slider menu items with <= 4 keys (M. Dolze) * a bit more Doxygen-ation and documentation * hd44780 driver: make ConnectionType 4bit more fool-proof (M. Dolze) * picolcd driver: overhaul USB init for more portability (M. Dolze) + curses driver: new option DrawBorder (Bruno Schwander) * avoid sending duplicate "success" messages in response to menu_add_item + lcdexec: parameter support using widgets * server core: display values in menu for all input MenuEntry types * hd44780 driver: reorganize ConnectionType recognition + hd44780 driver: new ConnectionType mplay + hd44780 driver: get/set contrast & brightness support for lcd2usb (M. Dolze) + hd44780 driver: reporting in ConnectionType functions (Thomas Jarosch) * clean up build system (T. Jarosch, with tests/fixes by M. Dolze) + hd44780 driver: new ConnectionType ftdi (Thomas Jarosch) * shuttleVFD driver: fix VendorID, support newer models (Miska Sulander) + i2500vfd driver for a graphical Noritake VFD (Thomas Jarosch) * hd44780 driver: more complete initialization (idea by Pierre Ossman) * hd44780 driver: "euro" character mapping table (Markus Dolze) * CwLnx driver: support for CW12832 + new driver mx5000 for Logitech MX5000 keyboards (Christian Jodar) * update debian init scripts to allow multiple instances of clients + serialVFD driver: support for 4 more display types (Stefan Herdler) * IOWarrior driver: fixed 4-line display use + IOWarrior driver: add ExtendedMode option * lcdproc: unbreak compilation on OS X 1.5 and higher (Topher Fangio) * server: fix interpretation of numeric priorities (Andrew M. Bishop) + hd44780 driver: new ConnectionType ethlcd (Mariusz Bialonczyk) + picolcd driver: support to send IR commands to LIRC (Jack Cleaver) + picolcd driver: support for 20x4 picoLCDs (Nicu Pavel) + hd44780 driver: new ConnectionType uss720 (Eric Pooch) * new make targets to compile & install server & clients separately * autoconf fixes: check for pkg-config macros + new driver irtrans (Phant0m / Aron Parsons) + serialVFD driver: support Siemens/Wincor Nixdorf BA63/66 (Stefan Herdler) + new client lcdident.pl (Ethan Dicks) * server: prevent stalling if time goes backwards (M. Vallevand) * hd44780 driver: update the backlight setting only on change + hd44780 driver: add lineaddress option to support ST7036 (Malte Poeggel) + lcdproc: Retrieve per CPU usage statistics on FreeBSD (M. Dolze) * Change drivers to start in background by default: bayrad, CFontz, ea65, glk * imon driver: Change hbars to make last char in-/decrease vertically + hd44780 driver: port usblcd connection type from 0.4.5 to 0.5 (M. Dolze) * server: Fix interpretation of named screen priorities + new driver imonlcd for SoundGraph iMON LCD (Dean Harding, Jonathan Kyler) * MtxOrb driver: Fix backlight for old firmware * Add checks for null pointer / failed malloc to menu code * lcdproc, lcdexec, lcdvc clients: Use our included getopt.h * documentation: Fix XML errors in user and developer guide + documentation: Add man page for lcdvc v.0.5.2 * fix switching on/off the Load screen in lcdproc client using the menu * refactor adv_bignum: support height > 4, loadable chars with offset * ged rid of global variables buffer & tmp in lcdproc client + add init-script templates for LSB 3.x conforming systems * fix cellwidth in iMon driver + graphics character support in iMon driver (John Saunders) * try harder to find a shell in lcdexec + big number support in CwLnx driver via bignum library * do not copy more bytes than reserved in get_fs() in lcdproc's machine_*.c * update lcdproc's About screen with credits * fixes to ula200 build environment and documentation (B. Walle) * update g15 driver to be compatible with g15daemon > 1.2 (Anthony J. Mirabella) * allow compiling with LDFLAG "--as-needed" (Robert Buchholz) * optimize MtxOrb flush() * make MtxOrb use Brightness and OffBrightness like CFontzPacket * make Brightness & OffBrightness run-time configurable in CFontz & MtxOrb * add support for Iface and ProcSize screens for OS X / Darwin (Eric Pooch) * update & fix serialVFD driver (Stefan Herdler) + Hitachi SP14Q002 support & ConnectionType setting for sed1330 (Benjamin Wiedmann) * replace obsolete index() by strchr() (Guillaume LECERF) * fixes for CwLinux driver (Gideon Tsang) + new ConnectionType vdr-wakeup in hd44780 driver (originally Frank Jepsen) * fixes for the hd44780-serial drivers (Matteo Pillon) + new options for the hd44780 driver (Frank Jepsen) + new driver for text based serial Point of Sale displays (Eric Pooch) + new 2-line bignum mode using 6 user defined characters (Robin Gilks) * fix custom characters [with NewFirmware=yes] & backlight in CFontz + ea65 - driver for VFD in AOpen XC Cube AV EA65 barebones (Karsten Festag) + picolcd - driver for Mini-box.com USB LCD picoLCD (Gatewood Green) + new ConnectionType pertelian in hd44780 driver (Matteo Pillon) + new ConnectionType lcd2usb in hd44780 driver + make LCDd's GoodBye message configurable - remove compile-time option to read configuration from LDAP v.0.5.1 + config file support in lcdproc client (Andrew Foss) * install server & client config files in $(sysconfdir) + new client lcdvc: virtual console on LCD * convert adv_bignum library to bitwise set_char() * adapt drivers to modified bignum library: + CFontz + CFontz633 + CFontzPacket + hd44780 + IOWarrior + MtxOrb + serialVFD + tyan + add iface screen(s) to lcdproc client (Andrew Foss/Markus Dolze) * update sample Perl clients * fix LCDd crash on shutdown of clients using "menu_set_main" (Andrew Foss) * fix sock_connect() to allow 0 as legal socket (Frederick Nacino) * improve serialVFD driver (Stefan Herdler) + add MD8800 driver for LCDs in Medion MD8800 PCs (Stefan Herdler/Martin Møller) * make bigclock client screen more flexible: centered, require only 14 chars * correct axis mapping logic for joystick driver (Jannis Achstetter) * fixes to the CFontz driver + new unified serial sub-driver for hd44780 (Matteo Pillon) - obsolete hd44780 subdrivers-removed: lcdserializer, picanlcd * character mapping for special HD44780 modules (Matteo Pillon) + g15 - driver for LCD in Logitech G15 gaming keyboards (Anthony J. Mirabella) + EyeboxOne - driver for the LCD display on the EyeboxOne (Cedric TESSIER) * more flexible parsing of config files: allow spaces around sections and keys * updated & extended documentation * command line options more synchronizd between server and clients * CFontzPacket & CFontz633 support big & little endian systems * MtxOrb driver completely rewritten to support used-defined characters * CwLnx driver completely rewritten to support Cw1602 LCDs in addition to the CW12232 LCDs * more options in lcdproc's config file lcdproc.conf: + time and date formats can be changed using strftime formats + Load screen's LowLoad & HighLoad thresholds * revamped lcdexec's menu configuration * various little fixes v0.5.0 This version has split off from unstable-0.4.3. Includes major changes. + LCDd now does dynamic loading of driver modules * New API in use + LCDd will use fill-in functions for drivers that don't support a certain function. Available for: vbar, hbar, bignum, heartbeat, icon, cursor. * Server internal functions cleaned up, moved to other files etc. * Menu system rewritten + Client-supplied menus are now supported * Key support improved: now keys have descriptive names, not just a letter anymore. + Reloading of configuration and drivers by sending a SIGHUP. Probably needs improvement ;) * HD44780 output register support on winamp wiring * Reporting levels are now used more consistently + lcdexec client added * Display update frequency is now exactly 8Hz. Key scan frequency increased to 32Hz. * Priority scheme changed. Priority classes are now used, that indicate what kind of a screen we're dealing with. More useful for interactive clients. + better support for operating systems other than Linux: *BSD, Darwin + menu support for lcdproc client (configure option) + Added CFontz633 driver for CrytalFontz CFA633 + Added CFontzPacket driver fro CrystalFontz CFA-633, CFA-631, CFA-635 + Added glcdlib meta-driver for all LCDs supported by graphlcd-base + Added icp_a106 driver for A106 alarm/LCD boards in 19" racks by ICP + Added imon driver for iMON IR/VFD Modules from Silverstone, Uneed, ... + Added IOWarrior driver for IOWarrior USB controllers + Added lcterm driver for serial LCD terminal from Neumark Elektronik + Added ms6931 driver for MSI-6931 displays in 1U rack servers by MSI + Added mtc_s16209x driver for MTC-S16209x by Microtips Technology Inc + Added NoritakeVFD driver for Noritake VFD Device CU20045SCPB-T28A + Added pyramid driver for Pyramid LC-Displays + Added serialVFD driver for NEC FIPC8367 based serial VFDs + Added tyan driver for LCDs in Tyan Barebone GS series + Added ula200 driver for the USB board ULA-200 from ELV + Added xosd driver for On Screen Display on X + Added HD44780 subdriver bwctusb for USB-to-LCD converters from BWCT + Added HD44780 subdriver lcdserializer for an serial-LCD converter + Added HD44780 subdriver i2c to conned LCDs using the I2C bus + Added HD44780 subdriver lis2 for the LIS2 serial-to-USB converter v0.4.3 - Removed possibility of passing arguments to the drivers from the command line, which can be done in the configuration file now + Added configuration file support + Added ability of dropping root privileges to LCDd + Added LCDM001 driver (kernelconcepts.de) + Added Toshiba T6963 driver + Added Seiko-Epson SED 1520 driver + Added Seiko-Epson SED 1330 driver + Added STV5730 driver composite TV signal character generation driver * Modified the CFontz driver so that the new ROM version is supported + Added ASCII emulation of BigNum to the drivers that did not support custom characters + Added ability of configuring (rearranging) the keypad of MtxOrb displays + Added .lircrc location to the options of the lirc driver * Fixed backlight code (partly rewritten) * Fixed heartbeat code (completely rewritten analogous to the backlight code) + Added init scripts for debian and Redhat/Mandrake + Added EPM list file so that you can use EPM (http://www.easysw.com/epm) to generate packages of LCDproc + Added documentation in docbook format (LCDproc User's Guide - docs/lcdproc-user) * Ported some screens of lcdproc to *BSD. * Ported the parallel port functions in port.h to *BSD. v0.4.2: - Removed multiple output driver support - to simplify life * Removed use of sprintf() (in favor of snprintf) for security + Added ability to use defined port and address to listen on (for security) - now defaults to 127.0.0.1 + Revamped curses driver: now supports color; has border; and can be (with recompile) placed anywhere on screen it fits + Added --waittime server argument. You can now specify how long a screen should stay on the display. The default is 64 ticks or 8 seconds. + Fixed compile problems on non-Linux platforms where cfmakeraw, CBAUD, and ioperm don't exist. All drivers now use the same code to initialize a serial port. v0.4.1: + Changed protocol to 0.3 because we now accept both -foo and foo as argument introducers. in 0.4-pre10, these were changed from foo to -foo and this broke many clients. This change should fix that and be backward/forward compatible. + Added a noop function to the protocol. This is useful for writing shell script clients of LCDproc. + Changed the shared sock_send_string function to NOT send the ending NUL ('\0') byte with the string. This was confusing in Perl clients which saw NUL's as the first character of each reply. WARNING: The LCDPROC client depended on this behavior, your client may too. Use the newline instead. See the code in clients/lcdproc/main.c (look for "switch(buf[i])") to see one way to handle this. This should allow new clients to connect to old servers and vice-versa. + Messed with include structure in .c files. It should no longer be necessary to specify ../.. to get to shared code headers. Also, since we are using automake, the global config.h can be found with just #include "config.h" as it's location is included in a -I to the compilers. As a result "make distcheck" now works. + Added support for client_add_key and friends. Clients MUST now request keys to get notified. Keys are NO LONGER broadcast to all clients. Keys are now tied to a SCREEN and CLIENT. There are new commands (screen_add_key, screen_del_key) to bind keys to a screen. If the current screen has requested the key just pressed, the client gets the key and no other client gets it. If the current screen has not requested the current key, then the key is broadcast to all clients who requested that key with client_add_key. Clients might want to request a "hotkey" with client_add_key so they will be notified of that key no matter what screen is currently on the display, and then request whatever other keys a screen uses with screen_add_key. + Added driver for Matrix Orbital GLK12232-25 graphical display. Display is run in text mode since there isn't enough information in the widgets. If we knew the max width/height of an hbar/vbar, we could use graphical vbar/hbar's. Oh well. BigNums' look really cool though. You'll need some additional characters in the "Small Font" font (and the BigNumbers font) for this to work. + Rewrote Big Number Clock function in chrono.c. Many problems with it have been fixed. It now uses number value 10 to display a colon in between the digits. Don't know what this will do on a the MtxOrb driver. GLK driver draws a colon. + Cleaned up the CPU GRAPH (G) function in cpu.c and made get_load take a 'struct load' from the caller to save the last time values. This allows two callers (CPU GRAPH and CPU LOAD) to call get_load and both get reaosonable values. Without this, CPU GRAPH was always getting 0 because it was called immediatly after CPU LOAD called get_load and no clock ticks had gone by. + Changed --enable-debug autoconf option to be processed correctly. Debug now turns on -g and turns off -O6 + Lots of other little fixes. v0.4-pre10: + Metar client added (Weather information) + Linux infrared control (LIRC) driver added. + "rotating slash" heartbeat mode (looks weird on CFontz displays) Use "screen_set s -heartbeat slash" to use this. * Switched to client-server protocol V0.2, so arguments can come in any order, and require a "-" on the front. Instead of "widget_set s w 1 2 foo", use "widget_set s w -x 1 -y 2 -text foo". * Server info screen no longer enabled by default. * Merged Andrew McMeikan's HD44780 driver changes - Removed WHATSNEW + Added ChangeLog (okay, fine, I renamed WHATSNEW and typed a few entries into it :) V0.4-pre9: * small fixes for irix * Added flag in LCDd to shut off server screen: "-i off" or "--serverinfo off" + Wirz SLI driver + 16x2 support (server only) + MtxOrb generic output support in driver * Misc libc5 fixes + support for arbitrary display sizes; anything 16-80 characters wide, and 2-25 characters tall. (doesn't work if you try to use a display size bigger than your LCD.. :) * curses driver looks slightly better (titles) * sizes > 20x4 no longer crash V0.4-pre8: * LCDd gives more updated info in the connect string: cell size, lcd dimensions. * bargraphs are now the correct length on CFontz displays, in the main lcdproc client. For other clients, please parse the connect string! * MtxOrb driver supports simultaneous vbars/hbars now, with a mechanism to automatically use custom characters for as many as possible. + 20x2 support in LCDd! Use "--type 20x2". (LCDd --type 20x2 -d MtxOrb ) * LCDd can change backlight brightness instead of shutting it "off" * HD44780 should work again (LCDd forks earlier now.. oops :) + 20x2 support in lcdproc client for the following screens: C G T M X D B S U A Support will not be added for K and O screens. + BSD support (?) * 20x4 screens should display correctly on 40x4 displays V0.4-pre7: new driver + CrystalFontz (CFontz) LCD driver added * Backlight control improved + Brightness control added V0.4-pre6: + Backlight control added. Modes so far are "on", "off", and "open". Client commands are "on", "off", "toggle", "blink", and "flash". * Main clients' screen titles now include hostname + New sample client: fortune.pl * Added changes from David Glaude: + IRman support + Big Digit support (MtxOrb driver doesn't display it correctly yet) + Big cloc[K] screen * MtxOrb serial speed is configurable with "--speed" * misc bugfixes + ... more V0.4-pre5: * Fixed bug which could take server down with a dead client * Fixed small scroller bug + Added "frame" widgets.. use "-in " after widget_add to put something in a frame. + The disk screen is back! - Frame rendering isn't finished.. the renderer probably needs a complete rewrite. Any volunteers? :) V0.4-pre4: + Server menus (fairly small so far) + Ability to shut down, reboot, change some options, etc (menu only) * Driver arguments no longer required * Curses driver doesn't start server in background any more... * Argument handling fixed... * Drivers support "--help" for command-line info V0.4-pre3: + Scroller widgets * Proper errno messages... * "make install" should work now * Joystick driver allows key remapping + Screen "durations" are actually *used* now. (oops) + Initial support for screen priorities (strict priority queue) * Misc (but annoying!) bugs fixed, which hadn't yet affected anything + Drivers support parameters now (MtxOrb, joy, at least) V0.4-pre2: * Memory leaks fixed + Memory "top" screen (S) + Titles now autoscroll * Fixed small screen-visibility bug (clients weren't always notified of screen cycles) + Heartbeat modes implemented. Clients can remove it with widget_del my_screen heartbeat or turn it back on with widget_add my_screen heartbeat " " Note that the client only has control over this when the heartbeat is in "open" mode. (currently, it always is) V0.4-pre1: * Too much to mention... lcdproc-0.5.7/INSTALL000644 001751 000000 00000025640 12045443052 015011 0ustar00mmdolzewheel000000 000000 -- REALLY-QUICK START -------------------------------------------------- If you're in a desperate hurry type: ./configure --enable-drivers=all make And if you start wondering why it doesn't work, come back and read the rest of the file. 8) -- PREREQUISITES ----------------------------------------------------- First read the README if you haven't already. Please take a few minutes to read the user guide located at http://lcdproc.sourceforge.net/docs/ For the details on supported platforms, see the PLATFORM SPECIFIC section of this file. In order to compile LCDproc, you'll need the following programs: * A C compiler which supports C99, we recommend GCC. Most Linux or BSD systems come with GCC. * GNU Make. It is available for all major distributions. If you want to compile it yourself, see http://www.gnu.org/software/make/make.html . * The GNU autotools, that is automake and autoconf. They are only required if you want to build LCdproc directory from CVS. The GNU autotools are available for all major distributions. If you want to compile them yourself, see http://www.gnu.org/software/autoconf/ and http://www.gnu.org/software/automake/. Depending on the ./configure options and your choice of drivers, you will need some additional programs or libraries installed: * DocBook XML converter "xmlto" if you want to create the documentation or Doxygen when used with --enable-doxygen, also see http://cyberelk.net/tim/software/xmlto/ and http://www.stack.nl/~dimitri/doxygen/ * libusb if you --enable-libusb, see http://libusb.sourceforge.net/ * G15daemon, libg15 and libg15render (>= 1.1.1) for use with the 'g15' driver, see http://www.g15tools.com/ * GraphLCD and GLCDprocDriver for use with the 'glcdlib' driver, see http://projects.vdr-developer.org/projects/graphlcd/ and http://lucianm.github.com/GLCDprocDriver/ * libirman for use with the 'irman' driver, see http://www.evation.com/libirman/libirman.html for the home page and http://www.lirc.org/software/snapshots/ for current downloads * LIRC for use with the 'lirc' driver, see http://www.lirc.org/ * ncurses for use with the 'curses' driver, see http://www.gnu.org/software/ncurses/ * svgalib for use with the 'svga' driver, see http://www.svgalib.org/ * libftdi and libusb for use with the 'ula200', 'lis', and 'i2500vfd' driver, see http://www.intra2net.com/en/developer/libftdi/ and http://libusb.sourceforge.net/ * XOSD for use with the 'xosd' driver, see http://sourceforge.net/projects/libxosd/ , as well as an x11 implementation, more precisely libX11 and libXext. -- DISPLAYS ----------------------------------------------------------- Many different displays (or better said: output devices) are supported. Some of these devices also support input, for example with a keypad. There are drivers for input-only devices, too. For LCDd (the server) to use the device, it needs to load a driver. The drivers are so called 'shared modules', that usually have an extension of .so . The drivers to be loaded should be specified in the config file (by one or more Driver= lines), or on the command line. The command line should only be used to override things in the config file. The drivers should be in a directory that is indicated by the DriverPath= line in the configfile. Depending on what kind of LCD display that you have, there are several sources for information. If your LCD display came with a manual, this is a great place to start. If you don't have a manual, then you must find out what kind of display this is, and check the related information: HD44780 and compatible: read the HD44780 section in the LCDproc User's Guide (docs/lcdproc-user) or alternatively see http://www.robijn.net/lcdproc/ If you still have problems you could take a look at the comments in the driver source code in server/drivers/. You may have some good indications there. You may want to take a look at LCDproc's hardware page at http://lcdproc.org/hardware.php3 for details. Several different types of displays are now supported. -- BUILDING LCDPROC ------------------------------------------------- --- Preparing a CVS distro --- If you retrieved these files from the CVS, you will first need to run: sh ./autogen.sh --- Configuration --- The simplest way of doing it is with: ./configure But it may not do what you want, so please take a few seconds to type: ./configure --help And read the available options, especially --enable-drivers --- Compilation --- Run make to build the server and all clients make If you only want to compile the clients, you can omit to compile the server: make clients Similarly, if you only want to compile the server, you can omit to compile the clients: make server Depending on your system, LCDproc will build in a few seconds to a few minutes. It's not very big. If you want to, you can install it (if you're root) by typing: make install This will install the binaries and the man pages in the directory you specified in configure. You may have to copy the configuration file (LCDd.conf) to /etc (or /usr/local/etc) manually. -- CREATING DISTRIBUTION SPECIFIC PACKAGES -------------------------- Instead of manually configuring, compiling and installing LCDproc you may use the support files in the LCDproc source tree to create an installation package specific to your distribution Debian: - Rename the .tgz file with the sources to lcdproc_VERSION.orig.tar.gz cp lcdproc-VERSION.tgz lcdproc_VERSION.orig.tar.gz - Extract the source tar ball tar xvzf lcdproc_VERSION.orig.tar.gz - Copy the debian/ directory below scripts/ to the root of the source tree cp -a lcdproc-VERSION/scripts/debian lcdproc-VERSION/ - Generate .deb debian package cd lcdproc-VERSION/ dpkg-buildpackage -rfakeroot -sd cd .. This creates a file named lcdproc_VERSION-RELEASE_ARCH.deb that contains the LCDproc suite as a regular Debian package. -- PLATFORM SPECIFIC ------------------------------------------------ The lcdproc crew has tried to support a number of platforms. Platforms that are very non-standard are not and probably will never be supported. Both, the server with its drivers and the clients, have their own difficulties in porting. Here's are the prerequisites for both: --- Client --- The client should run on any POSIX compliant system. It has been successfully tested on: Linux 2.2.x - 2.6.x, FreeBSD 6.x - 8.1, NetBSD 1.5 & 3.x, OpenBSD 3.0, Darwin, Solaris and MacOS. --- Server --- The server needs to talk to the LCD display. At this time, it works on very little more than on the Intel i386 (PC Compatible) architecture. It has been successfully tested on: Linux 2.2.x - 2.6.x, FreeBSD 6.x - 8.1, NetBSD 1.5 & 3.x, OpenBSD 3.0, Darwin, Solaris and MacOS. Here are some comments specific to each platform that LCDproc has been tested on. --- Linux --- Nothing special to say, everything should go well. You may not be able to compile all drivers on something else than i386 if your linux installation does not have ioperm, inb and outb commands. ./configure should leave all drivers that need those functions out (drivers for parallel port displays), so that LCDd should compile anyway. --- NetBSD --- You need to use GNU Make instead of NetBSD's make. Remember to type gmake instead of make to compile LCDproc. The server will probably only compile on NetBSD/i386. If you try to run LCDd and you get this error: Bus error (core dumped) It is likely that you did not have the right permission to access the ports. Try starting the program as root. --- OpenBSD --- You need to use GNU Make instead of OpenBSD's make. Remember to type gmake instead of make to compile LCDproc. The server will probably only compile on OpenBSD/i386. --- FreeBSD --- It should compile fine on i386. Must be started as root to be able to use parallel and USB ports. --- Other platforms --- If the build process fails, but you do know how to link a loadable module by hand, you can add the appropriate flags et cetera into acinclude.m4. Experience required. Please let us know if you got it working on a previously unsupported system, so we can include it in a next release. -- RUNNING LCDPROC ----------------------------------------------------- --- Configuration file --- The first thing that you need to do is to modify the configuration file for your server. A example file (LCDd.conf) is available in the tarball. The comments present in this file should give you indications on what to do. --- Starting the server --- If you're in the LCDproc source directory, and have just built it, run: server/LCDd -c path/to/config/file For security reasons, LCDd by default only accepts connections from localhost (127.0.0.1), it will not accept connections from other computers on your network / the Internet. You can change this behaviour in the configuration file. --- Starting the client(s) --- Then, you'll need some clients. LCDproc comes with a few, of which the 'lcdproc' client is the main client: clients/lcdproc/lcdproc -f C M T L This will run the LCDproc client, with the [C]pu, [M]emory, [T]ime, and [L]oad screens. The option "-f" causes it not to daemonize, but run in the foreground. By default, the client tries to connect to a server located on localhost and listening to port 13666. To change this, use the -s and -p options. -- PUTTING LCDPROC IN SYSTEM STARTUP ----------------------------------- It's nice to have LCDproc start when the computer boots, so here's how to do it: WARNING: Make sure you have modified the configuration file (/etc/LCDd.conf) so that LCDd enters the background mode. Otherwise LCDd will lock your system. Slackware: Add lines to your /etc/rc.d/rc.local, such as the following: echo "Starting LCDd..." /usr/local/sbin/LCDd -c /etc/LCDd.conf echo "Starting lcdproc..." /usr/local/bin/lcdproc C M X & Debian: (the hard way) - Copy (as root) the debian init script from the scripts/ directory of the sources to /etc/init.d (cp scripts/init-LCDd.debian /etc/init.d/LCDd && \ cp scripts/init-lcdproc.debian /etc/init.d/lcdproc) - Run (as root): update-rc.d LCDd defaults This will create symlinks to start and stop the daemon, resp. from /etc/rc[2-5].d/S50LCDd to /etc/init.d/LCDd, and from /etc/rc[016].d/K50LCDd to /etc/init.d/LCDd. - Run (as root): update-rc.d lcdproc defaults This will create symlinks to start and stop the lcdproc client, resp. from /etc/rc[2-5].d/S50lcdproc to /etc/init.d/lcdproc, and from /etc/rc[016].d/K50lcdproc to /etc/init.d/lcdproc. Debian: (the easy way) - Install the previously created .deb package (as root) dpkg -i lcdproc_VERSION-RELEASE_ARCH.deb Redhat / Mandrake: - Copy the scripts: cp scripts/init-lcdd.rpm /etc/rc.d/init.d/lcdd && \ cp scripts/init-lcdproc.rpm /etc/rc.d/init.d/lcdproc) - enable the scripts with e.g. linuxconf or create the symlinks manually FreeBSD: - If you install from the ports collection startup script are installed by default. That's all the OS's we've actually done this with so far. lcdproc-0.5.7/README000644 001751 000000 00000007066 11621737632 014653 0ustar00mmdolzewheel000000 000000 -- INTRODUCTION -------------------------------------------------------------- LCDproc is a client/server suite including drivers for all kinds of nifty LCD devices. The server works with different display sizes and supports several serial devices: Matrix Orbital, Crystal Fontz, Bayrad, LB216, LCDM001 (kernelconcepts.de), Wirz-SLI and PIC-an-LCD; some devices connected to the parallel port: HD44780, STV5730, T6963, SED1520 and SED1330; and also some displays connected via USB: CFontzPacket, CwLnx, IOWarrior, LIS2 and BWCT. Various clients are available that display things like CPU load, system load, memory usage, uptime, and a lot more. LCDproc also supports key or remote control input for controlling the clients. The client and the server use a TCP connection to communicate, so it is possible to have a client on a box in Sweden showing its stats on a LCD display in the United States. Our web site is located at http://lcdproc.org/ For new versions and CVS go to http://sourceforge.net/projects/lcdproc/ Check there first for new versions or updates. For remaining questions, you can ask the mailing list. For how to get on the mailing list, see the main web site. LCDproc was originally written by William W. Ferrell and Selene Scriven . -- INSTALLATION -------------------------------------------------------------- Refer to the INSTALL file included with this archive for installation instructions (including how to connect the LCD to your system). -- CHANGES ------------------------------------------------------------------- Woow... a lot. :) See the ChangeLog file for more details. -- HELPING OUT --------------------------------------------------------------- The first thing you should do is join the mailing list, to do so, go to out web site and click on MAIL and follow the instructions. If you get the urge to help out by writing code, take a look at the TODO file to see what we think that needs to be done. If you want to work on something, or you want to add something different, tell it on the mailing list. Maybe someone is already working on the part, and maybe someone has already writen something that you can use. New ideas are always welcome ! To learn more about how LCDproc works, first have a look at the docs/ directory. Some important things are documented there, but because this is still somewhat a big hacking project, some documentation will be missing ;) -- SPECIAL THANKS ------------------------------------------------------------ LCDproc is a community effort, and as such we'd like to recognize everyone's efforts. We've tried to list all the people that have contributed in the CREDITS file. Thanks all ! -- LEGAL STUFF --------------------------------------------------------------- LCDproc is Copyright (C) 1998-2006 William Ferrell, Selene Scriven and many other contributors. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. The file COPYING contains the GNU General Public License. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. lcdproc-0.5.7/TODO000644 001751 000000 00000004256 11621737632 014461 0ustar00mmdolzewheel000000 000000 NOTE: Use of this TODO list is obsolete! A list of things to be done is automatically created by Doxygen. You may create the Doxygen documentation yourself by running the doxygen command from the docs/ directory. Ideas for new features can be entered at the IdeaTorrent: http://sourceforge.net/apps/ideatorrent/lcdproc/ ------------------------------------------------------------------------------ Stuff planned for future releases... (in no particular order) Feel free to help out with any of this stuff! :) Please send a message to the mailing list if you have any question. Things for the short term ========================= - Use non-standard serial baud rates (57600 and higher) only optional. Things for the longer term ========================== lcdproc client -------------- - allow more than one instance of a screen with different configuration sections (implementation should be possible similar to the one with the drivers in LCDd where File=... points to the original driver file) - more options in the config file (clocks with offsets from localtime, ...) - more options changeable in the lcdproc client menu - rewrite machine_get_fs() in machine_Linux.c to use functions from mntent.h - get rid of MTAB_FILE compile time definition (for Linux & SunOS) lcdexec client -------------- more flexbibility: do not just only execute commands, but maybe also display their result in a screen, get a command's parameters interactively using the builtin input menus, confirmation of commands, jumping between commands depending on the output of a command (wizards), ... Client driver ------------- An LCDproc client can connect, request the "client" driver, then get all screen information sent to it! This allows things such as logging in remotely and starting up a curses display of LCDproc. It also gives another method for writing drivers. In a sense, it could even let you write and link in new drivers without having to recompile and restart LCDproc... Another bonus is that LCDproc will come with a client which can, for example, start up a "client" driver to send "keypresses" from the command line. Or, lcdtool -key A would have the same result as pressing a key on the keypad. lcdproc-0.5.7/compile000555 001751 000000 00000016245 12330423206 015331 0ustar00mmdolzewheel000000 000000 #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: lcdproc-0.5.7/install-sh000555 001751 000000 00000033255 12330423206 015757 0ustar00mmdolzewheel000000 000000 #!/bin/sh # install - install a program, script, or datafile scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: lcdproc-0.5.7/missing000555 001751 000000 00000015331 12330423206 015345 0ustar00mmdolzewheel000000 000000 #! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2012-06-26.16; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'automa4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: lcdproc-0.5.7/LCDd.conf000644 001751 000000 00000113000 12313532717 015366 0ustar00mmdolzewheel000000 000000 # LCDd.conf -- configuration file for the LCDproc server daemon LCDd # # This file contains the configuration for the LCDd server. # # The format is ini-file-like. It is divided into sections that start at # markers that look like [section]. Comments are all line-based comments, # and are lines that start with '#' or ';'. # # The server has a 'central' section named [server]. For the menu there is # a section called [menu]. Further each driver has a section which # defines how the driver acts. # # The drivers are activated by specifying them in a driver= line in the # server section, like: # # Driver=curses # # This tells LCDd to use the curses driver. # The first driver that is loaded and is capable of output defines the # size of the display. The default driver to use is curses. # If the driver is specified using the -d command line option, # the Driver= options in the config file are ignored. # # The drivers read their own options from the respective sections. ## Server section with all kinds of settings for the LCDd server ## [server] # Where can we find the driver modules ? # IMPORTANT: Make sure to change this setting to reflect your # specific setup! Otherwise LCDd won't be able to find # the driver modules and will thus not be able to # function properly. # NOTE: Always place a slash as last character ! DriverPath=server/drivers/ # Tells the server to load the given drivers. Multiple lines can be given. # The name of the driver is case sensitive and determines the section # where to look for further configuration options of the specific driver # as well as the name of the dynamic driver module to load at runtime. # The latter one can be changed by giving a File= directive in the # driver specific section. # # The following drivers are supported: # bayrad, CFontz, CFontzPacket, curses, CwLnx, ea65, EyeboxOne, g15, glcd, # glcdlib, glk, hd44780, icp_a106, imon, imonlcd,, IOWarrior, irman, joy, # lb216, lcdm001, lcterm, lirc, lis, MD8800,, mdm166a, ms6931, mtc_s16209x, # MtxOrb, mx5000, NoritakeVFD, picolcd,, pyramid, rawserial, sdeclcd, # sed1330, sed1520, serialPOS, serialVFD, shuttleVFD, sli,, stv5730, svga, # t6963, text, tyan, ula200, vlsys_m428, xosd Driver=curses # Tells the driver to bind to the given interface. [default: 127.0.0.1] Bind=127.0.0.1 # Listen on this specified port. [default: 13666] Port=13666 # Sets the reporting level; defaults to warnings and errors only. # [default: 2; legal: 0-5] #ReportLevel=3 # Should we report to syslog instead of stderr? [default: no; legal: yes, no] #ReportToSyslog=yes # User to run as. LCDd will drop its root privileges and run as this user # instead. [default: nobody] User=nobody # The server will stay in the foreground if set to yes. # [default: no, legal: yes, no] #Foreground=yes # Hello message: each entry represents a display line; default: builtin #Hello=" Welcome to" #Hello=" LCDproc!" # GoodBye message: each entry represents a display line; default: builtin #GoodBye="Thanks for using" #GoodBye=" LCDproc!" # Sets the default time in seconds to displays a screen. [default: 4] WaitTime=5 # If set to no, LCDd will start with screen rotation disabled. This has the # same effect as if the ToggleRotateKey had been pressed. Rotation will start # if the ToggleRotateKey is pressed. Note that this setting does not turn off # priority sorting of screens. [default: on; legal: on, off] #AutoRotate=off # If yes, the the serverscreen will be rotated as a usual info screen. If no, # it will be a background screen, only visible when no other screens are # active. The special value 'blank' is similar to no, but only a blank screen # is displayed. [default: on; legal: on, off, blank] #ServerScreen=off # Set master backlight setting. If set to 'open' a client may control the # backlight for its own screens (only). [default: open; legal: off, open, on] #Backlight=open # Set master heartbeat setting. If set to 'open' a client may control the # heartbeat for its own screens (only). [default: open; legal: off, open, on] #Heartbeat=open # set title scrolling speed [default: 10; legal: 0-10] #TitleSpeed=10 # The "...Key=" lines define what the server does with keypresses that # don't go to any client. The ToggleRotateKey stops rotation of screens, while # the PrevScreenKey and NextScreenKey go back / forward one screen (even if # rotation is disabled. # Assign the key string returned by the driver to the ...Key setting. These # are the defaults: ToggleRotateKey=Enter PrevScreenKey=Left NextScreenKey=Right #ScrollUpKey=Up #ScrollDownKey=Down ## The menu section. The menu is an internal LCDproc client. ## [menu] # You can configure what keys the menu should use. Note that the MenuKey # will be reserved exclusively, the others work in shared mode. # Up to six keys are supported. The MenuKey (to enter and exit the menu), the # EnterKey (to select values) and at least one movement keys are required. # These are the default key assignments: MenuKey=Escape EnterKey=Enter UpKey=Up DownKey=Down #LeftKey=Left #RightKey=Right ### Driver sections are below this line, in alphabetical order ### ## EMAC BayRAD driver ## [bayrad] # Select the output device to use [default: /dev/lcd] Device=/dev/lcd # Set the communication speed [default: 9600; legal: 1200, 2400, 9600, 19200] Speed=9600 ## CrystalFontz driver (for CF632 & CF634) ## [CFontz] # Select the output device to use [default: /dev/lcd] Device=/dev/ttyS0 # Select the LCD size [default: 20x4] Size=20x4 # Set the initial contrast [default: 560; legal: 0 - 1000] Contrast=350 # Set the initial brightness [default: 1000; legal: 0 - 1000] Brightness=1000 # Set the initial off-brightness [default: 0; legal: 0 - 1000] # This value is used when the display is normally # switched off in case LCDd is inactive OffBrightness=0 # Set the communication speed [default: 9600; legal: 1200, 2400, 9600, 19200, # 115200] Speed=9600 # Set the firmware version (New means >= 2.0) [default: no; legal: yes, no] NewFirmware=no # Reinitialize the LCD's BIOS [default: no; legal: yes, no] # normally you shouldn't need this Reboot=no ## CrystalFontz packet driver (for CFA533, CFA631, CFA633 & CFA635) ## [CFontzPacket] # Select the LCD model [default: 633; legal: 533, 631, 633, 635] Model=633 # Select the output device to use [default: /dev/lcd] Device=/dev/ttyUSB0 # Set the initial contrast [default: 560; legal: 0 - 1000] Contrast=350 # Set the initial brightness [default: 1000; legal: 0 - 1000] Brightness=1000 # Set the initial off-brightness [default: 0; legal: 0 - 1000] # This value is used when the display is normally # switched off in case LCDd is inactive OffBrightness=50 # Reinitialize the LCD's BIOS on driver start. [default: no; legal: yes, no] Reboot=yes # Enable the USB flag if the device is connected to an USB port. For # serial ports leave it disabled. [default: no; legal: yes, no] #USB=yes # Very old 633 firmware versions do not support partial screen updates using # 'Send Data to LCD' command (31). For those devices it may be necessary to # enable this flag. [default: no; legal: yes, no] #OldFirmware=yes # Override the LCD size known for the selected model. Usually setting this # value should not be necessary. #Size=20x4 # Override the default communication speed known for the selected model. # Default value depends on model [legal: 19200, 115200] #Speed=115200 ## Curses driver ## [curses] # color settings # foreground color [default: blue] Foreground=blue # background color when "backlight" is off [default: cyan] Background=cyan # background color when "backlight" is on [default: red] Backlight=red # display size [default: 20x4] Size=20x4 # What position (X,Y) to start the left top corner at... # Default: (7,7) TopLeftX=7 TopLeftY=7 # use ASC symbols for icons & bars [default: no; legal: yes, no] UseACS=no # draw Border [default: yes; legal: yes, no] DrawBorder=yes ## Cwlinux driver ## [CwLnx] # Select the LCD model [default: 12232; legal: 12232, 12832, 1602] Model=12232 # Select the output device to use [default: /dev/lcd] Device=/dev/ttyUSB0 # Select the LCD size. Default depends on model: # 12232: 20x4 # 12832: 21x4 # 1602: 16x2 Size=20x4 # Set the communication speed [default: 19200; legal: 9600, 19200] Speed=19200 # Reinitialize the LCD's BIOS [default: no; legal: yes, no] # normally you shouldn't need this Reboot=no # If you have a keypad connected. Keypad layout is currently not # configureable from the config file. Keypad=yes # If you have a non-standard keypad you can associate any keystrings to keys. # There are 6 input keys in the CwLnx hardware that generate characters # from 'A' to 'F'. # # The following is the built-in default mapping hardcoded in the driver. # You can leave those unchanged if you have a standard keypad. # You can change it if you want to report other keystrings or have a non # standard keypad. # KeyMap_A=Up # KeyMap_B=Down # KeyMap_C=Left # KeyMap_D=Right # KeyMap_E=Enter # KeyMap_F=Escape # keypad_test_mode permits one to test keypad assignment # Default value is no #keypad_test_mode=yes ## ea65 driver for the display in AOpen XC Cube AV EA65 media barebones ## [ea65] # Device is fixed /dev/ttyS1 # Width and Height are fixed 9x1 # As the VFD is self luminescent we don't have a backlight # But we can use the backlight functions to control the front LEDs # Brightness 0 to 299 -> LEDs off # Brightness 300 to 699 -> LEDs half bright # Brightness 700 to 1000 -> LEDs full bright Brightness=500 # OffBrightness is the the value used for the 'backlight off' state OffBrightness=0 ## EyeboxOne driver ## [EyeboxOne] # Select the output device to use [default: /dev/ttyS1] #Device=/dev/cua01 Device=/dev/ttyS1 # Set the display size [default: 20x4] Size=20x4 # Switch on the backlight? [default: yes] Backlight=yes # Switch on the cursor? [default: no] Cursor=no # Set the communication speed [default: 19200; legal: 1200, 2400, 9600, 19200] Speed=19200 # Enter Key is a \r character, so it's hardcoded in the driver LeftKey=D RightKey=C UpKey=A DownKey=B EscapeKey=P # You can find out which key of your display sends which # character by setting keypad_test_mode to yes and running # LCDd. LCDd will output all characters it receives. # Afterwards you can modify the settings above and set # keypad_set_mode to no again. keypad_test_mode=no ## g15 driver for Logitech G15 Keyboard LCDs ## [g15] # Display size (currently unused) size=20x5 ## glcd generic graphical display driver [glcd] # Select what type of connection. See documentation for types. ConnectionType=t6963 # Width and height of the display in pixel. The supported sizes may depend on # the ConnectionType. [default: 128x64; legal: 1x1 - 640x480] #Size=128x64 # Width and height of a character cell in pixels. This value is only used if # the driver has been compiled with FreeType and it is enabled. Otherwise the # default 6x8 cell is used. #CellSize=12x16 # If LCDproc has been compiled with FreeType 2 support this option can be used # to turn if off intentionally. [default: yes; legal: yes, no] #useFT2=no # Path to font file to use for FreeType rendering. This font must be monospace # and should contain some special Unicode characters like arrows (Andale Mono # is recommended and can be fetched at http://corefonts.sf.net). #normal_font=/usr/local/lib/X11/fonts/TTF/andalemo.ttf # Some fonts miss the Unicode characters used to represent icons. In this case # the built-in 5x8 font can used if this option is turned off. [default: yes; # legal: yes, no] #fontHasIcons=no # Set the initial contrast if supported by connection type. # [default: 600; legal: 0 - 1000] #Contrast=600 # Set brightness of the backlight if the backlight is switched 'on'. # [default: 800; legal: 0 - 1000] #Brightness=1000 # Set brightness of the backlight if the backlight is switched 'off'. Set this # to zero to completely turn off the backlight. [default: 100; legal: 0 - 1000] #OffBrightness=0 # Time (ms) from first key report to first repeat. Set to 0 to disable repeated # key reports. [default: 500; legal: 0 - 3000] #KeyRepeatDelay=500 # Time (ms) between repeated key reports. Ignored if KeyRepeatDelay is disabled # (set to zero). [default: 300; legal: 0 - 3000] #KeyRepeatInterval=300 # Assign key strings to keys. There may be up to 16 keys numbered 'A' to 'Z'. # By default keys 'A' to 'F' are assigned Up, Down, Left, Right, Enter, Escape. KeyMap_A=Up KeyMap_B=Down KeyMap_C=Enter KeyMap_D=Escape # --- t6963 options --- # Parallel port to use [default: 0x378; legal: 0x200 - 0x400] #Port=0x378 # 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 # Insert additional delays into reads / writes. [default: no; legal: yes, no] #delayBus=no # --- serdisplib options --- # Name of the underlying serdisplib driver, e.g. ctinclud. See # serdisplib documentation for details. serdisp_name=t6963 # The display device to use, e.g. serraw:/dev/ttyS0, # parport:/dev/parport0 or USB:07c0/1501. serdisp_device=/dev/ppi0 # 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 # --- picolcdgfx options --- # Time in ms for usb_read to wait on a key press. [default: 125; legal: >0] #picolcdgfx_KeyTimeout=125 # Inverted: Inverts the pixels. [default: no; legal: yes or no] #picolcdgfx_Inverted=no ## glcdlib meta driver for graphical LCDs ## [glcdlib] ## mandatory: # which graphical display supported by graphlcd-base to use [default: image] # (see /etc/graphlcd.conf for possible drivers) Driver=noritake800 # no=use graphlcd bitmap fonts (they have only one size / font file) # yes=use fonts supported by FreeType2 (needs Freetype2 support in # libglcdprocdriver and its dependants) UseFT2=yes # text resolution in fixed width characters [default: 16x4] # (if it won't fit according to available physical pixel resolution # and the minimum available font face size in pixels, then # 'DebugBorder' will automatically be turned on) TextResolution=20x4 # path to font file to use FontFile=/usr/share/fonts/corefonts/courbd.ttf ## these only apply if UseFT2=yes: # character encoding to use CharEncoding=iso8859-2 # minimum size in pixels in which fonts should be rendered MinFontFaceSize=7x12 ## optional: Brightness=50 # Brightness (in %) if applicable Contrast=50 # Contrast (in %) if applicable Backlight=no # Backlight if applicable UpsideDown=no # flip image upside down Invert=no # invert light/dark pixels ShowDebugFrame=no # turns on/off 1 pixel thick debugging # border within the usable text area, # for setting up TextResolution and # MinFontFaceSize (if using FT2); ShowBigBorder=no # border around the unused area ShowThinBorder=yes # border around the unused area PixelShiftX=0 PixelShiftY=2 ## Matrix Orbital GLK driver ## [glk] # select the serial device to use [default: /dev/lcd] Device=/dev/lcd # set the initial contrast value [default: 560; legal: 0 - 1000] Contrast=560 # set the serial port speed [default: 19200; legal: 9600, 19200, 38400] Speed=19200 ## Hitachi HD44780 driver ## [hd44780] # Select what type of connection. See documentation for availabe types. ConnectionType=4bit # I/O address of the LPT port. Usual values are: 0x278, 0x378 and 0x3BC. # For I2C connections this sets the slave address (usually 0x20). Port=0x378 # Device of the serial, I2C, or SPI interface [default: /dev/lcd] Device=/dev/ttyS0 # Bitrate of the serial port (0 for interface default) Speed=0 # If you have a keypad connected. # You may also need to configure the keypad layout further on in this file. Keypad=no # Set the initial contrast (bwctusb, lcd2usb, and usb4all) # [default: 800; legal: 0 - 1000] #Contrast=0 # Set brightness of the backlight (lcd2usb and usb4all): # Brightness is the brightness while the backlight is set to 'on'. # [default: 800; legal: 0 - 1000] #Brightness=1000 # OffBrightness is the brightness while the backlight is set to 'off'. # [default: 300; legal: 0 - 1000] #OffBrightness=0 # If you have a switchable backlight. Backlight=no # If you have the additional output port ("bargraph") and you want to # be able to control it with the lcdproc OUTPUT command OutputPort=no # Specifies if the last line is pixel addressable (yes) or it controls an # underline effect (no). [default: yes; legal: yes, no] #Lastline=yes # Specifies the size of the LCD. # In case of multiple combined displays, this should be the total size. Size=20x4 # For multiple combined displays: how many lines does each display have. # Vspan=2,2 means both displays have 2 lines. #vspan=2,2 # If you have an HD66712, a KS0073 or another controller with 'extended mode', # set this flag to get into 4-line mode. On displays with just two lines, do # not set this flag. # As an additional restriction, controllers with and without extended mode # AND 4 lines cannot be mixed for those connection types that support more # than one display! #ExtendedMode=yes # In extended mode, on some controllers like the ST7036 (in 3 line mode) # the next line in DDRAM won't start 0x20 higher. [default: 0x20] #LineAddress=0x10 # Character map to to map ISO-8859-1 to the LCD's character set # [default: hd44780_default; legal: hd44780_default, hd44780_euro, ea_ks0073, # sed1278f_0b, hd44780_koi8_r, hd44780_cp1251, hd44780_8859_5, upd16314 ] # (hd44780_koi8_r, hd44780_cp1251, hd44780_8859_5 and upd16314 are possible if # compiled with additional charmaps) CharMap=hd44780_default # If your display is slow and cannot keep up with the flow of data from # LCDd, garbage can appear on the LCDd. Set this delay factor to 2 or 4 # to increase the delays. Default: 1. #DelayMult=2 # Some displays (e.g. vdr-wakeup) need a message from the driver to that it # is still alive. When set to a value bigger then null the character in the # upper left corner is updated every seconds. Default: 0. #KeepAliveDisplay=0 # If you experience occasional garbage on your display you can use this # option as workaround. If set to a value bigger than null it forces a # full screen refresh seconds. Default: 0. #RefreshDisplay=5 # You can reduce the inserted delays by setting this to false. # On fast PCs it is possible your LCD does not respond correctly. # Default: true. DelayBus=true # If you have a keypad you can assign keystrings to the keys. # See documentation for used terms and how to wire it. # For example to give directly connected key 4 the string "Enter", use: # KeyDirect_4=Enter # For matrix keys use the X and Y coordinates of the key: # KeyMatrix_1_3=Enter KeyMatrix_4_1=Enter KeyMatrix_4_2=Up KeyMatrix_4_3=Down KeyMatrix_4_4=Escape ## ICP A106 driver ## [icp_a106] Device=/dev/ttyS1 ## Code Mercenaries IO-Warrior driver ## [IOWarrior] # display dimensions Size=20x4 # serial number. Must be exactly as listed by usbview # (if not given, the 1st IOWarrior found gets used) #SerialNumber=00000674 # If you have an HD66712, a KS0073 or another 'almost HD44780-compatible', # set this flag to get into extended mode (4-line linear). #ExtendedMode=yes # Specifies if the last line is pixel addressable (yes) or it controls an # underline effect (no). [default: yes; legal: yes, no] #Lastline=yes ## Soundgraph/Ahanix/Silverstone/Uneed/Accent iMON driver ## [imon] # select the device to use Device=/dev/lcd0 # display dimensions Size=16x2 # Character map to to map ISO-8859-1 to the displays character set. # [default: none; legal: none, hd44780_euro, upd16314, hd44780_koi8_r, # hd44780_cp1251, hd44780_8859_5 ] (upd16314, hd44780_koi8_r, # hd44780_cp1251, hd44780_8859_5 are possible if compiled with additional # charmaps) CharMap=hd44780_euro ## Soundgraph iMON LCD ## [imonlcd] # Specify which iMon protocol should be used # [legal: 0, 1; default: 0] # Choose 0 for 15c2:ffdc device, # Choose 1 for 15c2:0038 device Protocol=0 # Set the exit behavior [legal: 0-2; default: 1] # 0 means leave shutdown message, # 1 means show the big clock, # 2 means blank device #OnExit=2 # Select the output device to use [default: /dev/lcd0] Device=/dev/lcd0 # Select the displays contrast [default: 200; legal: 0-1000] Contrast=200 # Specify the size of the display in pixels [default: 96x16] #Size=96x16 # Set the backlight state [default: on; legal: on, off] #Backlight=on # Set the disc mode [legal: 0,1; default: 0] # 0 => spin the "slim" disc - two disc segments, # 1 => their complement spinning; #DiscMode=0 ## IrMan driver ## [IrMan] # in case of trouble with IrMan, try the Lirc emulator for IrMan # Select the input device to use #Device=/dev/irman # Select the configuration file to use #Config=/etc/irman.cfg ## IRtrans driver ## [irtrans] # Does the device have a backlight? [default: no; legal: yes, no] #Backlight=no # IRTrans device to connect to [default: localhost] #Hostname=localhost # display dimensions Size=16x2 ## Joystick driver ## [joy] # Select the input device to use [default: /dev/js0] Device=/dev/js0 # set the axis map Map_Axis1neg=Left Map_Axis1pos=Right Map_Axis2neg=Up Map_Axis2pos=Down # set the button map Map_Button1=Enter Map_Button2=Escape ## LB216 driver ## [lb216] # Select the output device to use [default: /dev/lcd] Device=/dev/lcd # Set the initial brightness [default: 255; legal: 0 - 255] Brightness=255 # Set the communication speed [default: 9600; legal: 2400, 9600] Speed=9600 # Reinitialize the LCD's BIOS [default: no; legal: yes, no] Reboot=no ## LCDM001 driver ## [lcdm001] Device=/dev/ttyS1 # keypad settings # Keyname Function # Normal context Menu context # ------- -------------- ------------ # PauseKey Pause/Continue Enter/select # BackKey Back(Go to previous screen) Up/Left # ForwardKey Forward(Go to next screen) Down/Right # MainMenuKey Open main menu Exit/Cancel PauseKey=LeftKey BackKey=UpKey ForwardKey=DownKey MainMenuKey=RightKey # You can rearrange the settings here. # If your device is broken, have a look at server/drivers/lcdm001.h ## HNE LCTerm driver ## [lcterm] Device=/dev/ttyS1 Size=16x2 ## LIRC input driver ## [lirc] # Specify an alternative location of the lircrc file [default: ~/.lircrc] #lircrc=/etc/lircrc.lcdproc # Must be the same as in your lircrc #prog=lcdd ## LIS MCE 2005 driver ## [lis] # Set the initial brightness [default: 1000; legal: 0 - 1000] # 0-250 = 25%, 251-500 = 50%, 501-750 = 75%, 751-1000 = 100% #Brightness=1000 # Columns by lines [default: 20x2] #Size=20x2 # USB Vendor ID [default: 0x0403] # Change only if testing a compatible device. #VendorID=0x0403 # USB Product ID [default: 0x6001] # Change only if testing a compatible device. #ProductID=0x6001 # Specifies if the last line is pixel addressable (yes) or it only controls an # underline effect (no). [default: yes; legal: yes, no] #Lastline=yes ##The driver for the VFD of the Medion MD8800 PC ## [MD8800] # device to use [default: /dev/ttyS1] #Device=/dev/ttyS1 # display size [default: 16x2] #Size=16x2 # Set the initial brightness [default: 1000; legal: 0 - 1000] Brightness=1000 # Set the initial off-brightness [default: 0; legal: 0 - 1000] # This value is used when the display is normally # switched off in case LCDd is inactive OffBrightness=50 ## Futuba MDM166A Display [mdm166a] # Show self-running clock after LCDd shutdown # Possible values: [default: no; legal: no, small, big] Clock=big # Dim display, no dimming gives full brightness [default: no, legal: yes, no] Dimming=no # Dim display in case LCDd is inactive [default: no, legal: yes, no] OffDimming=yes ## MSI MS-6931 driver for displays in 1HU servers ## [ms6931] # device to use [default: /dev/ttyS1] Device=/dev/ttyS1 # display size [default: 16x2] #Size=16x2 ## MTC-S16209x driver ## [mtc_s16209x] # Select the output device to use [default: /dev/lcd] Device=/dev/lcd # Set the initial brightness [default: 255; legal: 0 - 255] Brightness=255 # Reinitialize the LCD's BIOS [default: no; legal: yes, no] Reboot=no ## Matrix Orbital driver ## [MtxOrb] # Select the output device to use [default: /dev/lcd] Device=/dev/ttyS0 # Set the display size [default: 20x4] Size=20x4 # Set the display type [default: lcd; legal: lcd, lkd, vfd, vkd] Type=lkd # Set the initial contrast [default: 480] # NOTE: The driver will ignore this if the display # is a vfd or vkd as they don't have this feature Contrast=480 # Some old displays do not have an adjustable backlight but only can # switch the backlight on/off. If you experience randomly appearing block # characters, try setting this to false. [default: yes; legal: yes, no] hasAdjustableBacklight=no # Set the initial brightness [default: 1000; legal: 0 - 1000] Brightness=1000 # Set the initial off-brightness [default: 0; legal: 0 - 1000] # This value is used when the display is normally # switched off in case LCDd is inactive OffBrightness=0 # Set the communication speed [default: 19200; legal: 1200, 2400, 9600, 19200] Speed=19200 # The following table translates from MtxOrb key letters to logical key names. # By default no keys are mapped, meaning the keypad is not used at all. #KeyMap_A=Left #KeyMap_B=Right #KeyMap_C=Up #KeyMap_D=Down #KeyMap_E=Enter #KeyMap_F=Escape # See the [menu] section for an explanation of the key mappings # You can find out which key of your display sends which # character by setting keypad_test_mode to yes and running # LCDd. LCDd will output all characters it receives. # Afterwards you can modify the settings above and set # keypad_set_mode to no again. keypad_test_mode=no ## mx5000 driver for LCD display on the Logitech MX5000 keyboard ## [mx5000] # Select the output device to use [default: /dev/hiddev0] Device = /dev/hiddev0 # Time to wait in ms after the refresh screen has been sent [default: 1000] WaitAfterRefresh = 1000 ## Noritake VFD driver ## [NoritakeVFD] # device where the VFD is. Usual values are /dev/ttyS0 and /dev/ttyS1 # [default: /dev/lcd] Device=/dev/ttyS0 # Specifies the size of the LCD. Size=20x4 # Set the initial brightness [default: 1000; legal: 0 - 1000] Brightness=1000 # Set the initial off-brightness [default: 0; legal: 0 - 1000] # This value is used when the display is normally # switched off in case LCDd is inactive OffBrightness=50 # set the serial port speed [default: 9600, legal: 1200, 2400, 9600, 19200, 115200] Speed=9600 # Set serial data parity [default: 0; legal: 0-2 ] # Meaning: 0(=none), 1(=odd), 2(=even) Parity=0 # re-initialize the VFD [default: no; legal: yes, no] Reboot=no ## Mini-box.com picoLCD (usblcd) driver ## [picolcd] # KeyTimeout is only used if the picoLCD driver is built with libusb-0.1. When # built with libusb-1.0 key and IR data is input asynchronously so there is no # need to wait for the USB data. # KeyTimeout is the time in ms that LCDd spends waiting for a key press before # cycling through other duties. Higher values make LCDd use less CPU time and # make key presses more detectable. Lower values make LCDd more responsive # but a little prone to missing key presses. 500 (.5 second) is the default # and a balanced value. [default: 500; legal: 0 - 1000] KeyTimeout=500 # Key auto repeat is only available if the picoLCD driver is built with # libusb-1.0. Use KeyRepeatDelay and KeyRepeatInterval to configure key auto # repeat. # # Key auto repeat delay (time in ms from first key report to first repeat). Use # zero to disable auto repeat. [default: 300; legal: 0 - 3000] KeyRepeatDelay=300 # Key auto repeat interval (time in ms between repeat reports). Only used if # KeyRepeatDelay is not zero. [default: 200; legal: 0 - 3000] KeyRepeatInterval=200 # Sets the initial state of the backlight upon start-up. # [default: on; legal: on, off] #Backlight=on # Set the initial brightness [default: 1000; legal: 0 - 1000]. Works only # with the 20x4 device Brightness=1000 # Set the brightness while the backlight is 'off' [default: 0; legal: 0 - 1000]. # Works only with the 20x4 device. #OffBrightness=0 # Set the initial contrast [default: 1000; legal: 0 - 1000] Contrast=1000 # Link the key lights to the backlight? [default: on; legal: on, off] #LinkLights=off # Light the keys? [default: on; legal: on, off] Keylights=on # If Keylights is on, the you can unlight specific keys below: # Key0 is the directional pad. Key1 - Key5 correspond to the F1 - F5 keys. # There is no LED for the +/- keys. This is a handy way to indicate to users # which keys are disabled. [default: on; legal: on, off] Key0Light=on Key1Light=on Key2Light=on Key3Light=on Key4Light=on Key5Light=on # Host name or IP address of the LIRC instance that is to receive IR codes # If not set, or set to an empty value, IR support is disabled. #LircHost=127.0.0.1 # UDP port on which LIRC is listening [default: 8765; legal: 1 - 65535] LircPort=8765 # UDP data time unit for LIRC [default: off; legal: on, off] # On: times sent in microseconds (requires LIRC UDP driver that accepts this). # Off: times sent in 'jiffies' (1/16384s) (supported by standard LIRC UDP driver). LircTime_us=on # Threshold in microseconds of the gap that triggers flushing the IR data # to lirc [default: 8000; legal: 1000 - ] # If LircTime_us is on values greater than 32.767ms will disable the flush # If LircTime_us is off values greater than 1.999938s will disable the flush LircFlushThreshold=10000 ## Pyramid LCD driver ## [pyramid] # device to connect to [default: /dev/lcd] Device=/dev/ttyUSB0 ## rawserial driver ## [rawserial] # Select the output device to use [default: /dev/cuaU0] Device=/dev/ttyS0 # Serial port baudrate [default: 9600] Speed=9600 # Specifies the size of the LCD. If this driver is loaded as a secondary driver # it always adopts to the size of the primary driver. If loaded as the only # (or primary) driver, the size can be set. [default: 40x4] #Size=16x2 # How often to dump the LCD contents out the port, in Hertz (times per second) # 1 = once per second, 4 is 4 times per second, 0.1 is once every 10 seconds. # [default: 1; legal: 0.0005 - 10] UpdateRate=1 ## SDEC driver for Watchguard Firebox ## [sdeclcd] # No options ## Seiko Epson 1330 driver ## [sed1330] # Port where the LPT is. Common values are 0x278, 0x378 and 0x3BC Port=0x378 # Type of LCD module (legal: G321D, G121C, G242C, G191D, G2446, SP14Q002) # Note: Currently only tested with G321D & SP14Q002. Type=G321D # Width x Height of a character cell in pixels [legal: 6x7 - 8x16; default: 6x10] CellSize=6x10 # Select what type of connection [legal: classic, bitshaker; default: classic] ConnectionType=classic ## Seiko Epson 1520 driver ## [sed1520] # Port where the LPT is. Usual values are 0x278, 0x378 and 0x3BC Port=0x378 # Select the interface type (wiring) for the display. Supported values are # 68 for 68-style connection (RESET level high) and 80 for 80-style connection # (RESET level low). [legal: 68, 80; default: 80] InterfaceType=80 # On fast machines it may be necessary to slow down transfer to the display. # If this value is set to zero, delay is disabled. Any value greater than # zero slows down each write by one microsecond. [legal: 0-1000; default: 1] DelayMult=0 # The original wiring used an inverter to drive the control lines. If you do # not use an inverter set haveInverter to no. [default: yes; legal: yes, no] HaveInverter=no # On some displays column data in memory is mapped to segment lines from right # to left. This is called inverted mapping (not to be confused with # 'haveInverter' from above). [default: no; legal: yes, no] #InvertedMapping=yes # At least one display is reported (Everbouquet MG1203D) that requires sending # three times 0xFF before a reset during initialization. # [default: no; legal: yes, no] #UseHardReset=yes ## serial POS display driver ## [serialPOS] # Device to use in serial mode [default: /dev/lcd] Device=/dev/lcd # Specifies the size of the display in characters. [default: 16x2] Size=16x2 # Set the communication protocol to use with the POS display. # [default: AEDEX; legal: IEE, Epson, Emax, IBM, LogicControls, Ultimate] Type=AEDEX # communication baud rate with the display [default: 9600; legal: 1200, 2400, # 19200, 115200] Speed=9600 ## Serial VFD driver ## ## Drives various (see below) serial 5x7dot VFD's. ## [serialVFD] # Specifies the displaytype.[default: 0] # 0 NEC (FIPC8367 based) VFDs. # 1 KD Rev 2.1. # 2 Noritake VFDs (*). # 3 Futaba VFDs # 4 IEE S03601-95B # 5 IEE S03601-96-080 (*) # 6 Futaba NA202SD08FA (allmost IEE compatible) # 7 Samsung 20S207DA4 and 20S207DA6 # 8 Nixdorf BA6x / VT100 # (* most should work, not tested yet.) Type=0 # "no" if display connected serial, "yes" if connected parallel. [default: no] # I.e. serial by default use_parallel=no # Number of Custom-Characters. default is display type dependent #Custom-Characters=0 # Portaddress where the LPT is. Used in parallel mode only. Usual values are # 0x278, 0x378 and 0x3BC. Port=0x378 # Set parallel port timing delay (us). Used in parallel mode only. # [default: 2; legal: 0 - 255] #PortWait=2 # Device to use in serial mode. Usual values are /dev/ttyS0 and /dev/ttyS1 Device=/dev/ttyS1 # Specifies the size of the VFD. Size=20x2 # Set the initial brightness [default: 1000; legal: 0 - 1000] # (4 steps 0-250, 251-500, 501-750, 751-1000) Brightness=1000 # Set the initial off-brightness [default: 0; legal: 0 - 1000] # This value is used when the display is normally # switched off in case LCDd is inactive # (4 steps 0-250, 251-500, 501-750, 751-1000) OffBrightness=0 # set the serial port speed [default: 9600; legal: 1200, 2400, 9600, 19200, 115200] Speed=9600 # enable ISO 8859 1 compatibility [default: yes; legal: yes, no] #ISO_8859_1=yes ## shuttleVFD driver ## [shuttleVFD] # No options ## stv5730 driver ## [stv5730] # Port the device is connected to [default: 0x378] Port=0x378 [SureElec] # Port the device is connected to (by default first USB serial port) Device=/dev/ttyUSB0 # Edition level of the device (can be 1, 2 or 3) [default: 2] #Edition=1 # set display size # Note: The size can be obtained directly from device for edition 2 & 3. #Size=16x2 # Set the initial contrast [default: 480; legal: 0 - 1000] #Contrast=200 # Set the initial brightness [default: 480; legal: 1 - 1000] #Brightness=480 # Set the initial off-brightness [default: 100; legal: 1 - 1000] # This value is used when the display is normally # switched off in case LCDd is inactive #OffBrightness=100 ## SVGAlib driver ## [svga] # svgalib mode to use [default: G320x240x256 ] # legal values are supported svgalib modes #Mode=G640x480x256 # set display size [default: 20x4] Size=20x4 # Set the initial contrast [default: 500; legal: 0 - 1000] # Can be set but does not change anything internally Contrast=500 # Set the initial brightness [default: 1000; legal: 1 - 1000] Brightness=1000 # Set the initial off-brightness [default: 500; legal: 1 - 1000] # This value is used when the display is normally # switched off in case LCDd is inactive OffBrightness=500 ## Text driver ## [text] # Set the display size [default: 20x4] Size=20x4 ## Toshiba T6963 driver ## [t6963] # set display size in pixels [default: 128x64] Size=128x64 # port to use [default: 0x378; legal: 0x200 - 0x400] Port=0x378 # 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 # Insert additional delays into reads / writes. [default: no; legal: yes, no] #delayBus=no # Clear graphic memory on start-up. [default: no; legal: yes, no] #ClearGraphic=no ## Tyan Barebones LCD driver (GS10 & GS12 series) ## [tyan] # Select the output device to use [default: /dev/lcd] Device=/dev/lcd # Set the communication speed [default: 9600; legal: 4800, 9600] Speed=9600 # set display size [default: 16x2] Size=16x2 ## ELV ula200 driver ## [ula200] # Select the LCD size [default: 20x4] Size=20x4 # If you have a non standard keypad you can associate any keystrings to keys. # There are 6 input key in the CwLnx hardware that generate characters # from 'A' to 'F'. # # The following it the built-in default mapping hardcoded in the driver. # You can leave those unchanged if you have a standard keypad. # You can change it if you want to report other keystrings or have a non # standard keypad. # KeyMap_A=Up # KeyMap_B=Down # KeyMap_C=Left # KeyMap_D=Right # KeyMap_E=Enter # KeyMap_F=Escape ## Wirz SLI LCD driver ## [sli] # Select the output device to use [default: /dev/lcd] Device=/dev/lcd # Set the communication speed [default: 19200; legal: 1200, 2400, 9600, 19200, # 38400, 57600, 115200] Speed=19200 ## vlsys_m428 for VFD/IR combination in Moneual MonCaso 320 ## [vlsys_m428] # Select the output device to use [default: /dev/ttyUSB0] #Device=/dev/ttyUSB0 ## OnScreen Display using libxosd ## [xosd] # set display size [default: 20x4] Size=20x4 # Offset in pixels from the top-left corner of the monitor [default: 0x0] Offset=200x200 # X font to use, in XLFD format, as given by "xfontsel" Font=-*-terminus-*-r-*-*-*-320-*-*-*-*-* # EOF lcdproc-0.5.7/CREDITS000644 001751 000000 00000015404 11621737632 015006 0ustar00mmdolzewheel000000 000000 This is the CREDITS file that should list all people that are or have been involved in LCDproc. Please help us keeping this file up to date. Developers, please insert your name and a short description of your activities. Other people involved, please tell us if your name is missing or your credit information is incorrect. LCDproc is a community effort, and as such we'd like to recognize everyone's efforts! CONTRIBUTORS (in order of appearance :) William Ferrell (Choadstre) : - Project founder, wrote 1st version, much documentation, design for V0.4, continued maintenance It's Choadstre's fault that LCDproc exists. He wanted his computer to have a heartbeat, like some HP workstations do. So he found a nice LCD, wrote some amazingly spiffy software for it, and life was good. Selene Scriven (ToyKeeper) : - wrote V0.3 and most of V0.4, and helped procrastinate the rest of the time... ToyKeeper was the main programmer for LCDproc 0.2 - 0.4-pre9. She took Choadstre's idea and put it in its current form. Gareth Watts (Xeno42): - Patches, mailing list, ideas, web hosting, CVS, etc. Matrix Orbital Corporation : - Free displays for us developers, and lots of help early on Crystalfontz America, Inc. : - Sends us testing LCDs to get LCDproc going on all their models Lorand Bruhacs : - Lorand made LCDproc V0.3.5, which added lots of nifty stuff while keeping the old program model Benjamin Tse , Matthias Prinke : - HD44780 driver and predecessors Richard Rognlie : - Work on HD44780 driver - GIF driver (lost code) Tom Wheeley: - IRMan input driver Bjoern Andersson: - Autoconf/automake build system - Curses driver Andrew McMeikan : - HD44780 driver David Glaude: - Lirc driver(not the current version) - IRMAN driver, - lcdproc big clocK screen. - Matrix Orbital enhancement: Big Number, general-purpose output, dynamic custom char allocation, i2c support(lost), ... - Crystal Fontz drivers - Matrix orbital GLK driver Todd Porter: - Windows 95/98 and NT version Jason Dale Woodward: - widget scrolling Ethan Dicks: - PIC-an-LCD original driver (later merged into HD44780 driver) - fixes & tests to the MtxOrb driver and some clients - lcdident.pl client Michael Reinelt: - SED1520 (copied work of him) Simon Harrison: - SVGAlib driver Horizon Technologies: - WIRZ-SLI driver Charles Steinkuehler: - Work on HD44780 timing code Harald Klein: - Lirc driver (initial version of the current code) - Metar Client Philip Pokorny: - Crystal Fontz driver - Matrix Orbital driver - Matrix Orbital GLK driver - Curses driver Glen Gray: - ? David Douthitt: - Crystal Fontz driver - Matrix Orbital driver - Matrix Orbital GLK driver - Curses driver Eddie Sheldrake: - Crystal Fontz driver Rene Wagner: - LCDM001 driver - ASCII emulation of BigNum - CFontz v2.0 patches merging, - LIRC driver updates (new API, merged David's code) - Lots of driver updates for 0.4.3 (configfile, reporting): - CFontz, curses, glk, MtxOrb, - EPM list file for automatic package generation, - current documentation in docbook format - 0.4.3 backlight and heartbeat implementation - Lots of other stuff for the 0.4.3 release Andre Breiler: - Matrix Orbital driver Joris Robijn: - HD44780 driver maintenance and enhancement - Config file stuff - Reporting stuff - Work on API 0.5 architecture and implementation, loadable drivers. - Menu stuff of 0.5 - SED1330 driver Guillaume Filion: - Portability bug fixes on the curses, HD44780, SED1520 and STV5730 drivers. - Partially implemented Thomas Runge's BSD port of lcdproc. - Ported the parallel functions in port.h to BSD. - Autoconf/automake stuff. - Various small 0.4.3 changes. Chris Debenham: - Matrix Orbital GLK driver - LB216 driver Mark Haemmerling: - HD44780 character conversion table Robin Adams: - SED1520 driver - STV5730 driver Manuel Stahl: - T6963 driver Mike Patnode: - Crystal Fontz - Various 0.4.3 changes Peter Marschall: - new drivers: IOWarrior, xosdlib - bwctusb connectiontype for the HD44780 driver - extensions to CFontz* drivers: support CF631 & CF635 - various fixes in preparation of 0.5 - lcd2usb connectiontype for the HD44780 driver Markus Dolze (current maintainer): - various fixes (especially for *BSD) - merged and extended network interface statistics to lcdproc client - new LCDd network input buffering Volker Boerchers: - fixes and extensions to the menu system Lucian Muresan: - glcdlib meta driver Matteo Pillon: - lcdserializer connectiontype to the hd44780 driver - various improvements to the serial connections of the hd44780 driver Laurent Arnal: - connectiontype for LIS2 displays from VLSystem (http://www.vlsys.co.kr) Simon Funke: - driver for Noritake VFD Matthias Goebl : - I2C connectiontype for the HD44780 driver Stefan Herdler: - serialVFD driver - bignum library Bernhard Walle: - driver for the ULA-200 device from ELV (http://www.elv.de) Andrew Foss: - menu support for lcdproc client Anthony J. Mirabella: - Logitech g15 driver Cedric Tessier: - EyeBoxOne driver John Sanders: - iMon driver graphics support Eric Pooch: - Mac OS X / Darwin support - serialPOS driver - uss720 connection type for hd44780 driver - driver for SoundGraph iMON OEM LCD Modules Benjamin Wiedmann - Added functionality for HITACHI SP14Q002 gLCD (320x240) - Implemented dynamic wiring scheme selection for SED1330 driver ("ConnectionType") Frank Jepsen - vdr-wakeup support in hd44780 driver (originally for v0.4.5) - new options for the hd44780 driver Karsten Festag - ea65 driver Gatewood Green - picolcd driver Dave Platt - overhauled CwLnx driver Nicu Pavel - overhauled & extended picolcd driver Daryl Fonseca-Holt - lis driver Thien Vu - shuttleVFD driver Thomas Jarosch - support reporting in hd44780's ConnectionType functions - build-system clean up: use pkg-config for some libs - HD44780 connection type for a USB connection via a FTDI FT2232D chip - i2500vfd driver Christian Jodar - mx5000 driver Mariusz Bialonczyk - ethlcd connection type for HD44780 Jack Cleaver - LIRC support in picolcd Phant0m / Aron Parsons -IRtrans driver Malte Poeggel - support for ST7036 controller in hd44780 Dean Harding, Christian Leuschen, Jonathan Kyler: - driver for SoundGraph iMON OEM LCD Modules Laurent Latil - SureElec driver for devices made by SURE Electronics Christoph Rasim - MDM166A driver for Futaba/Targa USB VFD Further developers in the sourceforge lcdproc team: Colin Munro colinmunro Shane Spencer hardwire Jim McCracken merlin_jim Luis Llorente luisllo lcdproc-0.5.7/contrib/000755 001751 000000 00000000000 12330423234 015406 5ustar00mmdolzewheel000000 000000 lcdproc-0.5.7/shared/000755 001751 000000 00000000000 12330423234 015214 5ustar00mmdolzewheel000000 000000 lcdproc-0.5.7/depcomp000555 001751 000000 00000056016 12330423206 015330 0ustar00mmdolzewheel000000 000000 #! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: lcdproc-0.5.7/clients/000755 001751 000000 00000000000 12330423234 015407 5ustar00mmdolzewheel000000 000000 lcdproc-0.5.7/server/000755 001751 000000 00000000000 12330423234 015254 5ustar00mmdolzewheel000000 000000 lcdproc-0.5.7/docs/000755 001751 000000 00000000000 12330423234 014676 5ustar00mmdolzewheel000000 000000 lcdproc-0.5.7/scripts/000755 001751 000000 00000000000 12330423234 015435 5ustar00mmdolzewheel000000 000000 lcdproc-0.5.7/scripts/Makefile.am000644 001751 000000 00000000701 10610214160 017462 0ustar00mmdolzewheel000000 000000 ## Process this file with automake to produce Makefile.in EXTRA_DIST = README \ init-LCDd.LSB.in \ init-lcdproc.LSB.in \ init-lcdexec.LSB.in \ init-lcdvc.LSB.in \ init-LCDd.debian.in \ init-lcdproc.debian.in \ init-lcdexec.debian.in \ init-lcdvc.debian.in \ init-LCDd.rpm.in \ init-lcdproc.rpm.in debian dist-hook: rm -rf `find $(distdir)/debian -name CVS` ## EOF lcdproc-0.5.7/scripts/init-LCDd.LSB.in000644 001751 000000 00000002533 11204452542 020121 0ustar00mmdolzewheel000000 000000 #! /bin/sh ### BEGIN INIT INFO # Provides: LCDd # Required-Start: $syslog $local_fs $network $remote_fs # Required-Stop: $syslog $local_fs $network $remote_fs # Should-Start: udev # Default-Start: 2 3 4 5 # Default-Stop: S 0 1 6 # Short-Description: LCDproc Server Daemon # Description: LSB init script for LCDd, the display # server daemon in the LCDproc suite ### END INIT INFO # local variables prefix=@prefix@ exec_prefix=@exec_prefix@ bindir=@bindir@ sbindir=@sbindir@ etc=@sysconfdir@ PATH=/sbin:/bin:/usr/sbin:/usr/bin NAME=LCDd DAEMON=${sbindir}/$NAME DESC="LCDproc display server daemon" DEFAULTS=/etc/default/$NAME START=yes # Source defaults file; edit that file to configure this script. if [ -e "${DEFAULTS}" ]; then . "${DEFAULTS}" fi # If we're not to start the daemon, simply exit if [ "${START}" != "yes" ]; then exit 0 fi # installation check test -x $DAEMON || exit 5 # load LSB 3.x init functions . /lib/lsb/init-functions case "$1" in start) log_daemon_msg "Starting $DESC" "$NAME" start_daemon $DAEMON $OPTIONS log_end_msg $? ;; stop) log_daemon_msg "Stopping $DESC" "$NAME" killproc $DAEMON log_end_msg $? ;; restart|reload|force-reload) $0 stop sleep 1 $0 start ;; *) echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2 exit 2 ;; esac exit 0 lcdproc-0.5.7/scripts/init-lcdproc.LSB.in000644 001751 000000 00000002601 11204452542 020775 0ustar00mmdolzewheel000000 000000 #! /bin/sh ### BEGIN INIT INFO # Provides: lcdproc # Required-Start: $syslog $local_fs $network $remote_fs # Required-Stop: $syslog $local_fs $network $remote_fs # Should-Start: LCDd # Default-Start: 2 3 4 5 # Default-Stop: S 0 1 6 # Short-Description: LCDproc system status information viewer # Description: LSB init script for lcdproc, the system # status information viewer in the LCDproc suite ### END INIT INFO # local variables prefix=@prefix@ exec_prefix=@exec_prefix@ bindir=@bindir@ sbindir=@sbindir@ etc=@sysconfdir@ PATH=/sbin:/bin:/usr/sbin:/usr/bin NAME=lcdproc DAEMON=${bindir}/$NAME DESC="LCDproc system status monitor" DEFAULTS=/etc/default/$NAME START=yes # Source defaults file; edit that file to configure this script. if [ -e "${DEFAULTS}" ]; then . "${DEFAULTS}" fi # If we're not to start the daemon, simply exit if [ "${START}" != "yes" ]; then exit 0 fi # installation check test -x $DAEMON || exit 5 # load LSB 3.x init functions . /lib/lsb/init-functions case "$1" in start) log_daemon_msg "Starting $DESC" "$NAME" start_daemon $DAEMON $OPTIONS log_end_msg $? ;; stop) log_daemon_msg "Stopping $DESC" "$NAME" killproc $DAEMON log_end_msg $? ;; restart|reload|force-reload) $0 stop sleep 1 $0 start ;; *) echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2 exit 2 ;; esac exit 0 lcdproc-0.5.7/scripts/init-lcdexec.LSB.in000644 001751 000000 00000002607 11204452542 020764 0ustar00mmdolzewheel000000 000000 #! /bin/sh ### BEGIN INIT INFO # Provides: lcdexec # Required-Start: $syslog $local_fs $network $remote_fs # Required-Stop: $syslog $local_fs $network $remote_fs # Should-Start: LCDd # Default-Start: 2 3 4 5 # Default-Stop: S 0 1 6 # Short-Description: LCDproc program starter from the LCDd menu # Description: LSB init script for lcdexec, the client to # start programs from the LCDd menu in the LCDproc suite ### END INIT INFO # local variables prefix=@prefix@ exec_prefix=@exec_prefix@ bindir=@bindir@ sbindir=@sbindir@ etc=@sysconfdir@ PATH=/sbin:/bin:/usr/sbin:/usr/bin NAME=lcdexec DAEMON=${bindir}/$NAME DESC="LCDproc program starter" DEFAULTS=/etc/default/$NAME START=no # Source defaults file; edit that file to configure this script. if [ -e "${DEFAULTS}" ]; then . "${DEFAULTS}" fi # If we're not to start the daemon, simply exit if [ "${START}" != "yes" ]; then exit 0 fi # installation check test -x $DAEMON || exit 5 # load LSB 3.x init functions . /lib/lsb/init-functions case "$1" in start) log_daemon_msg "Starting $DESC" "$NAME" start_daemon $DAEMON $OPTIONS log_end_msg $? ;; stop) log_daemon_msg "Stopping $DESC" "$NAME" killproc $DAEMON log_end_msg $? ;; restart|reload|force-reload) $0 stop sleep 1 $0 start ;; *) echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2 exit 2 ;; esac exit 0 lcdproc-0.5.7/scripts/init-lcdvc.LSB.in000644 001751 000000 00000002531 11204452542 020444 0ustar00mmdolzewheel000000 000000 #! /bin/sh ### BEGIN INIT INFO # Provides: lcdvc # Required-Start: $syslog $local_fs $network $remote_fs # Required-Stop: $syslog $local_fs $network $remote_fs # Should-Start: LCDd # Default-Start: 2 3 4 5 # Default-Stop: S 0 1 6 # Short-Description: LCDproc virtual console # Description: LSB init script for lcdvc, the virtual # console client in the LCDproc suite ### END INIT INFO # local variables prefix=@prefix@ exec_prefix=@exec_prefix@ bindir=@bindir@ sbindir=@sbindir@ etc=@sysconfdir@ PATH=/sbin:/bin:/usr/sbin:/usr/bin NAME=lcdvc DAEMON=${bindir}/$NAME DESC="LCDproc virtual console" DEFAULTS=/etc/default/$NAME START=no # Source defaults file; edit that file to configure this script. if [ -e "${DEFAULTS}" ]; then . "${DEFAULTS}" fi # If we're not to start the daemon, simply exit if [ "${START}" != "yes" ]; then exit 0 fi # installation check test -x $DAEMON || exit 5 # load LSB 3.x init functions . /lib/lsb/init-functions case "$1" in start) log_daemon_msg "Starting $DESC" "$NAME" start_daemon $DAEMON $OPTIONS log_end_msg $? ;; stop) log_daemon_msg "Stopping $DESC" "$NAME" killproc $DAEMON log_end_msg $? ;; restart|reload|force-reload) $0 stop sleep 1 $0 start ;; *) echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2 exit 2 ;; esac exit 0 lcdproc-0.5.7/scripts/init-LCDd.debian.in000644 001751 000000 00000002071 11204452542 020720 0ustar00mmdolzewheel000000 000000 #!/bin/sh -e ### BEGIN INIT INFO # Provides: LCDd # Required-Start: $syslog $local_fs $network $remote_fs # Required-Stop: $syslog $local_fs $network $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: S 0 1 6 # Short-Description: LCDproc Server Daemon # Description: Debian init script for LCDd, the display # server daemon in the LCDproc suite ### END INIT INFO # local variables prefix=@prefix@ exec_prefix=@exec_prefix@ bindir=@bindir@ sbindir=@sbindir@ etc=@sysconfdir@ NAME=LCDd DAEMON=${sbindir}/${NAME} DESC="LCDproc display server daemon" OPTIONS="" # installation check test -x ${DAEMON} || exit 0 case "$1" in start) printf "Starting ${DESC}: " start-stop-daemon --start --quiet --exec ${DAEMON} -- ${OPTIONS} printf "${NAME}.\n" ;; stop) printf "Stopping ${DESC}: " start-stop-daemon --stop --oknodo --quiet --exec ${DAEMON} printf "${NAME}.\n" ;; restart|force-reload) $0 stop sleep 1 $0 start ;; *) printf "Usage: $0 {start|stop|restart|force-reload}\n" >&2 exit 1 ;; esac exit 0 lcdproc-0.5.7/scripts/init-lcdproc.debian.in000644 001751 000000 00000002137 11204452542 021603 0ustar00mmdolzewheel000000 000000 #!/bin/sh -e ### BEGIN INIT INFO # Provides: lcdproc # Required-Start: $syslog $local_fs $network $remote_fs # Required-Stop: $syslog $local_fs $network $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: S 0 1 6 # Short-Description: LCDproc system status information viewer # Description: Debian init script for lcdproc, the system # status information viewer in the LCDproc suite ### END INIT INFO # local variables prefix=@prefix@ exec_prefix=@exec_prefix@ bindir=@bindir@ sbindir=@sbindir@ etc=@sysconfdir@ NAME=lcdproc DAEMON=${bindir}/${NAME} DESC="LCDproc system status monitor" OPTIONS="" # installation check test -x ${DAEMON} || exit 0 case "$1" in start) printf "Starting ${DESC}: " start-stop-daemon --start --quiet --exec ${DAEMON} -- ${OPTIONS} printf "${NAME}.\n" ;; stop) printf "Stopping ${DESC}: " start-stop-daemon --stop --oknodo --quiet --exec ${DAEMON} printf "${NAME}.\n" ;; restart|force-reload) $0 stop sleep 1 $0 start ;; *) printf "Usage: $0 {start|stop|restart|force-reload}\n" >&2 exit 1 ;; esac exit 0 lcdproc-0.5.7/scripts/init-lcdexec.debian.in000644 001751 000000 00000002142 11204452542 021560 0ustar00mmdolzewheel000000 000000 #!/bin/sh -e ### BEGIN INIT INFO # Provides: lcdexec # Required-Start: $syslog $local_fs $network $remote_fs # Required-Stop: $syslog $local_fs $network $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: S 0 1 6 # Short-Description: LCDproc program starter from the LCDd menu # Description: Debian init script for lcdexec, the client to # start programs from the LCDd menu in the LCDproc suite ### END INIT INFO # local variables prefix=@prefix@ exec_prefix=@exec_prefix@ bindir=@bindir@ sbindir=@sbindir@ etc=@sysconfdir@ NAME=lcdexec DAEMON=${bindir}/${NAME} DESC="LCDproc program starter" OPTIONS="" # installation check test -x ${DAEMON} || exit 0 case "$1" in start) printf "Starting ${DESC}: " start-stop-daemon --start --quiet --exec ${DAEMON} -- ${OPTIONS} printf "${NAME}." ;; stop) printf "Stopping ${DESC}: " start-stop-daemon --stop --oknodo --quiet --exec ${DAEMON} printf "${NAME}." ;; restart|force-reload) $0 stop sleep 1 $0 start ;; *) printf "Usage: $0 {start|stop|restart|force-reload}\n" >&2 exit 1 ;; esac exit 0 lcdproc-0.5.7/scripts/init-lcdvc.debian.in000644 001751 000000 00000002064 11204452542 021247 0ustar00mmdolzewheel000000 000000 #!/bin/sh -e ### BEGIN INIT INFO # Provides: lcdvc # Required-Start: $syslog $local_fs $network $remote_fs # Required-Stop: $syslog $local_fs $network $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: S 0 1 6 # Short-Description: LCDproc virtual console # Description: Debian init script for lcdvc, the virtual # console client in the LCDproc suite ### END INIT INFO # local variables prefix=@prefix@ exec_prefix=@exec_prefix@ bindir=@bindir@ sbindir=@sbindir@ etc=@sysconfdir@ NAME=lcdvc DAEMON=${bindir}/${NAME} DESC="LCDproc virtual console" OPTIONS="" # installation check test -x ${DAEMON} || exit 0 case "$1" in start) printf "Starting ${DESC}: " start-stop-daemon --start --quiet --exec ${DAEMON} -- ${OPTIONS} printf "${NAME}." ;; stop) printf "Stopping ${DESC}: " start-stop-daemon --stop --oknodo --quiet --exec ${DAEMON} printf "${NAME}." ;; restart|force-reload) $0 stop sleep 1 $0 start ;; *) printf "Usage: $0 {start|stop|restart|force-reload}\n" >&2 exit 1 ;; esac exit 0 lcdproc-0.5.7/scripts/init-LCDd.rpm.in000644 001751 000000 00000004240 11717742756 020316 0ustar00mmdolzewheel000000 000000 #!/bin/sh # This is the LCDd init-script for RPM based (RedHat, Mandrake) systems # # Copyright (C) 2001 Rene Wagner # 2001 Guillaume Filion # # This script is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # any later version. # # This script is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this file; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 # # # chkconfig: 345 70 21 # description: LCDd(8) is the LCDproc server used for displaying text and other data to LCDs. \ # Apart from the main client lcdproc(1) there are various clients. \ # See http://lcdproc.omnipotent.net for details. # processname: LCDd # config: @sysconfdir@/LCDd.conf # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. if [ ${NETWORKING} = "no" ]; then exit 0 fi RETVAL=0 prefix=@prefix@ exec_prefix=@exec_prefix@ bindir=@bindir@ sbindir=@sbindir@ etc=@sysconfdir@ LCDd=${sbindir}/LCDd configfile=${etc}/LCDd.conf [ -x ${LCDd} ] || exit 0 start() { echo -n "Starting up LCDd: " daemon ${LCDd} -c ${configfile} RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/LCDd echo } stop() { echo -n "Shutting down LCDd: " killproc LCDd RETVAL=$? [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/LCDd echo } dostatus() { status LCDd RETVAL=$? } restart() { stop start RETVAL=$? } condrestart() { [ -e /var/lock/subsys/LCDd ] && restart || : } # See how we were called. case "$1" in start) start ;; stop) stop ;; status) dostatus ;; restart) restart ;; condrestart) condrestart ;; *) echo "Usage: $0 {start|stop|status|restart|condrestart}" exit 1 esac exit $RETVAL lcdproc-0.5.7/scripts/init-lcdproc.rpm.in000644 001751 000000 00000004303 10511507774 021164 0ustar00mmdolzewheel000000 000000 #!/bin/sh # This is the lcdproc init-script for RPM based (RedHat, Mandrake) systems # # Copyright (C) 2001 Rene Wagner # 2001 Guillaume Filion # # This script is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # any later version. # # This script is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this file; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 # # # chkconfig: 345 71 20 # description: LCDd(8) is the LCDproc server used for displaying text and other data to LCDs. \ # Apart from the main client lcdproc(1) there are various clients. \ # See http://lcdproc.omnipotent.net for details. # processname: lcdproc # pidfile: /var/run/lcdproc.pid # config: /etc/sysconfig/lcdproc # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. if [ ${NETWORKING} = "no" ]; then exit 0 fi RETVAL=0 prefix=@prefix@ exec_prefix=@exec_prefix@ bindir=@bindir@ sbindir=@sbindir@ etc=@sysconfdir@ lcdproc=${bindir}/lcdproc [ -x ${lcdproc} ] || exit 0 start() { echo -n "Starting up lcdproc: " daemon ${lcdproc} $SCREENS RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/lcdproc echo } stop() { echo -n "Shutting down lcdproc: " killproc lcdproc RETVAL=$? [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/lcdproc echo } dostatus() { status lcdproc RETVAL=$? } restart() { stop start RETVAL=$? } condrestart() { [ -e /var/lock/subsys/lcdproc ] && restart || : } # See how we were called. case "$1" in start) start ;; stop) stop ;; status) dostatus ;; restart) restart ;; condrestart) condrestart ;; *) echo "Usage: $0 {start|stop|status|restart|condrestart}" exit 1 esac exit $RETVAL lcdproc-0.5.7/scripts/README000644 001751 000000 00000002003 11204452542 016313 0ustar00mmdolzewheel000000 000000 This directory contains * init-script templates for various system types (These templates are adapted to the confugration parameters passed to configure at configure-run-time.) - init-*.LSB.in templates for systems conforming to LSB (Linux Standard Base) 3.x. Among others the following distributions support LSB 3.x: - SuSE Linux 10.x - SuSE Linux Enterprise Server 10 - SuSE Linux Enterprise Server 9 SP3 - Ubuntu 6.06 - Debian Etch - RedHat Enterprise Linux4 Update2 - init-*.debian.in templates for older Debian systems (or modern Debian systems without the lsb-core package installed) - init-*.rpm init-scripts for RPM based distributions that are not LSB 3.x conforming. Please try the LSB scripts first. - a sub-directory debian/ that contains the infrastructure to create a Debian package for lcdproc. Simply copy the debian/ directory to the top-level source directory, adapt the call in debian/rules to your wishes, call dpkg -rfakeoot -sd and you're done. lcdproc-0.5.7/scripts/debian/000755 001751 000000 00000000000 12330423075 016662 5ustar00mmdolzewheel000000 000000 lcdproc-0.5.7/scripts/debian/watch000644 001751 000000 00000000110 11204452542 017703 0ustar00mmdolzewheel000000 000000 version=3 http://sf.net/lcdproc/lcdproc-([\d\.]+).tar.gz debian uupdate lcdproc-0.5.7/scripts/debian/changelog000644 001751 000000 00000026657 11212746053 020556 0ustar00mmdolzewheel000000 000000 lcdproc (0.5.2+cvs20090607) UNRELEASED; urgency=low * New snapshot from upstream CVS -- Markus Dolze Sun, 07 Jun 2009 11:34:46 +0200 lcdproc (0.5.2+cvs20070501) UNRELEASED; urgency=low * New snapshot from upstream CVS -- Peter Marschall Tue, 1 May 2007 10:45:00 +0200 lcdproc (0.5.2) unstable; urgency=low * New upstream release - updated & extended documentation - various fixes to the server core - init-script templates for LSB 3.x conforming systems - new drivers: + serialPOS: for text based serial Point of Sale displays + ea65: driver for VFD in AOpen XC Cube AV EA65 barebones + picolcd: driver for Mini-box.com USB LCD picoLCD + hd44780/pertelian: connection type for Pertelian X4020 + hd44780/lcd2usb: connection type for Till Harbaum's LCD2USB + hd44780/vdr-wakeup: connection type for Frank Jepsen's vdr-wakeup + sed1330/SP14Q002: connection type for Hitachi SP14Q002 - updated drivers: + iMon: fix cellwidth, add graphics character support + ula200: fix build environment and documentation + g15: compatibility with g15daemon > 1.2 + MtxOrb: flush(), run-time configurable Brightness/OffBrightness + CFontz: run-time configurable Brightness/OffBrightness, custom chars + CwLnx: fixes, big number support + serialVFD: fixes, updates + hd44780: fixes for the serial connection types, new options - updated clients: + lcdproc: - ged rid of more global variables - fix Disk screen - Credit contributors in About screen - support Iface and ProcSize screens for OS X / Darwin - allow switching on/off Load screen using menu + lcdexec: - try harder to find a shell - updated build environment: + allow compiling with LDFLAG "--as-needed" + remove compile-time option to read configuration from LDAP -- Peter Marschall Sat, 27 Apr 2007 13:30:00 +0200 lcdproc (0.5.1) unstable; urgency=low * New upstream release - updated & extended documentation - install server & client config files in $(sysconfdir) - various fixes to the server core - new drivers: + MD8800 driver for LCDs in Medion MD8800 PCs + g15 - driver for LCD in Logitech G15 gaming keyboards + EyeboxOne - driver for the LCD display on the EyeboxOne + new unified serial sub-driver for hd44780 - updated drivers: + CFontz + CFontz633 + CFontzPacket + CwLnx - completely revamped + hd44780 + IOWarrior + joy + MtxOrb - completely revamped + serialVFD + tyan - new clients: + lcdvc - virtual console on LCD - updated clients: + lcdproc - config file support with lots of options - iface screen - netwerk interface information - bigclock screen flexibilized + lcdexec - revamped & documented menu configuration + sample Perl clients -- Peter Marschall Sat, 14 Oct 2006 17:00:00 +0200 lcdproc (0.5.0-1) unstable; urgency=low * new upstream release - better support for operating systems other than Linux: *BSD, Darwin - /etc/default/LCDd to configure /etc/init.d/LCDd - use original man pages - licence problem for CFontz* solved - various fixes - new drivers: + CFontz633: for CrytalFontz CFA633 + CFontzPacket: fro CrystalFontz CFA-633, CFA-631, CFA-635 + glcdlib meta-driver for all LCDs supported by graphlcd-base + icp_a106: for A106 alarm/LCD boards in 19" racks by ICP + imon: for iMON IR/VFD Modules from Silverstone, Uneed, + IOWarrior: for IOWarrior USB controllers + lcterm: for serial LCD terminal from Neumark Elektronik + ms6931: for MSI-6931 displays in 1U rack servers by MSI + mtc_s16209x: for MTC-S16209x by Microtips Technology Inc + NoritakeVFD: for Noritake VFD Device CU20045SCPB-T28A + pyramid: for Pyramid LC-Displays + serialVFD: for NEC FIPC8367 based serial VFDs + tyan: for LCDs in Tyan Barebone GS series + ula200: for the USB board ULA-200 from ELV + xosd: for On Screen Display on X - new HD44780 subdrivers: + bwctusb: for USB-to-LCD converters from BWCT + lcdserializer: for an serial-LCD converter + i2c: to conned LCDs using the I2C bus + lis2: for the LIS2 serial-to-USB converter -- Peter Marschall Sat, 15 Apr 2006 13:00:00 +0200 lcdproc (0.4.5-1) unstable; urgency=high * New upstream release which fixes two buffer overflow / string format vulnerabilities. By the way, yes I know this package is 'native' when it should be 'normal', but I'll fix that with another upload because I want to get this security update done ASAP since upstream indicate it's a serious problem. * Fixed location of example client 'metar.pl'. Closes: #249770 -- Jonathan Oxer Wed, 19 May 2004 21:32:59 +1000 lcdproc (0.4.4-1) unstable; urgency=low * The April Fool's Release. Stable version bump adds some funky new things, including support for USB displays with a couple of new drivers. Also fixes a memory leak, some assorted bugs in render.c, some flickering problems with the CFontz driver. Adds upstream support for the Apple Network Server (ANS) LCD, which: (closes: #236687) -- Jonathan Oxer Thu, 1 Apr 2004 12:30:01 +1000 lcdproc (0.4.3-15) unstable; urgency=low * Applied patch from Gentoo by Bernhard Tittelbach which fixes a memory leak and some of the heartbeat handling (see http://bugs.gentoo.org/attachment.cgi?id=6981&action=view and debian/patches/lcdproc-0.4.3-gentoo.diff) -- Jonathan Oxer Wed, 17 Dec 2003 10:32:30 +1100 lcdproc (0.4.3-14) unstable; urgency=low * New maintainer. (closes: #196676) * Fix for trivial spelling mistayk in long description and added comment about creating custom clients. (closes: #199303) * Rebuilt package to bring it up to date with latest standards version, latest package scripts etc and renamed items such as init script and man pages in a more standard way. * Wrote man pages for all the example clients, but not set them to be installed because they have .pl extensions and dh_installman thinks they're in Polish. So also... * Moved all example clients into /usr/share/doc/lcdproc/examples -- Jonathan Oxer Mon, 8 Dec 2003 16:30:05 +1100 lcdproc (0.4.3-13) unstable; urgency=low * orphaning package see #196676 -- Noel Koethe Sun, 29 Jun 2003 13:03:00 +0200 lcdproc (0.4.3-12) unstable; urgency=high * added missing patch to fix this problem http://online.securityfocus.com/archive/1/56411 * updated Standards-Version * added USB controller patch (closes: Bug#166051) -- Noel Koethe Thu, 9 Jan 2003 12:10:00 +0100 lcdproc (0.4.3-11) unstable; urgency=low * 0.4.3 release version * updated Standards-Version to 3.5.7 * enabled all drivers (closes: Bug#145314) (closes: Bug#141577) -- Noel Koethe Sat, 22 Sep 2002 00:15:00 +0200 lcdproc (0.4.3-10) unstable; urgency=medium * updated code from cvs to get all drivers updated. upstream maintainer asked for this for woody release this version will the 0.4.3 upstream release * small changes in description * added some upstream Docs which are not in the source -- Noel Koethe Tue, 18 Apr 2002 18:05:00 +0200 lcdproc (0.4.3-9) unstable; urgency=low * added .de template translation (closes: Bug#137482) * added URL to description -- Noel Koethe Sun, 24 Mar 2002 23:53:00 +0100 lcdproc (0.4.3-8) unstable; urgency=low * upstream fixed LCDd.8 and lcdproc.1 manpage (closes: Bug#136325) -- Noel Koethe Thu, 7 Mar 2002 11:45:00 +0100 lcdproc (0.4.3-7) unstable; urgency=low * added ru translation of template (closes: Bug#136596) -- Noel Koethe Wed, 6 Mar 2002 12:47:00 +0100 lcdproc (0.4.3-6) unstable; urgency=low * removed --enable-drivers=all configure option because some drivers contains architecture dependent asm code (closes: Bug#136217) -- Noel Koethe Fri, 1 Mar 2002 21:30:00 +0100 lcdproc (0.4.3-5) unstable; urgency=low * small correction in description * added missing libc6-dev to build-deps -- Noel Koethe Wed, 27 Feb 2002 10:32:00 +0100 lcdproc (0.4.3-4) unstable; urgency=low * using the included init script (with small modifications) * using the included LCDd.conf * moved the perl examples to /usr/bin * added debconf note -- Noel Koethe Sun, 24 Feb 2002 17:42:00 +0100 lcdproc (0.4.3-3) unstable; urgency=low * corrected Daemon start -- Noel Koethe Wed, 20 Feb 2002 20:33:00 +0100 lcdproc (0.4.3-2) unstable; urgency=low * updated description * corrected driver option in init.d (closes: Bug#134590) -- Noel Koethe Mon, 18 Feb 2002 18:44:00 +0100 lcdproc (0.4.3-1) unstable; urgency=low * upstream version with security fixes -- Noel Koethe Sun, 27 Jan 2002 20:53:00 +0100 lcdproc (0.4.1-1) unstable; urgency=low * new upstream version from 2001-05-29 (closes: Bug#129858) (closes: Bug#129857) * removed lcdprocconfig and uses now /etc/lcdproc.conf (closes: Bug#87427) * corrected init script (closes: Bug#98004) -- Noel Koethe Fri, 18 Jan 2002 22:32:00 +0100 lcdproc (0.3.4.5-1) unstable; urgency=low * new maintainer (closes: Bug#119089) (closes: Bug#70098) (closes: Bug#105036) (closes: Bug#67742) (closes: Bug#84518) (closes: Bug#87423) -- Noel Koethe Fri, 18 Jan 2002 18:40:00 +0100 lcdproc (0.3.4.5-0.2) unstable; urgency=low * NMU * Remove obsolete gcc option from Makefile. Closes: #105036 -- Randolph Chung Sat, 25 Aug 2001 20:58:19 -0700 lcdproc (0.3.4.5-0.1) unstable; urgency=low * Bugsquash party NMU. * New upstream release. - This should fix a floating point exception on startup (a grave bug, hence this NMU; closes: #70098). That bug report suggests upgrading only to 0.3.4.5 rather than any of the newer releases available, as they introduce new bugs. I'll leave newer releases to the maintainer. * Update URL and GPL pointer in copyright file. * Remove bashism from init script and use start-stop-daemon instead of pidof (closes: #67742). * Updated to policy version 3.1.1 and add build-depends (closes: #84518). * Removed obsolete dh_suidregister call from debian/rules. * lcdprocconfig is undocumented. Add the man page symlink (bug on its way). -- Colin Watson Sat, 24 Feb 2001 16:25:33 +0000 lcdproc (0.3.4-3) unstable; urgency=low * Updated to Standards-Version 3.0.1, FHS. * Added correct dependencies (turns out I plum forgot the Depends: line in the control file) (closes: #44086) -- Brian Bassett Sat, 6 Nov 1999 17:56:29 -0800 lcdproc (0.3.4-2) unstable; urgency=low * Fixed lcdproc dying from floating point exception when trying to display information about an autofs mount on the "D" screen. -- Brian Bassett Sat, 29 Aug 1998 22:32:17 -0700 lcdproc (0.3.4-1) unstable; urgency=low * Initial release. -- Brian Bassett Sun, 19 Jul 1998 11:19:46 -0700 lcdproc-0.5.7/scripts/debian/compat000644 001751 000000 00000000002 10510750112 020051 0ustar00mmdolzewheel000000 000000 5 lcdproc-0.5.7/scripts/debian/control000644 001751 000000 00000002253 11212746053 020271 0ustar00mmdolzewheel000000 000000 Source: lcdproc Section: utils Priority: extra Maintainer: Jose Luis Tallon Build-Depends: debhelper (>= 5.0.0), pkg-config, xmlto, libncurses5-dev, libusb-dev (>= 0.1.8) Uploaders: Jonathan Oxer Homepage: http://www.lcdproc.org/ Standards-Version: 3.8.0 Package: lcdproc Architecture: alpha amd64 arm armel hppa hurd-i386 i386 ia64 kfreebsd-amd64 kfreebsd-i386 m68k mips mipsel powerpc sparc Depends: ${shlibs:Depends}, debconf | debconf-2.0, lsb-base (>= 3.0.10) Description: LCD display driver daemon and clients This is a client/server suite including drivers for all kinds of nifty LCD displays. The server supports several serial devices: Matrix Orbital, Crystal Fontz, Bayrad, LB216, LCDM001 (kernelconcepts.de), Wirz-SLI and PIC-an-LCD; some devices connected to the parallel port: HD44780, STV5730, T6963, SED1520 and SED1330; and also some displays connected via USB: CFontzPacket, CwLnx, IOWarrior and HD44780. . Various clients are available that display things like CPU load, system load, memory usage, uptime, and a lot more. Custom clients can be written using the simple client-server protocol and provided example code. lcdproc-0.5.7/scripts/debian/copyright000644 001751 000000 00000001526 11621737633 020633 0ustar00mmdolzewheel000000 000000 This package was debianized by Brian Bassett on Wed, 3 Jun 1998 22:15:03 -0700 Adopted by Noel Koethe on Fri, 18 Jan 2002 19:03:47 +0100 Adopted by Jonathan Oxer on Mon, 8 Dec 2003 16:30:05 +1100 Adopted by Jose Luis Tallon on Sun, 23 Jul 2006 20:23:48 +0200 It was downloaded from https://sf.net/projects/lcdproc/ Upstream Author: William W. Ferrell and others Copyright: Copyright (c) 1999-2006 William Ferrell Portions (c) by Selene Scriven, Joris Robijn, F5 Networks, Inc., Peter Marschall and others, as specified in the corresponding source modules. LCDproc is released under the terms of the GNU GPL version 2. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL-2. lcdproc-0.5.7/scripts/debian/dirs000644 001751 000000 00000000262 10510750112 017537 0ustar00mmdolzewheel000000 000000 etc etc/init.d etc/default etc/lcdproc usr/bin usr/sbin usr/share/doc/lcdproc/user-guide/ usr/share/doc/lcdproc/examples usr/share/man/man1 usr/share/man/man5 usr/share/man/man8 lcdproc-0.5.7/scripts/debian/docs000644 001751 000000 00000000024 11212746053 017533 0ustar00mmdolzewheel000000 000000 README TODO INSTALL lcdproc-0.5.7/scripts/debian/lcdproc.LCDd.default000644 001751 000000 00000000277 11204452542 022431 0ustar00mmdolzewheel000000 000000 # /etc/default/LCDd -- config file for LCDd startup # shall LCDd be started (yes/no) START=no # config file #CONFIGFILE=/etc/lcdproc/LCDd.conf # options for LCDd startup OPTIONS="" # EOF lcdproc-0.5.7/scripts/debian/lcdproc.LCDd.init000644 001751 000000 00000003474 11204452542 021752 0ustar00mmdolzewheel000000 000000 #! /bin/sh ### BEGIN INIT INFO # Provides: LCDd # Required-Start: $syslog $local_fs $network $remote_fs # Required-Stop: $syslog $local_fs $network $remote_fs # Should-Start: udev # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: LCDproc Server Daemon # Description: Debian init script for LCDd, the display # server daemon in the LCDproc suite ### END INIT INFO # local variables PATH=/sbin:/bin:/usr/sbin:/usr/bin NAME=$(basename $0 | sed -e 's/^[SK][0-9][0-9]//') NAME=${NAME:-LCDd} DAEMON=/usr/sbin/LCDd DESC="LCDproc display server daemon" DEFAULTS=/etc/default/$NAME CONFIGFILE=/etc/lcdproc/$NAME.conf PIDFILE=/var/run/$NAME.pid OPTIONS="" START=yes # Source defaults file; edit that file to configure this script. if [ -e "${DEFAULTS}" ]; then . "${DEFAULTS}" fi # try to get PID file name from config file (not used yet) if [ -f "${CONFIGFILE:=/etc/lcdproc/$NAME.conf}" ]; then PIDFILE=`grep -i '^[:space:]*PidFile[:space:]*=' ${CONFIGFILE} \ | head -n1 \ | cut -d= -f2- \ | sed -e 's,^[:space:]*\(.*\)[:space:]*$,\1,'` OPTIONS="${OPTIONS} -c ${CONFIGFILE}" fi # if necessary set default PID file name (not used yet) PIDFILE=${PIDFILE:-/var/run/$NAME.pid} # If we're not to start the daemon, simply exit if [ "${START}" != "yes" ]; then exit 0 fi # installation check test -x $DAEMON || exit 5 # load LSB 3.x init functions . /lib/lsb/init-functions case "$1" in start) log_daemon_msg "Starting $DESC" "$NAME" start_daemon $DAEMON $OPTIONS log_end_msg $? ;; stop) log_daemon_msg "Stopping $DESC" "$NAME" killproc $DAEMON log_end_msg $? ;; restart|reload|force-reload) $0 stop sleep 1 $0 start ;; *) echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2 exit 2 ;; esac exit 0 lcdproc-0.5.7/scripts/debian/lcdproc.default000644 001751 000000 00000000322 11204452542 021653 0ustar00mmdolzewheel000000 000000 # /etc/default/lcdproc -- config file for lcdproc startup # shall lcdproc be started (yes/no) START=no # config file #CONFIGFILE=/etc/lcdproc/lcdproc.conf # options for lcdproc startup #OPTIONS="C G" # EOF lcdproc-0.5.7/scripts/debian/lcdproc.examples000644 001751 000000 00000000205 10402071104 022033 0ustar00mmdolzewheel000000 000000 clients/examples/fortune.pl clients/examples/iosock.pl clients/metar/lcdmetar.pl clients/examples/tail.pl clients/examples/x11amp.pl lcdproc-0.5.7/scripts/debian/lcdproc.init000644 001751 000000 00000003517 11204452542 021203 0ustar00mmdolzewheel000000 000000 #! /bin/sh ### BEGIN INIT INFO # Provides: lcdproc # Required-Start: $syslog $local_fs $network $remote_fs # Required-Stop: $syslog $local_fs $network $remote_fs # Should-Start: LCDd # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: LCDproc system status information viewer # Description: Debian init script for lcdproc, the system # status information viewer in the LCDproc suite ### END INIT INFO # local variables PATH=/sbin:/bin:/usr/sbin:/usr/bin NAME=$(basename $0 | sed -e 's/^[SK][0-9][0-9]//') NAME=${NAME:-lcdproc} DAEMON=/usr/bin/lcdproc DESC="LCDproc system status monitor" DEFAULTS=/etc/default/$NAME CONFIGFILE=/etc/lcdproc/$NAME.conf PIDFILE=/var/run/$NAME.pid OPTIONS="" START=yes # Source defaults file; edit that file to configure this script. if [ -e "${DEFAULTS}" ]; then . "${DEFAULTS}" fi # try to get PID file name from config file if [ -f "${CONFIGFILE:=/etc/lcdproc/$NAME.conf}" ]; then PIDFILE=`grep -i '^[:space:]*PidFile[:space:]*=' ${CONFIGFILE} \ | head -n1 \ | cut -d= -f2- \ | sed -e 's,^[:space:]*\(.*\)[:space:]*$,\1,'` OPTIONS="${OPTIONS} -c ${CONFIGFILE}" fi # if necessary set default PID file name PIDFILE=${PIDFILE:-/var/run/$NAME.pid} # If we're not to start the daemon, simply exit if [ "${START}" != "yes" ]; then exit 0 fi # installation check test -x $DAEMON || exit 5 # load LSB 3.x init functions . /lib/lsb/init-functions case "$1" in start) log_daemon_msg "Starting $DESC" "$NAME" start_daemon -p $PIDFILE $DAEMON $OPTIONS log_end_msg $? ;; stop) log_daemon_msg "Stopping $DESC" "$NAME" killproc -p $PIDFILE $DAEMON log_end_msg $? ;; restart|reload|force-reload) $0 stop sleep 1 $0 start ;; *) echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2 exit 2 ;; esac exit 0 lcdproc-0.5.7/scripts/debian/lcdproc.lcdexec.default000644 001751 000000 00000000317 11204452542 023265 0ustar00mmdolzewheel000000 000000 # /etc/default/lcdexec -- config file for lcdexec startup # shall lcdexec be started (yes/no) START=no # config file #CONFIGFILE=/etc/lcdproc/lcdexec.conf # options for lcdexec startup #OPTIONS="" # EOF lcdproc-0.5.7/scripts/debian/lcdproc.lcdexec.init000644 001751 000000 00000003527 11204452542 022612 0ustar00mmdolzewheel000000 000000 #! /bin/sh ### BEGIN INIT INFO # Provides: lcdexec # Required-Start: $syslog $local_fs $network $remote_fs # Required-Stop: $syslog $local_fs $network $remote_fs # Should-Start: LCDd # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: LCDproc program starter from the LCDd menu # Description: Debian init script for lcdexec, the client to # start programs from the LCDd menu in the LCDproc suite ### END INIT INFO # local variables PATH=/sbin:/bin:/usr/sbin:/usr/bin NAME=$(basename $0 | sed -e 's/^[SK][0-9][0-9]//') NAME=${NAME:-lcdexec} DAEMON=/usr/bin/lcdexec DESC="LCDproc program starter" DEFAULTS=/etc/default/$NAME CONFIGFILE=/etc/lcdproc/$NAME.conf PIDFILE=/var/run/$NAME.pid OPTIONS="" START=no # Source defaults file; edit that file to configure this script. if [ -e "${DEFAULTS}" ]; then . "${DEFAULTS}" fi # try to get PID file name from config file if [ -f "${CONFIGFILE:=/etc/lcdproc/$NAME.conf}" ]; then PIDFILE=`grep -i '^[:space:]*PidFile[:space:]*=' ${CONFIGFILE} \ | head -n1 \ | cut -d= -f2- \ | sed -e 's,^[:space:]*\(.*\)[:space:]*$,\1,'` OPTIONS="${OPTIONS} -c ${CONFIGFILE}" fi # if necessary set default PID file name PIDFILE=${PIDFILE:-/var/run/$NAME.pid} # If we're not to start the daemon, simply exit if [ "${START}" != "yes" ]; then exit 0 fi # installation check test -x $DAEMON || exit 5 # load LSB 3.x init functions . /lib/lsb/init-functions case "$1" in start) log_daemon_msg "Starting $DESC" "$NAME" start_daemon -p $PIDFILE $DAEMON $OPTIONS log_end_msg $? ;; stop) log_daemon_msg "Stopping $DESC" "$NAME" killproc -p $PIDFILE $DAEMON log_end_msg $? ;; restart|reload|force-reload) $0 stop sleep 1 $0 start ;; *) echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2 exit 2 ;; esac exit 0 lcdproc-0.5.7/scripts/debian/lcdproc.lcdvc.default000644 001751 000000 00000000305 11204452542 022746 0ustar00mmdolzewheel000000 000000 # /etc/default/lcdvc -- config file for lcdvc startup # shall lcdvc be started (yes/no) START=no # config file #CONFIGFILE=/etc/lcdproc/lcdvc.conf # options for lcdvc startup #OPTIONS="" # EOF lcdproc-0.5.7/scripts/debian/lcdproc.lcdvc.init000644 001751 000000 00000003447 11204452542 022277 0ustar00mmdolzewheel000000 000000 #! /bin/sh ### BEGIN INIT INFO # Provides: lcdvc # Required-Start: $syslog $local_fs $network $remote_fs # Required-Stop: $syslog $local_fs $network $remote_fs # Should-Start: LCDd # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: LCDproc virtual console # Description: Debian init script for lcdvc, the virtual # console client in the LCDproc suite ### END INIT INFO # local variables PATH=/sbin:/bin:/usr/sbin:/usr/bin NAME=$(basename $0 | sed -e 's/^[SK][0-9][0-9]//') NAME=${NAME:-lcdvc} DAEMON=/usr/bin/lcdvc DESC="LCDproc virtual console" DEFAULTS=/etc/default/$NAME CONFIGFILE=/etc/lcdproc/$NAME.conf PIDFILE=/var/run/$NAME.pid OPTIONS="" START=no # Source defaults file; edit that file to configure this script. if [ -e "${DEFAULTS}" ]; then . "${DEFAULTS}" fi # try to get PID file name from config file if [ -f "${CONFIGFILE:=/etc/lcdproc/$NAME.conf}" ]; then PIDFILE=`grep -i '^[:space:]*PidFile[:space:]*=' ${CONFIGFILE} \ | head -n1 \ | cut -d= -f2- \ | sed -e 's,^[:space:]*\(.*\)[:space:]*$,\1,'` OPTIONS="${OPTIONS} -c ${CONFIGFILE}" fi # if necessary set default PID file name PIDFILE=${PIDFILE:-/var/run/$NAME.pid} # If we're not to start the daemon, simply exit if [ "${START}" != "yes" ]; then exit 0 fi # installation check test -x $DAEMON || exit 5 # load LSB 3.x init functions . /lib/lsb/init-functions case "$1" in start) log_daemon_msg "Starting $DESC" "$NAME" start_daemon -p $PIDFILE $DAEMON $OPTIONS log_end_msg $? ;; stop) log_daemon_msg "Stopping $DESC" "$NAME" killproc -p $PIDFILE $DAEMON log_end_msg $? ;; restart|reload|force-reload) $0 stop sleep 1 $0 start ;; *) echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2 exit 2 ;; esac exit 0 lcdproc-0.5.7/scripts/debian/postinst000644 001751 000000 00000002361 10511146114 020465 0ustar00mmdolzewheel000000 000000 #! /bin/sh # postinst script for lcdproc # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package # # quoting from the policy: # Any necessary prompting should almost always be confined to the # post-installation script, and should be protected with a conditional # so that unnecessary prompting doesn't happen if a package's # installation fails and the `postinst' is called with `abort-upgrade', # `abort-remove' or `abort-deconfigure'. case "$1" in configure) ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 lcdproc-0.5.7/scripts/debian/postrm000644 001751 000000 00000001574 10511146114 020133 0ustar00mmdolzewheel000000 000000 #! /bin/sh # postrm script for lcdproc # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `remove' # * `purge' # * `upgrade' # * `failed-upgrade' # * `abort-install' # * `abort-install' # * `abort-upgrade' # * `disappear' overwrit>r> # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;; *) echo "postrm called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 lcdproc-0.5.7/scripts/debian/prerm000644 001751 000000 00000001523 10511146114 017726 0ustar00mmdolzewheel000000 000000 #! /bin/sh # prerm script for lcdproc # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `remove' # * `upgrade' # * `failed-upgrade' # * `remove' `in-favour' # * `deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in remove|upgrade|deconfigure) ;; failed-upgrade) ;; *) echo "prerm called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 lcdproc-0.5.7/scripts/debian/rules000755 001751 000000 00000006456 11212746053 017757 0ustar00mmdolzewheel000000 000000 #!/usr/bin/make -f # -*- makefile -*- # Sample debian/rules that uses debhelper. # GNU copyright 1997 to 1999 by Joey Hess. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # These are used for cross-compiling and for saving the configure script # from having to guess our platform (since we know it already) DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) CFLAGS = -Wall -g ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_PROGRAM += -s endif config.status: configure dh_testdir # Add here commands to configure the package. ifneq "$(wildcard /usr/share/misc/config.sub)" "" cp -f /usr/share/misc/config.sub config.sub endif ifneq "$(wildcard /usr/share/misc/config.guess)" "" cp -f /usr/share/misc/config.guess config.guess endif CFLAGS="$(CFLAGS)" ./configure \ --host=$(DEB_HOST_GNU_TYPE) \ --build=$(DEB_BUILD_GNU_TYPE) \ --prefix=/usr \ --mandir=\$${prefix}/share/man \ --sysconfdir=/etc/lcdproc \ --enable-seamless-hbars \ --enable-stat-nfs \ --enable-stat-smbfs \ --enable-lcdproc-menus \ --enable-drivers=all build: build-stamp build-stamp: config.status dh_testdir # Add here commands to compile the package. $(MAKE) touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp # Add here commands to clean up after the build process. [ ! -f Makefile ] || $(MAKE) distclean rm -f LCDd.conf.debian dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs # Add here commands to install the package into debian/lcdproc. $(MAKE) install DESTDIR=$(CURDIR)/debian/lcdproc $(MAKE) install-html-userguide DESTDIR=$(CURDIR)/debian/lcdproc # install config file (with some adaptions) sed -e '/^DriverPath=/s,server/drivers,/usr/lib/lcdproc,' \ < $(CURDIR)/LCDd.conf > $(CURDIR)/LCDd.conf.debian install -m644 $(CURDIR)/LCDd.conf.debian $(CURDIR)/debian/lcdproc/etc/lcdproc/LCDd.conf # trick: move samples into the correct directory # this saves us from patching Makefile.in files for i in fortune.pl iosock.pl lcdident.pl lcdmetar.pl tail.pl x11amp.pl ; do \ mv $(CURDIR)/debian/lcdproc/usr/bin/$$i $(CURDIR)/debian/lcdproc/usr/share/doc/lcdproc/examples; \ done # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. # Build architecture-dependent files here. binary-arch: build install dh_testdir dh_testroot dh_installchangelogs ChangeLog dh_installdocs # dh_installexamples # dh_install # dh_installmenu # dh_installdebconf # dh_installlogrotate # dh_installemacsen # dh_installpam # dh_installmime # dh_python dh_installinit --update-rcd-params="defaults 21 79" # for the lcdproc client dh_installinit --name=LCDd dh_installinit --name=lcdexec --update-rcd-params="defaults 21 79" dh_installinit --name=lcdvc --update-rcd-params="defaults 21 79" # dh_installcron # dh_installinfo dh_installman dh_link dh_strip dh_compress dh_fixperms # dh_perl # dh_makeshlibs dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install lcdproc-0.5.7/scripts/debian/README.Debian000644 001751 000000 00000002340 10511144355 020722 0ustar00mmdolzewheel000000 000000 lcdproc for Debian ------------------ New upstream version. All drivers enabled. CFontz633 and all other USB drivers are enabled in this release. Enabled support for libusb Doxygen-generated documentation included Moved to a more "standard" way of installing most files -- Jose Luis Tallon Sun, 23 Jul 2006 20:23:48 +0200 WARNING: CFontz633 USB driver removed Due to licencing issues this upstream release is missing the CFontz633 USB driver. Upstream are hoping to add this back in once the licence is resolved. -- Jonathan Oxer , Thu, 1 Apr 2004 13:24:56 +1000 WARNING: Location of example clients changed lcdproc originally installed a number of example clients in /usr/bin, but this was not the intended behaviour. Upstream have stated these examples should be located in /usr/share/doc/lcdproc/examples, which is in agreement with Debian policy. Release 0.4.3-14 of this package therefore moves the example clients from /usr/bin to /usr/share/doc/lcdproc/examples. That means they are no longer in PATH, so you will either need to copy them to another location manually or specify the full path when calling them. -- Jonathan Oxer , Tue, 9 Dec 2003 14:33:27 +1100 lcdproc-0.5.7/docs/Makefile.am000644 001751 000000 00000005216 12313532717 016746 0ustar00mmdolzewheel000000 000000 ## Process this file with automake to produce Makefile.in man_MANS = lcdproc.1 lcdexec.1 lcdvc.1 LCDd.8 lcdproc-config.5 SUBDIRS = lcdproc-user lcdproc-dev doxygen_input = doxy-mainpage.md EXTRA_DIST = lcdproc.1.in \ lcdexec.1 \ lcdvc.1.in \ LCDd.8.in \ lcdproc-config.5.in \ $(doxygen_input) ## generate man pages LCDd.8: LCDd.8.in sed -e 's:@SYSCONFDIR@:@sysconfdir@:g' $? > $@ lcdproc.1: lcdproc.1.in sed -e 's:@SYSCONFDIR@:@sysconfdir@:g' $? > $@ lcdvc.1: lcdvc.1.in sed -e 's:@SYSCONFDIR@:@sysconfdir@:g' $? > $@ lcdproc-config.5: lcdproc-config.5.in sed -e 's:@SYSCONFDIR@:@sysconfdir@:g' $? > $@ ## clean generated makefiles CLEANFILES = LCDd.8 lcdproc.1 lcdvc.1 lcdproc-config.5 ## convenience targets .PHONY: install-server-man install-client-man install-server-man: install-man8 install-man5 install-client-man: install-man1 install-man5 .PHONY: install-html-guides install-html-developerguide install-html-userguide install-html-guides: install-html-developerguide install-html-userguide install-html-developerguide: $(MAKE) -C lcdproc-dev $@ install-html-userguide: $(MAKE) -C lcdproc-user $@ ###################################################################### # DOXYGEN stuff # (stolen from cppunit project (http://cppunit.sourceforge.net/) ###################################################################### # DOX is defined if installer requests dox generation. # For now, we only install HTML documentation. if DOX ### htmldir = $(pkgdatadir)/html ### html_DATA = html/index.html ### install-data-hook: ### cp -pR html/* $(DESTDIR)$(htmldir) ### # Automake's "distcheck" is sensitive to having files left over ### # after "make uninstall", so we have to clean up the install hook. ### uninstall-local: ### rm -rf $(DESTDIR)$(htmldir) install-data-hook: uninstall-local: dox: html/index.html else # We repeat the three targets in both the "if" and "else" clauses # of the conditional, because the generated makefile will contain # references to the targets (target "install" depends on target # "install-datahook", for example), and some make programs get upset # if no target exists. install-data-hook: uninstall-local: dox: endif # uncomment this if you want documentation to be build by # default. Otherwise do it on demand. #all-local: dox html/index.html: Doxyfile $(doxygen_input) "@DOXYGEN@" # Make tarfile to distribute the HTML documentation. doc-dist: dox tar -czf $(PACKAGE)-docs-$(VERSION).tar.gz -C html . pdf: @PACKAGE@.pdf @PACKAGE@.pdf: $(MAKE) -C ./latex pdf ln -s ./latex/refman.ps @PACKAGE@.ps ln -s ./latex/refman.pdf @PACKAGE@.pdf clean-local: rm -f -r latex rm -f -r html man @PACKAGE@.ps @PACKAGE@.pdf ## EOF lcdproc-0.5.7/docs/Doxyfile.in000644 001751 000000 00000227142 12313532717 017031 0ustar00mmdolzewheel000000 000000 # Doxyfile 1.8.2 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. # # All text after a hash (#) is considered a comment and will be ignored. # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" "). #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all # text before the first occurrence of this tag. Doxygen uses libiconv (or the # iconv built into libc) for the transcoding. See # http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or sequence of words) that should # identify the project. Note that if you do not use Doxywizard you need # to put quotes around the project name if it contains spaces. PROJECT_NAME = LCDproc # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = "Version @VERSION@" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer # a quick idea about the purpose of the project. Keep the description short. PROJECT_BRIEF = # With the PROJECT_LOGO tag one can specify an logo or icon that is # included in the documentation. The maximum height of the logo should not # exceed 55 pixels and the maximum width should not exceed 200 pixels. # Doxygen will copy the logo to the output directory. PROJECT_LOGO = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = . # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, # Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English # messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, # Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, # Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = NO # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. Note that you specify absolute paths here, but also # relative paths, which will be relative from the directory where doxygen is # started. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful if your file system # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like regular Qt-style comments # (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = YES # If the QT_AUTOBRIEF tag is set to YES then Doxygen will # interpret the first line (until the first dot) of a Qt-style # comment as the brief description. If set to NO, the comments # will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding # "class=itcl::class" will allow you to use the command class in the # itcl::class meaning. TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = YES # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for # Java. For instance, namespaces will be presented as packages, qualified # scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources only. Doxygen will then generate output that is more tailored for # Fortran. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for # VHDL. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, # and language is one of the parsers supported by doxygen: IDL, Java, # Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, # C++. For instance to make doxygen treat .inc files as Fortran files (default # is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note # that for custom extensions you also need to set FILE_PATTERNS otherwise the # files are not read by doxygen. EXTENSION_MAPPING = # If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all # comments according to the Markdown format, which allows for more readable # documentation. See http://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you # can mix doxygen, HTML, and XML commands with Markdown formatting. # Disable only in case of backward compatibilities issues. MARKDOWN_SUPPORT = YES # When enabled doxygen tries to link words that correspond to documented classes, # or namespaces to their corresponding documentation. Such a link can be # prevented in individual cases by by putting a % sign in front of the word or # globally by setting AUTOLINK_SUPPORT to NO. AUTOLINK_SUPPORT = YES # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also makes the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. # Doxygen will parse them like normal C++ but will assume all classes use public # instead of private inheritance when no explicit protection keyword is present. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate getter and setter methods for a property. Setting this option to YES (the default) will make doxygen replace the get and set methods by a property in the documentation. This will only work if the methods are indeed getting or setting a simple type. If this is not the case, or you want to show the methods anyway, you should set this option to NO. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES # When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and # unions are shown inside the group in which they are included (e.g. using # @ingroup) instead of on a separate page (for HTML and Man pages) or # section (for LaTeX and RTF). INLINE_GROUPED_CLASSES = NO # When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and # unions with only public data fields will be shown inline in the documentation # of the scope in which they are defined (i.e. file, namespace, or group # documentation), provided this scope is documented. If set to NO (the default), # structs, classes, and unions are shown on a separate page (for HTML and Man # pages) or section (for LaTeX and RTF). INLINE_SIMPLE_STRUCTS = YES # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum # is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically # be useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. TYPEDEF_HIDES_STRUCT = NO # The SYMBOL_CACHE_SIZE determines the size of the internal cache use to # determine which symbols to keep in memory and which to flush to disk. # When the cache is full, less often used symbols will be written to disk. # For small to medium size projects (<1000 input files) the default value is # probably good enough. For larger projects a too small cache size can cause # doxygen to be busy swapping symbols to and from disk most of the time # causing a significant performance penalty. # If the system has enough physical memory increasing the cache will improve the # performance by keeping more symbols in memory. Note that the value works on # a logarithmic scale so increasing the size by one will roughly double the # memory usage. The cache size is given by this formula: # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, # corresponding to a cache size of 2^16 = 65536 symbols. SYMBOL_CACHE_SIZE = 0 # Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be # set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given # their name and scope. Since this can be an expensive process and often the # same symbol appear multiple times in the code, doxygen keeps a cache of # pre-resolved symbols. If the cache is too small doxygen will become slower. # If the cache is too large, memory is wasted. The cache size is given by this # formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0, # corresponding to a cache size of 2^16 = 65536 symbols. LOOKUP_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = YES # If the EXTRACT_PACKAGE tag is set to YES all members with package or internal # scope will be included in the documentation. EXTRACT_PACKAGE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base # name of the file that contains the anonymous namespace. By default # anonymous namespaces are hidden. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = NO # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen # will list include files with double quotes in the documentation # rather than with sharp brackets. FORCE_LOCAL_INCLUDES = NO # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen # will sort the (brief and detailed) documentation of class members so that # constructors and destructors are listed first. If set to NO (the default) # the constructors will appear in the respective orders defined by # SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. # This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO # and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. SORT_MEMBERS_CTORS_1ST = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the # hierarchy of group names into alphabetical order. If set to NO (the default) # the group names will appear in their defined order. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to # do proper type resolution of all parameters of a function it will reject a # match between the prototype and the implementation of a member function even # if there is only one candidate or it is obvious which candidate to choose # by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen # will still accept a match between prototype and implementation in such cases. STRICT_PROTO_MATCHING = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or macro consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and macros in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # Set the SHOW_FILES tag to NO to disable the generation of the Files page. # This will remove the Files entry from the Quick Index and from the # Folder Tree View (if specified). The default is YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the # Namespaces page. # This will remove the Namespaces entry from the Quick Index # and from the Folder Tree View (if specified). The default is YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated # output files in an output format independent way. To create the layout file # that represents doxygen's defaults, run doxygen with the -l option. # You can optionally specify a file name after the option, if omitted # DoxygenLayout.xml will be used as the name of the layout file. LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files # containing the references data. This must be a list of .bib files. The # .bib extension is automatically appended if omitted. Using this command # requires the bibtex tool to be installed. See also # http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style # of the bibliography can be controlled using LATEX_BIB_STYLE. To use this # feature you need bibtex and perl available in the search path. CITE_BIB_FILES = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = YES # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # The WARN_NO_PARAMDOC option can be enabled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text " # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = ../clients \ ../server \ ../shared \ doxy-mainpage.md # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # also the default input encoding. Doxygen uses libiconv (or the iconv built # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for # the list of possible encodings. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh # *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py # *.f90 *.f *.for *.vhd *.vhdl FILE_PATTERNS = *.c \ *.h # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should be # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. # Note that relative paths are relative to the directory from which doxygen is # run. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = config.h # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = *.c \ *.h # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. # If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. # Doxygen will compare the file name with each pattern and apply the # filter if there is a match. # The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty or if # non of the patterns match the file name, INPUT_FILTER is applied. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO # The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file # pattern. A pattern will override the setting for FILTER_PATTERN (if any) # and it is also possible to disable source filtering for a specific pattern # using *.ext= (so without naming a filter). This option only has effect when # FILTER_SOURCE_FILES is enabled. FILTER_SOURCE_PATTERNS = #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C, C++ and Fortran comments will always remain visible. STRIP_CODE_COMMENTS = NO # If the REFERENCED_BY_RELATION tag is set to YES # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES # If the REFERENCES_RELATION tag is set to YES # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. # Otherwise they will link to the documentation. REFERENCES_LINK_SOURCE = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = YES # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = yes # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. Note that when using a custom header you are responsible # for the proper inclusion of any scripts and style sheets that doxygen # needs, which is dependent on the configuration options used. # It is advised to generate a default header using "doxygen -w html # header.html footer.html stylesheet.css YourConfigFile" and then modify # that header. Note that the header is subject to change so you typically # have to redo this when upgrading to a newer version of doxygen or when # changing the value of configuration settings such as GENERATE_TREEVIEW! HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If left blank doxygen will # generate a default style sheet. Note that it is recommended to use # HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this # tag will in the future become obsolete. HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify an additional # user-defined cascading style sheet that is included after the standard # style sheets created by doxygen. Using this option one can overrule # certain style aspects. This is preferred over using HTML_STYLESHEET # since it does not replace the standard style sheet and is therefor more # robust against future updates. Doxygen will copy the style sheet file to # the output directory. HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note # that these files will be copied to the base HTML output directory. Use the # $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these # files. In the HTML_STYLESHEET file, use the file name only. Also note that # the files will be copied as-is; there are no commands or markers available. HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. # Doxygen will adjust the colors in the style sheet and background images # according to this color. Hue is specified as an angle on a colorwheel, # see http://en.wikipedia.org/wiki/Hue for more information. # For instance the value 0 represents red, 60 is yellow, 120 is green, # 180 is cyan, 240 is blue, 300 purple, and 360 is red again. # The allowed range is 0 to 359. HTML_COLORSTYLE_HUE = 220 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of # the colors in the HTML output. For a value of 0 the output will use # grayscales only. A value of 255 will produce the most vivid colors. HTML_COLORSTYLE_SAT = 100 # The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to # the luminance component of the colors in the HTML output. Values below # 100 gradually make the output lighter, whereas values above 100 make # the output darker. The value divided by 100 is the actual gamma applied, # so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, # and 100 does not change the gamma. HTML_COLORSTYLE_GAMMA = 80 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting # this to NO can help when comparing the output of multiple runs. HTML_TIMESTAMP = NO # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. HTML_DYNAMIC_SECTIONS = NO # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of # entries shown in the various tree structured indices initially; the user # can expand and collapse entries dynamically later on. Doxygen will expand # the tree to such a level that at most the specified number of entries are # visible (unless a fully collapsed tree already exceeds this amount). # So setting the number of entries 1 will produce a full collapsed tree by # default. 0 is a special value representing an infinite number of entries # and will result in a full expanded tree by default. HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files # will be generated that can be used as input for Apple's Xcode 3 # integrated development environment, introduced with OSX 10.5 (Leopard). # To create a documentation set, doxygen will generate a Makefile in the # HTML output directory. Running make will produce the docset in that # directory and running "make install" will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find # it at startup. # See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html # for more information. GENERATE_DOCSET = NO # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the # feed. A documentation feed provides an umbrella under which multiple # documentation sets from a single provider (such as a company or product suite) # can be grouped. DOCSET_FEEDNAME = "Doxygen generated docs" # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that # should uniquely identify the documentation set bundle. This should be a # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen # will append .docset to the name. DOCSET_BUNDLE_ID = org.doxygen.Project # When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely # identify the documentation publisher. This should be a reverse domain-name # style string, e.g. com.mycompany.MyDocSet.documentation. DOCSET_PUBLISHER_ID = org.doxygen.Publisher # The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING # is used to encode HtmlHelp index (hhk), content (hhc) and project file # content. CHM_INDEX_ENCODING = # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated # that can be used as input for Qt's qhelpgenerator to generate a # Qt Compressed Help (.qch) of the generated HTML documentation. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can # be used to specify the file name of the resulting .qch file. # The path specified is relative to the HTML output folder. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#namespace QHP_NAMESPACE = # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#virtual-folders QHP_VIRTUAL_FOLDER = doc # If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to # add. For more information please see # http://doc.trolltech.com/qthelpproject.html#custom-filters QHP_CUST_FILTER_NAME = # The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see # # Qt Help Project / Custom Filters. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's # filter section matches. # # Qt Help Project / Filter Attributes. QHP_SECT_FILTER_ATTRS = # If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can # be used to specify the location of Qt's qhelpgenerator. # If non-empty doxygen will try to run qhelpgenerator on the generated # .qhp file. QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files # will be generated, which together with the HTML files, form an Eclipse help # plugin. To install this plugin and make it available under the help contents # menu in Eclipse, the contents of the directory containing the HTML and XML # files needs to be copied into the plugins directory of eclipse. The name of # the directory within the plugins directory should be the same as # the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before # the help appears. GENERATE_ECLIPSEHELP = NO # A unique identifier for the eclipse help plugin. When installing the plugin # the directory name containing the HTML and XML files should also have # this name. ECLIPSE_DOC_ID = org.doxygen.Project # The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) # at top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. Since the tabs have the same information as the # navigation tree you can set this option to NO if you already set # GENERATE_TREEVIEW to YES. DISABLE_INDEX = NO # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. # If the tag value is set to YES, a side panel will be generated # containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). # Windows users are probably better off using the HTML help feature. # Since the tree basically has the same information as the tab index you # could consider to set DISABLE_INDEX to NO when enabling this option. GENERATE_TREEVIEW = NO # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values # (range [0,1..20]) that doxygen will group on one line in the generated HTML # documentation. Note that a value of 0 will completely suppress the enum # values from appearing in the overview section. ENUM_VALUES_PER_LINE = 4 # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 # When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open # links to external symbols imported via tag files in a separate window. EXT_LINKS_IN_WINDOW = NO # Use this tag to change the font size of Latex formulas included # as images in the HTML documentation. The default is 10. Note that # when you change the font size after a successful doxygen run you need # to manually remove any form_*.png images from the HTML output directory # to force them to be regenerated. FORMULA_FONTSIZE = 10 # Use the FORMULA_TRANPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are # not supported properly for IE 6.0, but are supported on all modern browsers. # Note that when changing this option you need to delete any form_*.png files # in the HTML output before the changes have effect. FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax # (see http://www.mathjax.org) which uses client side Javascript for the # rendering instead of using prerendered bitmaps. Use this if you do not # have LaTeX installed or if you want to formulas look prettier in the HTML # output. When enabled you may also need to install MathJax separately and # configure the path to it using the MATHJAX_RELPATH option. USE_MATHJAX = NO # When MathJax is enabled you need to specify the location relative to the # HTML output directory using the MATHJAX_RELPATH option. The destination # directory should contain the MathJax.js script. For instance, if the mathjax # directory is located at the same level as the HTML output directory, then # MATHJAX_RELPATH should be ../mathjax. The default value points to # the MathJax Content Delivery Network so you can quickly see the result without # installing MathJax. # However, it is strongly recommended to install a local # copy of MathJax from http://www.mathjax.org before deployment. MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension # names that should be enabled during MathJax rendering. MATHJAX_EXTENSIONS = # When the SEARCHENGINE tag is enabled doxygen will generate a search box # for the HTML output. The underlying search engine uses javascript # and DHTML and should work on any modern browser. Note that when using # HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets # (GENERATE_DOCSET) there is already a search function so this one should # typically be disabled. For large projects the javascript based search engine # can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. SEARCHENGINE = YES # When the SERVER_BASED_SEARCH tag is enabled the search engine will be # implemented using a PHP enabled web server instead of at the web client # using Javascript. Doxygen will generate the search PHP script and index # file to put on the web server. The advantage of the server # based approach is that it scales better to large projects and allows # full text search. The disadvantages are that it is more difficult to setup # and does not have live searching capabilities. SERVER_BASED_SEARCH = NO #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = no # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. # Note that when enabling USE_PDFLATEX this option is only used for # generating bitmaps for formulas in the HTML output, but not in the # Makefile that is written to the output directory. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for # the generated latex document. The footer should contain everything after # the last chapter. If it is left blank doxygen will generate a # standard footer. Notice: only use this tag if you know what you are doing! LATEX_FOOTER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = NO # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = NO # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO # If LATEX_SOURCE_CODE is set to YES then doxygen will include # source code with syntax highlighting in the LaTeX output. # Note that which sources are shown also depends on other settings # such as SOURCE_BROWSER. LATEX_SOURCE_CODE = NO # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See # http://en.wikipedia.org/wiki/BibTeX for more info. LATEX_BIB_STYLE = plain #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load style sheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. # This is useful # if you want to understand what is going on. # On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = YES # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # pointed to by INCLUDE_PATH will be searched when a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition that # overrules the definition found in the source code. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all references to function-like macros # that are alone on a line, have an all uppercase name, and do not end with a # semicolon, because these will confuse the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. For each # tag file the location of the external documentation should be added. The # format of a tag file without this location is as follows: # # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths # or URLs. Note that each tag file must have a unique name (where the name does # NOT include the path). If a tag file is not located in the directory in which # doxygen is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option also works with HAVE_DOT disabled, but it is recommended to # install and use dot, since it yields more powerful graphs. CLASS_DIAGRAMS = YES # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the # documentation. The MSCGEN_PATH tag allows you to specify the directory where # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. MSCGEN_PATH = # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = no # The DOT_NUM_THREADS specifies the number of dot invocations doxygen is # allowed to run in parallel. When set to 0 (the default) doxygen will # base this on the number of processors available in the system. You can set it # explicitly to a value larger than 0 to get control over the balance # between CPU load and processing speed. DOT_NUM_THREADS = 0 # By default doxygen will use the Helvetica font for all dot files that # doxygen generates. When you want a differently looking font you can specify # the font name using DOT_FONTNAME. You need to make sure dot is able to find # the font, which can be done by putting it in a standard location or by setting # the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the # directory containing the font. DOT_FONTNAME = FreeSans # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. # The default size is 10pt. DOT_FONTSIZE = 10 # By default doxygen will tell dot to use the Helvetica font. # If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to # set the path where dot can find it. DOT_FONTPATH = # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = YES # If the UML_LOOK tag is enabled, the fields and methods are shown inside # the class node. If there are many fields or methods and many nodes the # graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS # threshold limits the number of items for each type to make the size more # managable. Set this to 0 for no limit. Note that the threshold may be # exceeded by 50% before the limit is enforced. UML_LIMIT_NUM_FIELDS = 10 # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT options are set to YES then # doxygen will generate a call dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable call graphs # for selected functions only using the \callgraph command. CALL_GRAPH = NO # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then # doxygen will generate a caller dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable caller # graphs for selected functions only using the \callergraph command. CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will generate a graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are svg, png, jpg, or gif. # If left blank png will be used. If you choose svg you need to set # HTML_FILE_EXTENSION to xhtml in order to make the SVG files # visible in IE 9+ (other browsers do not have this requirement). DOT_IMAGE_FORMAT = png # If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to # enable generation of interactive SVG images that allow zooming and panning. # Note that this requires a modern browser other than Internet Explorer. # Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you # need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files # visible. Older versions of IE do not have SVG support. INTERACTIVE_SVG = NO # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The MSCFILE_DIRS tag can be used to specify one or more directories that # contain msc files that are included in the documentation (see the # \mscfile command). MSCFILE_DIRS = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of # nodes that will be shown in the graph. If the number of nodes in a graph # becomes larger than this value, doxygen will truncate the graph, which is # visualized by representing a node as a red box. Note that doxygen if the # number of direct children of the root node in a graph is already larger than # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that the size of a graph can be further restricted by # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, because dot on Windows does not # seem to support this out of the box. Warning: Depending on the platform used, # enabling this option may lead to badly anti-aliased labels on the edges of # a graph (i.e. they become hard to read). DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES lcdproc-0.5.7/docs/lcdproc.1.in000644 001751 000000 00000012201 11621737633 017024 0ustar00mmdolzewheel000000 000000 .TH lcdproc 1 "24 March 2011" LCDproc "LCDproc suite" .SH NAME lcdproc - system status information client .SH SYNOPSIS .B lcdproc [\fB\-hfv\fP] [\fB\-c\fP \fIconfig\fP] [\fB\-s\fP \fIhost\fP] [\fB\-p\fP \fIport\fP] [\fB\-e\fP \fIdelay\fP] [\fIscreen\fP ...] .SH DESCRIPTION \fBlcdproc\fP is the client in the LCDproc suite that displays information about the local system's status on an LCD that is connected to an LCDd server daemon. .PP Due to the client-server architecture it does not matter whether the LCDd daemon runs on the local machine or on a remote system. .PP Most settings of \fBlcdproc\fP are configured through its configuration file \fI@SYSCONFDIR@/lcdproc.conf\fP, some of them can be overridden using command line options. .PP Before running \fBlcdproc\fP you should carefully read through that file and modify the settings therein according to your needs. .PP When compiled appropriately, some aspects of \fBlcdproc\fP can even configured at run time using a menu on the LCD. .PP Currently, only Linux, the BSD variants FreeBSD, NetBSD, OpenBSD and Darwin as well as Solaris are supported, but not all features may be available on all platforms. .SH OPTIONS .B lcdproc understands these command line options: .TP .B \-c \fIconfig\fP Use a configuration file other than @SYSCONFDIR@/LCDd.conf .TP .B \-s \fIhost\fP Connect to the LCDd server on \fIhost\fP, instead to the one listed in te \fBServer\fP parameter in the config file's \fB[lcdproc]\fP section. If not given here and not specified in the config file or if the default config file does not exist, it defaults to '\fIlocalhost\fP. .TP .B \-p \fIport\fP Use port \fIport\fP when connecting to the LCDd server on \fIhost\fP. This option overrides the \fBPort\fP parameter in the config file's \fB[lcdproc]\fP section. Without a default config file or when not set in the config file, it defaults to the LCDproc port \fI13666\fP. .TP .B \-f Run in the foreground, overriding the \fBForeground\fP parameter in the config file's \fB[lcdproc]\fP section. The default, if not in the config file or without a config file, is to daemonize \fBlcdproc\fP as it is intended to display the system information in the background. .TP .B \-e \fIdelay\fP Sleep \fIdelay\fP in 100ths of seconds between updating screens in an update cycle. This option overrides the \fBDelay\fP parameter in the config file's \fB[lcdproc]\fP section. When not given and not in the config file, it defaults to 0. .TP .B \-h Show help screen. .TP .B \-v Print the version of \fBlcdproc\fP and exit. .TP .B \fIscreen\fP can be one of the following: .RS .TP 16 .B C CPU show detailed CPU usage .TP 16 .B P SMP-CPU CPU usage overview: one line per CPU, especially useful on SMP systems. .TP 16 .B G CPUGraph CPU histogram .TP 16 .B L Load Load histogram .TP 16 .B M Memory memory & swap usage .TP 16 .B S ProcSize memory usage of 5 biggest processes .TP 16 .B D Disk filling level of the mounted file systems .TP 16 .B I Iface network interface usage .TP 16 .B B Battery battery status .TP 16 .B T TimeDate time & date information .TP 16 .B O OldTime old time screen .TP 16 .B U Uptime uptime screen .TP 16 .B K BigClock big clock .TP 16 .B N MiniClock minimal clock .TP 16 .B A About credits page .PP On the command line you may either use the short or the long \fIscreen\fP name. In the config file, the long names are used as section labels to configure the screens further. .PP You may also prefix the screen names with an exclamation mark '\fB!\fP' to disable a screen that was activated in the config file instead of activating a disabled one. .SH EXAMPLES .RS .I lcdproc C M D '!L' .RE .PP With the command line specified above, \fBlcdproc\fP loads the default configuration file, connects to the LCDd server specified therein and then displays the following screens in addition to those activated in the configuration file on the LCD: .IP * detailed CPU Usage .IP * Memory & swap usage .IP * filling level of the mounted file systems .PP The .IP * Load histogram .PP screen is disabled and therefore not shown in the display. (The quotes are not part of lcdproc's command line syntax; they are required to disable special interpretation of the exclamation mark by the shell). .SH FILES \fB@SYSCONFDIR@/lcdproc.conf\fR, lcdproc's default configuration file .SH SEE ALSO LCDd(8), lcdproc-config(5) .SH AUTHOR Many people have contributed to LCDproc. See the \fICREDITS\fP file for more details. .PP All questions should be sent to the lcdproc mailing list. The mailing list, and the newest version of LCDproc, should be available from here: .PP http://www.lcdproc.org/ .SH LEGAL STUFF LCDproc is released as "WorksForMe-Ware". In other words, it is free, kinda neat, and we don't guarantee that it will do anything in particular on any machine except the ones it was developed on. .PP It is technically released under the GNU GPL license (you should have received the file, "COPYING", with LCDproc) (also, look on http://www.fsf.org/ for more information), so you can distribute and use it for free -- but you must make the source code freely available to anyone who wants it. .PP For any sort of real legal information, read the GNU GPL (GNU General Public License). It's worth reading. lcdproc-0.5.7/docs/lcdexec.1000644 001751 000000 00000016030 11621737633 016404 0ustar00mmdolzewheel000000 000000 .TH lcdexec 1 "24 March 2011" LCDproc "LCDproc suite" .SH NAME lcdexec - LCDproc client to execute commands from the LCDd menu .SH SYNOPSIS .B lcdexec [\fB\-hf\fP] [\fB\-c\fP \fIconfig\fP] [\fB\-a\fP \fIaddr\fP] [\fB\-p\fP \fIport\fP] [\fB\-r\fP \fIlevel\fP] [\fB\-s\fP \fIbool\fP] .SH DESCRIPTION lcdexec connects to LCDd (the LCDproc server) and adds a submenu to the LCDd main menu that allows the user to select commands to be executed. You can access the menu by pressing the menu key configured for LCDd. .SH OPTIONS .I lcdexec understands the following command line options., that override the corresponding options given in the configuration file: .TP 8 .B \-c \fIfilename\fP Set the name of the config file to read, /etc/lcdexec.conf by default .TP 8 .B \-a \fIaddress\fP Set the address of the host which LCDd is running on, localhost by default .TP 8 .B \-p \fIport\fP Set the port which LCDd is accepting connections on, 13666 by default .TP 8 .B \-f Run in foreground. .TP 8 .B \-r \fIlevel\fP Set the reporting level to \fIlevel\fP, which is an integer representing the reporting levels from 0 (critical errors only) to 5 (debug messages). Default is 2 (errors and warnings only) .TP 8 .B \-s \fIbool\fP Report to syslog (1) or to stdout (0, default) .PP .SH USAGE In addition to the command line options listed above lcdexec also takes options from a configuration file. .PP This file is expected to have a "INI-file" like format with sections introduced by section headers in square brackets and options lines consisting of key=value pairs. .PP Section and option names may contain only characters from the range [a-zA-Z0-9_], while value strings may contain any printable character. Value strings with characters outside the range [a-zA-Z0-9_] must be quoted with double quotes. To get a double quote or backslashes in the string, they must be escaped by preceding it by a backslash. .PP The lcdexec configuration file needs at least two sections: .TP 8 .B [lcdexec] for the general options .TP 8 .B [MainMenu] for the top level of the menu hierarchy to be displayed. .PP The \fB[lcdexec]\fP section supports the following options: .TP 8 .B Address=\fIserver\fP The host name or IP address of the LCDd server to connect to. If not given, \fIserver\fP defaults to localhost. .TP 8 .B Port=\fIport\fP Port of the server to connect to. The default value for \fIport\fP is 13666, the LCDproc port. .TP 8 .B ReportLevel=\fIlevel\fP Set the reporting level to \fIlevel\fP, which is an integer representing the reporting levels from 0 (critical errors only) to 5 (debug messages). Default is 2 (errors and warnings only) .TP 8 .B ReportToSyslog=\fIbool\fP Tell whether to report to syslog (TRUE) or to stderr (FALSE). .TP 8 .B Foreground=\fIbool\fP Tell whether to run in foreground (TRUE) or in background (FALSE). If not given, the default is FALSE for daemon mode. .TP 8 .B DisplayName=\fIDisplay\fP Set the display name for the main menu. If not given it defaults to \fBlcdexec\fP \fIHOST\fP, where \fIHOST\fP is the hostname of the system \fIlcdexec\fP is running on. .TP 8 .B Shell=\fI/path/to/shell\fP Set the shell to use when executing programs. If not given, \fBlcdexec\fP tries to read the environment variable \fISHELL\fP. If that fails, it defaults to \fB/bin/sh\fP. Please note that the shell given here must understand the option \fB\-c\fP followed by the command line to execute. .PP The \fB[MainMenu]\fP section and the sections it refers to define the menu hierarchy to be displayed. Each menu and each menu entry in the menu hierarchy is defined as its own section. Whether a given section is a sub-menu or a command entry is defined by the option keys occurring in the section. .PP Menu / menu entry sections may contain the following options: .TP 8 .B Entry=\fIentry\fP Defines a menu entry \fIentry\fP which is further specified in the section \fB[\fP\fIentry\fP\fB]\fP. Sections containing one or more \fBEntry=\fP options are menus. .TP 8 .B Exec=\fIcommand\fP Defines the system command \fIcommand\fP to be executed when this entry gets selected. Sections containing an \fBExec=\fP option are command entries. .TP 8 .B DisplayName=\fIname\fP The name of the menu entry to be displayed on the LCD. If this option is not given, the the section header name is used (without the square brackets). .TP 8 .B Feedback=\fIbool\fP In command entries, this option tells whether to inform the user of the completion of commands using an alert screen on the display. If not given, it defaults to \fBno\fB. .PP .SH FILES .TP .B lcdexec.conf .SH EXAMPLES In the configfile: .PP .DS .ft CW .nf ## general options for lcdexec ## [lcdexec] # address of the LCDd server to connect to Address=localhost # Port of the server to connect to Port=13666 # set reporting level ReportLevel=2 # report to to syslog ? ReportToSyslog=false # run in foreground [default: false; legal: true, false] Foreground=false # display name for the main menu [default: lcdexec HOST] #DisplayName=lcdexec # main menu definition [MainMenu] # the Entry=... lines (one for each menu entry) tell it is a menu definition Entry=EjectCD Entry=ShutdownMenu # definition of a command [EjectCD] # name to display in the menu instead of the section name DisplayName="Eject CD-ROM" # the Exec=... line tells that it is a command Exec="umount /cdrom; cdeject" # definition of a menu [ShutdownMenu] DisplayName="Shutdown menu" # a menu contains an Entry=... line for each menu entry Entry=Shutdown5min Entry=Reboot5min Entry=CancelShutdown Entry=ShutdownNow Entry=RebootNow [Shutdown5min] DisplayName="Shutdown in 5 minutes" Exec="shutdown \-h +5" Feedback=yes [Reboot5min] DisplayName="Reboot in 5 minutes" Exec="shutdown \-r +5" Feedback=yes [CanclShutdown] DisplayName="Cancel shutdown/reboot" Exec="shutdown \-c" Feedback=yes [ShutdownNow] DisplayName="Shutdown now" Exec="shutdown \-h now" [RebootNow] DisplayName="Reboot now" Exec="shutdown \-r now" .ft R .fi .DE .PP Start lcdexec with: lcdexec \-c /usr/local/etc/lcdexec.conf .PP This will allow you to eject the CD-ROM by opening the LCDd menu, selecting "lcdexec" and selecting "Eject CD-ROM". Further it allows you to do various shutdowns, among others the "Shutdown in 5 minutes" by opening the LCDd menu, selecting "lcdexec", selecting "Shutdown menu" and selecting "Shutdown in 5 minutes". .SH SEE ALSO LCDd(8) .SH AUTHOR lcdexec is written by Joris Robijn and Peter Marschall. It is part of the LCDproc suite. The newest version of LCDproc should be available from here: http://www.lcdproc.org/ .SH LEGAL STUFF LCDproc is released as "WorksForMe-Ware". In other words, it is free, kinda neat, and we don't guarantee that it will do anything in particular on any machine except the ones it was developed on. .PP It is technically released under the GNU GPL license (you should have received the file, "COPYING", with LCDproc) (also, look on http://www.fsf.org/ for more information), so you can distribute and use it for free -- but you must make the source code freely available to anyone who wants it. .PP For any sort of real legal information, read the GNU GPL (GNU General Public License). It's worth reading. lcdproc-0.5.7/docs/lcdvc.1.in000644 001751 000000 00000003607 11621737633 016503 0ustar00mmdolzewheel000000 000000 .\" This man page is released under the GNU General Public License. .\" Refer to the COPYING file distributed with this package. .TH "lcdvc" "1" "12 June 2009" "LCDproc" "LCDproc suite" .SH "NAME" .LP lcdvc \- LCDproc virtual console .SH "SYNOPSIS" .LP lcdvc [\fB\-fh\fR] [\fB\-a\fR \fIaddr\fR] [\fB\-c\fR \fIfile\fR] [\fB\-p\fR \fIport\fR] [\fB\-r\fR \fIlevel\fR] [\fB\-s\fR \fIbool\fR] .SH "DESCRIPTION" .LP This program shows content from a system console on a LCD controlled by \fBLCDd\fR. As the console is usually larger than a LCD, the area shown on the LCD screen can be scrolled using keys attached to the display. .LP Additionally it has an autoscroll feature, which is on by default and can only be disabled by using \fBlcdvc\fR's menu. .LP By default it uses \fI/dev/vcs\fR and \fI/dev/vcsa\fR devices as the console to show. Other console devices can be set in the configuration file \fI@SYSCONFDIR@/lcdvc.conf\fR. The keys used for scrolling can be set in the config file as well. .SH "OPTIONS" .LP The following options can be set in the configuration file \fI@SYSCONFDIR@/lcdvc.conf\fR as well, but those given on the command line take precedence: .TP \fB\-a\fR \fIaddr\fR DNS name or IP address of the LCDd server (default localhost). .TP \fB\-c\fR \fIfile\fR Specify configuration file. .TP \fB\-f\fR Run in foreground. .TP \fB\-h\fR Output help and exit. .TP \fB\-p\fR \fIport\fR Port of the LCDd server (default 13666). .TP \fB\-r\fR \fIlevel\fR Set reporting level (0\-5, default: 2) .TP \fB\-s\fR \fIbool\fR Report to syslog (1) or stderr (0, default). .SH "FILES" .LP \fI@SYSCONFDIR@/lcdvc.conf\fP .br \fI/dev/vcs\fP .br \fI/dev/vcsa\fP .SH "AUTHORS" .LP \fBlcdvc\fR was originally written by Joris Robijn, modified by Peter Marschall. .LP This man page was written by Markus Dolze. .SH "SEE ALSO" .LP LCDd(8) vcs(4) .SH "LICENSE" \fBlcdvc\fR is released under the GNU General Public License, version 2. lcdproc-0.5.7/docs/LCDd.8.in000644 001751 000000 00000037334 12313532717 016164 0ustar00mmdolzewheel000000 000000 .TH LCDd 8 "February 10, 2014" LCDproc "LCDproc suite" .SH NAME LCDd - LCDproc server daemon .SH SYNOPSIS .B LCDd [\fB\-hf\fP] [\fB\-c\fP \fIconfig\fP] [\fB\-d\fP \fIdriver\fP] [\fB\-i\fP \fIbool\fP] [\fB\-a\fP \fIaddr\fP] [\fB\-p\fP \fIport\fP] [\fB\-u\fP \fIuser\fP] [\fB\-w\fP \fItime\fP] [\fB\-r\fP \fIlevel\fP] [\fB\-s\fP \fIbool\fP] .SH DESCRIPTION \fBLCDd\fP is the server part of LCDproc, a daemon which listens to a certain port (normally 13666) and displays information on an LCD display. It works with several types and sizes of displays. .PP Most settings of \fBLCDd\fP are configured through its configuration file \fI@SYSCONFDIR@/LCDd.conf\fP, some of them can be overridden using command line options. Before running \fBLCDd\fP you should carefully read through that file and modify everything necessary according to your needs. Otherwise you might encounter \fBLCDd\fP not running properly on your system. .PP To make full use of \fBLCDd\fP, a client such as lcdproc(1), lcdexec(1), or lcdvc is required. .SH OPTIONS Available options are: .TP .B \-h Display help screen .TP .B \-c \fIconfig\fP Use a configuration file other than \fI@SYSCONFDIR@/LCDd.conf\fP .TP .B \-d \fIdriver\fP Specify a driver to use (output only to first), overriding the \fBDriver\fP parameter in the config file's \fB[Server]\fP section. .TP .B \-f Run in the foreground, overriding the \fBForeground\fP parameter in the config file's \fB[Server]\fP section. The default, if not specified in the config file, is to daemonize \fBLCDd\fP as it is intended to operate in the background. .TP .B \-i \fIbool\fP Tell whether the to enable (\fI1\fP) or disable (\fI0\fP) showing the LCDproc server screen in n the screen rotation, overriding \fBServerScreen\fP in the config file's \fB[Server]\fP section. .TP .B \-w \fIwaittime\fP Time to pause at each screen (in seconds), overriding the \fBWaitTime\fP parameter in the config file's \fB[Server]\fP section. .TP .B \-a \fIaddr\fP Bind to network address \fIaddr\fP, overriding the \fBBind\fP parameter in the config file's \fB[Server]\fP section. .TP .B \-p \fIport\fP Listen on port \fIport\fP for incoming connections, overriding the \fBPort\fP parameter in the config file's \fB[Server]\fP section. .TP .B \-u \fIuser\fP Run as user \fIuser\fP, overriding the \fBUser\fP parameter in the config file's \fB[Server]\fP section. .TP .B \-s \fIbool\fP Output messages to syslog (\fI1\fP) or to stdout (\fI0\fP), overriding the \fBReportToSyslog\fP parameter in the config file's \fB[Server]\fP section. .TP .B \-r \fIlevel\fP Set reporting level to \fIlevel\fP, overriding th \fBReportLevel\fP parameter in the config file's \fB[Server]\fP section. .SS SUPPORTED DRIVERS Currently supported display drivers include: .TP .B bayrad BayRAD LCD modules by EMAC Inc. .TP .B CFontz CrystalFontz CFA-632 and CFA-634 serial LCD displays .TP .B CFontzPacket CrystalFontz CFA-533, CFA-631, CFA-633 and CFA-635 serial/USB LCD displays .TP .B curses Standard video display using the (n)curses library .TP .B CwLnx serial/USB displays by Cwlinux (http://www.cwlinux.com) .TP .B ea65 VFD front panel display on Aopen XC Cube EA65 media barebone .TP .B EyeboxOne LCD display on the EyeboxOne .TP .B g15 LCD display on the Logitech G15 keyboard .TP .B glcd generic driver for graphical LCDs with FreeType rendering support. This driver supports the following sub-drivers (a.k.a. \fIconnection types\fP): .RS .TP .B glcd2usb Till Harbaum's open source/open hardware GLCD2USB (http://www.harbaum.org/till/glcd2usb/) .TP .B picolcdgfx picoLCD 256x64 Sideshow graphic LCD (Mini-Box.com) .TP .B png Write out screens as PNG images .TP .B serdisplib Uses serdisplib (http://serdisplib.sourceforge.net/) for output .TP .B t6963 Toshiba T6963 based LCD displays (graphic mode) .RE .TP .B glcdlib graphical LCDs supported by graphlcd-base .TP .B glk Matrix Orbital GLK Graphic Displays .TP .B hd44780 Hitachi HD44780 LCD displays. This driver supports the following sub-drivers (a.k.a. \fIconnection types\fP): .RS .TP .B 4bit LCD 4bit-mode, connected to a PC parallel port .TP .B 8bit LCD 8bit-mode, connected to a PC parallel port .TP .B serialLpt LCD in 4bit-mode through a 4094 shift register .TP .B winamp LCD in 8bit-mode using \fIWinAmp\fP-wiring, connected to a PC parallel port .TP .B picanlcd LCD driven by a PIC-an-LCD chip/board by Dale Wheat, connected to a serial port .TP .B lcdserializer LCD driven by a PIC16C54-based piggy-back board, connected to a serial port .TP .B los-panel LCD driven by an Atmel AVR based board, connected to a serial port .TP .B vdr-lcd ???, connected to a serial port .TP .B vdr-wakeup VDR-Wake module by Frank Jepsen (http://www.jepsennet.de/vdr/) .TP .B pertelian Pertelian X2040 module (http://pertelian.com/) .TP .B lis2 LIS2 from VLSystem (http://www.vlsys.co.kr), connected to USB .TP .B mplay MPlay Blast from VLSystem (http://www.vlsys.co.kr), connected to USB .TP .B usblcd LCD device from Adams IT Services (http://www.usblcd.de/) .TP .B bwctusb USB-to-HD44780 converter by BWCT (http://www.bwct.de) .TP .B lcd2usb Till Harbaum's open source/open hardware LCD2USB (http://www.harbaum.org/till/lcd2usb/) .TP .B usbtiny Devices based on Dick Streefland's USBtiny firmware .TP .B uss720 USS-720 USB-to-IEEE 1284 Bridge (Belkin F5U002 USB Parallel Printer Adapters) .TP .B usb4all Sprut's open source / open hardware USB-4-all (http://www.sprut.de/) .TP .B ftdi USB connection via a FTDI FT2232D chip in bitbang mode .TP .B i2c LCD in 4-bit mode driven by PCF8574(A) / PCA9554(A), connected via I2C bus .TP .B piplate Adafruit RGB Positive 16x2 LCD+Keypad for Raspberry Pi .TP .B spi LCD with KS0073 or equivalent in serial mode, connected via SPI bus .TP .B pifacecad PiFace Control and Display for the Raspberry Pi (http://www.piface.org.uk/) .TP .B ethlcd TCP connection using open source/open hardware ethlcd (http://manio.skyboo.net/ethlcd/) .TP .B raspberrypi LCD driven by the GPIO pins of a Raspberry Pi .RE .TP .B i2500vfd 140x32 pixel VFD Display of the Intra2net Intranator 2500 appliance .TP .B icp_a106 ICP A106 alarm/LCD board in 19" rack cases by ICP .TP .B imon iMON IR/VFD modules in cases by Soundgraph/Ahanix/Silverstone/Uneed/Accent .TP .B imonlcd iMON IR/LCD modules in cases by Soundgraph/Ahanix/Silverstone/Uneed/Accent/Antec .TP .B irtrans IRTrans IR/VFD modules in cases by Ahanix (e.g. MCE303) and possibly others May require irserver (http://www.irtrans.de/en/download/linux.php) to be running for connectivity. .TP .B IOWarrior Code Mercenaries IOWarrior .TP .B irman IrMan infrared (input) .TP .B joy Joystick driver (input) .TP .B lb216 LB216 LCD displays .TP .B lcdm001 kernelconcepts.de 20x4 serial LCD displays .TP .B lcterm serial LCD terminal from Helmut Neumark Elektronik (http://www.neumark.de) .TP .B lirc Infrared (input) .TP .B lis L.I.S MCE 2005 20x2 VFD (http://vlsys.co.kr) .TP .B MD8800 VFD displays in Medion MD8800 PCs .TP .B mdm166a Futuba MDM166A displays .TP .B ms6931 MSI-6931 displays in 1U rack servers by MSI .TP .B mtc_s16209x MTC_S16209x LCD displays by Microtips Technology Inc .TP .B MtxOrb Matrix Orbital displays (except Matrix Orbital GLK displays) .TP .B mx5000 LCD display on the Logitech MX5000 keyboard .TP .B NoritakeVFD Noritake VFD Device CU20045SCPB-T28A .TP .B rawserial Dumps the entire framebuffer to the serial port at a configurable rate. .TP .B picolcd Mini-box.com USB LCD (PicoLCD 20x4 & picoLCD 20x2) .TP .B pyramid LCD displays from Pyramid (http://www.pyramid.de) .TP .B sdeclcd Watchguard Firebox LCD display based on SDEC LMC-S2D20 (http://www.sdec.com.tw) .TP .B sed1330 SED1330/SED1335 (aka S1D13300/S1D13305) based graphical displays .TP .B sed1520 122x32 pixel graphic displays based on SED1520 controllers .TP .B serialPOS Driver for Point Of Sale ("POS") devices using various protocols (currently AEDEX only) .TP .B serialVFD Text VFDs of various manufacturers, see LCDproc user-documentation for further details. .TP .B shuttleVFD Shuttle VFD (USB-based) .TP .B sli Wirz SLI driver (unknown) .TP .B stv5730 STV5730A on-screen display chip .TP .B SureElec LCD devices from SURE electronics (http://www.sureelectronics.net) .TP .B svga VGA monitors using svgalib .TP .B t6963 Toshiba T6963 based LCD displays (text mode) .TP .B text Standard "hard-copy" text display .TP .B tyan LCD module in Tyan Barebone GS series .TP .B ula200 ULA-200 device from ELV (http://www.elv.de) .TP .B vlsys_m428 VFD/IR combination in case MonCaso 320 from Moneual .TP .B xosd On Screen Display on X11 .PP Multiple drivers can be used simultaneously; thus, for example, a Matrix Orbital display (MtxOrb driver) can be combined with an infrared driver (irmanin driver). .SH INVOCATION .RS .I LCDd -d MtxOrb -d joy .RE The invocation example above will start \fBLCDd\fP reading its configuration from the default configuration file \fI@SYSCONFDIR@/LCDd.conf\fP but overriding the drivers specified therein with the Matrix Orbital driver and the Joystick input driver. .SH LCDPROC CLIENT-SERVER PROTOCOL There is a basic sequence: .TP 1. Open a TCP connection to the LCDd server port (usually 13666). .TP 2. Say "hello" .TP 3. The server will return some information on the type of display available. .TP 4. Define (and use) a new screen and its widgets. .TP 5. Close the socket when done displaying data. .PP .SS CLIENT COMMANDS There are many commands for the client to send to the LCDd server: .TP .B hello This starts a client-server session with the LCDd server; the server will return a data string detailing the type of display and its size. .TP .B client_set -name \fIname\fP Set the client's name. .TP .B screen_add \fI#id\fP Add a new screen to the display. .TP .B screen_del \fI#id\fP Remove a screen from the display. .TP .B screen_set \fI#id\fP [\fB-name\fI "name"\fP] [\fB-wid\fI width\fP] [\fB-hgt\fI height\fP] [\fB-priority\fI prio\fP] [\fB-duration\fI int\fP] [\fB-timeout\fI int\fP] [\fB-heartbeat\fI mode\fP] [\fB-backlight\fI mode\fP] [\fB-cursor\fI mode\fP] [\fB-cursor_x\fI xpos\fP] [\fB-cursor_y\fI ypos\fP] Initialize a screen, or reset its data. .TP .B widget_add \fI#screen #id type\fR [\fB-in \fI#frame\fR] Add a widget of type \fItype\fP to screen \fI#screen\fR. .TP .B widget_del \fI#screen #id\fR Delete widget \fI#id\fR from screen \fI#screen\fR. .TP .B widget_set \fI#screen #id data\fR Set the data used to define a particular widget \fI#id\fR on screen \fI#screen\fR. .SS HEARTBEAT MODES Valid heartbeat mode values (for the \fBscreen_set\fR command) are: .TP .B on Display pulsing heart symbol. .TP .B off No heartbeat display. .TP .B open Use client's heartbeat setting. This is the default. .SS BACKLIGHT MODES Valid heartbeat mode values (for the \fBscreen_set\fR command) are: .TP .B on Turn backlight on. .TP .B off Turn backlight off .TP .B toggle Turn backlight off when it is on and vice versa. .TP .B open Use client's backlight setting. This is the default. .TP .B blink Blinking backlight .TP .B flash Flashing blacklight .SS Priorities Valid priority settings (used in the \fBscreen_set\fR command) are as follows: .TP .B input The client is doing interactive input. .TP .B alert The screen has an important message for the user. .TP .B foreground an active client .TP .B info Normal info screen, default priority. .TP .B background The screen is only visible when no normal info screens exists. .TP .B hidden The screen will never be visible. .PP For compatibility with older versions of clients a mapping of numeric priority values is also supported: .TP .B 1 - 64 foreground .TP .B 65 - 192 normal .TP .B 193 - (infinity) background .PP An example of how to properly use priorities is as follows: .PP Imagine you're making an mp3 player for lcdproc. When the song changes, it's nice to display the new name immediately. So, you could set your screen's priority to \fBforeground\fP, wait for the server to display (or ignore) your screen, then set the screen back to \fBnormal\fP. This would cause the mp3 screen to show up as soon as the one on screen was finished, then return to normal priority afterward. .PP Or, let's say your client monitors the health of hospital patients. If one of the patients has a heart attack, you could set the screen priority to \fBalert\fP, and it would be displayed immediately. It wouldn't even wait for the previous screen to finish. Also, the display would stay on screen most of the time until the user did something about it. .SS WIDGET TYPES Widgets can be any of the following: .TP .B string A text string to display (as is). .TP .B hbar A horizontal bar graph. .TP .B vbar A vertical bar graph. .TP .B title A title displayed across the top of the display, within a banner. .TP .B icon A graphic icon. .TP .B scroller A scrolling text display, scrolling either horizontally or vertically. .TP .B frame A \fIcontainer\fR to contain other widgets, permitting them to be refered to as a single unit. A widget is put inside a frame by using the \-in \fI#id\fR parameter, where \fI#id\fR refers to the id of the frame. .TP .B num Displays a large decimal digit .PP Widgets are drawn on the screen in the order they are created. .SS SETTING WIDGET DATA In the \fBwidget_set\fR command, the \fIdata\fR argument depends on which widget is being set. Each widget takes a particular set of arguments which defines its form and behavior: .TP .B string \fIx y text\fP Displays \fItext\fP at position (\fIx\fP,\fIy\fP). .TP .B title \fItext Uses \fItext\fP as title to display. .TP .B hbar \fIx y length\fP Displays a horizontal bar starting at position (\fIx\fP,\fIy\fP) that is \fIlength\fP pixels wide. .TP .B vbar \fIx y length\fP Displays a vertical bar starting at position (\fIx\fP,\fIy\fP) that is \fIlength\fP pixels high. .TP .B icon \fIx y name\fP Displays the icon \fIname\fP at position (\fIx\fP,\fIy\fP). .TP .B scroller \fIleft top right bottom direction speed text\fP The \fItext\fR defined will scroll in the direction defined. Valid directions are \fBh\fR (horizontal) and \fBv\fR (vertical). The speed defines how many "movements" (or changes) will occur per frame. A positive number indicates frames per movement; a negative number indicates movements per frame. .TP .B frame \fIleft top right bottom wid hgt dir speed\fP Frames define a visible "box" on screen, from the (\fIleft\fR, \fItop\fR) corner to the (\fIright\fR, \fIbottom\fR) corner. The actual data may be bigger, and is defined as \fIwid\fR (width) by \fIhgt\fR (height); if it is bigger, then the frame will scroll in the direction (\fIdir\fR) and \fIspeed\fR defined. .TP .B num \fIx int\fP Displays large decimal digit \fIint\fP at the horizontal position \fIx\fP, which is a normal character x coordinate on the display. The special value 10 for \fIint\fP displays a colon. .SH BUGS If \fBLCDd\fP seems not to work as expected, try to run it in the foreground with reporting level set to maximum and reporting to stderr. This can be achieved without changes to the config file by using the command line: .RS .I LCDd -f -r 5 -s 0 .RE .SH FILES \fB@SYSCONFDIR@/LCDd.conf\fR, LCDd's default configuration file .SH SEE ALSO lcdproc-config(5), lcdproc(1), lcdexec(1) .SH AUTHOR Many people have contributed to LCDd. See the \fICREDITS\fP file for more details. .PP All questions should be sent to the lcdproc mailing list. The mailing list, and the newest version of LCDproc, should be available from here: .PP http://www.lcdproc.org/ .SH LEGAL STUFF The lcdproc package is released as "WorksForMe-Ware". In other words, it is free, kinda neat, and we don't guarantee that it will do anything in particular on any machine except the ones it was developed on. .PP It is technically released under the GNU GPL license (you should have received the file, "COPYING", with LCDproc) (also, look on http://www.fsf.org/ for more information), so you can distribute and use it for free -- but you must make the source code freely available to anyone who wants it. .PP For any sort of real legal information, read the GNU GPL (GNU General Public License). It's worth reading. lcdproc-0.5.7/docs/lcdproc-config.5.in000644 001751 000000 00000007450 10510750302 020265 0ustar00mmdolzewheel000000 000000 .TH lcdproc-config 5 "18 September 2006" LCDproc "LCDproc suite" .SH NAME lcdproc-config - format of LCDproc's configuration files .SH SYNTAX The syntax for LCDproc's configuration files is INI-file style. .PP They are 8-bit text files divided into sections, each containing zero or more key-value pairs. Sections are introduced by section labels which start with '\fB[\fP' and end with '\fB]\fP', and key-value pairs consist of a key name, a '\fB=\fP' sign and a value each. .PP Key names are sequences of non-space characters, not starting with '\fB[\fP' and not containing '\fB=\fP' or '\fB\\n\fP', while values are shell like strings. I.e. they are either simple sequences of non-space characters, or double quoted-strings with C-style syntax (except the missing support for '\\NNN' and '\\xNN' escape sequences) or or a mix of both of these forms. .PP Section labels and key names are case-insensitive and may occur more than once. Keys of duplicate sections will be merged into one section, while the values of duplicate keys in a section will be appended to form an array of values for this key. (In the program, all values of a key can be retrieved individually) .PP Spaces around section labels, keys, and values are ignored. Lines starting with '\fB;\fP' or '\fB#\fP' are considered comments and ignored too. .PP While all of the above is quite common to almost all INI-file implementations, there are a few special features that make LCDproc's config files special: .IP * Section labels may contain any character except '\fB]\fP', '\fB\\n\fP' or '\fB\\0\fP'. However, all characters are interpreted literally (i.e. neither quoting, nor escaping done). .IP * Key names may contain any non-space character except '\fB\\n\fP' or '\fB\\0\fP'. However, all characters are interpreted literally (i.e. neither quoting, nor escaping done). .IP * Comments are allowed after section labels and key value pairs .IP * Values may be a mix of quoted and unquoted strings similar as strings are interpreted in the shell. E.g. the value \fR'string" with "blanks"\\t!"'\fP will be parsed as \fR'string with blanks!'\fP where stands for the TAB character. .PP In case of a a parsing error the rest of the line is ignored and parsing continues with the next line. .SH EXAMPLE Here is fully working example of an LCDd.conf (formatted somewhat strange to show the features): .na .nf # the server section [server] Bind=127.0.0.1 Port=13666 User="nobody" #Foreground=no #ReportLevel=3 #ReportToSyslog=yes Driver="my Curses Driver" DriverPath=/usr/lib/lcdproc/ WaitTime= "5" ServerScreen=no # assign keys to special functions # ToggleRotateKey = Enter PrevScreenKey = Left NextScreenKey = Right # ScrollUpKey = Up #ScrollDownKey=Down # menu section: define keys to use in the server menu # [menu] MenuKey = Escape # ESC switches to server menu EnterKey =Enter UpKey= Up DownKey="Down" LeftKey= "Left" RightKey = "Right" # configuration of the curses driver # [my curses Driver] # yes I use the curse driver File= "curses.so" Size="20"x"4" # LCD screen dimensions TopLeftX=7 # screen position: X coordinate TopLeftY=7 # screen position: Y coordinate Foreground=blue # foreground color Background=cyan # background color when backight is off Backlight=red # background color when backight is on .SH FILES These are the default config files for the various parts of the LCDproc suite: .TP .B @SYSCONFDIR@/LCDd.conf configuration of the \fILCDd\fP server daemon .TP .B @SYSCONFDIR@/lcdproc.conf configuration of the \fIlcdproc\fP system monitoring client .TP .B @SYSCONFDIR@/lcdexec.conf configuration of the \fIlcdexec\fP the program starter client .TP .B @SYSCONFDIR@/lcdvc.conf configuration of the \fIlcdvc\fP virtual console client .SH SEE ALSO LCDd(8), lcdproc(1), lcdexec(1) .SH AUTHOR This manual page has been written by Peter Marschall lcdproc-0.5.7/docs/doxy-mainpage.md000644 001751 000000 00000000423 12313532717 017771 0ustar00mmdolzewheel000000 000000 The LCDproc source code documentation {#mainpage} ===================================== This is the LCDproc source code documentation. It is generated from comments in the source code files. Visit the LCDproc homepage at http://www.lcdproc.org/. lcdproc-0.5.7/docs/lcdproc-user/000755 001751 000000 00000000000 12330423234 017300 5ustar00mmdolzewheel000000 000000 lcdproc-0.5.7/docs/lcdproc-dev/000755 001751 000000 00000000000 12330423234 017100 5ustar00mmdolzewheel000000 000000 lcdproc-0.5.7/docs/lcdproc-dev/Makefile.am000644 001751 000000 00000002332 11621737633 021151 0ustar00mmdolzewheel000000 000000 ## Process this file with automake to produce Makefile.in EXTRA_DIST = add-your-driver.docbook \ bookinfo.docbook \ driver-api.docbook \ introduction.docbook \ language.docbook \ lcdproc-dev.css \ lcdproc-dev.docbook \ license.docbook \ make-driver.docbook \ programming.docbook \ README.docbook \ releasing.docbook \ shared-files.docbook ## convenience targets developerguidedir ?= $(DESTDIR)$(htmldir)/developer-guide/ docreleasedir = lcdproc-$(PACKAGE_VERSION)-dev-html .PHONY: install-html-developerguide doc-release doc-online install-html-developerguide: lcdproc-dev.docbook lcdproc-dev.css $(mkinstalldirs) $(developerguidedir) $(XMLTO) html -o $(developerguidedir) \ --stringparam html.stylesheet=lcdproc-dev.css lcdproc-dev.docbook cp lcdproc-dev.css $(developerguidedir) doc-release: lcdproc-dev.docbook lcdproc-dev.css $(XMLTO) html -o $(docreleasedir) \ --stringparam html.stylesheet=lcdproc-dev.css lcdproc-dev.docbook cp lcdproc-dev.css $(docreleasedir) $(AMTAR) -czf $(docreleasedir).tar.gz $(docreleasedir) doc-online: lcdproc-dev.docbook $(XMLTO) html-nochunks \ --stringparam html.stylesheet=lcdproc-dev.css lcdproc-dev.docbook && \ mv lcdproc-dev.html current-dev.html ## EOF lcdproc-0.5.7/docs/lcdproc-dev/add-your-driver.docbook000644 001751 000000 00000032055 12014174063 023466 0ustar00mmdolzewheel000000 000000 Adding your driver to LCDproc Introduction LCDproc is meant to be modular, it is relatively easy to add new input and output drivers to LCDproc. This chapter will explain you the major steps and few gotchas of adding your own driver to LCDproc. Enjoy! Be sure to read and as well. As a starting point you may take a look at the debug driver. It is available as server/drivers/debug.c. Rules for accepting new drivers LCDproc is open source software. Anyone is free to take LCDproc's code, write his own driver and publish the modified sources somewhere again. If you want your driver to be included in LCDproc's code some conditions have to be met: The hardware (display or enclosing product) is publicly sold OR the schematics and firmware (if required) are publicly available. Therefore I will not commit drivers for displays ripped out from an old telephone for your private hardware project and are not available otherwise. The driver is released under (L)GPL and has an appropriate copyright notice. The submitter is or is acting on behalf of the original driver developer. I will not submit drivers found somewhere on the internet and submitted without the original developer's written acknowledgement. The driver description contains a valid email address for contacting the submitter or developer. The code is commented AND includes appropriate Doxygen comments, especially for internal / non-API functions. End user documentation (updates to man pages AND User's Guide in Docbook format) is available. Driver options are described in the end user documentation AND LCDd.conf. The driver adheres to the style guide as described in . Autoconf, automake, and Everything! How I Learned to Stop Worrying and Love the Configure Script It was decided pretty early in LCDproc's life to use GNU autoconf and GNU automake. This allows LCDproc to be ported to several platforms with much less effort. It can be quite daunting to understand how autoconf & automake interact with each others and with your code, but don't be discouraged. We have taken great care in making this as simple as possible for programmers to add their own driver to LCDproc. Hopefully, you'll only have to modify two files, one for autoconf and one for automake. The first thing you need to do is to find a name for your driver, it should be as descriptive as possible; most drivers are named after their respective chipset, for example hd44780, mtc_s16209x, sed1330 and stv5730, others are named after the company that makes that particular LCD display, for example CFontz and MtxOrb. Remember that these names are case sensitive. In this chapter, we'll use myDriver (which is an absolute non-descriptive name). Autoconf and its friend, acinclude.m4 You need to add your driver to function LCD_DRIVERS_SELECT of file acinclude.m4. This can be done in three steps. Step 1 First you need to add your driver name to the list of possible choices in the help screen. This: AC_ARG_ENABLE(drivers, [ --enable-drivers=<list> compile driver for LCDs in <list>.] [ drivers may be separated with commas.] [ Possible choices are:] [ bayrad,CFontz,CFontz633,CFontzPacket,curses,CwLnx,] [ glcdlib,glk,hd44780,icp_a106,imon,IOWarrior,irman,] [ joy,lb216,lcdm001,lcterm,lirc,ms6931,mtc_s16209x,] [ MtxOrb,NoritakeVFD,pyramid,sed1330,sed1520,serialVFD,] [ sli,stv5730,svga,t6963,text,tyan,ula200,xosd] [ 'all' compiles all drivers;] [ 'all,!xxx,!yyy' de-selects previously selected drivers], drivers="$enableval", becomes: AC_ARG_ENABLE(drivers, [ --enable-drivers=<list> compile driver for LCDs in <list>.] [ drivers may be separated with commas.] [ Possible choices are:] [ bayrad,CFontz,CFontz633,CFontzPacket,curses,CwLnx,] [ glcdlib,glk,hd44780,icp_a106,imon,IOWarrior,irman,] [ joy,lb216,lcdm001,lcterm,lirc,ms6931,mtc_s16209x,] [ MtxOrb,NoritakeVFD,pyramid,sed1330,sed1520,serialVFD,] [ sli,stv5730,svga,t6963,text,tyan,ula200,xosd,myDriver] [ 'all' compiles all drivers;] [ 'all,!xxx,!yyy' de-selects previously selected drivers], drivers="$enableval", Step 2 Second, you need to add your driver to the list of all drivers. This: allDrivers=[bayrad,CFontz,CFontz633,...(big list)...,tyan,ula200,xosd] becomes: allDrivers=[bayrad,CFontz,CFontz633,...(big list)...,tyan,ula200,xosd,myDriver] Step 3 Then last, you need to add your driver to be big switch-case in this function, see below. myDriver) DRIVERS="$DRIVERS myDriver${SO}" actdrivers=["$actdrivers myDriver"] ;; If your driver only works in some platform or requires a particular library or header, you can add your autoconf test here. You can see how other drivers do it, but if you're not sure on how to do this, just send an email to the mailing list and we'll make it for you. Automake and its friend, Makefile.am Already half of the job is done! Not to bad, wasn't it? The rest should be just as easy. In this section, you'll be adding your driver to the file server/drivers/Makefile.am. As you can guess, it's the Makefile for the drivers. This can be done in three (or two) simple steps. Step 1 First, you need to add your driver to the list of drivers in this file, this list is called EXTRA_PROGRAMS. This EXTRA_PROGRAMS = bayrad CFontz ...(big list)... ula200 xosd becomes EXTRA_PROGRAMS = bayrad CFontz ...(big list)... ula200 xosd myDriver Step 2 This second step is only needed if your driver needs a particular library. If it doesn't, you can skip to step 3. You basically need to put you driver name followed by _LDADD and equal this to the name of the library that you need. Usually, these library are substituted by a autoconf variable, if you're not comfortable with this, you send an email to the mailing list and we'll set this up for you. For example, we would put this for our fictional driver myDriver_LDADD = @SOMESTRANGELIB@ Step 3 Last but not least, you need to specify which source files should be associated with your driver. You put your driver name followed by _SOURCES and equal this to a space separated list of the source and header files. See below for an example. myDriver_SOURCES = lcd.h myDriver.c myDriver.h report.h Test your setup You're almost done! You only need to check out if you didn't made any mistake. Just run sh autogen.sh to regenerate the configure script and Makefiles, then run ./configure --enable-drivers=myDriver and type make. If your driver compiles without error, then congratulations, you've just added your driver to LCDproc! Remember to submit a patch to the mailing list so that we can add it to the standard distribution, but do not forget the documentation. If you had an error, just send us an email describing it to the mailing list and we'll try to help you. It's all about documentation Please do not forget to also add the required documentation, so that your driver can be used from others as well. Within the source code We use Doxygen to document functions and data types. The doxygen documentation can be created anytime by changing to the docs/ directory and running doxygen. When documenting your driver's API functions you may use a short hand version and add 'API:' to the beginning of your comment and leave out the parameter and return value description (as we know what the API is doing). If you use some clever algorithm inside a function please add a few words about it. Always document functions internal to the driver! We do know what the API does (or is expected to do) but we don't know about what your driver does internally. Read on how for format comments. The configuration file, LCDd.conf Extend the LCDproc server's configuration file with a section that holds a standard configuration for your driver together with short descriptions of the options used. ## MyDriver for MyDevice ## [MyDriver] # Select the output device to use [default: /dev/lcd] Device=/dev/ttyS0 # Set the display size [default: 20x4] Size=20x4 The daemon's manual page, LCDd.8 Append your driver to the list of drivers in docs/LCDd.8.in, the manual page of LCD, so that users can find your driver when doing man LCDd. … .TP .B ms6931 MSI-6931 displays in 1U rack servers by MSI .TP .B mtc_s16209x MTC_S16209x LCD displays by Microtips Technology Inc .TP .B MtxOrb Matrix Orbital displays (except Matrix Orbital GLK displays) .TP .B MyDriver displays connected using MyDevice .TP .B NoritakeVFD Noritake VFD Device CU20045SCPB-T28A .TP .B pyramid LCD displays from Pyramid (http://www.pyramid.de) .TP .B sed1330 SED1330/SED1335 (aka S1D13300/S1D13305) based graphical displays … The user guide Step 1 Please add a file myDriver.docbook, that describes the configuration of your driver and the hard/software needed, to the directory docs/lcdproc-user/drivers/. Step 2 Define a Docbook entity for your driver file in lcdproc-user.docbook. … <!ENTITY ms6931 SYSTEM "drivers/ms6931.docbook"> <!ENTITY mtc_s16209x SYSTEM "drivers/mtc_s16209x.docbook"> <!ENTITY MtxOrb SYSTEM "drivers/mtxorb.docbook"> <!ENTITY MyDriver SYSTEM "drivers/MyDriver.docbook"> <!ENTITY NoritakeVFD SYSTEM "drivers/NoritakeVFD.docbook"> <!ENTITY pylcd SYSTEM "drivers/pylcd.docbook"> <!ENTITY sed1330 SYSTEM "drivers/sed1330.docbook"> … Step 3 Add the freshly defined entity to drivers.docbook to include the documentation of your driver into the LCDproc User's Guide. … &ms6931; &mtc_s16209x; &MtxOrb; &MyDriver; &NoritakeVFD; &pylcd; &sed1330; … Step 4 Add the newly defined file myDriver.docbook to the Makefile in the directory docs/lcdproc-user/drivers/. ## Process this file with automake to produce Makefile.in EXTRA_DIST = bayrad.docbook \ CFontz.docbook \ ... MyDriver.docbook \ ... ## EOF lcdproc-0.5.7/docs/lcdproc-dev/bookinfo.docbook000644 001751 000000 00000002574 12313535265 022271 0ustar00mmdolzewheel000000 000000 LCDproc Developer's Guide The Hitchhiker's Guide to LCDproc 0.5.7 Markus Dolze Peter Marschall Guillaume Filion 2014-03-23 0.5.7 This document is a guide to LCDproc written for developers. It covers LCDproc 0.5.7. Users should read the user guide. 2012 Markus Dolze 2006 Peter Marschall 2002 Guillaume Filion Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". documentation LCDproc 0.5.7 developer guide lcdproc-0.5.7/docs/lcdproc-dev/driver-api.docbook000644 001751 000000 00000054340 12313535265 022523 0ustar00mmdolzewheel000000 000000 The LCDproc driver API This chapter describes the driver API of v0.5.7 of LCDproc. Overview of Operation The API defines functions which drivers may implement to provide certain services. If a driver implements a function, the function will be detected by the server. For some optional functions the server core provides default implementations. The API consists of functions to: print data to the display, set display properties (backlight, brightness, contrast, extra LEDs), read input from an input device (may be the display), and inform the server of the driver/display capabilities. The API is best described by starting with the struct lcd_logical_driver which is defined in server/drivers/lcd.h. Below is a commented version of lcd_logical_driver. Each function is described more detailed in . typedef struct lcd_logical_driver { //////// Variables to be provided by the driver module // The driver loader will look for symbols with these names ! // pointer to a string describing the API version char *api_version; // Does this driver require to be in foreground ? int *stay_in_foreground; / Does this driver support multiple instances ? int *supports_multiple; // What should alternatively be prepended to the function names ? char **symbol_prefix; //////// Functions to be provided by the driver module //// Mandatory functions (necessary for all drivers) // initialize driver: returns >= 0 on success int (*init) (Driver *drvthis); // close driver void (*close) (Driver *drvthis); //// Essential output functions (necessary for output drivers) // get display width / height (in characters; 1-based) int (*width) (Driver *drvthis); int (*height) (Driver *drvthis); // clear screen void (*clear) (Driver *drvthis); // flush screen contents to LCD void (*flush) (Driver *drvthis); // write string s at position (x,y) void (*string) (Driver *drvthis, int x, int y, const char *str); // write char c at position (x,y) void (*chr) (Driver *drvthis, int x, int y, char c); //// essential input functions (necessary for input drivers) // get key from driver: returns a string denoting the key pressed const char *(*get_key) (Driver *drvthis); //// Extended output functions (optional; core provides alternatives) // draw a bar from pos (x,y) upward / to the right filling promille of len chars void (*vbar) (Driver *drvthis, int x, int y, int len, int promille, int options); void (*hbar) (Driver *drvthis, int x, int y, int len, int promille, int options); // display (big) number num at horizontal position x void (*num) (Driver *drvthis, int x, int num); // set heartbeat state; animate heartbeat void (*heartbeat) (Driver *drvthis, int state); // draw named icon at position (x,y) int (*icon) (Driver *drvthis, int x, int y, int icon); // set cursor type and move it to position (x,y) void (*cursor) (Driver *drvthis, int x, int y, int type); //// User-defined character functions // set special character / get free characters // - It is currently unclear how this system should work exactly // - The set_char function expects a simple block of data with 1 byte for each pixel-line. // (So that is 8 bytes for a 5x8 char) void (*set_char) (Driver *drvthis, int n, unsigned char *dat); int (*get_free_chars) (Driver *drvthis); // get width / height of a character cell (in pixels) // - necessary to provide info about cell size to clients // - if not defined, the core will provide alternatives returning default values int (*cellwidth) (Driver *drvthis); int (*cellheight) (Driver *drvthis); //// Hardware functions // get / set the display's contrast int (*get_contrast) (Driver *drvthis); void (*set_contrast) (Driver *drvthis, int promille); // get / set brightness for given backlight state int (*get_brightness) (Driver *drvthis, int state); void (*set_brightness) (Driver *drvthis, int state, int promille); // set backlight state void (*backlight) (Driver *drvthis, int state); // set output void (*output) (Driver *drvthis, int state); //// Informational functions // get a string describing the driver and it's features const char * (*get_info) (Driver *drvthis); //////// Variables in server core, available for drivers // name of the driver instance (name of the config file section) // - do not change from the driver; consider it read-only // - to be used to access the driver's own section in the config file char * name; // pointer to the driver instance's private data // - filled by the server by calling store_private_ptr() // - the driver should cast this to it's own private structure pointer void * private_data; //////// Functions in server core, available for drivers // store a pointer to the driver instance's private data int (*store_private_ptr) (struct lcd_logical_driver * driver, void * private_data); // Config file functions, cwprovided by the server // - see configfile.h on how to use these functions // - as sectionname, always use the driver name: drvthis->name short (*config_get_bool) (char * sectionname, char * keyname, int skip, short default_value); long int (*config_get_int) (char * sectionname, char * keyname, int skip, long int default_value); double (*config_get_float) (char * sectionname, char * keyname, int skip, double default_value); const char *(*config_get_string) (char * sectionname, char * keyname, int skip, const char * default_value); // Returns a string in server memory space. // Copy this string. int config_has_section (const char *sectionname); int config_has_key (const char *sectionname, const char *keyname); // error reporting function // - see drivers/report.h for details void (*report) ( const int level, const char *format, .../*args*/ ); // Display properties functions (for drivers that adapt to other loaded drivers) // - the return the size of another already loaded driver // - if no driver is loaded yet, the return values will be 0 int (*get_display_width) (); int (*get_display_height) (); } Driver; Private Data With the introduction of loadable modules it is necessary to stop using global variables to store a driver's data in. Instead, you should store it in a structure, that you allocate and store on driver's init. If you don't use this system, but use globals, you get queer results if you run two LCDd daemons on one machine. They will then use the same variables ! In the driver's private structure will probably at least be something like: typedef struct MyDriver_private_data { int fd; // file descriptor for the LCD device int width, height; // dimension of the LCD (in characters, 1-based int cellwidth, cellheight; // Size of each LCD cell, in pixels unsigned char *framebuf; // Frame buffer... } PrivateData; You allocate and store this structure like this: PrivateData *p; // Allocate and store private data p = (PrivateData *) malloc(sizeof(PrivateData)); if (p == NULL) return -1; if (drvthis->store_private_ptr( drvthis, p ) < 0) return -1; // initialize private data p->fd = -1; p->cellheight = 8; p->cellwidth = 6; (... continue with the rest of your init routine) You retrieve this private data pointer by adding the following code to the beginning of your functions: PrivateData *p = (PrivateData *) drvthis->private_data; Then you can access your data like: p->framebuf Functions in Detail int (*init) Driver *drvthis The init() function. It starts up the LCD, initializes all variables, allocates private data space and stores the pointer by calling store_private_ptr(); Returns <0 on error. void (*close) Driver *drvthis Shut down the connection with the LCD. Called just before unloading the driver. int (*width) Driver *drvthis Get the screen width in characters. The result is 1-based. int (*height) Driver *drvthis Get the screen height in character lines. The result is 1-based. void (*clear) Driver *drvthis Clear the framebuffer. void (*flush) Driver *drvthis Flush the framebuffer to the LCD. void (*string) Driver *drvthis int x int y const char *str Place string str into position (x,y) in the framebuffer. All coordinates are 1-based, i.e. (1,1) is top left. The driver should check for overflows, i.e. that the positional parameters are within the screen's boundaries and cut off the part of the string that is out of bounds. void (*chr) Driver *drvthis int x int y char c Place a single character c into position (x,y) in the framebuffer. The driver should check for overflows, i.e. that the positional parameters are within the screen's boundaries and ignore the request if the character is out of bounds. void (*vbar) Driver *drvthis int x int y int len int promille int options Draw a vertical bar at position (x,y) that has maximal length len, where a fraction of (promille / 1000) is filled. void (*hbar) Driver *drvthis int x int y int len int promille int options Draw a horizontal bar at position (x,y) that has maximal length len, where a fraction of (promille / 1000) is filled. void (*num) Driver *drvthis int x int num Display big number num at horizontal position x. void (*heartbeat) Driver *drvthis int state Sets the heartbeat to the indicated state: 0=off, 1=on. Use HEARTBEAT_ON to say that we want to display/refresh the heartbeat. The driver choose how to do it. int (*icon) Driver *drvthis int x int y int icon Draw named icon icon at position (x,y). If the driver returns -1 the server core will draw an appropriate replacement character. void (*cursor) Driver *drvthis int x int y int type Move cursor to position (x,y), setting its type to type. void (*set_char) Driver *drvthis char ch unsigned char *dat The set_char function expects a simple block of data with 1 byte for each pixel-line. (So that is 8 bytes for a 5x8 char) int (*get_free_chars) Driver *drvthis Get total number of custom characters available. int (*cellwidth) Driver *drvthis Return the width of a character cell in pixels. The result is 1-based. int (*cellheight) Driver *drvthis Return the height of a character cell in pixels. The result is 1-based. int (*get_contrast) Driver *drvthis Get the contrast value from the driver. The return value is an integer in the range from 0 to 1000. Many displays do not support getting or setting contrast using software. int (*set_contrast) Driver *drvthis int promille Sets the contrast to the given value, which is an integer in the range from 0 to 1000. It is up to the driver to map the logical interval [0, 1000] into the interval that the hardware supports. Many displays do not support software setting of contrast. int (*get_brightness) Driver *drvthis int state Get the brightness value from the driver for the given backlight state. The parameter state determines which one is returned. The return value is an integer in the range from 0 to 1000. Many displays do not support getting or setting brightness using software. int (*set_brightness) Driver *drvthis int state int promille Set the brightness for the given backlight state to the value given. Value must be an integer in the range from 0 to 1000. It is up to the driver to map the logical interval [0, 1000] into the interval that the hardware supports. Many displays do not support software setting of brightness. void (*backlight) Driver *drvthis int state Sets the backlight to the given brightness state. Often hardware can only support two values for the backlight: on and off. In that case any value of state > 0 will switch the backlight on. void (*output) Driver *drvthis int state Sets the output value. Some displays/wirings have a general purpose output, which can be controlled by calling this function. See the 'output' command in the 'widget language'. const char *(*get_key) Driver *drvthis Checks if a key has been pressed on the device. Returns NULL for "no key pressed", or a string describing the pressed key. These characters should match the keypad-layout. const char *(*get_info) Driver *drvthis Returns a string describing the driver and its features. short (*config_get_bool) char *sectionname char *keyname int skip short default_value Call to server. Retrieve a bool from the config file. Sectionname should be the name of the driver (as in the struct). If the key cannot be found, the default value will be returned. skip should be 0 usually, but if you want to retrieve multiple identical keys, then increase skip to get every next value. long int (*config_get_int) char *sectionname char *keyname int skip long int default_value Call to server. Retrieve an integer from the config file. double (*config_get_float) char *sectionname char *keyname int skip double default_value Call to server. Retrieve a float from the config file. const char *(*config_get_string) char *sectionname char *keyname int skip const char *default Call to server. Retrieve a string from the config file. Fill result with a pointer to some available space. You can fill it with a default value. If the key is found, it will be overwritten with the value from the key. Note that you should always first copy the the returned string. It is in the address space of the server, and will be freed at the next call. int config_has_section const char *sectionname Returns whether a section exists. Does not need to be called prior to a call to a config_get_* function. int config_has_key const char *sectionname const char *keyname Returns the number of times a key exists. Does not need to be called prior to a call to a config_get_* function. First version, Joris Robijn, 20011016 Corrected and expanded, Peter Marschall 20060411 Sync'd with lcd.h, Markus Dolze, 20090322 lcdproc-0.5.7/docs/lcdproc-dev/introduction.docbook000644 001751 000000 00000002063 12313535265 023175 0ustar00mmdolzewheel000000 000000 Introduction About this Document This document is meant to be a reference for LCDproc developers. It tries to indicate you where to find the relevant information about LCDproc's inner workings. Please note that this document is still "under construction". If you run into any trouble feel free to write to the LCDproc mailing list. See http://lcdproc.org/mail.php3 for details on how to subscribe to the list. Therefore you might want to have a look at , to get the latest version of this document, unless you want to generate it yourself from the docbook files in the CVS). This document was written for LCDproc 0.5.7. In several other places e-mails and other documents have been included in this document. The authors of those are listed below every such document. lcdproc-0.5.7/docs/lcdproc-dev/language.docbook000644 001751 000000 00000142373 12035322144 022237 0ustar00mmdolzewheel000000 000000 The LCDproc client language Introduction The LCDproc clients, for example lcdproc, connect over the network to LCDd. In their communication they use a protocol, often referred to as the "widget language". In this chapter the widget language will be discussed. Opening a session The essence of talking to LCDd is quite simple. First you will need to connect to the LCDproc port (usually 13666) on the correct IP address (by default localhost). Once you have established the connection you should say "hello", to let LCDd know you are a good guy. It will respond by telling some LCDproc data, like version and screen width and height. Now your session is open and you can start sending 'real' commands. LCDd can send a number of strings itself. As a response to your commands, it will usually send a "success" string, or a string starting with "huh" in case of any error. See further below for other strings sent by LCDd. You can test all these commands by opening a TCP/IP connection manually, like with: telnet localhost 13666 This way, you can check how the various commands work. It's in this case best to have no other clients. If you do have other clients, you will receive "listen" and "ignore" messages that will disturb your typing. Command reference In this section all commands and their parameters are listed, along with the responses you can expect. If you need a space or a special char in a string, you should quote the string with double quotes. If you need to use a double quote, escape it with a backslash. The listing is divided into subsections for Basic stuff Screens and widgets Menu stuff Miscellaneous Basic stuff hello Opens the session with the LCDd server program. This command is required before other commands can be issued. The response will be a string in the format: connect parameter... The client should read all parameters it needs and store their values. The following parameters are in use: LCDproc version Indicates the version number of LCDd. protocol version Indicates the widget language version number. This number is only changed when the language of a newer version has become incompatible with the previous version. Each part of the version number shall be treated as an independent numeric value. This means that 0.9 is followed by 0.10. lcd This word introduces the next key / value pairs that describe the display's properties. wid int Tells the client the width of the attached display device in characters. hgt int Tells the client the height of the attached display device in characters. cellwid int How many pixels is a character wide (space between character cells not included) cellhgt int How many pixels is a character high (space between character cells not included) client_set Sets attributes for the current client. The current client is the one from the connection that you send this command on, in other words: yourself. name is the client's name as visible to a user. Screens and widgets screen_add Adds a screen to be displayed. The screen will be identified by the string new_screen_id, which is used later when manipulating on the screen. screen_del Removes the screen identified by screen_id from the client's screens. screen_set Sets attributes for the given screen. The following attributes exist: Sets the screen's name as visible to a user. Sets the size of the screen in characters. If unset, the full display size is assumed. Sets the screen's priority. The following priority classes exist: hidden The screen will never be visible background The screen is only visible when no normal info screens exists info normal info screen, default priority foreground an active client alert The screen has an important message for the user. input The client is doing interactive input. int a positive integer that maps to priority classes above according to the mapping given in the table below. range priority 1 - 64 foreground 65 - 192 info 193 - ∞ background LCDd will only show screens with the highest priority at that moment. So when there are three info screens and one foreground screen, only the foreground screen will be visible. Only background, info and foreground screens will rotate; higher classes do not rotate because their purpose is not suitable for rotation. Changes the heartbeat setting for this screen. If set to open, the default, the client's heartbeat setting will be used. Changes the screen's backlight setting. If set to the default value open, the state will be determined by the client's setting. blink is a moderately striking backlight variation, flash is very strinking. A screen will be visible for this amount of time every rotation. The value is in eights of a second. After the screen has been visible for a total of this amount of time, it will be deleted. The value is in eights of a second. Currently the client will not be informed of the deletion (TODO?). Determines the visibility of a cursor. If on, a cursor will be visible. Depending on your hardware, this will be a hardware or software cursor. The specified cursor shape (block or under) might not be available in which case an other cursor shape will be used instead. Default is off. Set the cursor's x and y coordinates respectively. If not given, the cursor will be set to the leftmost () resp. topmost () position. Coordinates are always 1-based. So the default top-left corner is denoted by (1,1). widget_add Adds a widget to the given screen. The new_widget_id sets the identifier for this widget. The optional places the widget into the given frame. The following widget types exist: string A simple text. title A title bar on top of the screen. hbar A horizontal bar. vbar A vertical bar. icon A predefined icon. For a list of valid names consult server/widget.c. scroller A variation of the string type that scrolls the text horizontally or vertically. frame A frame with that can contain widgets itself. In fact a frame displays an other screen in it. num A big number. They have a size of 3x4 characters. The special number 10 is a colon, that you can use for a clock. This character is 1x4. widget_del Deletes the given widget from the screen. widget_set Sets parameters for a widget. Because not all widgets are created equal, the various widget types require different parameters. string x y text Displays text at position (x,y). title text Uses text as the title to display. hbar vbar x y length Displays a horizontal (hbar) resp. vertical (vbar) starting at position (x,y) that is length pixels wide resp. high. icon x y iconname Displays the icon iconname at position (x,y). scroller left top right bottom direction speed text Displays a scroller spanning from position (left,top) to (right,bottom) scrolling text in horizontal (h), vertical (v) or marquee (m) direction at a speed of speed, which is the number of movements per rendering stroke (8 times/second). frame left top right bottom width height direction speed Sets up a frame spanning from (left,top) to (right,bottom) that is width columns wide and height rows high. It scrolls in either horizontal (h) or vertical (v) direction at a speed of speed, which is the number of movements per rendering stroke (8 times/second). In the current implementation frames can only scroll vertically and only string and hbar widgets work inside frames. num x int Displays decimal digit int at the horizontal position x, which is a normal character x coordinate on the display. The special value 10 for int displays a colon. Menu stuff In this section all commands for creation, modification of menus and for interaction with them are described. Although keys may be used for other tasks they are listed here too. TODO: example for normal (static) menu structure. Menus may be even be used for wizards (the user is automatically guided through a number of configuration options) by virtue of the options -next and -prev. Here a complete example: client_set name Parenttest # to be entered on escape from test_menu (but overwritten # for test_{checkbox,ring}) menu_add_item "" ask menu "Leave menus?" -is_hidden true menu_add_item "ask" ask_yes action "Yes" -next _quit_ menu_add_item "ask" ask_no action "No" -next _close_ menu_add_item "" test menu "Test" menu_add_item "test" test_action action "Action" menu_add_item "test" test_checkbox checkbox "Checkbox" menu_add_item "test" test_ring ring "Ring" -strings "one\ttwo\tthree" menu_add_item "test" test_slider slider "Slider" -mintext "" -maxtext "" -value "50" menu_add_item "test" test_numeric numeric "Numeric" -value "42" menu_add_item "test" test_alpha alpha "Alpha" -value "abc" menu_add_item "test" test_ip ip "IP" -v6 false -value "192.168.1.1" menu_add_item "test" test_menu menu "Menu" menu_add_item "test_menu" test_menu_action action "Submenu's action" # no successor for menus. Since test_checkbox and test_ring have their # own predecessors defined the "ask" rule will not work for them menu_set_item "" test -prev "ask" menu_set_item "test" test_action -next "test_checkbox" menu_set_item "test" test_checkbox -next "test_ring" -prev "test_action" menu_set_item "test" test_ring -next "test_slider" -prev "test_checkbox" menu_set_item "test" test_slider -next "test_numeric" -prev "test_ring" menu_set_item "test" test_numeric -next "test_alpha" -prev "test_slider" menu_set_item "test" test_alpha -next "test_ip" -prev "test_numeric" menu_set_item "test" test_ip -next "test_menu" -prev "test_alpha" menu_set_item "test" test_menu_action -next "_close_" # replace the main menu with the client's menu as created above menu_set_main "" client_add_key | ... Tells the server that the current client wants to make use of the given key(s). If you reserve the key(s) in shared mode, other clients can still reserve these keys too. If you reserve the key(s) in exclusive mode no other client can reserve them again. Key(s) reserved in shared mode will only be returned when a screen of the current client is active. These keys can be used for interaction with a visible screen (default). Key(s) reserved in exclusive mode will be returned regardless of which screen is active. They can be used to trigger a special feature or to make a screen come to foreground. Note that you cannot reserve a key in exclusive mode when an other client has reserved it in shared mode. client_del_key Ends the reservation of the given key(s). menu_add_item Adds a new menu item to a menu. The main menu of a client, will be created automatically as soon as the client adds an item. This main menu has an empty id ("") and the name is identical to the name of the client. The item specific options are described under menu_set_item below. Use of text is optional and is a shortcut for "-text text" option. Note: Some menu commands (menu_goto) and options (, ) assume that menu_ids are unique (at least within a clients menu hierarchy). If you want to use a text label that starts with a '-' (minus) character, you have to use the "-text text" option. menu item types action This item should trigger an action. It consists of simple text. checkbox Consists of a text and a status indicator. The status can be on (Y), off (N) or gray (o). ring Consists of a text and a status indicator. The status can be one of the strings specified for the item. slider Is visible as a text. When selected, a screen comes up that shows a slider. You can set the slider using the cursor keys. When Enter is pressed, the menu returns. numeric Allows the user to input an integer value. Is visible as a text. When selected, a screen comes up that shows the current numeric value, that you can edit with the cursor keys and Enter. The number is ended by selecting a 'null' input digit. After that the menu returns. alpha Is visible as a text. When selected, a screen comes up that shows the current string value, that you can edit with the cursor keys and Enter. The string is ended by selecting a 'null' input character. After that the menu returns. ip Allows the user to input an IP number (v4 or v6). When selected, a screen comes up that shows an IP number that can be edited - digit by digit - via left/right (switch digit) and up/down keys (increase/decrease). menu This is a submenu. It is visible as a text, with an appended >. When selected, the submenu becomes the active menu. menu_del_item Removes a menu item item_id from menu menu_id. The menu with the special id "" (i.e. the empty string) is the client's main menu. menu_set_item Sets parameters for the menu item(s). Each item type knows different parameters. options for the various menu items for all item types The visible text of the item. (false) If the item currently should not appear in a menu. Sets the menu item to show after hitting the ENTER key when this item is active. This works for all menu item types except menus i.e. also for menu item types without an own screen e.g., checkbox, ring and action. Special values _close_ Equivalent to : Close the menu. _quit_ Equivalent to : Quit the menu system. _none_ Equivalent to : Keep the item open. Sets the menu item to show after hitting the ESCAPE key when this Item is active. This works for all menu item types i.e. also for menu item types without an own screen e.g., checkbox, ring and action. Note: If you define a predecessor for e.g., a checkbox and its parent menu too, the menu's predecessor is ignored in favor of the checkboxes one. This option accepts the same special values as the option. action (none) Sets what to do with the menu when this action is selected: none: the menu stays as it is; close: the menu closes and returns to a higher level; quit: quits the menu completely so you can foreground your app. checkbox Set the value of the item. (false) Sets if a grayed checkbox is allowed. ring (0) Sets the index in the stringlist that is currently selected. (empty) This single string should contain the strings that can be selected. They should be tab-separated (\t). slider (0) Sets its current value. ("") ("") The texts at the left and right side of the slider. (0) (100) The minimum and maximum values of the slider. (1) The stepsize of the slider. If you use 0, you can control the movement completely from your client. numeric (0) Sets its current value. (0) (100) The minimum and maximum values that are allowed. If one of them is negative, the user will be able to enter negative numbers too. TODO: floats! alpha ("") Sets its current value. ("") If used, instead of the typed characters, this character will be visible. (0) (10) Sets the minimum and maximum allowed lengths. (true) (false) (false) (Dis)allow these groups of characters. ("") The chars in this string are also allowed. ip ("192.168.1.245") Set the value of the item, e.g. "192.168.1.245" (v4) or ":::ffff:ffff:ffff:ffff:ffff" (v6). (false) Changes IP version from default v4. menu This is a submenu. It is visible as a text, with an appended '>'. When selected, the submenu becomes the active menu. (Re)sets the parent of this menu. Parentid has to be of type menu. This function does not change any menu (neither the old nor the new parent) since this option is normally used with hidden menus. Otherwise use menu_add/del_item. Applying this option is equivalent to second argument of the menu_goto command. menu_goto Changes current menu to menu_id. Depending on the configure option the client may switch to any (if enabled) or his menus only (if not enabled). menu_id The menu item to go to (any menu type e.g. an action or a menu). parent_id Resets the parent of menu_id. This optional parameter can be used to reuse a menu from different places (for wizards etc.). Use it with caution: This may lead to a messy menu structure in particular due to the fact that the menus are not changed ! menu_set_main Sets the entry point into the menu system. Use this to make the server menu invisible. Note that you may only set the menu to your own clients menus unless the configure option is used. (See menuscreens.c for the menu ids of the server menus.) menu_id The new main menu, restricted to the client's own menus. Special values: "" (i.e. the empty string) The client's main menu. _main_ Resets main to the "real" main menu. Miscellaneous backlight { | | | | } Sets the client's backlight state. output { | | } Sets the general purpose output on some display modules to this value. Use on to set all outputs to high state, and off to set all to low state. The meaning of the integer value depends on your specific device, usually it is a bit pattern describing the state of each output line. info This command provides information about the driver. noop This command does nothing and is always successful. Can be useful to be sent at regular intervals to make sure your connection is still alive. sleep Sleep for the given number of seconds. int must be a positive integer in the range from 1 to 60. Note: This command is currently ignored on the server side. LCDd messages LCDd can send messages back to the client. These messages can be directly related to the last command, or generated for some other reason. Because messages can be generated at any moment, the client should read from the connection at regular intervals. A very simple client could simply ignore all received messages. Not reading the messages will cause trouble ! success This is the response to a command in case everything went OK. huh? error_description This is the response to a command in case something has gone wrong. The description is not meant to be parsed, it's only meant for the programmer of the client. It might be that your command has only been partially executed, for example if you try to reserve 3 keys, and one fails. Your client might need to undo its actions completely. listen screen_id ignore screen_id The screen with the screen_id given is now visible on the display (listen) or it is not visible anymore on the display (ignore). key key This message will be sent if there was a keypress that should be delivered to the current client. menuevent event_type id value The user did something with a client supplied menu. The type of event can be: select (action) The item was activated. update (checkbox, ring, numeric, alpha) The item was modified by the user, so LCDd sends an updated value. plus (slider) minus (slider) The slider was moved to left (minus) or right (plus), so LCDd sends an updated value. enter This item has been entered, which means it is currently active on the screen. The client could now for example update the value of the item. If it is a menu, it may be needed to update the values of the items in it too, because they may be visible too. leave This item has been left, so it is currently not the (main) active item anymore. Multiple messages may be generated by one action of the user. lcdproc-0.5.7/docs/lcdproc-dev/lcdproc-dev.css000644 001751 000000 00000000424 11506112610 022011 0ustar00mmdolzewheel000000 000000 pre.screen { background-color: #FFFF99 ; border: 1px solid #006600 ; } div.note, div.tip, div.warning { margin-top: 5px; margin-bottom: 5px; padding: 5px; } div.note, div.tip { border-left: solid palegreen 20px; } div.warning { border-left: solid red 20px; } lcdproc-0.5.7/docs/lcdproc-dev/lcdproc-dev.docbook000644 001751 000000 00000001516 11506112610 022644 0ustar00mmdolzewheel000000 000000 ]> &bookinfo; &introduction; &language; &programming; &shared-files; &driver-api; &add-your-driver; &releasing; &license; lcdproc-0.5.7/docs/lcdproc-dev/license.docbook000644 001751 000000 00000051524 10510750107 022073 0ustar00mmdolzewheel000000 000000 GNU Free Documentation License Version 1.1, March 2000
Copyright (C) 2000 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
PREAMBLE The purpose of this License is to make a manual, textbook, or other written document "free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. APPLICABILITY AND DEFINITIONS This License applies to any manual or other work that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you". A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (For example, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, whose contents can be viewed and edited directly and straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup has been designed to thwart or discourage subsequent modification by readers is not Transparent. A copy that is not "Transparent" is called "Opaque". Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML designed for human modification. Opaque formats include PostScript, PDF, proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML produced by some word processors for output purposes only. The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies. COPYING IN QUANTITY If you publish printed copies of the Document numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a publicly-accessible computer-network location containing a complete Transparent copy of the Document, free of added material, which the general network-using public has access to download anonymously at no charge using public-standard network protocols. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has less than five). State on the Title page the name of the publisher of the Modified Version, as the publisher. Preserve all the copyright notices of the Document. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. Include an unaltered copy of this License. Preserve the section entitled "History", and its title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. In any section entitled "Acknowledgements" or "Dedications", preserve the section's title, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. Delete any section entitled "Endorsements". Such a section may not be included in the Modified Version. Do not retitle any existing section as "Endorsements" or to conflict in title with any Invariant Section. If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles. You may add a section entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections entitled "History" in the various original documents, forming one section entitled "History"; likewise combine any sections entitled "Acknowledgements", and any sections entitled "Dedications". You must delete all sections entitled "Endorsements." COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, does not as a whole count as a Modified Version of the Document, provided no compilation copyright is claimed for the compilation. Such a compilation is called an "aggregate", and this License does not apply to the other self-contained works thus compiled with the Document, on account of their being thus compiled, if they are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one quarter of the entire aggregate, the Document's Cover Texts may be placed on covers that surround only the Document within the aggregate. Otherwise they must appear on covers around the whole aggregate. TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License provided that you also include the original English version of this License. In case of a disagreement between the translation and the original English version of this License, the original English version will prevail. TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. How to use this License for your documents To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page:
Copyright (c) YEAR YOUR NAME. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. A copy of the license is included in the section entitled "GNU Free Documentation License".
If you have no Invariant Sections, write "with no Invariant Sections" instead of saying which ones are invariant. If you have no Front-Cover Texts, write "no Front-Cover Texts" instead of "Front-Cover Texts being LIST"; likewise for Back-Cover Texts. If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software.
lcdproc-0.5.7/docs/lcdproc-dev/make-driver.docbook000644 001751 000000 00000033460 11621737633 022673 0ustar00mmdolzewheel000000 000000 Shared files specific for drivers Driving an LCD display is not easy; you need to address ports, to send bytes in a certain order, to respect timing, and unfortunately no two operating system let you do this in the same way. But don't despair! There's hope! Someone in a galaxy far far away, has Already done the dirty job for you! This dirty job has been put in shared files. These shared files are full cross platform and are auto-magically configured by the configure script. You only need to include them and use their functions to benefit from them. These files are provided only for drivers, others are provided for all of LCDproc. These files are located in the shared directory, they have a dedicated chapter in this book. port.h : Parallel port I/O The file port.h, located in the server/drivers/ directory provide Input/Output and port permissions for the PC compatible parallel port, also known as the LPT port. Of course, these functions will only work if the computer where LCDproc runs has parallel port! In these situations, the configure script will see this and disable drivers that need a parallel port. The functions in port.h are defined and as 'static inline'. Therefore each driver including this header file gets its own copy of the functions and they are inlined into the driver's code. As a result calls to port_in() and port_out() are directly translated to inb() or outb() or assembly code by the compiler. There is less to no overhead in using them. port.h file defines 6 static inline functions for port I/O: Read a byte from port static inline int port_in unsigned short int port Returns the content of the byte. Write a char(byte) 'val' to port static inline void port_out unsigned short int port unsigned char val Returns nothing (void). Get access to a specific port static inline int port_access unsigned short int port Returns 0 if successful, -1 if failed. Close access to a specific port static inline int port_deny unsigned short int port Returns 0 if successful, -1 if failed. Get access to multiple sequential ports static inline int port_access_full unsigned short int port unsigned short int count Returns 0 if successful, -1 if failed. Close access to multiple sequential ports static inline int port_deny_full unsigned short int port unsigned short int count Returns 0 if successful, -1 if failed. Example use #include "port.h" /* * Get access to these 3 ports: * 0x378 (CONTROL), * 0x379 (STATUS) and * 0x37A (DATA) */ if (port_access_multiple(0x378, 3) == -1) { /* Access denied, do something */ } /* Write a 'A' to the control port */ port_out(0x378, 'A'); /* Read from the status port */ char status = port_in(0x379); /* Close the 3 ports */ port_deny_multiple(0x378, 3); adv_bignum.h : Write Big-Numbers adv_bignum.h is the headerfile for libbignum.a (made from adv_bignum.c) which contains everything needed to show big-numbers, including the fonts for the different displays. (All files are located in the server/drivers/ directory.) There are only a few requirements to the calling driver: The following functions have to be implemented by the driver: height() to determine the display's height and thus the maximal height of the big numbers to be displayed. get_free_chars() to determine the number of user-definable characters that can be used in the generation of big numbers. set_char() to define a character necessary to write a big number. Of course this is only necessary if there really are user-definable characters, i.e. only if get_free_chars() returns a value greater 0. chr() to actually write the characters the big numbers consist of. The display's cellwidth has to be 5 (6 works also in some cases) and the cellheight 7 or 8. The custom-characters (if any) have to be at character positions offset+0, offset+1, offset+2, ... offset+ get_free_chars()-1, offset+ get_free_chars()-1 must be less than 32, The library determines the correct font, depending on the display size and the number of user-defined characters itself. So it is easy to integrate into the driver. Provided Functions void lib_adv_bignum Driver *drvthis int x int num int offset int do_init The main thing the driver has to do is to call this function from its num() function with the parameters described below. drvthis the pointer pointing to the Driver structure passed to the driver's num() function. x the horizontal position of the top-left corner of the big-number (the big-numbers don't have a y position). The placing of the characters is done by the client, so the driver only has to forward the position to the lib. The bignumlib has no influence on the placing of the characters. num the number (legal: 0 - 9, and :) to be written. offset the character position where the user-definable characters start (usually 0). The user-definable characters (if any) are then expected to be at the character positions offset+0, offset+1, offset+2, ... offset+ get_free_chars()-1 and offset+ get_free_chars()-1 is required to be less than 32. do_init if not 0, lib_adv_bignum will set the custom characters of the display for the big-numbers. The driver has to check if the custom-characters have to be set or if it is already done and tell it to the lib (using the do_init parameter). The common way is to use variable called p->ccmode or similar. In the different drivers there are some differences in the naming and handling of this variable. So the responsibility of checking and setting is left to the driver. Calling <function>lib_adv_bignum()</function> #include "adv_bignum.h" MODULE_EXPORT void myDriver_num( Driver * drvthis, int x, int num ) { PrivateData *p = drvthis->private_data; int do_init = 0; if (p->ccmode != CCMODE_BIGNUM){ // Are the custom-characters set up correctly? If not: do_init = 1; // Lib_adv_bignum has to set the custom-characters. p->ccmode = CCMODE_BIGNUM; // Switch custom-charactermode to bignum. } // Lib_adv_bignum does everything needed to show the big-numbers. lib_adv_bignum(drvthis, x, num, 0, do_init); } All that's left to do is to add libbignum.a to the libs and adv_bignum.h sources of your driver in the Makefile (or the file that generates the Makefile). Enabling adv_bignum support in <filename>Makefile.am</filename> myDriver_LDADD: libLCD.a libbignum.a myDriver_SOURCES: lcd.h lcd_lib.h myDriver.c myDriver.h report.h adv_bignum.h Internal Structure and Functions The only purpose of lib_adv_bignum() is to determine the best display-dependent big-number function, based upon the values of the driver's height() and get_free_chars() functions, and call it. The display-dependent functions are named adv_bignum_num_N_M(), where N is the display's height in lines and M the number of used user-definable characters. The bits of the user-characters are stored in static char bignum (take a look at the source and you will see what I mean). (On a display with a cellheight of 7 the lowest line stored is not shown.) While static char num_map defines the placing in the big number. (A big number is always 3 characters wide and 4 characters high. On a big number for 2 line displays the 2 lower lines are not in use.) If user-definable characters have to be set, the driver's set_char() function will be called once for every user-definable character. Now adv_bignum_write_num() is called. This function places the 6 or 12 characters the big-number consists of in the framebuffer using the drivers chr() function. lcdproc-0.5.7/docs/lcdproc-dev/programming.docbook000644 001751 000000 00000030701 12014174063 022767 0ustar00mmdolzewheel000000 000000 Programming for LCDproc Get the source If you want to start programming for LCDproc you will need the have the most current source code available. You can get it several ways: Download yesterday's CVS version of as a tarball (preferred). Download the latest version from CVS. Download the last stable release from Sourceforge. (This is not recommended as stable release may be months behind the current version.) Download Yesterday's CVS Version of LCDproc as a Tarball There are nightly distributions of the CVS branches of LCDproc. You can download them from . For development we recommended to use the 'current' branch. To extract the files run $ tar xvfz lcdproc-CVS-current.tar.gz Download The Latest Version of LCDproc from CVS Of course you can download the latest stuff from CVS via anonymous login. For more information on how to use CVS see About CVS on Sourceforge. Login to CVS: $ cvs -d:pserver:anonymous@lcdproc.cvs.sourceforge.net:/cvsroot/lcdproc login (Hit enter when prompted for a password.) Get the files from CVS: $ cvs -d:pserver:anonymous@lcdproc.cvs.sourceforge.net:/cvsroot/lcdproc checkout -P lcdproc Once you've done that and want to update the downloaded files to the latest stuff you can use the "update" command of CVS (make sure to be in the lcdproc directory!): $ cvs update -d Now that once you have downloaded the files you can prepare them for compiling, but first you should (you don't have to) copy them to another place on your machine. Code style guideline LCDproc has been developed by many contributors over many years. You may find different programming styles (naming, indention, etc) in the source code. When modifying an existing file, please take a careful look at its style and program continuing that style instead of mixing it up with another one even if it does not comply with the guidelines written below. For newly added files the following guideline describes how source code should look like. All new submitted files will be passed through GNU indent to enforce the style described below. File format and indention Language: The programming language used for LCDd (server core), drivers and the lcdproc client is C. No other programming language will be accepted. File encoding: Files shall either encoded as UTF-8 or ISO-8859-1 and line endings shall be Unix type. Line length: Lines of source code should be wrapped at column 100. Comment lines should wrap at column 79. Indention: Tab indention shall be used (with tab width set to 8 characters). License: LCDproc is released under GNU General Public License version 2 (GPL v2) and every file shall have a standard copyright notice. Naming conventions Function names: Function names shall be lowercase. We do not use CamelCase (some historical exceptions may exist). Multiple words are separated by underscore. Variable names: We do not use Hungarian Notation. CamelCase may be used, but names shall begin with a lowercase letter. Constants: Constants shall be written in uppercase using underscore to separate multiple words. Names of constants, variables and functions /* Constants */ #define KEYPAD_AUTOREPEAT_DELAY 500 #define KEYPAD_AUTOREPEAT_FREQ 15 /* Variable names */ MODULE_EXPORT char * api_version = API_VERSION; MODULE_EXPORT int stay_in_foreground = 0; MODULE_EXPORT int supports_multiple = 1; /* Function names */ void HD44780_position(Driver *drvthis, int x, int y); static void uPause(PrivateData *p, int usecs); unsigned char HD44780_scankeypad(PrivateData *p); Comments All code comments shall be C-style comments (/* */). Comments spanning multiple lines shall have a star at the beginning of each line. C++-style comments (//) may be used to comment out single lines of code to disable these lines. Larger blocks of code which shall be disabled should be wrapped within C-style comments or using pre-processor directives (#if ... #endif). C++-style comments should not be used in general. We use Doxygen to document our source code. Functions shall be documented using Doxygen-style comments (/** *). See Doxygen Manual for more information and how to use it. If you carefully formatted a comment, you may use the special comment /*- */ (comment start is star minus) to prevent automatic reformatting. This usually applies to the standard copyright notice. Standard copyright notice /*- * Copyright (C) 2010 Your Name <your_email_address> * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. */ Statement style Function declarations: Function declarations have their declaration and opening brace split across two lines. Function names start in column one. The return type is placed on the previous line. There is no space between the function name and '('. A function declaration /** * This is a Doxygen function description. * * \param y The number of years * \param str Pointer to a string containing X * \return 0 on success; -1 on error */ int this_is_a_function(int y, char *str) { code } Operators: There shall be a space characters before/after an operator or assignment, except for increment (++) or decrement (--) operators. Space around operators if (p->dispSizes[dispID - 1] == 1 && p->width == 16) { if (x >= 8) { x -= 8; relY = 1; } } x--; /* Convert 1-based coords to 0-based */ y--; Function calls: There shall be no space between the function call and the opening brace '(' of the parameter list. Within the parameter list a space shall be after each parameter. Function call lib_vbar_static(drvthis, x, y, len, promille, options, p->cellheight, 0); Compound statements: Opening braces occur on the same line as the statement. Else statements: Else statements are placed on a line of their own, even is there is a previous closing brace. Opening and closing braces may be omitted on single line compound statements. However, if one part of an if-else-statement requires braces the other part shall have braces as well. If-else with braces if (...) { code } else { code } If-else with single statements if (...) print(); else err = 1; Other compound statements while (...) { code } for (a = 0; a < max; a++) { code } /* case labels are not indented */ switch (icon) { case ICON_BLOCK_FILLED: HD44780_set_char(drvthis, 6, block_filled); break; case ICON_HEART_FILLED: HD44780_set_char(drvthis, 0, heart_filled); break; case ICON_HEART_OPEN: HD44780_set_char(drvthis, 0, heart_open); break; default: return -1; /* Let the core do other icons */ } Example indent profile The following example shows an indent profile that checks and corrects the coding style guideline described above. Copy the following text into file .indent.pro in your home directory. indent.pro example -TPrivateData -TDriver -l100 -lc79 -i8 -ip8 -di1 -cd33 -ci8 -cli0 -ts8 -ut -nsob -sc -psl -npcs -lp -fc1 -nbc -nce -brs -br -sbi0 -saw -sai -saf -nprs -hnl -fca -cdw -nbfda -nbbo -ncdb -nbad -cs Submitting code When you have finished modifying the code you may decide to submit it to the LCDproc project. You usually do this by submitting a patch for review to the mailing list. To create a patch you need the unmodified files and the files containing your modifications. Usually you do this by storing an unmodified copy of the sources in one directory and another copy with your modifications in another one. You then run diff like this: diff > mymodifications.patch Please use unified diff format ( option) only! When running diff using is strongly recommended. The file diff_ignore contains an exclusion list which makes cvs ignore all generated files (Makefiles, log files, object files, etc.) If you have modified files in a source tree you checked out from CVS you can also run cvs diff from the working directory: cvs diff > mymodifications.patch Some versions of cvs diff will not handle new files because these are unknown to the repository. There are ways to make cvs believe the files existed previously (fake add) but this is not recommended. You will need to submit new files 'as-is' in this case. lcdproc-0.5.7/docs/lcdproc-dev/README.docbook000644 001751 000000 00000001646 11506112610 021403 0ustar00mmdolzewheel000000 000000 README.docbook -------------- The documentation for LCDproc is written in DocBook, to be exact: DocBook V4.x XML. You can generate the documentation of LCDproc using 'xmlto', which is a shell-script frontend to an XML toolchain. Get it from http://cyberelk.net/tim/software/xmlto/ or pre-packaged from your distribution. To convert the Admin Guide to a single XHTML document, simply do: $ xmlto xhtml-nochunks lcdproc-dev.docbook See xlmto's man page for further conversion targets. In earlier releases it was possible to convert the LCDproc documentation using the Docbook utilities, but unfortunately this is not possible any more. $ docbook2html lcdproc-dev.docbook should create HTML documents, but currently fails. Unfortunately I am not expert enough in DocBook and SGML to find out why. If you find out the cause of this failure, please do not hesitate to post the fix tho the LCDproc mailing list. Peter Marschall lcdproc-0.5.7/docs/lcdproc-dev/releasing.docbook000644 001751 000000 00000021326 12313532720 022421 0ustar00mmdolzewheel000000 000000 Making a release This chapter describes the steps necessary to create a software release of LCDproc. It is intended to guide the release manager when creating a new release. Creating a source code release Steps to create a new software release of LCDproc Update year of release in HEAD. The following files need to be updated: server/main.c clients/lcdproc/main.c docs/lcdproc-user/bookinfo.docbook docs/lcdproc-dev/bookinfo.docbook Make a backup of the CVS repository to the local disk. This is needed if something goes wrong. Run: rsync -av 'lcdproc.cvs.sourceforge.net::cvsroot/lcdproc/*' . Check out the CVS stable release branch. Run: cvs -d:ext:<your_sf_userid>@lcdproc.cvs.sourceforge.net:/cvsroot/lcdproc checkout -r stable-0-5-x -d lcdproc-0-5-x lcdproc and change into the stable-0-5-x directory. Merge HEAD to stable. This step is only required if the release will be done from HEAD. Run: cvs -q update -j stable-0-5-x -j HEAD Update version numbers for stable branch. See for the list of affected files. Commit everything. Run: cvs commit -m "Sync with HEAD" Tag the stable tree to indicate the file revision where the branch was made. This eases later diffs against that point. Run: cvs tag LCDPROC_0_5_A_BP (where A is the version number of the next release and _BP means branch point). Tag names are all uppercase with underscores to separate elements! Create a release branch in CVS. Run: cvs tag -b lcdproc-0-5-A Release branch names are all lowercase with hyphens to separate elements! Now you have created a branch from which the new release will done. Before continuing either checkout this new branch to a new working directory or update the current one by running: cvs update -r lcdproc-0-5-A Update version numbers for release and commit the changes. See for the list of affected files. Set a CVS tag for the release. Run: cvs tag LCDPROC_0_5_A_RELEASE where A is the version number of the next release. Export the release source tree as anonymous. This step is intended to check if all files are correctly tagged with the new release in the source tree. Run: cvs -d :pserver:anonymous@lcdproc.cvs.sourceforge.net:/cvsroot/lcdproc -z3 export -r LCDPROC_0_5_A_RELEASE lcdproc Create the release tarball by running: sh autogen.sh ./configure make distcheck Test the newly created release tarball at least once. Try to build and install it with all drivers enabled. Better: Try to build and install with several library options turned on and off. Create the release notes. The release notes should be an easy to read summary of changes in this release. The ChangeLog file is not very good as release notes as it is just a chronological list of things that happen. The release notes should talk about: Fingerprint (SHA-1) of the release tarball Known bugs New drivers Other important changes within drivers, the server core and clients Everything else the user has to know for upgrading his installed version grouped by topics of interest. Upload the new release and release notes to Sourceforge. Announce the new release. Send notice about the new release to the LCDproc mailing list (lcdproc@lists.omnipotent.net) and the lcdproc-announce mailing list on Sourceforge (lcdproc-announce@lists.sourceforge.net). Also mention the new release on the LCDproc website download and front page. Files that need version numbers updated BUGS ChangeLog configure.ac server/menuscreens.c docs/lcdproc-dev/bookinfo.docbook docs/lcdproc-dev/driver-api.docbook docs/lcdproc-dev/introduction.docbook docs/lcdproc-user/bookinfo.docbook docs/lcdproc-user/how-to-obtain.docbook Creating a documentation release Any release of LCDproc is accompanied the the user guide and developer guide. Here is how to create these documentation packages. Steps to create the documentation package Get the release tarball and extract it (or change to the CVS directory exported in and change to docs/lcdproc-user. Create the documentation package by running: xmlto -o lcdproc-0-5-A-user-html xhtml lcdproc-user.docbook Create a tarfile of the documentation package: tar -czf lcdproc-0-5-A-user-html.tar.gz lcdproc-0-5-A-user-html Repeat the above steps for the developers guide, replacing -user with -dev where appropriate. Upload the files to the Sourceforge file release system. The online documentation consists of the user and developer guide, each converted to a single file for viewing online. Steps to create the online documentation Get the release tarball and extract it (or change to the CVS directory exported exported in and change to docs/lcdproc-user. Create the documentation file by running: xmlto xhtml-nochunks lcdproc-user.docbook Rename the file: mv lcdproc-user.html lcdproc-0-5-A-user.html Repeat the above steps for the developers guide, replacing -user with -dev where appropriate. Upload the files to our Sourceforge web site (not the file release system!) and change htdocs/docs/index.html to point to the new files. lcdproc-0.5.7/docs/lcdproc-dev/shared-files.docbook000644 001751 000000 00000016176 11621737633 023040 0ustar00mmdolzewheel000000 000000 Shared files Introduction Here we provide functions that should be used by all parts of the program. report.h : Debugging and reporting To enable the debug() function on all of the software, just type: ./configure --enable-debug and recompile with 'make'. Enabling the debug() function only in specific files: Configure without enabling debug (that is without --enable-debug). Edit the source file that you want to debug and put the following line at the top, before the #include "report.h" line: #define DEBUG. Then recompile with 'make'. This way, the global DEBUG macro is off but is locally enabled in certain parts of the software. The reporting levels have the following meaning. Reporting Levels 0 RPT_CRIT Critical conditions: the program stops right after this. Only use this if the program is actually exited from the current function. 1 RPT_ERR Error conditions: serious problem, program continues. Use this just before you return -1 from a function. 2 RPT_WARNING Warning conditions: Something that the user should fix, but the program can continue without a real problem. Ex: Protocol errors from a client. 3 RPT_NOTICE Major event in the program: (un)loading of driver, client (dis)connect. 4 RPT_INFO Minor event in the program: the activation of a setting, details of a loaded driver, a key reservation, a keypress, a screen switch. 5 RPT_DEBUG Insignificant event: What function has been called, what subpart of a function is being executed, what was received and sent over the socket, etc. Levels 4 (maybe) and 5 (certainly) should be reported using the debug function. The code that this function generates will not be in the executable when compiled without debugging. This way memory and CPU cycles are saved. report.h file defines 3 functions for debugging and reporting: Sets reporting level and message destination int set_reporting char * application_name int new_level int new_dest Returns -1 on error or 0 on success. Report the message to the selected destination if important enough void report const int level const char *format ... Returns nothing (void). The format parameter is the same as the one used by printf. Send debugging information if important enough Consider the debug function to be exactly the same as the report function. The only difference is that it is only compiled in if DEBUG is defined. LL.h : Linked Lists (Doubly-Linked Lists) Creating a list To create a list, do the following: LinkedList *list; list = LL_new(); if(!list) handle_an_error(); The list can hold any type of data. You will need to typecast your datatype to a "void *", though. So, to add something to the list, the following would be a good way to start: typedef struct my_data { char string[16]; int number; } my_data; my_data *thingie; for(something to something else) { thingie = malloc(sizeof(my_data)); LL_AddNode(list, (void *)thingie); // typecast it to a "void *" } For errors, the general convention is that "0" means success, and a negative number means failure. Check LL.c to be sure, though. Changing data To change the data, try this: thingie = (my_data *)LL_Get(list); // typecast it back to "my_data" thingie->number = another_number; You don't need to "Put" the data back, but it doesn't hurt anything. LL_Put(list, (void *)thingie); However, if you want to point the node's data somewhere else, you'll need to get the current data first, keep track of it, then set the data to a new location: my_data * old_thingie, new_thingie; old_thingie = (my_data *)LL_Get(list); LL_Put(list, (void *)new_thingie); // Now, do something with old_thingie. (maybe, free it?) Or, you could just delete the node entirely and then add a new one: my_data * thingie; thingie = (my_data *)LL_DeleteNode(list, NEXT); free(thingie); thingie->number = 666; LL_InsertNode(list, (void *)thingie); Iterations throught the list To iterate on each list item, try this: LL_Rewind(list); do { my_data = (my_data *)LL_Get(list); /* ... do something to it ... */ } while(LL_Next(list) == 0); Using the list as a stack or a queue You can also treat the list like a stack, or a queue. Just use the following functions: LL_Push() // Regular stack stuff: add, remove, peek, rotate LL_Pop() LL_Top() LL_Roll() LL_Shift() // Other end of the stack (like in perl) LL_Unshift() LL_Look() LL_UnRoll() LL_Enqueue() // Standard queue operations LL_Dequeue() There are also other goodies, like sorting and searching. Future Array-like operations will come later, to allow numerical indexing: LL_nGet(list, 3); LL_nSwap(list, 6, 13); LL_nPut(list, -4, data); // Puts item at 4th place from the end.. More ideas for later: LL_MoveNode(list, amount); // Slides a node to another spot in the list -- LL_MoveNode(list, -1); // moves a node back one toward the head That's about it, for now... Be sure to free the list when you're done! See LL.c for more detailed descriptions of these functions. &make-driver; lcdproc-0.5.7/docs/lcdproc-user/Makefile.am000644 001751 000000 00000002321 11621737633 021347 0ustar00mmdolzewheel000000 000000 ## Process this file with automake to produce Makefile.in SUBDIRS = drivers EXTRA_DIST = bookinfo.docbook \ configuration.docbook \ contact.docbook \ drivers.docbook \ how-to-obtain.docbook \ installation.docbook \ introduction.docbook \ lcdproc-user.css \ lcdproc-user.docbook \ license.docbook \ parameters.ent \ running.docbook \ README.docbook ## convenience targets userguidedir ?= $(DESTDIR)$(htmldir)/user-guide/ docreleasedir = lcdproc-$(PACKAGE_VERSION)-user-html .PHONY: install-html-userguide doc-release doc-online install-html-userguide: lcdproc-user.docbook lcdproc-user.css $(mkinstalldirs) $(userguidedir) $(XMLTO) html -o $(userguidedir) \ --stringparam html.stylesheet=lcdproc-user.css lcdproc-user.docbook cp lcdproc-user.css $(userguidedir) doc-release: lcdproc-user.docbook lcdproc-user.css $(XMLTO) html -o $(docreleasedir) \ --stringparam html.stylesheet=lcdproc-user.css lcdproc-user.docbook cp lcdproc-user.css $(docreleasedir) $(AMTAR) -czf $(docreleasedir).tar.gz $(docreleasedir) doc-online: lcdproc-user.docbook $(XMLTO) html-nochunks \ --stringparam html.stylesheet=lcdproc-user.css lcdproc-user.docbook && \ mv lcdproc-user.html current-user.html ## EOF lcdproc-0.5.7/docs/lcdproc-user/bookinfo.docbook000644 001751 000000 00000003452 12313535265 022465 0ustar00mmdolzewheel000000 000000 LCDproc User's Guide The Ultimate Guide to LCDproc 0.5.7 Peter Marschall
peter@adpm.de
Rene Wagner
reenoo@gmx.de
Guillaume Filion
gfk@logidac.com
William W. Ferrell
wwf@splatwerks.org
2014-02-10 0.5.7 This document is a guide to LCDproc written for users. It covers LCDproc 0.5.7. 2006 2007 Peter Marschall 2002 Rene Wagner 2002 Guillaume Filion 1999 William W. Ferrell Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". documentation LCDproc 0.5.7 user guide
lcdproc-0.5.7/docs/lcdproc-user/configuration.docbook000644 001751 000000 00000060531 11621737633 023533 0ustar00mmdolzewheel000000 000000 LCDproc Configuration Configure LCDd As mentioned in the introduction LCDd, the LCDproc server, has its own configuration file, which is usually /etc/LCDd.conf. If you have not installed LCDproc from the sources the configuration file might have a different location. You should be able to find it by making your system's package manager list all the files in the LCDproc package. The format of the /etc/LCDd.conf is INI-file like. It is divided into sections that start at declarations that look like [section]; i.e. an opening square bracket, followed by the section name, and terminated by a closing square bracket, on a line by itself. Section names are case insensitive. Parameters are grouped into sections and have the form key=value; i.e. a key, also known as the configuration option, followed by an equality sign and finally the value for the option. All three elements must occur together on one line. The key, which is case insensitive, may be surrounded by spaces, but is must be one word (i.e. a sequence of non-space characters) not containing the equality sign. A similar rule applies to the value: it may be surrounded by spaces, but it must be either one word or enclosed within double quotes ("), which are not considered as part of value. When quoted, the following character sequences are evaluated as in literal C strings: escape sequence character \a alert (bell) character \b backspace \f formfeed \n newline \r carriage return \t horizontal tab \v vertical tab \\ backslash All other occurrences of \ within quoted values will be ignored. Comments are all line-based, and may start with '#' or ';'. Everything including and behind the character starting the comment up to the end of the line is ignored. The server has a 'central' section named [Server]. Further each driver has a section which defines how the driver acts. Those sections start with [drivername]. The drivers are activated by specifying them in a Driver= line in the server section, like: <filename>LCDd.conf</filename>: Specify which driver to use [Server] Driver=curses This tells LCDd to use the curses driver. The drivers read their own options from the config file. For this purpose they use the config sections that are named like the driver. <filename>LCDd.conf</filename>: The <code>[Server]</code> Section The [Server] section of the LCDd.conf contains the settings for the LCDproc server LCDd. DriverPath = DRIVERPATH Tells the server where to look for the driver files. See above for details. If not specified DRIVERPATH defaults to the empty string, resulting in drivers being searched in the directory LCDd is started in. Driver = DRIVERNAME Tells the server which driver(s) to use. The first driver specified here that is capable of output functionality will be used as the master output driver, defining display properties and capabilities. All other drivers specified can only serve as input drivers or slave output drivers. If not specified DRIVERNAME defaults to curses, a driver that is supposed to work on any half-way decent UNIX console. This setting can be overridden on LCDd's command line using the option. When the command line option is used, only the one driver given there will be loaded, and all drivers specified in the configuration file are ignored. Bind = ADDRESS Tells the server to bind to the given local IP address and listen for incoming client connections. The default value for ADDRESS is 127.0.0.1, which is actually the safest variant, as it allows connections only from the local machine and forbids connections from remote systems. This setting can be overridden on LCDd's command line using the option. Port = PORTNUMBER Tells the server to listen to this specified port. If not specified PORTNUMBER defaults to 13666. This setting can be overridden on LCDd's command line using the option. ReportLevel = LEVEL Sets the reporting level. Legal values for LEVEL range from 0 (only critical errors) to 5 (everything including debugging information). If not specified it defaults to 2 (warnings and errors only). This setting can be overridden on LCDd's command line using the option. ReportToSyslog = ¶meters.yesnodef; Should we report to syslog (yes) instead of stderr (no)? Default value is no. This setting can be overridden on LCDd's command line using the option. Passing on the command line enables reporting to syslog while disables it. If LCDd is started automatically by an init script using the curses driver, it will lock /dev/tty1! So, be careful about what you are doing here. User = USER User to run as. When started as root LCDd will drop its privileges, and run as USER instead. Defaults to nobody. This setting can be overridden on LCDd's command line using the option. Foreground = ¶meters.yesnodef; The server will stay in the foreground if set to true. Otherwise the server will fork to background and report to syslog. Defaults to no. This setting can be overridden on LCDd's command line with the option that forces foreground mode. Hello = HELLOMSG Define the startup message printed on the screen when LCDd starts. This message will stay on the screen until the first client connects. If not given, it defaults to the built-in server screen that tells how many clients are connected and how many screens these clients are using in total. If it is given, each Hello= directive represents a line on the display. The HELLOMSGs will be printed on the display one after each other starting on the beginning of each line. So, the definition of Hello=" Welcome to" Hello=" LCDproc!" prints a nice 2-line welcome message to the display. To simply disable the default built-in server screen on startup, and start with a blank screen a single Hello="" is sufficient. GoodBye = GOODBYEMSG Define the message left on the screen when LCDd exits. If not given, it defaults to the built-in Thanks for using LCDproc!. If it is given, each GoodBye= directive represents a line on the display. The GOODBYEMSGs will be printed on the display one after each other starting on the beginning of each line. So, the definition of GoodBye=" So Long," GoodBye=" and" GoodBye="Thanks for All the Fish!" prints the well known dolphin's message on the first 3 lines of the display (which obviously needs to be 24 columns wide to show the full last line). To simply disable the default built-in message, and leave the screen blank a single GoodBye="" suffices. WaitTime = SECONDS Sets the default time in seconds to display a screen. If not specified the default value for SECONDS is 4. This setting can be overridden on LCDd's command line with the option. AutoRotate = ¶meters.yesdefno; If set to no, LCDd will start with screen rotation disabled. This has the same effect as if the ToggleRotateKey had been pressed. Rotation will start if the ToggleRotateKey is pressed. This setting does not turn off priority sorting of screens. Therefore the client or LCDd may still show a different screen if it assigns it a higher priority than any other screen. Due to the way priority sorting works the screen shown when the first client connects may not be that clients first screen. If the client sets up more than two screens it will be the next to last one (this is not considered a bug). ServerScreen = { yes | no | blank } Control the behaviour of the server screen, that usually shows the number of active clients and screens. When set to its default value yes, the server screen is included into the screen rotation scheme when other screens exist. Whet set to no, the server screen only shows up when no other screen exists. The special value blank is similar to no, but instead of displaying the current number of clients and screens, only a blank screen is displayed. This setting can be partially overridden on LCDd's command line using the option. Passing on the command line enables server screen rotation, while disables it. Using the command line, it is not possible to set the server screen to blank mode. Backlight = { off | open | on } Set the master backlight setting. If set to the default value open, then the backlight setting of the display can be influenced by the clients. When set to off or on, the backlight is set to the appropriate value without the clients being able to change the value. Heartbeat = { off | open | on } Set the master heartbeat, the oscillating icon in the top right corner of the display, setting. If set to the default value open, then the heartbeat setting of the display can be influenced by the clients. When set to off or on, the heartbeat is turned on or off without the clients being able to change the value. TitleSpeed = SPEED Set the speed how fast over-long title lines shall scroll. Legal values are 0 to 10, where 0 means that no scrolling takes place and 10 stands for fastest scrolling. Default is 10, where no artificial delay is inserted. The …Key lines define what the server does with keypresses that don't go to any client. ToggleRotateKey = KEY Defaults to Enter. PrevScreenKey = KEY Defaults to Left. NextScreenKey = KEY Defaults to Right. ScrollUpKey = KEY Defaults to Up. ScrollDownKey = KEY Defaults to Down. <filename>LCDd.conf</filename>: The <code>[Menu]</code> Section The [Menu] section enables you to set some general ("global") options related to the way LCDd handles input "events". The menu is a special LCDproc client built into LCDd that allows changing server and display settings as well as extending it with entries from client applications. You can configure what keys the menu should use. MenuKey = KEY The key that switches into menu mode (=open the main menu). In menu mode it cancels any operation. Cancelling the main menu means returning to the regular display mode. It has no default, but a natural candidate is Menu. The MenuKey will be reserved exclusively, while the others work in shared mode and can thus be used by a client application when not in the menu. EnterKey = KEY The key to enter a sub menu, to select an entry and/or to confirm the value of an input field. If the RightKey is not defined, it is also used to move right in input fields. In this case the value of the input field is not confirmed, until the right end of the input has been reached. It is not set by default, but a natural candidate is Enter. UpKey = KEY The key to move to the previous item in a menu and/or to select the previous value in input fields (e.g. the previous character available for the current position). If the DownKey is not set, moving up before the first entry automatically wraps around to the last entry. It is not set by default, but a natural candidate is Up. DownKey = KEY The key to move to the next item in a menu and/or to select the next value in input fields (e.g. the next character available for the current position). If the UpKey is not set, moving down below the last entry automatically wraps around to the first entry. It has no default, but a natural candidate is Down. LeftKey = KEY If defined, this optional key is used to to move left in input fields and to select submenu entries. It is not set by default, but if you have more than 4 keys, a natural candidate is Left. RightKey = KEY If defined, this optional key is used to to move right in input fields. It is not set by default, but if you have more than 4 keys, a natural candidate is Right. The minimal keys required for the menu work correctly are the MenuKey, the EnterKey and one of UpKey or DownKey. With these 3 keys the menus can be operated. Of course with only 3 keys the navigation gets a bit awkward. So if you have 4 or more keys, you better use them. Especially the LeftKey and RightKey make a big difference in user experience. <filename>LCDd.conf</filename>: The Driver Section As mentioned earlier, each driver has its own section in the LCDd.conf. Although the settings are more or less self-explanatory, they are explained in the next chapter in the section for each driver. So, read through the section of your driver and change everything necessary. The LCDproc Init Scripts The LCDproc distribution contains init scripts for LSB 3.1 (Linux Standard Base 3.1) conforming GNU/Linux distributions. In addition to those it contains init scripts for older RedHat- and Debian-based distributions that do not adhere to LSB 3.1. You can find all of them in the scripts/ directory of the LCDproc sources. The init scripts are generated using autoconf. So, again it is important that you have run ./configure with the correct options for your system. Refer to your system's manual on how to install the scripts. init-LCDd The file scripts/init-LCDd.* is the init script for the LCDproc server LCDd. It does not require modification. init-lcdproc The file scripts/init-lcdproc.* is the init script for the LCDproc "main" client lcdproc. You can retrieve a listing of all options of lcdproc running lcdproc --help. init-lcdexec The file scripts/init-lcdexec.* is the init script for the LCDproc lcdexec client, which can execute predefined commands via the menu feature. init-lcdvc The file scripts/init-lcdvc.* is the init script for the LCDproc lcdvc client, a simple terminal. lcdproc-0.5.7/docs/lcdproc-user/contact.docbook000644 001751 000000 00000006626 11204452537 022316 0ustar00mmdolzewheel000000 000000 Contact Us Errata Of course LCDproc is not perfect (yet). We do our very best to improve it, but in some cases we are very much restricted in our efforts. The main reason for that is the fact that we do not have all the hardware people have written drivers for. Unfortunately some developers have kind of vanished and don't react to mails from the mailing list any more. So, as far as drivers are concerned we rely on you as testers. We have developed elaborate "coding in the dark" skills over the time. E.g. the CFontz driver has been updated and ported to 0.4.3 without the developers having the hardware. The LCDproc Mailing List We are a bit lazy about the bug-tracking and whatever stuff on SourceForge. So, please contact us directly through the mailing list. For details on how to subscribe to the list see http://lcdproc.omnipotent.net/mail.php3. We like people to subscribe to the list with their real names. Of course we cannot and do not want to force you to do so. Anyway, we need to know your name, if you want to contribute code to LCDproc (legal issues of copyrights). Reporting Bugs Possibly you will find a bug in the LCDproc distribution. Before reporting this to the mailing list, please respect the following: Your system should be more or less up to date. This does not mean that you have to update from GNU/Linux kernel 2.2.x to 2.4.x or from 2.4.x to 2.6.x. But we would like to make sure that your problem is not related to a known bug in the kernel or maybe your compiler. Especially LCDd might need certain privileges to access a device. Make sure LCDd has the required rights to do so. When experiencing problems with LCDd, make sure that your hardware is OK. E.g. you should make sure that the wiring for your (in this case most likely parallel) device is correct. Make sure that you use the correct speed settings for your device. Incorrect speed settings (baud rate) are most likely to produce garbage scrolling on your display. Refer to the specifications of your device. If your device needs a speed setting that is not supported by LCDd send us a mail. Make sure that you have modified the configuration file according to your needs and that LCDd actually uses the configuration file. I.e. you might have to run LCDd with the -c option Anyway, no question is too stupid to ask ;) Feel free to ask whatever you want. Unfortunately replying to mails takes time as well (a damn lot of time). So, if you want LCDproc to develop faster, please try to solve a problem yourself first. BUT if you have actually FOUND A BUG we will be quite happy if you let us know. We NEED YOU as testers and appreciate any feedback. lcdproc-0.5.7/docs/lcdproc-user/drivers.docbook000644 001751 000000 00000001341 12313532720 022321 0ustar00mmdolzewheel000000 000000 LCDproc Drivers This chapter contains the documentation of each LCDproc driver, which may include the installation process of the hardware as well as the configuration of LCDd. &bayrad; &CFontz; &CFontzPacket; &curses; &CwLnx; &ea65; &EyeboxOne; &g15; &glcd; &glcdlib; &glk; &hd44780; &i2500vfd; &icp_a106; &imon; &imonlcd; &IOWarrior; &irman; &irtrans; &joy; &lb216; &lcdm001; &lcterm; &lirc; &lis; &MD8800; &mdm166a; &ms6931; &mtc_s16209x; &MtxOrb; &mx5000; &NoritakeVFD; &rawserial; &picolcd; &pylcd; &sdeclcd; &sed1330; &sed1520; &serialPOS; &serialVFD; &shuttleVFD; &sli; &stv5730; &SureElec; &svga; &t6963; &text; &tyan; &ula200; &vlsys_m428; &xosd; &ppttrouble; lcdproc-0.5.7/docs/lcdproc-user/how-to-obtain.docbook000644 001751 000000 00000004122 12313535265 023341 0ustar00mmdolzewheel000000 000000 How to Obtain LCDproc Versioning At the time of writing the following majors versions of LCDproc are floating around on the internet: LCDproc 0.5.7 LCDproc 0.5.7 is the current stable version of LCDproc. This is the version recommended to use. Older releases of LCDproc can be found on the Sourceforge project page at . Download Yesterday's CVS Version of LCDproc as a Tarball There are nightly distributions of the CVS branches of LCDproc. You can download them from To extract the files run $ tar xvfz lcdproc-CVS-*.tar.gz Download The Latest Version of LCDproc from CVS Of course you can download the latest stuff from CVS via anonymous login. Login to CVS: $ cvs -d:pserver:anonymous@lcdproc.cvs.sourceforge.net:/cvsroot/lcdproc login (Hit enter when prompted for a password.) Get the files from CVS: $ cvs -d:pserver:anonymous@lcdproc.cvs.sourceforge.net:/cvsroot/lcdproc checkout -r stable-0-5-x lcdproc Once you've done that and want to update the downloaded files to the latest stuff you can use the "update" command of CVS (Make sure to be in the lcdproc directory.): $ cvs update -d Now that once you have downloaded the files you can prepare them for compiling, but first you should (you don't have to) copy them to another place on your machine. lcdproc-0.5.7/docs/lcdproc-user/installation.docbook000644 001751 000000 00000011154 11506112610 023342 0ustar00mmdolzewheel000000 000000 Installation Build LCDproc Now that you have downloaded the LCDproc distribution you can start building it. If you have installed the Debian package with apt-get (or another Debian package management tool), you can skip this this chapter. If you're building this version from CVS, you'll need autoconf, automake, aclocal and autoheader installed. If you have autoconf and friends, run: $ sh autogen.sh This produces the configure script and supporting files. It has already been run if you are using the tarball distribution. Once the above command has run, the rest is pretty standard: $ ./configure --help Read about the options, figure out what to use. $ ./configure --prefix=/usr/local --enable-drivers=curses,CFontz Be sure to replace /usr/local with the prefixdir you want (e.g. /usr for RedHat) and curses,CFontz with the comma-separated list of drivers you want to have compiled. $ make Congratulations: You have just compiled your version of LCDproc ;) Install LCDproc Directly From The Sources If you want to install LCDproc more or less permanently you can run: $ su Password: top secret # make install make install is absolutely OPTIONAL You can also run LCDproc directly from the source directory. See below for details. Generate And Install Packages of LCDproc As an alternative (which is actually better ;) to installing directly from the sources you can generate packages using the packaging tool EPM. First of all you may need to download EPM from http://www.epmhome.org/ and install it according to the instructions that are included in its source distribution. Debian users (who do not want to download the official lcdproc debs via apt-get) can of course use Debian's epm package: # apt-get install epm There are of course other and maybe better ways to generate packages for your system. The reason for us to choose EPM was that it provide the developers with a tool that makes it possible to write one list file for all platforms defining what the resulting package is meant to look like. This way we do not have to learn all the package managing tools of the different platforms that are supported by LCDproc. To generate an LCDproc package follow these instructions: It is of certain importance that you have run ./configure with the correct pathname settings for your system. Otherwise the resulting package will install the files in the wrong directories. $ epm -v -f native LCDproc Generating an RPM package as a non-root user will fail, RPM wants to generate the files from the tree under /usr/src/RPM, which you do not have write access to as a non-root user. If you want to generate the package as a non-root user anyway, you may want to follow these instructions. A workaround for the described problem is creating a file named ~/.rpmmacros which contains: ~/rpm must contain the same tree usually found under /usr/src/RPM Unfortunately epm does not read ~/.rpmmacros and of course returns warnings. Don't worry! That's OK ;) In order to actually install the generated package follow the instructions in your system's manual. lcdproc-0.5.7/docs/lcdproc-user/introduction.docbook000644 001751 000000 00000011630 10610214157 023365 0ustar00mmdolzewheel000000 000000 Introduction About this Document This document was meant as a tutorial for LCDproc users. It tries to introduce you into the world of LCDproc giving you an overview of the project. After reading this document you will be able to set up your own LCDproc'ed system. Please note that this document is still under construction". We hope to finish it until the final release of LCDproc ⌣. If you run into any trouble feel free to write to the LCDproc mailing list. See for details on how to subscribe to the list. Therefore you might want to have a look at , to get the latest version of this document (unless you want to generate it yourself from the docbook files in the CVS). This document was originally written for LCDproc 0.4.3, but has been dramatically updated since. At the time of writing there had already been the "LCDproc User's Guide" written by William W. Ferrel in 1999. His version covered an early version of LCDproc and therefore concentrated on Matrix Orbital displays. William's document was "recycled" for the description of the Matrix Orbital display driver and for other parts of this document. In several other places e-mails and other documents have been included in this document. The authors of those are listed below every such document. What is LCDproc? LCDproc is a client/server suite including drivers for all kinds of nifty LCD displays. The server LCDd makes it possible to display text and other data on an LCD display. As well LCDd can handle certain input devices. Support for devices is added by drivers. We distinguish between output and input drivers. LCDd currently supports only one single output driver, which may at the same time handle input. Nevertheless several input (only) drivers are supported. Currently there are drivers for several serial devices: Matrix Orbital, Crystal Fontz, Bayrad, LB216, LCDM001 (kernelconcepts.de), Wirz-SLI and PIC-an-LCD; and some devices connected to the LPT port: HD44780, STV5730, T6963, SED1520 and SED1330. There are input (only) drivers for LIRC and joysticks. Clients can connect to LCDd through common TCP sockets. Various clients are available. The main client lcdproc, which is shipped with the LCDproc distribution, can display things like CPU load, system load, memory usage, uptime, and a lot more. The LCDproc Server - LCDd LCDd is one of those well known *NIX daemons. BUT it's not just *one* daemon. It's the one that is supposed to drive your LCD ;) LCDd can either be run from the command line or automatically by the init scripts shipped with the distribution. As other daemons, LCDd has to be configured. In this respect a lot has changed since LCDproc 0.4.1. While LCDd retrieved all its configuration settings from the command line in 0.4.1, it now has a configuration file, which is normally /etc/LCDd.conf. The LCDproc "Main" Client - lcdproc While LCDd only offer the functionality of displaying text on a display, lcdproc actually retrieves data worth displaying. lcdproc gets its information from the /proc filesystem. lcdproc can connect to an LCDproc server either on the local system or on a remote system as long as it is reachable. It extracts the same statistics regardless of where it sends this information. The statistics it gathers include CPU utilization, memory utilization, disk utilization, network utilization, system uptime, time, and date, and so on. It displays this information in assorted ways, and can be tailored to taste. Other LCDproc Clients As it is rather simple to write an LCDproc client, you can find various clients on the Internet. Unfortunately we cannot provide a list of LCDproc clients here. So, take a look at the Clients page on LCDproc's web site or have fun searching Google or freshmeat. Simply use lcdproc as the search pattern. lcdproc-0.5.7/docs/lcdproc-user/lcdproc-user.css000644 001751 000000 00000000525 11656571206 022433 0ustar00mmdolzewheel000000 000000 pre.screen { background-color: #FFFF99 ; border: 1px solid #006600 ; } div.note, div.tip, div.warning, div.important { margin-top: 5px; margin-bottom: 5px; padding: 5px; } div.note, div.tip { border-left: solid palegreen 20px; } div.important { border-left: solid gold 20px; } div.warning { border-left: solid red 20px; } lcdproc-0.5.7/docs/lcdproc-user/lcdproc-user.docbook000644 001751 000000 00000007124 12313532720 023252 0ustar00mmdolzewheel000000 000000 %parameters; ]> &bookinfo; &introduction; &how-to-obtain; &installation; &configuration; &drivers; &running; &contact; &license; lcdproc-0.5.7/docs/lcdproc-user/license.docbook000644 001751 000000 00000051524 10510750107 022273 0ustar00mmdolzewheel000000 000000 GNU Free Documentation License Version 1.1, March 2000
Copyright (C) 2000 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
PREAMBLE The purpose of this License is to make a manual, textbook, or other written document "free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. APPLICABILITY AND DEFINITIONS This License applies to any manual or other work that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you". A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (For example, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, whose contents can be viewed and edited directly and straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup has been designed to thwart or discourage subsequent modification by readers is not Transparent. A copy that is not "Transparent" is called "Opaque". Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML designed for human modification. Opaque formats include PostScript, PDF, proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML produced by some word processors for output purposes only. The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies. COPYING IN QUANTITY If you publish printed copies of the Document numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a publicly-accessible computer-network location containing a complete Transparent copy of the Document, free of added material, which the general network-using public has access to download anonymously at no charge using public-standard network protocols. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has less than five). State on the Title page the name of the publisher of the Modified Version, as the publisher. Preserve all the copyright notices of the Document. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. Include an unaltered copy of this License. Preserve the section entitled "History", and its title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. In any section entitled "Acknowledgements" or "Dedications", preserve the section's title, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. Delete any section entitled "Endorsements". Such a section may not be included in the Modified Version. Do not retitle any existing section as "Endorsements" or to conflict in title with any Invariant Section. If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles. You may add a section entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections entitled "History" in the various original documents, forming one section entitled "History"; likewise combine any sections entitled "Acknowledgements", and any sections entitled "Dedications". You must delete all sections entitled "Endorsements." COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, does not as a whole count as a Modified Version of the Document, provided no compilation copyright is claimed for the compilation. Such a compilation is called an "aggregate", and this License does not apply to the other self-contained works thus compiled with the Document, on account of their being thus compiled, if they are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one quarter of the entire aggregate, the Document's Cover Texts may be placed on covers that surround only the Document within the aggregate. Otherwise they must appear on covers around the whole aggregate. TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License provided that you also include the original English version of this License. In case of a disagreement between the translation and the original English version of this License, the original English version will prevail. TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. How to use this License for your documents To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page:
Copyright (c) YEAR YOUR NAME. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. A copy of the license is included in the section entitled "GNU Free Documentation License".
If you have no Invariant Sections, write "with no Invariant Sections" instead of saying which ones are invariant. If you have no Front-Cover Texts, write "no Front-Cover Texts" instead of "Front-Cover Texts being LIST"; likewise for Back-Cover Texts. If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software.
lcdproc-0.5.7/docs/lcdproc-user/parameters.ent000644 001751 000000 00000001516 11506112610 022153 0ustar00mmdolzewheel000000 000000 yes | no }" > yes | no }" > WIDTH x HEIGHT " > lcdproc-0.5.7/docs/lcdproc-user/running.docbook000644 001751 000000 00000011267 11621737633 022346 0ustar00mmdolzewheel000000 000000 Running LCDproc Running LCDd If you have installed the init-scripts you can simply start, stop and restart LCDd with the init-script. Running LCDd from the command line There are several reasons for running LCDd from the command line You don't want to install LCDd but run it from the source directory. You want to do some debugging. You want to get the output directly on stderr. ... If you run LCDd as a "normal" user, it will not change to the user specified in the config file. For some devices, mostly parallel port devices but also some USB devices, you will need root privileges anyway ;) The simplest command that will run LCDd is the following. It is useful for running LCDd from the source directory, e.g. after building. $ server/LCDd -c LCDd.conf The Command Line Options of LCDd Running LCDd -h gives you an overview of the currently available command line options. <command>LCDd -h</command> ] where are: -h Display this help screen -c Use a configuration file other than /etc/lcdproc/LCDd.conf -d Add a driver to use (overrides drivers in config file) [curses] -f Run in the foreground -a Network (IP) address to bind to [127.0.0.1] -p Network port to listen for connections on [13666] -u User to run as [nobody] -w Time to pause at each screen (in seconds) [4] -s If set, reporting will be done using syslog -r Report level [2] -i Whether to rotate the server info screen ]]> Running lcdproc You will probably more often run lcdproc from the command line than you will run LCDd. The Command Line Options of lcdproc Running lcdproc -h gives you an overview of the currently available command line options. <command>lcdproc -h</command> ] [ ...] where are -s connect to LCDd daemon on -p connect to LCDd daemon using -f run in foreground -e slow down initial announcement of screens (in 1/100s) -c use a configuration file other than /etc/lcdproc/lcdproc.conf -h show this help screen -v display program version and are C CPU detailed CPU usage P SMP-CPU CPU usage overview (one line per CPU) G CPUGraph CPU usage histogram L Load load histogram M Memory memory & swap usage S ProcSize biggest processes size D Disk filling level of mounted file systems I Iface network interface usage B Battery battery status T TimeDate time & date information O OldTime old time screen U Uptime uptime screen K BigClock big clock N MiniClock minimal clock A About credits page Example: lcdproc -s my.lcdproc.server.com -p 13666 C M X ]]> You will not be able to connect to a remote server, unless it listens to the correct interface and port! See LCDd.conf: The [server] Section for details on the server setup. lcdproc-0.5.7/docs/lcdproc-user/README.docbook000644 001751 000000 00000001647 11506112610 021604 0ustar00mmdolzewheel000000 000000 README.docbook -------------- The documentation for LCDproc is written in DocBook, to be exact: DocBook V4.x XML. You can generate the documentation of LCDproc using 'xmlto', which is a shell-script frontend to an XML toolchain. Get it from http://cyberelk.net/tim/software/xmlto/ or pre-packaged from your distribution. To convert the User Guide to a single XHTML document, simply do: $ xmlto xhtml-nochunks lcdproc-user.docbook See xlmto's man page for further conversion targets. In earlier releases it was possible to convert the LCDproc documentation using the Docbook utilities, but unfortunately this is not possible any more. $ docbook2html lcdproc-user.docbook should create HTML documents, but currently fails. Unfortunately I am not expert enough in DocBook and SGML to find out why. If you find out the cause of this failure, please do not hesitate to post the fix tho the LCDproc mailing list. Peter Marschall lcdproc-0.5.7/docs/lcdproc-user/drivers/000755 001751 000000 00000000000 12330423234 020756 5ustar00mmdolzewheel000000 000000 lcdproc-0.5.7/docs/lcdproc-user/drivers/Makefile.am000644 001751 000000 00000002102 12313532720 023007 0ustar00mmdolzewheel000000 000000 ## Process this file with automake to produce Makefile.in EXTRA_DIST = bayrad.docbook \ CFontz.docbook \ CFontzPacket.docbook \ curses.docbook \ CwLnx.docbook \ ea65.docbook \ eyeboxone.docbook \ g15.docbook \ glcd.docbook \ glcdlib.docbook \ glk.docbook \ hd44780.docbook \ i2500vfd.docbook \ icp_a106.docbook \ imon.docbook \ imonlcd.docbook \ IOWarrior.docbook \ irman.docbook \ irtrans.docbook \ joy.docbook \ lb216.docbook \ lcdm001.docbook \ lcterm.docbook \ lircin.docbook \ lis.docbook \ MD8800.docbook \ mdm166a.docbook \ ms6931.docbook \ mtc_s16209x.docbook \ mtxorb.docbook \ mx5000.docbook \ NoritakeVFD.docbook \ picolcd.docbook \ ppttrouble.docbook \ pylcd.docbook \ rawserial.docbook \ sdeclcd.docbook \ sed1330.docbook \ sed1520.docbook \ serialPOS.docbook \ serialVFD.docbook \ shuttleVFD.docbook \ sli.docbook \ stv5730.docbook \ SureElec.docbook \ svga.docbook \ t6963.docbook \ text.docbook \ tyan.docbook \ ula200.docbook \ vlsys_m428.docbook \ xosd.docbook ## EOF lcdproc-0.5.7/docs/lcdproc-user/drivers/bayrad.docbook000644 001751 000000 00000003423 11506112610 023561 0ustar00mmdolzewheel000000 000000 The bayrad Driver This section talks about using LCDproc with the BayRAD LCD modules by EMAC, Inc. Features The BayRAD LCD modules are designed to fit into 5,25" drive bays. They contain an LCD display that is 20 characters wide and 2 lines high surrounded by 4 buttons labeled Menu, Select, +/Yes, and -/No. BayRAD modules are connected to the PC using a serial RS232 connection getting operating power using the standard floppy drive power connector. For more information see the BayRAD home page Configuration in LCDd.conf [bayrad] Device = DEVICE Select the serial output device to use. If not given, default is /dev/lcd. Speed = { 1200 | 2400 | 9600 | 19200 } Set the the baud rate to use when communicating with the LCD. 9600 is the default, if not specified. lcdproc-0.5.7/docs/lcdproc-user/drivers/CFontz.docbook000644 001751 000000 00000007211 11656571206 023541 0ustar00mmdolzewheel000000 000000 The CFontz Driver This section talks about using LCDproc with the serial LCD displays of the CFA632 and CFA634 series by CrystalFontz, Inc. This driver must be compiled with SEAMLESS_HBARS option enabled. Otherwise horizontal bars will not display correctly. Use configure --enable-driver=CFontz --enable-seamless-hbars to accomplish this. Configuration in LCDd.conf [CFontz] Device = DEVICE Select the serial output device to use. If not given, default is /dev/lcd. Size = ¶meters.size; Set the LCD's dimensions in terms of characters per line and lines. If not given, it defaults to 20x4. Contrast = CONTRAST Set the initial contrast. Legal values for CONTRAST are in the range between 0 and 1000. If not given, it defaults to 560. Brightness = BRIGHTNESS Set the initial brightness. Legal values for BRIGHTNESS range from 0 to 1000. If not given, it defaults to 1000. OffBrightness = BRIGHTNESS Set the initial off-brightness. This value is used when the display is normally switched off in case LCDd is inactive. Legal values BRIGHTNESS are in the range from 0 to 1000. The default is 0. Speed = { 1200 | 2400 | 9600 | 19200 | 115200 } Set the the baud rate to use when communicating with the LCD. It defaults to 9600 if not specified. NewFirmware = ¶meters.yesnodef; Set the firmware version (New means >= 2.0) [default: no; legal: yes, no]. Reboot = ¶meters.yesnodef; Reinitialize the LCD's BIOS [default: no; legal: yes, no] normally you shouldn't need this. lcdproc-0.5.7/docs/lcdproc-user/drivers/CFontzPacket.docbook000644 001751 000000 00000015712 11506112610 024656 0ustar00mmdolzewheel000000 000000 The CFontzPacket Driver CrystalFontz offers a wide range of character and graphical LCD modules. The CFontzPacket driver supports the modules that communicate with the host computer using a packet-based communications protocol with 16-bit CRC (hence the driver name). Currently this line of modules comprises the models: CFA-631 20x2 character LCD with backlight keypad with 4 keys: Up, Down, enter & Escape USB connection for data and power mounting bracket to fit into 3,5" drive bays Optional (via add-on board) temperature sensor, fan and ATX power control connectors (all unsupported by LCDproc) CFA-633 16x2 character LCD with backlight keypad with 6 keys: 4 directions, Enter & Escape serial or USB connection mounting bracket to fit into 5,25" drive bays Temperature sensor and fan control connectors (both unsupported by LCDproc) CFA-533 This is the same as CFA-633 except it misses the fan control capabilities. The temperature monitoring is not supported in LCDproc though. CFA-635 20x4 characters LCD with backlight keypad with 6 keys: 4 directions, Enter & Escape USB connection for data and power four bi-color LEDs to show status information optional mounting bracket to fit into 5,25" drive bays Configuration in LCDd.conf [CFontzPacket] Model = { 533 | 631 | 633 | 635 } Select the LCD model that is connected. Legal values for this option are 631, 533, 633, or 635, with the default being 633. Device = DEVICE Select the output device to use. It may be a serial device or a USB device in serial emulation mode. If not given, it defaults to /dev/lcd. Mac OS X users may need to use one of the /dev/cu devices instead of the /dev/tty ones. USB = ¶meters.yesnodef; Enable this flag if the device is connected to an USB port. For serial ports leave it disabled. [default: no; legal: yes, no] Size = ¶meters.size; Select the LCD size. This overrides the size the driver uses for the selected model (631: 20x2, 533/633: 16x2, 635: 20x4). You should usually not need to set this value! Contrast = CONTRAST Set the initial contrast. Legal values for CONTRAST are 0 - 1000. If not specified, it defaults to 560. Brightness = BRIGHTNESS Set the initial brightness [default: 1000; legal: 0 - 1000] OffBrightness = BRIGHTNESS Set the initial off-brightness [default: 0; legal: 0 - 1000] This value is used when the display is normally switched off in case LCDd is inactive Speed = { 19200 | 115200 } Override the default baud rate the driver uses for communication with the selected LCD model. Allowed values are 19200 (default for CFA-533 and CFA-633) and 115200 (default for the CFA631 and CFA635). You should usually not need to set this value! OldFirmware = ¶meters.yesnodef; Very old 633 firmware versions do not support partial screen updates using 'Send Data to LCD' command (31). For those devices it may be necessary to enable this flag. [default: no; legal: yes, no] Reboot = ¶meters.yesnodef; Reinitialize the LCD's BIOS [default: no; legal: yes, no]. lcdproc-0.5.7/docs/lcdproc-user/drivers/curses.docbook000644 001751 000000 00000005763 11506112610 023634 0ustar00mmdolzewheel000000 000000 The curses Driver This section talks about using LCDproc with the (n)curses library. This diver displays an emulated LCD display of configurable size at a configurable position of the terminal screen using (n)curses. Configuration in LCDd.conf [curses] Foreground = COLOUR Set the foreground color. If not given, it defaults to blue. Legal values for COLOUR are red, black, green, yellow, blue, magenta, cyan and white. Background = COLOUR Set the background color. The default is cyan. The legal values for COLOUR are the same as for the Foreground setting. Backlight = COLOUR Set the background color that is to be used when backlight is set on. backlight color. If not given, the default is red. The legal values for COLOUR are the same as for the Foreground setting. Size = ¶meters.size; display size [default: 20x4] TopLeftx = X-OFFSET TopLefty = Y-OFFSET What position (X,Y) to start the left top corner at. Default: (7,7) UseACS = ¶meters.yesnodef; Tell whether to use ACS (alternative character set) symbols for icons and bars instead of simple ASCII characters. DrawBorder = ¶meters.yesdefno; Tell whether to draw a border around the screen. lcdproc-0.5.7/docs/lcdproc-user/drivers/CwLnx.docbook000644 001751 000000 00000013766 12014174063 023372 0ustar00mmdolzewheel000000 000000 The CwLnx Driver This section talks about using LCDproc with the serial / USB LCDs CW12232, CW12832 and CW1602 by CwLinux. Features The CwLinux CW12232 LCDs are graphical LCDs with 122 x 32 dots that also have a text mode with 20 x 4 characters, the CW12832 are graphical displays with 128 x 32 dots and a 21 x 4 character text mode, the CW1602 LCDs are character LCDs that are 16 characters wide and 2 lines high. The modules can be ordered bare or as part of a kit mounted on brackets that fit in half-height 5.25" (CW12232 and CW1608) or 3,5" (CW12832) drive bays. The mounting brackets optionally feature a 6 button keypad that makes use of the keypad connector on the display modules. The kits allow to programmatically switch on/off their backlight. Newer revisions of the kits also have programmable brighness as well as 4 general purpose IO ports. The displays come in 2 variants that differ how they communicate with the host: The serial modules are connected to the PC using a serial RS232 connection getting operating power using the standard floppy drive power connector, while the USB modules only require an USB connection. For more information see the CwLinux web site Configuration in LCDd.conf [CwLnx] Model = { 12232 | 12832 | 1602 } Select the LCD model [default: 12232; legal: 12232, 12832, 1602] Device = DEVICE Select the output device to use [default: /dev/lcd] May be serial device or USB device in serial emulation mode. Size = ¶meters.size; Select the LCD size [default: depending on model: 12232: 20x4, 12832: 21x4] 1602: 16x2] Speed = { 9600 | 19200 } Set the the baud rate for communication with the LCD. If not given, the default is 19200. Reboot = ¶meters.yesnodef; Reinitialize the LCD's BIOS [default: no; legal: yes, no] normally you shouldn't need this Keypad = ¶meters.yesnodef; Tells if you have a keypad connected. Keypad layout is currently not configurable from the config file. KeyMap_A = KEY KeyMap_B = KEY KeyMap_C = KEY KeyMap_D = KEY KeyMap_E = KEY KeyMap_F = KEY If you have a non standard keypad you can associate any keystrings to keys. There are 6 input key in the CwLnx hardware that generate characters from 'A' to 'F'. Legal values for KEY are Up, Down, Left, Right, Enter and Escape. The following is the built-in default mapping hardcoded in the driver. KeyMap_A Up KeyMap_B Down KeyMap_C Left KeyMap_D Right KeyMap_E Enter KeyMap_F Escape You may leave it unchanged if you have a standard keypad. You can change it if you want to report other keystrings or have a non standard keypad. keypad_test_mode = ¶meters.yesnodef; keypad_test_mode permit to test keypad assignment Default value is no lcdproc-0.5.7/docs/lcdproc-user/drivers/ea65.docbook000644 001751 000000 00000005162 11506112610 023061 0ustar00mmdolzewheel000000 000000 The ea65 driver This section describes the ea65 driver which works with the front panel VFD display on the AOpen XC Cube-AV EA65 media barebone. EA65 front panel VFD The AOpen XC Cube-AV is a barebone designed for using as a media center. It comes with a front panel display which is capable of displaying one line of 9 characters. The display is internally connected to the serial port (/dev/ttyS1) with a fixed rate of 9600 baud. The display uses 13 segments per character. That's why the driver provides no custom characters like the ones for dot matrix displays do. The front panel furthermore has 9 keys which are illuminated by blue LEDs. The LEDs can be controlled with the backlight functions. The keys are not supported by this driver. The red LED (RECORD) can be controlled with the output command of LCDd. Configuration in LCDd.conf [ea65] Brightness = BRIGHTNESS Set the brightness for the front LEDs if backlight is switched on. Legal values for BRIGHTNESS are in the range between 0 and 1000. Values under 300 set the LEDs off. Values between 300 and 700 turn on the LEDs with half brightness. Values above 700 turn on the LEDs with full brightness. If not given, it defaults to 500. OffBrightness = OFFBRIGHTNESS Set the brightness for the front LEDs if backlight is switched off. Legal values for OFFBRIGHTNESS are in the range between 0 and 1000. Values under 300 set the LEDs off. Values between 300 and 700 turn on the LEDs with half brightness. Values above 700 turn on the LEDs with full brightness. If not given, it defaults to 0. lcdproc-0.5.7/docs/lcdproc-user/drivers/eyeboxone.docbook000644 001751 000000 00000012606 11621737633 024337 0ustar00mmdolzewheel000000 000000 The Eyebox One Driver (EyeboxOne) This section describes the Eyebox One. Eyebox One LCD Module Eyebox One is a small rackmounted server marketed by Rightvision (). This server has an LCD module, a keypad, two graphbars and some leds. The LCD is a 20x4 alphanumeric module connected via standard DB-9 cabling and connector. I couldn't find any documentation about it. All I know has been obtained with some reverse engineering. It seems that it can run only at 19.200 baud. Sending ASCII to the module will make it simply display that text at its current cursor position. The module has a built-in BIOS that recognizes commands (sent by transmitting a single-byte "marker" signifying that a command is on the way, followed by the single-byte command character itself along with any parameters, if needed) allowing the programmer to clear the screen, position the cursor anywhere, hide/show the cursor, on/off the backlight, and so on. This module is fast. If updating less than the whole screen, the LCD can update faster than can be seen by the human eye. This, of course, more than meets LCDproc's needs. Eyebox One Driver and lcdproc client You can use the two Eyebox One graphbars, one as a free CPU meter, and one as a free RAM meter with lcdproc client (see eyebox.c in lcdproc client sources). In order to use it, you must execute ./configure with a special parameter: CPPFLAGS=-DLCDPROC_EYEBOXONE ./configure --enable-drivers=EyeboxOne This is only a BETA version modification, take it as a demo... Copyright This section was originally part of the mtxorb.docbook file by Rene Wagner reenoo@gmx.de This section has been modified by Cédric TESSIER (http://www.nezetic.info) Configuration in LCDd.conf [EyeboxOne] Device = DEVICE Select the output device to use [default: /dev/ttyS1] Size = ¶meters.size; Set the display size [default: 20x4] Backlight = ¶meters.yesdefno; Switch on the backlight [default: yes; legal: yes, no] If you choose yes, you can switch on/off the backlight in real time using the LCDproc server menu with the keypad. Cursor = ¶meters.yesnodef; Switch on the cursor? [default: no; legal: yes, no] Speed = { 1200 | 2400 | 9600 | 19200 } Set the the baud rate to use when communicating with the LCD. If not specified, it defaults to 19200. As I said, I think only 19200 is a good choice. LeftKey = D RightKey = C UpKey = A DownKey = B EscapeKey = P EnterKey = The following table translate from EyeboxOne Key to Logical Key. EyeboxOne Enter Key is a \r character, so it's hardcoded in the driver. keypad_test_mode = ¶meters.yesnodef; You can find out which key of your display sends which character by setting keypad_test_mode to yes and running LCDd. LCDd will output all characters it receives. Afterwards you can modify the settings above and set keypad_set_mode to no again. lcdproc-0.5.7/docs/lcdproc-user/drivers/g15.docbook000644 001751 000000 00000001767 11506112610 022724 0ustar00mmdolzewheel000000 000000 The G15 Driver This section talks about using LCDproc with LCD displays on Logitech G15 gaming keyboards. Features This driver uses g15daemon's virtual screen capabilities to enable multiple LCDd instances to display on the LCD of the Logitech G15 gaming keyboard. Text and other rendering services are provided by libg15render from the g15tools project. Input is provided by g15daemon, enabling use of the L1-L5 and G1 keys. The required libraries are available from the g15daemon and g15tools projects at sourceforge.net. Configuration in LCDd.conf Currently there aren't really any configuration options to be set. The width and height are hardcoded based on the font currently used. In the future, now that libg15render has FreeType2 support, there may be options to adjust the font used and the display size. lcdproc-0.5.7/docs/lcdproc-user/drivers/glcd.docbook000644 001751 000000 00000040361 12326762354 023253 0ustar00mmdolzewheel000000 000000 Markus Dolze The glcd Driver The glcd driver (graphic lcd) driver is a "meta driver" that renders text for display on graphic displays. It uses either a built-in 5x8 font (the same as used in elsewhere in LCDproc) or Freetype 2 to draw the characters and icons into an internal frame buffer. That frame buffer is then copied to the display by a small sub-driver called connection type driver (CT-driver). LCDproc is compiled with FreeType support by default if it is installed on your system. It is enabled by default, too. However a font is not configured by default. Thus the driver will not start unless a font is configured! Connections Connection type t6963 Support for displays using a Toshiba T6863 controller connected to the parallel port. Wiring is the same as for the t6963 driver. Refer to for details. If used without FreeType this connection type uses the same font as the t6963 driver but draws the characters into the graphic memory of the T6963. You must configure the display for 8x8 font to make this connection type work! Connection type png This connection type writes out the frame buffer into files in /tmp. The files are named lcdproc######.png where ###### is a number starting at 0. As a new file is written on any change to the screen it is best to turn off the heartbeat. Connection type serdisplib Use the serdisplib library () for output. This enables use of a number of graphical displays connected to a parallel, serial, or USB port. See the serdisplib web page for details, especially for available options for your display. Connection type glcd2usb Support for the glcd2usb device (, a graphic LCD to USB converter based on Atmel ATmega16 and the V-USB stack. This device features an adjustable backlight and 4 keys. Right now only displays with the KS0108 controller are supported. The device has 4 keys which may be configured using the KeyMap_A (leftmost key) to KeyMap_D (rightmost key) settings. Note that any size setting configured in LCDd.conf is 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. Connection type picolcdgfx Support for the picoLCD Graphics 256x64 display from mini-box.com. Configuration in LCDd.conf [glcd] Settings affecting all connection type drivers ConnectionType = { t6963 | glcd2usb | png | picolcdgfx | serdisplib | x11 } Specify which connection type to use. See above for details. Size = ¶meters.size; Specifies the size of the LCD in pixels. Default: 128x64. Maximum value supported: 640x480. The size in characters is automatically calculated from this value and the CellSize value (see below) and cannot be configured. Contrast = CONTRAST Set the initial contrast (if supported by the connection type driver). Legal values for CONTRAST are 0 - 1000. If not given, it defaults to 600. Brightness = BRIGHTNESS Set the initial brightness when the backlight is "on" (if supported by the connection type driver). Legal values are 0 - 1000. If not given, it defaults to 800. OffBrightness = BRIGHTNESS Set the initial brightness when the backlight is set "off" (if supported by the connection type driver). Legal values are 0 - 1000. If not given, it defaults to 100. Available parameters if compiled with FreeType support useFT2 = ¶meters.yesdefno; Tell whether to use FreeType2 or not. It is set to yes by default. If turned off (set to no), the fixed internal 5x8 font is used to draw characters and icons. normal_font = FONTFILE Set path to the font file to use, e.g. /usr/local/lib/X11/fonts/TTF/andalemo.ttf. This option is required if FreeType 2 support is enabled, but it is not set to any default value. A font with a fixed character width (monotype) is strongly recommended. fontHasIcons = ¶meters.yesdefno; Many fonts to not include the Unicode glyphs used for drawing icons. If this option is set to no then the internal 5x8 font is used even if FreeType is enabled. This option is on (yes) by default. CellSize = ¶meters.size; Specifies the size of the character cell in pixels. Characters will be drawn within this cell. Default: 6x8; minimum value 4x6; maximum value: 24x32. Keypad settings KeyRepeatDelay = DELAY DELAYis the time in milliseconds from first key report to first repeat. Set to 0 to disable repeated key reports. Allowed values are between 0 and 3000, the default is 500. KeyRepeatInterval = DELAY DELAYis the time in milliseconds between repeated key strokes. Allowed values are between 0 and 3000, the default is 300. This setting is ignored, if KeyRepeatDelay is disabled (set to zero). KeyMap_A = KEY KeyMap_B = KEY KeyMap_C = KEY KeyMap_D = KEY KeyMap_E = KEY KeyMap_F = KEY These settings allow to assign arbitrary key strings to key strokes. Up to 26 keys may be configured ('A' to 'Z'). The following is the built-in default mapping hard-coded in the driver. Only keys 'A' to 'F' are used by default. KeyMap_A Up KeyMap_B Down KeyMap_C Left KeyMap_D Right KeyMap_E Enter KeyMap_F Escape Settings for the t6963 connection type Port = PORT Specify the address of the parallel port the LCD is connected to. Common values for PORT are 0x278, 0x378 and 0x3BC. If not given, the default is 0x378. bidirectional = ¶meters.yesdefno; Use parallel port in bi-directional mode. [default: yes; legal: yes, no] Most LPT ports can be used in bi-directional mode. It is required for proper timing of the display. delayBus = ¶meters.yesnodef; Use additional delay in read / write operations. [default: no; legal: yes, no]. As the driver implements busy checking usually no additional delays are required. Settings for the serdisplib connection type serdisp_name = NAME This is the name or alias to select a display driver in the serdisplib library. As there is not default value setting this option is mandatory. serdisp_device = DEVICE Set the device to use. Unlike elsewhere in LCDd.conf this is a device description understood by serdisplib. As there is not default value setting this option is mandatory. serdisp_options = OPTIONS OPTIONS is a serdisplib option string, which is a list of semicolon separated key / value pairs. Use this to pass any additional options to serdisplib, e.g. wiring or rotation settings. As the value will contain equal signs the whole OPTIONS value must be enclosed in double quotes. The display width and height are always set using the values from the glcd driver (see above). Any width / height values set in the option string will be ignored. Settings for the x11 connection type x11_PixelSize = PIXELS + GAP Each LCD dot is drawn in the X window as a filled rectangle 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. x11_PixelColor = 0xRRGGBB The color used to draw each LCD dot at full contrast and full brightness. Default is 0x000000. x11_BacklightColor = 0xRRGGBB The color used for the backlight at full brightness. Default is 0x80FF80. x11_Border = PIXELS Extra space in pixels around the LCD portion of the X window. Default is 20. x11_Inverted = ¶meters.yesnodef; Swap the colors for the pixel and backlight within the LCD portion of the X window. This results in an inverted display. Settings for the picolcdgfx connection type picolcdgfx_KeyTimeout = TIMEOUT The time in milliseconds to wait for a key press before assuming no key was pressed. This settings is the usb_read timeout. Default 125. picolcdgfx_Inverted = ¶meters.yesnodef; When set to yes, the pixel will be inverted. Default no. lcdproc-0.5.7/docs/lcdproc-user/drivers/glcdlib.docbook000644 001751 000000 00000014725 12045443052 023734 0ustar00mmdolzewheel000000 000000 Lucian Muresan The glcdlib Driver This section talks about using LCDproc with LCD displays supported by graphlcd-base. Connections The so-called "meta-driver" glcdlib extends LCDproc's supported drivers by all the drivers supported by graphlcd-base, which you can get from . In order to be able to use it, you have to get and install the glcdprocdriver from before configuring the LCDproc build process --enable-drivers=glcdlib. Configuration in LCDd.conf [glcdlib] Mandatory settings Driver = GRAPHLCD-DRIVER Specify which graphical display supported by graphlcd-base to use. Legal values for GRAPHLCD-DRIVER are specified in graphlcd's configuration file /etc/graphlcd.conf. For graphlcd 0.13 they comprise avrctl, framebuffer, gu140x32f, gu256x64-372, gu256x64C-3xx0, hd61830, image, ks0108, noritake800, sed1330, sed1520, serdisp, simlcd, and t6963c. If not specified it defaults to image. UseFT2 = ¶meters.yesdefno; Tell whether to use FreeType2 or not. If set to no use graphlcd's bitmap fonts, which is only one size/font file. If set to to the default value yes use the fonts that FreeType2 provides. Setting it to yes requires Freetype2 support in libglcdprocdriver and its dependants. TextResolution = ¶meters.size; Give text resolution in fixed width characters. If it won't fit according to the available physical pixel resolution and the minimum available font face size in pixels, 'DebugBorder' will automatically be turned on. If not specified, it defaults to 16x4. FontFile = FILENAME Set path to font file to use, e.g. /usr/share/fonts/corefonts/courbd.ttf. Availalble parameters if <property>UseFT2</property> = <literal>yes</literal> CharEncoding = CHARSET Specify character encoding to use, e.g. iso8859-2. If not given, use the default ISO8859-1. MinFontFaceSize = COLUMNS x ROWS minimum size in pixels in which fonts should be rendered Optional settings Brightness = BRIGHTNESS Brightness (in %) if applicable Legal values are 0 - 100. If not specified, the default is 50. Contrast = CONTRAST Set the contrast (in %) if applicable. Legal values are 0 - 100, with 50 being the default when not specified. Backlight = ¶meters.yesnodef; Backlight if applicable UpsideDown = ¶meters.yesnodef; flip image upside down Invert = ¶meters.yesnodef; invert light/dark pixels ShowDebugFrame = ¶meters.yesnodef; turns on/off 1 pixel thick debugging border within the usable text area, for setting up TextResolution and MinFontFaceSize (if using FT2); ShowBigBorder = ¶meters.yesnodef; border around the unused area ShowThinBorder = ¶meters.yesnodef; border around the unused area PixelShiftX = SHIFTX PixelShiftY = SHIFTY Shifts the content of the display by SHIFTX (default: 0) and SHIFTY (default: 0) pixels. lcdproc-0.5.7/docs/lcdproc-user/drivers/glk.docbook000644 001751 000000 00000004577 11506112610 023107 0ustar00mmdolzewheel000000 000000 The glk Driver This section talks about using LCDproc with LCD displays that use the Matrix Orbital GLK and GLC chipset. Supported devices Currently the drivers supports the following devices: GLC12232 (20x4) GLC12864 (20x8) GLC128128 (20x16) GLC24064 (40x8) GLK12232-25 (20x4) GLK12232-25-SM (20x4) GLK12864-25 (20x8) GLK128128-25 (20x16) GLK24064-25 (40x8) Modules not in the list above are not recognized and the driver will not load if it encounteres an unrecognized display. Configuration in LCDd.conf [glk] Device = DEVICE select the serial device to use [default: /dev/lcd] Contrast = CONTRAST Set the initial contrast. Legal values for CONTRAST are 0 - 1000. If not given, it defaults to 560. Speed = { 9600 | 19200 | 38400 } Set the the baud rate for communication with the LCD. The default is 19200. lcdproc-0.5.7/docs/lcdproc-user/drivers/hd44780.docbook000644 001751 000000 00000325243 12313532720 023335 0ustar00mmdolzewheel000000 000000 The HD44780 Driver The HD44780 has become the de-facto standard of alphanumeric character displays. Although the original Hitachi HD44780 is long out of production, its command set has survived in a variety of (fully or nearly) compatible LCD, VFD and even OLED displays sold by a broad range of manufacturers all over the world. To name only a few: KS0066, KS0070, KS0076, LC7985, NT3881, SED1278, ST7066 ... The command set of these displays, which sometimes are advertised as being "industry standards compatible", is thus the workhorse of controllers for displays ranging from 8x1 to 20x4 or 40x2 characters. There are even displays with larger dimensions sporting two controllers, one for each half of the display. The HD44780 driver supports various ways of connecting HD44780 devices to your system. Each of these different ways is called a connection type of the driver. Depending on the connection type and the display connected, the driver supports various special features. Input keys Software controllable brightness / backlight Software controllable contrast multiple displays / multi-controller displays The following table lists the available connection types, sorted by the kind of connection (parallel port, serial port, USB, I2C, SPI or others). HD44780: Connection Types ConnectionType Wiring / Display Type Parallel port connection types: 4bit 4-bit wiring. This is the default. 8bit 8-bit wiring ("lcdtime" style) winamp 8-bit wiring ("winamp" style) serialLpt Serial LPT wiring Serial (RS-232) connection types: picanlcd PIC-an-LCD serial device "picanlcd" lcdserializer LCD serializer "lcdserializer" los-panel LCD on Serial panel device "los-panel" () vdr-lcd VDR LCD serial device "vdr-lcd" vdr-wakeup VDR-Wakeup module "vdr-wakeup" USB connection types: pertelian Pertelian X2040 LCD display () lis2 LIS2 from VLSystem () mplay MPlay Blast from VLSystem () usblcd USBLCD adapter from Adams IT Services () bwctusb BWCT USB device "bwctusb" () lcd2usb Till Harbaum's LCD2USB () usbtiny Dick Streefland's USBtiny () uss720 Belkin USS-720 USB-to-IEEE 1284 Bridge (Belkin F5U002) USB-4-all The USB-4-all controller board from Sprut () ftdi Display connected to a FTDI RS2232 (dual channel) or FTDI RS232 (single channel) USB chip I2C connection types: i2c LCD driven by PCF8574(A)/PCA9554(A) connected via I2C piplate Adafruit RGB Positive 16x2 LCD+Keypad for Raspberry Pi SPI (Serial Peripheral Interface): spi Display using a KS0073 or similar in serial mode accessed via Linux SPI device pifacecad PiFace Control and Display for Raspberry Pi Other connection types: ethlcd Display connected via TCP to PoE powered ethlcd device () raspberrypi LCD connected to the GPIO header of a Raspberry Pi
If you suspect the table above to be outdated, you might want to have a look at server/drivers/hd44780-drivers.h in LCDproc's source directory which contains the actual translation code.
Connections Common connections for all connection types No matter what connection type you choose, you will always need some connections. They are explained here. Power All variants use the same method of obtaining power. i.e., for each LCD: HD44780: Power Connections LCD Signal name pin VEE 1 GND (connect to any of pins 18 - 25 of you parallel port) VCC 2 +5V VLC 3 (contrast adjustment)
Always double check your power connection, your display will probably not survive a reversely connected supply ! There are several ways to get 5V: Connect to a 5V line intended for disk drives (the red wire is 5V, black is GND). Get it from the VCC and GND pins of an USB connector. For the USB connection types this is done automatically, as the circuits used there automatically power the LCD. Get it from a joystick port (pin 1 and 9 are 5V, 4, 5 and 12 are GND). It seems that some soundcards can use these lines for communication, so if you want to use this first check whether it really gives a 'clean' 5V. If you don't have a backlight, you can sometimes get the needed mA's from the LPT port itself. Connect a few diodes from the data pins to a capacitor and you have the 5V. If it's strong enough is another question... Get it from the keyboard connector. I do not recommend to use this with a backlight, as the keyboard connector is often protected with a fuse of 100mA or 200mA.
HD44780: Connecting the contrast adjusting pin (V<subscript>LC</subscript>)
Keypad You can connect a keypad with most connection types. The maximum supported number of keys differs per type. There are several ways to connect the keys to the input pins. Direct Keys If you connect a key like sketched below, then you can only connect one key per input pin. It is a simple solution if you need only few keys.
HD44780: Direct Keys
By default, the following keystrokes are generated by the different keys: HD44780: Direct Key Mapping key index mapped string X1 A X2 B X3 C X4 D X5 E
You can change the mapping using the KeyDirect_NUM configuration option, where NUM is the subscript to the X in the table above.
Matrix Keys Using a matrix, we can connect much more keys. To simplify the drawing here, we replace all switches with an @ symbol:
HD44780: Single Matrix Key
We connect the matrix of keys like this:
HD44780: Complete Key Matrix
As you can see, you need 1 resistor per X line, and 1 diode per Y line. By default, lcdproc will presume that you have a keypad with a layout like a telephone connected, with X and Y lines connected as show. To be more precise, it assumes this mapping: HD44780: Matrix Keypad Layout X1 X2 X3 X4 X5 Y1 1 2 3 A E Y2 4 5 6 B F Y3 7 8 9 C G Y4 * 0 # D H
This mapping can be changed using the KeyMatrix_X_Y configuration option, where X and Y are the subscripts to the respective axes above. If you only need e.g. 10 keys, leave the rest away. You should modify and recompile the driver to get an other keypad layout. You can buy arrays of keys that are connected like this in the electronics shop. They usually call it a matrix keypad. To hook it to lcdproc, you would only need to add the resistors and diodes. If you want to use just one return line, for example with the serialLpt wiring, it looks (completely drawn) like this:
HD44780: One Return Line
If the driver generates keypresses without that you actually press a key, it might be that the unconnected input lines are picking up electromagnetic waves from the air. In that case connect the unconnected input lines (pin 10, 11, 12, 13 and 15 of the LPT) to VCC = 5V.
Backlight A small extension allows you to switch the backlight of the display on and off. At the moment only the 4bit and winamp connection types support this. The extension uses one output pin, you cannot use that pin for other functions anymore. The wiring looks like this:
HD44780: Backlight Wiring
Sometimes the backlight connections are not on the 'main' connector, but on the side. If that is the case, there is usually NO RESISTOR present to limit the current through the LEDs. Therefore you should then add a resistor after the transistor of about 10 ohm (see display documentation). If you want the backlight to light a bit while it is "switched off", you can add a resistor bypassing the transistor from e to c, with a value of, say 47ohm or 22ohm. (My 4x20 has an internal resistor of 6ohm, so with 47 ohm extra it lights at only 1/9th. I like this. Joris.)
4bit This wiring is originally based on "lcdtext" (by Matthias Prinke). HD44780: 4bit Pinouts (1) printer port <-> LCD name pin name pin GND VEE 1 +5V VCC 2 (contrast adjustment) VLC 3 D4 6 RS 4 GND RW 5 D6 8 EN 6 D0 2 D4 11 D1 3 D5 12 D2 4 D6 13 D3 5 D7 14
The RW (pin 5) line of the display decides whether the display receives data from the LPT port, or whether it sends data to the LPT port: if grounded it receives, if High or connected to nothing at all it "sends" (i.e., will not work as intended). So, if you are not sure that you need it otherwise, then connect it to GND. This certainly applies if you have only one display. Theoretically this wiring sends the data over twice as slow as the winamp or ext8bit wirings, because it only sends 4 bits at a time. The 4bit connection type supports more than one display connected to the same parallel port. If you want to connect more than one display, then wire the all the displays to the parallel port according to the scheme above with the exception of the EN (pin 6) line of the LCDs. For the second and further displays, you can find the wiring for the EN (pin 6) line in the table below. HD44780: 4bit Pinouts (2) printer port <-> LCD name pin name pin D7 9 EN2 6 of 2nd display D5 7 EN3 6 of 3rd display STR 1 EN4 6 of 4th display LF 14 EN5 6 of 5th display INIT 16 EN6 6 of 6th display SEL 17 EN7 6 of 7th display
The optional keypad can be connected as follows: HD44780: 4bit Keypad Pinouts printer port <-> keypad remarks name pin pin D0 2 Y1 D1 3 Y2 D2 4 Y3 D3 5 Y4 D4 6 Y5 D5 7 Y6 Only if not used for backlight or 3rd controller. nSTRB 1 Y7 Only if not used for additional controllers. nLF 14 Y8 INIT 16 Y9 nSEL 17 Y10 nACK 10 X1 BUSY 11 X2 PAPEREND 12 X3 SELIN 13 X4 nFAULT 15 X5
The optional backlight wiring should be connected to D5, pin 7.
8bit "Winamp" This type of connection should work with winamp. HD44780: "Winamp" wiring printer port <-> LCD name pin name pin D0 2 D0 7 D1 3 D1 8 D2 4 D2 9 D3 5 D3 10 D4 6 D4 11 D5 7 D5 12 D6 8 D6 13 D7 9 D7 14 nSTRB 1 EN 6 nLF 14 RW 5 (EN3 6 - LCD 3) (optional (*) ) INIT 16 RS 4 nSEL 17 EN2 (6 - LCD 2) (optional)
(*) on the RW line of the display: this line decides whether the display receives data from the LPT port, or whether it sends data to the LPT port: if grounded it receives, if High or connected to nothing at all it "sends" (i.e., will not work as intended). So, if you are not sure that you need it otherwise, then connect it to GND. This certainly applies if you have only one display. If you want the display to work with the Winamp plugin, wire nLF (pin 14) to RW of your LCD. You can then use the plugin in bidirectional mode (which is much faster). With 3 connected LCDs this is not possible. Note from Benjamin: I haven't tried using winamp while having the third LCD connected to this line. The optional keypad can be connected as follows: HD44780: "Winamp" wiring - Keypad printer port <-> keypad name pin pin D0 2 Y1 D1 3 Y2 D2 4 Y3 D3 5 Y4 D4 6 Y5 D5 7 Y6 D6 8 Y7 D7 9 Y8 nACK 10 X1 BUSY 11 X2 PAPEREND 12 X3 SELIN 13 X4 nFAULT 15 X5
The optional backlight wiring should be connected to nSEL, pin 17.
8bit "lcdtime" This is originally based on "lcdtime" (by Benjamin Tse blt@ComPorts.com) and allows you to combine the LCD with a LED bargraph. The LCD is driven by LCDproc and the LEDs by another program such as portato. Further details can be obtained from: The LCD connections are: HD44780: "lcdtime" wiring printer port <-> LCD name pin name pin D0 2 D0 7 D1 3 D1 8 D2 4 D2 9 D3 5 D3 10 D4 6 D4 11 D5 7 D5 12 D6 8 D6 13 D7 9 D7 14 nSEL 17 - nSTRB 1 RS 4 nLF 14 RW 5 (optional - pull LCD RW low (*) INIT 16 EN 6
(*) on the RW line of the display: this line decides whether the display receives data from the LPT port, or whether it sends data to the LPT port: if grounded it receives, if High or connected to nothing at all it "sends" (i.e., will not work as intended). So, if you are not sure that you need it otherwise, then connect it to GND. See the lcdtime tar-ball (above) for full details of the bargraph connections. The optional keypad can be connected as follows: HD44780: "lcdtime" wiring - keypad printer port <-> keypad name pin pin D0 2 Y1 D1 3 Y2 D2 4 Y3 D3 5 Y4 D4 6 Y5 D5 7 Y6 D6 8 Y7 D7 9 Y8 nSTRB 1 Y9 nSEL 17 Y10 (only if not used for backlight) nACK 10 X1 BUSY 11 X2 PAPEREND 12 X3 SELIN 13 X4 nFAULT 15 X5
The backlight wiring should be attached to nSEL, pin 17. Because the portato program (mentioned above) also uses this pin to control the bargraph, you cannot use the backlight control together with the bargraph.
Serial LPT This interface uses a handful of wires to interface to the HD44780. Suitable for high noise, long connections. Designed by Andrew McMeikan andrewm@engineer.com. I (Joris) have extended this driver and the wiring a bit. It now supports keys again (it had earlier supported keys, but some time did not). Further I have extended the driver and the wiring to be able to run using 2 instead of 3 output pins. That's even one less pin ! :) Of course the use of fewer lines than the other wirings can not stay without drawbacks. In this case the simplicity of the long feeding wires is compensated by some intelligence in the decoding of the data. If you have no experience with the soldering iron, I do not recommend to build this wiring. OK, so here is the wiring. First of the 'simple' 3 wires version. IC1 is the shift register, a 4094. Do not forget to connect the 5V to pin 16 and GND to pin 8 of the IC.
HD44780: Serial LPT wiring ('simple')
The second possible wiring is with 2 output lines. This one is a bit more complex. If you do not understand the schematic, do not build it.
HD44780: Serial LPT wiring ('complex') o----|R Q6|--------------------o Y7 | 22k | |/ | |13 | --- IC1 | Q7|---+ +--o 5 RW | --- | | | 5V | | |100p ----------- | O === | | | | | === | .-. | | | |22k +--------------------------------------+ | | | '-' | ___ 11|\ 10 | 5|\ 6 +--|___|--+----| >o-------------------||-----+----| >o--o 6 EN 22k | |/ 22p |/ --- IC1 IC1 --- |22p | IC1=74HCT14 (6x Schmitt trigger inverter) === 5V O--+-------+------+------+-----------------------+-----o 2 VCC | | | | 13|\ 12 | | | | +---| >o- | |100n O 14 O 14 |/ .-. --- IC1 IC2 | |<---o 3 Vlcd --- O 7 O 7 1|\ 2 3|\ 4 | |10k | | | +--| >o- +--| >o- '-' GND | | | | |/ | |/ | 18..25 o------+-------+------+-------+----------+-----+-----+-----o 1 GND | === GND ]]>
Serial LPT Keypad To understand this part of the serialLpt documentation, you also need to read the keypad section in this document. serialLpt wiring supports a keypad. The 3 wires version supports 8 keys, or if you use multiple return lines up to 8 x 5 = 40 lines. The 2 wires version supports 7 keys, or with multiple return lines 7 x 5 = 35 keys. HD44780: Serial LPT - Keypad return lines printer port <-> keypad name pin pin nACK 10 X1 BUSY 11 X2 PAPEREND 12 X3 SELIN 13 X4 nFAULT 15 X5
On lines longer than, say a meter, you should buffer the return line(s). If you only have 1 return line, you can buffer it with two remaining buffers from the 74HCT14:
HD44780: Serial LPT - Keypad return lines buffered o------| >o---|___|---+---o input pin on LPT port return |/ |/ 220E | IC1 IC1 --- --- 1nF | === ]]>
Serial LPT Backlight Also a backlight is supported. You will also need a port from the 74HCT14 for that. The BL output below should be connected to the BL input in the backlight section
HD44780: Serial LPT - Backlight extra circuit o----o BL output LPT-D3 470k | |/ --- IC1 --- |100nF | === ]]>
spi This connection type drives a LCD in serial mode (supported on Hitachi HD66712, Samsung KS0073 and KS0074 (and clones) controllers) connected to some Linux SPI device. This connection type is currently only supported on Linux. It is strongly recommended to use a SPI implementation with hardware support, e.g. on the Raspberry Pi. As the SPI communication to the display cannot drive a backlight switch, this connection type features a BacklightDevice option that can use a GPIO pin exposed via sysfs (see eLinux GPIO). FTDI FT2232D USB chip "ftdi" You can use a FTDI FT2232D dual channel USB <-> parallel FIFO chip to connect a display via the USB bus. The chip is switched to bitbang mode and drives both channels as outputs to control the display in 8bit mode. HD44780: 8bit FTDI FTDI chip <-> LCD name pin name pin ADBUS0 24 D0 7 ADBUS1 23 D1 8 ADBUS2 22 D2 9 ADBUS3 21 D3 10 ADBUS4 20 D4 11 ADBUS5 19 D5 12 ADBUS6 18 D6 13 ADBUS7 17 D7 14 BDBUS0 40 RS 4 BDBUS1 39 RW 5 BDBUS2 38 EN 6 BDBUS3 37 BL Backlight (optional)
You can configure the USB vendor/product ID in LCDd.conf. The wiring of the control lines can optionally be reconfigured, please look at the driver source if you really need that. The backlight line is driven high when the backlight is on. Therefore the standard backlight circuit () will not work. Use the following instead.
hd44780/ftdi: Backlight Wiring
Alternatively you can use a single channel FTDI FT245BM USB <-> parallel FIFO chip and use the display in its 4 bit mode. HD44780: 4bit FTDI FTDI chip <-> LCD name pin name pin D0 25 D4 11 D1 24 D5 12 D2 23 D6 13 D3 22 D7 14 D4 21 EN 6 D5 20 RS 4 D6 19 RW 5 D7 18 BL Backlight (optional)
The following special configuration settings are required to use a single channel FTDI FIFO chip: HD44780: Configuration for FTDI 4bit
LIS2 USB device "lis2" LIS2 from VLSystem () is a full featured USB VFD module with four channel fan controls. This device can be accessed as a serial device with the help of the kernel module ftdi_sio.ko that maps the USB port to a serial port (e.g. /dev/ttyUSBx). MPlay Blast USB device "mplay" MPlay Blast from VLSystem () is a full featured USB VFD module with two channel fan controls and two channel temperature sensors. This device can be accessed as a serial device with the help of the kernel module ftdi_sio.ko that maps the USB port to a serial port (e.g. /dev/ttyUSBx). LCD on Serial panel device "los-panel" The LoS-Panel is a DIY device built using an Atmel ATtiny2313 and supports the following features: Drives displays with one controller. Switchable backlight. One 4x4 matrix keypad and 4 direct keys. The direct keys are reported as a fifth column of a matrix keypad to LCDd. Column and rows are reported reverse (column 1 / row 1 is in the lower right corner) to LCDd which expects (1/1) to be the upper left corner. You have to take this into account when configuring keys. See for more information on this device. VDR LCD serial device "vdr-lcd" … to be documented … Please address Matteo Pillon for further information. VDR-Wakeup module "vdr-wakeup" The VDR-Wake module by Frank Jepsen is a serial IO extension module for the famous Linux-based VDR that allows to connect an LCD to it and supports LCDproc. See (German) for more information on VDR-Wakeup. Pertelian X2040 "pertelian" The Pertelian X2040 includes an HD44780 display with enclosure and USB connection. In order to work with LCDproc in Linux you need the usbserial.ko and ftdi_sio.ko kernel modules loaded. The display will then be available on a serial port /dev/ttyUSBx. See the X4020 product page for more information. PIC-an-LCD serial device "picanlcd" The PIC-an-LCD module is also supported. It is not connected to the LPT port but to a serial port, which saves you from a lot of potential problems. To use it, specify the device to which you have connected the module in the config file with the Device setting. The default is /dev/lcd. It does not support a keypad nor backlight switching. As of 2012 these devices are not sold anymore. Search the Internet Archive for a copy of if you need the manual. LCD serializer device "lcdserializer" LCD serializer connection is technically the same as PIC-an-LCD with the same advantages, it uses the serial port making things really simple. Unlike PIC-an-LCD LCD serializer is not a commercial product. it's just a project found digging on the net and freely available. You have all the tools and the code to build it yourself and to customize the behaviour of the device. What you need Some electronic knowledge and familiarity with the soldering iron A PIC16F84 (I used PIC16F84A) or PIC16C54 JDM PIC programmer gputils and picprog installed on your GNU/Linux box Burning the PIC First, you need to download the ASM source for your PIC and then make the hex: $ gpasm lcd16f84_custom.asm Now the binary is ready to be flashed to the PIC. Connect the programmer with the PIC installed and issue the following command to see it burning ;-): $ picprog --erase --burn --input lcd16f84.hex --pic /dev/ttyS0 Running lcdproc It's time to build the operating circuit, remember this driver uses a baud rate of 9600, so JP2 need to be closed. Now power on the board. You should see OK on the LCD screen. Otherwise double-check all the connections. Change LCDd.conf to include the following statements in the [hd44780] section: ConnectionType=lcdserializer Device=/dev/ttyS0 Finally, start the daemon and relax watching lcdproc running. BWCT USB LCD module "bwctusb" The BWCT USB LCD module, sold by Bernd Walter Computing Technology () is a little board that can be piggy-packed to a HD44780 display and connects that to USB. The board, driven by the bwctusb connection type, does neither support a keypad for input, nor more than one single-controller display, nor does it allow setting the backlight or brightness. But you can set the display's contrast using software (see the Contrast configuration parameter). Special configuration options If there is more than one BWCT USB module connected to the system, the SerialNumber configuration parameter allows selecting which display is used in LCDd. Till Harbaum's "lcd2usb" LCD2USB is a cheap but powerful do-it-yourself interface to connect HD44780 based displays via USB, consisting of easily available parts only. The device supports software adjustable contrast and backlight as well as dual controller displays (required for 4*27 and 4*40). It is based upon an Atmel AVR Mega8 CPU with a pure software implementation of the USB protocol for the Atmel AVR microcontroller series. The whole interface incl. the hardware layout is under a GPL like license. This means that you can take these schematics and use it as a basis for your own interface e.g. for a graphic LCD. Two keys can be connected to the LCD2USB interface board. They can generate three key events that can be mapped to key names using the DirectKey_1 to DirectKey_3 commands: one for each key and the third if the keys are pressed simultaneously. With this 3-key setup, menus can be used (see example below). This driver supports the original LCD2USB interface board as described above as well as compatible devices like those sold by Lcdmod Kit or those developed by Malte Pöggel. Special configuration options Besides the standard configuration options for hd44780 displays, the lcd2usb connection type supports three additional options: Contrast to set the display's contrast, Brightness to set the display's brightness when the backlight is switched on and OffBrightness to set the display's brightness when is backlight is switched off. All three options expect a number in the range from 0 to 1000. HD44780: Configuration for LCD2USB In order to make the lcd2usb connection type work with a 2-controller display you may need to set the vSpan config option accordingly. Dick Streefland's "USBtiny" USBtiny is a software implementation of the USB low-speed protocol for the Atmel ATtiny microcontrollers. It is also the name of a 'reference circuit' using the ATtiny2313. The reference circuit features an IR receiver for remote controls and a LCD. Due to hardware limitations of the ATtiny2313 the LCD does not have switchable backlight, adjustable contrast, any keys, nor does it support displays with more than one controller. If you want these features and do not require the IR receiver we recommend to take a look at the LCD2USB device. LCDproc does not make use of the IR receiver. 3rd party software is required to make it do anything, e.g. LIRC. USS-720 USB-to-IEEE 1284 Bridge (Belkin F5U002) "uss720" The USS-720 USB-to-IEEE 1284 Bridge is a fully featured USB to parallel chip that is used in most (but not all) Belkin F5U002 USB Parallel Printer Adapters. Because these adapters are inexpensive and readily available on the second-hand market, they provide an excellent solution for users who want to experiment with a parallel port but only have USB ports on their computers. Because the chip acts as a parallel port, the driver maintains the same features and wiring as the 8-bit "winamp" driver. However, because most USB Parallel Printer Adapters use a centronics printer connector, be sure to convert the pin numbering of the parallel port pins in the "winamp" wiring to the pin numbering of the centronics port. Many tables are available on the internet that illustrate how the pin numbering differs between the two. Special configuration options Because several manufacturers used the USS720 chip in their USB Parallel Printer Adapters, the VendorID and ProductID options are configurable in the LCDd.conf file. Not all Belkin F5U002 USB Parallel Printer Adapters used the USS720 chip. Look for the dark grey adapters with the removable USB cable for best results. I<superscript>2</superscript>C with Port-Expander If you have an I2C port available that is supported by your kernel (through /dev/i2c*), you can add a I2C port expander there (PCF8574P in this example).
HD44780: PCF8574P port expander on I<superscript>2</superscript>C bus
Configuration HD44780: Configuration for I<superscript>2</superscript>C with port expander The Device configuration setting denotes the device file of your I2C bus (here /dev/i2c-0). You have to load the kernel standard module i2c-dev.ko and the bus driver, but no I2C chip modules (e.g. pcf8574.ko)! The Port config option contains the I2C address of the I2C port expander (here 0x20, the PCF8574 from the example above, with all address bits set to 0). Bit 8 of the address (normally 0 in I2C addresses) has a special meaning: It tells the driver to treat the device as PCA9554 or similar, a device that needs a 2-byte command, and it will be stripped off the address. HD44780: Examples of I<superscript>2</superscript>C port expander addresses Port value Meaning 0x200x27 PCF8574 with A[012]=07 0x380x3f PCF8574A with A[012]=07 0xa00xa7 PCA9554 with A[012]=07 0xa00xa7 PCA9554A with A[012]=07
ethlcd Device The ethlcd () device is simply an LCD display driven by an ATmega microcontroller, controlled and powered by "home-made" Power over Ethernet. The hardware and software are open source. Features ethernet connection using ENC28J60 ethernet controller Power over Ethernet (data and power using single UTP cable) Atmel's ATmega168 microcontroller 6 buttons (MENU, UP, DOWN, LEFT, RIGHT, ENTER) backlight control in three states: ON, Night-Mode (partialy ON) and OFF beeper device act as a TCP server - LCDproc driver is connecting to device just by creating a TCP socket - no need to PC-side additional hardware besides NIC
HD44780: ethlcd - block diagram | ethernet |<========+------> PC running | | | | | | controller | | | LCDproc | | | | | | | | | | |_________| |___________| |____________| | | | | | | | | | | | beeper | | |_____________________________________________________| | ethlcd AC Adapter ]]>
The device is "visible" to LCDproc just like any other HD44780 device. The difference is the wiring - instead of connecting the display directly to PC (via serial/parallel/usb port), it is connected via ethernet and the communication is done over TCP connection. The main feature is - that to power and control the LCD is needed single UTP cable. To use the driver, specify the device IP address or hostname, on which the ethlcd device is accessible by setting in config file the Device value. The default is ethlcd.
USBLCD adapter The USBLCD adapter from Adams IT Services () is a small interface board which allows you to connect an alphanumerical display module based on the HD44780 or compatible controller to the USB. The display will be powered by the USB. It features a switchable backlight (on or off) and can be used with 16x2, 16x4 or 20x4 displays. The usblcd connection type communicates with a kernel driver by using a device file /dev/usb/lcdx. The kernel driver providing this device currently only exists for Linux kernels newer than 2.4.20-pre7. As of 2007 these device are not sold anymore. This driver has been ported from lcdproc 0.4.5 to support existing users. USB-4-all controller The USB-4-all controller board from Sprut () is a small interface board which allows you to connect different hardware to the USB. The subdriver for LCDproc supports dual HD44780 displays and a 4x4 keypad as well as software adjustable contrast and brightness (backlight). HD44780: USB-4-all - Display connection USB-4-all LCD1 LCD2 name pin name name RB7 28 D7 D7 RB6 27 D6 D6 RB5 26 D5 D5 RB4 25 D4 D4 RB3 24 R/W R/W RB2 23 RS RS RB0 21 EN RC0 11 EN
HD44780: USB-4-all - Keypad connection USB-4-all keypad name pin name RA0 2 X1 RA1 3 X2 RA2 4 X3 RA3 5 X4 RA4 6 Y1 RA5 7 Y2 RC6 17 Y3 RC7 18 Y4
HD44780: USB-4-all - Brightness and contrast connection USB-4-all Desc name pin RC1 12 brightness RC2 13 contrast
HD44780: USB-4-all brightness control LCD 15 (+ Backlight) +---> LCD 16 (- Backlight) | === GND ]]>
HD44780: USB-4-all contrast control LCD 3 (Contrast) |c 680R | ___ b |/ |+ RC2 o------|___|------| npn --- 10uF 22k |\ --- |e | | | | | === === GND ]]>
Raspberry Pi This connection type supports a LCD connected to the GPIO header P1 on a Raspberry Pi. Displays with one or two controllers are supported. It supports a switchable backlight connected to pin P1-11 by default. Use the switch circuit as described in . The signal level on the GPIO pins is 3.3 V and they are said not to be 5 V tolerant. Therefore the R/W pin of the display must be wired to GND to prevent 5V logic appearing on the GPIO pins. For the same reason the backlight cicuit from must not be used. Powering a LCD that uses 5 V from pin P1-02 will work. Powering a LCD from 3.3 V (pin P1-01) will only work if it is designed for 3.3 V operation. HD44780: Default pin mapping for Raspberry Pi Connector <-> LCD Pin Name Pin Number Name Pin GPIO18 P1-12 D7 14 GPIO23 P1-16 D6 13 GPIO24 P1-18 D5 12 GPIO25 P1-22 D4 11 GPIO08 P1-24 EN 6 GPIO07 P1-26 RS 4 GND P1-06 RW 5 GPIO22 P1-15 EN2 Second controller (optional) GPIO17 P1-11 BL Backlight (optional)
GPIO07 and GPIO08 used for RS and EN signal are also used by the SPI bus. If you loaded the SPI driver you will need to assign them to a different GPIO, e.g. GPIO04 and GPIO22. When using a display with two controllers the vspan option has to be configured as well (e.g. vspan=2,2 for a 40x4 display). Special Raspberry Pi configuration options This connection driver can be configured to use other pins than the one described in the table above. Using the pin_<LCD pin name> configuration option, any LCD pin can be assigned to any GPIO pin. The values for the pin_<LCD pin name> configuration option are the number part from the GPIO signal name, not the pin number from the header connector! To find out which signal is routed to which connector pin refer to the RPi Low-level peripherals description. The connection driver contains a check for possible signal names. You will receive an error message if you try to assign a pin to a signal that is not available on connector P1 or P5. HD44780: Alternate configuration for Raspberry Pi GPIO pins
Adafruit Pi Plate The Adafruit RGB Positive 16x2 LCD+Keypad for Raspberry Pi (aka Pi Plate, see ()) combines a 16x2 Character LCD, up to 3 backlight pins AND 5 keypad pins using only the two I2C pins on the Rasperry Pi. Note that this connection type drives all RGB pins of the backlight at the same time, resulting in a white backlight. You will need to modify the source code if you want to have some other color. HD44780: Configuration example for Pi Plate connection type PiFace Control and Display The PiFace Control and Display for Raspberry Pi from OpenLX SP Ltd combines a 16x2 Character LCD and navigation buttons using the SPI bus on the Rasperry Pi. The PiFace Control and Display features a IR receiver, which LCDproc does not make use of. You have to setup and use LIRC for that. See Setting up PiFace Control And Display to use a remote. HD44780: Configuration example for PiFace Control and Display connection type
Compiling Make sure that the HD44780 files are built when you run ./configure. This can be done by specifying or by including hd44780 in the list of enabled drivers (e.g. ). Configuration in LCDd.conf [hd44780] Port = PORT For parallel connections, specify the address of the parallel port the LCD is connected to. Common values for PORT are 0x278, 0x378 and 0x3BC. If not given, the default is 0x378. For I2C connection types this sets the slave address. Device = DEVICE If you are using a serial or I2C connection, you need to set this parameter to the device your LCD is connected to. For example, if the display is connected to the first serial port, you have to set it to /dev/ttyS0. The default value is /dev/lcd. ConnectionType = { 4bit | 8bit | serialLpt | winamp | picanlcd | lcdserializer | los-panel | vdr-lcd | vdr-wakeup | pertelian | lis2 | mplay | usblcd | bwctusb | lcd2usb | usbtiny | uss720 | usb4all | ftdi | i2c | piplate | spi | pifacecad | ethlcd | raspberrypi } Select the type of the wiring / display connection. See also (). Speed = BITRATE For a serial connection, set to the serial port bitrate. To use the default value for the chosen interface, just set to 0. CharMap = { hd44780_default | hd44780_euro | ea_ks0073 | sed12780f_0b | hd44780_koi8_r | hd44780_cp1251 | hd44780_8859_5 | upd16314 | none } Set the character mapping depending on the display you have: The default, hd44780_default, is for "classic" HD44780 displays. hd44780_euro is for displays with a ROM mask supporting the european charset (ROM code A02). ea_ks0073 is the charmap for Electronic Assembly's KS0073 based displays. These devices have a richer charset, including many icons and many more characters of the ISO-8859-1 than standard HD44780s. sed12780f_0b is for some SED 1278 displays. The none charmap does not translate any characters. It displays the characters the display controllers actually has stored in its CGROM for that position instead. This setting is intended for debugging purpose. You only need to set this parameter if you have a non-standard HD44780 display or charmap. If LCDproc was configured with '--enable-extra-charmaps' option the following character mappings are available, too: hd44780_koi8_r maps input from a client in Russian KOI8-R to displays with a ROM mask supporting the european charset (ROM code A02). hd44780_cp1251 maps input from a client in Russian CP1251 (Windows-1251) to displays with a ROM mask supporting the european charset (ROM code A02). hd44780_8859_5 maps input from a client in Russian ISO 8859-5 to displays with a ROM mask supporting the european charset (ROM code A02). upd16314 is for displays with a Nec uPD16314 vacuum fluorescent display (VFD) controller with ROM code 002 character set. If your display has ROM code 001 character set you may use the hd44780_euro charmap instead. See server/drivers/hd44780-charset.h in LCDproc's source directory for the actual mappings. Keypad = ¶meters.yesnodef; Tell whether you have a keypad connected. You may also need to configure the keypad layout further on in this file. Brightness = BRIGHTNESS Set the initial brightness when the backlight is on for the lcd2usb connection type. Legal values are 0 - 1000, with 800 being the default. OffBrightness = BRIGHTNESS Set the initial off-brightness, i.e. the brightness when the backlight is off, for the lcd2usb connection type. The legal range is 0 - 1000. If not given, it defaults to 300. Contrast = CONTRAST Set the initial contrast for the bwctusb and lcd2usb connection types. Legal values for CONTRAST are 0 - 1000. If not given, it defaults to 500 which may be too low or too high for the selected connection type. So, if the screen is blank or dark, please try playing with the contrast a bit. Backlight = ¶meters.yesnodef; Specify if you have a switchable backlight. OutputPort = ¶meters.yesnodef; Tell if you have the additional output port ("bargraph") and you want to be able to control it with the lcdproc OUTPUT command. Lastline = ¶meters.yesdefno; Specifies whether the lowest pixel line of a character is pixel addressable or if it controls an underline effect. The default is yes, meaning a pixel addressable last pixel line. Size = ¶meters.size; Specifies the size of the LCD. Default: 20x4 In case of multiple combined displays, this should be the total size. vSpan = HEIGHT , The "vertical span" when using the driver with multi-controller displays or with multiple displays that are treated as a single virtual display. It is a comma separated list of the heights of each display. In multi-controller displays it lists the number of lines each controller is responsible for. E.g. vSpan=2,2,1 means you have three physical displays, the first two having two lines each, and the third having one line, that together form a virtual display that is 5 lines high. The sum of the HEIGHTs must match the total height given in Size=. ExtendedMode = ¶meters.yesnodef; If you have a KS0073 or an other 'almost HD44780-compatible', set this flag to get into extended,4-line linear addressing mode. LineAddress = ADDR If the next line of your display doesn't start 0x20 higher in DDRAM you can override the default value of the ExtendedMode with this parameter. DelayMult = DELAY If your display is slow and cannot keep up with the flow of data from LCDd, garbage can appear on the LCDd. Set this delay multiplier to 2 or 4 to increase the delays. The default is 1 for a non-multiplied delay. DelayBus = ¶meters.yesdefno; You can reduce the inserted delays by setting this to no. On fast PCs it is possible your LCD does not respond correctly. Default: yes. KeepAliveDisplay = SECONDS Some displays (e.g. vdr-wakeup) need a message from the driver to indicate that it is still alive. When set to a value greater than 0 the character in the upper left corner is updated every SECONDS seconds. The default 0 does not cause any extra updates. RefreshDisplay = SECONDS If you experience occasional garbage on your display you can use this option as workaround. If set to a value greater than 0 it forces a full screen refresh every SECONDS seconds. Default: 0. KeyDirect_NUM = KEY KeyMatrix_X_Y = KEY If you have a keypad you can assign keystrings to the keys. See the keypad section for used terms and the section on the specific connection type how to wire it. To map, for example, the directly connected key 4 to the string Enter, use KeyDirect_4=Enter. For matrix keys use the X and Y coordinates of the key; e.g. KeyMatrix_1_3=Enter. VendorID = VENDORID USB vendor ID to look for in certain USB connection types. When using an FTDI chip with connection type ftdi, the default value is 0x4003. When using a USS720 chip with connection type uss720, the default value is 0x1293. ProductID = PRODUCTID USB product ID to look for in certain USB connection types. When using an FTDI chip with connection type ftdi, the default value is 0x6001. When using a USS720 chip with connection type uss720, the default value is 0x0002. SerialNumber = SERIALNO Serial number of the USB device to look for with connection type bwctusb. If not given, the first BWCT USB module found will be used. Miscellanea This text has originally been taken from a message by Bill Farrow bfarrow@arrow.bsee.swin.edu.au. Updated February 2000, Benjamin Tse blt@ComPorts.com Updated October 2001, Joris Robijn joris@robijn.net Converted to Docbook March 2002, Rene Wagner reenoo@gmx.de Updated April 2002, Rene Wagner reenoo@gmx.de Updated and extended April 2006 to November 2007, Peter Marschall peter@adpm.de
lcdproc-0.5.7/docs/lcdproc-user/drivers/i2500vfd.docbook000644 001751 000000 00000002145 11506112610 023556 0ustar00mmdolzewheel000000 000000 The i2500vfd Driver This section talks about using LCDproc with an Intra2net Intranator 2500 VFD display. The displays are part of a custom high grade steel chassis and not sold separately. More information can be found here: Intra2net AG It connects to USB using a FTDI FT245BM chip and therefore needs libftdi as requirement. libftdi can be found here: libftdi Features The display features a 140x32 pixel Noritake VFD tube which gets driven by an Atmel ATmega128 processor and used as a 23x4 character display with a 6x8 pixel font. It features B/W colors and two additional adjustable grayscale colors. It does hardware double buffering with up to 27 FPS and shows an animated boot logo until data is received from USB. Options There are currently no options for this driver. lcdproc-0.5.7/docs/lcdproc-user/drivers/icp_a106.docbook000644 001751 000000 00000001675 11217162257 023643 0ustar00mmdolzewheel000000 000000 The icp_a106 Driver This section talks about using LCDproc with the ICP A106 alarm/LCD board, used in 19" rack cases by ICP. Both LCD and alarm functions are accessed via one serial port, using separate commands. Unfortunately, the device runs at slow 1200bps and the LCD does not allow user-defined characters, so the bargraphs do not look very nice. Configuration in LCDd.conf [icp_a106] Device = DEVICE Sets the device to use. Defaults to /dev/lcd. lcdproc-0.5.7/docs/lcdproc-user/drivers/imon.docbook000644 001751 000000 00000011657 11621737633 023311 0ustar00mmdolzewheel000000 000000 The imon Driver General The imon driver controls Soundgraph iMON VFD devices, that are either preinstalled or available as optional accessories for a variety of Home Theater PC (HTPC) cases from Ahanix, Silverstone, Cooler Master and others. They can also be bought separately and then fit into a 5,25" disk drive bay of any regular PC. The iMON VFD sports a vacuum fluorescent display with 16x2 characters that connects to the computer using USB. Although the device is shipped with an IR remote control and some versions even have a volume knob, LCDproc's driver currently only supports the display part of the device. In order to be able to use it, you have to get and install one of the following Linux kernel modules: standalone iMON VFD driver from the iMON module included with LIRC ver. 0.7.1 or newer from the LIRC project For further details, please consult the page and the forum at . Configuration in LCDd.conf [imon] Size = ¶meters.size; Set the display size. The default 16x2 should be safe for most if not all users, since the device seems to be made only with this one size. But who knows … Device = DEVICE Select the output device to use. Change this from the default /dev/lcd to the device file that gets created when the kernel module (see above) is loaded. CharMap = { hd44780_euro | hd44780_koi8_r | hd44780_cp1251 | hd44780_8859_5 | upd16314 | none } Set the character mapping depending on the display you have: The default, hd44780_euro is for displays with a ROM mask supporting the european charset (ROM code A02). The none charmap does not translate any characters and is only useful for debugging. You only need to set this parameter if you have a non-standard charmap. If LCDproc was configured with '--enable-extra-charmaps' option the following character mappings are available, too: hd44780_koi8_r maps input from a client in Russian KOI8-R to displays with a ROM mask supporting the european charset (ROM code A02). hd44780_cp1251 maps input from a client in Russian CP1251 (Windows-1251) to displays with a ROM mask supporting the european charset (ROM code A02). hd44780_8859_5 maps input from a client in Russian ISO 8859-5 to displays with a ROM mask supporting the european charset (ROM code A02). upd16314 is for displays with a Nec uPD16314 vacuum fluorescent display (VFD) controller with ROM code 002 character set. If your display has ROM code 001 character set you may use the hd44780_euro charmap instead. See server/drivers/hd44780-charset.h in LCDproc's source directory for the actual mappings. lcdproc-0.5.7/docs/lcdproc-user/drivers/imonlcd.docbook000644 001751 000000 00000007142 11621737633 023766 0ustar00mmdolzewheel000000 000000 The imonlcd Driver General This section talks about using LCDproc with LCD devices manufactured by SoundGraph. For example, the iMON OEM LCD. This driver currently supports versions 15c2:ffdc and 15c2:0038 of the device. (You can find the version of your LCD via the lsusb command). In many systems, the LCD backlight will remain on after the system is shutdown. This behavior remains a mystery - somehow the LCD receives a reset command (or similar) AFTER LCDd is stopped. This driver requires the iMON module included with LIRC v0.8.4a or newer, available from the LIRC project. The 15c2:0038 device may require LIRC v0.8.5 or newer. Configuration in LCDd.conf [imonlcd] Protocol = PROTOCOL Specify which version of iMON LCD is installed. The default, 0 specifies the :ffdc device. 1 should be used for the :0038 device. OnExit = ONEXIT Specify the exit behavior. The default is 1, which turns on the big ugly clock upon shutdown. 0 leaves the shutdown message on the screen. 2 turns the LCD off. Device = DEVICE Select the output device to use. Change this from the default /dev/lcd0 to the device file that gets created when the kernel module (see above) is loaded. Contrast = CONTRAST Select the display's contrast 200 is the default. Permissible values are in the range of 0-1000. Size = ¶meters.size; Set the display size in pixels. The default 96x16 should be safe for most if not all users, since the device seeems to be made only with this one size. Backlight = BACKLIGHT Set the backlight state. The default is 1, which turns the backlight on. 0 turns the backlight off. DiscMode = DISCMODE Sets the disc mode. The default is 0 which spins the "slim" disc. 1 spins their complement. lcdproc-0.5.7/docs/lcdproc-user/drivers/IOWarrior.docbook000644 001751 000000 00000013150 11621737633 024212 0ustar00mmdolzewheel000000 000000 The IOWarrior Driver General IOWarrior is the name of a series of multi-purpose USB controller chips produced and sold by Code Mercenaries. This series currently consists of three main types, that - among other features - support controlling LCD displays: IOWarrior24 USB 1.1 Low Speed 16 generic I/O Pins, typ. 125Hz read rate I2C master function, 100kHz, throughput typ. 750 bytes/sec SPI master interface, up to 2MHz, throughput typ. 750 bytes/sec control an HD44780 compatible LCD drive a matrix of up to 8x32 LEDs decode RC5 compatible infrared remote controls IOWarrior40 USB 1.1 Low Speed 32 generic I/O Pins, typ. 125Hz read rate I2C master function, 100kHz, throughput typ. 750 bytes/sec control an HD44780 compatible LCD drive a matrix of up to 8x32 LEDs drive a 8x8 switch or button matrix IOWarrior56 USB 1.1 Full Speed 50 generic I/O Pins, typ. 1000Hz read rate I2C master function, 50, 100, or 400kHz SPI master interface, up to 12MHz, throughput up to 62Kbytes/sec control various display modules, including most graphic modules drive a matrix of up to 8x64 LEDs drive a 8x8 switch or button matrix The IOWarrior driver currently only supports writing to a single-controller HD44780-type display. LED output using the output() function is also implemented, although not tested very well. The hardware's support for input using keys or IR and dual-controller displays is not implemented yet. Please note that the latter requires extra circuitry with IOWarrior24 and IOWarrior40. The driver was developed and tested with IOWarrior24 and the IOWarrior40. Although there are good chances for it to work with an IOWarrior56, the current state regarding support of this chip is unknown due to the lack of the required hardware. Requirements The driver is based on the libusb USB library, which should make it work with Linux, the different BSD variants as well as Darwin/MacOS X. When using a libusb based driver like IOWarrior, LCDd needs to be started as root. Newer Linux kernels (2.6.20 and higher) provide a kernel module iowarrior.ko that allows controlling IOWarrior chips using device files. LCDd tries to unload this kernel module for libusb to be able to control IOWarrior devices. If this fails, this may hinder LCDd from starting using the IOWarrior driver. In this case, simply unload the kernel module by hand. Configuration in LCDd.conf [IOWarrior] Size = ¶meters.size; Set the display dimensions. If not given, it defaults to 20x4. SerialNumber = SERIALNO Use the IOWarrior module with the serial number SERIALNO. If this parameter is missing, the default is to use the first IOWarrior module found. ExtendedMode = ¶meters.yesnodef; If you have a KS0073 or an other 'almost HD44780-compatible' display connected to the IOWarrior, set this flag to get into extended, 4-line linear addressing mode Lastline = ¶meters.yesdefno; Specifies if the last line is pixel addressable or it controls an underline effect. The default yes means, it is pixel addressable. lcdproc-0.5.7/docs/lcdproc-user/drivers/irman.docbook000644 001751 000000 00000004131 11217162257 023435 0ustar00mmdolzewheel000000 000000 The irman Driver The irman driver allows you to use the IrMan IR remote control to control the LCDproc server LCDd and/or clients that can handle input. The keys are mapped according to the following table: Mapping between LCDproc keys and IrMan commands LCDproc key IrMan command Up lcdproc-Up Down lcdproc-Down Left lcdproc-Left Right lcdproc-Right Enter lcdproc-Enter Escape lcdproc-Escape
If you have trouble using the irman driver, you might try the lirc driver. lirc supports IrMan as well. Configuration in LCDd.conf [IrMan] Device = DEVICE Select the input device to use, e.g. /dev/irman. Config = FILENAME Select the IrMan configuration file to use, e.g. /etc/irman.cfg.
lcdproc-0.5.7/docs/lcdproc-user/drivers/irtrans.docbook000644 001751 000000 00000003471 11621737633 024024 0ustar00mmdolzewheel000000 000000 The irtrans Driver General The irtrans driver controls IRTrans VFD devices, that are preinstalled in cases such as the Ahanix MCE303. The IRTrans VFD sports a vacuum fluorescent display with 16x2 characters that connects to the computer using USB. Although the device is shipped with an IR remote control, LCDproc's driver currently only supports the display part of the device. In order to be able to use it, you have to get and install the IRTrans irserver package from . Configuration in LCDd.conf [irtrans] Backlight = ¶meters.yesnodef; Tell whether the device has a backlight, or whether the backlight shall be used. If not given, it defaults to no. Hostname = HOSTNAME_OR_IP-ADDRESS Set the hostname or IP address of the IRTrans device to connect to. If not set or set, the default is localhost. Size = ¶meters.size; Select the display size [default: 16x2] lcdproc-0.5.7/docs/lcdproc-user/drivers/joy.docbook000644 001751 000000 00000004540 11217162257 023134 0ustar00mmdolzewheel000000 000000 The Joystick Input Driver This section covers the joystick input driver for LCDd. Configuration in LCDd.conf [joy] Device = DEVICE Select the input device to use [default: /dev/js0] Map_AxisNUMneg = KEY Map_AxisNUMpos = KEY Set the axis map. NUM is an integer starting with 1 that represents each axis with the affixes neg and pos determining the direction. The exact numbering of the axes depends on the hardware used. KEY can be one of the keys that LCDd recognizes (Left, Right, Up, Down, Enter or Escape) or any other string that a client can parse. Map_ButtonNUM = KEY Set the button map. NUM is an integer starting with 1 that represents each button. The exact numbering of the buttons depends on the hardware used. KEY can be one of the keys that LCDd recognizes (Left, Right, Up, Down, Enter or Escape) or any other string that a client can parse. lcdproc-0.5.7/docs/lcdproc-user/drivers/lb216.docbook000644 001751 000000 00000004164 11217162257 023163 0ustar00mmdolzewheel000000 000000 Chris Debenham chris.debenham@aus.sun.com The lb216 Driver This section talks about using LCDproc with LCD displays that use the lb216 chipset. Heres a bit more info on the display. It is the LB216 and is made by R.T.N. Australia The web page for it is http://www.nollet.com.au/ It is a serial 16x2 LCD with software controllable backlight. They also make 40x4 displays (which I'll be getting one of soon :-) ) 3 wire connection (5V,0V and serial), 2400 or 9600 bps. 8 custom characters 40*83.5MM size made in australia :-) Configuration in LCDd.conf [lb216] Device = DEVICE Select the output device to use [default: /dev/lcd] Brightness = BRIGHTNESS Set the initial brightness [default: 255; legal: 0 - 255] Speed = { 2400 | 9600 } Set the the baud rate to use when communicating with the LCD. If not given, the default is 9600. Reboot = ¶meters.yesnodef; Reinitialize the LCD's BIOS [default: no; legal: yes, no] lcdproc-0.5.7/docs/lcdproc-user/drivers/lcdm001.docbook000644 001751 000000 00000004266 11506112610 023465 0ustar00mmdolzewheel000000 000000 The lcdm001 Driver This section talks about using LCDproc with serial LCD displays from kernel concepts. Configuration in LCDd.conf [lcdm001] Device = DEVICE Default: /dev/lcd PauseKey = KEY BackKey = KEY ForwardKey = KEY MainMenuKey = KEY keypad settings key name function (normal context) function (menu context) PauseKey Pause/Continue Enter/select BackKey Back(Go to previous screen) Up/Left ForwardKey Forward(Go to next screen) Down/Right MainMenuKey Open main menu Exit/Cancel You can rearrange the settings here. If your device is broken, have a look at server/drivers/lcdm001.h lcdproc-0.5.7/docs/lcdproc-user/drivers/lcterm.docbook000644 001751 000000 00000001513 11506112610 023603 0ustar00mmdolzewheel000000 000000 The lcterm Driver This section talks about using LCDproc with serial LCD displays from Helmut Neumark Elektronik. Configuration in LCDd.conf [lcterm] Device = DEVICE Default: /dev/lcd Size = ¶meters.size; Default: 16x2. lcdproc-0.5.7/docs/lcdproc-user/drivers/lircin.docbook000644 001751 000000 00000011040 11621737633 023611 0ustar00mmdolzewheel000000 000000 The lirc Driver The lirc driver enables you to use any IR remote control that works with LIRC to control the LCDproc server LCDd and/or clients that can handle input. Of course you need a working LIRC setup. Refer to the LIRC project for more information on LIRC itself. Checking Your LIRC Setup Basically all you need is a running lircd. And of course you have to start lircd as root. Also, make sure that the permission of /dev/lircd are correct. Build LCDd with the lirc Driver You need to add lirc to the --enable-drivers=... list. Then simply run make. Configure LCDd to Use the lirc Driver First of all you need to activate the driver by adding a Driver=lirc line to your LCDd.conf <filename>LCDd.conf</filename>: Activate the lirc driver Driver=mtxorb Driver=lirc This activates the mtxorb driver as the output driver and the lirc driver as the input driver. Then you have to modify the [lirc] section of your LCDd.conf. Configuration in LCDd.conf [lirc] lircrc = FILENAME Normally all LIRC clients scan the file ~/.lircrc. However, you might want to have a separate file to configure the LCDproc lirc driver only. This option enables you to specify the file you want the lirc driver to scan. If not given it defaults to ~/.lircrc. Prog = PROGRAM All LIRC keys are assigned to a program using the prog=... directive in the lirc configuration file. PROGRAM must be the same as in your lirc configuration file. Modify Your <filename>~/.lircrc</filename> As mentioned above you can either modify the ~/.lircrc or use a separate file for the lirc LCDproc driver (See above for details). No matter which file you use, you have to add at least the following lines to the file: <filename>~/.lircrc</filename>: Specify the associations from buttons to keys for the lirc driver begin prog = lcdd button = 2 config = Up end begin prog = lcdd button = 4 config = Left end begin prog = lcdd button = 6 config = Right end begin prog = lcdd button = 8 config = Down end begin prog = lcdd button = 1 config = Escape end begin prog = lcdd button = 0 config = Enter end Which buttons you specify here depends on your remote control and your LIRC configuration. The config values need to be one of Up, Down, Left, Right, Escape or Enter. For LCDd's server menu at least the keys Up, Escape and Enter are necessary. Of course you can define other keys. Those keys will not be handled by the server but sent to a client. Refer to the documentation of the client you want to use, to find out which keys are necessary for that client. lcdproc-0.5.7/docs/lcdproc-user/drivers/lis.docbook000644 001751 000000 00000007251 11621737633 023131 0ustar00mmdolzewheel000000 000000 The lis Driver This section talks about using LCDproc with the VLSystem L.I.S MCE 2005 Vacuum Fluorescent Display (VFD) based on the FTDI USB-to-serial converter, the Microchip PIC-16F716 microcontroller, and the NEC UPD16314 display driver manufactured by VLSystem. Features This device uses a vacuum fluorescent display of 20 characters by 2 lines. Each each character is 5 pixels wide by 8 pixels high. The device is connected by USB. The FTDI chip translates the USB protocol to serial expected by the VFD driver chip, an NEC UPD16314. A programmable interrupt controller (PIC), the PIC16F716 by Microchip, provides the glue between the FTDI and the NEC chips. Requirements The driver depends on libftdi, version 0.8 or higher, from http://www.intra2net.com/en/developer/libftdi/. libftdi itself depends on the libusb USB library. When using a libusb based driver like lis, LCDd needs to be started as root. Configuration in LCDd.conf [lis] Size = ¶meters.size; Set the display size. The default 20x2 should be safe for most if not all users, since the device seems to be made only with this one size. But who knows … VendorID = VENDORID The USB Vendor ID of the device to use. If not given, it defaults to 0x0403 for a VLSystems L.I.S. MCE 2005 VFD based on a FT232BL USB-to-RS232 converter by FTDI, which was produced before March 2007. It is usually not necessary to specify a VENDORID. Please do so only if you want to test a compatible device. ProductID = PRODUCTID The USB Product ID of the device to use. If not given, it defaults to 0x6001 for a VLSystems L.I.S. MCE 2005 VFD based on a FT232BL USB-to-RS232 converter by FTDI, which was produced before March 2007. It is usually not necessary to specify a PRODUCTID. Please do so only if you want to test a compatible device. Brightness = BRIGHTNESS Set the initial brightness [default: 1000; legal: 0 - 1000. Values between 0 and 250 give 25% brightness, 251 to 500 give 50% brightness, 501 and 750, give 75% brightness, and values higher than 751 give 100% brightness. lcdproc-0.5.7/docs/lcdproc-user/drivers/MD8800.docbook000644 001751 000000 00000003370 11217162257 023153 0ustar00mmdolzewheel000000 000000 The MD8800 Driver This section talks about using LCDproc with VFD displays in Medion MD8800 PCs. Features You may find more information about the LCD on Martin Moeller's homepage. Configuration in LCDd.conf [MD8800] Device = DEVICE device to use [default: /dev/ttyS1] Size = ¶meters.size; display size [default: 16x2] Brightness = BRIGHTNESS Set the initial brightness [default: 1000; legal: 0 - 1000] OffBrightness = BRIGHTNESS Set the initial off-brightness [default: 0; legal: 0 - 1000] This value is used when the display is normally switched off in case LCDd is inactive lcdproc-0.5.7/docs/lcdproc-user/drivers/mdm166a.docbook000644 001751 000000 00000012712 11621737633 023513 0ustar00mmdolzewheel000000 000000 MarkusDolze The mdm166a driver This section talks about using LCDproc with the Futaba / Targa USB Graphic Vacuum Fluorescent Display (MDM166A; USB VID=0x19c2, PID=0x6a11). The MDM166A is a graphical VFD with a 96x16 pixel dot matrix area which is used for 16x2 characters with a 6x8 pixel font. It features several icons, volume level and WLAN strength indicator which are all software controllable using the output function. The mdm166a driver builds on top of libhid which in turn uses libusb. The driver was developed by Christoph Rasim () without any available documentation from the vendor, but with a good protocol description from Thomas Koos () created by reverse engineering the protocol. Configuration in LCDd.conf [mdm166a] Clock = TYPE Show self-running clock after LCDd shutdown. Possible values for TYPE are no, small and big. If not given no clock is shown. Dimming = ¶meters.yesnodef; Dim display, no dimming gives full brightness. OffDimming = ¶meters.yesnodef; Dim display in case LCDd is inactive. Using the icons The icons, the volume bar and the WLAN indicator supported by the VFD can be controlled by use of the output function. The on parameter is used as a bitmask to control which elements to display. Setting an icon bit to 1 enables the icon, setting the bit to 0 disables an icon. Volume and WLAN strength indicator accept an numeric value in the given bit mask. mdm166a_output bitmask bit(s) Icon 0 Play 1 Pause 2 Record 3 Message 4 Mail (at-symbol) 5 Mute 6 WLAN tower 7 Volume (the word) 8…12 Volume (decimal 0…28) 13…14 WLAN strength (0…3)
Special device hints This display may appear as a HID device in your system which may prevent libhid from being able to open the USB device. In this case you have to create some OS-specific configuration to prevent the HID driver to take control of this display. Configuring FreeBSD 7.x to exclude this device from uhid To make the uhid driver ignore this device you have to apply the following patch to your kernel source and recompile and install your kernel:
lcdproc-0.5.7/docs/lcdproc-user/drivers/ms6931.docbook000644 001751 000000 00000001526 11217162257 023276 0ustar00mmdolzewheel000000 000000 The ms6931 Driver This section talks about using LCDproc with LCD displays that use the ms6931 chipset. Configuration in LCDd.conf [ms6931] Device = DEVICE device to use [default: /dev/ttyS1] Size = ¶meters.size; display size [default: 16x2] lcdproc-0.5.7/docs/lcdproc-user/drivers/mtc_s16209x.docbook000644 001751 000000 00000002352 11217162257 024231 0ustar00mmdolzewheel000000 000000 The mtc_s16209x Driver This section talks about using LCDproc with LCD displays that use the mtc_s16209x chipset. Configuration in LCDd.conf [mtc_s16209x] Device = DEVICE Select the output device to use [default: /dev/lcd] Brightness = BRIGHTNESS Set the initial brightness [default: 255; legal: 0 - 255] Reboot = ¶meters.yesnodef; Reinitialize the LCD's BIOS [default: no; legal: yes, no] lcdproc-0.5.7/docs/lcdproc-user/drivers/mtxorb.docbook000644 001751 000000 00000037231 11621737633 023656 0ustar00mmdolzewheel000000 000000 The MtxOrb Driver This section covers the installation process for the Matrix Orbital LCD module intended for use with LCDproc. We will examine the installation process of the hardware in small steps, as it is vitally important to pay close attention to detail during hardware installation to avoid damaging equipment. Matrix Orbital LCD Modules LCDproc was born out of original tinkering by William Ferrell with one of these LCD modules. Their ease of installation and use (as well as the amazing amount of patience demonstrated by the folks at Matrix Orbital whilst William figured things out) meant one less thing to worry about during the early stages of LCDproc's life. These 20x4 alphanumeric modules are connected via standard DB-9 cabling and connectors. They draw either 5V or 12V, depending on the module purchased, and are attached with a standard floppy cable connector (with a slightly modified wire configuration). Once connected, using them is a breeze. They can operate at any number of different baud rates and serial configurations, but normally they run at 19,200 baud, 8-N-1, making them quite quick. Sending ASCII to the module will make it simply display that text at its current cursor position. The module has a built-in BIOS that recognizes commands (sent by transmitting a single-byte "marker" signifying that a command is on the way, followed by the single-byte command character itself along with any parameters, if needed) allowing the programmer to clear the screen, position the cursor anywhere, define custom characters (up to 8 at a time), draw bar graphs and large numbers, change the LCD's contrast, and so on. The BIOS included also implements line-wrapping (i.e. writing past the twentieth character on the first row will automatically move the cursor to the first character on the second row), and screen scrolling (i.e. writing past the twentieth character on the fourth row causes the whole screen to scroll up one row, clearing the fourth line and positioning the cursor at the first character on that line). These modules are fast. Using the auto-line-wrap feature and disabling the auto-scrolling feature, the screen can be updated thirty times per second if *every* character on the screen is changed. If updating less than the whole screen, the LCD can update faster than can be seen by the human eye. This, of course, more than meets LCDproc's needs. Matrix Orbital Hardware Installation Regardless of what specific type of hardware you intend to use with LCDproc, installation is usually straightforward, and requires only a few steps. Regardless, you must use caution while working inside your computer system or with any hardware attachments. Installing new hardware inside a computer system can be dangerous to both system components and the installer. Use caution whenever adding a component to the inside of your system, altering a power cable, or physically mounting a device inside a computer system. When installing hardware inside a computer, make sure it's turned off and that its power is disconnected. This is especially important when making changes to power cables (as some LCD modules require). Matrix Orbital LCD/VFD Module Installation The LCD and VFD modules from Matrix Orbital are relatively straightforward to install. With a small, regular (flat-head) screwdriver, a spare floppy drive power cable, and a bit of luck, installation will take less than an hour. These installation instructions assume that you are installing the module into a PC or PC-style system (one with AT- or ATX-compliant power cabling) and that you have some idea of where you intend to permanently mount the module. Before you start Your Matrix Orbital LCD or VFD module should be clearly marked with an indication of the module's power requirements. It should be either a 5 volt or 12 volt unit. You should have this information available before proceeding. Power Cable Modification The first step in installing the module is making the necessary modifications to a floppy drive power cable in order to provide power to the module. The modifications must be made based on the module's power requirements -- either 5V or 12V -- depending on which module you purchased. A standard floppy drive power cable has a smaller connection than a "normal" PC power connector. However, like a "normal" power connector, it has four wires: one yellow, one red, and two black. The red wire provides +5V power, and is "hot" or live when the system is powered up. The yellow wire provides +12V power, and is also hot when the system is powered up. Both black wires are ground. [TODO: INCLUDE A FIGURE HERE SHOWING A "STANDARD" FLOPPY CONNECTOR] One of the hot wires and one of the black wires will not be needed for your module's power connection; they will be completely removed when the power cable modification is complete. Do NOT make this modification to a power cable attached to a running system! Electrocution resulting in personal injury and/or damage to the system can result. Using a regular screwdriver, press down the small metal locking flap of one of the two black wires on the small end of the cable, and pull the black wire from the connector. Using a pair of needle-nose pliers, squeeze the other end of the same black wire, and pull it out of the large end of the cable. This black wire can be set aside; it will not be used for the module's power connection. Either wire can be safely removed; you may safely remove either wire. [TODO: INCLUDE A FIGURE HERE SHOWING THIS PROCESS] Next, using the same procedure, remove the unneeded hot wire. If your module is 5V, you do not need the yellow (+12V) wire. Conversely, if your module is 12V, you do not need the red (+5V) wire. The removed wire can be set aside; it will not be used for the module's power connection. [TODO: INCLUDE A FIGURE HERE] The floppy power connector should now have only two wires attached to it. Leave the larger end alone from now on; these connections are correct (the larger end connects to your system's power mains). Move the two remaining wires to the outside connectors on the small end of the cable. Orientation does not particularly matter here; the connector will fit on the module's receptacle in either orientation. [TODO: A FIGURE HERE] You should now have a properly modified power connector. When physically attaching this connector to the module, the black (ground) lead should be connected to the pin labelled GND, while the colored (+5V/+12V) lead should be connected to the pin labelled +5V/+12V. Test the power connection before connecting the data line or mounting the module. Connect the module to the power connector, and the connector to your system's power mains. Turn the system on. If the module does not immediately display its initial BIOS screen and light up its backlight (or light up the screen if a VFD module is being used), immediately power down the system, disconnect the module and connector, and double-check the modification before trying again. Do NOT leave the system on if the module does not immediately respond; module or system damage could result. When the LCD powers up and displays its initial BIOS screen, you've gotten the power connection wired properly and can now properly mount the module and make its final connections. Matrix Orbital Corporation sells a PC bay insert mount for the 20x4 and 20x2 modules (LCDproc, however, only supports the 20x4 at present). The inserts provide an easy means of mounting the LCD modules inside a PC using one (for the 20x2) or two (for the 20x4) 5 1/4" bays. Describing how to physically mount the module in a PC case is beyond the scope of this document; LCDproc's website contains more detailed mounting information and examples. Serial Connection The LCD module uses a standard DB9 serial connector. You can attach the module to your system using a direct cable to the motherboard, or by removing one of your system's serial ports from the back of the case, then connecting it to a standard serial cable to the module. While connecting the serial cable to the module, be sure to configure the module's serial interface settings. Typically, setting the module to its fastest setting (19,200 baud, 8-N-1) is recommended. The speed settings can be configured from the config file /etc/LCDd.conf. If not specified in the config file, the Matrix Orbital module driver in LCDproc default to use these settings. Configuration in LCDd.conf [MtxOrb] Device = DEVICE Select the output device to use [default: /dev/lcd] Size = ¶meters.size; Set the display size [default: 20x4] Type = { lcd | lkd | vfd | vkd } Set the display type [default: lcd; legal: lcd, lkd, vfd, vkd] Contrast = CONTRAST Set the initial contrast. Legal values for CONTRAST are 0 - 1000. If not given, the default value is 480. The driver will ignore this setting if the display is a VFD or VKD as they do not support this feature. hasAdjustableBacklight = ¶meters.yesdefno; Some old firmware versions of Matrix Orbital modules do not support an adjustable backlight but only can switch the backlight on/off. If you own such a module and experience randomly appearing block characters and backlight cannot be switched on or off, use this to no [default: yes]. Brightness = BRIGHTNESS Set the initial brightness [default: 1000; legal: 0 - 1000] OffBrightness = BRIGHTNESS Set the initial off-brightness [default: 0; legal: 0 - 1000] This value is used when the display is normally switched off in case LCDd is inactive Speed = { 1200 | 2400 | 9600 | 19200 } Set the the baud rate to use when communicating with the LCD. If not specified, it defaults to 19200. KeyMap_LETTER = KEY Matrix Orbital displays support keypads with up to 25 keys, which return one of the letters A - Y for each pressed key. These settings allow to map the letter LETTER, that is generated by the display when a key is pressed, to be mapped to a key name KEY that LCDd can understand (see for more information). There is no default key mapping; if no keys are mapped in the LCDd.conf config file, the display is treated as if it had no keys attached. Matrix Orbital: keymap config KeyMap_A=Left KeyMap_B=Right KeyMap_C=Up KeyMap_D=Down KeyMap_E=Enter KeyMap_F=Escape keypad_test_mode = ¶meters.yesnodef; You can find out which key of your display sends which character by setting keypad_test_mode to yes and running LCDd. LCDd will output all characters it receives. Afterwards you can modify the settings above and set keypad_set_mode to no again. lcdproc-0.5.7/docs/lcdproc-user/drivers/mx5000.docbook000644 001751 000000 00000002014 11506112610 023243 0ustar00mmdolzewheel000000 000000 The MX5000 Driver This section talks about using LCDproc with LCD displays on Logitech MX5000 keyboards. Features This drivers uses the library from mx5000tools. Configuration in LCDd.conf [mx5000] Device = DEVICE Select the output device to use [default: /dev/hiddev0] WaitAfterRefresh = MS Set the time (in ms) to wait after each screen sent to the keyboard. Default is 1000ms. lcdproc-0.5.7/docs/lcdproc-user/drivers/NoritakeVFD.docbook000644 001751 000000 00000006036 11217162257 024451 0ustar00mmdolzewheel000000 000000 The NoritakeVFD Driver This section talks about using LCDproc with text mode VFD displays from Noritake Itron. Configuration in LCDd.conf [NoritakeVFD] Device = DEVICE Port where the VFD is. Usual values are /dev/ttyS0 and /dev/ttyS1 Default: /dev/lcd Size = ¶meters.size; Specifies the size of the LCD. Default: 20x4 Brightness = BRIGHTNESS Set the initial brightness [default: 1000; legal: 0 - 1000] OffBrightness = BRIGHTNESS Set the initial off-brightness [default: 0; legal: 0 - 1000] This value is used when the display is normally switched off in case LCDd is inactive Speed = { 1200 | 2400 | 9600 | 19200 | 115200 } Set the the baud rate to use when communicating with the VFD. If not specified, it defaults to 9600. Parity = { 0 | 1 | 2 } Set the parity for communication with the device to even parity (2), odd parity (1) or no parity (0). If not given, it defaults to 0. Reboot = ¶meters.yesnodef; Reinitialize the VFD [default: no; legal: yes, no] lcdproc-0.5.7/docs/lcdproc-user/drivers/picolcd.docbook000644 001751 000000 00000041211 12313532720 023736 0ustar00mmdolzewheel000000 000000 The Mini-Box.com USB LCD picoLCD Driver This section covers the use of the Mini-Box USB LCD displays. Displays Mini-Box.com offers two types of USB LCD displays: PicoLCD 4x20-Sideshow PicoLCD 4x20-Sideshow is the desktop variant targeted at end users. It is an external USB 2.0 full speed device that comes in a stylish case and sports a 4 line by 20 character display with white letters on a blue background, a built-in InfraRed receiver as well as a keypad with 8 keys labeled Escape, F1, F2, F3, Home, Up, Down and Enter. picoLCD 20x2 (OEM) picoLCD-20x2-OEM is the OEM version. It is a 2 line by 20 character display with black letters on a yellow-green background, that can be connected to the system via USB, I2C or USART (the latter two are not supported by this driver). It has connectors for an InfraRed receiver, keypad and LEDs. When pre-installed in enclosures like the Mini-Box M300 LCD it comes equipped with an InfraRed receiver as well as key pad with 12 keys labeled Plus, Minus, F1, F2, F3, F4, F5, Up, Down, Left, Right, and Enter. Finally, the picoLCD 20x2 (OEM) supports 8 general purpose outputs and 10 custom splash screens. When the keypad is connected the outputs control the key LEDs. The output command and KeyLight settings below can be used to control the outputs. Although splash screens are not supported by this driver, the splash screens can be changed using the usblcd tool, that can be built from the Linux SDK available on the picoLCD web page. Requirements The driver is based on the libusb USB library, which should make it work with Linux, the different BSB variants as well as Darwin/MacOS X. When using a libusb based driver like picolcd, LCDd needs to be started as root. On Linux, the only kernel module required is the USB host controller driver (uhci_hcd on the M300) to fire up the USB bus to which the LCD is attached. For other operating systems, analogous requirements apply. Lastly, for libusb to work correctly, the usbfs file system must be mounted on /proc/bus/usb, e.g. using the command mount -t usbfs usbfs /proc/bus/usb or by your system's default configuration. Configuration in LCDd.conf [picolcd] The Brightness and OffBrightness settings only have an effect on the 20x4 device. With the 20x2 device the backlight can only be set on (any value 1 or greater) or off (0). Backlight = ¶meters.yesdefno; Turns the backlight on or off on start-up, default yes. Brightness = BRIGHTNESS Set the initial brightness if the backlight is on. Legal values are: 0 - 1000. If not given, it defaults to 1000. OffBrightness = OFFBRIGHTNESS Set the initial value for the backlight if it is off. Legal values are: 0 - 1000. If not given, it defaults to 0. Contrast = CONTRAST Contrast: 0-1000, default to 1000 (full contrast). LinkLights = ¶meters.yesdefno; Allow key LEDs to be turned on or off with the backlight. Default is yes. KeyLights = ¶meters.yesdefno; Allow key LEDs to be turned on or off. Default is yes. This setting affects all keys. If set to on each key can be disabled independently by setting KeyXLight below. Key0Light = ¶meters.yesdefno; If Keylights is set, you can disable the directional pad LED by setting this value to no. Default is yes. Key1Light = ¶meters.yesdefno; If Keylights is set, you can disable the F1 LED by setting this value to no. Default is yes. Key2Light = ¶meters.yesdefno; If Keylights is set, you can disable the F2 LED by setting this value to no. Default is yes. Key3Light = ¶meters.yesdefno; If Keylights is set, you can disable the F3 LED by setting this value to no. Default is yes. Key4Light = ¶meters.yesdefno; If Keylights is set, you can disable the F4 LED by setting this value to no. Default is yes. Key5Light = ¶meters.yesdefno; If Keylights is set, you can disable the F5 LED by setting this value to no. Default is yes. KeyTimeout = DURATION KeyTimeout is only used if the picoLCD driver is built with libusb-0.1, when built with libusb-1.0 key and IR data is input asynchronously so there is no need to wait for the USB data thus allowing LCDd to process other inputs at the correct rate. This value controls how long LCDd waits for a key press when get_key() is called. The value represents milliseconds and the default is 500 or .5 seconds. Lowering this value will make LCDd more responsive but also causes LCDd to use more CPU time and, as the timeout grows shorter, key presses become harder to detect. Large values make key presses more reliable but may slow down LCDd. Values in the range 0-1000 (1s) are allowed. KeyRepeatDelay = DURATION KeyRepeatDelay is only used if the picoLCD driver is built with libusb-1.0, when built with libusb-0.1 key input blocks all other processing until the key is released. This value controls how long LCDd waits from when a key is pressed and reported before generating the first repeat. The value represents milliseconds and the default is 300 (0.3 second). Use zero to disable auto repeat. Values in the range 0-3000 (3s) are allowed. KeyRepeatInterval = DURATION KeyRepeatInterval is only used if the picoLCD driver is built with libusb-1.0, when built with libusb-0.1 key input blocks all other processing until the key is released. This value controls how long LCDd waits between key reports after generating the first repeat. The value represents milliseconds and the default is 200 (0.2 second). Use zero to disable auto repeat. Values in the range 0-3000 (3s) are allowed. LircHost = HOSTNAME_OR_IP-ADDRESS Set the hostname or IP address to which the driver will send IR data from the sensor. If not set or set to an empty value, IR support for LIRC will be disabled. LIRC should be configured to use the driver "udp", which will cause it to listen on some UDP port for packets containing a series of integers, representing mark and space intervals from the sensor. It doesn't matter whether LCDd or LIRC is started first; if LIRC isn't listening, the packets from LCDd will be discarded. When LIRC comes back, it will start picking up the packets. Similarly, LCDd can be stopped and restarted without affecting anything, because UDP is a connectionless protocol. LircPort = PORTNUM This value determines the UDP port to which the driver will send IR data from the sensor. It defaults to 8765, which is also the default port on which LIRC will listen. LircTime_us = ¶meters.yesnodef; If LircTime_us is set to on mark and space times are sent to LIRC in microseconds (requires a LIRC UDP driver that accepts this). If LircTime_us is set to off mark and space times are sent to LIRC in 'jiffies' (1/16384s) (supported by the standard LIRC UDP driver). Default is off. One 'jiffy' is approximately 61 microseconds about a tenth of typical IR mark and space times. LIRC configuration program irrecord cannot reliably detect the IR data timing when measured in 'jiffies' it works better with microseconds. I have submitted a patch that modifies the LIRC udp driver to support timing data in microseconds but it has been ignored. The LIRC team currently seems only to be interested in adding IR support to the kernel. You can obtain my modified files from GitHub. The standard UDP driver is satisfactory for most uses but I recommend using the modified driver if you intend to use irrecord LircFlushThreshold = DURATION This value is the length in microseconds of the gap that will trigger sending the queued IR data to LIRC. Values greater than 1000 (1ms) are permitted, lower values will set the default value 8000 (8ms). The maximum depends on the setting of LircTime_us; if LircTime_us is on values greater than 32.767ms will disable the flush, if LircTime_us is off values greater than 1.999938s will disable the flush. The value should be less than the gap times specified in lircd.conf and greater than any space time specified in any header, one, zero, etc. field. picolcd driver status The hardware also reports key-up events. Normally this would be of no issue (they are usually a 0 or 'no key') except that when keys are used in combination, the key-up event may actually come back as multiple events depending on how the user released the keys. If the key-up event for a multiple key press comes back as two events, the first up event will actually look like a new key press. The algorithm in get_key tries to deal with this in a sane way and toss out all key-up events for now. The hardware is touchy and both combo key-down and key-up actions may be reported as multiple events if the user is more than a tenth of a second (maybe less?) off in motions. The hardware is not "touchy" it reports what it receives. Two key presses or releases may appear simultaneous to a human but they are always some time apart. The hardware probably samples the keys for every USB transfer cycle; that is every 10ms, significantly faster than the typical human response time of a few hundred milliseconds! Infrared sensor status LIRC expects sensor data that starts with a longish 'sync' space, denoting the start of a command; followed by the code data, a sequence of mark/space pairs; sometimes followed by a 'gap', which should be a space long enough to make the entire command up to a preset duration in milliseconds. The 'sync' and the 'gap' are absent from the data emitted by the picolcd hardware. I found that LIRC configuration files for remotes similar to the ones I tested all used such a fixed-duration encoding, and as that was the only way I could get it working, this driver by default adds the gap as well as the sync. However I have still had trouble getting irrecord to work; you need at least to feed it a template configuration containing sync and gap data. The LIRC configuration program irrecord cannot reliably detect the IR data timing when measured in 'jiffies' it works better with microseconds, see LircTime_us above. The current libusb-1.0 implementation polls at 32Hz to see if any USB processing is required, this is needed when a key has been pressed or some IR data has been received. 32Hz has a period of 31.25ms this is not really fast enough the picoLCD USB transfers can occur every 10ms. This may cause buffer overrun problems for long bursts of IR data. The best solution would be to include USB processing in the main loop select statement this has not been done to avoid major changes to the core code, to work-round this extra USB transfer buffers are allocated. It may also be worth building with PROCESS_FREQ set to 100Hz (in server/main.h). Copyright The lcdproc picolcd driver originally was written by Gatewood Green (woody@nitrosecurity.com) or (woody@linif.org) and paid for by NitroSecurity, Inc (nitrosecurity.com), but has been extended with code from various contributors since then. lcdproc-0.5.7/docs/lcdproc-user/drivers/ppttrouble.docbook000644 001751 000000 00000014456 11621737633 024547 0ustar00mmdolzewheel000000 000000 Parallel Port Troubleshooting Unfortunately attaching an LCD module to a parallel port is not trivial. In most cases it requires soldering abilities and basic knowledge of electronics. The following hints might be helpful: Check The Wiring Wiring errors can easily be made. If you are inexperienced with the soldering iron better have someone solder it for you. Display modules are sensitive to electrostatic discharges, so touch an earthed surface (computer case, water pipes...) before you handle these. Power Source Unregulated / Noisy Make sure your power supply delivers steady 5 Volts without noise or interruptions. The bare wall plug-in transformer is often not suitable, though you can make it stabilized by adding an 7805 and a few capacitors. Some noise induced in the supply lines my be tricky to track, even if you have an oscilloscope. Ground Lift The power supply wires and especially the GND wires should be a little thicker than the other wires. If GND is not thick enough (or not existent, see 1) the resistance of the wire may cause differing GND potentials in the circuit. This may lead to strange display behaviour. It may also be wise to solder a 100nF capacitor directly to the GND and VCC pins of the display. Latchup Never let the supply voltage get much below the io signal voltage. It may lead to a latchup condition which will destroy the controller chip on the display. Contrast If you don't see anything on your display it may be that your contrast voltage is set wrong. Turn your contrast potentiometer all the way to the end connected to GND. Contrast is highest then. Beware The module you got so ultra cheap may be an enhanced temperature model which needs a negative contrast voltage for sufficient contrast - see chapter 99 on how to make negative voltage. Parallel Port Voltage Many modern mainboards and especially notebooks will not nearly output 5V for a logic H as the older parallel ports did, because the operating voltage of computers is lower than 5V these days. I have measured voltages between 2.5V and 4V for logic H, which is barely within specification of the HD44780. If you account RCL of your cable, this may not be enough and can cause unreliable operation. Enable Signal Rise Time If you ever read the HD44780 datasheet you will notice that somewhere in the 'signal timing' table is written: 'Enable Signal Rise Time max. 20nS'. That means the Voltage on the HD44780 pin called 'Enable' has to rise from 0 Volts to 5 Volts within 20 Nanoseconds and the other way round. They should better print that in big fat red letters, because most HD44780s are really picky about the enable signal rise time. That is a Problem: If you count together the bad driving characteristics of the parallel port combined with the capacitance of flat ribbon cable you may easily get an order of magnitude slower rise time. Therefore you should only use really short cable (shorter than 50cm) for connecting the display to the parallel port. It may also be useful to use pull-up resistors on the display module or a schmitt-trigger. The rise time of a digital output can (usually) not be altered by software. EMI The cable from the parallel port to the display may be sensible to electromagnetic interference and may emit electromagnetic radiation. If you place your cellphone near the cable, you may get unexpected display readings, on the other hand your house neighbour may not be able to listen to his/her favourite radio station any more - so better use shielded cable and put the display in a metallic case, perhaps a computer case. One or Two Black Lines If you see one or two black lines on the display it means nothing more than that the display is powered and contrast voltage is present. If one or two black lines appear the controller has not been reset properly by the on chip power on reset generator. No need to worry - it will be reset by the LCDd software. But if the black line will not disappear although the wiring is working, the controller on the display may be defective. Software Too Fast If you have a super GHz computer it may happen that the signal timing generated by LCDd is too fast. Adjust DELAYMULT in the source file to a bigger value. Parallel port wirings usually don't permit to read back the busy flag of the controller chip, so timing must be adjust so that the controller never is busy. LED Backlight Check whether you need a resistor for your LED Backlight and which value it should have. If you forget the required resistor the backlighting LEDs might become hot and draw excessive current. HD44780 Compatible The original HD44780 controller that we advertise to support has become the industry standard for alphanumeric character displays. The original HD44780 is out of production. It has many successors from many manufactures, which sometimes won't tell you that their chips are 'compatible'. To name a few: KS0066, KS0070, KS0076, LC7985, NT3881, SED1278, ST7066 ... Miscellanea This text has originally been taken from a message by Robin Adams robin@adams-online.de Converted to Docbook and slightly modified May 2002, Rene Wagner reenoo@gmx.de lcdproc-0.5.7/docs/lcdproc-user/drivers/pylcd.docbook000644 001751 000000 00000012516 11506112610 023435 0ustar00mmdolzewheel000000 000000 Stefan Reinauer The pyramid Driver This section talks about using LCDproc with programmable LC displays sold by Pyramid Computer. Pyramid Computer builds these LC displays into its thriving server products to show system data, and to allow the user to change important parameters or shut down the appliance in a controlled manner. The LCD module, accessible via USB, can be integrated by Pyramid's BTO server and appliance manufacturing division at the customer's request or it can be made available separately for self-integration, e.g. as a 5.25" module. Features The displays are 16 characters wide and 2 lines high. They have 4 programmable buttons as well as 3 (or 9) LEDs which can also be software controlled. Connector The display is connected to the host system using USB, with the usual USB pinout as shown below. The +5V VCC pin is marked with red colour. USB Pinout GND D+ D- VCC GND P0+ P0- +5V
Requirements For Linux the driver depends on features of the ftdi_sio.ko that have only been added to version 2.6.15 version of the 2.6 kernel series. For older Linux kernels of the 2.6 series these patches to ftdi_sio.c may help: Linux 2.6.9-11. Linux 2.6.12.x. Linux 2.6.13-14. LED output I've added support for the LEDs on the Pyramid LC-Display to the "pyramid" driver of lcdproc. Since it seems that LEDs on an LCD are not directly supported by the lcdproc API I've used the "output" command of the server to trigger the LEDs, similar to what the IOWarrior driver does. The Pyramid LC displays come in two different versions, with 3 and with 9 LEDs. Two of these LEDs can not be controlled by software but are usually hard wired to power and HDD. The other 1 or 7 LEDs can now be controlled by sending an output command to the server. The argument to the output command is a bitmask that controls the LEDs according to the table below: Mapping of <code>output</code> bits to LEDs Bit LED 0 3 1 4 2 5 3 6 4 7 5 8 6 9
For the LCDd server there is no way to find out whether 3 or 9 LEDs are available, so it is up to the client software to do the right thing. Pyramid: How to use the LED output from the client telnet localhost 13666 hello output 67 will light up LEDs 3, 4 and 9. output 0 will clear all LEDs. More information on the Pyramid LC-Display can be found here:
Configuration in LCDd.conf [pyramid] Device = DEVICE Device to connect to. Default: /dev/lcd
lcdproc-0.5.7/docs/lcdproc-user/drivers/rawserial.docbook000644 001751 000000 00000007462 12313532720 024324 0ustar00mmdolzewheel000000 000000 Connor Wolf The *Really* Simple Serial interface (rawserial) This section talks about using LCDproc with custom hardware. This driver is intended for using LCDproc with custom hardware. In the original implementation, this was for a PFsense router with a homemade arduino-style circuit that controlled analog panel meters to display network traffic. It is intended for this sort of application, where the LCD control characters emitted normally, as well as the partial screen drawing, make parsing the serial stream a considerably complex affair, particularly on small (generally 8 bit) microprocessors. Features The driver emulates a 40x4 display, and simply dumps the entire framebuffer out the serial port at a rate configured in the config file (default of 1 Hz), post-pended with a single "\n" character. At 1 Hz, it therefore generates 161 serial characters per second. The maximum update-rate is limited by the internal update-rate of LCDproc, which is currently 8 Hz, so speeds greater then 8 Hz will be simply limited to 8 Hz. The update-rate is also granular at 1 second/8 time-intervals (125 ms), so interesting fractional update-rates will behave oddly. The event-loop is rigidly deterministic, so fractional rates will *average* out to the desired rate, but that will be achieved by dithering between nearby available intervals. The baud rate is configurable, with a default of 9600 baud. Baud rate will have to be chosen with the required data-per-second in mind, since at 1 Hz, there are 161 characters (40x4+1) per second, which requires that's a theoretical minimum baud of 161*10 = 1610 baud. Higher frame-rates will require higher baud rates. Requirements None. The only requirement is a serial port of some sort. Configuration in LCDd.conf [rawserial] Device = DEVICE Serial port to use. Default: /dev/cuaU0 Speed = NUMBER Desired baud-rate. Possible values: 1200, 2400, 9600 (default), 19200, and 115200. Size = ¶meters.size; Specifies the size of the LCD. If this driver is loaded as a secondary driver it always adopts to the size of the primary driver. If loaded as the only (or primary) driver, the size can be set. Default: 40x4. UpdateRate = NUMBER Desired update-rate in Hertz (e.g. updates per second). Fractional values and values less than one are valid (e.g. 0.5). Legal values are 0.0005 (equals 2000 seconds) - 10, with 1.0 being the default. lcdproc-0.5.7/docs/lcdproc-user/drivers/sdeclcd.docbook000644 001751 000000 00000002212 12014174064 023721 0ustar00mmdolzewheel000000 000000 The SDEC LCD Driver The SDEC LCD modules are fitted to the Watchguard Firebox firewall appliances. Watchguard identifies these units by the X-Core, X-e and X-Peak product lines. The model number indicates a software license level, and has no bearing on the hardware configuration. Features The SDEC LCDs are interfaced to the appliance using a parallel port. All lines are hard-wired by Watchguard. The LCD displays are 20 characters wide and 2 lines high, and have 4 buttons: Up, Down, Left, and Right. The SDEC model number is LMC-S2D20-01. There is a back light that can be controlled by software. Due to its low half-life, the driver tries to keep the light off a short while after buttons have been pressed. For more detailed information about the SDEC LCD, locate the technical and programming guide LMC-S2D20-01.pdf. The manufacturer web site is: SDEC home page lcdproc-0.5.7/docs/lcdproc-user/drivers/sed1330.docbook000644 001751 000000 00000027707 11621737633 023434 0ustar00mmdolzewheel000000 000000 The sed1330 Driver This section talks about using LCDproc with graphical LCD displays driven by the EPSON/SMOS SED1330 or SED1335 LCD controllers, which may also be known by their new names: S1D13300 (= SED1330) and S1D13305 (= SED1335). The displays are driven in text mode using their built-in character generator and the graphic mode for bars and the heartbeat icon (a bouncing ball). Connections Displays using SED1330/1335 chipset come in a variety of pin-outs and power configurations. They usually require negative voltage for contrast and some displays have a negative voltage generator onboard. Connections below are for the G242C, G121C and G321D displays. Always consult documentation about the specific display before assuming the connections given here are also correct for your display! ConnectionType <literal>classic</literal> ordered by LPT port pins LPT port <-> LCD pin name name pin 1 ^STROBE ^RESET 1 2-9 D0-D7 D0-D7 8-15 16 ^INIT ^WR 3 17 ^SELECT_IN A0 7 18-25 GND GND VEE 17 +5V ^RD 2 GND SEL1 4 GND SEL2 5 GND ^CS 6 +5V VCC 16 potentiometer V0 18 -24V (not required for G242C) VLC 19 GND FGND 20
ConnectionType <literal>bitshaker</literal> ordered by LPT port pins LPT port <-> LCD pin name name pin 1 ^STROBE ^WR 3 2-9 D0-D7 D0-D7 8-15 14 ^LF A0 7 16 ^INIT ^RESET 1 18-25 GND GND VEE 17 +5V ^RD 2 GND SEL1 4 GND SEL2 5 GND ^CS 6 +5V VCC 16 potentiometer V0 18 -24V (not required for G242C) VLC 19 GND FGND 20
The potentiometer should be connected like this on these display modules: The G242C generates -24V internally. It is available on Vlc. To generate -24 from the +5V without an external power source, you can use the following circuit.
Keypad The sed1330 driver supports the same direct keys and matrix keypad connections as the hd44780 driver. See . Configuration in LCDd.conf [sed1330] CellSize = ¶meters.size; Specify the size of a character in pixels. WIDTH may vary between 6 and 8; legal values for HEIGHT range from 7 to 16. If not given CellSize defaults to 6x10. Contrary to other drivers the character size of an LCD using the sed1330 driver is not given directly. Instead it is determined by the pixel size of the display, which is derived from the display type setting and the character cell size specified with this setting. ConnectionType = { classic | bitshaker } Select the type of the wiring, see . If not given, it defaults to classic. Port = PORT Specify the address of the parallel port the LCD is connected to. Common values for PORT are 0x278, 0x378 and 0x3BC. If not given, it defaults to 0x278. Type = { G321D | G121C | G242C | G191D | G2446 | SP14Q002 | HG25504 } Type of LCD module. Besides other things (internal setup) this configuration setting determines the size of the display in pixels. Type Size (in pixels) G321D 320 x 200 G121C 128 x 128 G242C 240 x 128 G191D 192 x 192 G2446 240 x 64 SP14Q002 320 x 240 HG25504 320 x 240 Currently the G321D and SP14Q002 are the only ones that this driver is tested with.
lcdproc-0.5.7/docs/lcdproc-user/drivers/sed1520.docbook000644 001751 000000 00000020465 12014174064 023415 0ustar00mmdolzewheel000000 000000 The sed1520 Driver This section talks about using LCDproc with LCD displays that use the SED1520 chipset. Currently the driver supports 122x32 pixel graphic displays based on the SED1520 controller connected to the parallel port. Those SED1520 displays are the most troublesome I have ever used. You should probably avoid using them and get a 20x4 text display instead. Connections Displays using SED1520 come in a wide variety of configurations. It is possible to cause harm to your display (e.g. connecting negative voltage incorrectly. Be sure to check your datasheet! Do not try to use a display without having a datasheet to check against! Here here some of the options I encountered: Negative voltage: The chip requires negative voltage for driving the display. Some display modules have a negative voltage converter on-board. On those that don't you have to supply about -7 V (will not show how to do this). Reset circuit: Some display modules have an R/C-combination on-board selecting an MCU interface if the pin is not connected. Frequency generator: The SED1520 is manufactured in several versions. Some contain an on-chip frequency generator, others require an external clock of 2 kHz (won't show this here). Note that display modules with an on-chip generator do not have a /CS (chip select) line. Incorrect datasheets: I have seen display datasheets incorrectly naming pins, missing some of the commands, missing pages from the chip description and other odds. Be warned! No pin numbers are given in the tables below. You have to figure out those yourself from the datasheet for your display! That said here some wirings: 80-style connection style This mode of operation is selected if the RESET line is wired to ground. The wiring used by this driver in 80-style mode assumes you have /CS1 and /CS2 lines available (thus you must have an external clock generator) and toggles the /RW line. This is the original wiring by Robin Adams (SED1520 LPT Port). SED1520 80-style wiring schematic Parallel port <-> LCD name pin name pin D0-D7 2-9 DB0-DB7 * nSTRB 1 /WR * nLF 14 /CS1 * INIT 16 /CS2 * nSEL 17 A0 * VDD /RD * GND RESET/IF * 2 kHz clock CL *
68-style connection style This mode of operation is selected if the RESET line is wired to VDD. For this wiring the display is required to have an on-board frequency generator (something you really want to have) and the display module has an E1 and E2 line. Writing is controlled by toggling the E1 and E2 line while /RW is low. SED1520 68-style wiring schematic Parallel port <-> LCD name pin name pin D0-D7 2-9 DB0-DB7 * nSTRB 1 R/-W * nLF 14 E1 * INIT 16 E2 * nSEL 17 A0 * VDD RESET/IF *
Configuration in LCDd.conf [sed1520] Port = PORT Specify the address of the parallel port the LCD is connected to. Common values for PORT are 0x278, 0x378 and 0x3BC. The default value is 0x378. InterfaceType = INTERFACE The SED1520 chip can be driven with one of two interface types selected by the level of the RESET line: 68-style MCU interface (high level) or 80-style MCU interface (low level). Use value 68 if your display is connected using "68 family MPU" style. In this mode E1 and E2 lines are cycled to write the data. If you use 80 (the default), "80 family MPU" style is selected and the /WR line is cycled and /CS1 and /CS2 lines are required. DelayMult = DELAY This value adds an additional delay to each write, in microseconds. For the 80-style connection type actual two delays are added each. The default value of 1 already slows down communication a lot, larger value should likely be avoided. haveInverter = ¶meters.yesdefno; The original wiring by Robin used an inverter to drive the control lines. If you do not use an inverter set this to no.
lcdproc-0.5.7/docs/lcdproc-user/drivers/serialPOS.docbook000644 001751 000000 00000012252 11217162257 024173 0ustar00mmdolzewheel000000 000000 The serialPOS Driver This section talks about using LCDproc with a point of sale ("POS") character-display. The serialPOS driver is currently working with the AEDEX emulation protocol, and may support Epson ESC/POS and Logic Controls. It can be extended to work with various other protocol displays. The driver should operate most character POS displays with a serial (RS-232) input. Because these displays use a standardized protocol, if the protocol is supported by your display, it should work as expected. Feedback is welcome. serialPOS: Emulation Protocol Status Protocol Display tested Currently Supported Remark AEDEX Emax Yes IEE No Epson No Yes Emax No IBM No Logic Controls No Yes Ultimate No
(): Feature not tested.
Connecting The Display Connecting the display should consist of simply plugging it into your computer's RS-232 serial port. Because these displays typically support full RS-232, no additional wiring is needed. If your computer does not have such a port (many newer computers don't), you can use a USB to serial adapter with a driver provided by the adapter manufacturer. If your display supports a pass-through function, you can connect an RS-232 keyboard or terminal to the pass-through port. This will allow you to input keystrokes to LCDproc and control features and menus. Use the pass-through keyboard's arrow, delete, and return keys by default. If your display supports a pass-through function, but you do not have another RS-232 device connected to the pass-through port, you may experience hangs if an improperly formatted command sneaks through. This is because the display is waiting for the pass-through device to accept the data and a blocking state is created within the display. You can either connect another RS-232 device or use a wire to jumper the CTS and RTS pins together within the display. Configuration in LCDd.conf [serialPOS] Device = DEVICE Device to use in serial mode. Usual values are /dev/ttyS0 or /dev/cu.usbserial. Default is /dev/lcd. Size = ¶meters.size; Specifies the size of the VFD in characters. If not given, it defaults to 16x2. Type = { IEE | AEDEX | Epson | Emax | IBM | LogicControls | Ultimate } Set the communication protocol to use with the POS display. If not specified it defaults to AEDEX. Currently, only AEDEX is supported. Speed = { 1200 | 2400 | 9600 | 19200 | 115200 } Set the the baud rate communication with the POS display. If not given the default of 9600 is used.
lcdproc-0.5.7/docs/lcdproc-user/drivers/serialVFD.docbook000644 001751 000000 00000041131 11621737633 024154 0ustar00mmdolzewheel000000 000000 The serialVFD Driver This section talks about using LCDproc with VFD character-displays build by NEC, FUTABA and NORITAKE. The serialVFD-driver is working with NEC FIPC8367 based VFDs and the "KD Rev 2.1" (an ATMEL AT90S.... based FM20X2KB-AB replacement). It is also known to work on FUTABA VFDs. The driver should operate most of NEC, Futaba and Noritake 7x5 dot VFDs with serial(RS-232) and/or parallel interface. See the following table for testing-status. Feedback is welcome. serialVFD: Display Status Display Controller Serial Parallel Display tested Type Remark NEC FM20X2KB-AB NEC FIPC8367 Ok Ok Yes 0 NEC FC20X2JA NEC FIPC8367 (Ok) Should work, but feature not tested yet. (Ok) No 0 Same Controller as on FM20X2KB-AB NEC FC20X1SA-AB/AA NEC FIPC8367 (Ok) (Ok) No 0 Same Controller as on FM20X2KB-AB KD Rev 2.1 AT90S.... microcontroller Ok - Yes 1, 0 Custom-Characters are not supported with this Type, set Custom-Characters=0 in LCDd.conf. FUTABA M402SD06GJ ? (?) Ok Yes 3 The display has no user-characters. Serial interface with PC compatible baudrate is optional only, feature not tested. FUTABA M204SD01AA FUTABA 5P00A016 (Ok) (Ok) No 3 Futaba NA202SD08FA ? Ok Ok Yes 6 almost IEE compatible, no Custom-Characters Samsung 20S204DA2 and 20S207DA1 ? Ok Ok Yes 3, 7 The display is FUTABA compatible (hard- and software). Custom-Characters not supported(?). Samsung 20S207DA4 and 20S207DA6 ? Ok Ok Yes 7, 3 almost Futaba compatible Noritake CU20026SCPB-T microcontroller (Ok) (Ok) No 2 Noritake CU20045SCPB-T28A ? (Ok) (Ok) No 2 IEE 36657-01 (= 02S-93290-VFD 36657-01) ? Ok Ok Yes 4 IEE S03601-95B ? (Ok) (Ok) No 4 IEE S03601-96-080 ? (Ok) (Ok) No 5 Siemens/Wincor Nixdorf BA63/66 ? Ok - Yes 8 Display needs different connection, see below! no Custom-Characters, no brightness-control
If your display isn't working 100% satisfactorily you can add a new device with modified hardware commands to the driver if you want. To do that you have to add a new section to the display Type-switch-case in ./server/drivers/serialVFD-displays.c and to write a new "load" function with the correct commands for the display. (Try which display Type works best with your display, then copy, rename and modify this function to your needs - that is the easiest way I guess.) On Malte Poeggel's page you may find pictures and datasheets of the VFDs: It is possible to switch the display off and back on while the server is running. It may take a few minutes until the next full refresh makes the display show everything correctly. Connecting The Display The Connections shown have been tested successfully. Always cross-check with your datasheet, before connecting your display! Different displays of even the same manufacturer may have different pin assignments! With this example connections it will be easy to connect displays with different connector pin-layouts, the pins are commonly named equal in the datasheet. Serial Connections It is not possible to connect most of the displays directly to the serial port. The signal has to be inverted. I use the following circuit to do that job.
serialVFD: Serial Inverter - A* | E| | | | | 5(GND) ---------o-----------o----o--------------o-- GND |* Shield -----------------------------------------o optional *connect near display ]]>
The pins on the different displays vary. NEC Displays (FM20X2KB-AB): CN1: CN2: KD Rev 2.1: The blue connector (6pin in a row) (the important one!): Hold the display in that position where you can read the KD Rev 2.1 marking normally! The gray connector (10pin 2 rows): The two jumpers next to the gray connector: FUTABA Displays (M402SD06GJ): Siemens/Wincor Nixdorf BA63/66: This display doesn't need the inverter! It must be connected directly with the serial port. Check the serial port setup of the display, it has to be "9600 8N1". In most cases JP3 needs to be modified (closed) by the user! More detailed information can be found in the users manual of the display.
Parallel Connections NEC Displays (FM20X2KB-AB): CN1: CN2: FUTABA Displays (M402SD06GJ):
Configuration in LCDd.conf [serialVFD] use_parallel = ¶meters.yesdefno; "no" if display connected serial, "yes" if connected parallel [default: no(serial)]. Port = PORT Portaddress where the LPT is. Used in parallel mode only. Usual values are 0x278, 0x378 and 0x3BC [default: 0x278]. PortWait = DELAY Set parallel port timing delay (us). Used in parallel mode only. [default: 2; legal: 0 - 255]. Device = DEVICE Device to use in serial mode. Usual values are /dev/ttyS0 and /dev/ttyS1 [default: /dev/lcd]. Custom-Characters = CUSTOM-CHARACTERS Number of Custom-Characters [default: Display-Type dependent]. Size = ¶meters.size; Specifies the size of the VFD. [default: 20x2] Type = CODE Specifies the display type.[default: 0] The following type codes are available: CODE VFD model 0 NEC (FIPC8367 based) VFDs 1 KD Rev 2.1 2 Noritake VFDs 3 Futaba VFDs 4 IEE S03601-95B 5 IEE S03601-96-080 6 Futaba NA202SD08FA (allmost IEE compatible) 7 Samsung 20S207DA? 8 Siemens/Wincor Nixdorf BA63/66 Noritake VFDs have not been tested yet. Feedback is welcome. Brightness = BRIGHTNESS Set the initial brightness [default: 1000; legal: 0 - 1000] (4 steps 0-250, 251-500, 501-750, 751-1000) OffBrightness = OFFBRIGHTNESS Set the initial off-brightness [default: 0; legal: 0 - 1000]. This value is used when the display is normally switched off in case LCDd is inactive. (4 steps 0-250, 251-500, 501-750, 751-1000) Speed = { 1200 | 2400 | 9600 | 19200 | 115200 } Set the the baud rate communication with the VFD. If not given [default 9600]. ISO_8859_1 = ¶meters.yesdefno; Enable ISO-8859-1 compatibility [default is yes].
lcdproc-0.5.7/docs/lcdproc-user/drivers/shuttleVFD.docbook000644 001751 000000 00000004120 11621737633 024362 0ustar00mmdolzewheel000000 000000 The shuttleVFD Driver Features The shuttleVFD drivers works with Shuttle Computer Group VFDs. These VFDs are found on various Shuttle XPC models. A partial list include Shuttle M1000, Shuttle M2000, Shuttle G5 3300m and Shuttle SG33G5M. The display itself is a 20x1 character display. Each character cell is 5x8 pixels. It also has smaller row of specialized icons: clock, radio, music, CD/DVD, television, camera, rewind, record, play, pause, stop, fast-forward, reverse, repeat, mute, and a series of volume bars. Some or all of the icons can be displayed. The display is driven by Princeton Technologies PT6314 VFD Controller according to the sources cited in the driver source. The PT6314 is probably driven off the Serial Peripheral Interface of a Cypress CY7C63723C low-speed USB controller that is connected to the mainboard via USB. Data is written to the Cypress CY7C63723C in bytes. The specifications for both the PT6314 and CY7C63723C are available, but not used when writing this driver. It seems that much more advanced uses are available if the specifications were to be used, specifically pixel addressing. A current limitation of the driver is that it sleeps for some number of microseconds after writing to the display. If data is written to the display too quickly, it is simply discarded therefore the driver must sleep. The sleep time was experimentally found on a Shuttle M1000 machine and is hard-coded into the driver. This maybe different for other machines and configurations. This may occasionally cause the display to flicker or refresh unevenly across the display. It seems that the PT6314 can signal when it has read the data from the buffer, but this functionality is not used. Configuration in LCDd.conf [shuttleVFD] There are no configuration options available for this display. lcdproc-0.5.7/docs/lcdproc-user/drivers/sli.docbook000644 001751 000000 00000003237 11506112610 023111 0ustar00mmdolzewheel000000 000000 The sli Driver This section talks about using LCDproc with Serial LCD Interface (SLI-OEM) boards from Wirz Electronics. This driver is intended for use with the original SLI-OEM boards from Wirz Electronics. As of 2010 Parallax, Inc. sells serial displays designed by Element Products (formerly Wirz Electronics). Due to the lack of documentation it is unclear if these devices do work with this driver. Configuration in LCDd.conf [sli] Device = DEVICE Select the output device to use [default: /dev/lcd] Speed = { 1200 | 2400 | 9600 | 19200 | 38400 | 57600 | 115200 } Set the the baud rate communication with the LCD. If not specified, the default is 19200. lcdproc-0.5.7/docs/lcdproc-user/drivers/stv5730.docbook000644 001751 000000 00000001512 11217162257 023462 0ustar00mmdolzewheel000000 000000 The stv5730 Driver This section talks about using LCDproc with LCD displays that use the stv5730 chipset. Configuration in LCDd.conf [stv5730] Port = PORT Specify the address of the parallel port the LCD is connected to. Common values for PORT are 0x278, 0x378 and 0x3BC. If not given, it defaults to 0x378. lcdproc-0.5.7/docs/lcdproc-user/drivers/SureElec.docbook000644 001751 000000 00000005273 11506112610 024033 0ustar00mmdolzewheel000000 000000 The SureElec Driver Driver for the LCD modules (actually the controller board) available from the 'SURE electronics' shop (). These devices are PIC based controlled, using a serial communication protocol with the host. The actual connection to host is done through USB through a serial-to-USB converter (CP2102 USB to UART Bridge) integrated on the board. Configuration in LCDd.conf [SureElec] Device = DEVICE Name of the device the display appears as. By default first USB serial device /dev/ttyUSB0 is used. Edition = EDITION Edition level of the device (can be 1, 2 or 3). The default is 2. Size = ¶meters.size; Set the display size in characters. This is required for edition 1 devices. For edition 2 & 3 devices this value, if defined, overrides the size read directly from the device. Contrast = CONTRAST Select the display's contrast, 480 is the default. Permissible values are in the range of 0-1000. Brightness = BRIGHTNESS Select the display's brightness, 480 is the default. Permissible values are in the range of 0-1000. OffBrightness = OFFBRIGHTNESS Select the display's when the display is normally switched off in case LCDd is inactive, 100 is the default. Permissible values are in the range of 0-1000. lcdproc-0.5.7/docs/lcdproc-user/drivers/svga.docbook000644 001751 000000 00000004371 11621737633 023302 0ustar00mmdolzewheel000000 000000 The svga Driver This section talks about using LCDproc with LCD displays that use the svga library. Configuration in LCDd.conf [svga] Mode = SCGALIB-MODE svgalib mode to use [default: G320x240x256] SCGALIB-MODE can be any legal mode string for svgalib. See the svgalib 7 manual page for legal mode strings. Size = ¶meters.size; set display size [default: 20x4] Contrast = CONTRAST Set the initial contrast. Legal values for CONTRAST are 0 - 1000. If not given, the default value is 500. This parameter can be set but it does not change anything in the driver. Brightness = BRIGHTNESS Set the initial brightness [default: 1000; legal: 1 - 1000] OffBrightness = BRIGHTNESS Set the initial off-brightness [default: 500; legal: 1 - 1000] This value is used when the display is normally switched off in case LCDd is inactive lcdproc-0.5.7/docs/lcdproc-user/drivers/t6963.docbook000644 001751 000000 00000013222 11621737633 023130 0ustar00mmdolzewheel000000 000000 The Toshiba T6963 Driver This section talks about using LCDproc with LCD displays that use the T6963 chipset from Toshiba. Usually, this chipset is used on big graphical LCD displays that can often act as a screen. The driver uses the text mode of the chipset with a custom font loaded which resembles the characters from HD44780 ROM 002 character set (European character set). If your display has a 'Font Select' pin it must be wired to use the 6x8 font. Only displays in 'Single Scan' configurations are supported. Displays configured as 'Dual Scan' are currently not supported. Those use on-board memory differently. Check the datasheet of your display! Connections Displays using T6963 chipset come in a variety of pin-outs and power configurations. They usually require negative voltage for contrast and some displays have a negative voltage generator on-board. Therefore the wiring table below does only list signal names, not LCD pins. Be sure to get the correct datasheet for your display and identify the pins to use! We do not give wiring examples for power, contrast, and other control lines. You have to figure out this from your display's datasheet! T6963 wiring schematic Parallel port <-> LCD name pin name pin nSTRB 1 /WR * D0-D7 2-9 DB0-DB7 * nLF 14 /CE * INIT 16 C/D * nSEL 17 /RD * VDD FS *
Compiling Make sure that the T6963 files are built when you run configure. This can be done by specifying "--enable-drivers=all" or by "--enable-drivers=t6963". Configuration in LCDd.conf [t6963] Size = ¶meters.size; Set display size in pixels [default: 128x64]. The size in characters is automatically calculated assuming the font size is set to 6x8 for the display. Port = PORT Specify the address of the parallel port the LCD is connected to. Common values for PORT are 0x278, 0x378 and 0x3BC. Legal values are 0x200 - 0x400. If not given the default value is 0x378. bidirectional = ¶meters.yesdefno; Use LPT port in bi-directional mode. [default: yes; legal: yes, no] Most LPT ports can be used in bi-directional mode. It is required for proper timing of the display. Leave this on unless you experience problems. ClearGraphic = ¶meters.yesnodef; Clear graphic memory on start-up [default: no; legal: yes, no]. The T6963 has a graphic and a text area which can be combined using several modes. This driver uses default OR-mode. Usually the graphic area is empty after power-on but if you see random garbage overlaying the text this option may be enabled. delayBus = ¶meters.yesnodef; Use additional delay in read / write operations. [default: no; legal: yes, no]. The display can execute operations very fast. As the driver implements busy checking no additional delays are required. But if you experience problems you may try to slow down communication by enabling this setting.
lcdproc-0.5.7/docs/lcdproc-user/drivers/text.docbook000644 001751 000000 00000001122 11621737633 023315 0ustar00mmdolzewheel000000 000000 The text Driver The text driver simply outputs the content of the internal framebuffer to the current console using printf(). Configuration in LCDd.conf [text] Size = ¶meters.size; Set the display size [default: 20x4] lcdproc-0.5.7/docs/lcdproc-user/drivers/tyan.docbook000644 001751 000000 00000003663 11217162257 023313 0ustar00mmdolzewheel000000 000000 The tyan Driver This section talks about using LCDproc with LCD modules used in Tyan GS10 and GS12 barebones. Features The LCD modules used on the front side of the Tyan GS10 and GS12 series barebones consist of an LCD display by Winstar Display Co. LTD that is 16 characters wide and 2 lines high. To the right of the display there is a 6 button keypad: 4 array buttons and two buttons labeled C and S. For more information see the LCD pack from the Tyan support page. Besides a useless old version of LCDproc it contains some documentation about the panel itself including a PDF specification of the LCD display by its manufacturer. Configuration in LCDd.conf [tyan] Device = DEVICE Select the output device to use [default: /dev/lcd] Speed = { 4800 | 9600 } Set the the baud rate communication with the LCD. If not given, the default is 9600. Size = ¶meters.size; set display size [default: 16x2] lcdproc-0.5.7/docs/lcdproc-user/drivers/ula200.docbook000644 001751 000000 00000014275 11621737633 023351 0ustar00mmdolzewheel000000 000000 The ula200 Driver General The ULA-200 (short for German USB-LCD-Ansteuerung), manufactured and sold by ELV, is a small board that connects a HD44780-compatible display to the computer using the USB interface. Additionally it provides 6 digital inputs that can be used for keys. The ula200 driver controls this board supporting the features: display on a single-controller HD44780 display standard icons (heart, checkbox) backlight control input buttons no horizontal or vertical bars Requirements The driver uses libftdi, which again uses libusb for communication with the device, so no kernel driver is needed on Linux, and the driver can be used on other operating systems as well. When using a libusb based driver like IOWarrior, LCDd needs to be started as root. On Linux, you have to take care that the ftdi_sio.ko kernel module doesn't claim the ELV device. If you didn't change the IDs in the kernel driver (ftdi_sio.c), this should not matter. Known problems Sometimes the display hangs (the ACK response is not received) on shutdown. Reconnect the display in that case. Please do the same if it hangs while starting up. The latter only happens if it was not the first time LCDd talked to the display. Implementation note (by the driver's author Bernhard Walle) The ULA-200 talks a text protocol which allows to display text using a high-level language, i.e. STX s len char0 char1 ... ETX. It also allows low-level register access to the HD44780. So in theory, it would be possible to write a connection type for the hd44780 driver and let the hd44780 core do the rest. I tried this. It was slow and didn't work with user-specific characters (the hd44780 frequently changes this characters which seems to confuse the microcontroller, at least I cannot explain why it didn't work, there was garbage). So I wrote a separate driver, the ula200, which uses the high-level language and should work for displays with all sizes. I only tested 20x4, so maybe for other sizes the positioning code may be adapted. As I mentioned, there were problems with frequently changing the user-definable characters. I also tried to implement bar code in the ula200 driver with similar effects. I gave it up because I don't need it personally and it can be done later. However, standard icons are implemented. The user-definable characters are set in startup and are not changed. This works like a charm. It is not possible to use character 0 with the high-level language (or at least it isn't documented how to escape it). It could be done with hd44780 code, but I replaced the character with a standard character which looks good. Configuration in LCDd.conf [ula200] Size = ¶meters.size; Select the LCD size [default: 20x4] KeyMap_A = KEY KeyMap_B = KEY KeyMap_C = KEY KeyMap_D = KEY KeyMap_E = KEY KeyMap_F = KEY If you have a non standard keypad you can associate any keystrings to keys. There are 6 input keys in the ULA-200 hardware that generate characters from 'A' to 'F'. Legal values for KEY are Up, Down, Left, Right, Enter and Escape. The following table lists the built-in default mapping hardcoded in the driver. KeyMap_A Up KeyMap_B Down KeyMap_C Left KeyMap_D Right KeyMap_E Enter KeyMap_F Escape You may leave it unchanged if you have a standard keypad. You can change it if you want to report other keystrings or have a non-standard keypad. lcdproc-0.5.7/docs/lcdproc-user/drivers/vlsys_m428.docbook000644 001751 000000 00000002267 12014174064 024264 0ustar00mmdolzewheel000000 000000 The vlsys_m428 driver General The vlsys_m428 driver handles the VFD/IR combination from VLSystem built into the case MonCaso 320 from the manufacturer Moneual. The driver functionality is rudimentary as it is derived from a reverse engineering from the Windows driver behaviour. This driver writes only to the serial port, and it triggers no transmission activity of the combination. Thus, it cooperates with drivers reading only from the port. Other drivers are allowed to initialize the combination for IR operation. The vlsys_m428 driver assumes the character encoding ISO 8859-1. Note: The mapping from the character encoding to the display encoding is not complete; furthermore some characters are approximated by similar ones. Configuration The only configuration parameter is Device, the path name of the serial device (a mapper between USB and serial line emulation). By default it is /dev/ttyUSB0. lcdproc-0.5.7/docs/lcdproc-user/drivers/xosd.docbook000644 001751 000000 00000006057 11506112610 023302 0ustar00mmdolzewheel000000 000000 The xosd Driver This section talks about using LCDproc with libxosd. libxosd is a system that displays text on top of your X-Windows screen, much like the on-screen display (OSD) used by most modern televisions and video-players. Configuration in LCDd.conf [xosd] Size = ¶meters.size; set display size [default: 20x4] Offset = X-OFFSET x Y-OFFSET Offset (in pixels) of the top-left corner of LCDproc's xosd window from the top-left corner of the monitor. If not given, it defaults to 0x0. Font = FONT X font to use, in XLFD (X Logical Font Description) format, as given by the xfontsel property. E.g. -*-terminus-*-r-*-*-*-320-*-*-*-*-*. For best results it is recommended to use a mono-spaced font to mimic the aspect of a physical LCD display that most clients expect with regard to their screen layouts. Contrast = CONTRAST Set the initial contrast. Legal values for CONTRAST are 0 - 1000. If not given, the default value is 500. This parameter can be set but it does not change anything in the driver. Brightness = BRIGHTNESS Set the initial brightness [default: 1000; legal: 1 - 1000] OffBrightness = BRIGHTNESS Set the initial off-brightness [default: 500; legal: 1 - 1000] This value is used when the display is normally switched off in case LCDd is inactive lcdproc-0.5.7/server/Makefile.am000644 001751 000000 00000001215 12014174064 017312 0ustar00mmdolzewheel000000 000000 ## Process this file with automake to produce Makefile.in SUBDIRS=drivers commands sbin_PROGRAMS=LCDd LCDd_SOURCES= client.c client.h clients.c clients.h input.c input.h main.c main.h menuitem.c menuitem.h menu.c menu.h menuscreens.c menuscreens.h parse.c parse.h render.c render.h screen.c screen.h screenlist.c screenlist.h serverscreens.c serverscreens.h sock.c sock.h widget.c widget.h drivers.c drivers.h driver.c driver.h LDADD = ../shared/libLCDstuff.a commands/libLCDcommands.a @LIBPTHREAD_LIBS@ if !DARWIN AM_LDFLAGS = -rdynamic -uget_args endif AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/shared -DSYSCONFDIR=\"$(sysconfdir)\" ## EOF lcdproc-0.5.7/server/client.c000644 001751 000000 00000010175 12014174064 016705 0ustar00mmdolzewheel000000 000000 /** \file server/client.c * Define all the client data and actions. */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven * 2002, Joris Robijn */ #include #include #include #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "client.h" #include "screen.h" #include "screenlist.h" #include "render.h" #include "input.h" #include "menuscreens.h" #include "shared/report.h" #include "shared/LL.h" Client *client_create(int sock) { Client *c; debug(RPT_DEBUG, "%s(sock=%i)", __FUNCTION__, sock); /* Allocate new client...*/ c = malloc(sizeof(Client)); if (!c) { report(RPT_ERR, "%s: Error allocating", __FUNCTION__); return NULL; } /* Init struct members*/ c->sock = sock; c->messages = NULL; c->backlight = BACKLIGHT_OPEN; c->heartbeat = HEARTBEAT_OPEN; /*Set up message list...*/ c->messages = LL_new(); if (!c->messages) { report(RPT_ERR, "%s: Error allocating", __FUNCTION__); free(c); return NULL; } c->state = NEW; c->name = NULL; c->menu = NULL; c->screenlist = LL_new(); if (!c->screenlist) { report(RPT_ERR, "%s: Error allocating", __FUNCTION__); return NULL; } return c; } int client_destroy(Client *c) { Screen *s; Menu *m; char *str; if (!c) return -1; debug(RPT_DEBUG, "%s(c=[%d])", __FUNCTION__, c->sock); /* Close the socket */ close(c->sock); /* Eat messages */ while ((str = client_get_message(c))) { free(str); } LL_Destroy(c->messages); /* Clean up the screenlist...*/ debug(RPT_DEBUG, "%s: Cleaning screenlist", __FUNCTION__); for (s = LL_GetFirst(c->screenlist); s; s = LL_GetNext(c->screenlist)) { /* Free its memory...*/ screen_destroy(s); /* Note that the screen is not removed from the list because * the list will be destroyed anyway... */ } LL_Destroy(c->screenlist); m = (Menu *) c->menu; /* Destroy the client's menu, if it exists */ if (m) { menuscreen_inform_item_destruction(m); menu_remove_item(m->parent, m); menuscreen_inform_item_modified(m->parent); menuitem_destroy(m); } /* Forget client's key reservations */ input_release_client_keys(c); /* Free client's other data */ c->state = GONE; /* Clean up the name...*/ if (c->name) free(c->name); /* Remove structure */ free(c); debug(RPT_DEBUG, "%s: Client data removed", __FUNCTION__); return 0; } /*Add and remove messages from the client's queue...*/ int client_add_message(Client *c, char *message) { int err = 0; if (!c) return -1; if (!message) return -1; if (strlen(message) > 0) { debug(RPT_DEBUG, "%s(c=[%d], message=\"%s\")", __FUNCTION__, c->sock, message); err = LL_Enqueue(c->messages, (void *) message); } return err; } /* Woo-hoo! A simple function. :)*/ char * client_get_message(Client *c) { char *str; debug(RPT_DEBUG, "%s(c=[%d])", __FUNCTION__, c->sock); if (!c) return NULL; str = (char *) LL_Dequeue(c->messages); return str; } Screen * client_find_screen(Client *c, char *id) { Screen *s; if (!c) return NULL; if (!id) return NULL; debug(RPT_DEBUG, "%s(c=[%d], id=\"%s\")", __FUNCTION__, c->sock, id); LL_Rewind(c->screenlist); do { s = LL_Get(c->screenlist); if ((s) && (0 == strcmp(s->id, id))) { debug(RPT_DEBUG, "%s: Found %s", __FUNCTION__, id); return s; } } while (LL_Next(c->screenlist) == 0); return NULL; } int client_add_screen(Client *c, Screen *s) { if (!c) return -1; if (!s) return -1; debug(RPT_DEBUG, "%s(c=[%d], s=[%s])", __FUNCTION__, c->sock, s->id); LL_Push(c->screenlist, (void *) s); /* Now, add it to the screenlist...*/ screenlist_add(s); return 0; } int client_remove_screen(Client *c, Screen *s) { if (!c) return -1; if (!s) return -1; debug(RPT_DEBUG, "%s(c=[%d], s=[%s])", __FUNCTION__, c->sock, s->id); /* TODO: Check for errors here?*/ LL_Remove(c->screenlist, (void *) s, NEXT); /* Now, remove it from the screenlist...*/ screenlist_remove(s); return 0; } int client_screen_count(Client *c) { return LL_Length(c->screenlist); } lcdproc-0.5.7/server/client.h000644 001751 000000 00000004000 12014174064 016700 0ustar00mmdolzewheel000000 000000 /** \file server/client.h * Defines all the client data and actions. * * \note If you only need 'struct Client' to work with, you should use the * following code (which does not create an indirect dependency on * 'struct Screen'): * * \code * #define INC_TYPES_ONLY 1 * #include "client.h" * #undef INC_TYPES_ONLY * \endcode */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven * 2002, Joris Robijn */ #ifndef CLIENT_H_TYPES #define CLIENT_H_TYPES #include "shared/LL.h" #define CLIENT_NAME_SIZE 256 /** Possible states of a client. */ typedef enum _clientstate { NEW, /**< Client did not yet send \c hello. */ ACTIVE, /**< Client sent \c hello, but not yet \c bye. */ GONE /**< Client sent \c bye. */ } ClientState; /** The structure representing a client in the server. */ typedef struct Client { char *name; ClientState state; int sock; int backlight; int heartbeat; LinkedList *messages; /**< Messages that the client sent. */ LinkedList *screenlist; /**< List of client's screens. */ void* menu; /**< Menu hierarchy, if any */ } Client; #endif #ifndef INC_TYPES_ONLY #ifndef CLIENT_H_FNCS #define CLIENT_H_FNCS #define INC_TYPES_ONLY 1 #include "screen.h" #undef INC_TYPES_ONLY /* When a new client connects, set up a new client data struct */ Client *client_create(int sock); /* Destroys the client data */ int client_destroy(Client *c); /* Close the socket */ void client_close_sock(Client *c); /* Add message to the client's queue...*/ int client_add_message(Client *c, char *message); /* Get message from queue */ char *client_get_message(Client *c); /* Find a named screen for the client */ Screen *client_find_screen(Client *c, char *id); int client_add_screen(Client *c, Screen *s); int client_remove_screen(Client *c, Screen *s); int client_screen_count(Client *c); #endif #endif lcdproc-0.5.7/server/clients.c000644 001751 000000 00000005257 12014174064 017075 0ustar00mmdolzewheel000000 000000 /** \file server/clients.c * This file contains code allowing LCDd to handle client connections and * data structures. It contains functions to initialize the internal list * of clients, terminate client connections, add new clients to the list, * and locating a client's socket. */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven * 2002, Joris Robijn */ #include #include #include #include #include "shared/report.h" #include "shared/LL.h" #include "client.h" #include "clients.h" #include "render.h" LinkedList *clientlist = NULL; /* Initialize and kill client list...*/ int clients_init(void) { debug(RPT_DEBUG, "%s()", __FUNCTION__); clientlist = LL_new(); if (!clientlist) { report(RPT_ERR, "%s: Unable to create client list", __FUNCTION__); return -1; } return 0; } int clients_shutdown(void) { Client *c; debug(RPT_DEBUG, "%s()", __FUNCTION__); if (!clientlist) { /* Program shutdown before completed startup */ return -1; } /* Free all client structures... */ for (c = LL_GetFirst(clientlist); c; c = LL_GetNext(clientlist)) { debug(RPT_DEBUG, "%s: ...", __FUNCTION__); if (c) { debug(RPT_DEBUG, "%s: ... %i ...", __FUNCTION__, c->sock); if (client_destroy(c) != 0) { report(RPT_ERR, "%s: Error freeing client", __FUNCTION__); } else { debug(RPT_DEBUG, "%s: Freed client...", __FUNCTION__); } } else { debug(RPT_DEBUG, "%s: No client!", __FUNCTION__); } } /* Then, free the list...*/ LL_Destroy(clientlist); debug(RPT_DEBUG, "%s: done", __FUNCTION__); return 0; } /* Add the client to the clients list... */ Client * clients_add_client(Client *c) { if (LL_Push(clientlist, c) == 0) return c; return NULL; } /* Remove the client from the clients list... */ Client * clients_remove_client(Client *c, Direction whereto) { Client *client = LL_Remove(clientlist, c, whereto); return client; } Client * clients_getfirst(void) { return (Client *) LL_GetFirst(clientlist); } Client * clients_getnext(void) { return (Client *) LL_GetNext(clientlist); } int clients_client_count(void) { return LL_Length(clientlist); } /* A client is identified by the file descriptor * associated with it. Find one. */ Client * clients_find_client_by_sock(int sock) { Client *c; debug(RPT_DEBUG, "%s(sock=%i)", __FUNCTION__, sock); for (c = LL_GetFirst(clientlist); c; c = LL_GetNext(clientlist)) { if (c->sock == sock) { return c; } } debug(RPT_ERR, "%s: failed", __FUNCTION__); return NULL; } lcdproc-0.5.7/server/clients.h000644 001751 000000 00000001530 12014174064 017070 0ustar00mmdolzewheel000000 000000 /** \file server/clients.h * Manage the list of clients that are connected. */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven */ #ifndef CLIENTS_H #define CLIENTS_H #include "client.h" /* Initialize and kill client list...*/ int clients_init(void); int clients_shutdown(void); /* Add/remove clients (return NULL for error) */ Client *clients_add_client(Client *c); Client *clients_remove_client(Client *c, Direction whereto); /* List functions */ Client *clients_getfirst(void); Client *clients_getnext(void); int clients_client_count(void); /* Search for a client with a particular filedescriptor...*/ Client * clients_find_client_by_sock(int sock); #endif lcdproc-0.5.7/server/input.c000644 001751 000000 00000014465 12014174064 016574 0ustar00mmdolzewheel000000 000000 /** \file server/input.c * Handles keypad (and other?) input from the user. */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven * 2003, Joris Robijn */ #include #include #include #include "shared/sockets.h" #include "shared/report.h" #include "shared/configfile.h" #include "shared/LL.h" #include "drivers.h" #define INC_TYPES_ONLY 1 #include "client.h" #include "screen.h" #undef INC_TYPES_ONLY #include "screenlist.h" #include "menuscreens.h" #include "input.h" #include "render.h" /* For server_msg* */ LinkedList *keylist; char *toggle_rotate_key; char *prev_screen_key; char *next_screen_key; char *scroll_up_key; char *scroll_down_key; /* Local functions */ int server_input(int key); void input_send_to_client(Client *c, const char *key); void input_internal_key(const char *key); int input_init(void) { debug(RPT_DEBUG, "%s()", __FUNCTION__); keylist = LL_new(); /* Get rotate/scroll keys from config file */ toggle_rotate_key = strdup(config_get_string("server", "ToggleRotateKey", 0, "Enter")); prev_screen_key = strdup(config_get_string("server", "PrevScreenKey", 0, "Left")); next_screen_key = strdup(config_get_string("server", "NextScreenKey", 0, "Right")); scroll_up_key = strdup(config_get_string("server", "ScrollUpKey", 0, "Up")); scroll_down_key = strdup(config_get_string("server", "ScrollDownKey", 0, "Down")); return 0; } int input_shutdown() { if (!keylist) { /* Program shutdown before completed startup */ return -1; } free(keylist); free(toggle_rotate_key); free(prev_screen_key); free(next_screen_key); free(scroll_up_key); free(scroll_down_key); return 0; } int handle_input(void) { const char *key; Screen *current_screen; Client *current_client; Client *target; KeyReservation *kr; debug(RPT_DEBUG, "%s()", __FUNCTION__); current_screen = screenlist_current(); if (current_screen) current_client = current_screen->client; else current_client = NULL; /* Handle all keypresses */ while ((key = drivers_get_key()) != NULL) { /* Find what client wants the key */ kr = input_find_key(key, current_client); if (kr) { /* A hit ! */ report(RPT_DEBUG, "%s: reserved key: \"%.40s\"", __FUNCTION__, key); target = kr->client; } else { report(RPT_DEBUG, "%s: left over key: \"%.40s\"", __FUNCTION__, key); /*target = current_client;*/ target = NULL; /* left-over keys are always for internal client */ } if (target == NULL) { report(RPT_DEBUG, "%s: key is for internal client", __FUNCTION__); input_internal_key(key); } else { /* It's an external client */ report(RPT_DEBUG, "%s: key is for external client on socket %d", __FUNCTION__, target->sock); input_send_to_client(target, key); } } return 0; } void input_send_to_client(Client *c, const char *key) { char *s; size_t size = strlen(key) + sizeof("key %s\n"); // this is large enough debug(RPT_DEBUG, "%s(client=[%d], key=\"%.40s\")", __FUNCTION__, c->sock, key); /* Allocate just as much as we need */ s = calloc(1, size); if (s != NULL) { snprintf(s, size, "key %s\n", key); sock_send_string(c->sock, s); free(s); } else report(RPT_ERR, "%s: malloc failure", __FUNCTION__); } void input_internal_key(const char *key) { if (is_menu_key(key) || screenlist_current() == menuscreen) { menuscreen_key_handler(key); } else { /* Keys are for scrolling or rotating */ if (strcmp(key, toggle_rotate_key) == 0) { autorotate = !autorotate; if (autorotate) { server_msg("Rotate", 4); } else { server_msg("Hold", 4); } } else if (strcmp(key, prev_screen_key) == 0) { screenlist_goto_prev(); server_msg("Prev", 4); } else if (strcmp(key, next_screen_key) == 0) { screenlist_goto_next(); server_msg("Next", 4); } else if (strcmp(key, scroll_up_key) == 0) { } else if (strcmp(key, scroll_down_key) == 0) { } } } int input_reserve_key(const char *key, bool exclusive, Client *client) { KeyReservation *kr; debug(RPT_DEBUG, "%s(key=\"%.40s\", exclusive=%d, client=[%d])", __FUNCTION__, key, exclusive, (client?client->sock:-1)); /* Find out if this key is already reserved in a way that interferes * with the new reservation. */ for (kr = LL_GetFirst(keylist); kr != NULL; kr = LL_GetNext(keylist)) { if (strcmp(kr->key, key) == 0) { if (kr->exclusive || exclusive) { /* Sorry ! */ return -1; } } } /* We can now safely add it ! */ kr = malloc(sizeof(KeyReservation)); kr->key = strdup(key); kr->exclusive = exclusive; kr->client = client; LL_Push(keylist, kr); report(RPT_INFO, "Key \"%.40s\" is now reserved %s by client [%d]", key, (exclusive ? "exclusively" : "shared"), (client ? client->sock : -1)); return 0; } void input_release_key(const char *key, Client *client) { KeyReservation *kr; debug(RPT_DEBUG, "%s(key=\"%.40s\", client=[%d])", __FUNCTION__, key, (client ? client->sock : -1)); for (kr = LL_GetFirst(keylist); kr != NULL; kr = LL_GetNext(keylist)) { if ((kr->client == client) && (strcmp(kr->key, key) == 0)) { report(RPT_INFO, "Key \"%.40s\" reserved %s by client [%d] and is now released", key, (kr->exclusive ? "exclusively" : "shared"), (client ? client->sock : -1)); free(kr->key); free(kr); LL_DeleteNode(keylist, NEXT); return; } } } void input_release_client_keys(Client *client) { KeyReservation *kr; debug(RPT_DEBUG, "%s(client=[%d])", __FUNCTION__, (client ? client->sock : -1)); for (kr = LL_GetFirst(keylist); kr != NULL; kr = LL_GetNext(keylist)) { if (kr->client == client) { report(RPT_INFO, "Key \"%.40s\" reserved %s by client [%d] and is now released", kr->key, (kr->exclusive ? "exclusively" : "shared"), (client ? client->sock : -1)); free(kr->key); free(kr); // jump to node before deleted one to not miss any LL_DeleteNode(keylist, PREV); } } } KeyReservation *input_find_key(const char *key, Client *client) { KeyReservation *kr; debug(RPT_DEBUG, "%s(key=\"%.40s\", client=[%d])", __FUNCTION__, key, (client?client->sock:-1)); for (kr = LL_GetFirst(keylist); kr != NULL; kr = LL_GetNext(keylist)) { if (strcmp(kr->key, key) == 0) { if (kr->exclusive || client == kr->client) { return kr; } } } return NULL; } lcdproc-0.5.7/server/input.h000644 001751 000000 00000002564 12014174064 016576 0ustar00mmdolzewheel000000 000000 /** \file server/input.h */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven * 2003, Joris Robijn */ #ifndef INPUT_H #define INPUT_H #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef HAVE_STDBOOL_H # include #endif #include "shared/defines.h" /* Accepts and uses keypad input while displaying screens... */ int handle_input(void); typedef struct KeyReservation { char *key; bool exclusive; Client *client; /* NULL for internal clients */ } KeyReservation; int input_init(void); /* Init the input handling system */ int input_shutdown(void); /* Shut it down */ int input_reserve_key(const char *key, bool exclusive, Client *client); /* Reserves a key for a client */ /* Return -1 if reservation of key is not possible */ void input_release_key(const char *key, Client *client); /* Releases a key reservation */ void input_release_client_keys(Client *client); /* Releases all key reservations for a given client */ KeyReservation *input_find_key(const char *key, Client *client); /* Finds if a key reservation causes a 'hit'. * If the key was reserved exclusively, the client will be ignored. * If the key was reserved shared, the client must match. */ #endif lcdproc-0.5.7/server/main.c000644 001751 000000 00000064661 12313532720 016363 0ustar00mmdolzewheel000000 000000 /** \file server/main.c * Contains main(), plus signal callback functions and a help screen. * * Program init, command-line handling, and the main loop are * implemented here. Also, minimal data about the program such as * the revision number. * * Some of this stuff should probably be move elsewhere eventually, * such as command-line handling and the main loop. main() is supposed * to be "dumb". */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven * 2001, Joris Robijn * 2001, Rene Wagner * 2002, Mike Patnode * 2002, Guillaume Filion * 2005-2006, Peter Marschall (cleanup) */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "getopt.h" #ifdef HAVE_SYS_TIME_H # include #endif /* TODO: fill in what to include otherwise */ #include "shared/report.h" #include "shared/defines.h" #include "drivers.h" #include "sock.h" #include "clients.h" #include "screen.h" #include "screenlist.h" #include "parse.h" #include "render.h" #include "serverscreens.h" #include "menuscreens.h" #include "input.h" #include "shared/configfile.h" #include "drivers.h" #include "main.h" #if !defined(SYSCONFDIR) # define SYSCONFDIR "/etc" #endif #define DEFAULT_BIND_ADDR "127.0.0.1" #define DEFAULT_BIND_PORT LCDPORT #define DEFAULT_CONFIGFILE SYSCONFDIR "/LCDd.conf" #define DEFAULT_USER "nobody" #define DEFAULT_DRIVER "curses" #define DEFAULT_DRIVER_PATH "" /* not needed */ #define MAX_DRIVERS 8 #define DEFAULT_FOREGROUND_MODE 0 #define DEFAULT_ROTATE_SERVER_SCREEN SERVERSCREEN_ON #define DEFAULT_REPORTDEST RPT_DEST_STDERR #define DEFAULT_REPORTLEVEL RPT_WARNING #define DEFAULT_SCREEN_DURATION 32 #define DEFAULT_BACKLIGHT BACKLIGHT_OPEN #define DEFAULT_HEARTBEAT HEARTBEAT_OPEN #define DEFAULT_TITLESPEED TITLESPEED_MAX #define DEFAULT_AUTOROTATE AUTOROTATE_ON /* Socket to bind to... Using loopback is much more secure; it means that this port is accessible only to programs running locally on the same host as LCDd. Using variables for these means that (later) we can select which port and which address to bind to at run time. */ /* Store some standard defines into vars... */ char *version = VERSION; char *protocol_version = PROTOCOL_VERSION; char *api_version = API_VERSION; char *build_date = __DATE__; /**** Configuration variables ****/ /* Some variables are settable on the command line. This are variables that * change the mode of operation. This includes settings that you can use to * enable debugging: driver selection, report settings, bind address etc. * These variables should be in main.h and main.c (below). * * All other settings do not need to be settable from the command line. They * also do not necesarily need to be read in main.c but can better be read in * in the file concerned. */ unsigned int bind_port = UNSET_INT; char bind_addr[64]; /* Do not preinit these strings as they will occupy */ char configfile[256]; /* a lot of space in the executable. */ char user[64]; /* The values will be overwritten anyway... */ /* The drivers and their driver parameters */ char *drivernames[MAX_DRIVERS]; int num_drivers = 0; /* End of configuration variables */ /* Local variables */ static int foreground_mode = UNSET_INT; static int report_dest = UNSET_INT; static int report_level = UNSET_INT; static int stored_argc; static char **stored_argv; static volatile short got_reload_signal = 0; /* Local exported variables */ long timer = 0; /**** Local functions ****/ static void clear_settings(void); static int process_command_line(int argc, char **argv); static int process_configfile(char *cfgfile); static void set_default_settings(void); static void install_signal_handlers(int allow_reload); static void child_ok_func(int signal); static pid_t daemonize(void); static int wave_to_parent(pid_t parent_pid); static int init_drivers(void); static int drop_privs(char *user); static void do_reload(void); static void do_mainloop(void); static void exit_program(int val); static void catch_reload_signal(int val); static int interpret_boolean_arg(char *s); static void output_help_screen(void); static void output_GPL_notice(void); #define CHAIN(e,f) { if (e>=0) { e=(f); }} #define CHAIN_END(e,msg) { if (e<0) { report(RPT_CRIT,(msg)); exit(EXIT_FAILURE); }} int main(int argc, char **argv) { int e = 0; pid_t parent_pid = 0; stored_argc = argc; stored_argv = argv; /* * Settings in order of preference: * * 1: Settings specified in command line options... * 2: Settings specified in configuration file... * 3: Default settings * * Because of this, and because one option (-c) specifies where * the configuration file is, things are done in this order: * * 1. Read and set options. * 2. Read configuration file; if option is read in configuration * file and not already set, then set it. * 3. Having read configuration file, if parameter is not set, * set it to the default value. * * It is for this reason that the default values are **NOT** set * in the variable declaration... */ /* Report that server is starting (report will be delayed) */ report(RPT_NOTICE, "LCDd version %s starting", version); report(RPT_INFO, "Built on %s, protocol version %s, API version %s", build_date, protocol_version, api_version); clear_settings(); /* Read command line*/ CHAIN(e, process_command_line(argc, argv)); /* Read config file * If config file was not given on command line use default */ if (strcmp(configfile, UNSET_STR) == 0) strncpy(configfile, DEFAULT_CONFIGFILE, sizeof(configfile)); CHAIN(e, process_configfile(configfile)); /* Set default values*/ set_default_settings(); /* Set reporting settings (will also flush delayed reports) */ set_reporting("LCDd", report_level, report_dest); report(RPT_INFO, "Set report level to %d, output to %s", report_level, ((report_dest == RPT_DEST_SYSLOG) ? "syslog" : "stderr")); CHAIN_END(e, "Critical error while processing settings, abort."); /* Now, go into daemon mode (if we should)... * We wait for the child to report it is running OK. This mechanism * is used because forking after starting the drivers causes the * child to loose the (LPT) port access. */ if (!foreground_mode) { report(RPT_INFO, "Server forking to background"); CHAIN(e, parent_pid = daemonize()); } else { output_GPL_notice(); report(RPT_INFO, "Server running in foreground"); } install_signal_handlers(!foreground_mode); /* Only catch SIGHUP if not in foreground mode */ /* Startup the subparts of the server */ CHAIN(e, sock_init(bind_addr, bind_port)); CHAIN(e, screenlist_init()); CHAIN(e, init_drivers()); CHAIN(e, clients_init()); CHAIN(e, input_init()); CHAIN(e, menuscreens_init()); CHAIN(e, server_screen_init()); CHAIN_END(e, "Critical error while initializing, abort."); if (!foreground_mode) { /* Tell to parent that startup went OK. */ wave_to_parent(parent_pid); } drop_privs(user); /* This can't be done before, because sending a signal to a process of a different user will fail */ do_mainloop(); /* This loop never stops; we'll get out only with a signal...*/ return 0; } static void clear_settings(void) { int i; debug(RPT_DEBUG, "%s()", __FUNCTION__); bind_port = UNSET_INT; strncpy(bind_addr, UNSET_STR, sizeof(bind_addr)); strncpy(configfile, UNSET_STR, sizeof(configfile)); strncpy(user, UNSET_STR, sizeof(user)); foreground_mode = UNSET_INT; rotate_server_screen = UNSET_INT; backlight = UNSET_INT; heartbeat = UNSET_INT; titlespeed = UNSET_INT; default_duration = UNSET_INT; report_dest = UNSET_INT; report_level = UNSET_INT; for (i = 0; i < num_drivers; i++) { free(drivernames[i]); drivernames[i] = NULL; } num_drivers = 0; } /* parses arguments given on command line */ static int process_command_line(int argc, char **argv) { int c, b; int e = 0, help = 0; debug(RPT_DEBUG, "%s(argc=%d, argv=...)", __FUNCTION__, argc); /* Reset getopt */ opterr = 0; /* Prevent some messages to stderr */ /* Analyze options here.. (please try to keep list of options the * same everywhere) */ while ((c = getopt(argc, argv, "hc:d:fa:p:u:w:s:r:i:")) > 0) { switch(c) { case 'h': help = 1; /* Continue to process the other * options */ break; case 'c': strncpy(configfile, optarg, sizeof(configfile)); configfile[sizeof(configfile)-1] = '\0'; /* Terminate string */ break; case 'd': /* Add to a list of drivers to be initialized later...*/ if (num_drivers < MAX_DRIVERS) { drivernames[num_drivers] = strdup(optarg); if (drivernames[num_drivers] != NULL) { num_drivers++; } else { report(RPT_ERR, "alloc error storing driver name: %s", optarg); e = -1; } } else { report(RPT_ERR, "Too many drivers!"); e = -1; } break; case 'f': foreground_mode = 1; break; case 'a': strncpy(bind_addr, optarg, sizeof(bind_addr)); bind_addr[sizeof(bind_addr)-1] = '\0'; /* Terminate string */ break; case 'p': bind_port = atoi(optarg); break; case 'u': strncpy(user, optarg, sizeof(user)); user[sizeof(user)-1] = '\0'; /* Terminate string */ break; case 'w': default_duration = (int) (atof(optarg) * 1e6 / TIME_UNIT); if (default_duration * TIME_UNIT < 2e6) { report(RPT_ERR, "Waittime should be at least 2 (seconds), not %.8s", optarg); e = -1; } break; case 's': b = interpret_boolean_arg(optarg); if (b == -1) { report(RPT_ERR, "Not a boolean value: '%s'", optarg); e = -1; } else { report_dest = (b) ? RPT_DEST_SYSLOG : RPT_DEST_STDERR; } break; case 'r': report_level = atoi(optarg); break; case 'i': b = interpret_boolean_arg(optarg); if (b == -1) { report(RPT_ERR, "Not a boolean value: '%s'", optarg); e = -1; } else { rotate_server_screen = b; } break; case '?': /* For some reason getopt also returns an '?' * when an option argument is mission... */ report(RPT_ERR, "Unknown option: '%c'", optopt); e = -1; break; case ':': report(RPT_ERR, "Missing option argument!"); e = -1; break; } } if (optind < argc) { report(RPT_ERR, "Non-option arguments on the command line !"); e = -1; } if (help) { output_help_screen(); e = -1; } return e; } /* reads and parses configuration file */ static int process_configfile(char *configfile) { debug(RPT_DEBUG, "%s()", __FUNCTION__); /* Read server settings*/ if (config_read_file(configfile) != 0) { report(RPT_CRIT, "Could not read config file: %s", configfile); return -1; } if (bind_port == UNSET_INT) bind_port = config_get_int("Server", "Port", 0, UNSET_INT); if (strcmp(bind_addr, UNSET_STR) == 0) strncpy(bind_addr, config_get_string("Server", "Bind", 0, UNSET_STR), sizeof(bind_addr)); if (strcmp(user, UNSET_STR) == 0) strncpy(user, config_get_string("Server", "User", 0, UNSET_STR), sizeof(user)); if (default_duration == UNSET_INT) { default_duration = (config_get_float("Server", "WaitTime", 0, 0) * 1e6 / TIME_UNIT); if (default_duration == 0) default_duration = UNSET_INT; else if (default_duration * TIME_UNIT < 2e6) { report(RPT_WARNING, "Waittime should be at least 2 (seconds). Set to 2 seconds."); default_duration = 2e6 / TIME_UNIT; } } if (foreground_mode == UNSET_INT) { int fg = config_get_bool("Server", "Foreground", 0, UNSET_INT); if (fg != UNSET_INT) foreground_mode = fg; } if (rotate_server_screen == UNSET_INT) { rotate_server_screen = config_get_tristate("Server", "ServerScreen", 0, "blank", UNSET_INT); } if (backlight == UNSET_INT) { backlight = config_get_tristate("Server", "Backlight", 0, "open", UNSET_INT); } if (heartbeat == UNSET_INT) { heartbeat = config_get_tristate("Server", "Heartbeat", 0, "open", UNSET_INT); } if (autorotate == UNSET_INT) { autorotate = config_get_bool("Server", "AutoRotate", 0, DEFAULT_AUTOROTATE); } if (titlespeed == UNSET_INT) { int speed = config_get_int("Server", "TitleSpeed", 0, DEFAULT_TITLESPEED); /* set titlespeed */ titlespeed = (speed <= TITLESPEED_NO) ? TITLESPEED_NO : min(speed, TITLESPEED_MAX); } if (report_dest == UNSET_INT) { int rs = config_get_bool("Server", "ReportToSyslog", 0, UNSET_INT); if (rs != UNSET_INT) report_dest = (rs) ? RPT_DEST_SYSLOG : RPT_DEST_STDERR; } if (report_level == UNSET_INT) { report_level = config_get_int("Server", "ReportLevel", 0, UNSET_INT); } /* Read drivers */ /* If drivers have been specified on the command line, then do not * use the driver list from the config file. */ if (num_drivers == 0) { /* loop over all the Driver= directives to read the driver names */ while (1) { const char *s = config_get_string("Server", "Driver", num_drivers, NULL); if (s == NULL) break; if (s[0] != '\0') { drivernames[num_drivers] = strdup(s); if (drivernames[num_drivers] == NULL) { report(RPT_ERR, "alloc error storing driver name: %s", s); exit(EXIT_FAILURE); } num_drivers++; } } } return 0; } static void set_default_settings(void) { debug(RPT_DEBUG, "%s()", __FUNCTION__); /* Set defaults into unfilled variables... */ if (bind_port == UNSET_INT) bind_port = DEFAULT_BIND_PORT; if (strcmp(bind_addr, UNSET_STR) == 0) strncpy(bind_addr, DEFAULT_BIND_ADDR, sizeof(bind_addr)); if (strcmp(user, UNSET_STR) == 0) strncpy(user, DEFAULT_USER, sizeof(user)); if (foreground_mode == UNSET_INT) foreground_mode = DEFAULT_FOREGROUND_MODE; if (rotate_server_screen == UNSET_INT) rotate_server_screen = DEFAULT_ROTATE_SERVER_SCREEN; if (default_duration == UNSET_INT) default_duration = DEFAULT_SCREEN_DURATION; if (backlight == UNSET_INT) backlight = DEFAULT_BACKLIGHT; if (heartbeat == UNSET_INT) heartbeat = DEFAULT_HEARTBEAT; if (titlespeed == UNSET_INT) titlespeed = DEFAULT_TITLESPEED; if (report_dest == UNSET_INT) report_dest = DEFAULT_REPORTDEST; if (report_level == UNSET_INT) report_level = DEFAULT_REPORTLEVEL; /* Use default driver */ if (num_drivers == 0) { drivernames[0] = strdup(DEFAULT_DRIVER); if (drivernames[0] == NULL) { report(RPT_ERR, "alloc error storing driver name: %s", DEFAULT_DRIVER); exit(EXIT_FAILURE); } num_drivers = 1; } } static void install_signal_handlers(int allow_reload) { /* Installs signal handlers so that the program does clean exit and * can also receive a reload signal. * sigaction() is favoured over signal() */ struct sigaction sa; debug(RPT_DEBUG, "%s(allow_reload=%d)", __FUNCTION__, allow_reload); sigemptyset(&(sa.sa_mask)); /* Clients can cause SIGPIPE if they quit unexpectedly, and the * default action is to kill the server. Just ignore it. */ sa.sa_handler = SIG_IGN; sigaction(SIGPIPE, &sa, NULL); sa.sa_handler = exit_program; #ifdef HAVE_SA_RESTART sa.sa_flags = SA_RESTART; #endif sigaction(SIGINT, &sa, NULL); /* Ctrl-C will cause a clean exit...*/ sigaction(SIGTERM, &sa, NULL); /* and "kill"...*/ if (allow_reload) { sa.sa_handler = catch_reload_signal; /* On SIGHUP reread config and restart the drivers ! */ } else { /* Treat this signal just like INT and TERM */ } sigaction(SIGHUP, &sa, NULL); } static void child_ok_func(int signal) { /* We only catch this signal to be sure the child runs OK. */ debug(RPT_INFO, "%s(signal=%d)", __FUNCTION__, signal); /* Exit now ! because of bug? in wait() */ _exit(EXIT_SUCCESS); /* Parent exits normally. */ } static pid_t daemonize(void) { pid_t child; pid_t parent; int child_status; struct sigaction sa; debug(RPT_DEBUG, "%s()", __FUNCTION__); parent = getpid(); debug(RPT_INFO, "parent = %d", parent); /* Install handler at parent for child's signal */ /* sigaction should be more portable than signal, but it does not * work for some reason. */ sa.sa_handler = child_ok_func; sigemptyset(&(sa.sa_mask)); sa.sa_flags = SA_RESTART; sigaction(SIGUSR1, &sa, NULL); /* Do the fork */ switch ((child = fork())) { case -1: report(RPT_ERR, "Could not fork"); return -1; case 0: /* We are the child */ break; default: /* We are the parent */ debug(RPT_INFO, "child = %d", child); wait(&child_status); /* BUG? According to the man page wait() should also return * when a signal comes in that is caught. Instead it * continues to wait. */ if (WIFEXITED(child_status)) { /* Child exited normally, probably because of some * error. */ debug(RPT_INFO, "Child has terminated!"); exit(WEXITSTATUS(child_status)); /* Parent exits with same status as child did... */ } /* Child is still running and has signalled it's OK. * This means the parent can now rest in peace. */ debug(RPT_INFO, "Got OK signal from child."); exit(EXIT_SUCCESS); /* Parent exits normally. */ } /* At this point we are always the child. */ /* Reset signal handler */ sa.sa_handler = SIG_DFL; sigaction(SIGUSR1, &sa, NULL); setsid(); /* Create a new session because otherwise we'll * catch a SIGHUP when the shell is closed. */ return parent; } static int wave_to_parent(pid_t parent_pid) { debug(RPT_DEBUG, "%s(parent_pid=%d)", __FUNCTION__, parent_pid); kill(parent_pid, SIGUSR1); return 0; } static int init_drivers(void) { int i, res; int output_loaded = 0; debug(RPT_DEBUG, "%s()", __FUNCTION__); for (i = 0; i < num_drivers; i++) { res = drivers_load_driver(drivernames[i]); if (res >= 0) { /* Load went OK */ switch(res) { case 0: /* Driver does input only */ break; case 1: /* Driver does output */ output_loaded = 1; break; case 2: /* Driver does output in foreground (don't daemonize) */ foreground_mode = 1; output_loaded = 1; break; } } else { report(RPT_ERR, "Could not load driver %.40s", drivernames[i]); } } /* Do we have a running output driver ?*/ if (output_loaded) { return 0; } else { report(RPT_ERR, "There is no output driver"); return -1; } } static int drop_privs(char *user) { struct passwd *pwent; debug(RPT_DEBUG, "%s(user=\"%.40s\")", __FUNCTION__, user); if (getuid() == 0 || geteuid() == 0) { if ((pwent = getpwnam(user)) == NULL) { report(RPT_ERR, "User %.40s not a valid user!", user); return -1; } else { if (setuid(pwent->pw_uid) < 0) { report(RPT_ERR, "Unable to switch to user %.40s", user); return -1; } } } return 0; } static void do_reload(void) { int e = 0; drivers_unload_all(); /* Close all drivers */ config_clear(); clear_settings(); /* Reread command line*/ CHAIN(e, process_command_line(stored_argc, stored_argv)); /* Reread config file */ if (strcmp(configfile, UNSET_STR)==0) strncpy(configfile, DEFAULT_CONFIGFILE, sizeof(configfile)); CHAIN(e, process_configfile(configfile)); /* Set default values */ CHAIN(e, (set_default_settings(), 0)); /* Set reporting values */ CHAIN(e, set_reporting("LCDd", report_level, report_dest)); CHAIN(e, (report(RPT_INFO, "Set report level to %d, output to %s", report_level, ((report_dest == RPT_DEST_SYSLOG) ? "syslog" : "stderr")), 0)); /* And restart the drivers */ CHAIN(e, init_drivers()); CHAIN_END(e, "Critical error while reloading, abort."); } static void do_mainloop(void) { Screen *s; struct timeval t; struct timeval last_t; int sleeptime; long int process_lag = 0; long int render_lag = 0; long int t_diff; debug(RPT_DEBUG, "%s()", __FUNCTION__); gettimeofday(&t, NULL); /* Get initial time */ while (1) { /* Get current time */ last_t = t; gettimeofday(&t, NULL); t_diff = t.tv_sec - last_t.tv_sec; if ( ((t_diff + 1) > (LONG_MAX / 1e6)) || (t_diff < 0) ) { /* We're going to overflow the calculation - probably been to sleep, fudge the values */ t_diff = 0; process_lag = 1; render_lag = (1e6/RENDER_FREQ); } else { t_diff *= 1e6; t_diff += t.tv_usec - last_t.tv_usec; } process_lag += t_diff; if (process_lag > 0) { /* Time for a processing stroke */ sock_poll_clients(); /* poll clients for input*/ parse_all_client_messages(); /* analyze input from network clients*/ handle_input(); /* handle key input from devices*/ /* We've done the job... */ process_lag = 0 - (1e6/PROCESS_FREQ); /* Note : this does not make a fixed frequency */ } render_lag += t_diff; if (render_lag > 0) { /* Time for a rendering stroke */ timer ++; screenlist_process(); s = screenlist_current(); /* TODO: Move this call to every client connection * and every screen add... */ if (s == server_screen) { update_server_screen(); } render_screen(s, timer); /* We've done the job... */ if (render_lag > (1e6/RENDER_FREQ) * MAX_RENDER_LAG_FRAMES) { /* Cause rendering slowdown because too much lag */ render_lag = (1e6/RENDER_FREQ) * MAX_RENDER_LAG_FRAMES; } render_lag -= (1e6/RENDER_FREQ); /* Note: this DOES make a fixed frequency (except with slowdown) */ } /* Sleep just as long as needed */ sleeptime = min(0-process_lag, 0-render_lag); if (sleeptime > 0) { usleep(sleeptime); } /* Check if a SIGHUP has been caught */ if (got_reload_signal) { got_reload_signal = 0; do_reload(); } } /* Quit! */ exit_program(0); } static void exit_program(int val) { char buf[64]; debug(RPT_DEBUG, "%s(val=%d)", __FUNCTION__, val); /* TODO: These things shouldn't be so interdependent. The order * things are shut down in shouldn't matter... */ if (val > 0) { strncpy(buf, "Server shutting down on ", sizeof(buf)); switch(val) { case 1: strcat(buf, "SIGHUP"); break; case 2: strcat(buf, "SIGINT"); break; case 15: strcat(buf, "SIGTERM"); break; default: snprintf(buf, sizeof(buf), "Server shutting down on signal %d", val); break; /* Other values should not be seen, but just in case.. */ } report(RPT_NOTICE, buf); /* report it */ } /* Set emergency reporting and flush all messages if not done already. */ if (report_level == UNSET_INT) report_level = DEFAULT_REPORTLEVEL; if (report_dest == UNSET_INT) report_dest = DEFAULT_REPORTDEST; set_reporting("LCDd", report_level, report_dest); goodbye_screen(); /* display goodbye screen on LCD display */ drivers_unload_all(); /* release driver memory and file descriptors */ /* Shutdown things if server start was complete */ clients_shutdown(); /* shutdown clients (must come first) */ menuscreens_shutdown(); screenlist_shutdown(); /* shutdown screens (must come after client_shutdown) */ input_shutdown(); /* shutdown key input part */ sock_shutdown(); /* shutdown the sockets server */ report(RPT_INFO, "Exiting."); _exit(EXIT_SUCCESS); } static void catch_reload_signal(int val) { debug(RPT_DEBUG, "%s(val=%d)", __FUNCTION__, val); got_reload_signal = 1; } static int interpret_boolean_arg(char *s) { /* keep these checks consistent with config_get_boolean() */ if (strcasecmp(s, "0") == 0 || strcasecmp(s, "false") == 0 || strcasecmp(s, "n") == 0 || strcasecmp(s, "no") == 0 || strcasecmp(s, "off") == 0) { return 0; } if (strcasecmp(s, "1") == 0 || strcasecmp(s, "true") == 0 || strcasecmp(s, "y") == 0 || strcasecmp(s, "yes") == 0 || strcasecmp(s, "on") == 0) { return 1; } /* no legal boolean string given */ return -1; } static void output_GPL_notice(void) { /* This will only be invoked when running in foreground * So, directly output to stderr */ fprintf(stderr, "LCDd %s, LCDproc Protocol %s\n", VERSION, PROTOCOL_VERSION); fprintf(stderr, "Part of the LCDproc suite\n"); fprintf(stderr, "Copyright (C) 1998-2014 William Ferrell, Selene Scriven\n" " and many other contributors\n\n"); fprintf(stderr, "This program is free software; you can redistribute it and/or\n" "modify it under the terms of the GNU General Public License\n" "as published by the Free Software Foundation; either version 2\n" "of the License, or (at your option) any later version.\n\n"); fprintf(stderr, "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" "GNU General Public License for more details.\n\n"); fprintf(stderr, "You should have received a copy of the GNU General Public License\n" "along with this program; if not, write to the Free Software Foundation,\n" "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n\n"); } static void output_help_screen(void) { /* Help screen is printed to stdout on purpose. No reason to have * this in syslog... */ debug(RPT_DEBUG, "%s()", __FUNCTION__); fprintf(stdout, "LCDd - LCDproc Server Daemon, %s\n\n", version); fprintf(stdout, "Copyright (c) 1998-2014 Selene Scriven, William Ferrell, and misc. contributors.\n"); fprintf(stdout, "This program is released under the terms of the GNU General Public License.\n\n"); fprintf(stdout, "Usage: LCDd []\n"); fprintf(stdout, " where are:\n"); fprintf(stdout, " -h Display this help screen\n"); fprintf(stdout, " -c Use a configuration file other than %s\n", DEFAULT_CONFIGFILE); fprintf(stdout, " -d Add a driver to use (overrides drivers in config file) [%s]\n", DEFAULT_DRIVER); fprintf(stdout, " -f Run in the foreground\n"); fprintf(stdout, " -a Network (IP) address to bind to [%s]\n", DEFAULT_BIND_ADDR); fprintf(stdout, " -p Network port to listen for connections on [%i]\n", DEFAULT_BIND_PORT); fprintf(stdout, " -u User to run as [%s]\n", DEFAULT_USER); fprintf(stdout, " -w Time to pause at each screen (in seconds) [%d]\n", DEFAULT_SCREEN_DURATION/RENDER_FREQ); fprintf(stdout, " -s If set, reporting will be done using syslog\n"); fprintf(stdout, " -r Report level [%d]\n", DEFAULT_REPORTLEVEL); fprintf(stdout, " -i Whether to rotate the server info screen\n"); /* Error messages will be flushed to the configured output after this * help message. */ } lcdproc-0.5.7/server/main.h000644 001751 000000 00000003420 11621737634 016366 0ustar00mmdolzewheel000000 000000 /** \file server/main.h */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven * 2001, Joris Robijn */ #ifndef MAIN_H #define MAIN_H #ifdef HAVE_CONFIG_H # include "config.h" #endif /* contains a few things that other parts of the program might want to know about... */ extern char *version; extern char *protocol_version; extern char *build_date; /* You should be able to modify the following freqencies... */ #define RENDER_FREQ 8 /* We want 8 frames per second */ #define PROCESS_FREQ 32 /* And 32 times per second processing of messages and keypresses. */ #define MAX_RENDER_LAG_FRAMES 16 /* Allow the rendering strokes to lag behind this many frames. * More lag will not be corrected, but will cause slow-down. */ #define TIME_UNIT (1e6/RENDER_FREQ) /* Variable from stone age, still used a lot. */ extern long timer; /* 32 bits at 8Hz will overflow in 2 ^ 29 = 5e8 seconds = 17 years. * If you get an overflow, please mail us and we will fix this personally * for you ! */ /**** Configuration variables ****/ /* Only configuration items that are settable from the command line should * be mentioned here. See main.c. */ extern unsigned int bind_port; extern char bind_addr[]; /* Do not preinit these strings as they will occupy */ extern char configfile[]; /* a lot of space in the executable. */ extern char user[]; /* The values will be overwritten anyway... */ /* The drivers and their driver parameters */ extern char *drivernames[]; extern int num_drivers; /* End of configuration variables */ /* Defines for having 'unset' values*/ #define UNSET_INT -1 #define UNSET_STR "\01" #endif lcdproc-0.5.7/server/menuitem.c000644 001751 000000 00000130543 12313532720 017253 0ustar00mmdolzewheel000000 000000 /** \file server/menuitem.c * Handles a menuitem and all actions that can be performed on it. */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven * 2002, Joris Robijn * 2004, F5 Networks, Inc. - IP-address input * 2005, Peter Marschall - error checks, ... */ #include #include #include #include #include #include "shared/report.h" #include "shared/defines.h" #include "widget.h" #include "screen.h" #include "menuitem.h" #include "menu.h" #include "drivers.h" /* this is needed for verify_ipv4 and verify_ipv6. */ #include "sock.h" #define MAX_NUMERIC_LEN 40 extern Menu *main_menu; /* Access to the main menu */ char *error_strs[] = {"", "Out of range", "Too long", "Too short", "Invalid Address"}; char *menuitemtypenames[] = {"menu", "action", "checkbox", "ring", "slider", "numeric", "alpha", "ip"}; char *menueventtypenames[] = {"select", "update", "plus", "minus", "enter", "leave"}; void menuitem_destroy_action(MenuItem *item); void menuitem_destroy_checkbox(MenuItem *item); void menuitem_destroy_ring(MenuItem *item); void menuitem_destroy_slider(MenuItem *item); void menuitem_destroy_numeric(MenuItem *item); void menuitem_destroy_alpha(MenuItem *item); void menuitem_destroy_ip(MenuItem *item); void menuitem_reset_numeric(MenuItem *item); void menuitem_reset_alpha(MenuItem *item); void menuitem_reset_ip(MenuItem *item); void menuitem_rebuild_screen_slider(MenuItem *item, Screen *s); void menuitem_rebuild_screen_numeric(MenuItem *item, Screen *s); void menuitem_rebuild_screen_alpha(MenuItem *item, Screen *s); void menuitem_rebuild_screen_ip(MenuItem *item, Screen *s); void menuitem_update_screen_slider(MenuItem *item, Screen *s); void menuitem_update_screen_numeric(MenuItem *item, Screen *s); void menuitem_update_screen_alpha(MenuItem *item, Screen *s); void menuitem_update_screen_ip(MenuItem *item, Screen *s); MenuResult menuitem_process_input_slider(MenuItem *item, MenuToken token, const char *key, unsigned int keymask); MenuResult menuitem_process_input_numeric(MenuItem *item, MenuToken token, const char *key, unsigned int keymask); MenuResult menuitem_process_input_alpha(MenuItem *item, MenuToken token, const char *key, unsigned int keymask); MenuResult menuitem_process_input_ip(MenuItem *item, MenuToken token, const char *key, unsigned int keymask); /* information about string representation of IP addresses */ typedef struct { int maxlen; // max length of the string represenation; char sep; // separators between numeric strings int base; // numeric base int width; // width of each numeric string int limit; // upper limit of each numeric string int posValue[5]; // digit-value of the digits at the approp. position in the numeric string char format[5]; // printf-format string to print a numeric string int (*verify)(const char *); // verify function: returns 1 = OK, 0 = error char dummy[16]; // dummy value (if provided value is no IP address) } IpSstringProperties; const IpSstringProperties IPinfo[] = { // IPv4: 15 char long '.'-separated sequence of 3-digit decimal strings in range 000 - 255 { 15, '.', 10, 3, 255, { 100, 10, 1, 0, 0 }, "%03d", verify_ipv4, "0.0.0.0" }, // IPv6: 39 char long ':'-separated sequence of 4-digit hex strings in range 0000 - ffff { 39, ':', 16, 4, 65535, { 4096, 256, 16, 1, 0 }, "%04x", verify_ipv6, "0:0:0:0:0:0:0:0" } }; /******** MENU UTILITY FUNCTIONS ********/ /** returns default_result if predecessor_id is NULL or the respective value * otherwise. */ MenuResult menuitem_predecessor2menuresult(char *predecessor_id, MenuResult default_result) { if (predecessor_id == NULL) return default_result; if (strcmp("_quit_", predecessor_id) == 0) return MENURESULT_QUIT; else if (strcmp("_close_", predecessor_id) == 0) return MENURESULT_CLOSE; else if (strcmp("_none_", predecessor_id) == 0) return MENURESULT_NONE; else return MENURESULT_PREDECESSOR; } /** returns default_result if successor_id is NULL or the respective value * otherwise. */ MenuResult menuitem_successor2menuresult(char *successor_id, MenuResult default_result) { if (successor_id == NULL) return default_result; if (strcmp("_quit_", successor_id) == 0) return MENURESULT_QUIT; else if (strcmp("_close_", successor_id) == 0) return MENURESULT_CLOSE; else if (strcmp("_none_", successor_id) == 0) return MENURESULT_NONE; else return MENURESULT_SUCCESSOR; } /** Returns the MenuItem with the specified id if found or NULL. The search * for itemid is restricted to the client's menus if the preprocessor macro * LCDPROC_PERMISSIVE_MENU_GOTO is *not* set. */ MenuItem *menuitem_search(char *menu_id, Client *client) { # ifdef LCDPROC_PERMISSIVE_MENU_GOTO MenuItem *top = main_menu; # else MenuItem *top = client->menu; # endif /* LCDPROC_PERMISSIVE_MENU_GOTO */ return menu_find_item(top, menu_id, true); } /******** FUNCTION TABLES ********/ /*- * Tables with functions to call for all different item types. The order is: * "menu", "action", "checkbox", "ring", "slider", "numeric", "alpha", "ip". */ void (*destructor_table[NUM_ITEMTYPES]) (MenuItem *item) = { menu_destroy, NULL, NULL, menuitem_destroy_ring, menuitem_destroy_slider, menuitem_destroy_numeric, menuitem_destroy_alpha, menuitem_destroy_ip }; void (*reset_table[NUM_ITEMTYPES]) (MenuItem *item) = { menu_reset, NULL, NULL, NULL, NULL, menuitem_reset_numeric, menuitem_reset_alpha, menuitem_reset_ip }; void (*build_screen_table[NUM_ITEMTYPES]) (MenuItem *item, Screen *s) = { menu_build_screen, NULL, NULL, NULL, menuitem_rebuild_screen_slider, menuitem_rebuild_screen_numeric, menuitem_rebuild_screen_alpha, menuitem_rebuild_screen_ip }; void (*update_screen_table[NUM_ITEMTYPES]) (MenuItem *item, Screen *s) = { menu_update_screen, NULL, NULL, NULL, menuitem_update_screen_slider, menuitem_update_screen_numeric, menuitem_update_screen_alpha, menuitem_update_screen_ip }; MenuResult (*process_input_table[NUM_ITEMTYPES]) (MenuItem *item, MenuToken token, const char *key, unsigned int keymask) = { menu_process_input, NULL, NULL, NULL, menuitem_process_input_slider, menuitem_process_input_numeric, menuitem_process_input_alpha, menuitem_process_input_ip }; /******** METHODS ********/ MenuItem *menuitem_create(MenuItemType type, char *id, MenuEventFunc(*event_func), char *text, Client *client) { MenuItem *new_item; debug(RPT_DEBUG, "%s(type=%d, id=\"%s\", event_func=%p, text=\"%s\")", __FUNCTION__, type, id, event_func, text); if ((id == NULL) || (text == NULL)) { // report(RPT_ERR, "%s: illegal id or text", __FUNCTION__); return NULL; } /* Allocate space and fill struct */ new_item = malloc(sizeof(MenuItem)); if (!new_item) { report(RPT_ERR, "%s: Could not allocate memory", __FUNCTION__); return NULL; } new_item->type = type; new_item->id = strdup(id); if (!new_item->id) { report(RPT_ERR, "%s: Could not allocate memory", __FUNCTION__); free(new_item); return NULL; } new_item->successor_id = NULL; new_item->predecessor_id = NULL; new_item->parent = NULL; new_item->event_func = event_func; new_item->text = strdup(text); if (!new_item->text) { report(RPT_ERR, "%s: Could not allocate memory", __FUNCTION__); free(new_item->id); free(new_item); return NULL; } new_item->client = client; new_item->is_hidden = false; /* Clear the type specific data part */ memset(&(new_item->data), '\0', sizeof(new_item->data)); return new_item; } // fixme: the menu_result arg is obsoleted (use char* successor_id) MenuItem *menuitem_create_action(char *id, MenuEventFunc(*event_func), char *text, Client *client, MenuResult menu_result) { MenuItem *new_item; debug(RPT_DEBUG, "%s(id=[%s], event_func=%p, text=\"%s\", close_menu=%d)", __FUNCTION__, id, event_func, text, menu_result); new_item = menuitem_create(MENUITEM_ACTION, id, event_func, text, client); if (new_item != NULL) { switch (menu_result) { case MENURESULT_NONE: new_item->successor_id = strdup("_none_"); break; case MENURESULT_CLOSE: new_item->successor_id = strdup("_close_"); break; case MENURESULT_QUIT: new_item->successor_id = strdup("_quit_"); break; default: assert(!"unexpected MENURESULT"); } } return new_item; } MenuItem *menuitem_create_checkbox(char *id, MenuEventFunc(*event_func), char *text, Client *client, bool allow_gray, bool value) { MenuItem *new_item; debug(RPT_DEBUG, "%s(id=[%s], event_func=%p, text=\"%s\", allow_gray=%d, value=%d)", __FUNCTION__, id, event_func, text, allow_gray, value); new_item = menuitem_create(MENUITEM_CHECKBOX, id, event_func, text, client); if (new_item != NULL) { new_item->data.checkbox.allow_gray = allow_gray; new_item->data.checkbox.value = value; } return new_item; } MenuItem *menuitem_create_ring(char *id, MenuEventFunc(*event_func), char *text, Client *client, char *strings, short value) { MenuItem *new_item; debug(RPT_DEBUG, "%s(id=[%s], event_func=%p, text=\"%s\", strings=\"%s\", value=%d)", __FUNCTION__, id, event_func, text, strings, value); new_item = menuitem_create(MENUITEM_RING, id, event_func, text, client); if (new_item != NULL) { new_item->data.ring.strings = tablist2linkedlist(strings); new_item->data.ring.value = value; } return new_item; } MenuItem *menuitem_create_slider(char *id, MenuEventFunc(*event_func), char *text, Client *client, char *mintext, char *maxtext, int minvalue, int maxvalue, int stepsize, int value) { MenuItem *new_item; debug(RPT_DEBUG, "%s(id=[%s], event_func=%p, text=\"%s\", mintext=\"%s\", maxtext=\"%s\", minvalue=%d, maxvalue=%d, stepsize=%d, value=%d)", __FUNCTION__, id, event_func, text, mintext, maxtext, minvalue, maxvalue, stepsize, value); new_item = menuitem_create(MENUITEM_SLIDER, id, event_func, text, client); if (new_item != NULL) { new_item->data.slider.mintext = strdup(mintext); new_item->data.slider.maxtext = strdup(maxtext); if (new_item->data.slider.mintext == NULL || new_item->data.slider.maxtext == NULL) { menuitem_destroy(new_item); return NULL; } new_item->data.slider.minvalue = minvalue; new_item->data.slider.maxvalue = maxvalue; new_item->data.slider.stepsize = stepsize; new_item->data.slider.value = value; } return new_item; } MenuItem *menuitem_create_numeric(char *id, MenuEventFunc(*event_func), char *text, Client *client, int minvalue, int maxvalue, int value) { MenuItem *new_item; debug(RPT_DEBUG, "%s(id=[%s], event_func=%p, text=\"%s\", minvalue=%d, maxvalue=%d, value=%d)", __FUNCTION__, id, event_func, text, minvalue, minvalue, value); new_item = menuitem_create(MENUITEM_NUMERIC, id, event_func, text, client); if (new_item != NULL) { new_item->data.numeric.maxvalue = maxvalue; new_item->data.numeric.minvalue = minvalue; new_item->data.numeric.value = value; new_item->data.numeric.edit_str = malloc(MAX_NUMERIC_LEN); if (new_item->data.numeric.edit_str == NULL) { menuitem_destroy(new_item); return NULL; } } return new_item; } MenuItem *menuitem_create_alpha(char *id, MenuEventFunc(*event_func), char *text, Client *client, char password_char, short minlength, short maxlength, bool allow_caps, bool allow_noncaps, bool allow_numbers, char *allowed_extra, char *value) { MenuItem *new_item; debug(RPT_DEBUG, "%s(id=\"%s\", event_func=%p, text=\"%s\", password_char=%d, maxlength=%d, value=\"%s\")", __FUNCTION__, id, event_func, text, password_char, maxlength, value); new_item = menuitem_create(MENUITEM_ALPHA, id, event_func, text, client); if (new_item != NULL) { new_item->data.alpha.password_char = password_char; new_item->data.alpha.minlength = minlength; new_item->data.alpha.maxlength = maxlength; new_item->data.alpha.allow_caps = allow_caps; new_item->data.alpha.allow_noncaps = allow_noncaps; new_item->data.alpha.allow_numbers = allow_numbers; new_item->data.alpha.allowed_extra = strdup(allowed_extra); if (new_item->data.alpha.allowed_extra == NULL) { menuitem_destroy(new_item); return NULL; } new_item->data.alpha.value = malloc(maxlength + 1); if (new_item->data.alpha.value == NULL) { menuitem_destroy(new_item); return NULL; } strncpy(new_item->data.alpha.value, value, maxlength); new_item->data.alpha.value[maxlength] = 0; new_item->data.alpha.edit_str = malloc(maxlength + 1); if (new_item->data.alpha.edit_str == NULL) { menuitem_destroy(new_item); return NULL; } } return new_item; } MenuItem *menuitem_create_ip(char *id, MenuEventFunc(*event_func), char *text, Client *client, bool v6, char *value) { MenuItem *new_item; const IpSstringProperties *ipinfo; debug(RPT_DEBUG, "%s(id=\"%s\", event_func=%p, text=\"%s\", v6=%d, value=\"%s\")", __FUNCTION__, id, event_func, text, v6, value); new_item = menuitem_create(MENUITEM_IP, id, event_func, text, client); if (new_item == NULL) return NULL; new_item->data.ip.v6 = v6; ipinfo = (v6) ? &IPinfo[1] : &IPinfo[0]; new_item->data.ip.maxlength = ipinfo->maxlen;; new_item->data.ip.value = malloc(new_item->data.ip.maxlength + 1); if (new_item->data.ip.value == NULL) { menuitem_destroy(new_item); return NULL; } strncpy(new_item->data.ip.value, value, new_item->data.ip.maxlength); new_item->data.ip.value[new_item->data.ip.maxlength] = '\0'; if (ipinfo->verify != NULL) { char *start = new_item->data.ip.value; while (start != NULL) { char *skip = start; while ((*skip == ' ') || ((*skip == '0') && (skip[1] != ipinfo->sep) && (skip[1] != '\0'))) skip++; memccpy(start, skip, '\0', new_item->data.ip.maxlength + 1); skip = strchr(start, ipinfo->sep); start = (skip != NULL) ? (skip + 1) : NULL; } if (!ipinfo->verify(new_item->data.ip.value)) { report(RPT_WARNING, "%s(id=\"%s\") ip address not verified: \"%s\"", __FUNCTION__, id, value); strncpy(new_item->data.ip.value, ipinfo->dummy, new_item->data.ip.maxlength); new_item->data.ip.value[new_item->data.ip.maxlength] = '\0'; } } new_item->data.ip.edit_str = malloc(new_item->data.ip.maxlength + 1); if (new_item->data.ip.edit_str == NULL) { menuitem_destroy(new_item); return NULL; } return new_item; } void menuitem_destroy(MenuItem *item) { debug(RPT_DEBUG, "%s(item=[%s])", __FUNCTION__, ((item != NULL) ? item->id : "(null)")); if (item != NULL) { void (*destructor) (MenuItem *); /* First destroy type specific data */ destructor = destructor_table[item->type]; if (destructor) destructor(item); /* Following strings should always be allocated */ free(item->text); free(item->id); /* And finally...*/ free(item); } } void menuitem_destroy_ring(MenuItem *item) { debug(RPT_DEBUG, "%s(item=[%s])", __FUNCTION__, ((item != NULL) ? item->id : "(null)")); if (item != NULL) { char *s; /* deallocate the strings */ for (s = LL_GetFirst(item->data.ring.strings); s != NULL; s = LL_GetNext(item->data.ring.strings)) { free(s); } /* and the list */ LL_Destroy(item->data.ring.strings); } } void menuitem_destroy_slider(MenuItem *item) { debug(RPT_DEBUG, "%s(item=[%s])", __FUNCTION__, ((item != NULL) ? item->id : "(null)")); if (item != NULL) { /* These strings should always be allocated */ free(item->data.slider.mintext); free(item->data.slider.maxtext); } } void menuitem_destroy_numeric(MenuItem *item) { debug(RPT_DEBUG, "%s(item=[%s])", __FUNCTION__, ((item != NULL) ? item->id : "(null)")); if (item != NULL) { /* This string should always be allocated */ free(item->data.numeric.edit_str); } } void menuitem_destroy_alpha(MenuItem *item) { debug(RPT_DEBUG, "%s(item=[%s])", __FUNCTION__, ((item != NULL) ? item->id : "(null)")); if (item != NULL) { /* These strings should always be allocated */ free(item->data.alpha.allowed_extra); free(item->data.alpha.value); free(item->data.alpha.edit_str); } } void menuitem_destroy_ip(MenuItem *item) { debug(RPT_DEBUG, "%s(item=[%s])", __FUNCTION__, ((item != NULL) ? item->id : "(null)")); /* These strings should always be allocated */ free(item->data.ip.value); free(item->data.ip.edit_str); } /******** MENU ITEM RESET FUNCTIONS ********/ void menuitem_reset(MenuItem *item) { debug(RPT_DEBUG, "%s(item=[%s])", __FUNCTION__, ((item != NULL) ? item->id : "(null)")); if (item != NULL) { void (*func) (MenuItem *); /* First destroy type specific data */ func = reset_table[item->type]; if (func) func(item); } } void menuitem_reset_numeric(MenuItem *item) { debug(RPT_DEBUG, "%s(item=[%s])", __FUNCTION__, ((item != NULL) ? item->id : "(null)")); if (item != NULL) { item->data.numeric.edit_pos = 0; item->data.numeric.edit_offs = 0; memset(item->data.numeric.edit_str, '\0', MAX_NUMERIC_LEN); if (item->data.numeric.minvalue < 0) { snprintf(item->data.numeric.edit_str, MAX_NUMERIC_LEN, "%+d", item->data.numeric.value); } else { snprintf(item->data.numeric.edit_str, MAX_NUMERIC_LEN, "%d", item->data.numeric.value); } } } void menuitem_reset_alpha(MenuItem *item) { debug(RPT_DEBUG, "%s(item=[%s])", __FUNCTION__, ((item != NULL) ? item->id : "(null)")); if (item != NULL) { item->data.alpha.edit_pos = 0; item->data.alpha.edit_offs = 0; memset(item->data.alpha.edit_str, '\0', item->data.alpha.maxlength+1); strcpy(item->data.alpha.edit_str, item->data.alpha.value); } } void menuitem_reset_ip(MenuItem *item) { char *start = item->data.ip.value; const IpSstringProperties *ipinfo = (item->data.ip.v6) ? &IPinfo[1] : &IPinfo[0]; debug(RPT_DEBUG, "%s(item=[%s])", __FUNCTION__, ((item != NULL) ? item->id : "(null)")); item->data.ip.edit_pos = 0; item->data.ip.edit_offs = 0; memset(item->data.ip.edit_str, '\0', item->data.ip.maxlength+1); // normalize IP address string to e.g. 010.002.250.002 / 0001:0203:0405:0607:0809:0a0b:0c0d:0e0f while (start != NULL) { char *end; char tmpstr[5]; int num = (int) strtol(start, (char **) NULL, ipinfo->base); snprintf(tmpstr, 5, ipinfo->format, num); strcat(item->data.ip.edit_str, tmpstr); end = strchr(start, ipinfo->sep); start = (end != NULL) ? (end + 1) : NULL; if (start != NULL) { tmpstr[0] = ipinfo->sep; tmpstr[1] = '\0'; strcat(item->data.ip.edit_str, tmpstr); } } } /******** MENU SCREEN BUILD FUNCTIONS ********/ void menuitem_rebuild_screen(MenuItem *item, Screen *s) { Widget *w; void (*build_screen) (MenuItem *item, Screen *s); debug(RPT_DEBUG, "%s(item=[%s], screen=[%s])", __FUNCTION__, ((item != NULL) ? item->id : "(null)"), ((s != NULL) ? s->id : "(null)")); if (!display_props) { /* Nothing to build if no display size is known */ report(RPT_ERR, "%s: display size unknown", __FUNCTION__); return; } if (s != NULL) { /* First remove all widgets from the screen */ while ((w = screen_getfirst_widget(s)) != NULL) { /* We know these widgets don't have subwidgets, so we can * easily remove them */ screen_remove_widget(s, w); widget_destroy(w); } if (item != NULL) { /* Call type specific screen building function */ build_screen = build_screen_table [item->type]; if (build_screen) { build_screen(item, s); } else { report(RPT_ERR, "%s: given menuitem cannot be active", __FUNCTION__); return; } /* Also always call update_screen */ menuitem_update_screen(item, s); } } } void menuitem_rebuild_screen_slider(MenuItem *item, Screen *s) { Widget *w; debug(RPT_DEBUG, "%s(item=[%s], screen=[%s])", __FUNCTION__, ((item != NULL) ? item->id : "(null)"), ((s != NULL) ? s->id : "(null)")); if ((item == NULL) || (s == NULL)) return; if (display_props->height >= 2) { /* Only add a title if enough space... */ w = widget_create("text", WID_STRING, s); screen_add_widget(s, w); w->text = strdup(item->text); w->x = 1; w->y = 1; } w = widget_create("bar", WID_HBAR, s); screen_add_widget(s, w); w->width = display_props->width; if (display_props->height > 2) { /* This is option 1: we have enought space, so the bar and * min/max texts can be on separate lines. */ w->x = 2; w->y = display_props->height / 2 + 1; w->width = display_props->width - 2; } w = widget_create("min", WID_STRING, s); screen_add_widget(s, w); w->text = NULL; w->x = 1; if (display_props->height > 2) { w->y = display_props->height / 2 + 2; } else { w->y = display_props->height / 2 + 1; } w = widget_create("max", WID_STRING, s); screen_add_widget(s, w); w->text = NULL; w->x = 1; if (display_props->height > 2) { w->y = display_props->height / 2 + 2; } else { w->y = display_props->height / 2 + 1; } } void menuitem_rebuild_screen_numeric(MenuItem *item, Screen *s) { Widget *w; debug(RPT_DEBUG, "%s(item=[%s], screen=[%s])", __FUNCTION__, ((item != NULL) ? item->id : "(null)"), ((s != NULL) ? s->id : "(null)")); if ((item == NULL) || (s == NULL)) return; if (display_props->height >= 2) { /* Only add a title if enough space... */ w = widget_create("text", WID_STRING, s); screen_add_widget(s, w); w->text = strdup(item->text); w->x = 1; w->y = 1; } w = widget_create("value", WID_STRING, s); screen_add_widget(s, w); w->text = malloc(MAX_NUMERIC_LEN); w->x = 2; w->y = display_props->height / 2 + 1; /* Only display error string if enough space... */ if (display_props->height > 2) { w = widget_create("error", WID_STRING, s); screen_add_widget(s, w); w->text = strdup(""); w->x = 1; w->y = display_props->height; } } void menuitem_rebuild_screen_alpha(MenuItem *item, Screen *s) { Widget *w; debug(RPT_DEBUG, "%s(item=[%s], screen=[%s])", __FUNCTION__, ((item != NULL) ? item->id : "(null)"), ((s != NULL) ? s->id : "(null)")); if ((item == NULL) || (s == NULL)) return; if (display_props->height >= 2) { /* Only add a title if enough space... */ w = widget_create("text", WID_STRING, s); screen_add_widget(s, w); w->text = strdup(item->text); w->x = 1; w->y = 1; } w = widget_create("value", WID_STRING, s); screen_add_widget(s, w); w->text = malloc(item->data.alpha.maxlength+1); w->x = 2; w->y = display_props->height / 2 + 1; /* Only display error string if enough space... */ if (display_props->height > 2) { w = widget_create("error", WID_STRING, s); screen_add_widget(s, w); w->text = strdup(""); w->x = 1; w->y = display_props->height; } } void menuitem_rebuild_screen_ip(MenuItem *item, Screen *s) { Widget *w; debug(RPT_DEBUG, "%s(item=[%s], screen=[%s])", __FUNCTION__, ((item != NULL) ? item->id : "(null)"), ((s != NULL) ? s->id : "(null)")); if ((item == NULL) || (s == NULL)) return; if (display_props->height >= 2) { /* Only add a title if enough space... */ w = widget_create("text", WID_STRING, s); screen_add_widget(s, w); w->text = strdup(item->text); w->x = 1; w->y = 1; } w = widget_create("value", WID_STRING, s); screen_add_widget(s, w); w->text = malloc(item->data.ip.maxlength+1); w->x = 2; w->y = display_props->height / 2 + 1; /* Only display error string if enough space... */ if (display_props->height > 2) { w = widget_create("error", WID_STRING, s); screen_add_widget(s, w); w->text = strdup(""); w->x = 1; w->y = display_props->height; } } /******** MENU SCREEN UPDATE FUNCTIONS ********/ void menuitem_update_screen(MenuItem *item, Screen *s) { void (*update_screen) (MenuItem *item, Screen *s); debug(RPT_DEBUG, "%s(item=[%s], screen=[%s])", __FUNCTION__, ((item != NULL) ? item->id : "(null)"), ((s != NULL) ? s->id : "(null)")); if ((item == NULL) || (s == NULL)) return; /* Disable the cursor by default */ s->cursor = CURSOR_OFF; /* Call type specific screen building function */ update_screen = update_screen_table [item->type]; if (update_screen) { update_screen(item, s); } else { report(RPT_ERR, "%s: given menuitem cannot be active", __FUNCTION__); return; } } void menuitem_update_screen_slider(MenuItem *item, Screen *s) { Widget *w; int min_len, max_len; debug(RPT_DEBUG, "%s(item=[%s], screen=[%s])", __FUNCTION__, ((item != NULL) ? item->id : "(null)"), ((s != NULL) ? s->id : "(null)")); if ((item == NULL) || (s == NULL)) return; /* Calculate the bar position and length by filling buffers */ min_len = strlen(item->data.slider.mintext); max_len = strlen(item->data.slider.maxtext); /* And adjust the data */ w = screen_find_widget(s, "bar"); if (display_props->height <= 2) { /* This is option 2: we're tight on lines, so we put the bar * and min/max texts on the same line. */ w->x = 1 + min_len; w->y = display_props->height; w->width = display_props->width - min_len - max_len; } /* FUTURE: w->promille = 1000 * (item->data.slider.value - item->data.slider.minvalue) / (item->data.slider.maxvalue - item->data.slider.minvalue) */; w->length = w->width * display_props->cellwidth * (item->data.slider.value - item->data.slider.minvalue) / (item->data.slider.maxvalue - item->data.slider.minvalue); w = screen_find_widget(s, "min"); if (w->text) free(w->text); w->text = strdup(item->data.slider.mintext); w = screen_find_widget(s, "max"); if (w->text) free(w->text); w->x = 1 + display_props->width - max_len; w->text = strdup(item->data.slider.maxtext); } void menuitem_update_screen_numeric(MenuItem *item, Screen *s) { Widget *w; debug(RPT_DEBUG, "%s(item=[%s], screen=[%s])", __FUNCTION__, ((item != NULL) ? item->id : "(null)"), ((s != NULL) ? s->id : "(null)")); if ((item == NULL) || (s == NULL)) return; w = screen_find_widget(s, "value"); strcpy(w->text, item->data.numeric.edit_str + item->data.numeric.edit_offs); s->cursor = CURSOR_DEFAULT_ON; s->cursor_x = w->x + item->data.numeric.edit_pos - item->data.numeric.edit_offs; s->cursor_y = w->y; /* Only display error string if enough space... */ if (display_props->height > 2) { w = screen_find_widget(s, "error"); free(w->text); w->text = strdup(error_strs[item->data.numeric.error_code]); } } void menuitem_update_screen_alpha(MenuItem *item, Screen *s) { Widget *w; debug(RPT_DEBUG, "%s(item=[%s], screen=[%s])", __FUNCTION__, ((item != NULL) ? item->id : "(null)"), ((s != NULL) ? s->id : "(null)")); if ((item == NULL) || (s == NULL)) return; w = screen_find_widget(s, "value"); if (item->data.alpha.password_char == '\0') { strcpy(w->text, item->data.alpha.edit_str + item->data.alpha.edit_offs); } else { int len = strlen(item->data.alpha.edit_str) - item->data.alpha.edit_offs; memset(w->text, item->data.alpha.password_char, len); w->text[len] = '\0'; } s->cursor = CURSOR_DEFAULT_ON; s->cursor_x = w->x + item->data.alpha.edit_pos - item->data.alpha.edit_offs; s->cursor_y = w->y; /* Only display error string if enough space... */ if (display_props->height > 2) { w = screen_find_widget(s, "error"); free(w->text); w->text = strdup(error_strs[item->data.alpha.error_code]); } } void menuitem_update_screen_ip(MenuItem *item, Screen *s) { Widget *w; debug(RPT_DEBUG, "%s(item=[%s], screen=[%s])", __FUNCTION__, ((item != NULL) ? item->id : "(null)"), ((s != NULL) ? s->id : "(null)")); if ((item == NULL) || (s == NULL)) return; w = screen_find_widget(s, "value"); if (w != NULL) strcpy(w->text, item->data.ip.edit_str + item->data.ip.edit_offs); s->cursor = CURSOR_DEFAULT_ON; s->cursor_x = w->x + item->data.ip.edit_pos - item->data.ip.edit_offs; s->cursor_y = w->y; /* Only display error string if enough space... */ if (display_props->height > 2) { w = screen_find_widget(s, "error"); free(w->text); w->text = strdup(error_strs[item->data.ip.error_code]); } } /******** MENU SCREEN INPUT HANDLING FUNCTIONS ********/ MenuResult menuitem_process_input(MenuItem *item, MenuToken token, const char *key, unsigned int keymask) { MenuResult (*process_input) (MenuItem *item, MenuToken token, const char *key, unsigned int keymask); debug(RPT_DEBUG, "%s(item=[%s], token=%d, key=\"%s\")", __FUNCTION__, ((item != NULL) ? item->id : "(null)"), token, key); if (item == NULL) return MENURESULT_ERROR; /* Call type specific screen building function */ process_input = process_input_table [item->type]; if (process_input) { return process_input(item, token, key, keymask); } else { report(RPT_ERR, "%s: given menuitem cannot be active", __FUNCTION__); return MENURESULT_ERROR; } } MenuResult menuitem_process_input_slider(MenuItem *item, MenuToken token, const char *key, unsigned int keymask) { debug(RPT_DEBUG, "%s(item=[%s], token=%d, key=\"%s\")", __FUNCTION__, ((item != NULL) ? item->id : "(null)"), token, key); if (item == NULL) return MENURESULT_ERROR; switch (token) { case MENUTOKEN_MENU: return menuitem_predecessor2menuresult( item->predecessor_id, MENURESULT_CLOSE); case MENUTOKEN_ENTER: return menuitem_successor2menuresult( item->successor_id, MENURESULT_CLOSE); case MENUTOKEN_UP: case MENUTOKEN_RIGHT: /* Wrap slider around if max value is reached. * Note: The max value is actually reached, * because of min(maxvalue, value + stepsize) below. * Wrapping then happens on the next key press. */ if ((!(keymask & (MENUTOKEN_LEFT | MENUTOKEN_DOWN))) && (item->data.slider.value == item->data.slider.maxvalue)) item->data.slider.value = item->data.slider.minvalue; else item->data.slider.value = min(item->data.slider.maxvalue, item->data.slider.value + item->data.slider.stepsize); if (item->event_func) item->event_func(item, MENUEVENT_PLUS); return MENURESULT_NONE; case MENUTOKEN_DOWN: case MENUTOKEN_LEFT: if ((!(keymask & (MENUTOKEN_RIGHT | MENUTOKEN_UP))) && (item->data.slider.value == item->data.slider.minvalue)) item->data.slider.value = item->data.slider.maxvalue; else item->data.slider.value = max(item->data.slider.minvalue, item->data.slider.value - item->data.slider.stepsize); if (item->event_func) item->event_func(item, MENUEVENT_MINUS); return MENURESULT_NONE; case MENUTOKEN_OTHER: default: break; } return MENURESULT_ERROR; } MenuResult menuitem_process_input_numeric(MenuItem *item, MenuToken token, const char *key, unsigned int keymask) { char buf1[MAX_NUMERIC_LEN]; char buf2[MAX_NUMERIC_LEN]; int max_len; debug(RPT_DEBUG, "%s(item=[%s], token=%d, key=\"%s\")", __FUNCTION__, ((item != NULL) ? item->id : "(null)"), token, key); if (item != NULL) { /* To make life easy... */ char *str = item->data.numeric.edit_str; int pos = item->data.numeric.edit_pos; int allow_signed = (item->data.numeric.minvalue < 0); char *format_str = (allow_signed) ? "%+d" : "%d"; snprintf(buf1, MAX_NUMERIC_LEN, format_str, item->data.numeric.minvalue); snprintf(buf2, MAX_NUMERIC_LEN, format_str, item->data.numeric.maxvalue); max_len = max(strlen(buf1), strlen(buf2)); /* Clear the error */ item->data.numeric.error_code = 0; switch (token) { case MENUTOKEN_MENU: if (pos == 0) { return menuitem_predecessor2menuresult( item->predecessor_id, MENURESULT_CLOSE); } else { /* Reset data */ menuitem_reset_numeric(item); } return MENURESULT_NONE; case MENUTOKEN_ENTER: if ((keymask & MENUTOKEN_RIGHT) || (str[pos] == '\0')) { int value; /* The user completed his input */ /* ...scan it */ if (sscanf(str, "%d", &value) != 1) { return MENURESULT_ERROR; } /* Test the value */ if ((value < item->data.numeric.minvalue) || (value > item->data.numeric.maxvalue)) { /* Out of range ! * We can't exit this screen now */ item->data.numeric.error_code = 1; item->data.numeric.edit_pos = 0; item->data.numeric.edit_offs = 0; return MENURESULT_NONE; } /* OK, store value */ item->data.numeric.value = value; /* Inform client */ if (item->event_func) item->event_func(item, MENUEVENT_UPDATE); return menuitem_successor2menuresult( item->successor_id, MENURESULT_CLOSE); } else { /* The user wants to go to next digit */ if (pos < max_len) { item->data.numeric.edit_pos++; if (pos >= display_props->width - 2) item->data.numeric.edit_offs++; } } return MENURESULT_NONE; case MENUTOKEN_UP: if (pos >= max_len) { /* We're not allowed to add anything anymore */ item->data.numeric.error_code = 2; item->data.numeric.edit_pos = 0; item->data.numeric.edit_offs = 0; return MENURESULT_NONE; } if (allow_signed && pos == 0) { /* make negative */ str[0] = (str[0] == '-') ? '+' : '-'; } else { if (str[pos] >= '0' && str[pos] < '9') { str[pos] ++; } else if (str[pos] == '9') { str[pos] = '\0'; } else if (str[pos] == '\0') { str[pos] = '0'; } } return MENURESULT_NONE; case MENUTOKEN_DOWN: if (pos >= max_len) { /* We're not allowed to add anything anymore */ item->data.numeric.error_code = 2; item->data.numeric.edit_pos = 0; item->data.numeric.edit_offs = 0; return MENURESULT_NONE; } if (allow_signed && pos == 0) { /* make negative */ str[0] = (str[0] == '-') ? '+' : '-'; } else { if (str[pos] > '0' && str[pos] <= '9') { str[pos] --; } else if (str[pos] == '0') { str[pos] = '\0'; } else if (str[pos] == '\0') { str[pos] = '9'; } } return MENURESULT_NONE; case MENUTOKEN_RIGHT: /* The user wants to go to next digit */ if (str[pos] != '\0' && pos < max_len) { item->data.numeric.edit_pos++; if (pos >= display_props->width - 2) item->data.numeric.edit_offs++; } return MENURESULT_NONE; case MENUTOKEN_LEFT: /* The user wants to go to back a digit */ if (pos > 0) { item->data.numeric.edit_pos--; if (item->data.numeric.edit_offs > item->data.numeric.edit_pos) item->data.numeric.edit_offs = item->data.numeric.edit_pos; } return MENURESULT_NONE; case MENUTOKEN_OTHER: if (pos >= max_len) { /* We're not allowed to add anything anymore */ item->data.numeric.error_code = 2; item->data.numeric.edit_pos = 0; item->data.numeric.edit_offs = 0; return MENURESULT_NONE; } /* process numeric keys */ if ((strlen(key) == 1) && isdigit(key[0])) { str[pos] = key[0]; item->data.numeric.edit_pos++; if (pos >= display_props->width - 2) item->data.numeric.edit_offs++; } default: return MENURESULT_NONE; } } return MENURESULT_ERROR; } MenuResult menuitem_process_input_alpha(MenuItem *item, MenuToken token, const char *key, unsigned int keymask) { char *p; static char *chars = NULL; debug(RPT_DEBUG, "%s(item=[%s], token=%d, key=\"%s\")", __FUNCTION__, ((item != NULL) ? item->id : "(null)"), token, key); if (item != NULL) { /* To make life easy... */ char *str = item->data.alpha.edit_str; int pos = item->data.alpha.edit_pos; /* Create list of allowed chars */ chars = realloc(chars, 26 + 26 + 10 + strlen(item->data.alpha.allowed_extra) + 1); chars[0] = '\0'; /* clear string */ if (item->data.alpha.allow_caps) strcat(chars, "ABCDEFGHIJKLMNOPQRSTUVWXYZ"); if (item->data.alpha.allow_noncaps) strcat(chars, "abcdefghijklmnopqrstuvwxyz"); if (item->data.alpha.allow_numbers) strcat(chars, "0123456789"); strcat(chars, item->data.alpha.allowed_extra); /* Clear the error */ item->data.alpha.error_code = 0; switch (token) { case MENUTOKEN_MENU: if (pos == 0) { return menuitem_predecessor2menuresult( item->predecessor_id, MENURESULT_CLOSE); } else { /* Reset data */ menuitem_reset_alpha(item); } return MENURESULT_NONE; case MENUTOKEN_ENTER: if ((keymask & MENUTOKEN_RIGHT) || (str[item->data.alpha.edit_pos] == '\0')) { /* The user completed his input */ /* It's not too short ? */ if (strlen(item->data.alpha.edit_str) < item->data.alpha.minlength) { item->data.alpha.error_code = 3; return MENURESULT_NONE; } /* Store value */ strcpy(item->data.alpha.value, item->data.alpha.edit_str); /* Inform client */ if (item->event_func) item->event_func(item, MENUEVENT_UPDATE); return menuitem_successor2menuresult( item->successor_id, MENURESULT_CLOSE); } else { /* The user wants to go to next digit */ if (pos < item->data.alpha.maxlength) { item->data.alpha.edit_pos++; if (pos >= display_props->width - 2) item->data.alpha.edit_offs++; } } return MENURESULT_NONE; case MENUTOKEN_UP: if (pos >= item->data.alpha.maxlength) { /* We're not allowed to add anything anymore */ item->data.alpha.error_code = 2; item->data.alpha.edit_pos = 0; item->data.alpha.edit_offs = 0; return MENURESULT_NONE; } if (str[pos] == '\0') { /* User goes past EOL */ str[pos] = chars[0]; } else { /* We should have a symbol from our list */ p = strchr(chars, str[pos]); if (p != NULL) { str[pos] = *(++p); /* next symbol on list */ /* Might be '\0' now */ } else { str[pos] = '\0'; } } return MENURESULT_NONE; case MENUTOKEN_DOWN: if (pos >= item->data.alpha.maxlength) { /* We're not allowed to add anything anymore */ item->data.alpha.error_code = 2; item->data.alpha.edit_pos = 0; item->data.alpha.edit_offs = 0; return MENURESULT_NONE; } if (str[pos] == '\0') { /* User goes past EOL */ str[pos] = chars[strlen(chars)-1]; } else { /* We should have a symbol from our list */ p = strchr(chars, str[pos]); if ((p != NULL) && (p != chars)) { str[pos] = *(--p); /* previous symbol on list */ } else { str[pos] = '\0'; } } return MENURESULT_NONE; case MENUTOKEN_RIGHT: /* The user wants to go to next digit */ if (str[item->data.alpha.edit_pos] != '\0' && pos < item->data.alpha.maxlength - 1) { item->data.alpha.edit_pos++; if (pos >= display_props->width - 2) item->data.alpha.edit_offs++; } return MENURESULT_NONE; case MENUTOKEN_LEFT: /* The user wants to go to back a digit */ if (pos > 0) { item->data.alpha.edit_pos--; if (item->data.alpha.edit_offs > item->data.alpha.edit_pos) item->data.alpha.edit_offs = item->data.alpha.edit_pos; } return MENURESULT_NONE; case MENUTOKEN_OTHER: if (pos >= item->data.alpha.maxlength) { /* We're not allowed to add anything anymore */ item->data.alpha.error_code = 2; item->data.alpha.edit_pos = 0; item->data.alpha.edit_offs = 0; return MENURESULT_NONE; } /* process other keys */ if ((strlen(key) == 1) && (key[0] >= ' ') && (strchr(chars, key[0]) != NULL)) { str[pos] = key[0]; item->data.alpha.edit_pos++; if (pos >= display_props->width - 2) item->data.alpha.edit_offs++; } default: return MENURESULT_NONE; } } return MENURESULT_ERROR; } MenuResult menuitem_process_input_ip(MenuItem *item, MenuToken token, const char *key, unsigned int keymask) { /* To make life easy... */ char *str = item->data.ip.edit_str; char numstr[5]; int num; int pos = item->data.ip.edit_pos; const IpSstringProperties *ipinfo = (item->data.ip.v6) ? &IPinfo[1] : &IPinfo[0]; debug(RPT_DEBUG, "%s(item=[%s], token=%d, key=\"%s\")", __FUNCTION__, ((item != NULL) ? item->id : "(null)"), token, key); /* Clear the error */ item->data.ip.error_code = 0; switch (token) { case MENUTOKEN_MENU: if (pos == 0) { return menuitem_predecessor2menuresult( item->predecessor_id, MENURESULT_CLOSE); } else { /* Reset data */ menuitem_reset_ip(item); } return MENURESULT_NONE; case MENUTOKEN_ENTER: if ((keymask & MENUTOKEN_RIGHT) || (pos >= item->data.ip.maxlength - 1)) { // remove the leading spaces/zeros in each octet-representing string char tmp[40]; // 40 = max. length of IPv4 & IPv6 addresses incl. '\0' char *start = tmp; memccpy(tmp, str, '\0', sizeof(tmp)); while (start != NULL) { char *skip = start; while ((*skip == ' ') || ((*skip == '0') && (skip[1] != ipinfo->sep) && (skip[1] != '\0'))) skip++; memccpy(start, skip, '\0', item->data.ip.maxlength + 1); skip = strchr(start, ipinfo->sep); start = (skip != NULL) ? (skip + 1) : NULL; } // check IP address entered if ((ipinfo->verify != NULL) && (!ipinfo->verify(tmp))) { report(RPT_WARNING, "%s(id=\"%s\") ip address not verified: \"%s\"", __FUNCTION__, item->id, tmp); item->data.ip.error_code = 4; return MENURESULT_NONE; } // store value strcpy(item->data.ip.value, tmp); // Inform client if (item->event_func) item->event_func(item, MENUEVENT_UPDATE); return menuitem_successor2menuresult( item->successor_id, MENURESULT_CLOSE); } else { item->data.ip.edit_pos++; if (str[item->data.ip.edit_pos] == ipinfo->sep) item->data.ip.edit_pos++; while (item->data.ip.edit_pos - item->data.ip.edit_offs > display_props->width - 2) item->data.ip.edit_offs++; return MENURESULT_NONE; } case MENUTOKEN_UP: // convert string starting at the beginning / previous dot into a number num = (int) strtol(&str[pos - (pos % (ipinfo->width + 1))], (char **) NULL, ipinfo->base); // increase the number depending on the position num += ipinfo->posValue[(pos - (pos / (ipinfo->width + 1))) % ipinfo->width]; // wrap around upper limit if (num > ipinfo->limit) num = 0; snprintf(numstr, 5, ipinfo->format, num); memcpy(&str[pos - (pos % (ipinfo->width + 1))], numstr, ipinfo->width); return MENURESULT_NONE; case MENUTOKEN_DOWN: // convert string starting at the beginning / previous dot into a number num = (int) strtol(&str[pos - (pos % (ipinfo->width + 1))], (char **) NULL, ipinfo->base); // decrease the number depending on the position num -= ipinfo->posValue[(pos - (pos / (ipinfo->width + 1))) % ipinfo->width]; // wrap around lower limit 0 if (num < 0) num = ipinfo->limit; snprintf(numstr, 5, ipinfo->format, num); memcpy(&str[pos - (pos % (ipinfo->width + 1))], numstr, ipinfo->width); return MENURESULT_NONE; case MENUTOKEN_RIGHT: if (pos < item->data.ip.maxlength - 1) { item->data.ip.edit_pos++; if (str[item->data.ip.edit_pos] == ipinfo->sep) item->data.ip.edit_pos++; while (item->data.ip.edit_pos - item->data.ip.edit_offs > display_props->width - 2) item->data.ip.edit_offs++; } return MENURESULT_NONE; case MENUTOKEN_LEFT: /* The user wants to go to back a digit */ if (pos > 0) { item->data.ip.edit_pos--; if (str[item->data.ip.edit_pos] == ipinfo->sep) item->data.ip.edit_pos--; if (item->data.ip.edit_offs > item->data.ip.edit_pos) item->data.ip.edit_offs = item->data.ip.edit_pos; } return MENURESULT_NONE; case MENUTOKEN_OTHER: /* process other keys */ if ((strlen(key) == 1) && ((item->data.ip.v6) ? isxdigit(key[0]) : isdigit(key[0]))) { str[pos] = tolower(key[0]); if (pos < item->data.ip.maxlength - 1) { item->data.ip.edit_pos++; if (str[item->data.ip.edit_pos] == ipinfo->sep) item->data.ip.edit_pos++; while (item->data.ip.edit_pos - item->data.ip.edit_offs > display_props->width - 2) item->data.ip.edit_offs++; } } /* FALLTHROUGH */ default: return MENURESULT_NONE; } /* NOTREACHED */ return MENURESULT_ERROR; } /** * get the Client that owns item. extracted from menu_commands_handler(). */ Client *menuitem_get_client(MenuItem *item) { return item->client; } LinkedList *tablist2linkedlist(char *strings) { LinkedList *list; list = LL_new(); /* Parse strings */ if (strings != NULL) { char *p = strings; char *tabptr, *new_s; while ((tabptr = strchr(p, '\t')) != NULL) { int len = (int)(tabptr - p); /* Alloc and copy substring */ new_s = malloc(len + 1); if (new_s != NULL) { strncpy(new_s, p, len); new_s[len] = 0; LL_Push(list, new_s); } /* Go to next string */ p = tabptr + 1; } /* Add last string */ new_s = strdup(p); if (new_s != NULL) LL_Push(list, new_s); } return list; } MenuItemType menuitem_typename_to_type(char *name) { if (name != NULL) { MenuItemType type; for (type = 0; type < NUM_ITEMTYPES; type ++) { if (strcmp(menuitemtypenames[type], name) == 0) { return type; } } } return MENUITEM_INVALID; } char *menuitem_type_to_typename(MenuItemType type) { return ((type >= 0 && type < NUM_ITEMTYPES) ? menuitemtypenames[type] : NULL); } MenuEventType menuitem_eventtypename_to_eventtype(char *name) { if (name != NULL) { MenuEventType type; for (type = 0; type < NUM_EVENTTYPES; type ++) { if (strcmp(menueventtypenames[type], name) == 0) { return type; } } } return MENUEVENT_INVALID; } char *menuitem_eventtype_to_eventtypename(MenuEventType type) { return ((type >= 0 && type < NUM_EVENTTYPES) ? menueventtypenames[type] : NULL); } lcdproc-0.5.7/server/menuitem.h000644 001751 000000 00000027203 12014174064 017257 0ustar00mmdolzewheel000000 000000 /** \file server/menuitem.h * Defines all the menuitem data and actions. * * There are a few different menuitems: * - action * - checkbox (on/off and optionally open) * - slider (the user can increase/decrease a value) * - numeric input * - alphanumeric input (in short: alpha) * - menu (a menu is a menuitem itself too) * * The slider, numeric & string input and menu have their own screen, * that comes to front when the items are selected. * One menuitem is in a different file: Menu data is in menu.h. */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven * 2004, F5 Networks, Inc. - IP-address input * 2005, Peter Marschall - error checks, ... */ #ifndef MENUITEM_H #define MENUITEM_H #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef HAVE_STDBOOL_H # include #endif #include "shared/defines.h" #include "shared/LL.h" /********************************************************************* * Data definitions of the menustuff */ /** These values are used in the function tables in menuitem.c ! */ typedef enum MenuItemType { MENUITEM_INVALID = -1, MENUITEM_MENU = 0, MENUITEM_ACTION = 1, MENUITEM_CHECKBOX = 2, MENUITEM_RING = 3, MENUITEM_SLIDER = 4, MENUITEM_NUMERIC = 5, MENUITEM_ALPHA = 6, MENUITEM_IP = 7, NUM_ITEMTYPES = 8 } MenuItemType; typedef enum CheckboxValue { CHECKBOX_OFF = 0, CHECKBOX_ON, CHECKBOX_GRAY } CheckboxValue; /** Recognized input token codes: they need to be bit values */ typedef enum MenuToken { MENUTOKEN_NONE = 0x0000, /**< no key */ MENUTOKEN_MENU = 0x0001, /**< MenuKey */ MENUTOKEN_ENTER = 0x0002, /**< EnterKey */ MENUTOKEN_UP = 0x0004, /**< UpKey */ MENUTOKEN_DOWN = 0x0008, /**< DownKey */ MENUTOKEN_LEFT = 0x0010, /**< LeftKey */ MENUTOKEN_RIGHT = 0x0020, /**< RightKey */ MENUTOKEN_OTHER = 0x1000 /**< any other key */ } MenuToken; /** Return codes from an input handler */ typedef enum MenuResult { MENURESULT_ERROR = -1, /**< Something has gone wrong */ MENURESULT_NONE = 0, /**< Token handled OK, no extra action */ MENURESULT_ENTER, /**< Token handled OK, enter the selected * menuitem now */ MENURESULT_CLOSE, /**< Token handled OK, close the current * menuitem now */ MENURESULT_QUIT, /**< Token handled OK, close ALL menus now */ MENURESULT_PREDECESSOR, /**< Token handled OK, goto registered * predecessor */ MENURESULT_SUCCESSOR /**< Token handled OK, goto registered * successor */ } MenuResult; /** Events caused by a menuitem */ typedef enum MenuEventType { MENUEVENT_INVALID = -1, /**< Special value for error handling */ MENUEVENT_SELECT = 0, /**< Item has been selected * (action chosen) */ MENUEVENT_UPDATE = 1, /**< Item has been modified * (checkbox, numeric, alphanumeric) */ MENUEVENT_PLUS = 2, /**< Item has been modified in positive direction * (slider moved) */ MENUEVENT_MINUS = 3, /**< Item has been modified in negative direction * (slider moved) */ MENUEVENT_ENTER = 4, /**< Menu has been entered */ MENUEVENT_LEAVE = 5, /**< Menu has been left */ NUM_EVENTTYPES = 6 } MenuEventType; #define MenuEventFunc(f) int (f) (struct MenuItem *item, MenuEventType event) /** I've used a union in the struct below. Why? And why not for Widget? * * There are different types of menuitems. There are also types of widgets. * Menuitems have, just like widgets, different datafields per subtype. * The difference is that menuitems have, unlike widgets _many__different_ * attributes. Widgets share many attributes like x, y, text. * The code would become unreadable if we used the 'widget way', or it would * get large if we define datafields that we use for only one type of * menuitem. (Joris) */ typedef struct MenuItem { MenuItemType type; /**< Type as defined above */ char *id; /**< Internal name for client supplied menus */ char *successor_id; /**< next menuitem after hitting "Enter" on * this one. (Special values are "_quit_", * "_close_", "_none_"). */ char *predecessor_id; /**< next menuitem after hitting "Escape" on * this one. (Special values are "_quit_", * "_close_", "_none_"). */ struct MenuItem *parent; /**< Parent of this menuitem */ MenuEventFunc (*event_func); /**< Defines event_func to be an event function */ char *text; /**< Visible name of the item */ void* client; /**< The owner of this menuitem. */ bool is_hidden; /**< If the item currently should not appear in a menu. */ union data { struct menu { int selector_pos; /**< At what menuitem is the selector (0 for first) */ int scroll; /**< How much has the menu been scrolled down */ void *association; /**< To associate an object with this menu */ LinkedList *contents; /**< What's in this menu */ } menu; struct action { /* nothing */ } action; struct checkbox { bool allow_gray; /**< Is CHECKBOX_GRAY allowed ? */ CheckboxValue value; /**< Current value */ } checkbox; struct ring { LinkedList *strings; /**< The selectable strings */ short value; /**< Current index */ } ring; struct slider { char *mintext; /**< Text at minimal value */ char *maxtext; /**< Text at minimal value */ int minvalue; int maxvalue; int stepsize; int value; /**< Current value */ } slider; struct numeric { int maxvalue; int minvalue; //short allowed_decimals; /**< Number of numbers behind dot */ int value; /**< Current value */ char *edit_str; /**< Value while being edited */ short edit_pos; /**< Position while editing */ short edit_offs; /**< Offset while editing */ short error_code; } numeric; struct alpha { char password_char; /**< For passwords */ short minlength; short maxlength; bool allow_caps; /**< Caps allowed ? */ bool allow_noncaps; /**< Non-caps allowed ? */ bool allow_numbers; /**< Numbers allowed ? */ char *allowed_extra; /**< Allowed extra characters */ char *value; /**< Current value */ char *edit_str; /**< Value while being edited */ short edit_pos; /**< Position while editing */ short edit_offs; /**< Offset while editing */ short error_code; } alpha; struct ip { char *value; /**< Current value */ char *edit_str; /**< Value while being edited */ short maxlength; bool v6; /**< true if editing ipv6 addr */ short edit_pos; /**< Position while editing */ short edit_offs; /**< Offset while editing */ short error_code; } ip; } data; } MenuItem; /********************************************************************* * Functions to use the menustuff */ /** translates a predecessor_id into a MenuResult. */ MenuResult menuitem_predecessor2menuresult(char *predecessor_id, MenuResult default_result); /** translates a successor_id into a MenuResult. */ MenuResult menuitem_successor2menuresult(char *successor_id, MenuResult default_result); MenuItem *menuitem_search(char *menu_id, Client *client); /** YOU SHOULD NOT CALL THIS FUNCTION BUT THE TYPE SPECIFIC ONE INSTEAD */ MenuItem *menuitem_create(MenuItemType type, char *id, MenuEventFunc(*event_func), char *text, Client *client); /* For all constructor functions below the following: * * id: internal name of the item. Never visible. String will be * copied. * event_func: the event function that should be called upon actions on this * item. * text: the displayed text. * * All strings will be copied ! * * Return value: the new item, or NULL on error. * * To create a Menu (which is also an ItemType), call menu_create. * */ /** Creates a an action item (a string only). Generated events: * MENUEVENT_SELECT when user selects the item. */ MenuItem *menuitem_create_action(char *id, MenuEventFunc(*event_func), char *text, Client *client, MenuResult menu_result); /** Creates a checkbox. * Generated events: MENUEVENT_UPDATE when user changes value (immediately). */ MenuItem *menuitem_create_checkbox(char *id, MenuEventFunc(*event_func), char *text, Client *client, bool allow_gray, bool value); /** Creates a ring with the given string, separated by tabs. * value is the (initial) index in the strings. * eg: if strings="abc\\tdef" the value=1 means that "def" is selected. * Generated events: MENUEVENT_UPDATE when user changes value (immediately). */ MenuItem *menuitem_create_ring(char *id, MenuEventFunc(*event_func), char *text, Client *client, char *strings, short value); /** Creates a slider with the given min and max values. * If the display is big enough the mintext and maxtext will be placed * at the end positions of the slider. * You can set the step size. Make it 0 to disable the automatic value chaning, * and update the value yourself. * MENUEVENT_PLUS, MENUEVENT_MINUS when slider is moved (immediately). */ MenuItem *menuitem_create_slider(char *id, MenuEventFunc(*event_func), char *text, Client *client, char *mintext, char *maxtext, int minvalue, int maxvalue, int stepsize, int value); /** Creates a numeric value box. * Value can range from minvalue to maxvalue. * MENUEVENT_UPDATE when user finishes the value (no immediate update). */ MenuItem *menuitem_create_numeric(char *id, MenuEventFunc(*event_func), char *text, Client *client, int minvalue, int maxvalue, int value); /** Creates a string value box. * Value should have given minimal and maximal length. You can set whether * caps, non-caps and numbers are allowed. Also you can alow other characters. * If password char is non-zero, you will only see this char, not the actual * input. * MENUEVENT_UPDATE when user finishes the value (no immediate update). */ MenuItem *menuitem_create_alpha(char *id, MenuEventFunc(*event_func), char *text, Client *client, char password_char, short minlength, short maxlength, bool allow_caps, bool allow_noncaps, bool allow_numbers, char *allowed_extra, char *value); /** Creates an ip value box. can be either v4 or v6 * MENUEVENT_UPDATE when user finishes the value (no immediate update). */ MenuItem *menuitem_create_ip(char *id, MenuEventFunc(*event_func), char *text, Client *client, bool v6, char *value); /** Deletes item from memory. * All allocated extra data (like strings) will be freed. */ void menuitem_destroy(MenuItem *item); /** Resets the item to the initial state. * You should call menuitem_update after this to see the effects. * This call is useless on items that have immediate effect, like a slider. * Those items do not keep temporary data. */ void menuitem_reset(MenuItem *item); /** (Re)builds the selected menuitem on screen using widgets. * Should be re-called if menuitem data has been changed. * There are a few (logical) exceptions to this: * - the values * - the menu scroll and menu index */ void menuitem_rebuild_screen(MenuItem *item, Screen *s); /** Updates the widgets of the selected menuitem * Fills all widget attributes with the corrrect values. */ void menuitem_update_screen(MenuItem *item, Screen *s); /** Does something with the given input. * key is only used if token is MENUTOKEN_OTHER. */ MenuResult menuitem_process_input(MenuItem *item, MenuToken token, const char *key, unsigned int keymask); /** returns the Client that owns the MenuItem. item must not be null */ Client *menuitem_get_client(MenuItem *item); /** Converts a tab-separated list to a LinkedList. */ LinkedList *tablist2linkedlist(char *strings); MenuItemType menuitem_typename_to_type(char *name); char *menuitem_type_to_typename(MenuItemType type); MenuEventType menuitem_eventtypename_to_eventtype(char *name); char *menuitem_eventtype_to_eventtypename(MenuEventType type); #endif lcdproc-0.5.7/server/menu.c000644 001751 000000 00000053706 12313532720 016401 0ustar00mmdolzewheel000000 000000 /** \file server/menu.c * Handles a menu and all actions that can be performed on it. Note that a * menu is itself also a menuitem. * * Menus are similar to "pull-down" menus, but have some extra features. * They can contain "normal" menu items, checkboxes, sliders, "movers", * etc.. * * The servermenu is created from servermenu.c * * For separation this file should never need to include menuscreen.h. */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven * 2002, Joris Robijn * 2004, F5 Networks, Inc. - IP-address input * 2005, Peter Marschall - error checks, ... */ #include #include #include #include #include #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "widget.h" #include "screen.h" #include "menuitem.h" #include "menu.h" #include "shared/report.h" #include "drivers.h" extern Menu *custom_main_menu; /** * Search a menu for an entry by index, ignoring hidden entries. * \param menu Pointer to menu to search in. * \param index Index to search for. * \return Pointer to entry found, NULL otherwise. */ static void * menu_get_subitem(Menu *menu, int index) { MenuItem *item; int i = 0; debug(RPT_DEBUG, "%s(menu=[%s], index=%d)", __FUNCTION__, ((menu != NULL) ? menu->id : "(null)"), index); for (item = LL_GetFirst(menu->data.menu.contents); item != NULL; item = LL_GetNext(menu->data.menu.contents)) { /* hidden items don't count at all... */ if (! item->is_hidden) { if (i == index) return item; ++i; } } return NULL; } /** * Search a menu for an entry by its ID, ignoring hidden entries. * \param menu Pointer to menu to search in. * \param item_id ID to search for. * \return Index of subitem if found, and -1 otherwise. */ static int menu_get_index_of(Menu *menu, char *item_id) { MenuItem *item; int i = 0; debug(RPT_DEBUG, "%s(menu=[%s], item_id=%s)", __FUNCTION__, ((menu != NULL) ? menu->id : "(null)"), item_id); for (item = LL_GetFirst(menu->data.menu.contents); item != NULL; item = LL_GetNext(menu->data.menu.contents)) { /* hidden items don't count at all... */ if (! item->is_hidden) { if (strcmp(item_id, item->id) == 0) return i; ++i; } } return -1; } /** * Count entries in a menu, ignoring invisible ones. * \param menu Pointer to menu to search in. * \return Number of visible entries in the menu. */ static int menu_visible_item_count(Menu *menu) { MenuItem *item; int i = 0; for (item = LL_GetFirst(menu->data.menu.contents); item != NULL; item = LL_GetNext(menu->data.menu.contents)) { if (! item->is_hidden) ++i; } return i; } #define LV_LABEL_ONLY 1 /**< Fill string with label only */ #define LV_VALUE_ONLY 2 /**< Fill string with value only */ #define LV_LABEL_VALU 3 /**< Fill string with label & beginning of value */ #define LV_LABEL_ALUE 4 /**< Fill string with label & end of value */ /** * Fill string with left-aligned label and right-aligned value, * with different modes on overflow. * \param string String to fill with label and value. * \param len Length of string (=no. of bytes). * \param text Label to use. * \param value Value to use. * \param mode Flag governing behaviour on overflow. * \return Filled string, or \c NULL in case of problems. */ char * fill_labeled_value(char *string, int len, const char *text, const char *value, int mode) { if ((string != NULL) && (text != NULL) && (len > 0)) { int textlen = strlen(text); len--; // make calculations nicer ;-))) debug(RPT_DEBUG, "%s(string=[%p], len=%d, text=\"%s\", value=\"%s\", mode=%d)", __FUNCTION__, string, len, text, ((value != NULL) ? value : "(null)"), mode); if ((value != NULL) && (textlen + strlen(value) < len - 1)) { memset(string, ' ', len); strncpy(string, text, textlen); strcpy(string + len - strlen(value), value); } else { // safeguard against missing value or too long labels if ((value == NULL) || (textlen >= len-3)) mode = LV_LABEL_ONLY; switch (mode) { case LV_LABEL_VALU: // show fist chars in value memset(string, ' ', len); strncpy(string, text, textlen); strncpy(string + textlen + 2, value, len - textlen - 2); strcpy(string + len - 2, ".."); string[len] = '\0'; break; case LV_LABEL_ALUE: // show last chars in value memset(string, ' ', len); strncpy(string, text, textlen); strcpy(string + textlen + 2, ".."); strcpy(string + textlen + 4, value + strlen(value) - len + textlen + 4); string[len] = '\0'; break; case LV_VALUE_ONLY: /* indent by one to indicate it's a value */ strcpy(string, " "); strncpy(string + 1, value, len-1); string[len] = '\0'; break; case LV_LABEL_ONLY: default: strncpy(string, text, len); string[len] = '\0'; break; } } return(string); } return NULL; } Menu * menu_create(char *id, MenuEventFunc(*event_func), char *text, Client *client) { Menu *new_menu; debug(RPT_DEBUG, "%s(id=\"%s\", event_func=%p, text=\"%s\", client=%p)", __FUNCTION__, id, event_func, text, client); new_menu = menuitem_create(MENUITEM_MENU, id, event_func, text, client); if (new_menu != NULL) { new_menu->data.menu.contents = LL_new(); new_menu->data.menu.association = NULL; } return new_menu; } void menu_destroy(Menu *menu) { debug(RPT_DEBUG, "%s(menu=[%s])", __FUNCTION__, ((menu != NULL) ? menu->id : "(null)")); if (menu == NULL) return; if (custom_main_menu == menu) custom_main_menu = NULL; menu_destroy_all_items(menu); LL_Destroy(menu->data.menu.contents); menu->data.menu.contents = NULL; /* After this the general menuitem routine destroys the rest... */ } void menu_add_item(Menu *menu, MenuItem *item) { debug(RPT_DEBUG, "%s(menu=[%s], item=[%s])", __FUNCTION__, ((menu != NULL) ? menu->id : "(null)"), ((item != NULL) ? item->id : "(null)")); if ((menu == NULL) || (item == NULL)) return; /* Add the item to the menu */ LL_Push(menu->data.menu.contents, item); item->parent = menu; } void menu_remove_item(Menu *menu, MenuItem *item) { int i; MenuItem *item2; debug(RPT_DEBUG, "%s(menu=[%s], item=[%s])", __FUNCTION__, ((menu != NULL) ? menu->id : "(null)"), ((item != NULL) ? item->id : "(null)")); if ((menu == NULL) || (item == NULL)) return; /* Find the item */ for (item2 = LL_GetFirst(menu->data.menu.contents), i = 0; item2 != NULL; item2 = LL_GetNext(menu->data.menu.contents), i++) { if (item == item2) { LL_DeleteNode(menu->data.menu.contents, NEXT); if (menu->data.menu.selector_pos >= i) { menu->data.menu.selector_pos--; if (menu->data.menu.scroll > 0) menu->data.menu.scroll--; } return; } } } void menu_destroy_all_items(Menu *menu) { MenuItem *item; debug(RPT_DEBUG, "%s(menu=[%s])", __FUNCTION__, ((menu != NULL) ? menu->id : "(null)")); if (menu == NULL) return; for (item = menu_getfirst_item(menu); item != NULL; item = menu_getfirst_item(menu)) { menuitem_destroy(item); LL_Remove(menu->data.menu.contents, item, NEXT); } } MenuItem *menu_get_current_item(Menu *menu) { return (MenuItem*) ((menu != NULL) ? menu_get_subitem(menu, menu->data.menu.selector_pos) : NULL); } MenuItem *menu_find_item(Menu *menu, char *id, bool recursive) { MenuItem *item; debug(RPT_DEBUG, "%s(menu=[%s], id=\"%s\", recursive=%d)", __FUNCTION__, ((menu != NULL) ? menu->id : "(null)"), id, recursive); if ((menu == NULL) || (id == NULL)) return NULL; if (strcmp(menu->id, id) == 0) return menu; for (item = menu_getfirst_item(menu); item != NULL; item = menu_getnext_item(menu)) { if (strcmp(item->id, id) == 0) { return item; } if (recursive && (item->type == MENUITEM_MENU)) { MenuItem *res = menu_find_item(item, id, recursive); if (res != NULL) return res; } } return NULL; } void menu_set_association(Menu *menu, void *assoc) { /* * assoc can currently be either a Screen or Driver, but there's * no way to tell, so just display (data) if it's not NULL */ debug(RPT_DEBUG, "%s(menu=[%s], assoc=[%s])", __FUNCTION__, ((menu != NULL) ? menu->id : "(null)"), ((assoc != NULL) ? "(data)" : "(null)")); /* note that assoc is allowed to be NULL */ if (menu == NULL) return; menu->data.menu.association = assoc; } void menu_reset(Menu *menu) { debug(RPT_DEBUG, "%s(menu=[%s])", __FUNCTION__, ((menu != NULL) ? menu->id : "(null)")); if (menu == NULL) return; menu->data.menu.selector_pos = 0; menu->data.menu.scroll = 0; } void menu_build_screen(MenuItem *menu, Screen *s) { Widget *w; MenuItem *subitem; int itemnr; debug(RPT_DEBUG, "%s(menu=[%s], screen=[%s])", __FUNCTION__, ((menu != NULL) ? menu->id : "(null)"), ((s != NULL) ? s->id : "(null)")); if ((menu == NULL) || (s == NULL)) return; /* TODO: Put menu in a frame to do easy scrolling */ /* Problem: frames are not handled correctly by renderer */ /* Create menu title widget */ w = widget_create("title", WID_TITLE, s); if (w != NULL) { screen_add_widget(s, w); w->text = strdup(menu->text); w->x = 1; } /* Create widgets for each subitem in the menu */ for (subitem = LL_GetFirst(menu->data.menu.contents), itemnr = 0; subitem != NULL; subitem = LL_GetNext(menu->data.menu.contents), itemnr ++) { char buf[10]; if (subitem->is_hidden) continue; snprintf(buf, sizeof(buf)-1, "text%d", itemnr); buf[sizeof(buf)-1] = '\0'; w = widget_create(buf, WID_STRING, s); /* (buf will be copied) */ if (w != NULL) { screen_add_widget(s, w); w->x = 2; switch (subitem->type) { case MENUITEM_CHECKBOX: /* Limit string length */ w->text = strdup(subitem->text); if (strlen(subitem->text) >= display_props->width-2) w->text[display_props->width-2] = '\0'; /* Add icon for checkbox */ snprintf(buf, sizeof(buf)-1, "icon%d", itemnr); buf[sizeof(buf)-1] = '\0'; w = widget_create(buf, WID_ICON, s); /* (buf will be copied) */ screen_add_widget(s, w); w->x = display_props->width - 1; w->length = ICON_CHECKBOX_OFF; break; case MENUITEM_RING: /* Create string for text + ringtext */ w->text = malloc(display_props->width); break; case MENUITEM_MENU: /* Limit string length */ w->text = malloc(strlen(subitem->text) + 4); strcpy(w->text, subitem->text); strcat(w->text, " >"); if (strlen(subitem->text) >= display_props->width-1) w->text[display_props->width-1] = '\0'; break; case MENUITEM_ACTION: case MENUITEM_SLIDER: case MENUITEM_NUMERIC: case MENUITEM_ALPHA: case MENUITEM_IP: /* Limit string length */ w->text = malloc(display_props->width); strncpy(w->text, subitem->text, display_props->width); w->text[display_props->width-1] = '\0'; break; default: assert(!"unexpected menuitem type"); } } } /* Add arrow for selection on the left */ w = widget_create("selector", WID_ICON, s); if (w != NULL) { screen_add_widget(s, w); w->length = ICON_SELECTOR_AT_LEFT; w->x = 1; } /* Add scrollers on the right side on top and bottom */ /* TODO: when menu is in a frame, these can be removed */ w = widget_create("upscroller", WID_ICON, s); if (w != NULL) { screen_add_widget(s, w); w->length = ICON_ARROW_UP; w->x = display_props->width; w->y = 1; } w = widget_create("downscroller", WID_ICON, s); if (w != NULL) { screen_add_widget(s, w); w->length = ICON_ARROW_DOWN; w->x = display_props->width; w->y = display_props->height; } } void menu_update_screen(MenuItem *menu, Screen *s) { Widget *w; MenuItem *subitem; int itemnr; int hidden_count = 0; debug(RPT_DEBUG, "%s(menu=[%s], screen=[%s])", __FUNCTION__, ((menu != NULL) ? menu->id : "(null)"), ((s != NULL) ? s->id : "(null)")); if ((menu == NULL) || (s == NULL)) return; /* Update widgets for the title */ w = screen_find_widget(s, "title"); if (w == NULL) report(RPT_ERR, "%s: could not find widget: %s", __FUNCTION__, "title"); w->y = 1 - menu->data.menu.scroll; /* TODO: remove next 3 limes when rendering is safe */ w->type = ((w->y > 0) && (w->y <= display_props->height)) ? WID_TITLE : WID_NONE; /* make invisible */ /* Update widgets for each subitem in the menu */ for (subitem = LL_GetFirst(menu->data.menu.contents), itemnr = 0; subitem != NULL; subitem = LL_GetNext(menu->data.menu.contents), itemnr ++) { char buf[LCD_MAX_WIDTH]; // long enough for "icon%d" and such char *p; int len = display_props->width - 1; if (subitem->is_hidden) { debug(RPT_DEBUG, "%s: menu %s has hidden menu: %s", __FUNCTION__, menu->id, subitem->id); hidden_count++; continue; } snprintf(buf, sizeof(buf)-1, "text%d", itemnr); buf[sizeof(buf)-1] = '\0'; w = screen_find_widget(s, buf); if (w == NULL) report(RPT_ERR, "%s: could not find widget: %s", __FUNCTION__, buf); w->y = 2 + itemnr - hidden_count - menu->data.menu.scroll; /* TODO: remove next 3 lines when rendering is safe */ w->type = ((w->y > 0) && (w->y <= display_props->height)) ? WID_STRING : WID_NONE; /* make invisible */ switch (subitem->type) { case MENUITEM_CHECKBOX: /* Update icon value for checkbox */ snprintf(buf, sizeof(buf)-1, "icon%d", itemnr); buf[sizeof(buf)-1] = '\0'; w = screen_find_widget(s, buf); if (w == NULL) report(RPT_ERR, "%s: could not find widget: %s", __FUNCTION__, buf); w->y = 2 + itemnr - menu->data.menu.scroll; w->length = ((int[]){ICON_CHECKBOX_OFF,ICON_CHECKBOX_ON,ICON_CHECKBOX_GRAY})[subitem->data.checkbox.value]; /* TODO: remove next 3 lines when rendering is safe */ w->type = ((w->y > 0) && (w->y <= display_props->height)) ? WID_ICON : WID_NONE; /* make invisible */ break; case MENUITEM_RING: p = LL_GetByIndex(subitem->data.ring.strings, subitem->data.ring.value); fill_labeled_value(w->text, len, subitem->text, p, LV_VALUE_ONLY); break; case MENUITEM_SLIDER: snprintf(buf, display_props->width, "%d", subitem->data.slider.value); buf[display_props->width-1] = '\0'; fill_labeled_value(w->text, len, subitem->text, buf, LV_LABEL_VALU); break; case MENUITEM_NUMERIC: snprintf(buf, display_props->width, "%d", subitem->data.numeric.value); buf[display_props->width-1] = '\0'; fill_labeled_value(w->text, len, subitem->text, buf, LV_LABEL_VALU); break; case MENUITEM_ALPHA: fill_labeled_value(w->text, len, subitem->text, subitem->data.alpha.value, LV_LABEL_VALU); break; case MENUITEM_IP: fill_labeled_value(w->text, len, subitem->text, subitem->data.ip.value, LV_LABEL_ALUE); break; default: break; } } /* Update selector position */ w = screen_find_widget(s, "selector"); if (w != NULL) w->y = 2 + menu->data.menu.selector_pos - menu->data.menu.scroll; else report(RPT_ERR, "%s: could not find widget: %s", __FUNCTION__, "selector"); /* Enable upscroller (if necessary) */ w = screen_find_widget(s, "upscroller"); if (w != NULL) w->type = (menu->data.menu.scroll > 0) ? WID_ICON : WID_NONE; else report(RPT_ERR, "%s: could not find widget: %s", __FUNCTION__, "upscroller"); /* Enable downscroller (if necessary) */ w = screen_find_widget(s, "downscroller"); if (w != NULL) w->type = (menu_visible_item_count(menu) >= menu->data.menu.scroll + display_props->height) ? WID_ICON : WID_NONE; else report(RPT_ERR, "%s: could not find widget: %s", __FUNCTION__, "downscroller"); } MenuItem *menu_get_item_for_predecessor_check(Menu *menu) { MenuItem *subitem = menu_get_subitem(menu, menu->data.menu.selector_pos); if (subitem == NULL) return NULL; switch (subitem->type) { case MENUITEM_ACTION: case MENUITEM_CHECKBOX: case MENUITEM_RING: // for types without own screen: look for menu's // predecessor if its subitem doesn't have one. (Since // menus can't have successors this problem arises // only for predecessors.) if (subitem->predecessor_id == NULL) return menu; return subitem; case MENUITEM_MENU: case MENUITEM_SLIDER: case MENUITEM_NUMERIC: case MENUITEM_ALPHA: case MENUITEM_IP: return menu; default: return NULL; } } MenuItem *menu_get_item_for_successor_check(Menu *menu) { MenuItem *subitem = menu_get_subitem(menu, menu->data.menu.selector_pos); if (subitem == NULL) return NULL; switch (subitem->type) { case MENUITEM_ACTION: case MENUITEM_CHECKBOX: case MENUITEM_RING: return subitem; case MENUITEM_MENU: case MENUITEM_SLIDER: case MENUITEM_NUMERIC: case MENUITEM_ALPHA: case MENUITEM_IP: return menu; default: return NULL; } } MenuResult menu_process_input(Menu *menu, MenuToken token, const char *key, unsigned int keymask) { MenuItem *subitem; debug(RPT_DEBUG, "%s(menu=[%s], token=%d, key=\"%s\")", __FUNCTION__, ((menu != NULL) ? menu->id : "(null)"), token, key); if (menu == NULL) return MENURESULT_ERROR; switch (token) { case MENUTOKEN_MENU: subitem = menu_get_item_for_predecessor_check(menu); if (subitem == NULL) return MENURESULT_ERROR; return menuitem_predecessor2menuresult( subitem->predecessor_id, MENURESULT_CLOSE); case MENUTOKEN_ENTER: subitem = menu_get_subitem(menu, menu->data.menu.selector_pos); if (!subitem) break; switch (subitem->type) { case MENUITEM_ACTION: if (subitem->event_func) subitem->event_func(subitem, MENUEVENT_SELECT); return menuitem_successor2menuresult( subitem->successor_id, MENURESULT_NONE); case MENUITEM_CHECKBOX: subitem->data.checkbox.value++; subitem->data.checkbox.value %= (subitem->data.checkbox.allow_gray) ? 3 : 2; if (subitem->event_func) subitem->event_func(subitem, MENUEVENT_UPDATE); return menuitem_successor2menuresult( subitem->successor_id, MENURESULT_NONE); case MENUITEM_RING: subitem->data.ring.value++; subitem->data.ring.value %= LL_Length(subitem->data.ring.strings); if (subitem->event_func) subitem->event_func(subitem, MENUEVENT_UPDATE); return menuitem_successor2menuresult( subitem->successor_id, MENURESULT_NONE); case MENUITEM_MENU: case MENUITEM_SLIDER: case MENUITEM_NUMERIC: case MENUITEM_ALPHA: case MENUITEM_IP: return MENURESULT_ENTER; default: break; } return MENURESULT_ERROR; case MENUTOKEN_UP: if (menu->data.menu.selector_pos > 0) { if (menu->data.menu.selector_pos < menu->data.menu.scroll) menu->data.menu.scroll--; menu->data.menu.selector_pos--; } else if (menu->data.menu.selector_pos == 0) { // wrap around to last menu entry menu->data.menu.selector_pos = menu_visible_item_count(menu) - 1; menu->data.menu.scroll = menu->data.menu.selector_pos + 2 - display_props->height; } return MENURESULT_NONE; case MENUTOKEN_DOWN: if (menu->data.menu.selector_pos < menu_visible_item_count(menu) - 1) { menu->data.menu.selector_pos++; if (menu->data.menu.selector_pos - menu->data.menu.scroll + 2 > display_props->height) menu->data.menu.scroll++; } else { // wrap araound to 1st menu entry menu->data.menu.selector_pos = 0; menu->data.menu.scroll = 0; } return MENURESULT_NONE; case MENUTOKEN_LEFT: if (!(keymask & MENUTOKEN_LEFT)) return MENURESULT_NONE; subitem = menu_get_subitem(menu, menu->data.menu.selector_pos); if (subitem == NULL) break; switch (subitem->type) { case MENUITEM_CHECKBOX: if (subitem->data.checkbox.value == 0) subitem->data.checkbox.value = (subitem->data.checkbox.allow_gray) ? 2 : 1; else subitem->data.checkbox.value--; if (subitem->event_func) subitem->event_func(subitem, MENUEVENT_UPDATE); return MENURESULT_NONE; case MENUITEM_RING: /* ring: jump to the end if beginning is reached */ if (subitem->data.ring.value == 0) subitem->data.ring.value = LL_Length(subitem->data.ring.strings) - 1; else subitem->data.ring.value--; if (subitem->event_func) subitem->event_func(subitem, MENUEVENT_UPDATE); return MENURESULT_NONE; default: break; } return MENURESULT_NONE; case MENUTOKEN_RIGHT: if (!(keymask & MENUTOKEN_RIGHT)) return MENURESULT_NONE; subitem = menu_get_subitem(menu, menu->data.menu.selector_pos); if (subitem == NULL) break; switch (subitem->type) { case MENUITEM_CHECKBOX: subitem->data.checkbox.value++; subitem->data.checkbox.value %= (subitem->data.checkbox.allow_gray) ? 3 : 2; if (subitem->event_func) subitem->event_func(subitem, MENUEVENT_UPDATE); return MENURESULT_NONE; case MENUITEM_RING: subitem->data.ring.value++; subitem->data.ring.value %= LL_Length(subitem->data.ring.strings); if (subitem->event_func) subitem->event_func(subitem, MENUEVENT_UPDATE); return MENURESULT_NONE; case MENUITEM_MENU: return MENURESULT_ENTER; default: break; } return MENURESULT_NONE; case MENUTOKEN_OTHER: /* TODO: move to the selected number and enter it */ default: return MENURESULT_NONE; } return MENURESULT_ERROR; } /** * Position current item pointer on entry with given ID in given menu. * If entry is hidden or no valid subitem of menu do nothing. * \param menu Pointer to menu to position pointer in. * \param item_id Sub-Menu ID to position menu pointer on. */ void menu_select_subitem(Menu *menu, char *item_id) { int position; assert(menu != NULL); position = menu_get_index_of(menu, item_id); debug(RPT_DEBUG, "%s(menu=[%s], item_id=\"%s\")", __FUNCTION__, menu->id, item_id); if (position < 0) { debug(RPT_DEBUG, "%s: item \"%s\" not found" " or hidden in \"%s\", ignored", __FUNCTION__, item_id, menu->id); return; } // debug(RPT_DEBUG, "%s: %s->%s is at position %d," // " current item is at menu position: %d, scroll: %d", // __FUNCTION__, menu->id, item_id, position, // menu->data.menu.selector_pos, menu->data.menu.scroll); menu->data.menu.selector_pos = position; menu->data.menu.scroll = position; } /* EOF */ lcdproc-0.5.7/server/menu.h000644 001751 000000 00000007135 12014174064 016402 0ustar00mmdolzewheel000000 000000 /** \file server/menu.h * Defines all the menu data and actions. */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven * 2004, F5 Networks, Inc. - IP-address input * 2005, Peter Marschall - error checks, ... */ #ifndef MENU_H #define MENU_H #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef HAVE_STDBOOL_H # include #endif #include "shared/defines.h" #include "shared/LL.h" #include "menuitem.h" /** A Menu is a MenuItem too. * This definition is only for better understanding of this code. */ typedef MenuItem Menu; /** Creates a new menu. */ Menu *menu_create(char *id, MenuEventFunc(*event_func), char *text, Client *client); /** Deletes menu from memory. * Destructors will be called for all subitems. * DO NOT CALL THIS FUNCTION, CALL menuitem_destroy INSTEAD ! */ void menu_destroy(Menu *menu); /** Adds an item to the menu */ void menu_add_item(Menu *menu, MenuItem *item); /** Removes an item from the menu (does not destroy it) */ void menu_remove_item(Menu *menu, MenuItem *item); /** Destroys and removes all items from the menu */ void menu_destroy_all_items(Menu *menu); /** Enumeration function. * Retrieves the first item from the list of items in the menu. */ static inline MenuItem *menu_getfirst_item(Menu *menu) { return (MenuItem*) ((menu != NULL) ? LL_GetFirst(menu->data.menu.contents) : NULL); } /** Enumeration function. * Retrieves the next item from the list of items in the menu. * No other menu calls should be made between menu_first_item() and * this function, to keep the list-cursor where it is. */ static inline MenuItem *menu_getnext_item(Menu *menu) { return (MenuItem*) ((menu != NULL) ? LL_GetNext(menu->data.menu.contents) : NULL); } /** Retrieves the current (non-hidden) item from the list of items in the * menu. */ MenuItem *menu_get_current_item(Menu *menu); /** Finds an item in the menu by the given id. */ MenuItem *menu_find_item(Menu *menu, char *id, bool recursive); /** sets the association member of a Menu. */ void menu_set_association(Menu *menu, void *assoc); /** Resets it to initial state. * DO NOT CALL THIS FUNCTION, CALL menuitem_reset_screen INSTEAD ! */ void menu_reset(Menu *menu); /** Builds the selected menuitem on screen using widgets. * DO NOT CALL THIS FUNCTION, CALL menuitem_rebuild_screen INSTEAD ! */ void menu_build_screen(Menu *menu, Screen *s); /** Updates the widgets of the selected menuitem * DO NOT CALL THIS FUNCTION, CALL menuitem_update_screen INSTEAD ! */ void menu_update_screen(Menu *menu, Screen *s); /** * For predecessor-Check: returns selected subitem of menu if this subitem * has no own screen (action, checkbox, ...) and this subitem has a * predecessor and menu otherwise. * * @return NULL on error. */ MenuItem *menu_get_item_for_predecessor_check(Menu *menu); /** * For successor-Check: returns selected subitem of menu if * this subitem has no own screen (action, checkbox, ...) or menu * otherwise. * * @return NULL on error. */ MenuItem *menu_get_item_for_successor_check(Menu *menu); /** Does something with the given input. * key is only used if token is MENUTOKEN_OTHER. * DO NOT CALL THIS FUNCTION, CALL menuitem_process_input INSTEAD ! */ MenuResult menu_process_input(Menu *menu, MenuToken token, const char *key, unsigned int keymask); /** positions current item pointer on subitem item_id. */ void menu_select_subitem(Menu *menu, char *item_id); #endif lcdproc-0.5.7/server/menuscreens.c000644 001751 000000 00000055613 12313535265 017772 0ustar00mmdolzewheel000000 000000 /** \file server/menuscreens.c * Creates the server menu screen(s) and creates the menus that should be * displayed on this screen. * It also handles its key presses and converts them to menu tokens for * easier processing. * * \note * menuscreens.c does not know whether a menuitem is displayed INSIDE * a menu or on a separate SCREEN, for flexibility. */ /*- * This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven * 2002, Joris Robijn * 2004, F5 Networks, Inc. - IP-address input * 2005, Peter Marschall - error checks, ... */ #include #include #include #include #include "screen.h" #include "screenlist.h" #include "menuscreens.h" #include "shared/configfile.h" #include "shared/report.h" #include "input.h" #include "driver.h" #include "drivers.h" #ifdef HAVE_CONFIG_H # include "config.h" #endif /* Next include files are needed for settings that we can modify */ #include "render.h" char *menu_key; char *enter_key; char *up_key; char *down_key; char *left_key; char *right_key; static unsigned int keymask; /* mask of defined menu keys */ Screen *menuscreen = NULL; MenuItem *active_menuitem = NULL; /** the "real" main_menu */ Menu *main_menu = NULL; /** customizable entry point into the menu system (see menuscreen_set_main()). */ Menu *custom_main_menu = NULL; Menu *screens_menu = NULL; /* Local prototypes */ static void handle_quit(void); static void handle_close(void); static void handle_none(void); static void handle_enter(void); static void handle_successor(void); void menuscreen_switch_item(MenuItem *new_menuitem); void menuscreen_create_menu(void); #ifdef LCDPROC_TESTMENUS void menuscreen_create_testmenu(void); #endif Menu *menuscreen_get_main(void); MenuEventFunc(heartbeat_handler); MenuEventFunc(backlight_handler); MenuEventFunc(titlespeed_handler); MenuEventFunc(contrast_handler); MenuEventFunc(brightness_handler); int menuscreens_init(void) { const char *tmp; debug(RPT_DEBUG, "%s()", __FUNCTION__); /* * Get keys from config file: MenuKey, EnterKey, UpKey, DownKey, * LeftKey, RightKey. For a working menu at least 3 are necessary: * MenuKey, EnterKey, UpKey/DownKey. */ keymask = 0; menu_key = enter_key = NULL; tmp = config_get_string("menu", "MenuKey", 0, NULL); if (tmp != NULL) { menu_key = strdup(tmp); keymask |= MENUTOKEN_MENU; } tmp = config_get_string("menu", "EnterKey", 0, NULL); if (tmp != NULL) { enter_key = strdup(tmp); keymask |= MENUTOKEN_ENTER; } up_key = down_key = NULL; tmp = config_get_string("menu", "UpKey", 0, NULL); if (tmp != NULL) { up_key = strdup(tmp); keymask |= MENUTOKEN_UP; } tmp = config_get_string("menu", "DownKey", 0, NULL); if (tmp != NULL) { down_key = strdup(tmp); keymask |= MENUTOKEN_DOWN; } left_key = right_key = NULL; tmp = config_get_string("menu", "LeftKey", 0, NULL); if (tmp != NULL) { left_key = strdup(tmp); keymask |= MENUTOKEN_LEFT; } tmp = config_get_string("menu", "RightKey", 0, NULL); if (tmp != NULL) { right_key = strdup(tmp); keymask |= MENUTOKEN_RIGHT; } /* Now reserve the keys that were defined */ if (menu_key != NULL) input_reserve_key(menu_key, true, NULL); if (enter_key != NULL) input_reserve_key(enter_key, false, NULL); if (up_key != NULL) input_reserve_key(up_key, false, NULL); if (down_key != NULL) input_reserve_key(down_key, false, NULL); if (left_key != NULL) input_reserve_key(left_key, false, NULL); if (right_key != NULL) input_reserve_key(right_key, false, NULL); /* Create screen */ menuscreen = screen_create("_menu_screen", NULL); if (menuscreen != NULL) menuscreen->priority = PRI_HIDDEN; active_menuitem = NULL; screenlist_add(menuscreen); /* Build menu */ menuscreen_create_menu(); return 0; } int menuscreens_shutdown(void) { debug(RPT_DEBUG, "%s()", __FUNCTION__); /* Program shutdown before completed startup */ if (!menuscreen) return -1; /* Quit menu just to make sure */ menuscreen_switch_item(NULL); /* Destroy the menuscreen */ screenlist_remove(menuscreen); screen_destroy(menuscreen); menuscreen = NULL; /* Destroy all menus */ menuitem_destroy(main_menu); main_menu = NULL; custom_main_menu = NULL; screens_menu = NULL; /* Forget menu's key reservations */ input_release_client_keys(NULL); if (menu_key != NULL) free(menu_key); if (enter_key != NULL) free(enter_key); if (up_key != NULL) free(up_key); if (down_key != NULL) free(down_key); if (left_key != NULL) free(left_key); if (right_key != NULL) free(right_key); keymask = 0; return 0; } void menuscreen_inform_item_destruction(MenuItem * item) { MenuItem *i; debug(RPT_DEBUG, "%s(item=[%s])", __FUNCTION__, ((item != NULL) ? item->id : "(null)")); /* Are we currently in (a subitem of) the given item ? */ for (i = active_menuitem; i != NULL; i = i->parent) { if (i == item) { menuscreen_switch_item(item->parent); } } } void menuscreen_inform_item_modified(MenuItem * item) { debug(RPT_DEBUG, "%s(item=[%s])", __FUNCTION__, ((item != NULL) ? item->id : "(null)")); if ((active_menuitem == NULL) || (item == NULL)) return; /* Are we currently in the item or the parent of the item ? */ if (active_menuitem == item || active_menuitem == item->parent) { menuitem_rebuild_screen(active_menuitem, menuscreen); } } bool is_menu_key(const char *key) { if ((menu_key != NULL) && (key != NULL) && (strcmp(key, menu_key) == 0)) return true; else return false; } /** This function changes the menuitem to the given one, and does necessary * actions. * To leave the menu system, specify NULL for new_menuitem. * The item will not be reset when the new item is a child of the last one. */ void menuscreen_switch_item(MenuItem * new_menuitem) { MenuItem *old_menuitem = active_menuitem; debug(RPT_DEBUG, "%s(item=[%s]) from active_menuitem=[%s]", __FUNCTION__, ((new_menuitem != NULL) ? new_menuitem->id : "(null)"), ((old_menuitem != NULL) ? old_menuitem->id : "(null)")); /* First we do the switch */ active_menuitem = new_menuitem; /* What was the state change ? */ if (!old_menuitem && !new_menuitem) { /* Nothing to be done */ } else if (old_menuitem && !new_menuitem) { /* leave menu system */ menuscreen->priority = PRI_HIDDEN; } else if (!old_menuitem && new_menuitem) { /* Menu is becoming active */ menuitem_reset(active_menuitem); menuitem_rebuild_screen(active_menuitem, menuscreen); menuscreen->priority = PRI_INPUT; } else { /* We're left with the usual case: a menu level switch */ if (old_menuitem->parent != new_menuitem) { menuitem_reset(new_menuitem); } menuitem_rebuild_screen(active_menuitem, menuscreen); } if (old_menuitem && old_menuitem->event_func) old_menuitem->event_func(old_menuitem, MENUEVENT_LEAVE); if (new_menuitem && new_menuitem->event_func) new_menuitem->event_func(new_menuitem, MENUEVENT_ENTER); return; } static void handle_quit(void) { debug(RPT_DEBUG, "%s: Closing menu screen", __FUNCTION__); menuscreen_switch_item(NULL); } static void handle_close(void) { debug(RPT_DEBUG, "%s: Closing item", __FUNCTION__); menuscreen_switch_item( (active_menuitem == menuscreen_get_main()) ? NULL : active_menuitem->parent); } static void handle_none(void) { debug(RPT_DEBUG, "%s: Staying in item", __FUNCTION__); if (active_menuitem) { menuitem_update_screen(active_menuitem, menuscreen); /* No rebuild needed, only value can be changed */ } /* Nothing extra to be done */ } /** Enter the selected menuitem * Note: this is not for checkboxes etc that don't have their * own screen. The menuitem_process_input function should do * things like toggling checkboxes ! */ static void handle_enter(void) { debug(RPT_DEBUG, "%s: Entering subitem", __FUNCTION__); menuscreen_switch_item(menu_get_current_item(active_menuitem)); } static void handle_predecessor(void) { MenuItem *predecessor; MenuItem *item = (active_menuitem->type == MENUITEM_MENU) ? menu_get_item_for_predecessor_check(active_menuitem) : active_menuitem; assert(item != NULL); debug(RPT_DEBUG, "%s: Switching to registered predecessor '%s' of '%s'.", __FUNCTION__, item->predecessor_id, item->id); predecessor = menuitem_search(item->predecessor_id, (Client *) active_menuitem->client); if (predecessor == NULL) { /* * note: if _quit_, _close_, _none_ get here this would be an * implementation error - they should have been handled via * different MENURESULT codes. */ report(RPT_ERR, "%s: cannot find predecessor '%s' of '%s'.", __FUNCTION__, item->predecessor_id, item->id); return; } switch (predecessor->type) { case MENUITEM_ACTION: case MENUITEM_CHECKBOX: case MENUITEM_RING: if (active_menuitem != predecessor->parent) menuscreen_switch_item(predecessor->parent); /* this won't work for hidden subitems */ menu_select_subitem(active_menuitem, item->predecessor_id); menuitem_update_screen(active_menuitem, menuscreen); break; default: if ((predecessor->parent != NULL) && (predecessor->parent->type == MENUITEM_MENU)) { /* update parent menu too */ menu_select_subitem(predecessor->parent, predecessor->id); } menuscreen_switch_item(predecessor); break; } } static void handle_successor(void) { MenuItem *successor; MenuItem *item = (active_menuitem->type == MENUITEM_MENU) ? menu_get_item_for_successor_check(active_menuitem) : active_menuitem; assert(item != NULL); debug(RPT_DEBUG, "%s: Switching to registered successor '%s' of '%s'.", __FUNCTION__, item->successor_id, item->id); successor = menuitem_search(item->successor_id, (Client *) active_menuitem->client); if (successor == NULL) { /* * note: if _quit_, _close_, _none_ get here this would be an * implementation error - they should have been handled via * different MENURESULT codes. */ report(RPT_ERR, "%s: cannot find successor '%s' of '%s'.", __FUNCTION__, item->successor_id, item->id); return; } switch (successor->type) { case MENUITEM_ACTION: case MENUITEM_CHECKBOX: case MENUITEM_RING: if (active_menuitem != successor->parent) menuscreen_switch_item(successor->parent); /* this won't work for hidden subitems */ menu_select_subitem(active_menuitem, item->successor_id); menuitem_update_screen(active_menuitem, menuscreen); break; default: if ((successor->parent != NULL) && (successor->parent->type == MENUITEM_MENU)) { /* update parent menu too */ menu_select_subitem(successor->parent, successor->id); } menuscreen_switch_item(successor); break; } } void menuscreen_key_handler(const char *key) { MenuToken token = MENUTOKEN_NONE; MenuResult res; debug(RPT_DEBUG, "%s(\"%s\")", __FUNCTION__, key); if ((menu_key != NULL) && (strcmp(key, menu_key) == 0)) { token = MENUTOKEN_MENU; } else if ((enter_key != NULL) && (strcmp(key, enter_key) == 0)) { token = MENUTOKEN_ENTER; } else if ((up_key != NULL) && (strcmp(key, up_key) == 0)) { token = MENUTOKEN_UP; } else if ((down_key != NULL) && (strcmp(key, down_key) == 0)) { token = MENUTOKEN_DOWN; } else if ((left_key != NULL) && (strcmp(key, left_key) == 0)) { token = MENUTOKEN_LEFT; } else if ((right_key != NULL) && (strcmp(key, right_key) == 0)) { token = MENUTOKEN_RIGHT; } else { token = MENUTOKEN_OTHER; } /* Is the menu already active ? */ if (!active_menuitem) { debug(RPT_DEBUG, "%s: Activating menu screen", __FUNCTION__); menuscreen_switch_item(menuscreen_get_main()); return; } res = menuitem_process_input(active_menuitem, token, key, keymask); switch (res) { case MENURESULT_ERROR: report(RPT_ERR, "%s: Error from menuitem_process_input", __FUNCTION__); break; case MENURESULT_NONE: handle_none(); break; case MENURESULT_ENTER: handle_enter(); break; case MENURESULT_CLOSE: handle_close(); break; case MENURESULT_QUIT: handle_quit(); break; case MENURESULT_PREDECESSOR: handle_predecessor(); break; case MENURESULT_SUCCESSOR: handle_successor(); break; default: assert(!"unexpected menuresult"); break; } } void menuscreen_create_menu(void) { Menu *options_menu; Menu *driver_menu; MenuItem *checkbox; MenuItem *slider; Driver *driver; debug(RPT_DEBUG, "%s()", __FUNCTION__); main_menu = menu_create("mainmenu", NULL, "LCDproc Menu", NULL); if (main_menu == NULL) { report(RPT_ERR, "%s: Cannot create main menu", __FUNCTION__); return; } options_menu = menu_create("options", NULL, "Options", NULL); if (options_menu == NULL) { report(RPT_ERR, "%s: Cannot create options menu", __FUNCTION__); return; } menu_add_item(main_menu, options_menu); #ifdef LCDPROC_TESTMENUS /* * TODO: Menu items in the screens menu currently have no functions * assigned. Therefore only enable the menu for testing. If functions * are available, this code should be outside the #ifdef. */ screens_menu = menu_create("screens", NULL, "Screens", NULL); if (screens_menu == NULL) { report(RPT_ERR, "%s: Cannot create screens menu", __FUNCTION__); return; } menu_add_item(main_menu, screens_menu); menuscreen_create_testmenu(); #endif /* * add option menu contents: menu's client is NULL since we're in the * server */ checkbox = menuitem_create_checkbox("heartbeat", heartbeat_handler, "Heartbeat", NULL, true, heartbeat); menu_add_item(options_menu, checkbox); checkbox = menuitem_create_checkbox("backlight", backlight_handler, "Backlight", NULL, true, backlight); menu_add_item(options_menu, checkbox); slider = menuitem_create_slider("titlespeed", titlespeed_handler, "TitleSpeed", NULL, "0", "10", TITLESPEED_NO, TITLESPEED_MAX, 1, titlespeed); menu_add_item(options_menu, slider); /* * add driver specific option menus for each driver: menu's client is * NULL since we're in the server */ for (driver = drivers_getfirst(); driver; driver = drivers_getnext()) { int contrast_avail = (driver->get_contrast && driver->set_contrast) ? 1 : 0; int brightness_avail = (driver->get_brightness && driver->set_brightness) ? 1 : 0; if (contrast_avail || brightness_avail) { /* menu's client is NULL since we're in the server */ driver_menu = menu_create(driver->name, NULL, driver->name, NULL); if (driver_menu == NULL) { report(RPT_ERR, "%s: Cannot create menu for driver %s", __FUNCTION__, driver->name); continue; } menu_set_association(driver_menu, driver); menu_add_item(options_menu, driver_menu); if (contrast_avail) { int contrast = driver->get_contrast(driver); /* menu's client is NULL since we're in the server */ slider = menuitem_create_slider("contrast", contrast_handler, "Contrast", NULL, "min", "max", 0, 1000, 25, contrast); menu_add_item(driver_menu, slider); } if (brightness_avail) { int onbrightness = driver->get_brightness(driver, BACKLIGHT_ON); int offbrightness = driver->get_brightness(driver, BACKLIGHT_OFF); slider = menuitem_create_slider("onbrightness", brightness_handler, "On Brightness", NULL, "min", "max", 0, 1000, 25, onbrightness); menu_add_item(driver_menu, slider); slider = menuitem_create_slider("offbrightness", brightness_handler, "Off Brightness", NULL, "min", "max", 0, 1000, 25, offbrightness); menu_add_item(driver_menu, slider); } } } } #ifdef LCDPROC_TESTMENUS void menuscreen_create_testmenu(void) { MenuItem *test_item; Menu *test_menu; char testiso[] = { 'D', 'e', 'm', 'o', '\t', /* #160 */ 160, 161, 162, 163, 164, 165, 166, 167, '\t', 168, 169, 170, 171, 172, 173, 174, 175, '\t', 176, 177, 178, 179, 180, 181, 182, 183, '\t', 184, 185, 186, 187, 188, 189, 190, 191, '\t', /* #192 */ 192, 193, 194, 195, 196, 197, 198, 199, '\t', 200, 201, 202, 203, 204, 205, 206, 207, '\t', 208, 209, 210, 211, 212, 213, 214, 215, '\t', 216, 217, 218, 219, 220, 221, 222, 223, '\t', /* #224 */ 224, 225, 226, 227, 228, 229, 230, 231, '\t', 232, 233, 234, 235, 236, 237, 238, 239, '\t', 240, 241, 242, 243, 244, 245, 246, 247, '\t', 248, 249, 250, 251, 252, 253, 254, 255, '\0' }; test_menu = menu_create("test", NULL, "Test menu", NULL); if (test_menu == NULL) { report(RPT_ERR, "%s: Cannot create test menu", __FUNCTION__); return; } menu_add_item(main_menu, test_menu); /* menu's client is NULL since we're in the server */ test_item = menuitem_create_action("", NULL, "Action", NULL, MENURESULT_NONE); menu_add_item(test_menu, test_item); test_item = menuitem_create_action("", NULL, "Action,closing", NULL, MENURESULT_CLOSE); menu_add_item(test_menu, test_item); test_item = menuitem_create_action("", NULL, "Action,quitting", NULL, MENURESULT_QUIT); menu_add_item(test_menu, test_item); test_item = menuitem_create_checkbox("", NULL, "Checkbox", NULL, false, false); menu_add_item(test_menu, test_item); test_item = menuitem_create_checkbox("", NULL, "Checkbox, gray", NULL, true, false); menu_add_item(test_menu, test_item); test_item = menuitem_create_ring("", NULL, "Ring", NULL, "ABC\tDEF\t01234567890\tOr a very long string that will not fit on any display", 1); menu_add_item(test_menu, test_item); test_item = menuitem_create_slider("", NULL, "Slider", NULL, "mintext", "maxtext", -20, 20, 1, 0); menu_add_item(test_menu, test_item); test_item = menuitem_create_slider("", NULL, "Slider,step=5", NULL, "mintext", "maxtext", -20, 20, 5, 0); menu_add_item(test_menu, test_item); test_item = menuitem_create_numeric("", NULL, "Numeric", NULL, 1, 365, 15); menu_add_item(test_menu, test_item); test_item = menuitem_create_numeric("", NULL, "Numeric,signed", NULL, -20, +20, 15); menu_add_item(test_menu, test_item); test_item = menuitem_create_alpha("", NULL, "Alpha", NULL, 0, 3, 14, true, true, true, ".-+@", "LCDproc-v0.5.7"); menu_add_item(test_menu, test_item); test_item = menuitem_create_alpha("", NULL, "Alpha, caps only", NULL, 0, 3, 12, true, false, false, "-", "LCDPROC"); menu_add_item(test_menu, test_item); test_item = menuitem_create_ip("", NULL, "IPv4", NULL, false, "192.168.1.245"); menu_add_item(test_menu, test_item); test_item = menuitem_create_ip("", NULL, "IPv6", NULL, true, "1080:0:0:0:8:800:200C:417A"); menu_add_item(test_menu, test_item); test_item = menuitem_create_ring("", NULL, "Charset", NULL, testiso, 0); menu_add_item(test_menu, test_item); } #endif /* LCDPROC_TESTMENUS */ MenuEventFunc(heartbeat_handler) { debug(RPT_DEBUG, "%s(item=[%s], event=%d)", __FUNCTION__, ((item != NULL) ? item->id : "(null)"), event); if ((item != NULL) && (event == MENUEVENT_UPDATE)) { /* Set heartbeat setting */ heartbeat = item->data.checkbox.value; report(RPT_INFO, "Menu: set heartbeat to %d", heartbeat); } return 0; } MenuEventFunc(backlight_handler) { debug(RPT_DEBUG, "%s(item=[%s], event=%d)", __FUNCTION__, ((item != NULL) ? item->id : "(null)"), event); if ((item != NULL) && (event == MENUEVENT_UPDATE)) { /* Set backlight setting */ backlight = item->data.checkbox.value; report(RPT_INFO, "Menu: set backlight to %d", backlight); } return 0; } MenuEventFunc(titlespeed_handler) { debug(RPT_DEBUG, "%s(item=[%s], event=%d)", __FUNCTION__, ((item != NULL) ? item->id : "(null)"), event); if ((item != NULL) && ((event == MENUEVENT_MINUS) || (event == MENUEVENT_PLUS))) { /* set titlespeed setting */ titlespeed = item->data.slider.value; report(RPT_INFO, "Menu: set titlespeed to %d", titlespeed); } return 0; } MenuEventFunc(contrast_handler) { debug(RPT_DEBUG, "%s(item=[%s], event=%d)", __FUNCTION__, ((item != NULL) ? item->id : "(null)"), event); /* * This function can be called by one of several drivers that support * contrast */ if ((item != NULL) && ((event == MENUEVENT_MINUS) || (event == MENUEVENT_PLUS))) { /* Determine the driver by following the menu's association */ Driver *driver = item->parent->data.menu.association; if (driver != NULL) { driver->set_contrast(driver, item->data.slider.value); report(RPT_INFO, "Menu: set contrast of [%.40s] to %d", driver->name, item->data.slider.value); } } return 0; } MenuEventFunc(brightness_handler) { debug(RPT_DEBUG, "%s(item=[%s], event=%d)", __FUNCTION__, ((item != NULL) ? item->id : "(null)"), event); /* * This function can be called by one of several drivers that support * brightness ! */ if ((item != NULL) && ((event == MENUEVENT_MINUS) || (event == MENUEVENT_PLUS))) { /* Determine the driver by following the menu's association */ Driver *driver = item->parent->data.menu.association; if (driver != NULL) { if (strcmp(item->id, "onbrightness") == 0) { driver->set_brightness(driver, BACKLIGHT_ON, item->data.slider.value); } else if (strcmp(item->id, "offbrightness") == 0) { driver->set_brightness(driver, BACKLIGHT_OFF, item->data.slider.value); } } } return 0; } void menuscreen_add_screen(Screen *s) { Menu *m; MenuItem *mi; debug(RPT_DEBUG, "%s(s=[%s])", __FUNCTION__, ((s != NULL) ? s->id : "(null)")); /* screens have not been created or no screen given ... */ if ((screens_menu == NULL) || (s == NULL)) return; /* Create a menu entry for the screen */ m = menu_create(s->id, NULL, ((s->name != NULL) ? s->name : s->id), s->client); if (m == NULL) { report(RPT_ERR, "%s: Cannot create menu", __FUNCTION__); return; } menu_set_association(m, s); menu_add_item(screens_menu, m); /* And add some items for it... */ mi = menuitem_create_action("", NULL, "(don't work yet)", s->client, MENURESULT_NONE); menu_add_item(m, mi); mi = menuitem_create_action("", NULL, "To Front", s->client, MENURESULT_QUIT); menu_add_item(m, mi); mi = menuitem_create_checkbox("", NULL, "Visible", s->client, false, true); menu_add_item(m, mi); mi = menuitem_create_numeric("", NULL, "Duration", s->client, 2, 3600, s->duration); menu_add_item(m, mi); mi = menuitem_create_ring("", NULL, "Priority", s->client, "Hidden\tBackground\tForeground\tAlert\tInput", s->priority); menu_add_item(m, mi); } void menuscreen_remove_screen(Screen *s) { debug(RPT_DEBUG, "%s(s=[%s])", __FUNCTION__, (s != NULL) ? s->id : "(NULL)"); /* allow to remove the menuscreen itself */ if ((s == NULL) || (s == menuscreen)) return; if (screens_menu) { Menu *m = menu_find_item(screens_menu, s->id, false); menu_remove_item(screens_menu, m); menuitem_destroy(m); } } int menuscreen_goto(Menu * menu) { debug(RPT_DEBUG, "%s(m=[%s]): active_menuitem=[%s]", __FUNCTION__, (menu != NULL) ? menu->id : "(NULL)", (active_menuitem != NULL) ? active_menuitem->id : "(NULL)"); menuscreen_switch_item(menu); return 0; } /** sets custom main menu. Use NULL pointer to reset it to the "real" main * menu. */ int menuscreen_set_main(Menu * menu) { debug(RPT_DEBUG, "%s(m=[%s])", __FUNCTION__, (menu != NULL) ? menu->id : "(NULL)"); custom_main_menu = menu; return 0; } Menu * menuscreen_get_main(void) { return custom_main_menu ? custom_main_menu : main_menu; } lcdproc-0.5.7/server/menuscreens.h000644 001751 000000 00000002677 12014174064 017773 0ustar00mmdolzewheel000000 000000 /** \file server/menuscreens.h * Creates all menuscreens, menus and handles the keypresses for the * menuscreens. */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven * 2003, Joris Robijn */ #ifndef MENUSCREENS_H #define MENUSCREENS_H #include "menu.h" #include "screen.h" extern Screen *menuscreen; extern Menu *main_menu; int menuscreens_init(void); int menuscreens_shutdown(void); /** This function indicates to the input part whether this key was the * reserved menu key. */ bool is_menu_key(const char *key); /** Meant for other parts of the program to inform the menuscreen that the * item is about to be removed. */ void menuscreen_inform_item_destruction(MenuItem *item); /** Meant for other parts of the program to inform the menuscreen that some * properties of the item have been modified. */ void menuscreen_inform_item_modified(MenuItem *item); /** This handler handles the keypresses for the menu. */ void menuscreen_key_handler(const char *key); /** Adds a menu for the given screen */ void menuscreen_add_screen(Screen *s); /** Removes the menu of the given screen */ void menuscreen_remove_screen(Screen *s); /** switches to menu. */ int menuscreen_goto(Menu *menu); /** sets custom_main_menu. */ int menuscreen_set_main(Menu *menu); #endif lcdproc-0.5.7/server/parse.c000644 001751 000000 00000012665 11621737634 016562 0ustar00mmdolzewheel000000 000000 /** \file server/parse.c * Handles input commands from clients, by splitting strings into tokens * and passing arguments to the appropriate handler. * * It works much like a command line. Only the first token is used to * determine what function to call. */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven * 2008, Peter Marschall */ #include #include #include #include "shared/LL.h" #include "shared/sockets.h" #include "shared/report.h" #include "clients.h" #include "commands/command_list.h" #include "parse.h" #include "sock.h" #define MAX_ARGUMENTS 40 static inline int is_whitespace(char x) { return ((x == ' ') || (x == '\t') || (x == '\r')); } static inline int is_final(char x) { return ((x == '\n') || (x == '\0')); } static inline int is_opening_quote(char x, char q) { return ((q == '\0') && ((x == '\"') || (x == '{'))); } static inline int is_closing_quote(char x, char q) { return (((q == '{') && (x == '}')) || ((q == '\"') && (x == '\"'))); } static int parse_message(const char *str, Client *c) { typedef enum { ST_INITIAL, ST_WHITESPACE, ST_ARGUMENT, ST_FINAL } State; State state = ST_INITIAL; int error = 0; char quote = '\0'; /* The quote used to open a quote string */ int pos = 0; char *arg_space; int argc = 0; char *argv[MAX_ARGUMENTS]; int argpos = 0; CommandFunc function = NULL; debug(RPT_DEBUG, "%s(str=\"%.120s\", client=[%d])", __FUNCTION__, str, c->sock); /* We will create a list of strings that is shorter or equally long as * the original string str. */ arg_space = malloc(strlen(str)+1); if (arg_space == NULL) { report(RPT_ERR, "%s: Could not allocate memory", __FUNCTION__); sock_send_error(c->sock, "error allocating memory!\n"); } argv[0] = arg_space; while ((state != ST_FINAL) && !error) { char ch = str[pos++]; switch (state) { case ST_INITIAL: case ST_WHITESPACE: if (is_whitespace(ch)) break; if (is_final(ch)) { state = ST_FINAL; break; } /* otherwise fall through */ state = ST_ARGUMENT; case ST_ARGUMENT: if (is_final(ch)) { if (quote) error = 2; if (argc >= MAX_ARGUMENTS-1) { error = 1; } else { argv[argc][argpos] = '\0'; argv[argc+1] = argv[argc] + argpos + 1; argc++; argpos = 0; } state = ST_FINAL; } else if (ch == '\\') { if (str[pos]) { /* We solve quoted chars here right away */ const char escape_chars[] = "nrt"; const char escape_trans[] = "\n\r\t"; char *p = strchr(escape_chars, str[pos]); /* Is it wise to have the characters \n, \r & \t expanded ? * Can the displays deal with them ? */ if (p != NULL) { /* Insert a replacement for the code */ argv[argc][argpos++] = escape_trans[p - escape_chars]; } else { /* Copy char literally */ argv[argc][argpos++] = str[pos]; } pos++; } else { error = 2; /* alternative: argv[argc][argpos++] = ch; */ if (argc >= MAX_ARGUMENTS-1) { error = 1; } else { argv[argc][argpos] = '\0'; argv[argc+1] = argv[argc] + argpos + 1; argc++; argpos = 0; } state = ST_FINAL; } } else if (is_opening_quote(ch, quote)) { quote = ch; } else if (is_closing_quote(ch, quote)) { quote = '\0'; if (argc >= MAX_ARGUMENTS-1) { error = 1; } else { argv[argc][argpos] = '\0'; argv[argc+1] = argv[argc] + argpos + 1; argc++; argpos = 0; } state = ST_WHITESPACE; } else if (is_whitespace(ch) && (quote == '\0')) { if (argc >= MAX_ARGUMENTS-1) { error = 1; } else { argv[argc][argpos] = '\0'; argv[argc+1] = argv[argc] + argpos + 1; argc++; argpos = 0; } state = ST_WHITESPACE; } else { argv[argc][argpos++] = ch; } break; case ST_FINAL: /* This will never be reached */ break; } } if (argc < MAX_ARGUMENTS) argv[argc] = NULL; else error = 1; if (error) { sock_send_error(c->sock, "Could not parse command\n"); free(arg_space); return 0; } #if 0 /* show what we have parsed */ int i; for (i = 0; i < argc; i++) { printf("%s%c", argv[i], (i == argc-1) ? '\n' : ' '); } #endif /* Now find and call the appropriate function...*/ function = get_command_function(argv[0]); if (function != NULL) { error = function(c, argc, argv); if (error) { sock_printf_error(c->sock, "Function returned error \"%.40s\"\n", argv[0]); report(RPT_WARNING, "Command function returned an error after command from client on socket %d: %.40s", c->sock, str); } } else { sock_printf_error(c->sock, "Invalid command \"%.40s\"\n", argv[0]); report(RPT_WARNING, "Invalid command from client on socket %d: %.40s", c->sock, str); } free(arg_space); return 0; } int parse_all_client_messages(void) { Client *c; debug(RPT_DEBUG, "%s()", __FUNCTION__); for (c = clients_getfirst(); c != NULL; c = clients_getnext()) { char *str; /* And parse all its messages...*/ /*debug(RPT_DEBUG, "parse: Getting messages...");*/ for (str = client_get_message(c); str != NULL; str = client_get_message(c)) { parse_message(str, c); free(str); if (c->state == GONE) { sock_destroy_client_socket(c); break; } } } return 0; } lcdproc-0.5.7/server/parse.h000644 001751 000000 00000000610 11621737634 016552 0ustar00mmdolzewheel000000 000000 /** \file server/parse.h */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven */ #ifndef PARSE_H #define PARSE_H // This should be pretty self-explanatory... int parse_all_client_messages(void); #endif lcdproc-0.5.7/server/render.c000644 001751 000000 00000046650 12313532720 016714 0ustar00mmdolzewheel000000 000000 /** \file server/render.c * This file contains code that actually generates the full screen data to * send to the LCD. render_screen() takes a screen definition and calls * render_frame() which in turn builds the screen according to the definition. * It may recursively call itself (for nested frames). * * This needs to be greatly expanded and redone for greater flexibility. * For example, it should support multiple screen sizes, more flexible * widgets, and multiple simultaneous screens. * * This will probably take a while to do. :( * * THIS FILE IS MESSY! Anyone care to rewrite it nicely? Please?? :) * * NOTE: (from David Douthitt) Multiple screen sizes? Multiple simultaneous * screens? Horrors of horrors... next thing you know it'll be making coffee... * Better believe it'll take a while to do... * * \todo Review render_string for correctness. */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven * 2001, Joris Robijn * 2007, Peter Marschall */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include "shared/report.h" #include "shared/LL.h" #include "shared/defines.h" #include "drivers.h" #include "screen.h" #include "screenlist.h" #include "widget.h" #include "render.h" #define BUFSIZE 1024 /* larger than display width => large enough */ int heartbeat = HEARTBEAT_OPEN; static int heartbeat_fallback = HEARTBEAT_ON; /* If no heartbeat setting has been set at all */ int backlight = BACKLIGHT_OPEN; static int backlight_fallback = BACKLIGHT_ON; /* If no backlight setting has been set at all */ int titlespeed = 1; int output_state = 0; char *server_msg_text; int server_msg_expire = 0; static int render_frame(LinkedList *list, int left, int top, int right, int bottom, int fwid, int fhgt, char fscroll, int fspeed, long timer); static int render_string(Widget *w, int left, int top, int right, int bottom, int fy); static int render_hbar(Widget *w, int left, int top, int right, int bottom, int fy); static int render_vbar(Widget *w, int left, int top, int right, int bottom); static int render_title(Widget *w, int left, int top, int right, int bottom, long timer); static int render_scroller(Widget *w, int left, int top, int right, int bottom, long timer); static int render_num(Widget *w, int left, int top, int right, int bottom); /** * Renders a screen. The following actions are taken in order: * * \li Clear the screen. * \li Set the backlight. * \li Set out-of-band data (output). * \li Render the frame contents. * \li Set the cursor. * \li Draw the heartbeat. * \li Show any server message. * \li Flush all output to screen. * * \param s The screen to render. * \param timer A value increased with every call. * \return -1 on error, 0 on success. */ int render_screen(Screen *s, long timer) { int tmp_state = 0; debug(RPT_DEBUG, "%s(screen=[%.40s], timer=%ld) ==== START RENDERING ====", __FUNCTION__, s->id, timer); if (s == NULL) return -1; /* 1. Clear the LCD screen... */ drivers_clear(); /* 2. Set up the backlight */ /*- * 2.1: * First we find out who has set the backlight: * a) the screen, * b) the client, or * c) the server core * with the latter taking precedence over the earlier. If the * backlight is not set on/off then use the fallback (set it ON). */ if (backlight != BACKLIGHT_OPEN) { tmp_state = backlight; } else if ((s->client != NULL) && (s->client->backlight != BACKLIGHT_OPEN)) { tmp_state = s->client->backlight; } else if (s->backlight != BACKLIGHT_OPEN) { tmp_state = s->backlight; } else { tmp_state = backlight_fallback; } /*- * 2.2: * If one of the backlight options (FLASH or BLINK) has been set turn * it on/off based on a timed algorithm. */ /* NOTE: dirty stripping of other options... */ /* Backlight flash: check timer and flip backlight as appropriate */ if (tmp_state & BACKLIGHT_FLASH) { drivers_backlight( ( (tmp_state & BACKLIGHT_ON) ^ ((timer & 7) == 7) ) ? BACKLIGHT_ON : BACKLIGHT_OFF); } /* Backlight blink: check timer and flip backlight as appropriate */ else if (tmp_state & BACKLIGHT_BLINK) { drivers_backlight( ( (tmp_state & BACKLIGHT_ON) ^ ((timer & 14) == 14) ) ? BACKLIGHT_ON : BACKLIGHT_OFF); } else { /* Simple: Only send lowest bit then... */ drivers_backlight(tmp_state & BACKLIGHT_ON); } /* 3. Output ports from LCD - outputs depend on the current screen */ drivers_output(output_state); /* 4. Draw a frame... */ render_frame(s->widgetlist, 0, 0, display_props->width, display_props->height, s->width, s->height, 'v', max(s->duration / s->height, 1), timer); /* 5. Set the cursor */ drivers_cursor(s->cursor_x, s->cursor_y, s->cursor); /* 6. Set the heartbeat */ if (heartbeat != HEARTBEAT_OPEN) { tmp_state = heartbeat; } else if ((s->client != NULL) && (s->client->heartbeat != HEARTBEAT_OPEN)) { tmp_state = s->client->heartbeat; } else if (s->heartbeat != HEARTBEAT_OPEN) { tmp_state = s->heartbeat; } else { tmp_state = heartbeat_fallback; } drivers_heartbeat(tmp_state); /* 7. If there is an server message that is not expired, display it */ if (server_msg_expire > 0) { drivers_string(display_props->width - strlen(server_msg_text) + 1, display_props->height, server_msg_text); server_msg_expire--; if (server_msg_expire == 0) { free(server_msg_text); } } /* 8. Flush display out, frame and all... */ drivers_flush(); debug(RPT_DEBUG, "==== END RENDERING ===="); return 0; } /* The following function is positively ghastly (as was mentioned above!) */ /* Best thing to do is to remove support for frames... but anyway... */ /* */ static int render_frame(LinkedList *list, int left, /* left edge of frame */ int top, /* top edge of frame */ int right, /* right edge of frame */ int bottom, /* bottom edge of frame */ int fwid, /* frame width? */ int fhgt, /* frame height? */ char fscroll, /* direction of scrolling */ int fspeed, /* speed of scrolling... */ long timer) /* current timer tick */ { int fy = 0; /* Scrolling offset for the frame... */ debug(RPT_DEBUG, "%s(list=%p, left=%d, top=%d, " "right=%d, bottom=%d, fwid=%d, fhgt=%d, " "fscroll='%c', fspeed=%d, timer=%ld)", __FUNCTION__, list, left, top, right, bottom, fwid, fhgt, fscroll, fspeed, timer); /* return on no data or illegal height */ if ((list == NULL) || (fhgt <= 0)) return -1; if (fscroll == 'v') { /* vertical scrolling */ // only set offset !=0 when fspeed is != 0 and there is something to scroll if ((fspeed != 0) && (fhgt > bottom - top)) { int fy_max = fhgt - (bottom - top) + 1; fy = (fspeed > 0) ? (timer / fspeed) % fy_max : (-fspeed * timer) % fy_max; fy = max(fy, 0); // safeguard against negative values debug(RPT_DEBUG, "%s: fy=%d", __FUNCTION__, fy); } } else if (fscroll == 'h') { /* horizontal scrolling */ /* TODO: Frames don't scroll horizontally yet! */ } /* reset widget list */ LL_Rewind(list); /* loop over all widgets */ do { Widget *w = (Widget *) LL_Get(list); if (w == NULL) return -1; /* TODO: Make this cleaner and more flexible! */ switch (w->type) { case WID_STRING: render_string(w, left, top - fy, right, bottom, fy); break; case WID_HBAR: render_hbar(w, left, top - fy, right, bottom, fy); break; case WID_VBAR: /* FIXME: Vbars don't work in frames! */ render_vbar(w, left, top, right, bottom); break; case WID_ICON: /* FIXME: Icons don't work in frames! */ drivers_icon(w->x, w->y, w->length); break; case WID_TITLE: /* FIXME: Doesn't work quite right in frames... */ render_title(w, left, top, right, bottom, timer); break; case WID_SCROLLER: /* FIXME: doesn't work in frames... */ render_scroller(w, left, top, right, bottom, timer); break; case WID_FRAME: { /* FIXME: doesn't handle nested frames quite right! * doesn't handle scrolling in nested frames at all... */ int new_left = left + w->left - 1; int new_top = top + w->top - 1; int new_right = min(left + w->right, right); int new_bottom = min(top + w->bottom, bottom); if ((new_left < right) && (new_top < bottom)) /* Render only if it's visible... */ render_frame(w->frame_screen->widgetlist, new_left, new_top, new_right, new_bottom, w->width, w->height, w->length, w->speed, timer); } break; case WID_NUM: /* FIXME: doesn't work in frames... */ /* NOTE: y=10 means COLON (:) */ if ((w->x > 0) && (w->y >= 0) && (w->y <= 10)) { drivers_num(w->x + left, w->y); } break; case WID_NONE: /* FALLTHROUGH */ default: break; } } while (LL_Next(list) == 0); return 0; } static int render_string(Widget *w, int left, int top, int right, int bottom, int fy) { debug(RPT_DEBUG, "%s(w=%p, left=%d, top=%d, right=%d, bottom=%d, fy=%d)", __FUNCTION__, w, left, top, right, bottom, fy); if ((w != NULL) && (w->text != NULL) && (w->x > 0) && (w->y > 0) && (w->y > fy) && (w->y <= bottom - top)) { int length; char str[BUFSIZE]; /* * FIXME: Could be a bug here? w->x is recalculated (On first * call only? Is it preserved between calls?) and first * character of w->text shows up on the rightmost column for * strings totally off-screen. Is this on purpose? (M. Dolze) */ w->x = min(w->x, right - left); length = min(right - left - w->x + 1, sizeof(str)-1); strncpy(str, w->text, length); str[length] = '\0'; drivers_string(w->x + left, w->y + top, str); } return 0; } static int render_hbar(Widget *w, int left, int top, int right, int bottom, int fy) { debug(RPT_DEBUG, "%s(w=%p, left=%d, top=%d, right=%d, bottom=%d, fy=%d)", __FUNCTION__, w, left, top, right, bottom, fy); if ((w != NULL) && (w->x > 0) && (w->y > 0) && (w->y > fy) && (w->y <= bottom - top)) { if (w->length > 0) { int full_len = display_props->width - w->x - left + 1; int promille = 1000; if ((w->length / display_props->cellwidth) < right - left - w->x + 1) promille = (long) 1000 * w->length / (display_props->cellwidth * full_len); drivers_hbar(w->x + left, w->y + top, full_len, promille, BAR_PATTERN_FILLED); } else if (w->length < 0) { /* TODO: Rearrange stuff to get left-extending * hbars to draw correctly... * .. er, this'll require driver modifications, * so I'll leave it out for now. */ } } return 0; } static int render_vbar(Widget *w, int left, int top, int right, int bottom) { debug(RPT_DEBUG, "%s(w=%p, left=%d, top=%d, right=%d, bottom=%d)", __FUNCTION__, w, left, top, right, bottom); if ((w != NULL) && (w->x > 0) && (w->y > 0)) { if (w->length > 0) { int full_len = display_props->height; int promille = (long) 1000 * w->length / (display_props->cellheight * full_len); drivers_vbar(w->x + left, w->y + top, full_len, promille, BAR_PATTERN_FILLED); } else if (w->length < 0) { /* TODO: Rearrange stuff to get down-extending * vbars to draw correctly... * .. er, this'll require driver modifications, * so I'll leave it out for now. */ } } return 0; } static int render_title(Widget *w, int left, int top, int right, int bottom, long timer) { int vis_width = right - left; debug(RPT_DEBUG, "%s(w=%p, left=%d, top=%d, right=%d, bottom=%d, timer=%ld)", __FUNCTION__, w, left, top, right, bottom, timer); if ((w != NULL) && (w->text != NULL) && (vis_width >= 8)) { char str[BUFSIZE]; int length = strlen(w->text); int width = vis_width - 6; int x; /* calculate delay from titlespeed: <=0 -> 0, [1 - infty] -> [10 - 1] */ int delay = (titlespeed <= TITLESPEED_NO) ? TITLESPEED_NO : max(TITLESPEED_MIN, TITLESPEED_MAX - titlespeed); /* display leading fillers */ drivers_icon(w->x + left, w->y + top, ICON_BLOCK_FILLED); drivers_icon(w->x + left + 1, w->y + top, ICON_BLOCK_FILLED); length = min(length, sizeof(str)-1); if ((length <= width) || (delay == 0)) { /* copy test starting from the beginning */ length = min(length, width); strncpy(str, w->text, length); str[length] = '\0'; /* set x value for trailing fillers */ x = length + 4; } else { /* Scroll the title, if it doesn't fit... */ int offset = timer; int reverse; /* if the delay is "too large" increase cycle length */ if ((delay != 0) && (delay < length / (length - width))) offset /= delay; /* reverse direction every length ticks */ reverse = (offset / length) & 1; /* restrict offset to cycle length */ offset %= length; offset = max(offset, 0); /* if the delay is "low enough" slow down as requested */ if ((delay != 0) && (delay >= length / (length - width))) offset /= delay; /* restrict offset to the max. allowed offset: length - width */ offset = min(offset, length - width); /* scroll backward by mirroring offset at max. offset */ if (reverse) offset = (length - width) - offset; /* copy test starting from offset */ length = min(width, sizeof(str)-1); strncpy(str, w->text + offset, length); str[length] = '\0'; /* set x value for trailing fillers */ x = vis_width - 2; } /* display text */ drivers_string(w->x + 3 + left, w->y + top, str); /* display trailing fillers */ for ( ; x < vis_width; x++) { drivers_icon(w->x + x + left, w->y + top, ICON_BLOCK_FILLED); } } return 0; } static int render_scroller(Widget *w, int left, int top, int right, int bottom, long timer) { debug(RPT_DEBUG, "%s(w=%p, left=%d, top=%d, right=%d, bottom=%d, timer=%ld)", __FUNCTION__, w, left, top, right, bottom, timer); if ((w->text != NULL) && (w->right >= w->left)) { char str[BUFSIZE]; int length; int offset; int screen_width; /*debug(RPT_DEBUG, "%s: %s %d",__FUNCTION__,w->text,timer);*/ screen_width = abs(w->right - w->left + 1); screen_width = min(screen_width, sizeof(str)-1); switch (w->length) { /* actually, direction... */ case 'm': // Marquee length = strlen(w->text); if (length <= screen_width) { /* it fits within the box, just render it */ drivers_string(w->left, w->top, w->text); } else { int necessaryTimeUnits = 0; if (w->speed > 0) { necessaryTimeUnits = length * w->speed; offset = (timer % necessaryTimeUnits) / w->speed; } else if (w->speed < 0) { necessaryTimeUnits = length / (w->speed * -1); offset = (timer % necessaryTimeUnits) * w->speed * -1; } else { offset = 0; } if (offset <= length) { int room = screen_width - (length - offset); strncpy(str, &w->text[offset], screen_width); // if there's more room, restart at the beginning if (room > 0) { strncat(str, w->text, room); } str[screen_width] = '\0'; /*debug(RPT_DEBUG, "scroller %s : %d", str, length-offset);*/ } else { str[0] = '\0'; } drivers_string(w->left, w->top, str); } break; case 'h': length = strlen(w->text) + 1; if (length <= screen_width) { /* it fits within the box, just render it */ drivers_string(w->left, w->top, w->text); } else { int effLength = length - screen_width; int necessaryTimeUnits = 0; if (w->speed > 0) { necessaryTimeUnits = effLength * w->speed; if (((timer / necessaryTimeUnits) % 2) == 0) { /* wiggle one way */ offset = (timer % (effLength * w->speed)) / w->speed; } else { /* wiggle the other */ offset = (((timer % (effLength * w->speed)) - (effLength * w->speed) + 1) / w->speed) * -1; } } else if (w->speed < 0) { necessaryTimeUnits = effLength / (w->speed * -1); if (((timer / necessaryTimeUnits) % 2) == 0) { offset = (timer % (effLength / (w->speed * -1))) * w->speed * -1; } else { offset = (((timer % (effLength / (w->speed * -1))) * w->speed * -1) - effLength + 1) * -1; } } else { offset = 0; } if (offset <= length) { strncpy(str, &((w->text)[offset]), screen_width); str[screen_width] = '\0'; /*debug(RPT_DEBUG, "scroller %s : %d", str, length-offset); */ } else { str[0] = '\0'; } drivers_string(w->left, w->top, str); } break; /* FIXME: Vert scrollers don't always seem to scroll */ /* back up after hitting the bottom. They jump back to */ /* the top instead... (nevermind?) */ case 'v': length = strlen(w->text); if (length <= screen_width) { /* no scrolling required... */ drivers_string(w->left, w->top, w->text); } else { int lines_required = (length / screen_width) + (length % screen_width ? 1 : 0); int available_lines = (w->bottom - w->top + 1); if (lines_required <= available_lines) { /* easy... */ int i; for (i = 0; i < lines_required; i++) { strncpy(str, &((w->text)[i * screen_width]), screen_width); str[screen_width] = '\0'; drivers_string(w->left, w->top + i, str); } } else { int necessaryTimeUnits = 0; int effLines = lines_required - available_lines + 1; int begin = 0; int i = 0; /*debug(RPT_DEBUG, "length: %d sw: %d lines req: %d avail lines: %d effLines: %d ",length,screen_width,lines_required,available_lines,effLines);*/ if (w->speed > 0) { necessaryTimeUnits = effLines * w->speed; if (((timer / necessaryTimeUnits) % 2) == 0) { /*debug(RPT_DEBUG, "up ");*/ begin = (timer % (necessaryTimeUnits)) / w->speed; } else { /*debug(RPT_DEBUG, "down ");*/ begin = (((timer % necessaryTimeUnits) - necessaryTimeUnits + 1) / w->speed) * -1; } } else if (w->speed < 0) { necessaryTimeUnits = effLines / (w->speed * -1); if (((timer / necessaryTimeUnits) % 2) == 0) { begin = (timer % necessaryTimeUnits) * w->speed * -1; } else { begin = (((timer % necessaryTimeUnits) * w->speed * -1) - effLines + 1) * -1; } } else { begin = 0; } /*debug(RPT_DEBUG, "rendering begin: %d timer: %d effLines: %d",begin,timer,effLines); */ for (i = begin; i < begin + available_lines; i++) { strncpy(str, &((w->text)[i * (screen_width)]), screen_width); str[screen_width] = '\0'; /*debug(RPT_DEBUG, "rendering: '%s' of %s", */ /*str,w->text); */ drivers_string(w->left, w->top + (i - begin), str); } } } break; } } return 0; } static int render_num(Widget *w, int left, int top, int right, int bottom) { debug(RPT_DEBUG, "%s(w=%p, left=%d, top=%d, right=%d, bottom=%d)", __FUNCTION__, w, left, top, right, bottom); /* NOTE: y=10 means COLON (:) */ if ((w != NULL) && (w->x > 0) && (w->y >= 0) && (w->y <= 10)) { drivers_num(w->x + left, w->y); } return 0; } int server_msg(const char *text, int expire) { debug(RPT_DEBUG, "%s(text=\"%.40s\", expire=%d)", __FUNCTION__, text, expire); if (strlen(text) > 15 || expire <= 0) { return -1; } /* Still a message active ? */ if (server_msg_expire > 0) { free(server_msg_text); } /* Store new message */ server_msg_text = malloc(strlen(text) + 3); strcpy(server_msg_text, "| "); strcat(server_msg_text, text); server_msg_expire = expire; return 0; } lcdproc-0.5.7/server/render.h000644 001751 000000 00000002016 12014174064 016706 0ustar00mmdolzewheel000000 000000 /** \file server/render.h */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven */ #ifndef RENDER_H #define RENDER_H #define HEARTBEAT_OFF 0 #define HEARTBEAT_ON 1 #define HEARTBEAT_OPEN 2 #define BACKLIGHT_OFF 0 #define BACKLIGHT_ON 1 #define BACKLIGHT_OPEN 2 #define BACKLIGHT_BLINK 0x100 #define BACKLIGHT_FLASH 0x200 #define CURSOR_OFF 0 #define CURSOR_DEFAULT_ON 1 #define CURSOR_BLOCK 4 #define CURSOR_UNDER 5 #define TITLESPEED_NO 0 /* needs to be (TITLESPEED_MIN - 1) */ #define TITLESPEED_MIN 1 #define TITLESPEED_MAX 10 extern int heartbeat; extern int backlight; extern int titlespeed; extern int output_state; /* Render the given screen. */ int render_screen(Screen *s, long timer); /* Display a short message, which must be shorter than 16 chars, in a corner */ int server_msg(const char *text, int expire); #endif lcdproc-0.5.7/server/screen.c000644 001751 000000 00000012104 12014174064 016700 0ustar00mmdolzewheel000000 000000 /** \file server/screen.c * This file stores all the screen definition-handling code. Functions here * provide means to create new screens and destroy existing ones. Screens are * identified by client and by the client's own identifiers for screens. */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven * 2003, Joris Robijn * 2008, Peter Marschall */ #include #include #include #include "shared/report.h" #include "drivers.h" #include "clients.h" #include "widget.h" #include "screenlist.h" #include "menuscreens.h" #include "main.h" #include "render.h" int default_duration = 0; int default_timeout = -1; char *pri_names[] = { "hidden", "background", "info", "foreground", "alert", "input", NULL, }; /** Create a screen. * \param id Screen id; it's name. * \param client Client, the screen belongs to. * \return Pointer to freshly created screen. */ Screen * screen_create(char *id, Client *client) { Screen *s; debug(RPT_DEBUG, "%s(id=\"%.40s\", client=[%d])", __FUNCTION__, id, (client?client->sock:-1)); if (!id) { report(RPT_ERR, "%s: Need id string", __FUNCTION__); return NULL; } /* Client can be NULL for serverscreens and other client-less screens */ s = malloc(sizeof(Screen)); if (s == NULL) { report(RPT_ERR, "%s: Error allocating", __FUNCTION__); return NULL; } s->id = strdup(id); if (s->id == NULL) { report(RPT_ERR, "%s: Error allocating", __FUNCTION__); free(s); return NULL; } s->name = NULL; s->priority = PRI_INFO; s->duration = default_duration; s->backlight = BACKLIGHT_OPEN; s->heartbeat = HEARTBEAT_OPEN; s->width = display_props->width; s->height = display_props->height; s->keys = NULL; s->client = client; s->widgetlist = NULL; s->timeout = default_timeout; /*ignored unless greater than 0.*/ s->backlight = BACKLIGHT_OPEN; /*Lets the screen do it's own*/ /*or do what the client says.*/ s->cursor = CURSOR_OFF; s->cursor_x = 1; s->cursor_y = 1; s->widgetlist = LL_new(); if (s->widgetlist == NULL) { report(RPT_ERR, "%s: Error allocating", __FUNCTION__); free(s->id); free(s); return NULL; } menuscreen_add_screen(s); return s; } /** Destroy a screen. * \param s Screen to destroy. * \retval <0 Error; no screen given. * \retval 0 Success. */ int screen_destroy(Screen *s) { Widget *w; debug(RPT_DEBUG, "%s(s=[%.40s])", __FUNCTION__, s->id); menuscreen_remove_screen(s); screenlist_remove(s); for (w = LL_GetFirst(s->widgetlist); w; w = LL_GetNext(s->widgetlist)) { /* Free a widget...*/ widget_destroy(w); } LL_Destroy(s->widgetlist); s->widgetlist = NULL; if (s->id != NULL) { free(s->id); s->id = NULL; } if (s->name != NULL) { free(s->name); s->name = NULL; } free(s); s = NULL; return 0; } /** Add a widget to a screen. * \param s Screen to add the widget \c w to. * \param w Widget to be added to \c s. * \retval <0 Error. * \retval 0 Success. */ int screen_add_widget(Screen *s, Widget *w) { debug(RPT_DEBUG, "%s(s=[%.40s], widget=[%.40s])", __FUNCTION__, s->id, w->id); LL_Push(s->widgetlist, (void *) w); return 0; } /** Remove a widget from a screen. * \param s Screen to remove the widget \c w from. * \param w Widget to be removed from \c s. * \retval <0 Error. * \retval 0 Success. */ int screen_remove_widget(Screen *s, Widget *w) { debug(RPT_DEBUG, "%s(s=[%.40s], widget=[%.40s])", __FUNCTION__, s->id, w->id); LL_Remove(s->widgetlist, (void *) w, NEXT); return 0; } /** Find a widget on a screen by its id. * \param s Screen where to look for the widget. * \param id Identifier of the widget. * \return Pointerr to the widget; \c NULL if widget was not found or error. */ Widget * screen_find_widget(Screen *s, char *id) { Widget *w; if (!s) return NULL; if (!id) return NULL; debug(RPT_DEBUG, "%s(s=[%.40s], id=\"%.40s\")", __FUNCTION__, s->id, id); for (w = LL_GetFirst(s->widgetlist); w != NULL; w = LL_GetNext(s->widgetlist)) { if (0 == strcmp(w->id, id)) { debug(RPT_DEBUG, "%s: Found %s", __FUNCTION__, id); return w; } /* Search subscreens recursively */ if (w->type == WID_FRAME) { w = widget_search_subs(w, id); if (w != NULL) return w; } } debug(RPT_DEBUG, "%s: Not found", __FUNCTION__); return NULL; } /** Convert a priority name to the priority id. * \param priname Name of the screen priority. * \return Priority id associated with \c priname, -1 if no matching priority * id could be found. */ Priority screen_pri_name_to_pri(char *priname) { Priority pri = -1; int i; for (i = 0; pri_names[i]; i++) { if (strcmp(pri_names[i], priname) == 0) { pri = i; break; /* it's valid: skip out...*/ } } return pri; } /** Convert a priority id to the associated name. * \param pri Priority id. * \return Priority name associated with \c pri. */ char * screen_pri_to_pri_name(Priority pri) { return pri_names[pri]; } lcdproc-0.5.7/server/screen.h000644 001751 000000 00000004365 12014174064 016717 0ustar00mmdolzewheel000000 000000 /** \file server/screen.h * Public interface to the screen management methods. * * \note If you only need 'struct Screen' to work with, you should use the * following code (which does not create an indirect dependency on * 'struct Widget'): * * \code * #define INC_TYPES_ONLY 1 * #include "screen.h" * #undef INC_TYPES_ONLY * \endcode */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven * 2003, Joris Robijn */ #ifndef SCREEN_H_TYPES #define SCREEN_H_TYPES #include "shared/LL.h" #ifdef INC_TYPES_ONLY # include "client.h" #else # define INC_TYPES_ONLY 1 # include "client.h" # undef INC_TYPES_ONLY #endif typedef enum { PRI_HIDDEN, PRI_BACKGROUND, PRI_INFO, PRI_FOREGROUND, PRI_ALERT, PRI_INPUT } Priority; typedef struct Screen { char *id; char *name; int width, height; int duration; int timeout; Priority priority; short int heartbeat; short int backlight; short int cursor; short int cursor_x; short int cursor_y; char *keys; LinkedList *widgetlist; struct Client *client; } Screen; extern int default_duration ; extern int default_priority ; #endif #ifndef INC_TYPES_ONLY #ifndef SCREEN_H_FNCS #define SCREEN_H_FNCS #define INC_TYPES_ONLY 1 #include "widget.h" #undef INC_TYPES_ONLY /* Creates a new screen */ Screen *screen_create(char *id, Client *client); /* Destroys a screen */ int screen_destroy(Screen *s); /* Add a widget to a screen */ int screen_add_widget(Screen *s, Widget *w); /* Remove a widget from a screen (does not destroy it) */ int screen_remove_widget(Screen *s, Widget *w); /* List functions */ static inline Widget *screen_getfirst_widget(Screen *s) { return (Widget *) ((s != NULL) ? LL_GetFirst(s->widgetlist) : NULL); } static inline Widget *screen_getnext_widget(Screen *s) { return (Widget *) ((s != NULL) ? LL_GetNext(s->widgetlist) : NULL); } /* Find a widget in a screen */ Widget *screen_find_widget(Screen *s, char *id); /* Convert priority names to priority and vv */ Priority screen_pri_name_to_pri(char *pri_name); char *screen_pri_to_pri_name(Priority pri); #endif #endif lcdproc-0.5.7/server/screenlist.c000644 001751 000000 00000013656 12014174064 017611 0ustar00mmdolzewheel000000 000000 /** \file server/screenlist.c * All actions that can be performed on the list of screens. * This file also manages the rotation of screens. */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven * 2003, Joris Robijn */ #include #include #include "shared/LL.h" #include "shared/sockets.h" #include "shared/report.h" #include "client.h" #include "screen.h" #include "screenlist.h" #include "main.h" /* for timer */ /* Local functions */ int compare_priority(void *one, void *two); bool autorotate = UNSET_INT; /* If on, INFO and FOREGROUND screens will rotate */ LinkedList *screenlist = NULL; Screen *current_screen = NULL; long int current_screen_start_time = 0; int screenlist_init(void) { report(RPT_DEBUG, "%s()", __FUNCTION__); screenlist = LL_new(); if (!screenlist) { report(RPT_ERR, "%s: Error allocating", __FUNCTION__); return -1; } return 0; } int screenlist_shutdown(void) { report(RPT_DEBUG, "%s()", __FUNCTION__); if (!screenlist) { /* Program shutdown before completed startup */ return -1; } LL_Destroy(screenlist); return 0; } int screenlist_add(Screen *s) { if (!screenlist) return -1; return LL_Push(screenlist, s); } int screenlist_remove(Screen *s) { debug(RPT_DEBUG, "%s(s=[%.40s])", __FUNCTION__, s->id); if (!screenlist) return -1; /* Are we trying to remove the current screen ? */ if (s == current_screen) { screenlist_goto_next(); if (s == current_screen) { /* Hmm, no other screen had same priority */ void *res = LL_Remove(screenlist, s, NEXT); /* And now once more */ screenlist_goto_next(); return (res == NULL) ? -1 : 0; } } return (LL_Remove(screenlist, s, NEXT) == NULL) ? -1 : 0; } void screenlist_process(void) { Screen *s; Screen *f; report(RPT_DEBUG, "%s()", __FUNCTION__); if (!screenlist) return; /* Sort the list according to priority class */ LL_Sort(screenlist, compare_priority); f = LL_GetFirst(screenlist); /**** First we need to check out the current situation. ****/ /* Check whether there is an active screen */ s = screenlist_current(); if (!s) { /* We have no active screen yet. * Try to switch to the first screen in the list... */ s = f; if (!s) { /* There was no screen in the list */ return; } screenlist_switch(s); return; } else { /* There already was an active screen. * Check to see if it has an expiry time. If so, decrease it * and then check to see if it has expired. Remove the screen * if expired. */ if (s->timeout != -1) { --(s->timeout); report(RPT_DEBUG, "Active screen [%.40s] has timeout->%d", s->id, s->timeout); if (s->timeout <= 0) { /* Expired, we can destroy it */ report(RPT_DEBUG, "Removing expired screen [%.40s]", s->id); client_remove_screen(s->client, s); screen_destroy(s); } } } /**** OK, current situation examined. We can now see if we need to switch. */ /* Is there a screen of a higher priority class than the * current one ? */ if (f->priority > s->priority) { /* Yes, switch to that screen, job done */ report(RPT_DEBUG, "%s: High priority screen [%.40s] selected", __FUNCTION__, f->id); screenlist_switch(f); return; } /* Current screen has been visible long enough and is it of 'normal' * priority ? */ if (autorotate && (timer - current_screen_start_time >= s->duration) && s->priority > PRI_BACKGROUND && s->priority <= PRI_FOREGROUND) { /* Ah, rotate! */ screenlist_goto_next(); } } void screenlist_switch(Screen *s) { Client *c; char str[256]; if (!s) return; report(RPT_DEBUG, "%s(s=[%.40s])", __FUNCTION__, s->id); if (s == current_screen) { /* Nothing to be done */ return; } if (current_screen) { c = current_screen->client; if (c) { /* Tell the client we're not listening any more...*/ snprintf(str, sizeof(str), "ignore %s\n", current_screen->id); sock_send_string(c->sock, str); } else { /* It's a server screen, no need to inform it. */ } } c = s->client; if (c) { /* Tell the client we're paying attention...*/ snprintf(str, sizeof(str), "listen %s\n", s->id); sock_send_string(c->sock, str); } else { /* It's a server screen, no need to inform it. */ } report(RPT_INFO, "%s: switched to screen [%.40s]", __FUNCTION__, s->id); current_screen = s; current_screen_start_time = timer; } Screen * screenlist_current(void) { return current_screen; } int screenlist_goto_next(void) { Screen *s; debug(RPT_DEBUG, "%s()", __FUNCTION__); if (!current_screen) return -1; /* Find current screen in screenlist */ for (s = LL_GetFirst(screenlist); s && s != current_screen; s = LL_GetNext(screenlist)) ; /* One step forward */ s = LL_GetNext(screenlist); if (!s || s->priority < current_screen->priority) { /* To far, go back to start of screenlist */ s = LL_GetFirst(screenlist); } screenlist_switch(s); return 0; } int screenlist_goto_prev(void) { Screen *s; debug(RPT_DEBUG, "%s()", __FUNCTION__); if (!current_screen) return -1; /* Find current screen in screenlist */ for (s = LL_GetFirst(screenlist); s && s != current_screen; s = LL_GetNext(screenlist)); /* One step back */ s = LL_GetPrev(screenlist); if (!s) { /* We're at the start of the screenlist. We should find the * last screen with the same priority as the first screen. */ Screen *f = LL_GetFirst(screenlist); Screen *n; s = f; while ((n = LL_GetNext(screenlist)) && n->priority == f->priority) { s = n; } } screenlist_switch(s); return 0; } /* Internal function for sorting. */ int compare_priority(void *one, void *two) { Screen *a, *b; /*debug(RPT_DEBUG, "compare_priority: %8x %8x", one, two);*/ if (!one) return 0; if (!two) return 0; a = (Screen *) one; b = (Screen *) two; /*debug(RPT_DEBUG, "compare_priority: done?");*/ return (b->priority - a->priority); } lcdproc-0.5.7/server/screenlist.h000644 001751 000000 00000002550 12014174064 017605 0ustar00mmdolzewheel000000 000000 /** \file server/screenlist.h */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven * 2003, Joris Robijn */ #ifndef SCREENLIST_H #define SCREENLIST_H #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef HAVE_STDBOOL_H # include #endif #include "shared/defines.h" #define AUTOROTATE_OFF 0 #define AUTOROTATE_ON 1 extern bool autorotate; /**< If enabled, screens will rotate */ int screenlist_init(void); /* Initializes the screenlist. */ int screenlist_shutdown(void); /* Shuts down the screenlist. */ int screenlist_add(Screen *s); /* Adds a screen to the screenlist. */ int screenlist_remove(Screen *s); /* Removes a screen from the screenlist. */ void screenlist_process(void); /* Processes the screenlist. Decides if we need to switch to an other * screen. */ void screenlist_switch(Screen *s); /* Switches to an other screen in the proper way. Informs clients of * the switch. ALWAYS USE THIS FUNCTION TO SWITCH SCREENS. */ Screen *screenlist_current(void); /* Returns the currently active screen. */ int screenlist_goto_next(void); /* Moves on to the next screen. */ int screenlist_goto_prev(void); /* Moves on to the previous screen. */ #endif lcdproc-0.5.7/server/serverscreens.c000644 001751 000000 00000017271 11621737634 020337 0ustar00mmdolzewheel000000 000000 /** \file server/serverscreens.c * This file contains code to allow the server to generate its own screens. * Currently, the startup, goodbye and server status screen are provided. The * server status screen shows total number of connected clients, and the * combined total of screens they provide. * * It is interesting to note that the server creates a special screen * definition for its screens, but uses the same widget set made available * to clients. */ /*- * This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven * 2002, Joris Robijn * 2007, Peter Marschall */ #include #include #include #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "shared/report.h" #include "shared/configfile.h" #include "drivers.h" #include "clients.h" #include "render.h" #include "screen.h" #include "screenlist.h" #include "widget.h" #include "main.h" #include "serverscreens.h" /* global variables */ Screen *server_screen = NULL; int rotate_server_screen = UNSET_INT; /* file-local variables */ static int has_hello_msg = 0; /* file-local function declarations */ static int reset_server_screen(int rotate, int heartbeat, int title); /** * Create the server screen and (optionally) print the hello message to it. * \return -1 on error allocating the screen or one of its widgets, * 0 otherwise. */ int server_screen_init(void) { Widget *w; int i; has_hello_msg = config_has_key("Server", "Hello"); debug(RPT_DEBUG, "%s()", __FUNCTION__); /* Create the screen */ server_screen = screen_create("_server_screen", NULL); if (!server_screen) { report(RPT_ERR, "server_screen_init: Error allocating screen"); return -1; } server_screen->name = "Server screen"; server_screen->duration = RENDER_FREQ; /* 1 second, instead of 4...*/ /* Create all the widgets...*/ for (i = 0; i < display_props->height; i++) { char id[8]; sprintf(id, "line%d", i+1); w = widget_create(id, WID_STRING, server_screen); if (w == NULL) { report(RPT_ERR, "server_screen_init: Can't create a widget"); return -1; } screen_add_widget(server_screen, w); w->x = 1; w->y = i+1; w->text = calloc(LCD_MAX_WIDTH+1, 1); } /* set parameters for server_screen and it's widgets */ reset_server_screen(rotate_server_screen, !has_hello_msg, !has_hello_msg); /* set the widgets depending on the Hello option in LCDd.conf */ if (has_hello_msg) { /* show whole Hello message */ int i; for (i = 0; i < display_props->height; i++) { const char *line = config_get_string("Server", "Hello", i, ""); char id[8]; sprintf(id, "line%d", i+1); w = screen_find_widget(server_screen, id); if ((w != NULL) && (w->text != NULL)) { strncpy(w->text, line, LCD_MAX_WIDTH); w->text[LCD_MAX_WIDTH] = '\0'; } } } /* And enqueue the screen */ screenlist_add(server_screen); debug(RPT_DEBUG, "%s() done", __FUNCTION__); return 0; } int server_screen_shutdown(void) { if (server_screen == NULL) return -1; screenlist_remove(server_screen); screen_destroy(server_screen); return 0; } /** * Print the numbers of connected clients and screens on the server screen * unless screen is set to be blank. If a custom hello message has been set * it is shown until the first client connects. * \return Always 0. */ int update_server_screen(void) { static int hello_done = 0; Client *c; Widget *w; int num_clients = 0; int num_screens = 0; /* get info on the number of connected clients...*/ num_clients = clients_client_count(); /* turn off the Hello message after the first client connected */ if (has_hello_msg && !hello_done) { /* TODO: * checking for num_clients is not really correct; we really * want num_screens (see also comment in main.c). * Unfortunately we do only get called if the server screen * needs to be updated; therefore we get num_screen updated too * late so that after a client disconnects to quickly (in its * 1st round of screens showing) num_screens still is 0. */ if (num_clients != 0) { reset_server_screen(rotate_server_screen, 1, 1); hello_done = 1; } else { return 0; } } /* ... and screens */ for (c = clients_getfirst(); c != NULL; c = clients_getnext()) { num_screens += client_screen_count(c); } /* update statistics if we do not only want to show a blank screen */ if (rotate_server_screen != SERVERSCREEN_BLANK) { /* format strings for the appropriate display size ... */ if (display_props->height >= 3) { /* >2-line display */ w = screen_find_widget(server_screen, "line2"); if ((w != NULL) && (w->text != NULL)) { snprintf(w->text, LCD_MAX_WIDTH, "Clients: %i", num_clients); } w = screen_find_widget(server_screen, "line3"); if ((w != NULL) && (w->text != NULL)) { snprintf(w->text, LCD_MAX_WIDTH, "Screens: %i", num_screens); } } else { /* 2-line display */ w = screen_find_widget(server_screen, "line2"); if ((w != NULL) && (w->text != NULL)) { snprintf(w->text, LCD_MAX_WIDTH, ((display_props->width >= 16) ? "Cli: %i Scr: %i" : "C: %i S: %i"), num_clients, num_screens); } } } return 0; } /** * Writes the default or a custom goodbye message defined in the config file * to the screen. Default message is centered on the screen while the custom * message has to be formatted by the user. * \return Always 0. */ int goodbye_screen(void) { if (!display_props) return 0; drivers_clear(); if (config_has_key("Server", "GoodBye")) { /* custom GoodBye */ int i; /* loop over all display lines to read config & display message */ for (i = 0; i < display_props->height; i++) { const char *line = config_get_string("Server", "GoodBye", i, ""); drivers_string(1, 1+i, line); } } else { /* default GoodBye */ if ((display_props->height >= 2) && (display_props->width >= 16)) { int xoffs = (display_props->width - 16) / 2; int yoffs = (display_props->height - 2) / 2; char *top = "Thanks for using"; #ifdef LINUX char *low = "LCDproc & Linux!"; #else char *low = " LCDproc! "; #endif drivers_string(1+xoffs, 1+yoffs, top); drivers_string(1+xoffs, 2+yoffs, low); } } drivers_cursor(1, 1, CURSOR_OFF); drivers_flush(); return 0; } /** * Clear all text on the server screen and (optionally) reset the title. If * the screen is blank or off it is put in the background. If it is on, the * screen is shown as a regular screen (priority info). * * \param rotate Server screen state (on/off/blank). * \param heartbeat If true (1) show the heartbeat unless the screen is blank. * \param title If true (1) and screen is not blank print the default title. * \return -1 if no server screen has been created yet, 0 otherwise. */ static int reset_server_screen(int rotate, int heartbeat, int title) { int i; if (server_screen == NULL) return -1; server_screen->heartbeat = (heartbeat && (rotate != SERVERSCREEN_BLANK)) ? HEARTBEAT_OPEN : HEARTBEAT_OFF; server_screen->priority = (rotate == SERVERSCREEN_ON) ? PRI_INFO : PRI_BACKGROUND; for (i = 0; i < display_props->height; i++) { char id[8]; Widget *w; sprintf(id, "line%d", i+1); w = screen_find_widget(server_screen, id); if (w != NULL) { w->x = 1; w->y = i+1; w->type = ((i == 0) && (title) && (rotate != SERVERSCREEN_BLANK)) ? WID_TITLE : WID_STRING; if (w->text != NULL) { w->text[0] = '\0'; if ((i == 0) && (title) && (rotate != SERVERSCREEN_BLANK)) { strncpy(w->text, "LCDproc Server", LCD_MAX_WIDTH); w->text[LCD_MAX_WIDTH] = '\0'; } } } } return 0; } lcdproc-0.5.7/server/serverscreens.h000644 001751 000000 00000001530 11621737634 020333 0ustar00mmdolzewheel000000 000000 /** \file server/serverscreens.h * Interface for the serverscreen implementation. */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven */ #ifndef SRVSTATS_H #define SRVSTATS_H #include "screen.h" /* server screen rotation states */ #define SERVERSCREEN_OFF 0 /**< Show server screen in rotation. */ #define SERVERSCREEN_ON 1 /**< Show server sreen only when there is no other screen. */ #define SERVERSCREEN_BLANK 2 /**< Don't rotate, and only show a blank screen. */ extern Screen *server_screen; extern int rotate_server_screen; int server_screen_init(void); int server_screen_shutdown(void); int update_server_screen(void); int goodbye_screen(void); #endif lcdproc-0.5.7/server/sock.c000644 001751 000000 00000031337 12014174064 016371 0ustar00mmdolzewheel000000 000000 /** \file server/sock.c * This file contains all the sockets code used by the server. This contains * the code called upon by main() to initialize the listening socket, as well * as code to deal with sending messages to clients, maintaining connections, * accepting new connections, closing dead connections (or connections * associated with dying/exiting clients), etc. */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven * 2004, F5 Networks, Inc. - IP-address input * 2005, Peter Marschall - error checks, ... * 2009, Markus Dolze - input ring buffer */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "shared/report.h" #include "shared/sring.h" #include "shared/defines.h" #include "clients.h" #include "sock.h" /****************************************************************************/ static fd_set active_fd_set, read_fd_set; static int listening_fd; /* For efficiency we maintain a list of open sockets. Nodes in this list * are obtained from a pre-allocated pool - this removes heap operations * from the polling loop. A list of open sockets is also required under WINSOCK * as sockets can be arbitrary values instead of low value integers. */ static LinkedList* openSocketList = NULL; static LinkedList* freeClientSocketList = NULL; /* ring buffer for incoming messages */ static sring_buffer *messageRing; /** Mapping between socket and associated client */ typedef struct _ClientSocketMap { int socket; /**< Socket for the client */ Client *client; /**< Pointer to client representation */ } ClientSocketMap; /* The memory referenced from \c openSocketList and \c freeSocketList * is obtained from the freeClientSocketPool array. */ ClientSocketMap *freeClientSocketPool; /* Length of longest transmission allowed at once...*/ #define MAXMSG 8192 /**** Internal function declarations ****************************************/ static int sock_read_from_client(ClientSocketMap *clientSocketMap); static void sock_destroy_socket(void); /** Initialize sockets. * Prepare server socket, and initialize socket management structures. * \param bind_addr Hostname / IP address to bind to. * \param bind_port Port to bind to. * \retval <0 error * \retval 0 success */ int sock_init(char* bind_addr, int bind_port) { int i; debug(RPT_DEBUG, "%s(bind_addr=\"%s\", port=%d)", __FUNCTION__, bind_addr, bind_port); /* Create the socket and set it up to accept connections. */ listening_fd = sock_create_inet_socket(bind_addr, bind_port); if (listening_fd < 0) { report(RPT_ERR, "%s: error creating socket - %s", __FUNCTION__, sock_geterror()); return -1; } /* Create the socket -> Client mapping pool */ /* How large can FD_SETSIZE be? Even if it is ~2000 this only uses a few kilobytes of memory. Let's trade size for speed! */ freeClientSocketPool = (ClientSocketMap *) calloc(FD_SETSIZE, sizeof(ClientSocketMap)); if (freeClientSocketPool == NULL) { report(RPT_ERR, "%s: Error allocating client sockets.", __FUNCTION__); return -1; } freeClientSocketList = LL_new(); if (freeClientSocketList == NULL) { report(RPT_ERR, "%s: error allocating free socket list.", __FUNCTION__); return -1; } for (i = 0; i < FD_SETSIZE; ++i) { LL_AddNode(freeClientSocketList, (void*) &freeClientSocketPool[i]); } /* Create and initialize the open socket list with the server socket */ openSocketList = LL_new(); if (openSocketList == NULL) { report(RPT_ERR, "%s: error allocating open socket list.", __FUNCTION__); return -1; } else { ClientSocketMap *entry; entry = (ClientSocketMap*) LL_Pop(freeClientSocketList); entry->socket = listening_fd; entry->client = NULL; LL_AddNode(openSocketList, (void*) entry); } if ((messageRing = sring_create(MAXMSG)) == NULL) { report(RPT_ERR, "%s: error allocating receive buffer.", __FUNCTION__); return -1; } return 0; } /** Cleanup socket management structures. * \retval <0 error * \retval 0 success */ int sock_shutdown(void) { int retVal = 0; debug(RPT_DEBUG, "%s()", __FUNCTION__); /*ClientSocketMap* clientIt;*/ /* delete all clients */ /* This should be done by calling clients_shutdown */ /* LL_Rewind(openSocketList); for (clientIt = (ClientSocketMap*) LL_Get(openSocketList); clientIt; clientIt = LL_GetNext(openSocketList)) { if (clientIt->client) { */ /* destroying a client also closes its socket */ /* client_destroy(clientIt->client); } } LL_Destroy(openSocketList); */ close(listening_fd); LL_Destroy(freeClientSocketList); free(freeClientSocketPool); sring_destroy(messageRing); return retVal; } /** Create an INET socket, bind to it and listen on it. * \param addr Hostname / IP address to bind to. * \param port Port to bind to. * \retval <0 error * \retval 0 success */ int sock_create_inet_socket(char *addr, unsigned int port) { struct sockaddr_in name; int sock; int sockopt = 1; debug(RPT_DEBUG, "%s(addr=\"%s\", port=%i)", __FUNCTION__, addr, port); /* Create the socket. */ sock = socket(PF_INET, SOCK_STREAM, 0); if (sock < 0) { report(RPT_ERR, "%s: cannot create socket - %s", __FUNCTION__, sock_geterror()); return -1; } /* Set the socket so we can re-use it*/ if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *) &sockopt, sizeof(sockopt)) < 0) { report(RPT_ERR, "%s: error setting socket option SO_REUSEADDR - %s", __FUNCTION__, sock_geterror()); return -1; } /* Give the socket a name. */ memset(&name, 0, sizeof(name)); name.sin_family = AF_INET; name.sin_port = htons(port); inet_aton(addr, &name.sin_addr); if (bind(sock, (struct sockaddr *) &name, sizeof(name)) < 0) { report(RPT_ERR, "%s: cannot bind to port %d at address %s - %s", __FUNCTION__, port, addr, sock_geterror()); return -1; } if (listen(sock, 1) < 0) { report(RPT_ERR, "%s: error in attempting to listen to port " "%d at %s - %s", __FUNCTION__, port, addr, sock_geterror()); return -1; } report(RPT_NOTICE, "Listening for queries on %s:%d", addr, port); /* Initialize the set of active sockets. */ FD_ZERO(&active_fd_set); FD_SET(sock, &active_fd_set); return sock; } /** Service all clients with pending input. * \retval <0 error * \retval 0 success */ int sock_poll_clients(void) { struct timeval t; ClientSocketMap* clientSocket; debug(RPT_DEBUG, "%s()", __FUNCTION__); t.tv_sec = 0; t.tv_usec = 0; /* Block until input arrives on one or more active sockets. */ read_fd_set = active_fd_set; if (select(FD_SETSIZE, &read_fd_set, NULL, NULL, &t) < 0) { report(RPT_ERR, "%s: Select error - %s", __FUNCTION__, sock_geterror()); return -1; } /* Service all the sockets with input pending. */ LL_Rewind(openSocketList); for (clientSocket = (ClientSocketMap *) LL_Get(openSocketList); clientSocket != NULL; clientSocket = LL_GetNext(openSocketList)) { if (FD_ISSET(clientSocket->socket, &read_fd_set)) { if (clientSocket->socket == listening_fd) { /* Connection request on original socket. */ Client *c; int new_sock; struct sockaddr_in clientname; socklen_t size = sizeof(clientname); new_sock = accept(listening_fd, (struct sockaddr *) &clientname, &size); if (new_sock < 0) { report(RPT_ERR, "%s: Accept error - %s", __FUNCTION__, sock_geterror()); return -1; } report(RPT_NOTICE, "Connect from host %s:%hu on socket %i", inet_ntoa(clientname.sin_addr), ntohs(clientname.sin_port), new_sock); FD_SET(new_sock, &active_fd_set); fcntl(new_sock, F_SETFL, O_NONBLOCK); /* Create new client */ if ((c = client_create(new_sock)) == NULL) { report(RPT_ERR, "%s: Error creating client on socket %i - %s", __FUNCTION__, clientSocket->socket, sock_geterror()); return -1; } else { /* add new_sock */ ClientSocketMap *newClientSocket; newClientSocket = (ClientSocketMap *) LL_Pop(freeClientSocketList); if (newClientSocket != NULL) { newClientSocket->socket = new_sock; newClientSocket->client = c; LL_InsertNode(openSocketList, (void *) newClientSocket); /* advance past the new node - check it on the next pass */ LL_Next(openSocketList); } else { report(RPT_ERR, "%s: Error - free client socket list exhausted - %d clients.", __FUNCTION__, FD_SETSIZE); return -1; } } if (clients_add_client(c) == NULL) { report(RPT_ERR, "%s: Could not add client on socket %i", __FUNCTION__, clientSocket->socket); return -1; } } else { /* Data arriving on an already-connected socket. */ int err = 0; debug(RPT_DEBUG, "%s: reading...", __FUNCTION__); err = sock_read_from_client(clientSocket); debug(RPT_DEBUG, "%s: ...done", __FUNCTION__); if (err < 0) sock_destroy_socket(); } } } return 0; } /** Read from a client's socket and store the messages in the client for further parsing. * \retval <0 error * \retval 0 success */ static int sock_read_from_client(ClientSocketMap *clientSocketMap) { char buffer[MAXMSG]; int nbytes; debug(RPT_DEBUG, "%s()", __FUNCTION__); errno = 0; nbytes = sock_recv(clientSocketMap->socket, buffer, MAXMSG); while (nbytes > 0) { /* Data available */ int fr; char *str; debug(RPT_DEBUG, "%s: received %4d bytes", __FUNCTION__, nbytes); /* Append to ring buffer */ sring_write(messageRing, buffer, nbytes); /* Process all available message in ring buffer */ do { str = sring_read_string(messageRing); if (clientSocketMap->client) { client_add_message(clientSocketMap->client, str); } else { report(RPT_DEBUG, "%s: Can't find client %d", __FUNCTION__, clientSocketMap->socket); } } while (str != NULL); /* Read again, but only as much as space is left */ fr = sring_getMaxWrite(messageRing); if (fr == 0) report(RPT_WARNING, "%s: Message buffer full", __FUNCTION__); nbytes = sock_recv(clientSocketMap->socket, buffer, min(MAXMSG, fr)); } if (sring_getMaxRead(messageRing) > 0) { report(RPT_WARNING, "%s: left over bytes in message buffer", __FUNCTION__); sring_clear(messageRing); } if (nbytes < 0 && errno == EAGAIN) return 0; /* No data is not an error */ return -1; /* EOF */ } /* comparison function to find a ClientsocketMap entry by client */ int byClient(void *csm, void *client) { return (((ClientSocketMap *) csm)->client == (Client *) client) ? 0 : -1; } /** Close an open socket for a given client. * \param client Client whose socket shall be closed. * \retval <0 error * \retval 0 success. */ int sock_destroy_client_socket(Client *client) { ClientSocketMap *entry; LL_Rewind(openSocketList); entry = LL_Find(openSocketList, byClient, client); if (entry != NULL) { sock_destroy_socket(); return 0; } return -1; } /** Close the socket the openSocketList's \c current pointer points to. */ static void sock_destroy_socket(void) { ClientSocketMap *entry = LL_Get(openSocketList); if (entry != NULL) { if (entry->client != NULL) { report(RPT_NOTICE, "Client on socket %i disconnected", entry->socket); client_destroy(entry->client); clients_remove_client(entry->client, PREV); entry->client = NULL; } else { report(RPT_ERR, "%s: Can't find client of socket %i", __FUNCTION__, entry->socket); } /* close socket and remove it from select()'s mask of active sockets */ FD_CLR(entry->socket, &active_fd_set); close(entry->socket); /* re-add socket to the free socket pool */ entry = (ClientSocketMap *) LL_DeleteNode(openSocketList, PREV); LL_Push(freeClientSocketList, (void*) entry); } } /* return 1 if addr is valid IPv4 */ int verify_ipv4(const char *addr) { int result = -1; if (addr != NULL) { struct in_addr a; /* inet_pton returns positive value if it worked */ result = inet_pton(AF_INET, addr, &a); } return (result > 0) ? 1 : 0; } /* return 1 if addr is valid IPv6 */ int verify_ipv6(const char *addr) { int result = 0; if (addr != NULL) { struct in6_addr a; /* inet_pton returns positive value if it worked */ result = inet_pton(AF_INET6, addr, &a); } return (result > 0) ? 1 : 0; } lcdproc-0.5.7/server/sock.h000644 001751 000000 00000001544 12014174064 016373 0ustar00mmdolzewheel000000 000000 /** \file server/sock.h * function declarations for LCDproc sockets code */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven * 2004, F5 Networks, Inc. - IP-address verification * 2008, Peter Marschall */ #ifndef SOCK_H #define SOCK_H #include "shared/sockets.h" #define INC_TYPES_ONLY 1 #include "client.h" #undef INC_TYPES_ONLY /* Server functions...*/ int sock_init(char* bind_addr, int bind_port); int sock_shutdown(void); int sock_create_inet_socket(char* bind_addr, unsigned int port); int sock_poll_clients(void); int sock_destroy_client_socket(Client *client); int verify_ipv4(const char *addr); int verify_ipv6(const char *addr); #endif lcdproc-0.5.7/server/widget.c000644 001751 000000 00000012606 12313532721 016713 0ustar00mmdolzewheel000000 000000 /** \file server/widget.c * This file houses code that handles the creation and destruction of widget * objects for the server. These functions are called from the command parser * storing the specified widget in a generic container that is parsed later * by the screen renderer. */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven * 2002, Joris Robijn * 2008, Peter Marschall */ #include #include #include #include #include "shared/sockets.h" #include "shared/report.h" #include "screen.h" #include "widget.h" #include "render.h" #include "drivers/lcd.h" char *typenames[] = { "none", /* WID_NONE */ "string", /* WID_STRING */ "hbar", /* WID_HBAR */ "vbar", /* WID_VBAR */ "icon", /* WID_ICON */ "title", /* WID_TITLE */ "scroller", /* WID_SCROLLER */ "frame", /* WID_FRAME */ "num", /* WID_NUM */ NULL, /* WID_NONE */ }; struct icontable { int icon; char *iconname; } icontable[] = { {ICON_BLOCK_FILLED, "BLOCK_FILLED"}, {ICON_HEART_OPEN, "HEART_OPEN"}, {ICON_HEART_FILLED, "HEART_FILLED"}, {ICON_ARROW_UP, "ARROW_UP"}, {ICON_ARROW_DOWN, "ARROW_DOWN"}, {ICON_ARROW_LEFT, "ARROW_LEFT"}, {ICON_ARROW_RIGHT, "ARROW_RIGHT"}, {ICON_CHECKBOX_OFF, "CHECKBOX_OFF"}, {ICON_CHECKBOX_ON, "CHECKBOX_ON"}, {ICON_CHECKBOX_GRAY, "CHECKBOX_GRAY"}, {ICON_SELECTOR_AT_LEFT, "SELECTOR_AT_LEFT"}, {ICON_SELECTOR_AT_RIGHT, "SELECTOR_AT_RIGHT"}, {ICON_ELLIPSIS, "ELLIPSIS"}, {ICON_STOP, "STOP"}, {ICON_PAUSE, "PAUSE"}, {ICON_PLAY, "PLAY"}, {ICON_PLAYR, "PLAYR"}, {ICON_FF, "FF"}, {ICON_FR, "FR"}, {ICON_NEXT, "NEXT"}, {ICON_PREV, "PREV"}, {ICON_REC, "REC"}, {0,NULL} }; /** Create a widget. * \param id Widget identifier; it's name. * \param type Widget type. * \param screen Screen on which the widget is to be placed. * \return Pointer to the freshly created widget. */ Widget * widget_create(char *id, WidgetType type, Screen *screen) { Widget *w; debug(RPT_DEBUG, "%s(id=\"%s\", type=%d, screen=[%s])", __FUNCTION__, id, type, screen->id); /* Create it */ w = malloc(sizeof(Widget)); if (w == NULL) { report(RPT_DEBUG, "%s: Error allocating", __FUNCTION__); return NULL; } w->id = strdup(id); if (w->id == NULL) { report(RPT_DEBUG, "%s: Error allocating", __FUNCTION__); free(w); return NULL; } w->type = type; w->screen = screen; w->x = 1; w->y = 1; w->width = 0; w->height = 0; w->left = 1; w->top = 1; w->right = 0; w->bottom = 0; w->length = 1; w->speed = 1; w->text = NULL; //w->kids = NULL; if (w->type == WID_FRAME) { /* create a screen for the frame widget */ char *frame_name = malloc(strlen("frame_") + strlen(id) + 1); if (frame_name == NULL) { report(RPT_DEBUG, "%s: Error allocating", __FUNCTION__); free(w->id); free(w); return NULL; } strcpy(frame_name, "frame_"); strcat(frame_name, id); w->frame_screen = screen_create(frame_name, screen->client); if (w->frame_screen == NULL) { report(RPT_DEBUG, "%s: Error allocating", __FUNCTION__); free(w->id); free(w); /* return NULL after cleaning up */ w = NULL; } free(frame_name); /* not needed anymore */ } return w; } /** Destroy a widget. * \param w Widget to destroy. * \retval <0 Error; no widget given. * \retval 0 Success. */ int widget_destroy(Widget *w) { debug(RPT_DEBUG, "%s(w=[%s])", __FUNCTION__, w->id); if (!w) return -1; if (w->id != NULL) { free(w->id); w->id = NULL; } if (w->text != NULL) { free(w->text); w->text = NULL; } /* Free subscreen of frame widget too */ if (w->type == WID_FRAME) { screen_destroy(w->frame_screen); w->frame_screen = NULL; } free(w); w = NULL; return 0; } /** Convert a widget type name to a widget type. * \param typename Name of the widget type. * \return Widget type. */ WidgetType widget_typename_to_type(char *typename) { WidgetType wid_type = WID_NONE; int i; for (i = 0; typenames[i] != NULL; i++) { if (strcmp(typenames[i], typename) == 0) { wid_type = i; break; /* it's valid: skip out...*/ } } return wid_type; } /** Convert a widget type to the associated type name. * \param t Widget type. * \return Widget type's name. */ char * widget_type_to_typename(WidgetType t) { return typenames[t]; } /** Find subordinate widgets of a widget by name. * \param w Widget. * \param id Name of the subiordinate widget. * \return Pointer to the sub-widget; \c NULL if not found or on error. */ Widget * widget_search_subs(Widget *w, char *id) { if (w->type == WID_FRAME) { return screen_find_widget(w->frame_screen, id); } else { return NULL; /* no kids */ } } /** Find a widget icon by type. * \param icon Icon type. * \return Pointer to constant string containing the icon name. */ char *widget_icon_to_iconname(int icon) { int i; for (i = 0; icontable[i].iconname != NULL; i++) { if (icontable[i].icon == icon) { return icontable[i].iconname; } } return NULL; } /** Find a widget icon by name. * \param iconname Icon name. * \return Icon type */ int widget_iconname_to_icon(char *iconname) { int i; for (i = 0; icontable[i].iconname != NULL; i++) { if (strcasecmp(icontable[i].iconname, iconname) == 0) { return icontable[i].icon; } } return -1; } lcdproc-0.5.7/server/widget.h000644 001751 000000 00000003464 12014174064 016722 0ustar00mmdolzewheel000000 000000 /** \file server/widget.h * Public interface to the widget methods. */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven */ #ifndef WIDGET_H #define WIDGET_H #define INC_TYPES_ONLY 1 #include "screen.h" #undef INC_TYPES_ONLY /* These correspond to the index into the "types" array...*/ typedef enum WidgetType { WID_NONE = 0, WID_STRING, WID_HBAR, WID_VBAR, WID_ICON, WID_TITLE, WID_SCROLLER, WID_FRAME, WID_NUM } WidgetType; /** Widget structure */ typedef struct Widget { char *id; /**< the widget's name */ WidgetType type; /**< the widget's type */ Screen *screen; /**< What screen is this widget in ? */ int x, y; /**< Position */ int width, height; /**< Visible size */ int left, top, right, bottom; /**< bounding rectangle */ int length; /**< size or direction */ int speed; /**< For scroller... */ char *text; /**< text or binary data */ struct Screen *frame_screen; /**< frame widget get an associated screen */ //LinkedList *kids; /* Frames can contain more widgets...*/ } Widget; #define WID_MAX_DIR 4 /* Create new widget */ Widget *widget_create(char *id, WidgetType type, Screen *screen); /* Destroy a widget */ int widget_destroy(Widget *w); /* Convert a widget typename to a widget type */ WidgetType widget_typename_to_type(char *typename); /* Convert a widget typename to a widget type */ char *widget_type_to_typename(WidgetType t); /* Search subwidgets of a widget */ Widget *widget_search_subs(Widget *w, char *id); /* Convert icon number to icon name */ char *widget_icon_to_iconname(int icon); /* Convert iconname to icon number */ int widget_iconname_to_icon(char *iconname); #endif lcdproc-0.5.7/server/drivers.c000644 001751 000000 00000026571 12014174064 017114 0ustar00mmdolzewheel000000 000000 /** \file server/drivers.c * Manage the lists of loaded drivers and perform actions on all drivers. */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright(c) 2001, Joris Robijn */ #include #include #include #include #include #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "shared/LL.h" #include "shared/report.h" #include "shared/configfile.h" #include "driver.h" #include "drivers.h" #include "widget.h" LinkedList *loaded_drivers = NULL; /**< list of loaded drivers */ DisplayProps *display_props = NULL; /**< properties of the display */ #define ForAllDrivers(drv) for (drv = LL_GetFirst(loaded_drivers); drv; drv = LL_GetNext(loaded_drivers)) /** * Load driver based on "DriverPath" config setting and section name or * "File" configuration setting in the driver's section. * \param name Driver section name. * \retval <0 error. * \retval 0 OK, driver is an input driver only. * \retval 1 OK, driver is an output driver. * \retval 2 OK, driver is an output driver that needs to run in the foreground. */ int drivers_load_driver(const char *name) { Driver *driver; const char *s; char *driverpath; char *filename; debug(RPT_DEBUG, "%s(name=\"%.40s\")", __FUNCTION__, name); /* First driver ? */ if (!loaded_drivers) { /* Create linked list */ loaded_drivers = LL_new(); if (!loaded_drivers) { report(RPT_ERR, "Error allocating driver list."); return -1; } } /* Retrieve data from config file */ s = config_get_string("server", "DriverPath", 0, ""); driverpath = malloc(strlen(s) + 1); strcpy(driverpath, s); s = config_get_string(name, "File", 0, NULL); if (s) { filename = malloc(strlen(driverpath) + strlen(s) + 1); strcpy(filename, driverpath); strcat(filename, s); } else { filename = malloc(strlen(driverpath) + strlen(name) + strlen(MODULE_EXTENSION) + 1); strcpy(filename, driverpath); strcat(filename, name); strcat(filename, MODULE_EXTENSION); } /* Load the module */ driver = driver_load(name, filename); if (driver == NULL) { /* It failed. The message has already been given by driver_load() */ report(RPT_INFO, "Module %.40s could not be loaded", filename); free(driverpath); free(filename); return -1; } /* Add driver to list */ LL_Push(loaded_drivers, driver); free(driverpath); free(filename); /* If first driver, store display properties */ if (driver_does_output(driver) && !display_props) { if (driver->width(driver) <= 0 || driver->width(driver) > LCD_MAX_WIDTH || driver->height(driver) <= 0 || driver->height(driver) > LCD_MAX_HEIGHT) { report(RPT_ERR, "Driver [%.40s] has invalid display size", driver->name); } /* Allocate new DisplayProps structure */ display_props = malloc(sizeof(DisplayProps)); display_props->width = driver->width(driver); display_props->height = driver->height(driver); if (driver->cellwidth != NULL && driver->cellwidth(driver) > 0) display_props->cellwidth = driver->cellwidth(driver); else display_props->cellwidth = LCD_DEFAULT_CELLWIDTH; if (driver->cellheight != NULL && driver->cellheight(driver) > 0) display_props->cellheight = driver->cellheight(driver); else display_props->cellheight = LCD_DEFAULT_CELLHEIGHT; } /* Return the driver type */ if (driver_does_output(driver)) { if (driver_stay_in_foreground(driver)) return 2; else return 1; } return 0; } /** * Unload all loaded drivers. * \retval 0 */ int drivers_unload_all(void) { Driver *driver; debug(RPT_DEBUG, "%s()", __FUNCTION__); while ((driver = LL_Pop(loaded_drivers)) != NULL) { driver_unload(driver); } return 0; } /** * Get information from loaded drivers. * \return Pointer to information string of first driver with get_info() function defined, * or the empty string if no driver has a get_info() function. */ const char * drivers_get_info(void) { Driver *drv; debug(RPT_DEBUG, "%s()", __FUNCTION__); ForAllDrivers(drv) { if (drv->get_info) { return drv->get_info(drv); } } return ""; } /** * Clear screen on all loaded drivers. * Call clear() function of all loaded drivers that have a clear() function defined. */ void drivers_clear(void) { Driver *drv; debug(RPT_DEBUG, "%s()", __FUNCTION__); ForAllDrivers(drv) { if (drv->clear) drv->clear(drv); } } /** * Flush data on all loaded drivers to LCDs. * Call flush() function of all loaded drivers that have a flush() function defined. */ void drivers_flush(void) { Driver *drv; debug(RPT_DEBUG, "%s()", __FUNCTION__); ForAllDrivers(drv) { if (drv->flush) drv->flush(drv); } } /** * Write string to all loaded drivers. * Call string() function of all loaded drivers that have a flush() function defined. * \param x Horizontal character position (column). * \param y Vertical character position (row). * \param string String that gets written. */ void drivers_string(int x, int y, const char *string) { Driver *drv; debug(RPT_DEBUG, "%s(x=%d, y=%d, string=\"%.40s\")", __FUNCTION__, x, y, string); ForAllDrivers(drv) { if (drv->string) drv->string(drv, x, y, string); } } /** * Write a character to all loaded drivers. * Call chr() function of all loaded drivers that have a chr() function defined. * \param x Horizontal character position (column). * \param y Vertical character position (row). * \param c Character that gets written. */ void drivers_chr(int x, int y, char c) { Driver *drv; debug(RPT_DEBUG, "%s(x=%d, y=%d, c='%c')", __FUNCTION__, x, y, c); ForAllDrivers(drv) { if (drv->chr) drv->chr(drv, x, y, c); } } /** * Draw a vertical bar to all drivers. * For drivers that define a vbar() function, call it; * otherwise call the general driver_alt_vbar() function from the server core. * \param x Horizontal character position (column) of the starting point. * \param y Vertical character position (row) of the starting point. * \param len Number of characters that the bar is long at 100% * \param promille Current length level of the bar in promille. * \param pattern Options (currently unused). */ void drivers_vbar(int x, int y, int len, int promille, int pattern) { Driver *drv; debug(RPT_DEBUG, "%s(x=%d, y=%d, len=%d, promille=%d, pattern=%d)", __FUNCTION__, x, y, len, promille, pattern); /* NEW FUNCTIONS * * We need more data in the widget. Requires language update... */ ForAllDrivers(drv) { if (drv->vbar) drv->vbar(drv, x, y, len, promille, pattern); else driver_alt_vbar(drv, x, y, len, promille, pattern); } } /** * Draw a horizontal bar to all drivers. * For drivers that define a hbar() function, call it; * otherwise call the general driver_alt_hbar() function from the server core. * \param x Horizontal character position (column) of the starting point. * \param y Vertical character position (row) of the starting point. * \param len Number of characters that the bar is long at 100% * \param promille Current length level of the bar in promille. * \param pattern Options (currently unused). */ void drivers_hbar(int x, int y, int len, int promille, int pattern) { Driver *drv; debug(RPT_DEBUG, "%s(x=%d, y=%d, len=%d, promille=%d, pattern=%d)", __FUNCTION__, x, y, len, promille, pattern); ForAllDrivers(drv) { if (drv->hbar) drv->hbar(drv, x, y, len, promille, pattern); else driver_alt_hbar(drv, x, y, len, promille, pattern); } } /** * Write a big number to all output drivers. * For drivers that define a num() function, call it; * otherwise call the general driver_alt_num() function from the server core. * \param x Horizontal character position (column). * \param num Character to write (0 - 10 with 10 representing ':') */ void drivers_num(int x, int num) { Driver *drv; debug(RPT_DEBUG, "%s(x=%d, num=%d)", __FUNCTION__, x, num); ForAllDrivers(drv) { if (drv->num) drv->num(drv, x, num); else driver_alt_num(drv, x, num); } } /** * Perform heartbeat on all drivers. * For drivers that define a heartbeat() function, call it; * otherwise call the general driver_alt_heartbeat() function from the server core. * \param state Heartbeat state. */ void drivers_heartbeat(int state) { Driver *drv; debug(RPT_DEBUG, "%s(state=%d)", __FUNCTION__, state); ForAllDrivers(drv) { if (drv->heartbeat) drv->heartbeat(drv, state); else driver_alt_heartbeat(drv, state); } } /** * Write icon to all drivers. * For drivers that define a icon() function, call it; * otherwise call the general driver_alt_icon() function from the server core. * If the driver's locally defined icon() function returns -1, then also * call the server core's driver_alt_icon(). * \param x Horizontal character position (column). * \param y Vertical character position (row). * \param icon synbolic value representing the icon. */ void drivers_icon(int x, int y, int icon) { Driver *drv; debug(RPT_DEBUG, "%s(x=%d, y=%d, icon=ICON_%s)", __FUNCTION__, x, y, widget_icon_to_iconname(icon)); ForAllDrivers(drv) { /* Does the driver have the icon function ? */ if (drv->icon) { /* Try driver call */ if (drv->icon(drv, x, y, icon) == -1) { /* do alternative call if driver's function does not know the icon */ driver_alt_icon(drv, x, y, icon); } } else { /* Also do alternative call if the driver does not have icon function */ driver_alt_icon(drv, x, y, icon); } } } /** * Set cursor on all loaded drivers. * For drivers that define a cursor() function, call it; * otherwise call the general driver_alt_cursor() function from the server core. * \param x Horizontal cursor position (column). * \param y Vertical cursor position (row). * \param state New cursor state. */ void drivers_cursor(int x, int y, int state) { Driver *drv; debug(RPT_DEBUG, "%s(x=%d, y=%d, state=%d)", __FUNCTION__, x, y, state); ForAllDrivers(drv) { if (drv->cursor) drv->cursor(drv, x, y, state); else driver_alt_cursor(drv, x, y, state); } } /** * Set backlight on all drivers. * Call backlight() function of all drivers that have a backlight() function defined. * \param state New backlight status. */ void drivers_backlight(int state) { Driver *drv; debug(RPT_DEBUG, "%s(state=%d)", __FUNCTION__, state); ForAllDrivers(drv) { if (drv->backlight) drv->backlight(drv, state); } } /** * Set output on all drivers. * Call ouptput() function of all drivers that have an ouptput() function defined. * \param state New ouptut status. */ void drivers_output(int state) { Driver *drv; debug(RPT_DEBUG, "%s(state=%d)", __FUNCTION__, state); ForAllDrivers(drv) { if (drv->output) drv->output(drv, state); } } /** * Get key presses from loaded drivers. * \return Pointer to key string for first driver ithat has a get_key() function defined * and for which the get_key() function returns a key; otherwise \c NULL. */ const char * drivers_get_key(void) { /* Find the first input keystroke, if any */ Driver *drv; const char *keystroke; debug(RPT_DEBUG, "%s()", __FUNCTION__); ForAllDrivers(drv) { if (drv->get_key) { keystroke = drv->get_key(drv); if (keystroke != NULL) { report(RPT_INFO, "Driver [%.40s] generated keystroke %.40s", drv->name, keystroke); return keystroke; } } } return NULL; } lcdproc-0.5.7/server/drivers.h000644 001751 000000 00000003021 12014174064 017102 0ustar00mmdolzewheel000000 000000 /** \file server/drivers.h */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 2001, Joris Robijn */ #ifndef DRIVERS_H #define DRIVERS_H #include "drivers/lcd.h" #include "shared/LL.h" typedef struct DisplayProps { int width, height; int cellwidth, cellheight; } DisplayProps; extern DisplayProps *display_props; int drivers_load_driver(const char *name); int drivers_unload_all(void); const char * drivers_get_info(void); void drivers_clear(void); void drivers_flush(void); void drivers_string(int x, int y, const char *string); void drivers_chr(int x, int y, char c); void drivers_vbar(int x, int y, int len, int promille, int pattern); void drivers_hbar(int x, int y, int len, int promille, int pattern); void drivers_num(int x, int num); void drivers_heartbeat(int state); void drivers_icon(int x, int y, int icon); void drivers_set_char(char ch, char *dat); int drivers_get_contrast(void); void drivers_set_contrast(int contrast); void drivers_cursor(int x, int y, int state); void drivers_backlight(int brightness); void drivers_output(int state); const char * drivers_get_key(void); /* Please don't read this list except using the following functions */ extern LinkedList *loaded_drivers; static inline Driver *drivers_getfirst(void) { return LL_GetFirst(loaded_drivers); } static inline Driver *drivers_getnext(void) { return LL_GetNext(loaded_drivers); } #endif lcdproc-0.5.7/server/driver.c000644 001751 000000 00000043375 12313532720 016731 0ustar00mmdolzewheel000000 000000 /** \file server/driver.c * This code does all actions on the driver object. */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 2001, Joris Robijn */ #include #include #include #include #include #include #include #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "main.h" /* for timer */ #include "shared/report.h" #include "shared/configfile.h" #include "widget.h" #include "driver.h" #include "drivers.h" #include "drivers/lcd.h" /* lcd.h is used for the driver API definition */ /** property / method symbols in a Driver structure */ typedef struct driver_symbols { const char *name; /**< symbol name */ short offset; /**< offset in Driver structure */ short required; /**< is the symbol mandatory */ } DriverSymbols; DriverSymbols driver_symbols[] = { { "api_version", offsetof(Driver, api_version), 1 }, { "stay_in_foreground", offsetof(Driver, stay_in_foreground), 1 }, { "supports_multiple", offsetof(Driver, supports_multiple), 1 }, { "symbol_prefix", offsetof(Driver, symbol_prefix), 1 }, { "init", offsetof(Driver, init), 1 }, { "close", offsetof(Driver, close), 1 }, { "width", offsetof(Driver, width), 0 }, { "height", offsetof(Driver, height), 0 }, { "clear", offsetof(Driver, clear), 0 }, { "flush", offsetof(Driver, flush), 0 }, { "string", offsetof(Driver, string), 0 }, { "chr", offsetof(Driver, chr), 0 }, { "vbar", offsetof(Driver, vbar), 0 }, { "hbar", offsetof(Driver, hbar), 0 }, { "num", offsetof(Driver, num), 0 }, { "heartbeat", offsetof(Driver, heartbeat), 0 }, { "icon", offsetof(Driver, icon), 0 }, { "cursor", offsetof(Driver, cursor), 0 }, { "set_char", offsetof(Driver, set_char), 0 }, { "get_free_chars", offsetof(Driver, get_free_chars), 0 }, { "cellwidth", offsetof(Driver, cellwidth), 0 }, { "cellheight", offsetof(Driver, cellheight), 0 }, { "get_contrast", offsetof(Driver, get_contrast), 0 }, { "set_contrast", offsetof(Driver, set_contrast), 0 }, { "get_brightness", offsetof(Driver, get_brightness), 0 }, { "set_brightness", offsetof(Driver, set_brightness), 0 }, { "backlight", offsetof(Driver, backlight), 0 }, { "output", offsetof(Driver, output), 0 }, { "get_key", offsetof(Driver, get_key), 0 }, { "get_info", offsetof(Driver, get_info), 0 }, { NULL, 0, 0 } }; /* Functions for the driver */ static int request_display_width(void); static int request_display_height(void); static int driver_store_private_ptr(Driver *driver, void *private_data); /** Create a driver object. * Allocate memory for the driver object, load it from file and bind its symbols. * \param name Name under which the driver shall be known further on. * \param filename Name of the file containing the drivers object code. * \return Pointer to the freshly created driver; \c NULL on error. */ Driver * driver_load(const char *name, const char *filename) { Driver *driver = NULL; int res; report(RPT_DEBUG, "%s(name=\"%.40s\", filename=\"%.80s\")", __FUNCTION__, name, filename); /* fail on wrong / missing parameters */ if ((name == NULL) || (filename == NULL)) return NULL; /* Allocate memory for new driver struct */ driver = calloc(1, sizeof(Driver)); if (driver == NULL) { report(RPT_ERR, "%s: error allocating driver", __FUNCTION__); return NULL; } /* And store its name and filename */ driver->name = malloc(strlen(name) + 1); if (driver->name == NULL) { report(RPT_ERR, "%s: error allocating driver name", __FUNCTION__); free(driver); return NULL; } strcpy(driver->name, name); driver->filename = malloc(strlen(filename) + 1); if (driver->filename == NULL) { report(RPT_ERR, "%s: error allocating driver filename", __FUNCTION__); free(driver->name); free(driver); return NULL; } strcpy(driver->filename, filename); /* Load and bind the driver module and locate the symbols */ if (driver_bind_module(driver) < 0) { report(RPT_ERR, "Driver [%.40s] binding failed", name); free(driver->name); free(driver->filename); free(driver); return NULL; } /* Check module version */ if (strcmp(*(driver->api_version), API_VERSION) != 0) { report(RPT_ERR, "Driver [%.40s] is of an incompatible version", name); driver_unbind_module(driver); free(driver->name); free(driver->filename); free(driver); return NULL; } /* Call the init function */ debug(RPT_DEBUG, "%s: Calling driver [%.40s] init function", __FUNCTION__, driver->name); res = driver->init(driver); if (res < 0) { report(RPT_ERR, "Driver [%.40s] init failed, return code %d", driver->name, res); /* Driver load failed, driver should not be added to list * Free driver structure again */ driver_unbind_module(driver); free(driver->name); free(driver->filename); free(driver); return NULL; } debug(RPT_NOTICE, "Driver [%.40s] loaded", driver->name); return driver; } /** Unload driver from memory. * \param driver Driver to unload. * \retval <0 Error. * \retval 0 Success. */ int driver_unload(Driver *driver) { debug(RPT_NOTICE, "Closing driver [%.40s]", driver->name); /* close the driver, if its \c close method is [already] defined */ if (driver->close != NULL) driver->close(driver); /* unload the module */ driver_unbind_module(driver); /* free its data */ free(driver->filename); driver->filename = NULL; free(driver->name); driver->name = NULL; free(driver); driver = NULL; debug(RPT_DEBUG, "%s: Driver unloaded", __FUNCTION__); return 0; } /** Dynamically load a module and bind it to the Driver's symbols. * \param driver Pointer to the Driver object. * \retval <0 Error. * \retval 0 Success. */ int driver_bind_module(Driver *driver) { int i; int missing_symbols = 0; debug(RPT_DEBUG, "%s(driver=[%.40s])", __FUNCTION__, driver->name); /* Load the module */ driver->module_handle = dlopen(driver->filename, RTLD_NOW); if (driver->module_handle == NULL) { report(RPT_ERR, "Could not open driver module %.40s: %s", driver->filename, dlerror()); return -1; } /* And locate the symbols */ for (i = 0; driver_symbols[i].name != NULL; i++) { void (**p)(); p = (void(**)()) ((size_t)driver + (driver_symbols[i].offset)); *p = NULL; /* 1) try to retrieve the symbol with the driver's symbol_prefix added */ if (driver->symbol_prefix != NULL) { char *s = malloc(strlen(*(driver->symbol_prefix)) + strlen(driver_symbols[i].name) + 1); strcpy(s, *(driver->symbol_prefix)); strcat(s, driver_symbols[i].name); debug(RPT_DEBUG, "%s: finding symbol: %s", __FUNCTION__, s); *p = dlsym(driver->module_handle, s); free(s); } /* 2) try to retrieve the symbol without the symbol prefix */ if (*p == NULL) { debug(RPT_DEBUG, "%s: finding symbol: %s", __FUNCTION__, driver_symbols[i].name); *p = dlsym(driver->module_handle, driver_symbols[i].name); } if (*p != NULL) { debug(RPT_DEBUG, "%s: found symbol at: %p", __FUNCTION__, *p); } else { /* Was the symbol required but not found ? */ if (driver_symbols[i].required) { report(RPT_ERR, "Driver [%.40s] does not have required symbol: %s", driver->name, driver_symbols[i].name); missing_symbols++; } } } /* If errors, leave now while we can :) */ if (missing_symbols > 0) { report(RPT_ERR, "Driver [%.40s] misses %d required symbols", driver->name, missing_symbols); dlclose(driver->module_handle); return -1; } /* Add our exported functions */ /* Config file functions */ driver->config_get_bool = config_get_bool; driver->config_get_int = config_get_int; driver->config_get_float = config_get_float; driver->config_get_string = config_get_string; driver->config_has_section = config_has_section; driver->config_has_key = config_has_key; /* Reporting */ driver->report = report; /* Driver private data */ driver->store_private_ptr = driver_store_private_ptr; /* Display size request */ driver->request_display_width = request_display_width; driver->request_display_height = request_display_height; return 0; } /** Unload a Driver's module. * \param driver Pointer to the driver object. * \retval <0 Error. * \retval 0 Success. */ int driver_unbind_module(Driver *driver) { debug(RPT_DEBUG, "%s(driver=[%.40s])", __FUNCTION__, driver->name); dlclose(driver->module_handle); return 0; } /** Determine if the driver is an output driver. * This is done by checking whether the driver knows dimensions * and supports the methods that write to the screen. * \param driver Pointer to the driver object. * \retval 0 No, it is not an output driver. * \retval 1 Yes, it is an output driver. */ bool driver_does_output(Driver *driver) { return (driver->width != NULL || driver->height != NULL || driver->clear != NULL || driver->string != NULL || driver->chr != NULL) ? 1 : 0; } /** Determine if the driver is an input driver. * This is done by checking whether the driver supports the \c get_key method. * \param driver Pointer to the driver object. * \retval 0 No, it is not an input driver. * \retval 1 Yes, it is an input driver. */ bool driver_does_input(Driver *driver) { return (driver->get_key != NULL) ? 1 : 0; } /** Tell if the driver needs to stay in the foreground. * \param driver Pointer to the driver object. * \retval 0 No, the driver does not need to stay in the foreground. * \retval 1 Yes, the driver needs to stay in the foreground. */ bool driver_stay_in_foreground(Driver *driver) { return *driver->stay_in_foreground; } /** Tell if the driver supports multiple instances. * \param driver Pointer to the driver object. * \retval 0 No, it doesn't. * \retval 1 Yes, it does. */ bool driver_supports_multiple(Driver *driver) { return *driver->supports_multiple; } static int driver_store_private_ptr(Driver *driver, void *private_data) { debug(RPT_DEBUG, "%s(driver=[%.40s], ptr=%p)", __FUNCTION__, driver->name, private_data); driver->private_data = private_data; return 0; } static int request_display_width(void) { if (!display_props) return 0; return display_props->width; } static int request_display_height(void) { if (!display_props) return 0; return display_props->height; } /** Draw a vertical bar bottom-up. * Fallback for the driver's \c vbar method if the driver does not provide one. * \param drv Pointer to driver structure. * \param x Horizontal character position (column) of the starting point. * \param y Vertical character position (row) of the starting point. * \param len Number of characters that the bar is high at 100% * \param promille Current height level of the bar in promille. * \param options Options (currently unused). */ void driver_alt_vbar(Driver *drv, int x, int y, int len, int promille, int options) { int pos; debug(RPT_DEBUG, "%s(drv=[%.40s], x=%d, y=%d, len=%d, promille=%d, options=%d)", __FUNCTION__, drv->name, x, y, len, promille, options); /* if the driver does not support output, do nothing */ if (drv->chr == NULL) return; for (pos = 0; pos < len; pos++) { if (2 * pos < ((long) promille * len / 500 + 1)) { drv->chr(drv, x, y-pos, '|'); } else { ; /* print nothing */ } } } /** Draw a horizontal bar to the right. * Fallback for the driver's \c hbar method if the driver does not provide one. * \param drv Pointer to driver structure. * \param x Horizontal character position (column) of the starting point. * \param y Vertical character position (row) of the starting point. * \param len Number of characters that the bar is long at 100% * \param promille Current length level of the bar in promille. * \param options Options (currently unused). */ void driver_alt_hbar(Driver *drv, int x, int y, int len, int promille, int options) { int pos; debug(RPT_DEBUG, "%s(drv=[%.40s], x=%d, y=%d, len=%d, promille=%d, options=%d)", __FUNCTION__, drv->name, x, y, len, promille, options); /* if the driver does not support output, do nothing */ if (drv->chr == NULL) return; for (pos = 0; pos < len; pos++) { if (2 * pos < ((long) promille * len / 500 + 1)) { drv->chr(drv, x+pos, y, '-'); } else { ; /* print nothing */ } } } /** Write a big number to the screen. * Fallback for the driver's \c num method if the driver does not provide one. * \param drv Pointer to driver structure. * \param x Horizontal character position (column). * \param num Character to write (0 - 10 with 10 representing ':') */ void driver_alt_num(Driver *drv, int x, int num) { /* Ugly code extracted by David GLAUDE from lcdm001.c ;)*/ /* Moved to driver.c by Joris Robijn */ static char num_map[][4][4] = { { /* 0 */ " _ ", "| |", "|_|", " " }, { /* 1 */ " ", " |", " |", " " }, { /* 2 */ " _ ", " _|", "|_ ", " " }, { /* 3 */ " _ ", " _|", " _|", " " }, { /* 4 */ " ", "|_|", " |", " " }, { /* 5 */ " _ ", "|_ ", " _|", " " }, { /* 6 */ " _ ", "|_ ", "|_|", " " }, { /* 7 */ " _ ", " |", " |", " " }, { /* 8 */ " _ ", "|_|", "|_|", " " }, { /* 9 */ " _ ", "|_|", " _|", " " }, { /* colon */ " ", ".", ".", " " } }; /* End of ugly code ;) by Rene Wagner */ /* I like this code ! Joris */ int y, dx; debug(RPT_DEBUG, "%s(drv=[%.40s], x=%d, num=%d)", __FUNCTION__, drv->name, x, num); if ((num < 0) || (num > 10)) return; /* if the driver does not support output, do nothing */ if (drv->chr == NULL) return; for (y = 0; y < 4; y++) for (dx = 0; num_map[num][y][dx] != '\0'; dx++) drv->chr(drv, x + dx, y+1, num_map[num][y][dx]); } /** Show the heartbeat. * Fallback for the driver's \c heartbeat method if the driver does not provide one. * \param drv Pointer to driver structure. * \param state Current heartbeat state. */ void driver_alt_heartbeat(Driver *drv, int state) { int icon; debug(RPT_DEBUG, "%s(drv=[%.40s], state=%d)", __FUNCTION__, drv->name, state); if (state == HEARTBEAT_OFF) return; /* Don't display anything */ /* if the driver does not support output, do nothing */ if (drv->width == NULL) return; /* Hmm, is this a good method ? * Or should we use clock() ? Or ftime ? Or gettimeofday ? */ icon = (timer & 5) ? ICON_HEART_FILLED : ICON_HEART_OPEN; if (drv->icon) drv->icon(drv, drv->width(drv), 1, icon); else driver_alt_icon(drv, drv->width(drv), 1, icon); } /** Place an icon on the screen. * Fallback for the driver's \c icon method, in case either the driver does not * provide one or the driver's method indicates the icon needs to be handled * by the server core. * \param drv Pointer to driver structure. * \param x Horizontal character position (column). * \param y Vertical character position (row). * \param icon synbolic value representing the icon. * * \note Icons used for 'play control' actually are composed of two * characters. Drivers must check for bounds on calls to chr()! */ void driver_alt_icon(Driver *drv, int x, int y, int icon) { char ch1 = '?'; char ch2 = '\0'; debug(RPT_DEBUG, "%s(drv=[%.40s], x=%d, y=%d, icon=ICON_%s)", __FUNCTION__, drv->name, x, y, widget_icon_to_iconname(icon)); /* if the driver does not support output, do nothing */ if (drv->chr == NULL) return; switch (icon) { case ICON_BLOCK_FILLED: ch1 = '#'; break; case ICON_HEART_OPEN: ch1 = '-'; break; case ICON_HEART_FILLED: ch1 = '#'; break; case ICON_ARROW_UP: ch1 = '^'; break; case ICON_ARROW_DOWN: ch1 = 'v'; break; case ICON_ARROW_LEFT: ch1 = '<'; break; case ICON_ARROW_RIGHT: ch1 = '>'; break; case ICON_CHECKBOX_OFF: ch1 = 'N'; break; case ICON_CHECKBOX_ON: ch1 = 'Y'; break; case ICON_CHECKBOX_GRAY: ch1 = 'o'; break; case ICON_SELECTOR_AT_LEFT: ch1 = '>'; break; case ICON_SELECTOR_AT_RIGHT: ch1 = '<'; break; case ICON_ELLIPSIS: ch1 = '_'; break; case ICON_STOP: ch1 = '['; ch2 = ']'; break; case ICON_PAUSE: ch1 = '|'; ch2 = '|'; break; case ICON_PLAY: ch1 = '>'; ch2 = ' '; break; case ICON_PLAYR: ch1 = '<'; ch2 = ' '; break; case ICON_FF: ch1 = '>'; ch2 = '>'; break; case ICON_FR: ch1 = '<'; ch2 = '<'; break; case ICON_NEXT: ch1 = '>'; ch2 = '|'; break; case ICON_PREV: ch1 = '|'; ch2 = '<'; break; case ICON_REC: ch1 = '('; ch2 = ')'; break; } drv->chr(drv, x, y, ch1); if (ch2 != '\0') drv->chr(drv, x+1, y, ch2); } /** Set cursor position and state. * Fallback for the driver's \c cursor method if the driver does not provide one. * \param drv Pointer to driver structure. * \param x Horizontal cursor position (column). * \param y Vertical cursor position (row). * \param state New cursor state. */ void driver_alt_cursor(Driver *drv, int x, int y, int state) { /* Same question about timer in this function... */ debug(RPT_DEBUG, "%s(drv=[%.40s], x=%d, y=%d, state=%d)", __FUNCTION__, drv->name, x, y, state); switch (state) { case CURSOR_BLOCK: case CURSOR_DEFAULT_ON: if ((timer & 2) && (drv->chr != NULL)) { if (drv->icon != NULL) { drv->icon(drv, x, y, ICON_BLOCK_FILLED); } else { driver_alt_icon(drv, x, y, ICON_BLOCK_FILLED); } } break; case CURSOR_UNDER: if ((timer & 2) && (drv->chr != NULL)) { drv->chr(drv, x, y, '_'); } break; } } lcdproc-0.5.7/server/driver.h000644 001751 000000 00000002361 12014174064 016725 0ustar00mmdolzewheel000000 000000 /** \file server/driver.h */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 2001, Joris Robijn */ #ifndef DRIVER_H #define DRIVER_H #include "drivers/lcd.h" #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef HAVE_STDBOOL_H # include #endif #include "shared/defines.h" Driver * driver_load(const char *name, const char *filename); int driver_unload(Driver *driver); int driver_bind_module(Driver *driver); int driver_unbind_module(Driver *driver); bool driver_does_output(Driver *driver); bool driver_does_input(Driver *driver); bool driver_support_multiple(Driver *driver); bool driver_stay_in_foreground(Driver *driver); /* Alternative functions for all extended functions */ void driver_alt_vbar(Driver *drv, int x, int y, int len, int promille, int pattern); void driver_alt_hbar(Driver *drv, int x, int y, int len, int promille, int pattern); void driver_alt_num(Driver *drv, int x, int num); void driver_alt_heartbeat(Driver *drv, int state); void driver_alt_icon(Driver *drv, int x, int y, int icon); void driver_alt_cursor(Driver *drv, int x, int y, int state); #endif lcdproc-0.5.7/server/drivers/000755 001751 000000 00000000000 12330423234 016732 5ustar00mmdolzewheel000000 000000 lcdproc-0.5.7/server/commands/000755 001751 000000 00000000000 12330423234 017055 5ustar00mmdolzewheel000000 000000 lcdproc-0.5.7/server/commands/Makefile.am000644 001751 000000 00000000577 10362772733 021140 0ustar00mmdolzewheel000000 000000 ## Process this file with automake to produce Makefile.in noinst_LIBRARIES = libLCDcommands.a libLCDcommands_a_SOURCES = command_list.c command_list.h client_commands.c client_commands.h menu_commands.c menu_commands.h screen_commands.c screen_commands.h server_commands.c server_commands.h widget_commands.c widget_commands.h AM_CPPFLAGS = -I$(top_srcdir) -I$(srcdir)/.. ## EOF lcdproc-0.5.7/server/commands/command_list.c000644 001751 000000 00000004371 12014174064 021702 0ustar00mmdolzewheel000000 000000 /** \file server/commands/command_list.c * Implements the dispatcher for handlers dealing with the client commands. * * This contains definitions for all the functions which clients can run. * The functions here are to be called only from parse.c's interpreter. */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven * 2003, Joris Robijn */ #include #include #include "command_list.h" #include "server_commands.h" #include "client_commands.h" #include "screen_commands.h" #include "widget_commands.h" #include "menu_commands.h" static client_function commands[] = { { "test_func", test_func_func }, { "hello", hello_func }, { "client_set", client_set_func }, { "client_add_key", client_add_key_func }, { "client_del_key", client_del_key_func }, /* { "screen_add_key", screen_add_key_func }, */ /* { "screen_del_key", screen_del_key_func }, */ { "screen_add", screen_add_func }, { "screen_del", screen_del_func }, { "screen_set", screen_set_func }, { "widget_add", widget_add_func }, { "widget_del", widget_del_func }, { "widget_set", widget_set_func }, { "menu_add_item", menu_add_item_func }, { "menu_del_item", menu_del_item_func }, { "menu_set_item", menu_set_item_func }, { "menu_goto", menu_goto_func }, { "menu_set_main", menu_set_main_func }, /* Misc stuff...*/ { "backlight", backlight_func }, { "output", output_func }, { "noop", noop_func }, { "info", info_func }, { "sleep", sleep_func }, { "bye", bye_func }, { NULL, NULL}, }; /** * Looks up a function for a command sent by the client. * \param cmd Command to look up as string. * \return Pointer to the implementing function. */ CommandFunc get_command_function(char *cmd) { int i; if (cmd == NULL) return NULL; for (i = 0; commands[i].keyword != NULL; i++) { if (0 == strcmp(cmd, commands[i].keyword)) return commands[i].function; } return NULL; } lcdproc-0.5.7/server/commands/command_list.h000644 001751 000000 00000001566 12014174064 021712 0ustar00mmdolzewheel000000 000000 /** \file server/commands/command_list.h * Declares client command dispatcher function. */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven */ #ifndef COMMANDS_COMMAND_LIST_H #define COMMANDS_COMMAND_LIST_H #include "client.h" /** * The function list for clients is stored in a table, and the items each * point to a function to call, defined below. */ typedef int (*CommandFunc) (Client *c, int argc, char **argv); /** Defines an entry in the command table */ typedef struct client_function { char *keyword; /**< Command string in the protocol */ CommandFunc function; /**< Pointer to the associated function */ } client_function; CommandFunc get_command_function(char *cmd); #endif lcdproc-0.5.7/server/commands/client_commands.c000644 001751 000000 00000014151 12014174064 022365 0ustar00mmdolzewheel000000 000000 /** \file server/commands/client_commands.c * Implements handlers for general client commands. * * This contains definitions for all the functions which clients can run. * The functions here are to be called only from parse.c's interpreter. * * The client's available function set is defined here, as is the syntax * for each command. */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven * 2002, Joris Robijn */ #include #include #include #include #include #include #include "shared/report.h" #include "shared/sockets.h" #include "drivers.h" #include "client.h" #include "render.h" #include "input.h" #include "client_commands.h" /** * Debugging only.. prints out a list of arguments it receives */ int test_func_func(Client *c, int argc, char **argv) { int i; for (i = 0; i < argc; i++) { report(RPT_INFO, "%s: %i -> %s", __FUNCTION__, i, argv[i]); sock_printf(c->sock, "%s: %i -> %s\n", __FUNCTION__, i, argv[i]); } return 0; } /** * The client must say "hello" before doing anything else. * * It sends back a string of info about the server to the client. * *\verbatim * Usage: hello *\endverbatim * * \todo Give \em real info about the server/lcd */ int hello_func(Client *c, int argc, char **argv) { if (argc > 1) { sock_send_error(c->sock, "extra parameters ignored\n"); } debug(RPT_INFO, "Hello!"); sock_printf(c->sock, "connect LCDproc %s protocol %s lcd wid %i hgt %i cellwid %i cellhgt %i\n", VERSION, PROTOCOL_VERSION, display_props->width, display_props->height, display_props->cellwidth, display_props->cellheight); /* make note that client has sent hello */ c->state = ACTIVE; return 0; } /** * The client should say "bye" before disconnecting * * The function does not respond to the client: it simply cuts connection. * *\verbatim * Usage: bye *\endverbatim */ int bye_func(Client *c, int argc, char **argv) { if (c != NULL) { debug(RPT_INFO, "Bye, %s!", (c->name != NULL) ? c->name : "unknown client"); c->state = GONE; //sock_send_error(c->sock, "\"bye\" is currently ignored\n"); } return 0; } /** * Sets info about the client, such as its name * *\verbatim * Usage: client_set -name *\endverbatim */ int client_set_func(Client *c, int argc, char **argv) { int i; if (c->state != ACTIVE) return 1; if (argc != 3) { sock_send_error(c->sock, "Usage: client_set -name \n"); return 0; } i = 1; do { char *p = argv[i]; /* ignore leading '-' in options: we allow both forms */ if (*p == '-') p++; /* Handle the "name" option */ if (strcmp(p, "name") == 0) { i++; if (argv[i] == '\0') { sock_printf_error(c->sock, "internal error: no parameter #%d\n", i); continue; } debug(RPT_DEBUG, "client_set: name=\"%s\"", argv[i]); /* set the name...*/ if (c->name != NULL) free(c->name); if ((c->name = strdup(argv[i])) == NULL) { sock_send_error(c->sock, "error allocating memory!\n"); } else { sock_send_string(c->sock, "success\n"); i++; /* bypass argument (name string)*/ } } else { sock_printf_error(c->sock, "invalid parameter (%s)\n", p); } } while (++i < argc); return 0; } /** * Tells the server the client would like to accept keypresses * of a particular type * *\verbatim * Usage: client_add_key [-exclusively|-shared] {}+ *\endverbatim */ int client_add_key_func(Client *c, int argc, char **argv) { int exclusively = 0; int argnr; if (c->state != ACTIVE) return 1; if (argc < 2) { sock_send_error(c->sock, "Usage: client_add_key [-exclusively|-shared] {}+\n"); return 0; } argnr = 1; if (argv[argnr][0] == '-') { if (strcmp( argv[argnr], "-shared") == 0) { exclusively = 0; } else if(strcmp(argv[argnr], "-exclusively") == 0) { exclusively = 1; } else { sock_printf_error(c->sock, "Invalid option: %s\n", argv[argnr]); } argnr++; } for ( ; argnr < argc; argnr++) { if (input_reserve_key(argv[argnr], exclusively, c) < 0) { sock_printf_error(c->sock, "Could not reserve key \"%s\"\n", argv[argnr]); } } sock_send_string(c->sock, "success\n"); return 0; } /** * Tells the server the client would NOT like to accept keypresses * of a particular type * *\verbatim * Usage: client_del_key {}+ *\endverbatim */ int client_del_key_func(Client *c, int argc, char **argv) { int argnr; if (c->state != ACTIVE) return 1; if (argc < 2) { sock_send_error(c->sock, "Usage: client_del_key {}+\n"); return 0; } for (argnr = 1; argnr < argc; argnr++) { input_release_key(argv[argnr], c); } sock_send_string(c->sock, "success\n"); return 0; } /** * Toggles the backlight, if enabled. * *\verbatim * Usage: backlight {on|off|toggle|blink|flash} *\endverbatim */ int backlight_func(Client *c, int argc, char **argv) { if (c->state != ACTIVE) return 1; if (argc != 2) { sock_send_error(c->sock, "Usage: backlight {on|off|toggle|blink|flash}\n"); return 0; } debug(RPT_DEBUG, "backlight(%s)", argv[1]); //backlight = (backlight && 1); /* only preserves ON/OFF bit*/ if (strcmp ("on", argv[1]) == 0) { c->backlight = BACKLIGHT_ON; } else if (strcmp ("off", argv[1]) == 0) { c->backlight = BACKLIGHT_OFF; } else if (strcmp ("toggle", argv[1]) == 0) { if (c->backlight == BACKLIGHT_ON) c->backlight = BACKLIGHT_OFF; else if (c->backlight == BACKLIGHT_OFF) c->backlight = BACKLIGHT_ON; } else if (strcmp ("blink", argv[1]) == 0) { c->backlight |= BACKLIGHT_BLINK; } else if (strcmp ("flash", argv[1]) == 0) { c->backlight |= BACKLIGHT_FLASH; } sock_send_string(c->sock, "success\n"); return 0; } /** * Sends back information about the loaded drivers. * *\verbatim * Usage: info *\endverbatim */ int info_func(Client *c, int argc, char **argv) { if (c->state != ACTIVE) return 1; if (argc > 1) { sock_send_error(c->sock, "Extra arguments ignored...\n"); } sock_printf(c->sock, "%s\n", drivers_get_info()); return 0; } lcdproc-0.5.7/server/commands/client_commands.h000644 001751 000000 00000001306 11621737634 022403 0ustar00mmdolzewheel000000 000000 /** \file server/commands/client_commands.h */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven * 2002, Joris Robijn */ #ifndef COMMANDS_CLIENT_H #define COMMANDS_CLIENT_H int hello_func(Client *c, int argc, char **argv); int bye_func(Client *c, int argc, char **argv); int client_set_func(Client *c, int argc, char **argv); int client_add_key_func(Client *c, int argc, char **argv); int client_del_key_func(Client *c, int argc, char **argv); int backlight_func(Client *c, int argc, char **argv); #endif lcdproc-0.5.7/server/commands/menu_commands.c000644 001751 000000 00000067106 12035322145 022061 0ustar00mmdolzewheel000000 000000 /** \file server/commands/menu_commands.c * Implements handlers for client commands concerning menus. * * This contains definitions for all the functions which clients can run. * The functions here are to be called only from parse.c's interpreter. * * The client's available function set is defined here, as is the syntax * for each command. */ /* This file is part of LCDd, the lcdproc server. * * This file is released under the GNU General Public License. * Refer to the COPYING file distributed with this package. * * Copyright (c) 1999, William Ferrell, Selene Scriven * 2002, Joris Robijn * 2004, F5 Networks, Inc. - IP-address input * 2005, Peter Marschall - error checks, ... */ #include #include #include #include #include #include #include #include #include "shared/report.h" #include "shared/sockets.h" #include "client.h" #include "menuitem.h" #include "menu.h" #include "menuscreens.h" #include "menu_commands.h" /* Local functions */ MenuEventFunc(menu_commands_handler); int set_predecessor(MenuItem *item, char *itemid, Client *client); int set_successor(MenuItem *item, char *itemid, Client *client); /** small utility for debug output of command line. */ static char *argv2string(int argc, char **argv) { char *rtn = NULL; unsigned int len; unsigned int i; for (i = len = 0; i < argc; i++) len += strlen(argv[i]) + 1; rtn = malloc(len + 1); if (rtn != NULL) { rtn[0] = '\0'; for (i = 0; i < argc; i++) { strcat(rtn, argv[i]); strcat(rtn, " "); } } return rtn; } /** * Adds an item to a menu. * *\verbatim * Usage: menu_add_item [] {