From: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx> Signed-off-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx> --- src/channel-cursor.c | 5 +---- src/channel-display.c | 5 +---- src/channel-inputs.c | 5 +---- src/channel-main.c | 5 +---- src/channel-playback.c | 5 +---- src/channel-port.c | 5 +---- src/channel-record.c | 5 +---- src/channel-smartcard.c | 5 +---- src/channel-usbredir.c | 5 +---- src/channel-webdav.c | 5 +---- src/desktop-integration.c | 11 +---------- src/smartcard-manager.c | 8 +------- src/spice-audio.c | 5 +---- src/spice-channel.c | 8 +------- src/spice-gstaudio.c | 5 +---- src/spice-gtk-session.c | 8 +------- src/spice-pulse.c | 5 +---- src/spice-session.c | 8 +------- src/spice-widget-egl.c | 20 ++++++++++---------- src/spice-widget-priv.h | 3 --- src/spice-widget.c | 2 +- src/usb-acl-helper.c | 8 +------- src/usb-device-manager.c | 8 +------- src/usb-device-widget.c | 9 +-------- src/win-usb-dev.c | 7 ++----- 25 files changed, 34 insertions(+), 131 deletions(-) diff --git a/src/channel-cursor.c b/src/channel-cursor.c index c2e0d85..0e19206 100644 --- a/src/channel-cursor.c +++ b/src/channel-cursor.c @@ -41,9 +41,6 @@ * property. */ -#define SPICE_CURSOR_CHANNEL_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE((obj), SPICE_TYPE_CURSOR_CHANNEL, SpiceCursorChannelPrivate)) - typedef struct display_cursor display_cursor; struct display_cursor { @@ -115,7 +112,7 @@ static void spice_cursor_channel_init(SpiceCursorChannel *channel) { SpiceCursorChannelPrivate *c; - c = channel->priv = SPICE_CURSOR_CHANNEL_GET_PRIVATE(channel); + c = channel->priv = spice_cursor_channel_get_instance_private(channel); c->cursors = cache_new((GDestroyNotify)display_cursor_unref); } diff --git a/src/channel-display.c b/src/channel-display.c index f5c5542..8fb4dee 100644 --- a/src/channel-display.c +++ b/src/channel-display.c @@ -49,9 +49,6 @@ * #SpiceDisplayChannel::display-invalidate signals. */ -#define SPICE_DISPLAY_CHANNEL_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE((obj), SPICE_TYPE_DISPLAY_CHANNEL, SpiceDisplayChannelPrivate)) - #define MONITORS_MAX 256 struct _SpiceDisplayChannelPrivate { @@ -881,7 +878,7 @@ static void spice_display_channel_init(SpiceDisplayChannel *channel) { SpiceDisplayChannelPrivate *c; - c = channel->priv = SPICE_DISPLAY_CHANNEL_GET_PRIVATE(channel); + c = channel->priv = spice_display_channel_get_instance_private(channel); c->surfaces = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, destroy_surface); c->image_cache.ops = &image_cache_ops; diff --git a/src/channel-inputs.c b/src/channel-inputs.c index 8151600..1e8f956 100644 --- a/src/channel-inputs.c +++ b/src/channel-inputs.c @@ -40,9 +40,6 @@ * is emitted with #SpiceInputsChannel::inputs-modifiers signal. */ -#define SPICE_INPUTS_CHANNEL_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE((obj), SPICE_TYPE_INPUTS_CHANNEL, SpiceInputsChannelPrivate)) - struct _SpiceInputsChannelPrivate { int bs; int dx, dy; @@ -77,7 +74,7 @@ static void channel_set_handlers(SpiceChannelClass *klass); static void spice_inputs_channel_init(SpiceInputsChannel *channel) { - channel->priv = SPICE_INPUTS_CHANNEL_GET_PRIVATE(channel); + channel->priv = spice_inputs_channel_get_instance_private(channel); } static void spice_inputs_get_property(GObject *object, diff --git a/src/channel-main.c b/src/channel-main.c index d2c0581..4c6bc70 100644 --- a/src/channel-main.c +++ b/src/channel-main.c @@ -48,9 +48,6 @@ * */ -#define SPICE_MAIN_CHANNEL_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE((obj), SPICE_TYPE_MAIN_CHANNEL, SpiceMainChannelPrivate)) - #define MAX_DISPLAY 16 /* Note must fit in a guint32, see monitors_align */ typedef struct spice_migrate spice_migrate; @@ -253,7 +250,7 @@ static void spice_main_channel_init(SpiceMainChannel *channel) { SpiceMainChannelPrivate *c; - c = channel->priv = SPICE_MAIN_CHANNEL_GET_PRIVATE(channel); + c = channel->priv = spice_main_channel_get_instance_private(channel); c->agent_msg_queue = g_queue_new(); c->file_xfer_tasks = g_hash_table_new(g_direct_hash, g_direct_equal); c->flushing = g_hash_table_new(g_direct_hash, g_direct_equal); diff --git a/src/channel-playback.c b/src/channel-playback.c index 8946d5a..3dc1849 100644 --- a/src/channel-playback.c +++ b/src/channel-playback.c @@ -46,9 +46,6 @@ * record audio channels for your application. */ -#define SPICE_PLAYBACK_CHANNEL_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE((obj), SPICE_TYPE_PLAYBACK_CHANNEL, SpicePlaybackChannelPrivate)) - struct _SpicePlaybackChannelPrivate { int mode; SndCodec codec; @@ -104,7 +101,7 @@ static void spice_playback_channel_reset_capabilities(SpiceChannel *channel) static void spice_playback_channel_init(SpicePlaybackChannel *channel) { - channel->priv = SPICE_PLAYBACK_CHANNEL_GET_PRIVATE(channel); + channel->priv = spice_playback_channel_get_instance_private(channel); spice_playback_channel_reset_capabilities(SPICE_CHANNEL(channel)); } diff --git a/src/channel-port.c b/src/channel-port.c index b1a4811..d9c5a6c 100644 --- a/src/channel-port.c +++ b/src/channel-port.c @@ -52,9 +52,6 @@ * Since: 0.15 */ -#define SPICE_PORT_CHANNEL_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE((obj), SPICE_TYPE_PORT_CHANNEL, SpicePortChannelPrivate)) - struct _SpicePortChannelPrivate { gchar *name; gboolean opened; @@ -81,7 +78,7 @@ static void channel_set_handlers(SpiceChannelClass *klass); static void spice_port_channel_init(SpicePortChannel *channel) { - channel->priv = SPICE_PORT_CHANNEL_GET_PRIVATE(channel); + channel->priv = spice_port_channel_get_instance_private(channel); } static void spice_port_get_property(GObject *object, diff --git a/src/channel-record.c b/src/channel-record.c index 2b5d2de..ab0a239 100644 --- a/src/channel-record.c +++ b/src/channel-record.c @@ -47,9 +47,6 @@ * record audio channels for your application. */ -#define SPICE_RECORD_CHANNEL_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE((obj), SPICE_TYPE_RECORD_CHANNEL, SpiceRecordChannelPrivate)) - struct _SpiceRecordChannelPrivate { int mode; gboolean started; @@ -99,7 +96,7 @@ static void spice_record_channel_reset_capabilities(SpiceChannel *channel) static void spice_record_channel_init(SpiceRecordChannel *channel) { - channel->priv = SPICE_RECORD_CHANNEL_GET_PRIVATE(channel); + channel->priv = spice_record_channel_get_instance_private(channel); spice_record_channel_reset_capabilities(SPICE_CHANNEL(channel)); } diff --git a/src/channel-smartcard.c b/src/channel-smartcard.c index f2feb71..6d0facd 100644 --- a/src/channel-smartcard.c +++ b/src/channel-smartcard.c @@ -49,9 +49,6 @@ * insertion/removal. */ -#define SPICE_SMARTCARD_CHANNEL_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE((obj), SPICE_TYPE_SMARTCARD_CHANNEL, SpiceSmartcardChannelPrivate)) - struct _SpiceSmartcardChannelMessage { #ifdef USE_SMARTCARD VSCMsgType message_type; @@ -115,7 +112,7 @@ static void spice_smartcard_channel_init(SpiceSmartcardChannel *channel) { SpiceSmartcardChannelPrivate *priv; - channel->priv = SPICE_SMARTCARD_CHANNEL_GET_PRIVATE(channel); + channel->priv = spice_smartcard_channel_get_instance_private(channel); priv = channel->priv; priv->message_queue = g_queue_new(); diff --git a/src/channel-usbredir.c b/src/channel-usbredir.c index c09d98a..0b0a47b 100644 --- a/src/channel-usbredir.c +++ b/src/channel-usbredir.c @@ -56,9 +56,6 @@ #ifdef USE_USBREDIR #define COMPRESS_THRESHOLD 1000 -#define SPICE_USBREDIR_CHANNEL_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE((obj), SPICE_TYPE_USBREDIR_CHANNEL, SpiceUsbredirChannelPrivate)) - enum SpiceUsbredirChannelState { STATE_DISCONNECTED, #ifdef USE_POLKIT @@ -115,7 +112,7 @@ G_DEFINE_TYPE_WITH_PRIVATE(SpiceUsbredirChannel, spice_usbredir_channel, SPICE_T static void spice_usbredir_channel_init(SpiceUsbredirChannel *channel) { #ifdef USE_USBREDIR - channel->priv = SPICE_USBREDIR_CHANNEL_GET_PRIVATE(channel); + channel->priv = spice_usbredir_channel_get_instance_private(channel); g_mutex_init(&channel->priv->device_connect_mutex); #endif } diff --git a/src/channel-webdav.c b/src/channel-webdav.c index 8ff4080..79e3f33 100644 --- a/src/channel-webdav.c +++ b/src/channel-webdav.c @@ -45,9 +45,6 @@ * Since: 0.24 */ -#define SPICE_WEBDAV_CHANNEL_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE((obj), SPICE_TYPE_WEBDAV_CHANNEL, SpiceWebdavChannelPrivate)) - typedef struct _OutputQueue OutputQueue; struct _SpiceWebdavChannelPrivate { @@ -532,7 +529,7 @@ static void client_remove_unref(gpointer data) static void spice_webdav_channel_init(SpiceWebdavChannel *channel) { - SpiceWebdavChannelPrivate *c = SPICE_WEBDAV_CHANNEL_GET_PRIVATE(channel); + SpiceWebdavChannelPrivate *c = spice_webdav_channel_get_instance_private(channel); channel->priv = c; c->stream = spice_vmc_stream_new(SPICE_CHANNEL(channel)); diff --git a/src/desktop-integration.c b/src/desktop-integration.c index e18b4d5..61d9eae 100644 --- a/src/desktop-integration.c +++ b/src/desktop-integration.c @@ -30,12 +30,6 @@ #define GNOME_SESSION_INHIBIT_AUTOMOUNT 16 -/* ------------------------------------------------------------------ */ -/* gobject glue */ - -#define SPICE_DESKTOP_INTEGRATION_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), SPICE_TYPE_DESKTOP_INTEGRATION, SpiceDesktopIntegrationPrivate)) - struct _SpiceDesktopIntegrationPrivate { #if defined(USE_GDBUS) GDBusProxy *gnome_session_proxy; @@ -159,14 +153,11 @@ static void gnome_integration_dispose(SpiceDesktopIntegration *self) g_clear_object(&priv->gnome_session_proxy); } -/* ------------------------------------------------------------------ */ -/* gobject glue */ - static void spice_desktop_integration_init(SpiceDesktopIntegration *self) { SpiceDesktopIntegrationPrivate *priv; - priv = SPICE_DESKTOP_INTEGRATION_GET_PRIVATE(self); + priv = spice_desktop_integration_get_instance_private(self); self->priv = priv; if (!gnome_integration_init(self)) diff --git a/src/smartcard-manager.c b/src/smartcard-manager.c index 629bbf9..9c94f95 100644 --- a/src/smartcard-manager.c +++ b/src/smartcard-manager.c @@ -50,12 +50,6 @@ * guest using 3 certificates available to the client). */ -/* ------------------------------------------------------------------ */ -/* gobject glue */ - -#define SPICE_SMARTCARD_MANAGER_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), SPICE_TYPE_SMARTCARD_MANAGER, SpiceSmartcardManagerPrivate)) - struct _SpiceSmartcardManagerPrivate { guint monitor_id; @@ -105,7 +99,7 @@ static void spice_smartcard_manager_init(SpiceSmartcardManager *smartcard_manage { SpiceSmartcardManagerPrivate *priv; - priv = SPICE_SMARTCARD_MANAGER_GET_PRIVATE(smartcard_manager); + priv = spice_smartcard_manager_get_instance_private(smartcard_manager); smartcard_manager->priv = priv; } diff --git a/src/spice-audio.c b/src/spice-audio.c index 4f6253a..d2f0d92 100644 --- a/src/spice-audio.c +++ b/src/spice-audio.c @@ -49,9 +49,6 @@ #include "spice-gstaudio.h" #endif -#define SPICE_AUDIO_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), SPICE_TYPE_AUDIO, SpiceAudioPrivate)) - G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE(SpiceAudio, spice_audio, G_TYPE_OBJECT) enum { @@ -145,7 +142,7 @@ static void spice_audio_class_init(SpiceAudioClass *klass) static void spice_audio_init(SpiceAudio *self) { - self->priv = SPICE_AUDIO_GET_PRIVATE(self); + self->priv = spice_audio_get_instance_private(self); } static void connect_channel(SpiceAudio *self, SpiceChannel *channel) diff --git a/src/spice-channel.c b/src/spice-channel.c index e7fbf57..6f3ca27 100644 --- a/src/spice-channel.c +++ b/src/spice-channel.c @@ -78,12 +78,6 @@ static RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey) * #SpiceInputsChannel. */ -/* ------------------------------------------------------------------ */ -/* gobject glue */ - -#define SPICE_CHANNEL_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), SPICE_TYPE_CHANNEL, SpiceChannelPrivate)) - G_DEFINE_TYPE_WITH_CODE (SpiceChannel, spice_channel, G_TYPE_OBJECT, G_ADD_PRIVATE (SpiceChannel) g_type_add_class_private (g_define_type_id, sizeof (SpiceChannelClassPrivate))); @@ -115,7 +109,7 @@ static void spice_channel_init(SpiceChannel *channel) { SpiceChannelPrivate *c; - c = channel->priv = SPICE_CHANNEL_GET_PRIVATE(channel); + c = channel->priv = spice_channel_get_instance_private(channel); c->out_serial = 1; c->in_serial = 1; diff --git a/src/spice-gstaudio.c b/src/spice-gstaudio.c index 4ae7cb5..dcd0591 100644 --- a/src/spice-gstaudio.c +++ b/src/spice-gstaudio.c @@ -27,9 +27,6 @@ #include "spice-session.h" #include "spice-util.h" -#define SPICE_GSTAUDIO_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE((obj), SPICE_TYPE_GSTAUDIO, SpiceGstaudioPrivate)) - struct stream { GstElement *pipe; GstElement *src; @@ -102,7 +99,7 @@ static void spice_gstaudio_dispose(GObject *obj) static void spice_gstaudio_init(SpiceGstaudio *gstaudio) { - gstaudio->priv = SPICE_GSTAUDIO_GET_PRIVATE(gstaudio); + gstaudio->priv = spice_gstaudio_get_instance_private(gstaudio); } static void spice_gstaudio_class_init(SpiceGstaudioClass *klass) diff --git a/src/spice-gtk-session.c b/src/spice-gtk-session.c index caa8545..705498a 100644 --- a/src/spice-gtk-session.c +++ b/src/spice-gtk-session.c @@ -104,12 +104,6 @@ static void channel_destroy(SpiceSession *session, SpiceChannel *channel, gpointer user_data); static gboolean read_only(SpiceGtkSession *self); -/* ------------------------------------------------------------------ */ -/* gobject glue */ - -#define SPICE_GTK_SESSION_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), SPICE_TYPE_GTK_SESSION, SpiceGtkSessionPrivate)) - G_DEFINE_TYPE_WITH_PRIVATE(SpiceGtkSession, spice_gtk_session, G_TYPE_OBJECT); /* Properties */ @@ -224,7 +218,7 @@ static void spice_gtk_session_init(SpiceGtkSession *self) SpiceGtkSessionPrivate *s; GdkKeymap *keymap = gdk_keymap_get_default(); - s = self->priv = SPICE_GTK_SESSION_GET_PRIVATE(self); + s = self->priv = spice_gtk_session_get_instance_private(self); s->clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); g_signal_connect(G_OBJECT(s->clipboard), "owner-change", diff --git a/src/spice-pulse.c b/src/spice-pulse.c index 1d22c0e..bb71b65 100644 --- a/src/spice-pulse.c +++ b/src/spice-pulse.c @@ -27,9 +27,6 @@ #include <pulse/pulseaudio.h> #include <pulse/ext-stream-restore.h> -#define SPICE_PULSE_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE((obj), SPICE_TYPE_PULSE, SpicePulsePrivate)) - struct async_task { SpicePulse *pulse; SpiceMainChannel *main_channel; @@ -155,7 +152,7 @@ static void spice_pulse_dispose(GObject *obj) static void spice_pulse_init(SpicePulse *pulse) { - pulse->priv = SPICE_PULSE_GET_PRIVATE(pulse); + pulse->priv = spice_pulse_get_instance_private(pulse); } static void spice_pulse_class_init(SpicePulseClass *klass) diff --git a/src/spice-session.c b/src/spice-session.c index 6f6dfa7..a46ae79 100644 --- a/src/spice-session.c +++ b/src/spice-session.c @@ -156,12 +156,6 @@ struct _SpiceSessionPrivate { * a Spice server. */ -/* ------------------------------------------------------------------ */ -/* gobject glue */ - -#define SPICE_SESSION_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), SPICE_TYPE_SESSION, SpiceSessionPrivate)) - G_DEFINE_TYPE_WITH_PRIVATE(SpiceSession, spice_session, G_TYPE_OBJECT); /* Properties */ @@ -283,7 +277,7 @@ static void spice_session_init(SpiceSession *session) GError *err = NULL; SPICE_DEBUG("New session (compiled from package " PACKAGE_STRING ")"); - s = session->priv = SPICE_SESSION_GET_PRIVATE(session); + s = session->priv = spice_session_get_instance_private(session); channels = spice_channel_supported_string(); SPICE_DEBUG("Supported channels: %s", channels); diff --git a/src/spice-widget-egl.c b/src/spice-widget-egl.c index 5354e26..29d2f01 100644 --- a/src/spice-widget-egl.c +++ b/src/spice-widget-egl.c @@ -92,7 +92,7 @@ static void apply_ortho(guint mproj, float left, float right, static gboolean spice_egl_init_shaders(SpiceDisplay *display, GError **err) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; GLuint fs = 0, vs = 0, buf; GLint status, tex_loc, prog; gboolean success = FALSE; @@ -182,7 +182,7 @@ end: G_GNUC_INTERNAL gboolean spice_egl_init(SpiceDisplay *display, GError **err) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; static const EGLint conf_att[] = { EGL_SURFACE_TYPE, EGL_WINDOW_BIT, EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT, @@ -290,7 +290,7 @@ end: static gboolean gl_make_current(SpiceDisplay *display, GError **err) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; g_return_val_if_fail(d->egl.context_ready, FALSE); @@ -328,7 +328,7 @@ gl_make_current(SpiceDisplay *display, GError **err) static gboolean spice_widget_init_egl_win(SpiceDisplay *display, GdkWindow *win, GError **err) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; EGLNativeWindowType native = 0; if (d->egl.surface) @@ -378,7 +378,7 @@ gboolean spice_egl_realize_display(SpiceDisplay *display, GdkWindow *win, GError G_GNUC_INTERNAL void spice_egl_unrealize_display(SpiceDisplay *display) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; DISPLAY_DEBUG(display, "egl unrealize %p", d->egl.surface); @@ -437,7 +437,7 @@ void spice_egl_unrealize_display(SpiceDisplay *display) G_GNUC_INTERNAL void spice_egl_resize_display(SpiceDisplay *display, int w, int h) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; int prog; if (!gl_make_current(display, NULL)) @@ -458,7 +458,7 @@ void spice_egl_resize_display(SpiceDisplay *display, int w, int h) static void draw_rect_from_arrays(SpiceDisplay *display, const void *verts, const void *tex) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; glBindBuffer(GL_ARRAY_BUFFER, d->egl.vbuf_id); @@ -530,7 +530,7 @@ client_draw_rect_tex(SpiceDisplay *display, G_GNUC_INTERNAL void spice_egl_cursor_set(SpiceDisplay *display) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; GdkPixbuf *image = d->mouse_pixbuf; g_return_if_fail(d->egl.enabled); @@ -555,7 +555,7 @@ void spice_egl_cursor_set(SpiceDisplay *display) G_GNUC_INTERNAL void spice_egl_update_display(SpiceDisplay *display) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; double s; int x, y, w, h; gdouble tx, ty, tw, th; @@ -644,7 +644,7 @@ gboolean spice_egl_update_scanout(SpiceDisplay *display, const SpiceGlScanout *scanout, GError **err) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; EGLint attrs[13]; guint32 format; diff --git a/src/spice-widget-priv.h b/src/spice-widget-priv.h index ac69b5f..96f6c1d 100644 --- a/src/spice-widget-priv.h +++ b/src/spice-widget-priv.h @@ -55,9 +55,6 @@ struct _SpiceDisplayClass { void (*keyboard_grab)(SpiceChannel *channel, gint grabbed); }; -#define SPICE_DISPLAY_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE((obj), SPICE_TYPE_DISPLAY, SpiceDisplayPrivate)) - struct _SpiceDisplayPrivate { GtkStack *stack; gint channel_id; diff --git a/src/spice-widget.c b/src/spice-widget.c index 4b5dbd6..885e8c0 100644 --- a/src/spice-widget.c +++ b/src/spice-widget.c @@ -632,7 +632,7 @@ static void spice_display_init(SpiceDisplay *display) SpiceDisplayPrivate *d; GtkTargetEntry targets = { "text/uri-list", 0, 0 }; - d = display->priv = SPICE_DISPLAY_GET_PRIVATE(display); + d = display->priv = spice_display_get_instance_private(display); d->stack = GTK_STACK(gtk_stack_new()); gtk_container_add(GTK_CONTAINER(display), GTK_WIDGET(d->stack)); area = gtk_drawing_area_new(); diff --git a/src/usb-acl-helper.c b/src/usb-acl-helper.c index 23023cf..fcac4b7 100644 --- a/src/usb-acl-helper.c +++ b/src/usb-acl-helper.c @@ -27,12 +27,6 @@ #include "usb-acl-helper.h" -/* ------------------------------------------------------------------ */ -/* gobject glue */ - -#define SPICE_USB_ACL_HELPER_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), SPICE_TYPE_USB_ACL_HELPER, SpiceUsbAclHelperPrivate)) - struct _SpiceUsbAclHelperPrivate { GTask *task; GIOChannel *in_ch; @@ -45,7 +39,7 @@ G_DEFINE_TYPE_WITH_PRIVATE(SpiceUsbAclHelper, spice_usb_acl_helper, G_TYPE_OBJEC static void spice_usb_acl_helper_init(SpiceUsbAclHelper *self) { - self->priv = SPICE_USB_ACL_HELPER_GET_PRIVATE(self); + self->priv = spice_usb_acl_helper_get_instance_private(self); } static void spice_usb_acl_helper_cleanup(SpiceUsbAclHelper *self) diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c index 9757ba0..35b1eb7 100644 --- a/src/usb-device-manager.c +++ b/src/usb-device-manager.c @@ -78,12 +78,6 @@ * spice_usb_device_manager_get() which ensures this 1:1 relation. */ -/* ------------------------------------------------------------------ */ -/* gobject glue */ - -#define SPICE_USB_DEVICE_MANAGER_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), SPICE_TYPE_USB_DEVICE_MANAGER, SpiceUsbDeviceManagerPrivate)) - enum { PROP_0, PROP_SESSION, @@ -268,7 +262,7 @@ static void spice_usb_device_manager_init(SpiceUsbDeviceManager *self) { SpiceUsbDeviceManagerPrivate *priv; - priv = SPICE_USB_DEVICE_MANAGER_GET_PRIVATE(self); + priv = spice_usb_device_manager_get_instance_private(self); self->priv = priv; #if defined(G_OS_WIN32) && defined(USE_USBREDIR) diff --git a/src/usb-device-widget.c b/src/usb-device-widget.c index 17f9f8c..6c4fd63 100644 --- a/src/usb-device-widget.c +++ b/src/usb-device-widget.c @@ -64,13 +64,6 @@ static void device_error_cb(SpiceUsbDeviceManager *manager, SpiceUsbDevice *device, GError *err, gpointer user_data); static gboolean spice_usb_device_widget_update_status(gpointer user_data); -/* ------------------------------------------------------------------ */ -/* gobject glue */ - -#define SPICE_USB_DEVICE_WIDGET_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE((obj), SPICE_TYPE_USB_DEVICE_WIDGET, \ - SpiceUsbDeviceWidgetPrivate)) - enum { PROP_0, PROP_SESSION, @@ -314,7 +307,7 @@ static void spice_usb_device_widget_class_init( static void spice_usb_device_widget_init(SpiceUsbDeviceWidget *self) { - self->priv = SPICE_USB_DEVICE_WIDGET_GET_PRIVATE(self); + self->priv = spice_usb_device_widget_get_instance_private(self); } /* ------------------------------------------------------------------ */ diff --git a/src/win-usb-dev.c b/src/win-usb-dev.c index 781214f..fe4cb98 100644 --- a/src/win-usb-dev.c +++ b/src/win-usb-dev.c @@ -29,9 +29,6 @@ #include "spice-util.h" #include "usbutil.h" -#define G_UDEV_CLIENT_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE((obj), G_UDEV_TYPE_CLIENT, GUdevClientPrivate)) - enum { PROP_0, PROP_REDIRECTING @@ -250,7 +247,7 @@ GList *g_udev_client_query_by_subsystem(GUdevClient *self, const gchar *subsyste static void g_udev_client_init(GUdevClient *self) { - self->priv = G_UDEV_CLIENT_GET_PRIVATE(self); + self->priv = g_udev_client_get_instance_private(self); } static void g_udev_client_finalize(GObject *gobject) @@ -474,7 +471,7 @@ static void g_udev_device_class_init(GUdevDeviceClass *klass) static void g_udev_device_init(GUdevDevice *device) { - device->priv = G_TYPE_INSTANCE_GET_PRIVATE(device, G_UDEV_TYPE_DEVICE, GUdevDevicePrivate); + device->priv = g_udev_device_get_instance_private(device); } static GUdevDevice *g_udev_device_new(GUdevDeviceInfo *udevinfo) -- 2.18.0.rc1.1.gae296d1cf5 _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel