[Spice-devel] [spice-xpi 1/4] Add nsPluginInstance::SendBool

Alon Levy alevy at redhat.com
Mon Mar 5 06:23:19 PST 2012


On Mon, Mar 05, 2012 at 02:33:33PM +0100, Christophe Fergeau wrote:
> ::SendVal will not send messages when the value is 0, which is not
> what is expected when sending a boolean value.

Looks good.

Ack series.

> ---
>  SpiceXPI/src/plugin/plugin.cpp |    6 ++++++
>  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:
> -- 
> 1.7.7.6
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel


More information about the Spice-devel mailing list