[Spice-devel] [PATCH spice-gtk] Mark deprecated props/signals/functions

Marc-André Lureau marcandre.lureau at gmail.com
Tue Nov 8 02:13:33 PST 2011


---
 gtk/channel-main.c |   12 ++++++++----
 gtk/glib-compat.h  |    4 ++++
 gtk/spice-audio.c  |    1 +
 gtk/spice-widget.c |    7 +++++--
 4 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/gtk/channel-main.c b/gtk/channel-main.c
index 74eeca9..fa46323 100644
--- a/gtk/channel-main.c
+++ b/gtk/channel-main.c
@@ -418,7 +418,7 @@ static void spice_main_channel_class_init(SpiceMainChannelClass *klass)
     signals[SPICE_MAIN_CLIPBOARD] =
         g_signal_new("main-clipboard",
                      G_OBJECT_CLASS_TYPE(gobject_class),
-                     G_SIGNAL_RUN_LAST,
+                     G_SIGNAL_RUN_LAST | G_SIGNAL_DEPRECATED,
                      0,
                      NULL, NULL,
                      g_cclosure_user_marshal_VOID__UINT_POINTER_UINT,
@@ -457,7 +457,7 @@ static void spice_main_channel_class_init(SpiceMainChannelClass *klass)
     signals[SPICE_MAIN_CLIPBOARD_GRAB] =
         g_signal_new("main-clipboard-grab",
                      G_OBJECT_CLASS_TYPE(gobject_class),
-                     G_SIGNAL_RUN_LAST,
+                     G_SIGNAL_RUN_LAST | G_SIGNAL_DEPRECATED,
                      0,
                      NULL, NULL,
                      g_cclosure_user_marshal_BOOLEAN__POINTER_UINT,
@@ -500,7 +500,7 @@ static void spice_main_channel_class_init(SpiceMainChannelClass *klass)
     signals[SPICE_MAIN_CLIPBOARD_REQUEST] =
         g_signal_new("main-clipboard-request",
                      G_OBJECT_CLASS_TYPE(gobject_class),
-                     G_SIGNAL_RUN_LAST,
+                     G_SIGNAL_RUN_LAST | G_SIGNAL_DEPRECATED,
                      0,
                      NULL, NULL,
                      g_cclosure_user_marshal_BOOLEAN__UINT,
@@ -541,7 +541,7 @@ static void spice_main_channel_class_init(SpiceMainChannelClass *klass)
     signals[SPICE_MAIN_CLIPBOARD_RELEASE] =
         g_signal_new("main-clipboard-release",
                      G_OBJECT_CLASS_TYPE(gobject_class),
-                     G_SIGNAL_RUN_LAST,
+                     G_SIGNAL_RUN_LAST | G_SIGNAL_DEPRECATED,
                      0,
                      NULL, NULL,
                      g_cclosure_marshal_VOID__VOID,
@@ -1666,6 +1666,7 @@ void spice_main_set_display(SpiceMainChannel *channel, int id,
  *
  * Deprecated: 0.6: use spice_main_clipboard_selection_grab() instead.
  **/
+GLIB_DEPRECATED_FOR(spice_main_clipboard_selection_grab)
 void spice_main_clipboard_grab(SpiceMainChannel *channel, guint32 *types, int ntypes)
 {
     spice_main_clipboard_selection_grab(channel, VD_AGENT_CLIPBOARD_SELECTION_CLIPBOARD, types, ntypes);
@@ -1701,6 +1702,7 @@ void spice_main_clipboard_selection_grab(SpiceMainChannel *channel, guint select
  *
  * Deprecated: 0.6: use spice_main_clipboard_selection_release() instead.
  **/
+GLIB_DEPRECATED_FOR(spice_main_clipboard_selection_release)
 void spice_main_clipboard_release(SpiceMainChannel *channel)
 {
     spice_main_clipboard_selection_release(channel, VD_AGENT_CLIPBOARD_SELECTION_CLIPBOARD);
@@ -1741,6 +1743,7 @@ void spice_main_clipboard_selection_release(SpiceMainChannel *channel, guint sel
  *
  * Deprecated: 0.6: use spice_main_clipboard_selection_notify() instead.
  **/
+GLIB_DEPRECATED_FOR(spice_main_clipboard_selection_notify)
 void spice_main_clipboard_notify(SpiceMainChannel *channel,
                                  guint32 type, const guchar *data, size_t size)
 {
@@ -1780,6 +1783,7 @@ void spice_main_clipboard_selection_notify(SpiceMainChannel *channel, guint sele
  *
  * Deprecated: 0.6: use spice_main_clipboard_selection_request() instead.
  **/
+GLIB_DEPRECATED_FOR(spice_main_clipboard_selection_request)
 void spice_main_clipboard_request(SpiceMainChannel *channel, guint32 type)
 {
     spice_main_clipboard_selection_request(channel, VD_AGENT_CLIPBOARD_SELECTION_CLIPBOARD, type);
diff --git a/gtk/glib-compat.h b/gtk/glib-compat.h
index b111c91..2766de0 100644
--- a/gtk/glib-compat.h
+++ b/gtk/glib-compat.h
@@ -62,4 +62,8 @@ type_name##_get_type (void) \
 #endif /* __GNUC__ */
 #endif /* glib 2.26 */
 
+#if !GLIB_CHECK_VERSION(2,32,0)
+# define G_SIGNAL_DEPRECATED (1 << 9)
+#endif
+
 #endif /* GLIB_COMPAT_H */
diff --git a/gtk/spice-audio.c b/gtk/spice-audio.c
index 8a5cd19..b51fa51 100644
--- a/gtk/spice-audio.c
+++ b/gtk/spice-audio.c
@@ -73,6 +73,7 @@ static void spice_audio_init(SpiceAudio *self G_GNUC_UNUSED)
  * Returns: a new #SpiceAudio instance or %NULL if no backend or failed.
  * Deprecated: 0.8: Use spice_audio_get() instead
  **/
+GLIB_DEPRECATED_FOR(spice_audio_get)
 SpiceAudio *spice_audio_new(SpiceSession *session, GMainContext *context,
                             const char *name)
 {
diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
index 5ce1b00..3589833 100644
--- a/gtk/spice-widget.c
+++ b/gtk/spice-widget.c
@@ -1206,7 +1206,7 @@ static void spice_display_class_init(SpiceDisplayClass *klass)
      * When this is true the clipboard gets automatically shared between host
      * and guest.
      *
-     * Deprecated: 0.8: Use #SpiceGtkSession's auto-clipboard property instead
+     * Deprecated: 0.8: Use SpiceGtkSession:auto-clipboard property instead
      **/
     g_object_class_install_property
         (gobject_class, PROP_AUTO_CLIPBOARD,
@@ -1216,7 +1216,8 @@ static void spice_display_class_init(SpiceDisplayClass *klass)
                               "host and guest.",
                               TRUE,
                               G_PARAM_READWRITE |
-                              G_PARAM_STATIC_STRINGS));
+                              G_PARAM_STATIC_STRINGS |
+                              G_PARAM_DEPRECATED));
 
     g_object_class_install_property
         (gobject_class, PROP_SCALING,
@@ -1656,6 +1657,7 @@ void spice_display_mouse_ungrab(SpiceDisplay *display)
  *
  * Deprecated: 0.8: Use spice_gtk_session_copy_to_guest() instead
  **/
+GLIB_DEPRECATED_FOR(spice_gtk_session_copy_to_guest)
 void spice_display_copy_to_guest(SpiceDisplay *display)
 {
     SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display);
@@ -1673,6 +1675,7 @@ void spice_display_copy_to_guest(SpiceDisplay *display)
  *
  * Deprecated: 0.8: Use spice_gtk_session_paste_from_guest() instead
  **/
+GLIB_DEPRECATED_FOR(spice_gtk_session_paste_from_guest)
 void spice_display_paste_from_guest(SpiceDisplay *display)
 {
     SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display);
-- 
1.7.7



More information about the Spice-devel mailing list