[Spice-devel] [PATCH v2 04/10] gtk: move SpiceUsbDeviceWidget

Marc-André Lureau marcandre.lureau at gmail.com
Fri Mar 11 20:50:35 UTC 2016


Do not leak internals of SpiceUsbDeviceWidget in public headers. This makes also
the class final, which let us extend more easily without fear of breaking ABI.

Signed-off-by: Marc-André Lureau <marcandre.lureau at gmail.com>
---
 src/usb-device-widget.c | 16 ++++++++++++++++
 src/usb-device-widget.h | 36 ------------------------------------
 2 files changed, 16 insertions(+), 36 deletions(-)

diff --git a/src/usb-device-widget.c b/src/usb-device-widget.c
index 59273f9..faa6c6d 100644
--- a/src/usb-device-widget.c
+++ b/src/usb-device-widget.c
@@ -39,6 +39,22 @@
  * add an UI to select USB devices to redirect (or unredirect).
  */
 
+struct _SpiceUsbDeviceWidget
+{
+    GtkVBox parent;
+
+    SpiceUsbDeviceWidgetPrivate *priv;
+};
+
+struct _SpiceUsbDeviceWidgetClass
+{
+    GtkVBoxClass parent_class;
+
+    /* signals */
+    void (*connect_failed) (SpiceUsbDeviceWidget *widget,
+                            SpiceUsbDevice *device, GError *error);
+};
+
 /* ------------------------------------------------------------------ */
 /* Prototypes for callbacks  */
 static void device_added_cb(SpiceUsbDeviceManager *manager,
diff --git a/src/usb-device-widget.h b/src/usb-device-widget.h
index 8ce91f2..a4ba638 100644
--- a/src/usb-device-widget.h
+++ b/src/usb-device-widget.h
@@ -41,42 +41,6 @@ typedef struct _SpiceUsbDeviceWidget SpiceUsbDeviceWidget;
 typedef struct _SpiceUsbDeviceWidgetClass SpiceUsbDeviceWidgetClass;
 typedef struct _SpiceUsbDeviceWidgetPrivate SpiceUsbDeviceWidgetPrivate;
 
-/**
- * SpiceUsbDeviceWidget:
- *
- * The #SpiceUsbDeviceWidget struct is opaque and should not be accessed directly.
- */
-struct _SpiceUsbDeviceWidget
-{
-    GtkVBox parent;
-
-    /*< private >*/
-    SpiceUsbDeviceWidgetPrivate *priv;
-    /* Do not add fields to this struct */
-};
-
-/**
- * SpiceUsbDeviceWidgetClass:
- * @parent_class: Parent class.
- * @connect_failed: Signal class handler for the #SpiceUsbDeviceWidget::connect-failed signal.
- *
- * Class structure for #SpiceUsbDeviceWidget.
- */
-struct _SpiceUsbDeviceWidgetClass
-{
-    GtkVBoxClass parent_class;
-
-    /* signals */
-    void (*connect_failed) (SpiceUsbDeviceWidget *widget,
-                            SpiceUsbDevice *device, GError *error);
-    /*< private >*/
-    /*
-     * If adding fields to this struct, remove corresponding
-     * amount of padding to avoid changing overall struct size
-     */
-    gchar _spice_reserved[SPICE_RESERVED_PADDING];
-};
-
 GType spice_usb_device_widget_get_type(void);
 GtkWidget *spice_usb_device_widget_new(SpiceSession    *session,
                                        const gchar     *device_format_string);
-- 
2.5.0



More information about the Spice-devel mailing list