|
From: <mla...@us...> - 2008-01-31 05:02:53
|
Revision: 457
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=457&view=rev
Author: mlampard
Date: 2008-01-30 21:02:46 -0800 (Wed, 30 Jan 2008)
Log Message:
-----------
g15daemon 1.9x: Add --set-backlight cmdline option to allow for individual per-screen backlight settings
Modified Paths:
--------------
trunk/g15daemon-wip/ChangeLog
trunk/g15daemon-wip/g15daemon/main.c
Modified: trunk/g15daemon-wip/ChangeLog
===================================================================
--- trunk/g15daemon-wip/ChangeLog 2008-01-28 06:05:31 UTC (rev 456)
+++ trunk/g15daemon-wip/ChangeLog 2008-01-31 05:02:46 UTC (rev 457)
@@ -169,3 +169,7 @@
SVN:
- BugFix: plugins/g15daemon_net.c: ensure that OOB traffic is not mixed with
normal image buffers.
+- Feature: Add --set-backlight to allow clients (and the backlight button)
+ to set the backlight level for the currently shown screen only. Default is
+ now to disallow clients changing backlight, and to set backlight globally
+ via the button.
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2008-01-28 06:05:31 UTC (rev 456)
+++ trunk/g15daemon-wip/g15daemon/main.c 2008-01-31 05:02:46 UTC (rev 457)
@@ -54,6 +54,7 @@
unsigned int g15daemon_debug = 0;
unsigned int cycle_key;
unsigned int client_handles_keys = 0;
+static unsigned int set_backlight = 0;
struct lcd_t *keyhandler = NULL;
static int loaded_plugins = 0;
@@ -246,7 +247,7 @@
uf_write_buf_to_g15(displaying);
g15daemon_log(LOG_DEBUG,"LCD Update Complete");
- if(prev_state!=displaying->backlight_state) {
+ if(prev_state!=displaying->backlight_state && set_backlight!=0) {
prev_state=displaying->backlight_state;
pthread_mutex_lock(&g15lib_mutex);
setLCDBrightness(displaying->backlight_state);
@@ -362,13 +363,14 @@
if (!strncmp(daemonargs, "-h",2) || !strncmp(daemonargs, "--help",6)) {
printf("G15Daemon version %s - %s\n",VERSION,uf_return_running() >= 0 ?"Loaded & Running":"Not Running");
- printf("%s -h (--help) or -k (--kill) or -s (--switch) or -d (--debug) [level] or -v (--version) or -l (--lcdlevel) [0-2] \n\n -k will kill a previous incarnation",argv[0]);
+ printf("%s -h (--help) or -k (--kill) or -s (--switch) or -d (--debug) [level] or -v (--version) or -l (--lcdlevel) [0-2] \n\n -k\twill kill a previous incarnation",argv[0]);
#ifdef LIBG15_VERSION
#if LIBG15_VERSION >= 1200
- printf(", if uppercase -K or -KILL turn off the keyboard backlight on the way out.");
+ printf("\n -K\tturn off the keyboard backlight on the way out.");
#endif
#endif
- printf("\n -h shows this help\n -s changes the screen-switch key from L1 to MR (beware)\n -d debug mode - stay in foreground and output all debug messages to STDERR\n -v show version\n -l set default LCD backlight level\n");
+ printf("\n -h\tshows this help\n -s\tchanges the screen-switch key from L1 to MR (beware)\n -d\tdebug mode - stay in foreground and output all debug messages to STDERR\n -v\tshow version\n -l\tset default LCD backlight level\n");
+ printf(" --set-backlight sets backlight individually for currently shown screen.\n\t\tDefault is to set backlight globally (keyboard default).\n");
exit(0);
}
@@ -377,6 +379,10 @@
cycle_cmdline_override=1;
}
+ if (!strncmp(daemonargs, "--set-backlight",15)) {
+ set_backlight = 1;
+ }
+
if (!strncmp(daemonargs, "-d",2) || !strncmp(daemonargs, "--debug",7)) {
g15daemon_debug = 1;
if((argv[i+1])!=NULL)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|