|
From: <mla...@us...> - 2008-01-13 02:58:55
|
Revision: 410
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=410&view=rev
Author: mlampard
Date: 2008-01-12 18:58:55 -0800 (Sat, 12 Jan 2008)
Log Message:
-----------
Add NEVER_SELECT cmd to client API. Screens using this cmd will always be hidden unless SWITCH_PRIORITY is used.
Modified Paths:
--------------
trunk/g15daemon-wip/ChangeLog
trunk/g15daemon-wip/g15daemon/g15daemon.h
trunk/g15daemon-wip/g15daemon/linked_lists.c
trunk/g15daemon-wip/libg15daemon_client/g15daemon_client.h
trunk/g15daemon-wip/libg15daemon_client/g15daemon_net.c
trunk/g15daemon-wip/plugins/g15_plugin_net.c
Modified: trunk/g15daemon-wip/ChangeLog
===================================================================
--- trunk/g15daemon-wip/ChangeLog 2008-01-12 15:16:26 UTC (rev 409)
+++ trunk/g15daemon-wip/ChangeLog 2008-01-13 02:58:55 UTC (rev 410)
@@ -150,4 +150,6 @@
- Optimisation: Use pthread conditional variable to signal LCD state change.
Further reduces unnecessary wakeups.
1.9.4->SVN
-- Add example udev helper scripts to contrib directory.
\ No newline at end of file
+- Add example udev helper scripts to contrib directory.
+- API: Add NEVER_SELECT cmd to client API to enforce non-display on
+ client-switch. Used by G15Macro if available.
Modified: trunk/g15daemon-wip/g15daemon/g15daemon.h
===================================================================
--- trunk/g15daemon-wip/g15daemon/g15daemon.h 2008-01-12 15:16:26 UTC (rev 409)
+++ trunk/g15daemon-wip/g15daemon/g15daemon.h 2008-01-13 02:58:55 UTC (rev 410)
@@ -46,6 +46,7 @@
#define CLIENT_CMD_GET_KEYSTATE 'k'
#define CLIENT_CMD_SWITCH_PRIORITIES 'p'
+#define CLIENT_CMD_NEVER_SELECT 'n'
#define CLIENT_CMD_IS_FOREGROUND 'v'
#define CLIENT_CMD_IS_USER_SELECTED 'u'
#define CLIENT_CMD_BACKLIGHT 0x80
@@ -176,8 +177,10 @@
unsigned int mkey_state;
unsigned int contrast_state;
unsigned int state_changed;
- /* set to 1 if user manually selected this screen 0 otherwise*/
+ /* set to 1 if user manually selected this screen 0 otherwise */
unsigned int usr_foreground;
+ /* set to 1 if screen is never to be user-selectable */
+ unsigned int never_select;
/* only used for plugins */
plugin_t *g15plugin;
Modified: trunk/g15daemon-wip/g15daemon/linked_lists.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/linked_lists.c 2008-01-12 15:16:26 UTC (rev 409)
+++ trunk/g15daemon-wip/g15daemon/linked_lists.c 2008-01-13 02:58:55 UTC (rev 410)
@@ -116,7 +116,9 @@
/* cycle through connected client displays */
void g15daemon_lcdnode_cycle(g15daemon_t *masterlist)
{
- lcdnode_t *current_screen = masterlist->current;
+ lcdnode_t *current_screen = NULL;
+skip:
+ current_screen = masterlist->current;
g15daemon_send_event(current_screen->lcd, G15_EVENT_VISIBILITY_CHANGED, SCR_HIDDEN);
@@ -140,6 +142,12 @@
} else {
masterlist->current = masterlist->current->prev;
}
+
+ if(masterlist->current->lcd->never_select==1) {
+ pthread_mutex_unlock(&lcdlist_mutex);
+ goto skip;
+ }
+
masterlist->current->last_priority = masterlist->current;
pthread_mutex_unlock(&lcdlist_mutex);
g15daemon_send_event(current_screen->lcd, G15_EVENT_USER_FOREGROUND, 1);
Modified: trunk/g15daemon-wip/libg15daemon_client/g15daemon_client.h
===================================================================
--- trunk/g15daemon-wip/libg15daemon_client/g15daemon_client.h 2008-01-12 15:16:26 UTC (rev 409)
+++ trunk/g15daemon-wip/libg15daemon_client/g15daemon_client.h 2008-01-13 02:58:55 UTC (rev 410)
@@ -50,7 +50,8 @@
#define G15DAEMON_SWITCH_PRIORITIES 'p'
#define G15DAEMON_IS_FOREGROUND 'v'
#define G15DAEMON_IS_USER_SELECTED 'u'
-
+ #define G15DAEMON_NEVER_SELECT 'n'
+
const char *g15daemon_version();
/* open a new connection to the g15daemon. returns an fd to be used with g15_send & g15_recv */
Modified: trunk/g15daemon-wip/libg15daemon_client/g15daemon_net.c
===================================================================
--- trunk/g15daemon-wip/libg15daemon_client/g15daemon_net.c 2008-01-12 15:16:26 UTC (rev 409)
+++ trunk/g15daemon-wip/libg15daemon_client/g15daemon_net.c 2008-01-13 02:58:55 UTC (rev 410)
@@ -217,6 +217,10 @@
packet[0] = (unsigned char)command;
retval = send( sock, packet, 1, MSG_OOB );
break;
+ case G15DAEMON_NEVER_SELECT:
+ packet[0] = (unsigned char)command;
+ retval = send( sock, packet, 1, MSG_OOB );
+ break;
case G15DAEMON_GET_KEYSTATE:{
retval = 0;
unsigned long keystate = 0;
Modified: trunk/g15daemon-wip/plugins/g15_plugin_net.c
===================================================================
--- trunk/g15daemon-wip/plugins/g15_plugin_net.c 2008-01-12 15:16:26 UTC (rev 409)
+++ trunk/g15daemon-wip/plugins/g15_plugin_net.c 2008-01-13 02:58:55 UTC (rev 410)
@@ -69,6 +69,12 @@
g15daemon_send_event(lcdnode,G15_EVENT_REQ_PRIORITY,1);
break;
}
+ case CLIENT_CMD_NEVER_SELECT: { /* client can never be user-selected */
+ pthread_mutex_lock(&lcdlist_mutex);
+ lcdnode->lcd->never_select = 1;
+ pthread_mutex_unlock(&lcdlist_mutex);
+ break;
+ }
case CLIENT_CMD_IS_FOREGROUND: { /* client wants to know if it's currently viewable */
pthread_mutex_lock(&lcdlist_mutex);
memset(msgbuf,0,2);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|