- 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:
+71
-11
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
@@ -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
@@ -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
|
||||
|
||||
@@ -186,6 +186,9 @@ goodbye_screen ()
|
||||
char *l16 = " LCDproc! ";
|
||||
#endif
|
||||
|
||||
if( !display_props )
|
||||
return 0;
|
||||
|
||||
drivers_clear ();
|
||||
|
||||
if (display_props->height >= 4) {
|
||||
|
||||
Reference in New Issue
Block a user