- Now using driver names without 'in' (like lircin).

- Added cursor control to client_functions.c
- Removed HEART_ON etc. ; changed to HEARTBEAT_ON etc. (both existed)
This commit is contained in:
robijn
2002-03-27 22:38:12 +00:00
parent 6910ac705e
commit 707fd2300d
6 changed files with 88 additions and 31 deletions
+4 -4
View File
@@ -6,7 +6,7 @@ AC_ARG_ENABLE(drivers,
[ drivers may be separated with commas.]
[ Possible choices are:]
[ mtxorb,cfontz,curses,text,lb216,]
[ hd44780,joy,irman,lircin,bayrad,glk,]
[ hd44780,joy,irman,lirc,bayrad,glk,]
[ stv5730,sed1330,sed1520,svga,lcdm001,t6963]
[ \"all\" compiles all drivers],
drivers="$enableval",
@@ -51,7 +51,7 @@ fi
AC_CHECK_HEADER(ncurses.h,
dnl We have ncurses.h and libncurses, add driver.
LIBCURSES="-lncurses"
DRIVERS="$DRIVERS curses_drv${SO}"
DRIVERS="$DRIVERS curses${SO}"
actdrivers=["$actdrivers curses"]
,
dnl else
@@ -63,7 +63,7 @@ dnl else
AC_CHECK_HEADER(curses.h,
dnl We have curses.h and libcurses, add driver.
LIBCURSES="-lcurses"
DRIVERS="$DRIVERS curses_drv${SO}"
DRIVERS="$DRIVERS curses${SO}"
actdrivers=["$actdrivers curses"]
,
dnl else
@@ -132,7 +132,7 @@ dnl else
AC_CHECK_LIB(lirc_client, main,
LIBLIRC_CLIENT="-llirc_client"
DRIVERS="$DRIVERS lirc${SO}"
actdrivers=["$actdrivers lircin"]
actdrivers=["$actdrivers lirc"]
,
dnl else
AC_MSG_WARN([The lirc driver needs the lirc client library])
+71 -11
View File
@@ -560,7 +560,8 @@ screen_del_func (client * c, int argc, char **argv)
* name, priority, or duration
*
* usage: screen_set <id> [ -priority <int> ] [ -name <name> ] [ -duration <int> ]
* [ -wid <width> ] [ -hgt <height> ] [ -heartbeat <type> ]
* [ -wid <width> ] [ -hgt <height> ] [ -heartbeat <type> ] [ -cursor <type> ]
* [ -cursor_x <xpos> ] [ -cursor_y <ypos> ]
*/
int
screen_set_func (client * c, int argc, char **argv)
@@ -654,19 +655,19 @@ screen_set_func (client * c, int argc, char **argv)
/* set the heartbeat type...*/
if (0 == strcmp (argv[i], "on"))
s->heartbeat = HEART_ON;
s->heartbeat = HEARTBEAT_ON;
if (0 == strcmp (argv[i], "heart"))
s->heartbeat = HEART_ON;
s->heartbeat = HEARTBEAT_ON;
if (0 == strcmp (argv[i], "normal"))
s->heartbeat = HEART_ON;
s->heartbeat = HEARTBEAT_ON;
if (0 == strcmp (argv[i], "default"))
s->heartbeat = HEART_ON;
s->heartbeat = HEARTBEAT_ON;
if (0 == strcmp (argv[i], "off"))
s->heartbeat = HEART_OFF;
s->heartbeat = HEARTBEAT_OFF;
if (0 == strcmp (argv[i], "none"))
s->heartbeat = HEART_OFF;
s->heartbeat = HEARTBEAT_OFF;
if (0 == strcmp (argv[i], "slash"))
s->heartbeat = HEART_OPEN;
s->heartbeat = HEARTBEAT_SLASH;
sock_send_string(c->sock, "success\n");
} else {
sock_send_string (c->sock, "huh? -heartbeat requires a parameter\n");
@@ -722,8 +723,7 @@ screen_set_func (client * c, int argc, char **argv)
sock_send_string (c->sock, "huh? -timeout requires a parameter\n");
}
}
/* Handle the backlight parameter*/
/* Handle the "backlight" parameter*/
else if (strcmp (argv[i], "backlight") == 0) {
if (argc > i + 1) {
i++;
@@ -759,7 +759,67 @@ screen_set_func (client * c, int argc, char **argv)
} else {
sock_send_string (c->sock, "huh? -backlight requires a parameter\n");
}
} else sock_send_string (c->sock, "huh? invalid parameter\n");
}
/* Handle the "cursor" parameter */
else if (strcmp (argv[i], "cursor") == 0) {
if (argc > i + 1) {
i++;
debug (RPT_DEBUG, "screen_set: cursor=\"%s\"", argv[i]);
/* set the heartbeat type...*/
if (0 == strcmp (argv[i], "off"))
s->heartbeat = CURSOR_OFF;
if (0 == strcmp (argv[i], "on"))
s->cursor = CURSOR_DEFAULT_ON;
if (0 == strcmp (argv[i], "under"))
s->cursor = CURSOR_UNDER;
if (0 == strcmp (argv[i], "block"))
s->cursor = CURSOR_BLOCK;
sock_send_string(c->sock, "success\n");
} else {
sock_send_string (c->sock, "huh? -cursor requires a parameter\n");
}
}
/* Handle the "cursor_x" parameter */
else if (strcmp (p, "cursor_x") == 0) {
if (argc > i + 1) {
i++;
debug (RPT_DEBUG, "screen_set: cursor_x=\"%s\"", argv[i]);
/* set the position...*/
number = atoi (argv[i]);
if (number > 0 && number <= s->wid) {
s->cursor_x = number;
sock_send_string(c->sock, "success\n");
}
else {
sock_send_string(c->sock, "huh? cursor position outside screen\n");
}
} else {
sock_send_string (c->sock, "huh? -cursor_x requires a parameter\n");
}
}
/* Handle the "cursor_y" parameter */
else if (strcmp (p, "cursor_y") == 0) {
if (argc > i + 1) {
i++;
debug (RPT_DEBUG, "screen_set: cursor_y=\"%s\"", argv[i]);
/* set the position...*/
number = atoi (argv[i]);
if (number > 0 && number <= s->hgt) {
s->cursor_y = number;
sock_send_string(c->sock, "success\n");
}
else {
sock_send_string(c->sock, "huh? cursor position outside screen\n");
}
} else {
sock_send_string (c->sock, "huh? -cursor_y requires a parameter\n");
}
}
else sock_send_string (c->sock, "huh? invalid parameter\n");
}/* done checking argv*/
return 0;
}
+5 -8
View File
@@ -42,19 +42,16 @@
#define BACKLIGHT_WARNING 2
#define BACKLIGHT_RED_ALERT 3
// Icons for icon function
/* Icons for icon function */
#define ICON_BLOCK_FILLED 0
#define ICON_HEART_OPEN 8
#define ICON_HEART_FILLED 9
/* Heartbeat data, taken from render.h */
/* ??? What do all these mean ? */
#define HEART_OFF 1
#define HEART_ON 2
#define HEART_OPEN 3
#define HEARTBEAT_OFF HEART_OFF
#define HEARTBEAT_ON HEART_ON
#define HEARTBEAT_OPEN HEART_OPEN
/* ??? What does OPEN mean here ? */
#define HEARTBEAT_OFF 0
#define HEARTBEAT_ON 1
#define HEARTBEAT_OPEN 2
/* Patterns for hbar / vbar */
#define BAR_POS 0x001 /* default */
+1 -1
View File
@@ -39,7 +39,7 @@
#include "widget.h"
#include "render.h"
int heartbeat = HEART_OPEN;
int heartbeat = HEARTBEAT_OPEN;
int backlight = BACKLIGHT_OPEN;
int backlight_state = BACKLIGHT_OPEN;
int backlight_brightness = 255;
+4 -7
View File
@@ -14,13 +14,10 @@
#include "screen.h"
#define HEART_OFF 1
#define HEART_ON 2
#define HEART_OPEN 3
#define HEARTBEAT_OFF HEART_OFF
#define HEARTBEAT_ON HEART_ON
#define HEARTBEAT_OPEN HEART_OPEN
#define HEARTBEAT_OFF 0
#define HEARTBEAT_ON 1
#define HEARTBEAT_OPEN 2
#define HEARTBEAT_SLASH 3
#define SERVER_SCREEN_NEVER 0
#define SERVER_SCREEN_NOSCREEN 1
+3
View File
@@ -186,6 +186,9 @@ goodbye_screen ()
char *l16 = " LCDproc! ";
#endif
if( !display_props )
return 0;
drivers_clear ();
if (display_props->height >= 4) {