summaryrefslogtreecommitdiff
path: root/SpiceXPI
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2012-03-05 13:46:20 +0100
committerChristophe Fergeau <cfergeau@redhat.com>2012-03-05 14:32:53 +0100
commit6cd20af5b3df49882f4cddcc8d5f91e400587a37 (patch)
tree3353f265699eb23b9cc4fc4ebd9b680ff2e76f56 /SpiceXPI
parent38c58f047e339dbc8fc4718531d25ecddf06c725 (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.cpp6
-rw-r--r--SpiceXPI/src/plugin/plugin.h1
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: