[Spice-commits] 5 commits - doc/reference src/channel-display.c src/channel-display.h src/channel-inputs.c src/channel-inputs.h src/channel-main.c src/channel-main.h src/channel-port.c src/channel-port.h src/channel-record.c src/channel-record.h src/map-file src/spice-glib-sym-file src/spice-gstaudio.c src/spice-gtk-session.c src/spice-pulse.c src/spice-widget.c src/spice-widget-egl.c tools/spicy.c

Marc-André Lureau elmarco at kemper.freedesktop.org
Mon Sep 25 11:03:29 UTC 2017


 doc/reference/spice-gtk-sections.txt |   28 +++
 src/channel-display.c                |   92 +++++++++++
 src/channel-display.h                |   22 ++
 src/channel-inputs.c                 |  146 +++++++++++++++++-
 src/channel-inputs.h                 |   34 +++-
 src/channel-main.c                   |  283 +++++++++++++++++++++++++++++++----
 src/channel-main.h                   |   99 ++++++++----
 src/channel-port.c                   |   67 ++++++++
 src/channel-port.h                   |   15 +
 src/channel-record.c                 |   19 ++
 src/channel-record.h                 |    6 
 src/map-file                         |   28 +++
 src/spice-glib-sym-file              |   28 +++
 src/spice-gstaudio.c                 |    2 
 src/spice-gtk-session.c              |   30 +--
 src/spice-pulse.c                    |    8 
 src/spice-widget-egl.c               |    2 
 src/spice-widget.c                   |   71 ++++----
 tools/spicy.c                        |   41 ++---
 19 files changed, 870 insertions(+), 151 deletions(-)

New commits:
commit 284c1f2d7e0384c3240c7c48a3bbf39adb8799d3
Author: Matthew Francis <mjay.francis at gmail.com>
Date:   Tue Sep 19 22:34:01 2017 +0800

    MainChannel: Fix introspection method bindings
    
    Signed-off-by: Matthew Francis <mjay.francis at gmail.com>
    Reviewed-by: Marc-André Lureau <marcandre.lureau at redhat.com>
    Message-Id: <1505831641-28134-6-git-send-email-mjay.francis at gmail.com>

diff --git a/doc/reference/spice-gtk-sections.txt b/doc/reference/spice-gtk-sections.txt
index 0f5ec10..a85df7a 100644
--- a/doc/reference/spice-gtk-sections.txt
+++ b/doc/reference/spice-gtk-sections.txt
@@ -69,20 +69,31 @@ SpiceMainChannelClass
 spice_main_set_display
 spice_main_set_display_enabled
 spice_main_update_display
+spice_main_channel_update_display
 spice_main_update_display_enabled
+spice_main_channel_update_display_enabled
 spice_main_send_monitor_config
+spice_main_channel_send_monitor_config
 spice_main_agent_test_capability
+spice_main_channel_agent_test_capability
 spice_main_request_mouse_mode
+spice_main_channel_request_mouse_mode
 spice_main_clipboard_selection_grab
+spice_main_channel_clipboard_selection_grab
 spice_main_clipboard_selection_notify
+spice_main_channel_clipboard_selection_notify
 spice_main_clipboard_selection_release
+spice_main_channel_clipboard_selection_release
 spice_main_clipboard_selection_request
+spice_main_channel_clipboard_selection_request
 spice_main_clipboard_grab
 spice_main_clipboard_release
 spice_main_clipboard_notify
 spice_main_clipboard_request
 spice_main_file_copy_async
+spice_main_channel_file_copy_async
 spice_main_file_copy_finish
+spice_main_channel_file_copy_finish
 <SUBSECTION Standard>
 SPICE_MAIN_CHANNEL
 SPICE_IS_MAIN_CHANNEL
diff --git a/src/channel-main.c b/src/channel-main.c
index dd78cad..3d682d6 100644
--- a/src/channel-main.c
+++ b/src/channel-main.c
@@ -1085,9 +1085,27 @@ static void monitors_align(VDAgentMonConfig *monitors, int nmonitors)
  * spice_main_set_display() and spice_main_set_display_enabled()
  *
  * Returns: %TRUE on success.
+ *
+ * Deprecated: 0.35: use spice_main_channel_send_monitor_config() instead.
  **/
 gboolean spice_main_send_monitor_config(SpiceMainChannel *channel)
 {
+    return spice_main_channel_send_monitor_config(channel);
+}
+
+/**
+ * spice_main_channel_send_monitor_config:
+ * @channel: a #SpiceMainChannel
+ *
+ * Send monitors configuration previously set with
+ * spice_main_set_display() and spice_main_set_display_enabled()
+ *
+ * Returns: %TRUE on success.
+ *
+ * Since: 0.35
+ **/
+gboolean spice_main_channel_send_monitor_config(SpiceMainChannel *channel)
+{
     SpiceMainChannelPrivate *c;
     VDAgentMonitorsConfig *mon;
     int i, j, monitors;
@@ -1097,8 +1115,7 @@ gboolean spice_main_send_monitor_config(SpiceMainChannel *channel)
     c = channel->priv;
     g_return_val_if_fail(c->agent_connected, FALSE);
 
-    if (spice_main_agent_test_capability(channel,
-                                     VD_AGENT_CAP_SPARSE_MONITORS_CONFIG)) {
+    if (spice_main_channel_agent_test_capability(channel, VD_AGENT_CAP_SPARSE_MONITORS_CONFIG)) {
         monitors = SPICE_N_ELEMENTS(c->display);
     } else {
         monitors = 0;
@@ -1120,8 +1137,8 @@ gboolean spice_main_send_monitor_config(SpiceMainChannel *channel)
     j = 0;
     for (i = 0; i < SPICE_N_ELEMENTS(c->display); i++) {
         if (c->display[i].display_state != DISPLAY_ENABLED) {
-            if (spice_main_agent_test_capability(channel,
-                                     VD_AGENT_CAP_SPARSE_MONITORS_CONFIG))
+            if (spice_main_channel_agent_test_capability(channel,
+                                                         VD_AGENT_CAP_SPARSE_MONITORS_CONFIG))
                 j++;
             continue;
         }
@@ -1497,7 +1514,7 @@ static gboolean timer_set_display(gpointer data)
 
     session = spice_channel_get_session(SPICE_CHANNEL(channel));
 
-    if (!spice_main_agent_test_capability(channel, VD_AGENT_CAP_SPARSE_MONITORS_CONFIG)) {
+    if (!spice_main_channel_agent_test_capability(channel, VD_AGENT_CAP_SPARSE_MONITORS_CONFIG)) {
         /* ensure we have an explicit monitor configuration at least for
            number of display channels */
         for (i = 0; i < spice_session_get_n_display_channels(session); i++)
@@ -1506,7 +1523,7 @@ static gboolean timer_set_display(gpointer data)
                 return FALSE;
             }
     }
-    spice_main_send_monitor_config(channel);
+    spice_main_channel_send_monitor_config(channel);
 
     return FALSE;
 }
@@ -1587,9 +1604,26 @@ static void agent_stopped(SpiceMainChannel *channel)
  * when possible.
  *
  * Since: 0.32
+ * Deprecated: 0.35: use spice_main_channel_request_mouse_mode() instead.
  **/
 void spice_main_request_mouse_mode(SpiceMainChannel *channel, int mode)
 {
+    spice_main_channel_request_mouse_mode(channel, mode);
+}
+
+/**
+ * spice_main_channel_request_mouse_mode:
+ * @channel: a %SpiceMainChannel
+ * @mode: a SPICE_MOUSE_MODE
+ *
+ * Request a mouse mode to the server. The server may not be able to
+ * change the mouse mode, but spice-gtk will try to request it
+ * when possible.
+ *
+ * Since: 0.35
+ **/
+void spice_main_channel_request_mouse_mode(SpiceMainChannel *channel, int mode)
+{
     SpiceMsgcMainMouseModeRequest req = {
         .mode = mode,
     };
@@ -1623,7 +1657,7 @@ static void set_mouse_mode(SpiceMainChannel *channel, uint32_t supported, uint32
 
     if (c->requested_mouse_mode != c->mouse_mode &&
         c->requested_mouse_mode & supported) {
-        spice_main_request_mouse_mode(SPICE_MAIN_CHANNEL(channel), c->requested_mouse_mode);
+        spice_main_channel_request_mouse_mode(SPICE_MAIN_CHANNEL(channel), c->requested_mouse_mode);
     }
 }
 
@@ -2567,9 +2601,27 @@ static void spice_main_handle_msg(SpiceChannel *channel, SpiceMsgIn *msg)
  * Test capability of a remote agent.
  *
  * Returns: %TRUE if @cap (channel kind capability) is available.
+ *
+ * Deprecated: 0.35: use spice_main_channel_agent_test_capability() instead.
  **/
 gboolean spice_main_agent_test_capability(SpiceMainChannel *channel, guint32 cap)
 {
+    return spice_main_channel_agent_test_capability(channel, cap);
+}
+
+/**
+ * spice_main_channel_agent_test_capability:
+ * @channel: a #SpiceMainChannel
+ * @cap: an agent capability identifier
+ *
+ * Test capability of a remote agent.
+ *
+ * Returns: %TRUE if @cap (channel kind capability) is available.
+ *
+ * Since: 0.35
+ **/
+gboolean spice_main_channel_agent_test_capability(SpiceMainChannel *channel, guint32 cap)
+{
     g_return_val_if_fail(SPICE_IS_MAIN_CHANNEL(channel), FALSE);
 
     return test_agent_cap(channel, cap);
@@ -2591,11 +2643,38 @@ gboolean spice_main_agent_test_capability(SpiceMainChannel *channel, guint32 cap
  * after 1 second without further changes. You can send when you want
  * without delay the new configuration to the remote with
  * spice_main_send_monitor_config()
+ *
+ * Deprecated: 0.35: use spice_main_channel_update_display() instead.
  **/
 void spice_main_update_display(SpiceMainChannel *channel, int id,
                                int x, int y, int width, int height,
                                gboolean update)
 {
+    spice_main_channel_update_display(channel, id, x, y, width, height, update);
+}
+
+/**
+ * spice_main_channel_update_display:
+ * @channel: a #SpiceMainChannel
+ * @id: display ID
+ * @x: x position
+ * @y: y position
+ * @width: display width
+ * @height: display height
+ * @update: if %TRUE, update guest resolution after 1sec.
+ *
+ * Update the display @id resolution.
+ *
+ * If @update is %TRUE, the remote configuration will be updated too
+ * after 1 second without further changes. You can send when you want
+ * without delay the new configuration to the remote with
+ * spice_main_send_monitor_config()
+ *
+ * Since: 0.35
+ **/
+void spice_main_channel_update_display(SpiceMainChannel *channel, int id, int x, int y, int width,
+                               int height, gboolean update)
+{
     SpiceMainChannelPrivate *c;
 
     g_return_if_fail(channel != NULL);
@@ -2634,11 +2713,13 @@ void spice_main_update_display(SpiceMainChannel *channel, int id,
  *
  * Notify the guest of screen resolution change. The notification is
  * sent 1 second later, if no further changes happen.
+ *
+ * Deprecated: 0.35: use spice_main_channel_update_display() instead.
  **/
 void spice_main_set_display(SpiceMainChannel *channel, int id,
                             int x, int y, int width, int height)
 {
-    spice_main_update_display(channel, id, x, y, width, height, TRUE);
+    spice_main_channel_update_display(channel, id, x, y, width, height, TRUE);
 }
 
 /**
@@ -2649,11 +2730,12 @@ void spice_main_set_display(SpiceMainChannel *channel, int id,
  *
  * Grab the guest clipboard, with #VD_AGENT_CLIPBOARD @types.
  *
- * Deprecated: 0.6: use spice_main_clipboard_selection_grab() instead.
+ * Deprecated: 0.6: use spice_main_channel_clipboard_selection_grab() instead.
  **/
 void spice_main_clipboard_grab(SpiceMainChannel *channel, guint32 *types, int ntypes)
 {
-    spice_main_clipboard_selection_grab(channel, VD_AGENT_CLIPBOARD_SELECTION_CLIPBOARD, types, ntypes);
+    spice_main_channel_clipboard_selection_grab(channel, VD_AGENT_CLIPBOARD_SELECTION_CLIPBOARD,
+                                                types, ntypes);
 }
 
 /**
@@ -2666,10 +2748,28 @@ void spice_main_clipboard_grab(SpiceMainChannel *channel, guint32 *types, int nt
  * Grab the guest clipboard, with #VD_AGENT_CLIPBOARD @types.
  *
  * Since: 0.6
+ * Deprecated: 0.35: use spice_main_channel_clipboard_selection_grab() instead.
  **/
 void spice_main_clipboard_selection_grab(SpiceMainChannel *channel, guint selection,
                                          guint32 *types, int ntypes)
 {
+    spice_main_channel_clipboard_selection_grab(channel, selection, types, ntypes);
+}
+
+/**
+ * spice_main_channel_clipboard_selection_grab:
+ * @channel: a #SpiceMainChannel
+ * @selection: one of the clipboard #VD_AGENT_CLIPBOARD_SELECTION_*
+ * @types: an array of #VD_AGENT_CLIPBOARD types available in the clipboard
+ * @ntypes: the number of @types
+ *
+ * Grab the guest clipboard, with #VD_AGENT_CLIPBOARD @types.
+ *
+ * Since: 0.35
+ **/
+void spice_main_channel_clipboard_selection_grab(SpiceMainChannel *channel, guint selection,
+                                                 guint32 *types, int ntypes)
+{
     g_return_if_fail(channel != NULL);
     g_return_if_fail(SPICE_IS_MAIN_CHANNEL(channel));
 
@@ -2684,11 +2784,11 @@ void spice_main_clipboard_selection_grab(SpiceMainChannel *channel, guint select
  * Release the clipboard (for example, when the client loses the
  * clipboard grab): Inform the guest no clipboard data is available.
  *
- * Deprecated: 0.6: use spice_main_clipboard_selection_release() instead.
+ * Deprecated: 0.6: use spice_main_channel_clipboard_selection_release() instead.
  **/
 void spice_main_clipboard_release(SpiceMainChannel *channel)
 {
-    spice_main_clipboard_selection_release(channel, VD_AGENT_CLIPBOARD_SELECTION_CLIPBOARD);
+    spice_main_channel_clipboard_selection_release(channel, VD_AGENT_CLIPBOARD_SELECTION_CLIPBOARD);
 }
 
 /**
@@ -2700,9 +2800,25 @@ void spice_main_clipboard_release(SpiceMainChannel *channel)
  * clipboard grab): Inform the guest no clipboard data is available.
  *
  * Since: 0.6
+ * Deprecated: 0.35: use spice_main_channel_clipboard_selection_release() instead.
  **/
 void spice_main_clipboard_selection_release(SpiceMainChannel *channel, guint selection)
 {
+    spice_main_channel_clipboard_selection_release(channel, selection);
+}
+
+/**
+ * spice_main_channel_clipboard_selection_release:
+ * @channel: a #SpiceMainChannel
+ * @selection: one of the clipboard #VD_AGENT_CLIPBOARD_SELECTION_*
+ *
+ * Release the clipboard (for example, when the client loses the
+ * clipboard grab): Inform the guest no clipboard data is available.
+ *
+ * Since: 0.35
+ **/
+void spice_main_channel_clipboard_selection_release(SpiceMainChannel *channel, guint selection)
+{
     g_return_if_fail(channel != NULL);
     g_return_if_fail(SPICE_IS_MAIN_CHANNEL(channel));
 
@@ -2724,13 +2840,13 @@ void spice_main_clipboard_selection_release(SpiceMainChannel *channel, guint sel
  *
  * Send the clipboard data to the guest.
  *
- * Deprecated: 0.6: use spice_main_clipboard_selection_notify() instead.
+ * Deprecated: 0.6: use spice_main_channel_clipboard_selection_notify() instead.
  **/
 void spice_main_clipboard_notify(SpiceMainChannel *channel,
                                  guint32 type, const guchar *data, size_t size)
 {
-    spice_main_clipboard_selection_notify(channel, VD_AGENT_CLIPBOARD_SELECTION_CLIPBOARD,
-                                          type, data, size);
+    spice_main_channel_clipboard_selection_notify(channel, VD_AGENT_CLIPBOARD_SELECTION_CLIPBOARD,
+                                                  type, data, size);
 }
 
 /**
@@ -2744,10 +2860,29 @@ void spice_main_clipboard_notify(SpiceMainChannel *channel,
  * Send the clipboard data to the guest.
  *
  * Since: 0.6
+ * Deprecated: 0.35: use spice_main_channel_clipboard_selection_notify() instead.
  **/
 void spice_main_clipboard_selection_notify(SpiceMainChannel *channel, guint selection,
                                            guint32 type, const guchar *data, size_t size)
 {
+    spice_main_channel_clipboard_selection_notify(channel, selection, type, data, size);
+}
+
+/**
+ * spice_main_channel_clipboard_selection_notify:
+ * @channel: a #SpiceMainChannel
+ * @selection: one of the clipboard #VD_AGENT_CLIPBOARD_SELECTION_*
+ * @type: a #VD_AGENT_CLIPBOARD type
+ * @data: clipboard data
+ * @size: data length in bytes
+ *
+ * Send the clipboard data to the guest.
+ *
+ * Since: 0.35
+ **/
+void spice_main_channel_clipboard_selection_notify(SpiceMainChannel *channel, guint selection,
+                                           guint32 type, const guchar *data, size_t size)
+{
     g_return_if_fail(channel != NULL);
     g_return_if_fail(SPICE_IS_MAIN_CHANNEL(channel));
 
@@ -2763,11 +2898,12 @@ void spice_main_clipboard_selection_notify(SpiceMainChannel *channel, guint sele
  * Request clipboard data of @type from the guest. The reply is sent
  * through the #SpiceMainChannel::main-clipboard signal.
  *
- * Deprecated: 0.6: use spice_main_clipboard_selection_request() instead.
+ * Deprecated: 0.6: use spice_main_channel_clipboard_selection_request() instead.
  **/
 void spice_main_clipboard_request(SpiceMainChannel *channel, guint32 type)
 {
-    spice_main_clipboard_selection_request(channel, VD_AGENT_CLIPBOARD_SELECTION_CLIPBOARD, type);
+    spice_main_channel_clipboard_selection_request(channel, VD_AGENT_CLIPBOARD_SELECTION_CLIPBOARD,
+                                                   type);
 }
 
 /**
@@ -2780,9 +2916,27 @@ void spice_main_clipboard_request(SpiceMainChannel *channel, guint32 type)
  * through the #SpiceMainChannel::main-clipboard-selection signal.
  *
  * Since: 0.6
+ * Deprecated: 0.35: use spice_main_channel_clipboard_selection_request() instead.
  **/
 void spice_main_clipboard_selection_request(SpiceMainChannel *channel, guint selection, guint32 type)
 {
+    spice_main_channel_clipboard_selection_request(channel, selection, type);
+}
+
+/**
+ * spice_main_channel_clipboard_selection_request:
+ * @channel: a #SpiceMainChannel
+ * @selection: one of the clipboard #VD_AGENT_CLIPBOARD_SELECTION_*
+ * @type: a #VD_AGENT_CLIPBOARD type
+ *
+ * Request clipboard data of @type from the guest. The reply is sent
+ * through the #SpiceMainChannel::main-clipboard-selection signal.
+ *
+ * Since: 0.35
+ **/
+void spice_main_channel_clipboard_selection_request(SpiceMainChannel *channel, guint selection,
+                                                    guint32 type)
+{
     g_return_if_fail(channel != NULL);
     g_return_if_fail(SPICE_IS_MAIN_CHANNEL(channel));
 
@@ -2807,8 +2961,34 @@ void spice_main_clipboard_selection_request(SpiceMainChannel *channel, guint sel
  * the value will be saved and used in the next configuration update.
  *
  * Since: 0.30
+ * Deprecated: 0.35: use spice_main_channel_update_display_enabled() instead.
  **/
-void spice_main_update_display_enabled(SpiceMainChannel *channel, int id, gboolean enabled, gboolean update)
+void spice_main_update_display_enabled(SpiceMainChannel *channel, int id, gboolean enabled,
+                                       gboolean update)
+{
+    spice_main_channel_update_display_enabled(channel, id, enabled, update);
+}
+
+/**
+ * spice_main_channel_update_display_enabled:
+ * @channel: a #SpiceMainChannel
+ * @id: display ID (if -1: set all displays)
+ * @enabled: wether display @id is enabled
+ * @update: if %TRUE, update guest display state after 1sec.
+ *
+ * When sending monitor configuration to agent guest, if @enabled is %FALSE,
+ * don't set display @id, which the agent translates to disabling the display
+ * id. If @enabled is %TRUE, the monitor will be included in the next monitor
+ * update. Note: this will take effect next time the monitor configuration is
+ * sent.
+ *
+ * If @update is %FALSE, no server update will be triggered by this call, but
+ * the value will be saved and used in the next configuration update.
+ *
+ * Since: 0.35
+ **/
+void spice_main_channel_update_display_enabled(SpiceMainChannel *channel, int id, gboolean enabled,
+                                               gboolean update)
 {
     SpiceDisplayState display_state = enabled ? DISPLAY_ENABLED : DISPLAY_DISABLED;
     g_return_if_fail(channel != NULL);
@@ -2845,10 +3025,11 @@ void spice_main_update_display_enabled(SpiceMainChannel *channel, int id, gboole
  * configuration is sent.
  *
  * Since: 0.6
+ * Deprecated: 0.35: use spice_main_channel_update_display_enabled() instead.
  **/
 void spice_main_set_display_enabled(SpiceMainChannel *channel, int id, gboolean enabled)
 {
-    spice_main_update_display_enabled(channel, id, enabled, TRUE);
+    spice_main_channel_update_display_enabled(channel, id, enabled, TRUE);
 }
 
 static void file_xfer_init_task_async_cb(GObject *obj, GAsyncResult *res, gpointer data)
@@ -3068,6 +3249,35 @@ static void file_transfer_operation_send_progress(SpiceFileTransferTask *xfer_ta
  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
  * @user_data: the data to pass to callback function
  *
+ * See: spice_main_channel_file_copy_async()
+ *
+ * Deprecated: 0.35: use spice_main_channel_file_copy_async() instead.
+ **/
+void spice_main_file_copy_async(SpiceMainChannel *channel,
+                                GFile **sources,
+                                GFileCopyFlags flags,
+                                GCancellable *cancellable,
+                                GFileProgressCallback progress_callback,
+                                gpointer progress_callback_data,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data)
+{
+    spice_main_channel_file_copy_async(channel, sources, flags, cancellable, progress_callback,
+                                       progress_callback_data, callback, user_data);
+}
+
+/**
+ * spice_main_channel_file_copy_async:
+ * @channel: a #SpiceMainChannel
+ * @sources: (array zero-terminated=1): a %NULL-terminated array of #GFile objects to be transferred
+ * @flags: set of #GFileCopyFlags
+ * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
+ * @progress_callback: (allow-none) (scope call): function to callback with
+ *     progress information, or %NULL if progress information is not needed
+ * @progress_callback_data: (closure): user data to pass to @progress_callback
+ * @callback: a #GAsyncReadyCallback to call when the request is satisfied
+ * @user_data: the data to pass to callback function
+ *
  * Copies the file @sources to guest
  *
  * If @cancellable is not %NULL, then the operation can be cancelled by
@@ -3092,15 +3302,16 @@ static void file_transfer_operation_send_progress(SpiceFileTransferTask *xfer_ta
  * progress_callback (above). If you need to monitor the ending of individual
  * files, you can connect to "finished" signal from each SpiceFileTransferTask.
  *
+ * Since: 0.35
  **/
-void spice_main_file_copy_async(SpiceMainChannel *channel,
-                                GFile **sources,
-                                GFileCopyFlags flags,
-                                GCancellable *cancellable,
-                                GFileProgressCallback progress_callback,
-                                gpointer progress_callback_data,
-                                GAsyncReadyCallback callback,
-                                gpointer user_data)
+void spice_main_channel_file_copy_async(SpiceMainChannel *channel,
+                                        GFile **sources,
+                                        GFileCopyFlags flags,
+                                        GCancellable *cancellable,
+                                        GFileProgressCallback progress_callback,
+                                        gpointer progress_callback_data,
+                                        GAsyncReadyCallback callback,
+                                        gpointer user_data)
 {
     SpiceMainChannelPrivate *c;
     FileTransferOperation *xfer_op;
@@ -3172,6 +3383,24 @@ gboolean spice_main_file_copy_finish(SpiceMainChannel *channel,
                                      GAsyncResult *result,
                                      GError **error)
 {
+    return spice_main_channel_file_copy_finish(channel, result, error);
+}
+
+/**
+ * spice_main_channel_file_copy_finish:
+ * @channel: a #SpiceMainChannel
+ * @result: a #GAsyncResult.
+ * @error: a #GError, or %NULL
+ *
+ * Finishes copying the file started with
+ * spice_main_file_copy_async().
+ *
+ * Returns: a %TRUE on success, %FALSE on error.
+ **/
+gboolean spice_main_channel_file_copy_finish(SpiceMainChannel *channel,
+                                             GAsyncResult *result,
+                                             GError **error)
+{
     GTask *task = G_TASK(result);
 
     g_return_val_if_fail(SPICE_IS_MAIN_CHANNEL(channel), FALSE);
diff --git a/src/channel-main.h b/src/channel-main.h
index 2bb6d10..7650a03 100644
--- a/src/channel-main.h
+++ b/src/channel-main.h
@@ -71,44 +71,81 @@ struct _SpiceMainChannelClass {
 
 GType spice_main_channel_get_type(void);
 
-void spice_main_set_display(SpiceMainChannel *channel, int id,
-                            int x, int y, int width, int height);
-void spice_main_update_display(SpiceMainChannel *channel, int id,
-                               int x, int y, int width, int height, gboolean update);
+void spice_main_channel_update_display(SpiceMainChannel *channel, int id, int x, int y, int width,
+                                       int height, gboolean update);
+void spice_main_channel_update_display_enabled(SpiceMainChannel *channel, int id, gboolean enabled,
+                                               gboolean update);
+gboolean spice_main_channel_send_monitor_config(SpiceMainChannel *channel);
+
+void spice_main_channel_clipboard_selection_grab(SpiceMainChannel *channel, guint selection,
+                                                 guint32 *types, int ntypes);
+void spice_main_channel_clipboard_selection_release(SpiceMainChannel *channel, guint selection);
+void spice_main_channel_clipboard_selection_notify(SpiceMainChannel *channel, guint selection,
+                                                   guint32 type, const guchar *data, size_t size);
+void spice_main_channel_clipboard_selection_request(SpiceMainChannel *channel, guint selection,
+                                                    guint32 type);
+
+gboolean spice_main_channel_agent_test_capability(SpiceMainChannel *channel, guint32 cap);
+void spice_main_channel_file_copy_async(SpiceMainChannel *channel,
+                                        GFile **sources,
+                                        GFileCopyFlags flags,
+                                        GCancellable *cancellable,
+                                        GFileProgressCallback progress_callback,
+                                        gpointer progress_callback_data,
+                                        GAsyncReadyCallback callback,
+                                        gpointer user_data);
+
+gboolean spice_main_channel_file_copy_finish(SpiceMainChannel *channel,
+                                             GAsyncResult *result,
+                                             GError **error);
+
+void spice_main_channel_request_mouse_mode(SpiceMainChannel *channel, int mode);
+
+#ifndef SPICE_DISABLE_DEPRECATED
+G_DEPRECATED_FOR(spice_main_channel_clipboard_selection_grab)
+void spice_main_clipboard_grab(SpiceMainChannel *channel, guint32 *types, int ntypes);
+G_DEPRECATED_FOR(spice_main_channel_clipboard_selection_release)
+void spice_main_clipboard_release(SpiceMainChannel *channel);
+G_DEPRECATED_FOR(spice_main_channel_clipboard_selection_notify)
+void spice_main_clipboard_notify(SpiceMainChannel *channel, guint32 type, const guchar *data, size_t size);
+G_DEPRECATED_FOR(spice_main_channel_clipboard_selection_request)
+void spice_main_clipboard_request(SpiceMainChannel *channel, guint32 type);
+
+G_DEPRECATED_FOR(spice_main_channel_set_display)
+void spice_main_set_display(SpiceMainChannel *channel, int id,int x, int y, int width, int height);
+G_DEPRECATED_FOR(spice_main_update_display)
+void spice_main_update_display(SpiceMainChannel *channel, int id, int x, int y, int width,
+                               int height, gboolean update);
+G_DEPRECATED_FOR(spice_main_channel_set_display_enabled)
 void spice_main_set_display_enabled(SpiceMainChannel *channel, int id, gboolean enabled);
-void spice_main_update_display_enabled(SpiceMainChannel *channel, int id, gboolean enabled, gboolean update);
+G_DEPRECATED_FOR(spice_main_channel_update_display_enabled)
+void spice_main_update_display_enabled(SpiceMainChannel *channel, int id, gboolean enabled,
+                                       gboolean update);
+G_DEPRECATED_FOR(spice_main_channel_send_monitor_config)
 gboolean spice_main_send_monitor_config(SpiceMainChannel *channel);
-
-void spice_main_clipboard_selection_grab(SpiceMainChannel *channel, guint selection, guint32 *types, int ntypes);
+G_DEPRECATED_FOR(spice_main_channel_clipboard_selection_grab)
+void spice_main_clipboard_selection_grab(SpiceMainChannel *channel, guint selection, guint32 *types,
+                                         int ntypes);
+G_DEPRECATED_FOR(spice_main_channel_clipboard_selection_release)
 void spice_main_clipboard_selection_release(SpiceMainChannel *channel, guint selection);
-void spice_main_clipboard_selection_notify(SpiceMainChannel *channel, guint selection, guint32 type, const guchar *data, size_t size);
-void spice_main_clipboard_selection_request(SpiceMainChannel *channel, guint selection, guint32 type);
-
+G_DEPRECATED_FOR(spice_main_channel_clipboard_selection_notify)
+void spice_main_clipboard_selection_notify(SpiceMainChannel *channel, guint selection, guint32 type,
+                                           const guchar *data, size_t size);
+G_DEPRECATED_FOR(spice_main_channel_clipboard_selection_request)
+void spice_main_clipboard_selection_request(SpiceMainChannel *channel, guint selection,
+                                            guint32 type);
+G_DEPRECATED_FOR(spice_main_channel_agent_test_capability)
 gboolean spice_main_agent_test_capability(SpiceMainChannel *channel, guint32 cap);
-void spice_main_file_copy_async(SpiceMainChannel *channel,
-                                GFile **sources,
-                                GFileCopyFlags flags,
-                                GCancellable *cancellable,
-                                GFileProgressCallback progress_callback,
-                                gpointer progress_callback_data,
-                                GAsyncReadyCallback callback,
+G_DEPRECATED_FOR(spice_main_channel_file_copy_async)
+void spice_main_file_copy_async(SpiceMainChannel *channel, GFile **sources, GFileCopyFlags flags,
+                                GCancellable *cancellable, GFileProgressCallback progress_callback,
+                                gpointer progress_callback_data, GAsyncReadyCallback callback,
                                 gpointer user_data);
-
-gboolean spice_main_file_copy_finish(SpiceMainChannel *channel,
-                                     GAsyncResult *result,
+G_DEPRECATED_FOR(spice_main_channel_file_copy_finish)
+gboolean spice_main_file_copy_finish(SpiceMainChannel *channel, GAsyncResult *result,
                                      GError **error);
-
+G_DEPRECATED_FOR(spice_main_channel_request_mouse_mode)
 void spice_main_request_mouse_mode(SpiceMainChannel *channel, int mode);
-
-#ifndef SPICE_DISABLE_DEPRECATED
-G_DEPRECATED_FOR(spice_main_clipboard_selection_grab)
-void spice_main_clipboard_grab(SpiceMainChannel *channel, guint32 *types, int ntypes);
-G_DEPRECATED_FOR(spice_main_clipboard_selection_release)
-void spice_main_clipboard_release(SpiceMainChannel *channel);
-G_DEPRECATED_FOR(spice_main_clipboard_selection_notify)
-void spice_main_clipboard_notify(SpiceMainChannel *channel, guint32 type, const guchar *data, size_t size);
-G_DEPRECATED_FOR(spice_main_clipboard_selection_request)
-void spice_main_clipboard_request(SpiceMainChannel *channel, guint32 type);
 #endif
 
 G_END_DECLS
diff --git a/src/map-file b/src/map-file
index 14e8ac6..cdb81c3 100644
--- a/src/map-file
+++ b/src/map-file
@@ -80,7 +80,18 @@ spice_inputs_motion;
 spice_inputs_position;
 spice_inputs_set_key_locks;
 spice_main_agent_test_capability;
+spice_main_channel_agent_test_capability;
+spice_main_channel_clipboard_selection_grab;
+spice_main_channel_clipboard_selection_notify;
+spice_main_channel_clipboard_selection_release;
+spice_main_channel_clipboard_selection_request;
+spice_main_channel_file_copy_async;
+spice_main_channel_file_copy_finish;
 spice_main_channel_get_type;
+spice_main_channel_request_mouse_mode;
+spice_main_channel_send_monitor_config;
+spice_main_channel_update_display;
+spice_main_channel_update_display_enabled;
 spice_main_clipboard_grab;
 spice_main_clipboard_notify;
 spice_main_clipboard_release;
diff --git a/src/spice-glib-sym-file b/src/spice-glib-sym-file
index 38e87e0..b19844c 100644
--- a/src/spice-glib-sym-file
+++ b/src/spice-glib-sym-file
@@ -59,7 +59,18 @@ spice_inputs_motion
 spice_inputs_position
 spice_inputs_set_key_locks
 spice_main_agent_test_capability
+spice_main_channel_agent_test_capability
+spice_main_channel_clipboard_selection_grab
+spice_main_channel_clipboard_selection_notify
+spice_main_channel_clipboard_selection_release
+spice_main_channel_clipboard_selection_request
+spice_main_channel_file_copy_async
+spice_main_channel_file_copy_finish
 spice_main_channel_get_type
+spice_main_channel_request_mouse_mode
+spice_main_channel_send_monitor_config
+spice_main_channel_update_display
+spice_main_channel_update_display_enabled
 spice_main_clipboard_grab
 spice_main_clipboard_notify
 spice_main_clipboard_release
diff --git a/src/spice-gtk-session.c b/src/spice-gtk-session.c
index 6a53bf5..312cf59 100644
--- a/src/spice-gtk-session.c
+++ b/src/spice-gtk-session.c
@@ -671,8 +671,8 @@ static void clipboard_get_targets(GtkClipboard *clipboard,
 
     s->clip_grabbed[selection] = TRUE;
 
-    if (spice_main_agent_test_capability(s->main, VD_AGENT_CAP_CLIPBOARD_BY_DEMAND))
-        spice_main_clipboard_selection_grab(s->main, selection, types, num_types);
+    if (spice_main_channel_agent_test_capability(s->main, VD_AGENT_CAP_CLIPBOARD_BY_DEMAND))
+        spice_main_channel_clipboard_selection_grab(s->main, selection, types, num_types);
 
     /* Sending a grab causes the agent to do an implicit release */
     s->nclip_targets[selection] = 0;
@@ -696,8 +696,8 @@ static void clipboard_owner_change(GtkClipboard        *clipboard,
 
     if (s->clip_grabbed[selection]) {
         s->clip_grabbed[selection] = FALSE;
-        if (spice_main_agent_test_capability(s->main, VD_AGENT_CAP_CLIPBOARD_BY_DEMAND))
-            spice_main_clipboard_selection_release(s->main, selection);
+        if (spice_main_channel_agent_test_capability(s->main, VD_AGENT_CAP_CLIPBOARD_BY_DEMAND))
+            spice_main_channel_clipboard_selection_release(s->main, selection);
     }
 
     switch (event->reason) {
@@ -741,7 +741,7 @@ static void clipboard_got_from_guest(SpiceMainChannel *main, guint selection,
     if (atom2agent[ri->info].vdagent == VD_AGENT_CLIPBOARD_UTF8_TEXT) {
         /* on windows, gtk+ would already convert to LF endings, but
            not on unix */
-        if (spice_main_agent_test_capability(s->main, VD_AGENT_CAP_GUEST_LINEEND_CRLF)) {
+        if (spice_main_channel_agent_test_capability(s->main, VD_AGENT_CAP_GUEST_LINEEND_CRLF)) {
             conv = spice_dos2unix((gchar*)data, size);
             size = strlen(conv);
         }
@@ -801,8 +801,8 @@ static void clipboard_get(GtkClipboard *clipboard,
                                      G_CALLBACK(clipboard_agent_connected),
                                      &ri);
 
-    spice_main_clipboard_selection_request(s->main, selection,
-                                           atom2agent[info].vdagent);
+    spice_main_channel_clipboard_selection_request(s->main, selection,
+                                                   atom2agent[info].vdagent);
 
 
     g_object_get(s->main, "agent-connected", &agent_connected, NULL);
@@ -921,7 +921,8 @@ static char *fixup_clipboard_text(SpiceGtkSession *self, const char *text, int *
 {
     char *conv = NULL;
 
-    if (spice_main_agent_test_capability(self->priv->main, VD_AGENT_CAP_GUEST_LINEEND_CRLF)) {
+    if (spice_main_channel_agent_test_capability(self->priv->main,
+                                                 VD_AGENT_CAP_GUEST_LINEEND_CRLF)) {
         conv = spice_unix2dos(text, *len);
         *len = strlen(conv);
     } else {
@@ -976,10 +977,10 @@ static void clipboard_received_text_cb(GtkClipboard *clipboard,
 
     data = (const guchar *) (conv != NULL ? conv : text);
 notify_agent:
-    spice_main_clipboard_selection_notify(self->priv->main, selection,
-                                          VD_AGENT_CLIPBOARD_UTF8_TEXT,
-                                          data,
-                                          (data != NULL) ? len : 0);
+    spice_main_channel_clipboard_selection_notify(self->priv->main, selection,
+                                                  VD_AGENT_CLIPBOARD_UTF8_TEXT,
+                                                  data,
+                                                  (data != NULL) ? len : 0);
     g_free(conv);
 }
 
@@ -1032,8 +1033,7 @@ static void clipboard_received_cb(GtkClipboard *clipboard,
      */
     g_warn_if_fail(type != VD_AGENT_CLIPBOARD_UTF8_TEXT);
 
-    spice_main_clipboard_selection_notify(s->main, selection, type,
-                                          data, len);
+    spice_main_channel_clipboard_selection_notify(s->main, selection, type, data, len);
 }
 
 static gboolean clipboard_request(SpiceMainChannel *main, guint selection,
diff --git a/src/spice-widget.c b/src/spice-widget.c
index 22d25c9..5365222 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -256,8 +256,7 @@ static void update_ready(SpiceDisplay *display)
      * application will manage the state of the displays.
      */
     if (d->resize_guest_enable) {
-        spice_main_update_display_enabled(d->main, get_display_id(display),
-                                          ready, TRUE);
+        spice_main_channel_update_display_enabled(d->main, get_display_id(display), ready, TRUE);
     }
 
     if (d->ready == ready)
@@ -514,7 +513,7 @@ static void file_transfer_callback(GObject *source_object,
     SpiceMainChannel *channel = SPICE_MAIN_CHANNEL(source_object);
     GError *error = NULL;
 
-    if (spice_main_file_copy_finish(channel, result, &error))
+    if (spice_main_channel_file_copy_finish(channel, result, &error))
         return;
 
     if (error != NULL && error->message != NULL)
@@ -556,8 +555,8 @@ static void drag_data_received_callback(SpiceDisplay *self,
     }
     g_strfreev(file_urls);
 
-    spice_main_file_copy_async(d->main, files, 0, NULL, NULL,
-                               NULL, file_transfer_callback, NULL);
+    spice_main_channel_file_copy_async(d->main, files, 0, NULL, NULL, NULL, file_transfer_callback,
+                                       NULL);
     for (i = 0; i < n_files; i++) {
         g_object_unref(files[i]);
     }
@@ -1257,8 +1256,8 @@ static void recalc_geometry(GtkWidget *widget)
                   d->ww, d->wh, zoom);
 
     if (d->resize_guest_enable)
-        spice_main_set_display(d->main, get_display_id(display),
-                               d->area.x, d->area.y, d->ww / zoom, d->wh / zoom);
+        spice_main_channel_update_display(d->main, get_display_id(display),
+                                          d->area.x, d->area.y, d->ww / zoom, d->wh / zoom, TRUE);
 }
 
 /* ---------------------------------------------------------------- */
diff --git a/tools/spicy.c b/tools/spicy.c
index 6ff6c9e..088e034 100644
--- a/tools/spicy.c
+++ b/tools/spicy.c
@@ -373,7 +373,7 @@ static void menu_cb_mouse_mode(GtkAction *action, void *data)
     else
         mode = SPICE_MOUSE_MODE_CLIENT;
 
-    spice_main_request_mouse_mode(cmain, mode);
+    spice_main_channel_request_mouse_mode(cmain, mode);
 }
 
 #ifdef USE_USBREDIR
@@ -614,14 +614,17 @@ static void menu_cb_resize_to(GtkAction *action G_GNUC_UNUSED,
 
     gtk_widget_show_all(dialog);
     if (gtk_dialog_run(GTK_DIALOG (dialog)) == GTK_RESPONSE_APPLY) {
-        spice_main_update_display_enabled(win->conn->main, win->id + win->monitor_id, TRUE, FALSE);
-        spice_main_set_display(win->conn->main,
-                               win->id + win->monitor_id,
-                               gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin_x)),
-                               gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin_y)),
-                               gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin_width)),
-                               gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin_height)));
-        spice_main_send_monitor_config(win->conn->main);
+        spice_main_channel_update_display_enabled(win->conn->main, win->id + win->monitor_id, TRUE,
+                                                  FALSE);
+        spice_main_channel_update_display(
+            win->conn->main,
+            win->id + win->monitor_id,
+            gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin_x)),
+            gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin_y)),
+            gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin_width)),
+            gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin_height)),
+            TRUE);
+        spice_main_channel_send_monitor_config(win->conn->main);
     }
     gtk_widget_destroy(dialog);
 }
@@ -1437,10 +1440,10 @@ static void del_window(spice_connection *conn, SpiceWindow *win)
     g_debug("del display monitor %d:%d", win->id, win->monitor_id);
     conn->wins[win->id * CHANNELID_MAX + win->monitor_id] = NULL;
     if (win->id > 0)
-        spice_main_set_display_enabled(conn->main, win->id, FALSE);
+        spice_main_channel_update_display_enabled(conn->main, win->id, FALSE, TRUE);
     else
-        spice_main_set_display_enabled(conn->main, win->monitor_id, FALSE);
-    spice_main_send_monitor_config(conn->main);
+        spice_main_channel_update_display_enabled(conn->main, win->monitor_id, FALSE, TRUE);
+    spice_main_channel_send_monitor_config(conn->main);
 
     destroy_spice_window(win);
 }
commit fa68227ef24a853cc31ee634821ea64ada2c4ef3
Author: Matthew Francis <mjay.francis at gmail.com>
Date:   Tue Sep 19 22:34:00 2017 +0800

    InputsChannel: Fix introspection method bindings
    
    Signed-off-by: Matthew Francis <mjay.francis at gmail.com>
    Reviewed-by: Marc-André Lureau <marcandre.lureau at redhat.com>
    Message-Id: <1505831641-28134-5-git-send-email-mjay.francis at gmail.com>

diff --git a/doc/reference/spice-gtk-sections.txt b/doc/reference/spice-gtk-sections.txt
index 538e07c..0f5ec10 100644
--- a/doc/reference/spice-gtk-sections.txt
+++ b/doc/reference/spice-gtk-sections.txt
@@ -237,13 +237,21 @@ SpiceInputsChannelClass
 SpiceInputsLock
 <SUBSECTION>
 spice_inputs_motion
+spice_inputs_channel_motion
 spice_inputs_position
+spice_inputs_channel_position
 spice_inputs_button_press
+spice_inputs_channel_button_press
 spice_inputs_button_release
+spice_inputs_channel_button_release
 spice_inputs_key_press
+spice_inputs_channel_key_press
 spice_inputs_key_press_and_release
+spice_inputs_channel_key_press_and_release
 spice_inputs_key_release
+spice_inputs_channel_key_release
 spice_inputs_set_key_locks
+spice_inputs_channel_set_key_locks
 <SUBSECTION Standard>
 SPICE_TYPE_INPUTS_LOCK
 spice_inputs_lock_get_type
diff --git a/src/channel-inputs.c b/src/channel-inputs.c
index 7572bff..75bf1ff 100644
--- a/src/channel-inputs.c
+++ b/src/channel-inputs.c
@@ -284,10 +284,29 @@ static void channel_set_handlers(SpiceChannelClass *klass)
  * @button_state: SPICE_MOUSE_BUTTON_MASK flags
  *
  * Change mouse position (used in SPICE_MOUSE_MODE_CLIENT).
+ *
+ * Deprecated: 0.35: use spice_inputs_channel_motion() instead.
  **/
 void spice_inputs_motion(SpiceInputsChannel *channel, gint dx, gint dy,
                          gint button_state)
 {
+    spice_inputs_channel_motion(channel, dx, dy, button_state);
+}
+
+/**
+ * spice_inputs_channel_motion:
+ * @channel: a #SpiceInputsChannel
+ * @dx: delta X mouse coordinates
+ * @dy: delta Y mouse coordinates
+ * @button_state: SPICE_MOUSE_BUTTON_MASK flags
+ *
+ * Change mouse position (used in SPICE_MOUSE_MODE_CLIENT).
+ *
+ * Since: 0.35
+ **/
+void spice_inputs_channel_motion(SpiceInputsChannel *channel, gint dx, gint dy,
+                                 gint button_state)
+{
     SpiceInputsChannelPrivate *c;
 
     g_return_if_fail(channel != NULL);
@@ -317,10 +336,30 @@ void spice_inputs_motion(SpiceInputsChannel *channel, gint dx, gint dy,
  * @button_state: SPICE_MOUSE_BUTTON_MASK flags
  *
  * Change mouse position (used in SPICE_MOUSE_MODE_CLIENT).
+ *
+ * Deprecated: 0.35: use spice_inputs_channel_position() instead.
  **/
 void spice_inputs_position(SpiceInputsChannel *channel, gint x, gint y,
                            gint display, gint button_state)
 {
+    spice_inputs_channel_position(channel, x, y, display, button_state);
+}
+
+/**
+ * spice_inputs_channel_position:
+ * @channel: a #SpiceInputsChannel
+ * @x: X mouse coordinates
+ * @y: Y mouse coordinates
+ * @display: display channel id
+ * @button_state: SPICE_MOUSE_BUTTON_MASK flags
+ *
+ * Change mouse position (used in SPICE_MOUSE_MODE_CLIENT).
+ *
+ * Since: 0.35
+ **/
+void spice_inputs_channel_position(SpiceInputsChannel *channel, gint x, gint y,
+                                   gint display, gint button_state)
+{
     SpiceInputsChannelPrivate *c;
 
     g_return_if_fail(channel != NULL);
@@ -348,10 +387,28 @@ void spice_inputs_position(SpiceInputsChannel *channel, gint x, gint y,
  * @button_state: SPICE_MOUSE_BUTTON_MASK flags
  *
  * Press a mouse button.
+ *
+ * Deprecated: 0.35: use spice_inputs_channel_button_press() instead.
  **/
 void spice_inputs_button_press(SpiceInputsChannel *channel, gint button,
                                gint button_state)
 {
+    spice_inputs_channel_button_press(channel, button, button_state);
+}
+
+/**
+ * spice_inputs_channel_button_press:
+ * @channel: a #SpiceInputsChannel
+ * @button: a SPICE_MOUSE_BUTTON
+ * @button_state: SPICE_MOUSE_BUTTON_MASK flags
+ *
+ * Press a mouse button.
+ *
+ * Since: 0.35
+ **/
+void spice_inputs_channel_button_press(SpiceInputsChannel *channel, gint button,
+                                       gint button_state)
+{
     SpiceInputsChannelPrivate *c;
     SpiceMsgcMousePress press;
     SpiceMsgOut *msg;
@@ -395,10 +452,28 @@ void spice_inputs_button_press(SpiceInputsChannel *channel, gint button,
  * @button_state: SPICE_MOUSE_BUTTON_MASK flags
  *
  * Release a button.
+ *
+ * Deprecated: 0.35: use spice_inputs_channel_button_release() instead.
  **/
 void spice_inputs_button_release(SpiceInputsChannel *channel, gint button,
                                  gint button_state)
 {
+    spice_inputs_channel_button_release(channel, button, button_state);
+}
+
+/**
+ * spice_inputs_channel_button_release:
+ * @channel: a #SpiceInputsChannel
+ * @button: a SPICE_MOUSE_BUTTON
+ * @button_state: SPICE_MOUSE_BUTTON_MASK flags
+ *
+ * Release a button.
+ *
+ * Since: 0.35
+ **/
+void spice_inputs_channel_button_release(SpiceInputsChannel *channel, gint button,
+                                         gint button_state)
+{
     SpiceInputsChannelPrivate *c;
     SpiceMsgcMouseRelease release;
     SpiceMsgOut *msg;
@@ -442,9 +517,26 @@ void spice_inputs_button_release(SpiceInputsChannel *channel, gint button,
  *            prefix, drop the prefix and OR the scancode with %0x100.
  *
  * Press a key.
+ *
+ * Deprecated: 0.35: use spice_inputs_channel_key_press() instead.
  **/
 void spice_inputs_key_press(SpiceInputsChannel *channel, guint scancode)
 {
+    spice_inputs_channel_key_press(channel, scancode);
+}
+
+/**
+ * spice_inputs_channel_key_press:
+ * @channel: a #SpiceInputsChannel
+ * @scancode: a PC XT (set 1) key scancode.  For scancodes with an %0xe0
+ *            prefix, drop the prefix and OR the scancode with %0x100.
+ *
+ * Press a key.
+ *
+ * Since: 0.35
+ **/
+void spice_inputs_channel_key_press(SpiceInputsChannel *channel, guint scancode)
+{
     SpiceMsgcKeyDown down;
     SpiceMsgOut *msg;
 
@@ -468,9 +560,26 @@ void spice_inputs_key_press(SpiceInputsChannel *channel, guint scancode)
  *            prefix, drop the prefix and OR the scancode with %0x100.
  *
  * Release a key.
+ *
+ * Deprecated: 0.35: use spice_inputs_channel_key_release() instead.
  **/
 void spice_inputs_key_release(SpiceInputsChannel *channel, guint scancode)
 {
+    spice_inputs_channel_key_release(channel, scancode);
+}
+
+/**
+ * spice_inputs_channel_key_release:
+ * @channel: a #SpiceInputsChannel
+ * @scancode: a PC XT (set 1) key scancode.  For scancodes with an %0xe0
+ *            prefix, drop the prefix and OR the scancode with %0x100.
+ *
+ * Release a key.
+ *
+ * Since: 0.35
+ **/
+void spice_inputs_channel_key_release(SpiceInputsChannel *channel, guint scancode)
+{
     SpiceMsgcKeyUp up;
     SpiceMsgOut *msg;
 
@@ -496,9 +605,26 @@ void spice_inputs_key_release(SpiceInputsChannel *channel, guint scancode)
  * Press and release a key event atomically (in the same message).
  *
  * Since: 0.13
+ *
+ * Deprecated: 0.35
  **/
 void spice_inputs_key_press_and_release(SpiceInputsChannel *input_channel, guint scancode)
 {
+    spice_inputs_channel_key_press_and_release(input_channel, scancode);
+}
+
+/**
+ * spice_inputs_channel_key_press_and_release:
+ * @channel: a #SpiceInputsChannel
+ * @scancode: a PC XT (set 1) key scancode.  For scancodes with an %0xe0
+ *            prefix, drop the prefix and OR the scancode with %0x100.
+ *
+ * Press and release a key event atomically (in the same message).
+ *
+ * Since: 0.35
+ **/
+void spice_inputs_channel_key_press_and_release(SpiceInputsChannel *input_channel, guint scancode)
+{
     SpiceChannel *channel = SPICE_CHANNEL(input_channel);
 
     g_return_if_fail(channel != NULL);
@@ -531,8 +657,8 @@ void spice_inputs_key_press_and_release(SpiceInputsChannel *input_channel, guint
         spice_msg_out_send(msg);
     } else {
         CHANNEL_DEBUG(channel, "The server doesn't support atomic press and release");
-        spice_inputs_key_press(input_channel, scancode);
-        spice_inputs_key_release(input_channel, scancode);
+        spice_inputs_channel_key_press(input_channel, scancode);
+        spice_inputs_channel_key_release(input_channel, scancode);
     }
 }
 
@@ -566,9 +692,25 @@ static SpiceMsgOut* set_key_locks(SpiceInputsChannel *channel, guint locks)
  * @locks: #SpiceInputsLock modifiers flags
  *
  * Set the keyboard locks on the guest (Caps, Num, Scroll..)
+ *
+ * Deprecated: 0.35: use spice_inputs_channel_set_key_locks() instead.
  **/
 void spice_inputs_set_key_locks(SpiceInputsChannel *channel, guint locks)
 {
+    spice_inputs_channel_set_key_locks(channel, locks);
+}
+
+/**
+ * spice_inputs_channel_set_key_locks:
+ * @channel: a #SpiceInputsChannel
+ * @locks: #SpiceInputsLock modifiers flags
+ *
+ * Set the keyboard locks on the guest (Caps, Num, Scroll..)
+ *
+ * Since: 0.35
+ **/
+void spice_inputs_channel_set_key_locks(SpiceInputsChannel *channel, guint locks)
+{
     SpiceMsgOut *msg;
 
     if (spice_channel_get_read_only(SPICE_CHANNEL(channel)))
diff --git a/src/channel-inputs.h b/src/channel-inputs.h
index 5123c47..fa78235 100644
--- a/src/channel-inputs.h
+++ b/src/channel-inputs.h
@@ -83,18 +83,36 @@ struct _SpiceInputsChannelClass {
 
 GType spice_inputs_channel_get_type(void);
 
-void spice_inputs_motion(SpiceInputsChannel *channel, gint dx, gint dy,
-                         gint button_state);
-void spice_inputs_position(SpiceInputsChannel *channel, gint x, gint y,
-                           gint display, gint button_state);
-void spice_inputs_button_press(SpiceInputsChannel *channel, gint button,
-                               gint button_state);
-void spice_inputs_button_release(SpiceInputsChannel *channel, gint button,
-                                 gint button_state);
+void spice_inputs_channel_motion(SpiceInputsChannel *channel, gint dx, gint dy, gint button_state);
+void spice_inputs_channel_position(SpiceInputsChannel *channel, gint x, gint y, gint display,
+                                   gint button_state);
+void spice_inputs_channel_button_press(SpiceInputsChannel *channel, gint button, gint button_state);
+void spice_inputs_channel_button_release(SpiceInputsChannel *channel, gint button,
+                                         gint button_state);
+void spice_inputs_channel_key_press(SpiceInputsChannel *channel, guint scancode);
+void spice_inputs_channel_key_release(SpiceInputsChannel *channel, guint scancode);
+void spice_inputs_channel_set_key_locks(SpiceInputsChannel *channel, guint locks);
+void spice_inputs_channel_key_press_and_release(SpiceInputsChannel *channel, guint scancode);
+
+#ifndef SPICE_DISABLE_DEPRECATED
+G_DEPRECATED_FOR(spice_inputs_channel_motion)
+void spice_inputs_motion(SpiceInputsChannel *channel, gint dx, gint dy, gint button_state);
+G_DEPRECATED_FOR(spice_inputs_channel_position)
+void spice_inputs_position(SpiceInputsChannel *channel, gint x, gint y, gint display,
+                           gint button_state);
+G_DEPRECATED_FOR(spice_inputs_channel_button_press)
+void spice_inputs_button_press(SpiceInputsChannel *channel, gint button, gint button_state);
+G_DEPRECATED_FOR(spice_inputs_channel_button_release)
+void spice_inputs_button_release(SpiceInputsChannel *channel, gint button, gint button_state);
+G_DEPRECATED_FOR(spice_inputs_channel_key_press)
 void spice_inputs_key_press(SpiceInputsChannel *channel, guint scancode);
+G_DEPRECATED_FOR(spice_inputs_channel_key_release)
 void spice_inputs_key_release(SpiceInputsChannel *channel, guint scancode);
+G_DEPRECATED_FOR(spice_inputs_channel_set_key_locks)
 void spice_inputs_set_key_locks(SpiceInputsChannel *channel, guint locks);
+G_DEPRECATED_FOR(spice_inputs_channel_key_press_and_release)
 void spice_inputs_key_press_and_release(SpiceInputsChannel *channel, guint scancode);
+#endif
 
 G_END_DECLS
 
diff --git a/src/map-file b/src/map-file
index 23bcaa5..14e8ac6 100644
--- a/src/map-file
+++ b/src/map-file
@@ -63,7 +63,15 @@ spice_gtk_session_get_type;
 spice_gtk_session_paste_from_guest;
 spice_inputs_button_press;
 spice_inputs_button_release;
+spice_inputs_channel_button_press;
+spice_inputs_channel_button_release;
 spice_inputs_channel_get_type;
+spice_inputs_channel_key_press;
+spice_inputs_channel_key_press_and_release;
+spice_inputs_channel_key_release;
+spice_inputs_channel_motion;
+spice_inputs_channel_position;
+spice_inputs_channel_set_key_locks;
 spice_inputs_key_press;
 spice_inputs_key_press_and_release;
 spice_inputs_key_release;
diff --git a/src/spice-glib-sym-file b/src/spice-glib-sym-file
index 10cc245..38e87e0 100644
--- a/src/spice-glib-sym-file
+++ b/src/spice-glib-sym-file
@@ -42,7 +42,15 @@ spice_gl_scanout_get_type
 spice_g_signal_connect_object
 spice_inputs_button_press
 spice_inputs_button_release
+spice_inputs_channel_button_press
+spice_inputs_channel_button_release
 spice_inputs_channel_get_type
+spice_inputs_channel_key_press
+spice_inputs_channel_key_press_and_release
+spice_inputs_channel_key_release
+spice_inputs_channel_motion
+spice_inputs_channel_position
+spice_inputs_channel_set_key_locks
 spice_inputs_key_press
 spice_inputs_key_press_and_release
 spice_inputs_key_release
diff --git a/src/spice-gtk-session.c b/src/spice-gtk-session.c
index e338ce6..6a53bf5 100644
--- a/src/spice-gtk-session.c
+++ b/src/spice-gtk-session.c
@@ -201,7 +201,7 @@ static void spice_gtk_session_sync_keyboard_modifiers_for_channel(SpiceGtkSessio
     if (force || client_modifiers != guest_modifiers) {
         CHANNEL_DEBUG(inputs, "client_modifiers:0x%x, guest_modifiers:0x%x",
                       client_modifiers, guest_modifiers);
-        spice_inputs_set_key_locks(inputs, client_modifiers);
+        spice_inputs_channel_set_key_locks(inputs, client_modifiers);
     }
 }
 
diff --git a/src/spice-widget.c b/src/spice-widget.c
index 714ca88..22d25c9 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -1381,7 +1381,7 @@ static void key_press_and_release(SpiceDisplay *display)
     if (d->key_delayed_scancode == 0)
         return;
 
-    spice_inputs_key_press_and_release(d->inputs, d->key_delayed_scancode);
+    spice_inputs_channel_key_press_and_release(d->inputs, d->key_delayed_scancode);
     d->key_delayed_scancode = 0;
 
     if (d->key_delayed_id) {
@@ -1398,7 +1398,7 @@ static gboolean key_press_delayed(gpointer data)
     if (d->key_delayed_scancode == 0)
         return FALSE;
 
-    spice_inputs_key_press(d->inputs, d->key_delayed_scancode);
+    spice_inputs_channel_key_press(d->inputs, d->key_delayed_scancode);
     d->key_delayed_scancode = 0;
 
     if (d->key_delayed_id) {
@@ -1419,11 +1419,11 @@ static bool send_pause(SpiceDisplay *display, GdkEventType type)
      * 0x45 is the NumLock.
      */
     if (type == GDK_KEY_PRESS) {
-        spice_inputs_key_press(inputs, 0x21d);
-        spice_inputs_key_press(inputs, 0x45);
+        spice_inputs_channel_key_press(inputs, 0x21d);
+        spice_inputs_channel_key_press(inputs, 0x45);
     } else {
-        spice_inputs_key_release(inputs, 0x21d);
-        spice_inputs_key_release(inputs, 0x45);
+        spice_inputs_channel_key_release(inputs, 0x21d);
+        spice_inputs_channel_key_release(inputs, 0x45);
     }
     return true;
 }
@@ -1458,7 +1458,7 @@ static void send_key(SpiceDisplay *display, int scancode, SendKeyType type, gboo
             d->key_delayed_id = g_timeout_add(d->keypress_delay, key_press_delayed, display);
             d->key_delayed_scancode = scancode;
         } else
-            spice_inputs_key_press(d->inputs, scancode);
+            spice_inputs_channel_key_press(d->inputs, scancode);
 
         d->key_state[i] |= m;
         break;
@@ -1472,7 +1472,7 @@ static void send_key(SpiceDisplay *display, int scancode, SendKeyType type, gboo
         else {
             /* ensure delayed key is pressed before other key are released */
             key_press_delayed(display);
-            spice_inputs_key_release(d->inputs, scancode);
+            spice_inputs_channel_key_release(d->inputs, scancode);
         }
 
         d->key_state[i] &= ~m;
@@ -1989,8 +1989,8 @@ static gboolean motion_event(GtkWidget *widget, GdkEventMotion *motion)
     case SPICE_MOUSE_MODE_CLIENT:
         if (x >= 0 && x < d->area.width &&
             y >= 0 && y < d->area.height) {
-            spice_inputs_position(d->inputs, x, y, get_display_id(display),
-                                  button_mask_gdk_to_spice(motion->state));
+            spice_inputs_channel_position(d->inputs, x, y, get_display_id(display),
+                                          button_mask_gdk_to_spice(motion->state));
         }
         break;
     case SPICE_MOUSE_MODE_SERVER:
@@ -1998,8 +1998,8 @@ static gboolean motion_event(GtkWidget *widget, GdkEventMotion *motion)
             gint dx = d->mouse_last_x != -1 ? x - d->mouse_last_x : 0;
             gint dy = d->mouse_last_y != -1 ? y - d->mouse_last_y : 0;
 
-            spice_inputs_motion(d->inputs, dx, dy,
-                                button_mask_gdk_to_spice(motion->state));
+            spice_inputs_channel_motion(d->inputs, dx, dy,
+                                        button_mask_gdk_to_spice(motion->state));
 
             d->mouse_last_x = x;
             d->mouse_last_y = y;
@@ -2036,10 +2036,10 @@ static gboolean scroll_event(GtkWidget *widget, GdkEventScroll *scroll)
         return true;
     }
 
-    spice_inputs_button_press(d->inputs, button,
-                              button_mask_gdk_to_spice(scroll->state));
-    spice_inputs_button_release(d->inputs, button,
-                                button_mask_gdk_to_spice(scroll->state));
+    spice_inputs_channel_button_press(d->inputs, button,
+                                      button_mask_gdk_to_spice(scroll->state));
+    spice_inputs_channel_button_release(d->inputs, button,
+                                        button_mask_gdk_to_spice(scroll->state));
     return true;
 }
 
@@ -2091,14 +2091,14 @@ static gboolean button_event(GtkWidget *widget, GdkEventButton *button)
 
     switch (button->type) {
     case GDK_BUTTON_PRESS:
-        spice_inputs_button_press(d->inputs,
-                                  button_gdk_to_spice(button->button),
-                                  button_mask_gdk_to_spice(button->state));
+        spice_inputs_channel_button_press(d->inputs,
+                                          button_gdk_to_spice(button->button),
+                                          button_mask_gdk_to_spice(button->state));
         break;
     case GDK_BUTTON_RELEASE:
-        spice_inputs_button_release(d->inputs,
-                                    button_gdk_to_spice(button->button),
-                                    button_mask_gdk_to_spice(button->state));
+        spice_inputs_channel_button_release(d->inputs,
+                                            button_gdk_to_spice(button->button),
+                                            button_mask_gdk_to_spice(button->state));
         break;
     default:
         break;
commit 30cf15edca2c55a185c9bffb8c3c6f14a19f1516
Author: Matthew Francis <mjay.francis at gmail.com>
Date:   Tue Sep 19 22:33:59 2017 +0800

    RecordChannel: Fix introspection method bindings
    
    Signed-off-by: Matthew Francis <mjay.francis at gmail.com>
    Reviewed-by: Marc-André Lureau <marcandre.lureau at redhat.com>
    Message-Id: <1505831641-28134-4-git-send-email-mjay.francis at gmail.com>

diff --git a/doc/reference/spice-gtk-sections.txt b/doc/reference/spice-gtk-sections.txt
index ffaf00e..538e07c 100644
--- a/doc/reference/spice-gtk-sections.txt
+++ b/doc/reference/spice-gtk-sections.txt
@@ -216,6 +216,7 @@ SpiceRecordChannel
 SpiceRecordChannelClass
 <SUBSECTION>
 spice_record_send_data
+spice_record_channel_send_data
 <SUBSECTION Standard>
 SPICE_RECORD_CHANNEL
 SPICE_IS_RECORD_CHANNEL
diff --git a/src/channel-record.c b/src/channel-record.c
index 9834e85..88bdb5c 100644
--- a/src/channel-record.c
+++ b/src/channel-record.c
@@ -312,10 +312,29 @@ static void spice_record_start_mark(SpiceRecordChannel *channel, uint32_t time)
  * @time: stream timestamp
  *
  * Send recorded PCM data to the guest.
+ *
+ * Deprecated: 0.35: use spice_record_channel_send_data() instead.
  **/
 void spice_record_send_data(SpiceRecordChannel *channel, gpointer data,
                             gsize bytes, uint32_t time)
 {
+    spice_record_channel_send_data(channel, data, bytes, time);
+}
+
+/**
+ * spice_record_channel_send_data:
+ * @channel: a #SpiceRecordChannel
+ * @data: PCM data
+ * @bytes: size of @data
+ * @time: stream timestamp
+ *
+ * Send recorded PCM data to the guest.
+ *
+ * Since: 0.35
+ **/
+void spice_record_channel_send_data(SpiceRecordChannel *channel, gpointer data,
+                                    gsize bytes, uint32_t time)
+{
     SpiceRecordChannelPrivate *rc;
     SpiceMsgcRecordPacket p = {0, };
 
diff --git a/src/channel-record.h b/src/channel-record.h
index c851421..5702f40 100644
--- a/src/channel-record.h
+++ b/src/channel-record.h
@@ -73,8 +73,14 @@ struct _SpiceRecordChannelClass {
 };
 
 GType	        spice_record_channel_get_type(void);
+void            spice_record_channel_send_data(SpiceRecordChannel *channel, gpointer data,
+                                               gsize bytes, guint32 time);
+
+#ifndef SPICE_DISABLE_DEPRECATED
+G_DEPRECATED_FOR(spice_record_channel_send_data)
 void            spice_record_send_data(SpiceRecordChannel *channel, gpointer data,
                                        gsize bytes, guint32 time);
+#endif
 
 G_END_DECLS
 
diff --git a/src/map-file b/src/map-file
index 8635e92..23bcaa5 100644
--- a/src/map-file
+++ b/src/map-file
@@ -99,6 +99,7 @@ spice_port_event;
 spice_port_write_async;
 spice_port_write_finish;
 spice_record_channel_get_type;
+spice_record_channel_send_data;
 spice_record_send_data;
 spice_session_connect;
 spice_session_disconnect;
diff --git a/src/spice-glib-sym-file b/src/spice-glib-sym-file
index d996dbf..10cc245 100644
--- a/src/spice-glib-sym-file
+++ b/src/spice-glib-sym-file
@@ -78,6 +78,7 @@ spice_port_event
 spice_port_write_async
 spice_port_write_finish
 spice_record_channel_get_type
+spice_record_channel_send_data
 spice_record_send_data
 spice_session_connect
 spice_session_disconnect
diff --git a/src/spice-gstaudio.c b/src/spice-gstaudio.c
index 715f824..97546b6 100644
--- a/src/spice-gstaudio.c
+++ b/src/spice-gstaudio.c
@@ -175,7 +175,7 @@ static gboolean record_bus_cb(GstBus *bus, GstMessage *msg, gpointer data)
             return TRUE;
         }
 
-        spice_record_send_data(SPICE_RECORD_CHANNEL(p->rchannel),
+        spice_record_channel_send_data(SPICE_RECORD_CHANNEL(p->rchannel),
                                /* FIXME: server side doesn't care about ts?
                                   what is the unit? ms apparently */
                                mapping.data, mapping.size, 0);
diff --git a/src/spice-pulse.c b/src/spice-pulse.c
index 9868251..dcfa71f 100644
--- a/src/spice-pulse.c
+++ b/src/spice-pulse.c
@@ -503,10 +503,10 @@ static void stream_read_callback(pa_stream *s, size_t length, void *data)
         g_return_if_fail(length > 0);
 
         if (p->rchannel != NULL)
-            spice_record_send_data(SPICE_RECORD_CHANNEL(p->rchannel),
-                                   /* FIXME: server side doesn't care about ts?
-                                      what is the unit? ms apparently */
-                                   (gpointer)snddata, length, 0);
+            spice_record_channel_send_data(SPICE_RECORD_CHANNEL(p->rchannel),
+                                           /* FIXME: server side doesn't care about ts?
+                                           what is the unit? ms apparently */
+                                           (gpointer)snddata, length, 0);
 
         if (pa_stream_drop(s) < 0) {
             g_warning("pa_stream_drop() failed: %s",
commit d593569f21186ba115ebfc3207c87ba6b5e831c7
Author: Matthew Francis <mjay.francis at gmail.com>
Date:   Tue Sep 19 22:33:58 2017 +0800

    DisplayChannel: Fix introspection method bindings
    
    Signed-off-by: Matthew Francis <mjay.francis at gmail.com>
    Reviewed-by: Marc-André Lureau <marcandre.lureau at redhat.com>
    Message-Id: <1505831641-28134-3-git-send-email-mjay.francis at gmail.com>

diff --git a/doc/reference/spice-gtk-sections.txt b/doc/reference/spice-gtk-sections.txt
index c4f416f..ffaf00e 100644
--- a/doc/reference/spice-gtk-sections.txt
+++ b/doc/reference/spice-gtk-sections.txt
@@ -165,10 +165,15 @@ SpiceDisplayPrimary
 SpiceGlScanout
 <SUBSECTION>
 spice_display_get_gl_scanout
+spice_display_channel_get_gl_scanout
 spice_display_gl_draw_done
+spice_display_channel_gl_draw_done
 spice_display_get_primary
+spice_display_channel_get_primary
 spice_display_change_preferred_compression
+spice_display_channel_change_preferred_compression
 spice_display_change_preferred_video_codec_type
+spice_display_channel_change_preferred_video_codec_type
 spice_gl_scanout_free
 <SUBSECTION Standard>
 SPICE_DISPLAY_CHANNEL
diff --git a/src/channel-display.c b/src/channel-display.c
index 4c570ea..75d2e32 100644
--- a/src/channel-display.c
+++ b/src/channel-display.c
@@ -227,7 +227,7 @@ static void spice_display_get_property(GObject    *object,
         break;
     }
     case PROP_GL_SCANOUT: {
-        g_value_set_static_boxed(value, spice_display_get_gl_scanout(channel));
+        g_value_set_static_boxed(value, spice_display_channel_get_gl_scanout(channel));
         break;
     }
     default:
@@ -472,10 +472,31 @@ static void spice_display_channel_class_init(SpiceDisplayChannelClass *klass)
  *
  * Returns: %TRUE if the primary surface was found and its details
  * collected in @primary.
+ *
+ * Deprecated: 0.35: use spice_display_channel_get_primary() instead.
  */
 gboolean spice_display_get_primary(SpiceChannel *channel, guint32 surface_id,
                                    SpiceDisplayPrimary *primary)
 {
+    return spice_display_channel_get_primary(channel, surface_id, primary);
+}
+
+/**
+ * spice_display_channel_get_primary:
+ * @channel: a #SpiceDisplayChannel
+ * @surface_id: a surface id
+ * @primary: a #SpiceDisplayPrimary
+ *
+ * Retrieve primary display surface @surface_id.
+ *
+ * Returns: %TRUE if the primary surface was found and its details
+ * collected in @primary.
+ *
+ * Since: 0.35
+ */
+gboolean spice_display_channel_get_primary(SpiceChannel *channel, guint32 surface_id,
+                                           SpiceDisplayPrimary *primary)
+{
     g_return_val_if_fail(SPICE_IS_DISPLAY_CHANNEL(channel), FALSE);
     g_return_val_if_fail(primary != NULL, FALSE);
 
@@ -508,9 +529,25 @@ gboolean spice_display_get_primary(SpiceChannel *channel, guint32 surface_id,
  * for the @channel.
  *
  * Since: 0.31
+ * Deprecated: 0.35: use spice_display_channel_change_preferred_compression() instead.
  */
 void spice_display_change_preferred_compression(SpiceChannel *channel, gint compression)
 {
+    spice_display_channel_change_preferred_compression(channel, compression);
+}
+
+/**
+ * spice_display_channel_change_preferred_compression:
+ * @channel: a #SpiceDisplayChannel
+ * @compression: a #SpiceImageCompression
+ *
+ * Tells the spice server to change the preferred image compression
+ * for the @channel.
+ *
+ * Since: 0.35
+ */
+void spice_display_channel_change_preferred_compression(SpiceChannel *channel, gint compression)
+{
     SpiceMsgOut *out;
     SpiceMsgcDisplayPreferredCompression pref_comp_msg;
 
@@ -561,9 +598,26 @@ static void spice_display_send_client_preferred_video_codecs(SpiceChannel *chann
  * display channel.
  *
  * Since: 0.34
+ * Deprecated: 0.35: use spice_display_channel_change_preferred_video_codec_type() instead.
  */
 void spice_display_change_preferred_video_codec_type(SpiceChannel *channel, gint codec_type)
 {
+    spice_display_channel_change_preferred_video_codec_type(channel, codec_type);
+}
+
+/**
+ * spice_display_channel_change_preferred_video_codec_type:
+ * @channel: a #SpiceDisplayChannel
+ * @codec_type: a #SpiceVideoCodecType
+ *
+ * Tells the spice server to change the preferred video codec type for
+ * streaming in @channel. Application can set only one preferred video codec per
+ * display channel.
+ *
+ * Since: 0.35
+ */
+void spice_display_channel_change_preferred_video_codec_type(SpiceChannel *channel, gint codec_type)
+{
     GArray *codecs;
 
     g_return_if_fail(SPICE_IS_DISPLAY_CHANNEL(channel));
@@ -595,10 +649,27 @@ void spice_display_change_preferred_video_codec_type(SpiceChannel *channel, gint
  * Returns: the current GL scanout, or %NULL if none or not valid
  *
  * Since: 0.31
+ * Deprecated: 0.35: use spice_display_channel_get_gl_scanout() instead.
  **/
 const SpiceGlScanout *
 spice_display_get_gl_scanout(SpiceDisplayChannel *channel)
 {
+    return spice_display_channel_get_gl_scanout(channel);
+}
+
+/**
+ * spice_display_channel_get_gl_scanout:
+ * @channel: a #SpiceDisplayChannel
+ *
+ * Retrieves the GL scanout if available
+ *
+ * Returns: the current GL scanout, or %NULL if none or not valid
+ *
+ * Since: 0.35
+ **/
+const SpiceGlScanout *
+spice_display_channel_get_gl_scanout(SpiceDisplayChannel *channel)
+{
     g_return_val_if_fail(SPICE_IS_DISPLAY_CHANNEL(channel), NULL);
 
     return channel->priv->scanout.fd != -1 ? &channel->priv->scanout : NULL;
@@ -978,7 +1049,7 @@ static void spice_display_channel_up(SpiceChannel *channel)
     g_coroutine_object_notify(G_OBJECT(channel), "monitors");
 
     if (preferred_compression != SPICE_IMAGE_COMPRESSION_INVALID) {
-        spice_display_change_preferred_compression(channel, preferred_compression);
+        spice_display_channel_change_preferred_compression(channel, preferred_compression);
     }
 }
 
@@ -1896,9 +1967,26 @@ static void display_handle_gl_draw(SpiceChannel *channel, SpiceMsgIn *in)
  * (failing to do so for each gl-draw may result in a frozen display).
  *
  * Since: 0.31
+ * Deprecated: 0.35: use spice_display_channel_gl_draw_done() instead.
  **/
 void spice_display_gl_draw_done(SpiceDisplayChannel *display)
 {
+    spice_display_channel_gl_draw_done(display);
+}
+
+/**
+ * spice_display_channel_gl_draw_done:
+ * @channel: a #SpiceDisplayChannel
+ *
+ * After a SpiceDisplayChannel::gl-draw is emitted, the client should
+ * draw the current display with the current GL scanout, and must
+ * release the GL resource with a call to spice_display_gl_draw_done()
+ * (failing to do so for each gl-draw may result in a frozen display).
+ *
+ * Since: 0.35
+ **/
+void spice_display_channel_gl_draw_done(SpiceDisplayChannel *display)
+{
     SpiceChannel *channel;
     SpiceMsgOut *out;
 
diff --git a/src/channel-display.h b/src/channel-display.h
index fccf228..5b48d2f 100644
--- a/src/channel-display.h
+++ b/src/channel-display.h
@@ -145,17 +145,31 @@ struct _SpiceDisplayChannelClass {
 };
 
 GType	        spice_display_channel_get_type(void);
-gboolean        spice_display_get_primary(SpiceChannel *channel, guint32 surface_id,
-                                          SpiceDisplayPrimary *primary);
+gboolean        spice_display_channel_get_primary(SpiceChannel *channel, guint32 surface_id,
+                                                  SpiceDisplayPrimary *primary);
 
-void spice_display_change_preferred_compression(SpiceChannel *channel, gint compression);
-void spice_display_change_preferred_video_codec_type(SpiceChannel *channel, gint codec_type);
+void spice_display_channel_change_preferred_compression(SpiceChannel *channel, gint compression);
+void spice_display_channel_change_preferred_video_codec_type(SpiceChannel *channel, gint codec_type);
 
 GType           spice_gl_scanout_get_type     (void) G_GNUC_CONST;
 void            spice_gl_scanout_free         (SpiceGlScanout *scanout);
 
+const SpiceGlScanout* spice_display_channel_get_gl_scanout(SpiceDisplayChannel *channel);
+void spice_display_channel_gl_draw_done(SpiceDisplayChannel *channel);
+
+#ifndef SPICE_DISABLE_DEPRECATED
+G_DEPRECATED_FOR(spice_display_channel_change_preferred_compression)
+void spice_display_change_preferred_compression(SpiceChannel *channel, gint compression);
+G_DEPRECATED_FOR(spice_display_channel_change_preferred_video_codec_type)
+void spice_display_change_preferred_video_codec_type(SpiceChannel *channel, gint codec_type);
+G_DEPRECATED_FOR(spice_display_channel_get_gl_scanout)
 const SpiceGlScanout* spice_display_get_gl_scanout(SpiceDisplayChannel *channel);
+G_DEPRECATED_FOR(spice_display_channel_get_primary)
+gboolean spice_display_get_primary(SpiceChannel *channel, guint32 surface_id,
+                                   SpiceDisplayPrimary *primary);
+G_DEPRECATED_FOR(spice_display_channel_gl_draw_done)
 void spice_display_gl_draw_done(SpiceDisplayChannel *channel);
+#endif
 
 G_END_DECLS
 
diff --git a/src/map-file b/src/map-file
index de4f421..8635e92 100644
--- a/src/map-file
+++ b/src/map-file
@@ -23,7 +23,12 @@ spice_cursor_channel_get_type;
 spice_cursor_shape_get_type;
 spice_display_change_preferred_compression;
 spice_display_change_preferred_video_codec_type;
+spice_display_channel_change_preferred_compression;
+spice_display_channel_change_preferred_video_codec_type;
+spice_display_channel_get_gl_scanout;
+spice_display_channel_get_primary;
 spice_display_channel_get_type;
+spice_display_channel_gl_draw_done;
 spice_display_get_gl_scanout;
 spice_display_get_grab_keys;
 spice_display_get_pixbuf;
diff --git a/src/spice-glib-sym-file b/src/spice-glib-sym-file
index 79c75f1..d996dbf 100644
--- a/src/spice-glib-sym-file
+++ b/src/spice-glib-sym-file
@@ -21,7 +21,12 @@ spice_cursor_channel_get_type
 spice_cursor_shape_get_type
 spice_display_change_preferred_compression
 spice_display_change_preferred_video_codec_type
+spice_display_channel_change_preferred_compression
+spice_display_channel_change_preferred_video_codec_type
+spice_display_channel_get_gl_scanout
+spice_display_channel_get_primary
 spice_display_channel_get_type
+spice_display_channel_gl_draw_done
 spice_display_get_gl_scanout
 spice_display_get_primary
 spice_display_gl_draw_done
diff --git a/src/spice-widget-egl.c b/src/spice-widget-egl.c
index b50641c..1e71753 100644
--- a/src/spice-widget-egl.c
+++ b/src/spice-widget-egl.c
@@ -278,7 +278,7 @@ end:
 
     d->egl.context_ready = TRUE;
 
-    if (spice_display_get_gl_scanout(d->display) != NULL) {
+    if (spice_display_channel_get_gl_scanout(d->display) != NULL) {
         DISPLAY_DEBUG(display, "scanout present during egl init, updating widget");
         spice_display_widget_gl_scanout(display);
         spice_display_widget_update_monitor_area(display);
diff --git a/src/spice-widget.c b/src/spice-widget.c
index fb94e94..714ca88 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -587,7 +587,7 @@ gl_area_render(GtkGLArea *area, GdkGLContext *context, gpointer user_data)
     spice_egl_update_display(display);
     glFlush();
     if (d->egl.call_draw_done) {
-        spice_display_gl_draw_done(d->display);
+        spice_display_channel_gl_draw_done(d->display);
         d->egl.call_draw_done = FALSE;
     }
 
@@ -620,7 +620,7 @@ drawing_area_realize(GtkWidget *area, gpointer user_data)
     SpiceDisplay *display = SPICE_DISPLAY(user_data);
 
     if (GDK_IS_X11_DISPLAY(gdk_display_get_default()) &&
-        spice_display_get_gl_scanout(display->priv->display) != NULL) {
+        spice_display_channel_get_gl_scanout(display->priv->display) != NULL) {
         spice_display_widget_gl_scanout(display);
     }
 #endif
@@ -2523,7 +2523,7 @@ static void update_area(SpiceDisplay *display,
 #if HAVE_EGL
     if (egl_enabled(d)) {
         const SpiceGlScanout *so =
-            spice_display_get_gl_scanout(d->display);
+            spice_display_channel_get_gl_scanout(d->display);
         g_return_if_fail(so != NULL);
         primary = (GdkRectangle) {
             .width = so->width,
@@ -2891,7 +2891,7 @@ void spice_display_widget_gl_scanout(SpiceDisplay *display)
     if (d->egl.context_ready) {
         const SpiceGlScanout *scanout;
 
-        scanout = spice_display_get_gl_scanout(d->display);
+        scanout = spice_display_channel_get_gl_scanout(d->display);
         /* should only be called when the display has a scanout */
         g_return_if_fail(scanout != NULL);
 
@@ -2913,7 +2913,7 @@ static void gl_draw(SpiceDisplay *display,
 
     if (!d->egl.context_ready) {
         DISPLAY_DEBUG(display, "Draw without GL context, skipping");
-        spice_display_gl_draw_done(d->display);
+        spice_display_channel_gl_draw_done(d->display);
         return;
     }
 
@@ -2930,7 +2930,7 @@ static void gl_draw(SpiceDisplay *display,
 #endif
     {
         spice_egl_update_display(display);
-        spice_display_gl_draw_done(d->display);
+        spice_display_channel_gl_draw_done(d->display);
     }
 }
 #endif
@@ -2966,7 +2966,7 @@ static void channel_new(SpiceSession *s, SpiceChannel *channel, gpointer data)
         spice_g_signal_connect_object(channel, "notify::monitors",
                                       G_CALLBACK(spice_display_widget_update_monitor_area),
                                       display, G_CONNECT_AFTER | G_CONNECT_SWAPPED);
-        if (spice_display_get_primary(channel, 0, &primary)) {
+        if (spice_display_channel_get_primary(channel, 0, &primary)) {
             primary_create(channel, primary.format, primary.width, primary.height,
                            primary.stride, primary.shmid, primary.data, display);
             mark(display, primary.marked);
diff --git a/tools/spicy.c b/tools/spicy.c
index d71d996..6ff6c9e 100644
--- a/tools/spicy.c
+++ b/tools/spicy.c
@@ -1009,16 +1009,16 @@ static void compression_cb(GtkRadioAction *action G_GNUC_UNUSED,
                            GtkRadioAction *current,
                            gpointer user_data)
 {
-    spice_display_change_preferred_compression(SPICE_CHANNEL(user_data),
-                                               gtk_radio_action_get_current_value(current));
+    spice_display_channel_change_preferred_compression(SPICE_CHANNEL(user_data),
+                                                       gtk_radio_action_get_current_value(current));
 }
 
 static void video_codec_type_cb(GtkRadioAction *action G_GNUC_UNUSED,
                                 GtkRadioAction *current,
                                 gpointer user_data)
 {
-    spice_display_change_preferred_video_codec_type(SPICE_CHANNEL(user_data),
-                                                    gtk_radio_action_get_current_value(current));
+    spice_display_channel_change_preferred_video_codec_type(SPICE_CHANNEL(user_data),
+                                                            gtk_radio_action_get_current_value(current));
 }
 
 static void
commit 00c4ab5eb67b46804b8decba3404e16e340454cc
Author: Matthew Francis <mjay.francis at gmail.com>
Date:   Tue Sep 19 22:33:57 2017 +0800

    PortChannel: Fix introspection method bindings
    
    Signed-off-by: Matthew Francis <mjay.francis at gmail.com>
    Reviewed-by: Marc-André Lureau <marcandre.lureau at redhat.com>
    Message-Id: <1505831641-28134-2-git-send-email-mjay.francis at gmail.com>

diff --git a/doc/reference/spice-gtk-sections.txt b/doc/reference/spice-gtk-sections.txt
index d5538d8..c4f416f 100644
--- a/doc/reference/spice-gtk-sections.txt
+++ b/doc/reference/spice-gtk-sections.txt
@@ -452,8 +452,11 @@ SpicePortChannel
 SpicePortChannelClass
 <SUBSECTION>
 spice_port_event
+spice_port_channel_event
 spice_port_write_async
+spice_port_channel_write_async
 spice_port_write_finish
+spice_port_channel_write_finish
 <SUBSECTION Standard>
 SPICE_PORT_CHANNEL
 SPICE_IS_PORT_CHANNEL
diff --git a/src/channel-port.c b/src/channel-port.c
index d922e4b..ff28b72 100644
--- a/src/channel-port.c
+++ b/src/channel-port.c
@@ -277,6 +277,7 @@ static void port_handle_msg(SpiceChannel *channel, SpiceMsgIn *in)
  * the operation.
  *
  * Since: 0.15
+ * Deprecated: 0.35: use spice_port_channel_write_async() instead.
  **/
 void spice_port_write_async(SpicePortChannel *self,
                             const void *buffer, gsize count,
@@ -284,6 +285,32 @@ void spice_port_write_async(SpicePortChannel *self,
                             GAsyncReadyCallback callback,
                             gpointer user_data)
 {
+    spice_port_channel_write_async(self, buffer, count, cancellable, callback, user_data);
+}
+
+/**
+ * spice_port_channel_write_async:
+ * @port: A #SpicePortChannel
+ * @buffer: (array length=count) (element-type guint8): the buffer
+ * containing the data to write
+ * @count: the number of bytes to write
+ * @cancellable: (allow-none): optional GCancellable object, NULL to ignore
+ * @callback: (scope async): callback to call when the request is satisfied
+ * @user_data: (closure): the data to pass to callback function
+ *
+ * Request an asynchronous write of count bytes from @buffer into the
+ * @port. When the operation is finished @callback will be called. You
+ * can then call spice_port_write_finish() to get the result of
+ * the operation.
+ *
+ * Since: 0.35
+ **/
+void spice_port_channel_write_async(SpicePortChannel *self,
+                                    const void *buffer, gsize count,
+                                    GCancellable *cancellable,
+                                    GAsyncReadyCallback callback,
+                                    gpointer user_data)
+{
     SpicePortChannelPrivate *c;
 
     g_return_if_fail(SPICE_IS_PORT_CHANNEL(self));
@@ -292,7 +319,7 @@ void spice_port_write_async(SpicePortChannel *self,
 
     if (!c->opened) {
         g_task_report_new_error(self, callback,
-            user_data, spice_port_write_async,
+            user_data, spice_port_channel_write_async,
             SPICE_CLIENT_ERROR, SPICE_CLIENT_ERROR_FAILED,
             "The port is not opened");
         return;
@@ -313,10 +340,29 @@ void spice_port_write_async(SpicePortChannel *self,
  *
  * Returns: a #gssize containing the number of bytes written to the stream.
  * Since: 0.15
+ * Deprecated: 0.35: use spice_port_channel_write_finish() instead.
  **/
 gssize spice_port_write_finish(SpicePortChannel *self,
                                GAsyncResult *result, GError **error)
 {
+    return spice_port_channel_write_finish(self, result, error);
+}
+
+/**
+ * spice_port_channel_write_finish:
+ * @port: a #SpicePortChannel
+ * @result: a #GAsyncResult
+ * @error: a #GError location to store the error occurring, or %NULL
+ * to ignore
+ *
+ * Finishes a port write operation.
+ *
+ * Returns: a #gssize containing the number of bytes written to the stream.
+ * Since: 0.35
+ **/
+gssize spice_port_channel_write_finish(SpicePortChannel *self,
+                                       GAsyncResult *result, GError **error)
+{
     g_return_val_if_fail(SPICE_IS_PORT_CHANNEL(self), -1);
 
     return spice_vmc_write_finish(SPICE_CHANNEL(self), result, error);
@@ -334,9 +380,28 @@ gssize spice_port_write_finish(SpicePortChannel *self,
  * state.
  *
  * Since: 0.15
+ * Deprecated: 0.35: use spice_port_channel_event() instead.
  **/
 void spice_port_event(SpicePortChannel *self, guint8 event)
 {
+    spice_port_channel_event(self, event);
+}
+
+/**
+ * spice_port_channel_event:
+ * @port: a #SpicePortChannel
+ * @event: a SPICE_PORT_EVENT value
+ *
+ * Send an event to the port.
+ *
+ * Note: The values SPICE_PORT_EVENT_CLOSED and
+ * SPICE_PORT_EVENT_OPENED are managed by the channel connection
+ * state.
+ *
+ * Since: 0.35
+ **/
+void spice_port_channel_event(SpicePortChannel *self, guint8 event)
+{
     SpiceMsgcPortEvent e;
     SpiceMsgOut *msg;
 
diff --git a/src/channel-port.h b/src/channel-port.h
index 8fc19cc..3c80d61 100644
--- a/src/channel-port.h
+++ b/src/channel-port.h
@@ -66,14 +66,29 @@ struct _SpicePortChannelClass {
 
 GType spice_port_channel_get_type(void);
 
+void spice_port_channel_write_async(SpicePortChannel *port,
+                                    const void *buffer, gsize count,
+                                    GCancellable *cancellable,
+                                    GAsyncReadyCallback callback,
+                                    gpointer user_data);
+gssize spice_port_channel_write_finish(SpicePortChannel *port,
+                                       GAsyncResult *result, GError **error);
+void spice_port_channel_event(SpicePortChannel *port, guint8 event);
+
+
+#ifndef SPICE_DISABLE_DEPRECATED
+G_DEPRECATED_FOR(spice_port_channel_write_async)
 void spice_port_write_async(SpicePortChannel *port,
                             const void *buffer, gsize count,
                             GCancellable *cancellable,
                             GAsyncReadyCallback callback,
                             gpointer user_data);
+G_DEPRECATED_FOR(spice_port_channel_write_finish)
 gssize spice_port_write_finish(SpicePortChannel *port,
                                GAsyncResult *result, GError **error);
+G_DEPRECATED_FOR(spice_port_channel_event)
 void spice_port_event(SpicePortChannel *port, guint8 event);
+#endif
 
 G_END_DECLS
 
diff --git a/src/map-file b/src/map-file
index 668ff41..de4f421 100644
--- a/src/map-file
+++ b/src/map-file
@@ -86,7 +86,10 @@ spice_main_update_display;
 spice_main_update_display_enabled;
 spice_playback_channel_get_type;
 spice_playback_channel_set_delay;
+spice_port_channel_event;
 spice_port_channel_get_type;
+spice_port_channel_write_async;
+spice_port_channel_write_finish;
 spice_port_event;
 spice_port_write_async;
 spice_port_write_finish;
diff --git a/src/spice-glib-sym-file b/src/spice-glib-sym-file
index e061744..79c75f1 100644
--- a/src/spice-glib-sym-file
+++ b/src/spice-glib-sym-file
@@ -65,7 +65,10 @@ spice_main_update_display
 spice_main_update_display_enabled
 spice_playback_channel_get_type
 spice_playback_channel_set_delay
+spice_port_channel_event
 spice_port_channel_get_type
+spice_port_channel_write_async
+spice_port_channel_write_finish
 spice_port_event
 spice_port_write_async
 spice_port_write_finish
diff --git a/tools/spicy.c b/tools/spicy.c
index a09f8cd..d71d996 100644
--- a/tools/spicy.c
+++ b/tools/spicy.c
@@ -1484,7 +1484,7 @@ static void port_write_cb(GObject *source_object,
     SpicePortChannel *port = SPICE_PORT_CHANNEL(source_object);
     GError *error = NULL;
 
-    spice_port_write_finish(port, res, &error);
+    spice_port_channel_write_finish(port, res, &error);
     if (error != NULL)
         g_warning("%s", error->message);
     g_clear_error(&error);
@@ -1519,7 +1519,7 @@ static gboolean input_cb(GIOChannel *gin, GIOCondition condition, gpointer data)
         return FALSE;
 
     if (stdin_port != NULL)
-        spice_port_write_async(stdin_port, buf, bytes_read, NULL, port_write_cb, NULL);
+        spice_port_channel_write_async(stdin_port, buf, bytes_read, NULL, port_write_cb, NULL);
 
     return TRUE;
 }
@@ -1543,7 +1543,7 @@ static void port_opened(SpiceChannel *channel, GParamSpec *pspec,
     if (opened) {
         /* only send a break event and disconnect */
         if (g_strcmp0(name, "org.spice.spicy.break") == 0) {
-            spice_port_event(port, SPICE_PORT_EVENT_BREAK);
+            spice_port_channel_event(port, SPICE_PORT_EVENT_BREAK);
             spice_channel_flush_async(channel, NULL, port_flushed_cb, conn);
         }
 


More information about the Spice-commits mailing list