diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2012-03-05 13:46:20 +0100 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2012-03-05 14:32:53 +0100 |
commit | 6cd20af5b3df49882f4cddcc8d5f91e400587a37 (patch) | |
tree | 3353f265699eb23b9cc4fc4ebd9b680ff2e76f56 /SpiceXPI | |
parent | 38c58f047e339dbc8fc4718531d25ecddf06c725 (diff) |
Add nsPluginInstance::SendBool
::SendVal will not send messages when the value is 0, which is not
what is expected when sending a boolean value.
Diffstat (limited to 'SpiceXPI')
-rw-r--r-- | SpiceXPI/src/plugin/plugin.cpp | 6 | ||||
-rw-r--r-- | SpiceXPI/src/plugin/plugin.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/SpiceXPI/src/plugin/plugin.cpp b/SpiceXPI/src/plugin/plugin.cpp index 2860d5e..cfa70cd 100644 --- a/SpiceXPI/src/plugin/plugin.cpp +++ b/SpiceXPI/src/plugin/plugin.cpp @@ -515,6 +515,12 @@ void nsPluginInstance::SendValue(uint32_t id, uint32_t value) WriteToPipe(&msg, sizeof(msg)); } +void nsPluginInstance::SendBool(uint32_t id, bool value) +{ + ControllerValue msg = { {id, sizeof(msg)}, value }; + WriteToPipe(&msg, sizeof(msg)); +} + void nsPluginInstance::SendStr(uint32_t id, const char *str) { if (!strlen(str)) diff --git a/SpiceXPI/src/plugin/plugin.h b/SpiceXPI/src/plugin/plugin.h index 7bd1e44..3b17a98 100644 --- a/SpiceXPI/src/plugin/plugin.h +++ b/SpiceXPI/src/plugin/plugin.h @@ -170,6 +170,7 @@ private: void SendValue(uint32_t id, uint32_t value); void SendStr(uint32_t id, const char *str); void SendWStr(uint32_t id, const wchar_t *str); + void SendBool(uint32_t id, bool value); void CallOnDisconnected(int code); private: |