Re: [PATCH spice-server 3/3] Move InputsChannelClient and InputsChannelClient definition to C file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Duplicate InputsChannelClient in the short log?
This also seems to be removing InputsChannelClientPrivate, it would be
worth a mention in the log.
Also, what is this bringing us in concrete terms? Ensuring internal
users of InputsChannelClient can't try to inherit from it?

Christophe

On Mon, Nov 07, 2016 at 11:13:23AM +0000, Frediano Ziglio wrote:
> Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
> ---
>  server/inputs-channel-client.c | 28 +++++++++++++++-------------
>  server/inputs-channel-client.h | 13 -------------
>  2 files changed, 15 insertions(+), 26 deletions(-)
> 
> diff --git a/server/inputs-channel-client.c b/server/inputs-channel-client.c
> index 4ab2457..7cb920f 100644
> --- a/server/inputs-channel-client.c
> +++ b/server/inputs-channel-client.c
> @@ -22,26 +22,28 @@
>  #include "migration-protocol.h"
>  #include "red-channel-client.h"
>  
> -G_DEFINE_TYPE(InputsChannelClient, inputs_channel_client, RED_TYPE_CHANNEL_CLIENT)
> +struct InputsChannelClient
> +{
> +    RedChannelClient parent;
>  
> -#define INPUTS_CHANNEL_CLIENT_PRIVATE(o) \
> -    (G_TYPE_INSTANCE_GET_PRIVATE((o), TYPE_INPUTS_CHANNEL_CLIENT, InputsChannelClientPrivate))
> +    uint16_t motion_count;
> +};
>  
> -struct InputsChannelClientPrivate
> +struct InputsChannelClientClass
>  {
> -    uint16_t motion_count;
> +    RedChannelClientClass parent_class;
>  };
>  
> +G_DEFINE_TYPE(InputsChannelClient, inputs_channel_client, RED_TYPE_CHANNEL_CLIENT)
> +
>  static void
>  inputs_channel_client_class_init(InputsChannelClientClass *klass)
>  {
> -    g_type_class_add_private(klass, sizeof(InputsChannelClientPrivate));
>  }
>  
>  static void
>  inputs_channel_client_init(InputsChannelClient *self)
>  {
> -    self->priv = INPUTS_CHANNEL_CLIENT_PRIVATE(self);
>  }
>  
>  RedChannelClient* inputs_channel_client_create(RedChannel *channel,
> @@ -93,16 +95,16 @@ void inputs_channel_client_send_migrate_data(RedChannelClient *rcc,
>  
>      spice_marshaller_add_uint32(m, SPICE_MIGRATE_DATA_INPUTS_MAGIC);
>      spice_marshaller_add_uint32(m, SPICE_MIGRATE_DATA_INPUTS_VERSION);
> -    spice_marshaller_add_uint16(m, icc->priv->motion_count);
> +    spice_marshaller_add_uint16(m, icc->motion_count);
>  }
>  
>  void inputs_channel_client_handle_migrate_data(InputsChannelClient *icc,
>                                                 uint16_t motion_count)
>  {
> -    icc->priv->motion_count = motion_count;
> +    icc->motion_count = motion_count;
>  
> -    for (; icc->priv->motion_count >= SPICE_INPUT_MOTION_ACK_BUNCH;
> -           icc->priv->motion_count -= SPICE_INPUT_MOTION_ACK_BUNCH) {
> +    for (; icc->motion_count >= SPICE_INPUT_MOTION_ACK_BUNCH;
> +           icc->motion_count -= SPICE_INPUT_MOTION_ACK_BUNCH) {
>          red_channel_client_pipe_add_type(RED_CHANNEL_CLIENT(icc),
>                                           RED_PIPE_ITEM_MOUSE_MOTION_ACK);
>      }
> @@ -112,10 +114,10 @@ void inputs_channel_client_on_mouse_motion(InputsChannelClient *icc)
>  {
>      InputsChannel *inputs_channel = INPUTS_CHANNEL(red_channel_client_get_channel(RED_CHANNEL_CLIENT(icc)));
>  
> -    if (++icc->priv->motion_count % SPICE_INPUT_MOTION_ACK_BUNCH == 0 &&
> +    if (++icc->motion_count % SPICE_INPUT_MOTION_ACK_BUNCH == 0 &&
>          !inputs_channel_is_src_during_migrate(inputs_channel)) {
>          red_channel_client_pipe_add_type(RED_CHANNEL_CLIENT(icc),
>                                           RED_PIPE_ITEM_MOUSE_MOTION_ACK);
> -        icc->priv->motion_count = 0;
> +        icc->motion_count = 0;
>      }
>  }
> diff --git a/server/inputs-channel-client.h b/server/inputs-channel-client.h
> index 7550b3c..6d4ab98 100644
> --- a/server/inputs-channel-client.h
> +++ b/server/inputs-channel-client.h
> @@ -40,19 +40,6 @@ G_BEGIN_DECLS
>  
>  typedef struct InputsChannelClient InputsChannelClient;
>  typedef struct InputsChannelClientClass InputsChannelClientClass;
> -typedef struct InputsChannelClientPrivate InputsChannelClientPrivate;
> -
> -struct InputsChannelClient
> -{
> -    RedChannelClient parent;
> -
> -    InputsChannelClientPrivate *priv;
> -};
> -
> -struct InputsChannelClientClass
> -{
> -    RedChannelClientClass parent_class;
> -};
>  
>  GType inputs_channel_client_get_type(void) G_GNUC_CONST;
>  
> -- 
> 2.7.4
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/spice-devel

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]