[Spice-commits] 4 commits - SpiceXPI/src data/test.html

Christophe Fergau teuf at kemper.freedesktop.org
Mon Mar 5 07:47:07 PST 2012


 SpiceXPI/src/plugin/plugin.cpp |    9 ++++++++-
 SpiceXPI/src/plugin/plugin.h   |    1 +
 data/test.html                 |    2 ++
 3 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit fcb9c6364ea94d22e699707c8b707d6c932a9f61
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Mon Mar 5 12:31:19 2012 +0100

    Add ctrl-alt-del setting to test page

diff --git a/data/test.html b/data/test.html
index ce94acd..83fcc14 100644
--- a/data/test.html
+++ b/data/test.html
@@ -39,6 +39,7 @@ function Execute()
     embed.fullScreen = false;
     embed.AdminConsole = (document.all["AdminConsole"].value == "1");
     embed.HotKeys = document.all["HotKeys"].value;
+    embed.SendCtrlAltdelete = (document.all["SendCtrlAltdelete"].value == "1")
     embed.fAudio = true;
     embed.connect();
 }
@@ -65,6 +66,7 @@ SecurePort: <input id="SecurePort" type="text" size="13"> </input> <BR>
 Password: <input id="Password" type="text" size="13"> </input>
 HotKeys: <input id="HotKeys" type="text" size="13" value="release-cursor=ctrl+alt"> </input>
 AdminConsole: <input id="AdminConsole" type="text" size="5" value="1"> </input>
+SendCtrlAltdelete: <input id="SendCtrlAltdelete" type="text" size="5" value="1"> </input>
 <BR>
 HostSubject: <input id="HostSubject" type="text" size="60"> </input></br>
 TrustStore: <textarea id="TrustStore" type="text" cols="65" rows="15"> </textarea> <BR>
commit 15f039b440ad28a2f599e4f21310e4a5b11a94d1
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Mon Mar 5 12:30:56 2012 +0100

    Add controller message for "SEND_CAD"

diff --git a/SpiceXPI/src/plugin/plugin.cpp b/SpiceXPI/src/plugin/plugin.cpp
index 220ac39..1564b70 100644
--- a/SpiceXPI/src/plugin/plugin.cpp
+++ b/SpiceXPI/src/plugin/plugin.cpp
@@ -651,6 +651,7 @@ void nsPluginInstance::Connect()
         SendStr(CONTROLLER_PASSWORD, m_password.c_str());
         SendStr(CONTROLLER_TLS_CIPHERS, m_cipher_suite.c_str());
         SendStr(CONTROLLER_SET_TITLE, m_title.c_str());
+        SendBool(CONTROLLER_SEND_CAD, m_send_ctrlaltdel);
 
         /*
          * HACK -- remove leading s from m_SSLChannels, e.g. "main" not "smain"
commit 0a91bd1dbf10f3b07832d3519cb68adcdefed776
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Mon Mar 5 13:47:45 2012 +0100

    Use ::SendBool for smartcard control

diff --git a/SpiceXPI/src/plugin/plugin.cpp b/SpiceXPI/src/plugin/plugin.cpp
index cfa70cd..220ac39 100644
--- a/SpiceXPI/src/plugin/plugin.cpp
+++ b/SpiceXPI/src/plugin/plugin.cpp
@@ -647,7 +647,7 @@ void nsPluginInstance::Connect()
         SendValue(CONTROLLER_FULL_SCREEN,
                    (m_fullscreen == PR_TRUE ? CONTROLLER_SET_FULL_SCREEN : 0) |
                    (m_admin_console == PR_FALSE ? CONTROLLER_AUTO_DISPLAY_RES : 0));
-        SendValue(CONTROLLER_ENABLE_SMARTCARD, m_smartcard == PR_TRUE ? 1 : 0);
+        SendBool(CONTROLLER_ENABLE_SMARTCARD, m_smartcard);
         SendStr(CONTROLLER_PASSWORD, m_password.c_str());
         SendStr(CONTROLLER_TLS_CIPHERS, m_cipher_suite.c_str());
         SendStr(CONTROLLER_SET_TITLE, m_title.c_str());
commit 6cd20af5b3df49882f4cddcc8d5f91e400587a37
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Mon Mar 5 13:46:20 2012 +0100

    Add nsPluginInstance::SendBool
    
    ::SendVal will not send messages when the value is 0, which is not
    what is expected when sending a boolean value.

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:


More information about the Spice-commits mailing list