summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYonit Halperin <yhalperi@redhat.com>2012-04-02 10:31:06 +0300
committerYonit Halperin <yhalperi@redhat.com>2012-04-03 09:04:51 +0300
commitf07d6824590085de149eabd1a33d61efeb373bc4 (patch)
tree43e494e08dc2a62cc0ded79cc156e8f2dd2dd4b7
parentce4097f049aaf31393a1d44facbd3abf3d7056bc (diff)
add support for DisableEffects and ColorDepth
- ColorDepth should be 32 or 16 - DisableEffects is a comma separated string, composed of one or more of the following options: "wallpaper"/"font-smooth"/"animation", or "all" rhbz #747313 Signed-off-by: Yonit Halperin <yhalperi@redhat.com>
-rw-r--r--SpiceXPI/src/plugin/nsISpicec.idl2
-rw-r--r--SpiceXPI/src/plugin/nsScriptablePeer.cpp16
-rw-r--r--SpiceXPI/src/plugin/nsScriptablePeer.h2
-rw-r--r--SpiceXPI/src/plugin/plugin.cpp26
-rw-r--r--SpiceXPI/src/plugin/plugin.h10
-rw-r--r--data/test.html12
m---------spice-protocol0
7 files changed, 67 insertions, 1 deletions
diff --git a/SpiceXPI/src/plugin/nsISpicec.idl b/SpiceXPI/src/plugin/nsISpicec.idl
index 5fc4a29..d3d0699 100644
--- a/SpiceXPI/src/plugin/nsISpicec.idl
+++ b/SpiceXPI/src/plugin/nsISpicec.idl
@@ -61,6 +61,8 @@ interface nsISpicec : nsISupports {
attribute unsigned short UsbListenPort;
attribute boolean UsbAutoShare;
attribute boolean Smartcard;
+ attribute string ColorDepth;
+ attribute string DisableEffects;
void connect();
void show();
diff --git a/SpiceXPI/src/plugin/nsScriptablePeer.cpp b/SpiceXPI/src/plugin/nsScriptablePeer.cpp
index 394ced8..caab9b7 100644
--- a/SpiceXPI/src/plugin/nsScriptablePeer.cpp
+++ b/SpiceXPI/src/plugin/nsScriptablePeer.cpp
@@ -79,6 +79,8 @@ NPIdentifier ScriptablePluginObject::m_id_no_taskmgr_execution;
NPIdentifier ScriptablePluginObject::m_id_send_ctrlaltdel;
NPIdentifier ScriptablePluginObject::m_id_usb_listen_port;
NPIdentifier ScriptablePluginObject::m_id_usb_auto_share;
+NPIdentifier ScriptablePluginObject::m_id_color_depth;
+NPIdentifier ScriptablePluginObject::m_id_disable_effects;
NPIdentifier ScriptablePluginObject::m_id_connect;
NPIdentifier ScriptablePluginObject::m_id_show;
NPIdentifier ScriptablePluginObject::m_id_disconnect;
@@ -129,6 +131,8 @@ void ScriptablePluginObject::Init()
m_id_send_ctrlaltdel = NPN_GetStringIdentifier("SendCtrlAltDelete");
m_id_usb_listen_port = NPN_GetStringIdentifier("UsbListenPort");
m_id_usb_auto_share = NPN_GetStringIdentifier("UsbAutoShare");
+ m_id_color_depth = NPN_GetStringIdentifier("ColorDepth");
+ m_id_disable_effects = NPN_GetStringIdentifier("DisableEffects");
m_id_connect = NPN_GetStringIdentifier("connect");
m_id_show = NPN_GetStringIdentifier("show");
m_id_disconnect = NPN_GetStringIdentifier("disconnect");
@@ -170,7 +174,9 @@ bool ScriptablePluginObject::HasProperty(NPIdentifier name)
name == m_id_no_taskmgr_execution ||
name == m_id_send_ctrlaltdel ||
name == m_id_usb_listen_port ||
- name == m_id_usb_auto_share);
+ name == m_id_usb_auto_share ||
+ name == m_id_color_depth ||
+ name == m_id_disable_effects);
}
bool ScriptablePluginObject::GetProperty(NPIdentifier name, NPVariant *result)
@@ -220,6 +226,10 @@ bool ScriptablePluginObject::GetProperty(NPIdentifier name, NPVariant *result)
INT32_TO_NPVARIANT(m_plugin->GetUsbListenPort(), *result);
else if (name == m_id_usb_auto_share)
BOOLEAN_TO_NPVARIANT(m_plugin->GetUsbAutoShare(), *result);
+ else if (name == m_id_color_depth)
+ STRINGZ_TO_NPVARIANT(m_plugin->GetColorDepth(), *result);
+ else if (name == m_id_disable_effects)
+ STRINGZ_TO_NPVARIANT(m_plugin->GetDisableEffects(), *result);
else
return false;
@@ -296,6 +306,10 @@ bool ScriptablePluginObject::SetProperty(NPIdentifier name, const NPVariant *val
m_plugin->SetUsbListenPort(val);
else if (name == m_id_usb_auto_share)
m_plugin->SetUsbAutoShare(boolean);
+ else if (name == m_id_color_depth)
+ m_plugin->SetColorDepth(str.c_str());
+ else if (name == m_id_disable_effects)
+ m_plugin->SetDisableEffects(str.c_str());
else
return false;
diff --git a/SpiceXPI/src/plugin/nsScriptablePeer.h b/SpiceXPI/src/plugin/nsScriptablePeer.h
index 469a05e..44bd53c 100644
--- a/SpiceXPI/src/plugin/nsScriptablePeer.h
+++ b/SpiceXPI/src/plugin/nsScriptablePeer.h
@@ -96,6 +96,8 @@ private:
static NPIdentifier m_id_send_ctrlaltdel;
static NPIdentifier m_id_usb_listen_port;
static NPIdentifier m_id_usb_auto_share;
+ static NPIdentifier m_id_color_depth;
+ static NPIdentifier m_id_disable_effects;
static NPIdentifier m_id_connect;
static NPIdentifier m_id_show;
static NPIdentifier m_id_disconnect;
diff --git a/SpiceXPI/src/plugin/plugin.cpp b/SpiceXPI/src/plugin/plugin.cpp
index 25a098b..5596609 100644
--- a/SpiceXPI/src/plugin/plugin.cpp
+++ b/SpiceXPI/src/plugin/plugin.cpp
@@ -225,6 +225,8 @@ NPBool nsPluginInstance::init(NPWindow *aWindow)
m_dynamic_menu.clear();
m_number_of_monitors.clear();
m_guest_host_name.clear();
+ m_color_depth.clear();
+ m_disable_effects.clear();
m_fullscreen = PR_FALSE;
m_smartcard = PR_FALSE;
@@ -482,6 +484,28 @@ void nsPluginInstance::SetUsbAutoShare(PRBool aUsbAutoShare)
// when fixed in RHEVM
}
+/* attribute string ColorDepth; */
+char *nsPluginInstance::GetColorDepth() const
+{
+ return stringCopy(m_color_depth);
+}
+
+void nsPluginInstance::SetColorDepth(const char *aColorDepth)
+{
+ m_color_depth = aColorDepth;
+}
+
+/* attribute string DisableEffects; */
+char *nsPluginInstance::GetDisableEffects() const
+{
+ return stringCopy(m_disable_effects);
+}
+
+void nsPluginInstance::SetDisableEffects(const char *aDisableEffects)
+{
+ m_disable_effects = aDisableEffects;
+}
+
void nsPluginInstance::WriteToPipe(const void *data, uint32_t size)
{
m_external_controller.Write(data, size);
@@ -668,6 +692,8 @@ void nsPluginInstance::Connect()
SendStr(CONTROLLER_CA_FILE, m_trust_store_file.c_str());
SendStr(CONTROLLER_HOST_SUBJECT, m_host_subject.c_str());
SendStr(CONTROLLER_HOTKEYS, m_hot_keys.c_str());
+ SendValue(CONTROLLER_COLOR_DEPTH, atoi(m_color_depth.c_str()));
+ SendStr(CONTROLLER_DISABLE_EFFECTS, m_disable_effects.c_str());
SendMsg(CONTROLLER_CONNECT);
SendMsg(CONTROLLER_SHOW);
diff --git a/SpiceXPI/src/plugin/plugin.h b/SpiceXPI/src/plugin/plugin.h
index 42e2a2d..acba031 100644
--- a/SpiceXPI/src/plugin/plugin.h
+++ b/SpiceXPI/src/plugin/plugin.h
@@ -159,7 +159,15 @@ public:
/* attribute boolean UsbAutoShare; */
PRBool GetUsbAutoShare() const;
void SetUsbAutoShare(PRBool aUsbAutoShare);
+
+ /* attribute ing color depth; */
+ char *GetColorDepth() const;
+ void SetColorDepth(const char *aColorDepth);
+ /* attribute ing disable effects; */
+ char *GetDisableEffects() const;
+ void SetDisableEffects(const char *aDisableEffects);
+
NPObject *GetScriptablePeer();
private:
@@ -202,6 +210,8 @@ private:
PRBool m_no_taskmgr_execution;
PRBool m_send_ctrlaltdel;
std::map<std::string, std::string> m_language;
+ std::string m_color_depth;
+ std::string m_disable_effects;
NPObject *m_scriptable_peer;
std::string m_tmp_dir;
diff --git a/data/test.html b/data/test.html
index 860851f..ff7743b 100644
--- a/data/test.html
+++ b/data/test.html
@@ -114,6 +114,8 @@ function setConnectVars()
if(document.getElementById("UsbListenPortToggled").checked == true) { embed.UsbListenPort = parseInt( document.getElementById("UsbListenPort").value ); } else { embed.UsbListenPort = ""; }
if(document.getElementById("UsbAutoShareToggled").checked == true) { embed.UsbAutoShare = document.getElementById("UsbAutoShare").checked; } else { embed.UsbAutoShare = ""; }
if(document.getElementById("SmartcardToggled").checked == true) { embed.Smartcard = document.getElementById("Smartcard").checked; } else { embed.Smartcard = ""; }
+ if(document.getElementById("ColorDepthToggled").checked == true) { embed.ColorDepth = document.getElementById("ColorDepth").value; } else { embed.ColorDepth = ""; }
+ if(document.getElementById("DisableEffectsToggled").checked == true) { embed.DisableEffects = document.getElementById("DisableEffects").value; } else { embed.DisableEffects = ""; }
}
function show()
@@ -242,6 +244,16 @@ function toggle(checkboxID)
<td> <input id="Smartcard" type="checkbox" /></td>
</tr>
<tr>
+<td><input type="checkbox" id="ColorDepthToggled" onclick="toggle('ColorDepthToggled', 'ColorDepth')" /></td>
+<td>Color Depth:</td>
+<td> <input id="ColorDepth" type="text" size="30" disabled /></td>
+</tr>
+<tr>
+<td><input type="checkbox" id="DisableEffectsToggled" onclick="toggle('DisableEffectsToggled', 'DisableEffects')" /></td>
+<td>Disable Effects:</td>
+<td> <input id="DisableEffects" type="text" size="30" disabled /></td>
+</tr>
+<tr>
<td><input type="checkbox" id="LanguageStringsSectionToggled" onclick="toggle('LanguageStringsSectionToggled', 'LanguageStringsSection')" checked /></td>
<td>*Language Strings - section:</td>
<td> <input id="LanguageStringsSection" type="input" size="30" /></td>
diff --git a/spice-protocol b/spice-protocol
-Subproject d5edafd28ab762b1b5f663aec449d3e3743f118
+Subproject 8cf92f042312e50b2ff186b28356053aeac9e04