[Spice-devel,spice-gtk,2/4] Deprecate spice_channel_set_capability()

Submitted by Marc-André Lureau on June 8, 2012, 10:13 a.m.

Details

Message ID 1339150409-22884-2-git-send-email-marcandre.lureau@redhat.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Marc-André Lureau June 8, 2012, 10:13 a.m.
This was initially public to eventually let a derived class
implement more capabilities. Even though it is technically
doable to derive and tweak exisiting channels, there is a
lack of support in spice-gtk for doing that.
---
 gtk/spice-channel.c |    2 +-
 gtk/spice-channel.h |    5 +++++
 gtk/spice-util.h    |    5 +++--
 3 files changed, 9 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c
index 75b171b..fda0666 100644
--- a/gtk/spice-channel.c
+++ b/gtk/spice-channel.c
@@ -2537,9 +2537,9 @@  static void set_capability(GArray *caps, guint32 cap)
  * @cap: a capability
  *
  * Enable specific channel-kind capability.
+ * Deprecated: 0.13: this function has been removed
  **/
 #undef spice_channel_set_capability
-/* FIXME: we may want to make caps read only from outside */
 void spice_channel_set_capability(SpiceChannel *channel, guint32 cap)
 {
     SpiceChannelPrivate *c;
diff --git a/gtk/spice-channel.h b/gtk/spice-channel.h
index 982b73b..73be1ef 100644
--- a/gtk/spice-channel.h
+++ b/gtk/spice-channel.h
@@ -108,10 +108,15 @@  gboolean spice_channel_open_fd(SpiceChannel *channel, int fd);
 void spice_channel_disconnect(SpiceChannel *channel, SpiceChannelEvent reason);
 gboolean spice_channel_test_capability(SpiceChannel *channel, guint32 cap);
 gboolean spice_channel_test_common_capability(SpiceChannel *channel, guint32 cap);
+
+#ifndef SPICE_DISABLE_DEPRECATED
+SPICE_DEPRECATED
 void spice_channel_set_capability(SpiceChannel *channel, guint32 cap);
+#endif
 
 const gchar* spice_channel_type_to_string(gint type);
 
+
 G_END_DECLS
 
 #endif /* __SPICE_CLIENT_CHANNEL_H__ */
diff --git a/gtk/spice-util.h b/gtk/spice-util.h
index 7a617f4..271f3be 100644
--- a/gtk/spice-util.h
+++ b/gtk/spice-util.h
@@ -40,10 +40,11 @@  gulong spice_g_signal_connect_object(gpointer instance,
 #define SPICE_RESERVED_PADDING (10 * sizeof(void*))
 
 #ifndef SPICE_NO_DEPRECATED
-#define SPICE_DEPRECATED_FOR(f) \
-    G_GNUC_DEPRECATED_FOR(f)
+#define SPICE_DEPRECATED_FOR(f)  G_GNUC_DEPRECATED_FOR(f)
+#define SPICE_DEPRECATED  G_GNUC_DEPRECATED
 #else
 #define SPICE_DEPRECATED_FOR(f)
+#define SPICE_DEPRECATED
 #endif
 
 G_END_DECLS

Comments

On Fri, Jun 08, 2012 at 12:13:27PM +0200, Marc-André Lureau wrote:
> This was initially public to eventually let a derived class
> implement more capabilities. Even though it is technically
> doable to derive and tweak exisiting channels, there is a
> lack of support in spice-gtk for doing that.

And is it something that is likely to come back later? This would be a bit
weird maybe?

> ---
>  gtk/spice-channel.c |    2 +-
>  gtk/spice-channel.h |    5 +++++
>  gtk/spice-util.h    |    5 +++--
>  3 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c
> index 75b171b..fda0666 100644
> --- a/gtk/spice-channel.c
> +++ b/gtk/spice-channel.c
> @@ -2537,9 +2537,9 @@ static void set_capability(GArray *caps, guint32 cap)
>   * @cap: a capability
>   *
>   * Enable specific channel-kind capability.
> + * Deprecated: 0.13: this function has been removed

It hasn't been removed, it's more that it wasn't doing anything and has no
replacement no ?

>   **/
>  #undef spice_channel_set_capability
> -/* FIXME: we may want to make caps read only from outside */
>  void spice_channel_set_capability(SpiceChannel *channel, guint32 cap)
>  {
>      SpiceChannelPrivate *c;
> diff --git a/gtk/spice-channel.h b/gtk/spice-channel.h
> index 982b73b..73be1ef 100644
> --- a/gtk/spice-channel.h
> +++ b/gtk/spice-channel.h
> @@ -108,10 +108,15 @@ gboolean spice_channel_open_fd(SpiceChannel *channel, int fd);
>  void spice_channel_disconnect(SpiceChannel *channel, SpiceChannelEvent reason);
>  gboolean spice_channel_test_capability(SpiceChannel *channel, guint32 cap);
>  gboolean spice_channel_test_common_capability(SpiceChannel *channel, guint32 cap);
> +
> +#ifndef SPICE_DISABLE_DEPRECATED
> +SPICE_DEPRECATED
>  void spice_channel_set_capability(SpiceChannel *channel, guint32 cap);
> +#endif
>  
>  const gchar* spice_channel_type_to_string(gint type);
>  
> +

Useless blank space

ACK

Christophe


>  G_END_DECLS
>  
>  #endif /* __SPICE_CLIENT_CHANNEL_H__ */
> diff --git a/gtk/spice-util.h b/gtk/spice-util.h
> index 7a617f4..271f3be 100644
> --- a/gtk/spice-util.h
> +++ b/gtk/spice-util.h
> @@ -40,10 +40,11 @@ gulong spice_g_signal_connect_object(gpointer instance,
>  #define SPICE_RESERVED_PADDING (10 * sizeof(void*))
>  
>  #ifndef SPICE_NO_DEPRECATED
> -#define SPICE_DEPRECATED_FOR(f) \
> -    G_GNUC_DEPRECATED_FOR(f)
> +#define SPICE_DEPRECATED_FOR(f)  G_GNUC_DEPRECATED_FOR(f)
> +#define SPICE_DEPRECATED  G_GNUC_DEPRECATED
>  #else
>  #define SPICE_DEPRECATED_FOR(f)
> +#define SPICE_DEPRECATED
>  #endif
>  
>  G_END_DECLS
> -- 
> 1.7.10.2
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
----- Mensaje original -----
> On Fri, Jun 08, 2012 at 12:13:27PM +0200, Marc-André Lureau wrote:
> > This was initially public to eventually let a derived class
> > implement more capabilities. Even though it is technically
> > doable to derive and tweak exisiting channels, there is a
> > lack of support in spice-gtk for doing that.
> 
> And is it something that is likely to come back later? This would be
> a bit
> weird maybe?

Likelihood is very very low: someone would want to extend/modify an
existing channel, by deriving the class. He would need to modify
other parts of spice-gtk to allow this.