[Spice-devel,spice-gtk,Win32,v3,01/12] namedpipe: add is_server property

Submitted by Uri Lublin on June 28, 2012, 1:46 a.m.

Details

Message ID 1340848001-7791-2-git-send-email-uril@redhat.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Uri Lublin June 28, 2012, 1:46 a.m.
Currently only NamePipe server is available.
We want to support also NamedPipe Client.

This property is to be used in a following patch.
---
 gtk/controller/namedpipe.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

Patch hide | download patch | download mbox

diff --git a/gtk/controller/namedpipe.c b/gtk/controller/namedpipe.c
index 6859770..355887a 100644
--- a/gtk/controller/namedpipe.c
+++ b/gtk/controller/namedpipe.c
@@ -36,6 +36,7 @@  enum
   PROP_0,
   PROP_NAME,
   PROP_HANDLE,
+  PROP_IS_SERVER,
 };

 struct _SpiceNamedPipePrivate
@@ -44,6 +45,7 @@  struct _SpiceNamedPipePrivate
   GError *              construct_error;
   guint                 inited : 1;
   HANDLE                handle;
+  gboolean              is_server;
 };

 static void
@@ -124,6 +126,9 @@  spice_named_pipe_get_property (GObject    *object,
       case PROP_HANDLE:
         g_value_set_pointer (value, np->priv->handle);
         break;
+      case PROP_IS_SERVER:
+        g_value_set_boolean (value, np->priv->is_server);
+        break;
       default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
     }
@@ -146,6 +151,9 @@  spice_named_pipe_set_property (GObject      *object,
       case PROP_HANDLE:
         np->priv->handle = g_value_get_pointer (value);
         break;
+    case PROP_IS_SERVER:
+        np->priv->is_server = g_value_get_boolean (value);
+        break;
       default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
     }
@@ -179,6 +187,15 @@  spice_named_pipe_class_init (SpiceNamedPipeClass *klass)
                                                          G_PARAM_CONSTRUCT_ONLY |
                                                          G_PARAM_READWRITE |
                                                          G_PARAM_STATIC_STRINGS));
+
+  g_object_class_install_property (gobject_class, PROP_IS_SERVER,
+				   g_param_spec_boolean ("isserver",
+                                                        "Server or Client",
+                                                        "Create or Connect a NamedPipe",
+                                                         TRUE,
+                                                         G_PARAM_CONSTRUCT_ONLY |
+                                                         G_PARAM_READWRITE |
+                                                         G_PARAM_STATIC_STRINGS));
 }

 static void

Comments

ack

Uri Lublin wrote:
> Currently only NamePipe server is available.
> We want to support also NamedPipe Client.
>
> This property is to be used in a following patch.
> ---
>  gtk/controller/namedpipe.c |   17 +++++++++++++++++
>  1 files changed, 17 insertions(+), 0 deletions(-)
>
> diff --git a/gtk/controller/namedpipe.c b/gtk/controller/namedpipe.c
> index 6859770..355887a 100644
> --- a/gtk/controller/namedpipe.c
> +++ b/gtk/controller/namedpipe.c
> @@ -36,6 +36,7 @@ enum
>    PROP_0,
>    PROP_NAME,
>    PROP_HANDLE,
> +  PROP_IS_SERVER,
>  };
>
>  struct _SpiceNamedPipePrivate
> @@ -44,6 +45,7 @@ struct _SpiceNamedPipePrivate
>    GError *              construct_error;
>    guint                 inited : 1;
>    HANDLE                handle;
> +  gboolean              is_server;
>  };
>
>  static void
> @@ -124,6 +126,9 @@ spice_named_pipe_get_property (GObject    *object,
>        case PROP_HANDLE:
>          g_value_set_pointer (value, np->priv->handle);
>          break;
> +      case PROP_IS_SERVER:
> +        g_value_set_boolean (value, np->priv->is_server);
> +        break;
>        default:
>          G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
>      }
> @@ -146,6 +151,9 @@ spice_named_pipe_set_property (GObject      *object,
>        case PROP_HANDLE:
>          np->priv->handle = g_value_get_pointer (value);
>          break;
> +    case PROP_IS_SERVER:
> +        np->priv->is_server = g_value_get_boolean (value);
> +        break;
>        default:
>          G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
>      }
> @@ -179,6 +187,15 @@ spice_named_pipe_class_init (SpiceNamedPipeClass *klass)
>                                                           G_PARAM_CONSTRUCT_ONLY |
>                                                           G_PARAM_READWRITE |
>                                                           G_PARAM_STATIC_STRINGS));
> +
> +  g_object_class_install_property (gobject_class, PROP_IS_SERVER,
> +				   g_param_spec_boolean ("isserver",
> +                                                        "Server or Client",
> +                                                        "Create or Connect a NamedPipe",
> +                                                         TRUE,
> +                                                         G_PARAM_CONSTRUCT_ONLY |
> +                                                         G_PARAM_READWRITE |
> +                                                         G_PARAM_STATIC_STRINGS));
>  }
>
>  static void
>