[Spice-devel] [spice-gtk 2/2] Adjust to new SpiceImageCompress name

Victor Toso lists at victortoso.com
Fri Aug 14 06:32:57 PDT 2015


Hi,

On Fri, Aug 07, 2015 at 12:49:23PM +0200, Christophe Fergeau wrote:
> This has been renamed to SpiceImageCompression in order to avoid clashes
> with older spice-server in the SPICE_IMAGE_COMPRESS_ namespace. This
> commit is a straight rename of SpiceImageCompress to
> SpiceImageCompression and SPICE_IMAGE_COMPRESS_ to
> SPICE_IMAGE_COMPRESSION_

Looks good.

> ---
>  src/channel-display.c |  4 ++--
>  src/spice-option.c    | 20 ++++++++++----------
>  src/spice-session.c   | 34 +++++++++++++++++-----------------
>  3 files changed, 29 insertions(+), 29 deletions(-)
> 
> diff --git a/src/channel-display.c b/src/channel-display.c
> index 752d69d..a65f926 100644
> --- a/src/channel-display.c
> +++ b/src/channel-display.c
> @@ -792,7 +792,7 @@ static void spice_display_channel_up(SpiceChannel *channel)
>      SpiceMsgcDisplayPreferredCompression pref_comp_msg;
>      int cache_size;
>      int glz_window_size;
> -    SpiceImageCompress preferred_compression = SPICE_IMAGE_COMPRESS_INVALID;
> +    SpiceImageCompression preferred_compression = SPICE_IMAGE_COMPRESSION_INVALID;
>  
>      g_object_get(s,
>                   "cache-size", &cache_size,
> @@ -813,7 +813,7 @@ static void spice_display_channel_up(SpiceChannel *channel)
>      g_coroutine_object_notify(G_OBJECT(channel), "monitors");
>  
>      if (spice_channel_test_capability(channel, SPICE_DISPLAY_CAP_PREF_COMPRESSION) &&
> -            preferred_compression > SPICE_IMAGE_COMPRESS_INVALID) {
> +            preferred_compression > SPICE_IMAGE_COMPRESSION_INVALID) {
>          pref_comp_msg.image_compression = preferred_compression;
>          out = spice_msg_out_new(channel, SPICE_MSGC_DISPLAY_PREFERRED_COMPRESSION);
>          out->marshallers->msgc_display_preferred_compression(out->marshaller, &pref_comp_msg);
> diff --git a/src/spice-option.c b/src/spice-option.c
> index 463a3e3..71e29a1 100644
> --- a/src/spice-option.c
> +++ b/src/spice-option.c
> @@ -41,7 +41,7 @@ static gint cache_size = 0;
>  static gint glz_window_size = 0;
>  static gchar *secure_channels = NULL;
>  static gchar *shared_dir = NULL;
> -static SpiceImageCompress preferred_compression = SPICE_IMAGE_COMPRESS_INVALID;
> +static SpiceImageCompression preferred_compression = SPICE_IMAGE_COMPRESSION_INVALID;
>  
>  G_GNUC_NORETURN
>  static void option_version(void)
> @@ -154,23 +154,23 @@ static gboolean parse_preferred_compression(const gchar *option_name, const gcha
>                                              gpointer data, GError **error)
>  {
>      if (!strcmp(value, "auto-glz")) {
> -        preferred_compression = SPICE_IMAGE_COMPRESS_AUTO_GLZ;
> +        preferred_compression = SPICE_IMAGE_COMPRESSION_AUTO_GLZ;
>      } else if (!strcmp(value, "auto-lz")) {
> -        preferred_compression = SPICE_IMAGE_COMPRESS_AUTO_LZ;
> +        preferred_compression = SPICE_IMAGE_COMPRESSION_AUTO_LZ;
>      } else if (!strcmp(value, "quic")) {
> -        preferred_compression = SPICE_IMAGE_COMPRESS_QUIC;
> +        preferred_compression = SPICE_IMAGE_COMPRESSION_QUIC;
>      } else if (!strcmp(value, "glz")) {
> -        preferred_compression = SPICE_IMAGE_COMPRESS_GLZ;
> +        preferred_compression = SPICE_IMAGE_COMPRESSION_GLZ;
>      } else if (!strcmp(value, "lz")) {
> -        preferred_compression = SPICE_IMAGE_COMPRESS_LZ;
> +        preferred_compression = SPICE_IMAGE_COMPRESSION_LZ;
>  #ifdef USE_LZ4
>      } else if (!strcmp(value, "lz4")) {
> -        preferred_compression = SPICE_IMAGE_COMPRESS_LZ4;
> +        preferred_compression = SPICE_IMAGE_COMPRESSION_LZ4;
>  #endif
>      } else if (!strcmp(value, "off")) {
> -        preferred_compression = SPICE_IMAGE_COMPRESS_OFF;
> +        preferred_compression = SPICE_IMAGE_COMPRESSION_OFF;
>      } else {
> -        preferred_compression = SPICE_IMAGE_COMPRESS_INVALID;
> +        preferred_compression = SPICE_IMAGE_COMPRESSION_INVALID;
>          g_set_error(error, G_OPTION_ERROR, G_OPTION_ERROR_FAILED,
>                      _("Image compression algorithm %s not supported"), value);
>          return FALSE;
> @@ -316,6 +316,6 @@ void spice_set_session_option(SpiceSession *session)
>          g_object_set(session, "glz-window-size", glz_window_size, NULL);
>      if (shared_dir)
>          g_object_set(session, "shared-dir", shared_dir, NULL);
> -    if (preferred_compression != SPICE_IMAGE_COMPRESS_INVALID)
> +    if (preferred_compression != SPICE_IMAGE_COMPRESSION_INVALID)
>          g_object_set(session, "preferred-compression", preferred_compression, NULL);
>  }
> diff --git a/src/spice-session.c b/src/spice-session.c
> index f1261fd..d768796 100644
> --- a/src/spice-session.c
> +++ b/src/spice-session.c
> @@ -117,7 +117,7 @@ struct _SpiceSessionPrivate {
>      uint32_t          n_display_channels;
>      guint8            uuid[16];
>      gchar             *name;
> -    SpiceImageCompress preferred_compression;
> +    SpiceImageCompression preferred_compression;
>  
>      /* associated objects */
>      SpiceAudio        *audio_manager;
> @@ -204,7 +204,7 @@ enum {
>      PROP_SHARE_DIR_RO,
>      PROP_USERNAME,
>      PROP_UNIX_PATH,
> -    PROP_PREF_COMPRESS,
> +    PROP_PREF_COMPRESSION,
>  };
>  
>  /* signals */
> @@ -216,22 +216,22 @@ enum {
>  };
>  
>  /* Register SpiceImageCompress */
> -#define SPICE_TYPE_IMAGE_COMPRESS spice_image_compress_get_type()
> +#define SPICE_TYPE_IMAGE_COMPRESSION spice_image_compress_get_type()
>  GType spice_image_compress_get_type (void);
>  
>  static const GEnumValue _spice_image_compress_values[] = {
> -  { SPICE_IMAGE_COMPRESS_INVALID, "SPICE_IMAGE_COMPRESS_INVALID", "invalid" },
> -  { SPICE_IMAGE_COMPRESS_OFF, "SPICE_IMAGE_COMPRESS_OFF", "off" },
> -  { SPICE_IMAGE_COMPRESS_AUTO_GLZ, "SPICE_IMAGE_COMPRESS_AUTO_GLZ", "auto-glz" },
> -  { SPICE_IMAGE_COMPRESS_AUTO_LZ, "SPICE_IMAGE_COMPRESS_AUTO_LZ", "auto-lz" },
> -  { SPICE_IMAGE_COMPRESS_QUIC, "SPICE_IMAGE_COMPRESS_QUIC", "quic" },
> -  { SPICE_IMAGE_COMPRESS_GLZ, "SPICE_IMAGE_COMPRESS_GLZ", "glz" },
> -  { SPICE_IMAGE_COMPRESS_LZ, "SPICE_IMAGE_COMPRESS_LZ", "lz" },
> -  { SPICE_IMAGE_COMPRESS_LZ4, "SPICE_IMAGE_COMPRESS_LZ4", "lz4" },
> +  { SPICE_IMAGE_COMPRESSION_INVALID, "SPICE_IMAGE_COMPRESSION_INVALID", "invalid" },
> +  { SPICE_IMAGE_COMPRESSION_OFF, "SPICE_IMAGE_COMPRESSION_OFF", "off" },
> +  { SPICE_IMAGE_COMPRESSION_AUTO_GLZ, "SPICE_IMAGE_COMPRESSION_AUTO_GLZ", "auto-glz" },
> +  { SPICE_IMAGE_COMPRESSION_AUTO_LZ, "SPICE_IMAGE_COMPRESSION_AUTO_LZ", "auto-lz" },
> +  { SPICE_IMAGE_COMPRESSION_QUIC, "SPICE_IMAGE_COMPRESSION_QUIC", "quic" },
> +  { SPICE_IMAGE_COMPRESSION_GLZ, "SPICE_IMAGE_COMPRESSION_GLZ", "glz" },
> +  { SPICE_IMAGE_COMPRESSION_LZ, "SPICE_IMAGE_COMPRESSION_LZ", "lz" },
> +  { SPICE_IMAGE_COMPRESSION_LZ4, "SPICE_IMAGE_COMPRESSION_LZ4", "lz4" },
>    { 0, NULL, NULL }
>  };
>  
> -G_STATIC_ASSERT(G_N_ELEMENTS(_spice_image_compress_values) == SPICE_IMAGE_COMPRESS_ENUM_END + 1);
> +G_STATIC_ASSERT(G_N_ELEMENTS(_spice_image_compress_values) == SPICE_IMAGE_COMPRESSION_ENUM_END + 1);
>  
>  GType
>  spice_image_compress_get_type (void)
> @@ -692,7 +692,7 @@ static void spice_session_get_property(GObject    *gobject,
>      case PROP_SHARE_DIR_RO:
>          g_value_set_boolean(value, s->share_dir_ro);
>          break;
> -    case PROP_PREF_COMPRESS:
> +    case PROP_PREF_COMPRESSION:
>          g_value_set_enum(value, s->preferred_compression);
>          break;
>      default:
> @@ -831,7 +831,7 @@ static void spice_session_set_property(GObject      *gobject,
>      case PROP_SHARE_DIR_RO:
>          s->share_dir_ro = g_value_get_boolean(value);
>          break;
> -    case PROP_PREF_COMPRESS:
> +    case PROP_PREF_COMPRESSION:
>          s->preferred_compression = g_value_get_enum(value);
>          break;
>      default:
> @@ -1452,12 +1452,12 @@ static void spice_session_class_init(SpiceSessionClass *klass)
>       * Since: 0.29
>       **/
>      g_object_class_install_property
> -        (gobject_class, PROP_PREF_COMPRESS,
> +        (gobject_class, PROP_PREF_COMPRESSION,
>           g_param_spec_enum("preferred-compression",
>                             "Preferred image compression algorithm",
>                             "Preferred image compression algorithm",
> -                           SPICE_TYPE_IMAGE_COMPRESS,
> -                           SPICE_IMAGE_COMPRESS_INVALID,
> +                           SPICE_TYPE_IMAGE_COMPRESSION,
> +                           SPICE_IMAGE_COMPRESSION_INVALID,
>                             G_PARAM_READWRITE |
>                             G_PARAM_STATIC_STRINGS));
>  
> -- 
> 2.4.3
> 
> _______________________________________________
> 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