[Spice-devel] [PATCH spice-gtk v2 5/8] widget: make gl-scanout and update-monitor-area privately exported

Marc-André Lureau marcandre.lureau at gmail.com
Tue Mar 22 12:57:12 UTC 2016


The following changes will call these functions from spice-widget-egl.c

Signed-off-by: Marc-André Lureau <marcandre.lureau at gmail.com>
---
 src/spice-widget-priv.h |  3 +++
 src/spice-widget.c      | 17 +++++++++++------
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/spice-widget-priv.h b/src/spice-widget-priv.h
index bafeb7d..95bca8a 100644
--- a/src/spice-widget-priv.h
+++ b/src/spice-widget-priv.h
@@ -163,6 +163,9 @@ gboolean spice_egl_update_scanout            (SpiceDisplay *display,
                                               GError **err);
 void     spice_egl_cursor_set                (SpiceDisplay *display);
 
+void     spice_display_widget_gl_scanout     (SpiceDisplay *display);
+void     spice_display_widget_update_monitor_area(SpiceDisplay *display);
+
 G_END_DECLS
 
 #endif
diff --git a/src/spice-widget.c b/src/spice-widget.c
index 198d0cd..f0f065c 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -264,7 +264,8 @@ static void set_monitor_ready(SpiceDisplay *self, gboolean ready)
     update_ready(self);
 }
 
-static void update_monitor_area(SpiceDisplay *display)
+G_GNUC_INTERNAL
+void spice_display_widget_update_monitor_area(SpiceDisplay *display)
 {
     SpiceDisplayPrivate *d = display->priv;
     SpiceDisplayMonitorConfig *cfg, *c = NULL;
@@ -339,7 +340,7 @@ static void spice_display_set_property(GObject      *object,
     case PROP_MONITOR_ID:
         d->monitor_id = g_value_get_int(value);
         if (d->display) /* if constructed */
-            update_monitor_area(display);
+            spice_display_widget_update_monitor_area(display);
         break;
     case PROP_KEYBOARD_GRAB:
         d->keyboard_grab_enable = g_value_get_boolean(value);
@@ -2230,7 +2231,7 @@ static void primary_create(SpiceChannel *channel, gint format,
     d->height = height;
     d->data_origin = d->data = imgdata;
 
-    update_monitor_area(display);
+    spice_display_widget_update_monitor_area(display);
 }
 
 static void primary_destroy(SpiceChannel *channel, gpointer data)
@@ -2480,7 +2481,8 @@ static void cursor_reset(SpiceCursorChannel *channel, gpointer data)
 }
 
 #ifndef G_OS_WIN32
-static void gl_scanout(SpiceDisplay *display)
+G_GNUC_INTERNAL
+void spice_display_widget_gl_scanout(SpiceDisplay *display)
 {
     SpiceDisplayPrivate *d = display->priv;
     const SpiceGlScanout *scanout;
@@ -2555,15 +2557,18 @@ static void channel_new(SpiceSession *s, SpiceChannel *channel, gpointer data)
         spice_g_signal_connect_object(channel, "display-mark",
                                       G_CALLBACK(mark), display, G_CONNECT_AFTER | G_CONNECT_SWAPPED);
         spice_g_signal_connect_object(channel, "notify::monitors",
-                                      G_CALLBACK(update_monitor_area), display, G_CONNECT_AFTER | G_CONNECT_SWAPPED);
+                                      G_CALLBACK(spice_display_widget_update_monitor_area),
+                                      display, G_CONNECT_AFTER | G_CONNECT_SWAPPED);
         if (spice_display_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);
         }
+
 #ifndef G_OS_WIN32
         spice_g_signal_connect_object(channel, "notify::gl-scanout",
-                                      G_CALLBACK(gl_scanout), display, G_CONNECT_SWAPPED);
+                                      G_CALLBACK(spice_display_widget_gl_scanout),
+                                      display, G_CONNECT_SWAPPED);
         spice_g_signal_connect_object(channel, "gl-draw",
                                       G_CALLBACK(gl_draw), display, G_CONNECT_SWAPPED);
 #endif
-- 
2.5.0



More information about the Spice-devel mailing list