diff --git a/gtk/channel-smartcard.c b/gtk/channel-smartcard.c index cbddc1c..5e77527 100644 --- a/gtk/channel-smartcard.c +++ b/gtk/channel-smartcard.c @@ -159,7 +159,8 @@ static void spice_smartcard_channel_constructed(GObject *object) static void spice_smartcard_channel_finalize(GObject *obj) { - SpiceSmartcardChannelPrivate *c = SPICE_SMARTCARD_CHANNEL_GET_PRIVATE(obj); + SpiceSmartcardChannel *channel = SPICE_SMARTCARD_CHANNEL(obj); + SpiceSmartcardChannelPrivate *c = channel->priv; if (c->pending_card_insertions != NULL) { g_hash_table_destroy(c->pending_card_insertions); @@ -188,7 +189,8 @@ static void spice_smartcard_channel_finalize(GObject *obj) static void spice_smartcard_channel_reset(SpiceChannel *channel, gboolean migrating) { - SpiceSmartcardChannelPrivate *c = SPICE_SMARTCARD_CHANNEL_GET_PRIVATE(channel); + SpiceSmartcardChannel *smart_channel = SPICE_SMARTCARD_CHANNEL(channel); + SpiceSmartcardChannelPrivate *c = smart_channel->priv; g_hash_table_remove_all(c->pending_card_insertions); g_hash_table_remove_all(c->pending_reader_removals); @@ -496,11 +498,11 @@ static void spice_smartcard_channel_up(SpiceChannel *channel) static void handle_smartcard_msg(SpiceChannel *channel, SpiceMsgIn *in) { #ifdef USE_SMARTCARD - SpiceSmartcardChannelPrivate *priv = SPICE_SMARTCARD_CHANNEL_GET_PRIVATE(channel); + SpiceSmartcardChannel *smart_channel = SPICE_SMARTCARD_CHANNEL (channel); + SpiceSmartcardChannelPrivate *priv = smart_channel->priv; SpiceMsgSmartcard *msg = spice_msg_in_parsed(in); VReader *reader; - priv = SPICE_SMARTCARD_CHANNEL_GET_PRIVATE(channel); CHANNEL_DEBUG(channel, "handle msg %d", msg->type); switch (msg->type) { case VSC_Error: diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c index fea46d7..185d24a 100644 --- a/gtk/spice-channel.c +++ b/gtk/spice-channel.c @@ -213,7 +213,7 @@ static void spice_channel_get_property(GObject *gobject, G_GNUC_INTERNAL gint spice_channel_get_channel_id(SpiceChannel *channel) { - SpiceChannelPrivate *c = SPICE_CHANNEL_GET_PRIVATE(channel); + SpiceChannelPrivate *c = channel->priv; g_return_val_if_fail(c != NULL, 0); return c->channel_id; @@ -222,7 +222,7 @@ gint spice_channel_get_channel_id(SpiceChannel *channel) G_GNUC_INTERNAL gint spice_channel_get_channel_type(SpiceChannel *channel) { - SpiceChannelPrivate *c = SPICE_CHANNEL_GET_PRIVATE(channel); + SpiceChannelPrivate *c = channel->priv; g_return_val_if_fail(c != NULL, 0); return c->channel_type; @@ -2335,7 +2335,7 @@ gboolean spice_channel_connect(SpiceChannel *channel) **/ gboolean spice_channel_open_fd(SpiceChannel *channel, int fd) { - SpiceChannelPrivate *c = SPICE_CHANNEL_GET_PRIVATE(channel); + SpiceChannelPrivate *c = channel->priv; g_return_val_if_fail(c != NULL, FALSE); g_return_val_if_fail(fd >= -1, FALSE); @@ -2348,7 +2348,7 @@ gboolean spice_channel_open_fd(SpiceChannel *channel, int fd) /* system or coroutine context */ static void channel_reset(SpiceChannel *channel, gboolean migrating) { - SpiceChannelPrivate *c = SPICE_CHANNEL_GET_PRIVATE(channel); + SpiceChannelPrivate *c = channel->priv; if (c->connect_delayed_id) { g_source_remove(c->connect_delayed_id); @@ -2416,7 +2416,7 @@ void spice_channel_reset(SpiceChannel *channel, gboolean migrating) /* system or coroutine context */ static void channel_disconnect(SpiceChannel *channel) { - SpiceChannelPrivate *c = SPICE_CHANNEL_GET_PRIVATE(channel); + SpiceChannelPrivate *c = channel->priv; g_return_if_fail(c != NULL); @@ -2445,7 +2445,7 @@ static void channel_disconnect(SpiceChannel *channel) **/ void spice_channel_disconnect(SpiceChannel *channel, SpiceChannelEvent reason) { - SpiceChannelPrivate *c = SPICE_CHANNEL_GET_PRIVATE(channel); + SpiceChannelPrivate *c = channel->priv; CHANNEL_DEBUG(channel, "channel disconnect %d", reason); g_return_if_fail(c != NULL); @@ -2587,8 +2587,8 @@ enum spice_channel_state spice_channel_get_state(SpiceChannel *channel) G_GNUC_INTERNAL void spice_channel_swap(SpiceChannel *channel, SpiceChannel *swap, gboolean swap_msgs) { - SpiceChannelPrivate *c = SPICE_CHANNEL_GET_PRIVATE(channel); - SpiceChannelPrivate *s = SPICE_CHANNEL_GET_PRIVATE(swap); + SpiceChannelPrivate *c = channel->priv; + SpiceChannelPrivate *s = swap->priv; g_return_if_fail(c != NULL); g_return_if_fail(s != NULL); @@ -2649,7 +2649,7 @@ static void spice_channel_handle_msg(SpiceChannel *channel, SpiceMsgIn *msg) static void spice_channel_reset_capabilities(SpiceChannel *channel) { - SpiceChannelPrivate *c = SPICE_CHANNEL_GET_PRIVATE(channel); + SpiceChannelPrivate *c = channel->priv; g_array_set_size(c->caps, 0); if (SPICE_CHANNEL_GET_CLASS(channel)->channel_reset_capabilities) { @@ -2659,7 +2659,7 @@ static void spice_channel_reset_capabilities(SpiceChannel *channel) static void spice_channel_send_migration_handshake(SpiceChannel *channel) { - SpiceChannelPrivate *c = SPICE_CHANNEL_GET_PRIVATE(channel); + SpiceChannelPrivate *c = channel->priv; if (SPICE_CHANNEL_GET_CLASS(channel)->channel_send_migration_handshake) { SPICE_CHANNEL_GET_CLASS(channel)->channel_send_migration_handshake(channel); diff --git a/gtk/spice-gstaudio.c b/gtk/spice-gstaudio.c index 6dd250e..ed933ed 100644 --- a/gtk/spice-gstaudio.c +++ b/gtk/spice-gstaudio.c @@ -81,9 +81,9 @@ void stream_dispose(struct stream *s) static void spice_gstaudio_dispose(GObject *obj) { - SpiceGstaudioPrivate *p; + SpiceGstaudio *pulse = SPICE_GSTAUDIO(obj) + SpiceGstaudioPrivate *p = p->priv; SPICE_DEBUG("%s", __FUNCTION__); - p = SPICE_GSTAUDIO_GET_PRIVATE(obj); stream_dispose(&p->playback); stream_dispose(&p->record); @@ -258,7 +258,7 @@ static void channel_event(SpiceChannel *channel, SpiceChannelEvent event, static void playback_stop(SpicePlaybackChannel *channel, gpointer data) { SpiceGstaudio *gstaudio = data; - SpiceGstaudioPrivate *p = SPICE_GSTAUDIO_GET_PRIVATE(gstaudio); + SpiceGstaudioPrivate *p = gstaudio->priv; if (p->playback.pipe) gst_element_set_state(p->playback.pipe, GST_STATE_READY); @@ -271,7 +271,7 @@ static void playback_stop(SpicePlaybackChannel *channel, gpointer data) static gboolean update_mmtime_timeout_cb(gpointer data) { SpiceGstaudio *gstaudio = data; - SpiceGstaudioPrivate *p = SPICE_GSTAUDIO_GET_PRIVATE(gstaudio); + SpiceGstaudioPrivate *p = gstaudio->priv; GstQuery *q; q = gst_query_new_latency(); @@ -293,7 +293,7 @@ static void playback_start(SpicePlaybackChannel *channel, gint format, gint chan gint frequency, gpointer data) { SpiceGstaudio *gstaudio = data; - SpiceGstaudioPrivate *p = SPICE_GSTAUDIO_GET_PRIVATE(gstaudio); + SpiceGstaudioPrivate *p = gstaudio->priv; g_return_if_fail(p != NULL); g_return_if_fail(format == SPICE_AUDIO_FMT_S16); @@ -346,7 +346,7 @@ static void playback_data(SpicePlaybackChannel *channel, gpointer data) { SpiceGstaudio *gstaudio = data; - SpiceGstaudioPrivate *p = SPICE_GSTAUDIO_GET_PRIVATE(gstaudio); + SpiceGstaudioPrivate *p = gstaudio->priv; GstBuffer *buf; g_return_if_fail(p != NULL); diff --git a/gtk/spice-pulse.c b/gtk/spice-pulse.c index 6a977c4..1404730 100644 --- a/gtk/spice-pulse.c +++ b/gtk/spice-pulse.c @@ -76,9 +76,8 @@ static gboolean connect_channel(SpiceAudio *audio, SpiceChannel *channel); static void spice_pulse_finalize(GObject *obj) { - SpicePulsePrivate *p; - - p = SPICE_PULSE_GET_PRIVATE(obj); + SpicePulse *pulse = SPICE_PULSE(obj); + SpicePulsePrivate *p = pulse->priv; if (p->context != NULL) pa_context_unref(p->context); @@ -91,10 +90,10 @@ static void spice_pulse_finalize(GObject *obj) static void spice_pulse_dispose(GObject *obj) { - SpicePulsePrivate *p; + SpicePulse *pulse = SPICE_PULSE(obj); + SpicePulsePrivate *p = pulse->priv; SPICE_DEBUG("%s", __FUNCTION__); - p = SPICE_PULSE_GET_PRIVATE(obj); if (p->playback.uncork_op) pa_operation_unref(p->playback.uncork_op); @@ -155,7 +154,7 @@ static void pulse_uncork_cb(pa_stream *pastream, int success, void *data) static void stream_uncork(SpicePulse *pulse, struct stream *s) { - SpicePulsePrivate *p = SPICE_PULSE_GET_PRIVATE(pulse); + SpicePulsePrivate *p = pulse->priv; pa_operation *o = NULL; if (s->cork_op) { @@ -200,7 +199,7 @@ static void pulse_cork_cb(pa_stream *pastream, int success, void *data) static void stream_cork(SpicePulse *pulse, struct stream *s) { - SpicePulsePrivate *p = SPICE_PULSE_GET_PRIVATE(pulse); + SpicePulsePrivate *p = pulse->priv; pa_operation *o = NULL; if (s->uncork_op) { @@ -220,7 +219,7 @@ static void stream_cork(SpicePulse *pulse, struct stream *s) static void stream_stop(SpicePulse *pulse, struct stream *s) { - SpicePulsePrivate *p = SPICE_PULSE_GET_PRIVATE(pulse); + SpicePulsePrivate *p = pulse->priv; if (pa_stream_disconnect(s->stream) < 0) { g_warning("pa_stream_disconnect() failed: %s", @@ -232,8 +231,8 @@ static void stream_stop(SpicePulse *pulse, struct stream *s) static void stream_state_callback(pa_stream *s, void *userdata) { - SpicePulsePrivate *p; - p = SPICE_PULSE_GET_PRIVATE(userdata); + SpicePulse *pulse = SPICE_PULSE(userdata); + SpicePulsePrivate *p = pulse->priv; g_return_if_fail(p != NULL); g_return_if_fail(s != NULL); @@ -271,7 +270,7 @@ static void stream_underflow_cb(pa_stream *s, void *userdata) static void create_playback(SpicePulse *pulse) { - SpicePulsePrivate *p = SPICE_PULSE_GET_PRIVATE(pulse); + SpicePulsePrivate *p = pulse->priv; pa_stream_flags_t flags; pa_buffer_attr buffer_attr = { 0, }; @@ -304,7 +303,7 @@ static void playback_start(SpicePlaybackChannel *channel, gint format, gint chan gint frequency, gpointer data) { SpicePulse *pulse = data; - SpicePulsePrivate *p = SPICE_PULSE_GET_PRIVATE(pulse); + SpicePulsePrivate *p = pulse->priv; pa_context_state_t state; g_return_if_fail(p != NULL); @@ -348,7 +347,7 @@ static void playback_data(SpicePlaybackChannel *channel, gpointer data) { SpicePulse *pulse = data; - SpicePulsePrivate *p = SPICE_PULSE_GET_PRIVATE(pulse); + SpicePulsePrivate *p = pulse->priv; pa_stream_state_t state; if (!p->playback.stream) @@ -396,9 +395,8 @@ static void stream_update_timing_callback(pa_stream *s, int success, void *userd { pa_usec_t usec; int negative = 0; - SpicePulsePrivate *p; - - p = SPICE_PULSE_GET_PRIVATE(userdata); + SpicePulse *pulse = SPICE_PULSE(userdata); + SpicePulsePrivate *p = pulse->priv; g_return_if_fail(s != NULL); g_return_if_fail(p != NULL); @@ -435,7 +433,7 @@ static void playback_get_delay(SpicePlaybackChannel *channel, gpointer data) static void stream_read_callback(pa_stream *s, size_t length, void *data) { SpicePulse *pulse = data; - SpicePulsePrivate *p = SPICE_PULSE_GET_PRIVATE(pulse); + SpicePulsePrivate *p = pulse->priv; g_return_if_fail(p != NULL); @@ -467,7 +465,7 @@ static void stream_read_callback(pa_stream *s, size_t length, void *data) static void create_record(SpicePulse *pulse) { - SpicePulsePrivate *p = SPICE_PULSE_GET_PRIVATE(pulse); + SpicePulsePrivate *p = pulse->priv; pa_buffer_attr buffer_attr = { 0, }; pa_stream_flags_t flags; @@ -499,7 +497,7 @@ static void record_start(SpiceRecordChannel *channel, gint format, gint channels gint frequency, gpointer data) { SpicePulse *pulse = data; - SpicePulsePrivate *p = SPICE_PULSE_GET_PRIVATE(pulse); + SpicePulsePrivate *p = pulse->priv; pa_context_state_t state; p->record.started = TRUE; @@ -748,8 +746,8 @@ static gboolean connect_channel(SpiceAudio *audio, SpiceChannel *channel) static void context_state_callback(pa_context *c, void *userdata) { - SpicePulsePrivate *p; - p = SPICE_PULSE_GET_PRIVATE(userdata); + SpicePulse *pulse = SPICE_PULSE(userdata); + SpicePulsePrivate *p = pulse->priv; g_return_if_fail(p != NULL); g_return_if_fail(c != NULL); @@ -762,10 +760,10 @@ static void context_state_callback(pa_context *c, void *userdata) case PA_CONTEXT_READY: { if (!p->record.stream && p->record.started) - create_record(SPICE_PULSE(userdata)); + create_record(pulse); if (!p->playback.stream && p->playback.started) - create_playback(SPICE_PULSE(userdata)); + create_playback(pulse); break; } @@ -791,7 +789,7 @@ SpicePulse *spice_pulse_new(SpiceSession *session, GMainContext *context, "session", session, "main-context", context, NULL); - p = SPICE_PULSE_GET_PRIVATE(pulse); + p = pulse->priv; p->mainloop = pa_glib_mainloop_new(context); p->state = PA_CONTEXT_READY; diff --git a/gtk/spice-session.c b/gtk/spice-session.c index 526d05b..260279f 100644 --- a/gtk/spice-session.c +++ b/gtk/spice-session.c @@ -185,7 +185,7 @@ spice_session_dispose(GObject *gobject) G_GNUC_INTERNAL void spice_session_palettes_clear(SpiceSession *session) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; g_return_if_fail(s != NULL); for (;;) { @@ -199,7 +199,7 @@ void spice_session_palettes_clear(SpiceSession *session) G_GNUC_INTERNAL void spice_session_images_clear(SpiceSession *session) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; g_return_if_fail(s != NULL); for (;;) { @@ -215,7 +215,7 @@ static void spice_session_finalize(GObject *gobject) { SpiceSession *session = SPICE_SESSION(gobject); - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; /* release stuff */ g_free(s->host); @@ -247,7 +247,7 @@ spice_session_finalize(GObject *gobject) static int spice_uri_create(SpiceSession *session, char *dest, int len) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; int pos = 0; if (s->host == NULL || (s->port == NULL && s->tls_port == NULL)) { @@ -264,7 +264,7 @@ static int spice_uri_create(SpiceSession *session, char *dest, int len) static int spice_uri_parse(SpiceSession *session, const char *original_uri) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; gchar *host = NULL, *port = NULL, *tls_port = NULL, *uri = NULL, *password = NULL; gchar *path = NULL; gchar *unescaped_path = NULL; @@ -401,7 +401,7 @@ static void spice_session_get_property(GObject *gobject, GParamSpec *pspec) { SpiceSession *session = SPICE_SESSION(gobject); - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; char buf[256]; int len; @@ -497,7 +497,7 @@ static void spice_session_set_property(GObject *gobject, GParamSpec *pspec) { SpiceSession *session = SPICE_SESSION(gobject); - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; const char *str; switch (prop_id) { @@ -1133,7 +1133,7 @@ SpiceSession *spice_session_new_from_session(SpiceSession *session) **/ gboolean spice_session_connect(SpiceSession *session) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; g_return_val_if_fail(s != NULL, FALSE); @@ -1165,7 +1165,7 @@ gboolean spice_session_connect(SpiceSession *session) **/ gboolean spice_session_open_fd(SpiceSession *session, int fd) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; g_return_val_if_fail(s != NULL, FALSE); g_return_val_if_fail(fd >= -1, FALSE); @@ -1185,7 +1185,7 @@ gboolean spice_session_open_fd(SpiceSession *session, int fd) G_GNUC_INTERNAL gboolean spice_session_get_client_provided_socket(SpiceSession *session) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; g_return_val_if_fail(s != NULL, FALSE); return s->client_provided_sockets; @@ -1194,7 +1194,7 @@ gboolean spice_session_get_client_provided_socket(SpiceSession *session) G_GNUC_INTERNAL void spice_session_switching_disconnect(SpiceSession *self) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(self); + SpiceSessionPrivate *s = self->priv; struct channel *item; RingItem *ring, *next; @@ -1222,8 +1222,8 @@ void spice_session_set_migration(SpiceSession *session, SpiceSession *migration, gboolean full_migration) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); - SpiceSessionPrivate *m = SPICE_SESSION_GET_PRIVATE(migration); + SpiceSessionPrivate *s = session->priv; + SpiceSessionPrivate *m = migration->priv; gchar *tmp; g_return_if_fail(s != NULL); @@ -1283,7 +1283,7 @@ SpiceChannel* spice_session_lookup_channel(SpiceSession *session, gint id, gint G_GNUC_INTERNAL void spice_session_abort_migration(SpiceSession *session) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; RingItem *ring, *next; struct channel *c; @@ -1321,7 +1321,7 @@ void spice_session_abort_migration(SpiceSession *session) G_GNUC_INTERNAL void spice_session_channel_migrate(SpiceSession *session, SpiceChannel *channel) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; SpiceChannel *c; gint id, type; @@ -1453,7 +1453,7 @@ gboolean spice_session_get_read_only(SpiceSession *self) **/ void spice_session_disconnect(SpiceSession *session) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; struct channel *item; RingItem *ring, *next; @@ -1494,7 +1494,7 @@ void spice_session_disconnect(SpiceSession *session) **/ GList *spice_session_get_channels(SpiceSession *session) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; struct channel *item; GList *list = NULL; RingItem *ring; @@ -1521,7 +1521,7 @@ GList *spice_session_get_channels(SpiceSession *session) **/ gboolean spice_session_has_channel_type(SpiceSession *session, gint type) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; struct channel *item; RingItem *ring; @@ -1585,7 +1585,7 @@ G_GNUC_INTERNAL GSocket* spice_session_channel_open_host(SpiceSession *session, SpiceChannel *channel, gboolean use_tls) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; GSocketConnectable *addr; GSocketAddressEnumerator *enumerator; GSocketAddress *sockaddr; @@ -1627,7 +1627,7 @@ GSocket* spice_session_channel_open_host(SpiceSession *session, SpiceChannel *ch G_GNUC_INTERNAL void spice_session_channel_new(SpiceSession *session, SpiceChannel *channel) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; struct channel *item; g_return_if_fail(s != NULL); @@ -1658,7 +1658,7 @@ void spice_session_channel_new(SpiceSession *session, SpiceChannel *channel) G_GNUC_INTERNAL void spice_session_channel_destroy(SpiceSession *session, SpiceChannel *channel) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; struct channel *item = NULL; RingItem *ring; @@ -1691,7 +1691,7 @@ void spice_session_channel_destroy(SpiceSession *session, SpiceChannel *channel) G_GNUC_INTERNAL void spice_session_set_connection_id(SpiceSession *session, int id) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; g_return_if_fail(s != NULL); @@ -1701,7 +1701,7 @@ void spice_session_set_connection_id(SpiceSession *session, int id) G_GNUC_INTERNAL int spice_session_get_connection_id(SpiceSession *session) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; g_return_val_if_fail(s != NULL, -1); @@ -1723,7 +1723,7 @@ static guint64 g_get_monotonic_time(void) G_GNUC_INTERNAL guint32 spice_session_get_mm_time(SpiceSession *session) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; g_return_val_if_fail(s != NULL, 0); @@ -1735,7 +1735,7 @@ guint32 spice_session_get_mm_time(SpiceSession *session) G_GNUC_INTERNAL void spice_session_set_mm_time(SpiceSession *session, guint32 time) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; g_return_if_fail(s != NULL); @@ -1761,7 +1761,7 @@ void spice_session_set_port(SpiceSession *session, int port, gboolean tls) G_GNUC_INTERNAL void spice_session_get_pubkey(SpiceSession *session, guint8 **pubkey, guint *size) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; g_return_if_fail(s != NULL); g_return_if_fail(pubkey != NULL); @@ -1774,7 +1774,7 @@ void spice_session_get_pubkey(SpiceSession *session, guint8 **pubkey, guint *siz G_GNUC_INTERNAL guint spice_session_get_verify(SpiceSession *session) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; g_return_val_if_fail(s != NULL, 0); return s->verify; @@ -1783,7 +1783,7 @@ guint spice_session_get_verify(SpiceSession *session) G_GNUC_INTERNAL void spice_session_set_migration_state(SpiceSession *session, SpiceSessionMigration state) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; g_return_if_fail(s != NULL); s->migration_state = state; @@ -1793,7 +1793,7 @@ void spice_session_set_migration_state(SpiceSession *session, SpiceSessionMigrat G_GNUC_INTERNAL const gchar* spice_session_get_password(SpiceSession *session) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; g_return_val_if_fail(s != NULL, NULL); return s->password; @@ -1802,7 +1802,7 @@ const gchar* spice_session_get_password(SpiceSession *session) G_GNUC_INTERNAL const gchar* spice_session_get_host(SpiceSession *session) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; g_return_val_if_fail(s != NULL, NULL); return s->host; @@ -1811,7 +1811,7 @@ const gchar* spice_session_get_host(SpiceSession *session) G_GNUC_INTERNAL const gchar* spice_session_get_cert_subject(SpiceSession *session) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; g_return_val_if_fail(s != NULL, NULL); return s->cert_subject; @@ -1820,7 +1820,7 @@ const gchar* spice_session_get_cert_subject(SpiceSession *session) G_GNUC_INTERNAL const gchar* spice_session_get_ciphers(SpiceSession *session) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; g_return_val_if_fail(s != NULL, NULL); return s->ciphers; @@ -1829,7 +1829,7 @@ const gchar* spice_session_get_ciphers(SpiceSession *session) G_GNUC_INTERNAL const gchar* spice_session_get_ca_file(SpiceSession *session) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; g_return_val_if_fail(s != NULL, NULL); return s->ca_file; @@ -1841,7 +1841,7 @@ void spice_session_get_caches(SpiceSession *session, display_cache **palettes, SpiceGlzDecoderWindow **glz_window) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; g_return_if_fail(s != NULL); @@ -1858,7 +1858,7 @@ void spice_session_set_caches_hints(SpiceSession *session, uint32_t pci_ram_size, uint32_t display_channels_count) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; g_return_if_fail(s != NULL); @@ -1880,7 +1880,7 @@ void spice_session_set_caches_hints(SpiceSession *session, G_GNUC_INTERNAL void spice_session_set_uuid(SpiceSession *session, guint8 uuid[16]) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; g_return_if_fail(s != NULL); memcpy(s->uuid, uuid, sizeof(s->uuid)); @@ -1891,7 +1891,7 @@ void spice_session_set_uuid(SpiceSession *session, guint8 uuid[16]) G_GNUC_INTERNAL void spice_session_set_name(SpiceSession *session, const gchar *name) { - SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session); + SpiceSessionPrivate *s = session->priv; g_return_if_fail(s != NULL); g_free(s->name); diff --git a/gtk/spice-widget-cairo.c b/gtk/spice-widget-cairo.c index 9ddbe51..618eaeb 100644 --- a/gtk/spice-widget-cairo.c +++ b/gtk/spice-widget-cairo.c @@ -35,7 +35,7 @@ static inline void gdk_drawable_get_size(GdkWindow *w, gint *ww, gint *wh) G_GNUC_INTERNAL int spicex_image_create(SpiceDisplay *display) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; if (d->ximage != NULL) return 0; @@ -61,7 +61,7 @@ int spicex_image_create(SpiceDisplay *display) G_GNUC_INTERNAL void spicex_image_destroy(SpiceDisplay *display) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; if (d->ximage) { cairo_surface_finish(d->ximage); @@ -85,7 +85,7 @@ void spicex_image_destroy(SpiceDisplay *display) G_GNUC_INTERNAL void spicex_draw_event(SpiceDisplay *display, cairo_t *cr) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; cairo_rectangle_int_t rect; cairo_region_t *region; double s; @@ -170,6 +170,6 @@ void spicex_expose_event(SpiceDisplay *display, GdkEventExpose *expose) G_GNUC_INTERNAL gboolean spicex_is_scaled(SpiceDisplay *display) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; return d->allow_scaling; } diff --git a/gtk/spice-widget-x11.c b/gtk/spice-widget-x11.c index 05b8d56..cc08eb2 100644 --- a/gtk/spice-widget-x11.c +++ b/gtk/spice-widget-x11.c @@ -121,7 +121,7 @@ static int catch_no_mitshm(Display * dpy, XErrorEvent * event) G_GNUC_INTERNAL int spicex_image_create(SpiceDisplay *display) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; if (d->ximage != NULL) return 0; @@ -191,7 +191,7 @@ int spicex_image_create(SpiceDisplay *display) G_GNUC_INTERNAL void spicex_image_destroy(SpiceDisplay *display) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; if (d->ximage) { /* avoid XDestroy to free shared memory, owned and freed by @@ -222,7 +222,7 @@ G_GNUC_INTERNAL void spicex_expose_event(SpiceDisplay *display, GdkEventExpose *expose) { GdkDrawable *window = gtk_widget_get_window(GTK_WIDGET(display)); - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; int x, y, w, h; spice_display_get_scaling(display, NULL, &x, &y, &w, &h); diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c index cdcff03..bea4f70 100644 --- a/gtk/spice-widget.c +++ b/gtk/spice-widget.c @@ -143,7 +143,7 @@ static void spice_display_get_property(GObject *object, GParamSpec *pspec) { SpiceDisplay *display = SPICE_DISPLAY(object); - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; gboolean boolean; switch (prop_id) { @@ -195,7 +195,7 @@ static void spice_display_get_property(GObject *object, static void scaling_updated(SpiceDisplay *display) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; GdkWindow *window = gtk_widget_get_window(GTK_WIDGET(display)); recalc_geometry(GTK_WIDGET(display)); @@ -206,7 +206,7 @@ static void scaling_updated(SpiceDisplay *display) static void update_size_request(SpiceDisplay *display) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; gint reqwidth, reqheight; if (d->resize_guest_enable) { @@ -223,7 +223,7 @@ static void update_size_request(SpiceDisplay *display) static void update_keyboard_focus(SpiceDisplay *display, gboolean state) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; d->keyboard_have_focus = state; @@ -239,7 +239,7 @@ static void update_keyboard_focus(SpiceDisplay *display, gboolean state) static void update_ready(SpiceDisplay *display) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; gboolean ready; ready = d->mark != 0 && d->monitor_ready; @@ -264,7 +264,7 @@ static void set_monitor_ready(SpiceDisplay *self, gboolean ready) static void update_monitor_area(SpiceDisplay *display) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; SpiceDisplayMonitorConfig *c; GArray *monitors = NULL; @@ -307,7 +307,7 @@ static void spice_display_set_property(GObject *object, GParamSpec *pspec) { SpiceDisplay *display = SPICE_DISPLAY(object); - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; switch (prop_id) { case PROP_SESSION: @@ -380,7 +380,7 @@ static void session_inhibit_keyboard_grab_changed(GObject *gobject, gpointer user_data) { SpiceDisplay *display = user_data; - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; g_object_get(d->session, "inhibit-keyboard-grab", &d->keyboard_grab_inhibit, NULL); @@ -391,7 +391,7 @@ static void session_inhibit_keyboard_grab_changed(GObject *gobject, static void spice_display_dispose(GObject *obj) { SpiceDisplay *display = SPICE_DISPLAY(obj); - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; SPICE_DEBUG("spice display dispose"); @@ -410,7 +410,7 @@ static void spice_display_dispose(GObject *obj) static void spice_display_finalize(GObject *obj) { SpiceDisplay *display = SPICE_DISPLAY(obj); - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; SPICE_DEBUG("Finalize spice display"); @@ -512,7 +512,7 @@ spice_display_constructor(GType gtype, } display = SPICE_DISPLAY(obj); - d = SPICE_DISPLAY_GET_PRIVATE(display); + d = display->priv; if (!d->session) g_error("SpiceDisplay constructed without a session"); @@ -554,7 +554,7 @@ spice_display_constructor(GType gtype, **/ void spice_display_set_grab_keys(SpiceDisplay *display, SpiceGrabSequence *seq) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; g_return_if_fail(d != NULL); if (d->grabseq) { @@ -607,7 +607,7 @@ static LRESULT CALLBACK keyboard_hook_cb(int code, WPARAM wparam, LPARAM lparam) **/ SpiceGrabSequence *spice_display_get_grab_keys(SpiceDisplay *display) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; g_return_val_if_fail(d != NULL, NULL); return d->grabseq; @@ -616,7 +616,7 @@ SpiceGrabSequence *spice_display_get_grab_keys(SpiceDisplay *display) static void try_keyboard_grab(SpiceDisplay *display) { GtkWidget *widget = GTK_WIDGET(display); - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; GdkGrabStatus status; if (g_getenv("SPICE_NOGRAB")) @@ -659,7 +659,7 @@ static void try_keyboard_grab(SpiceDisplay *display) static void try_keyboard_ungrab(SpiceDisplay *display) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; GtkWidget *widget = GTK_WIDGET(display); if (!d->keyboard_grab_active) @@ -679,7 +679,7 @@ static void try_keyboard_ungrab(SpiceDisplay *display) static void update_keyboard_grab(SpiceDisplay *display) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; if (d->keyboard_grab_enable && !d->keyboard_grab_inhibit && @@ -691,7 +691,7 @@ static void update_keyboard_grab(SpiceDisplay *display) static void set_mouse_accel(SpiceDisplay *display, gboolean enabled) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; #if defined GDK_WINDOWING_X11 GdkWindow *w = GDK_WINDOW(gtk_widget_get_window(GTK_WIDGET(display))); @@ -727,7 +727,7 @@ static void set_mouse_accel(SpiceDisplay *display, gboolean enabled) static GdkGrabStatus do_pointer_grab(SpiceDisplay *display) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; GdkWindow *window = GDK_WINDOW(gtk_widget_get_window(GTK_WIDGET(display))); GdkGrabStatus status; GdkCursor *blank = get_blank_cursor(); @@ -783,7 +783,7 @@ static GdkGrabStatus do_pointer_grab(SpiceDisplay *display) static void update_mouse_pointer(SpiceDisplay *display) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; GdkWindow *window = GDK_WINDOW(gtk_widget_get_window(GTK_WIDGET(display))); if (!window) @@ -806,7 +806,7 @@ static void update_mouse_pointer(SpiceDisplay *display) static void try_mouse_grab(SpiceDisplay *display) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; if (g_getenv("SPICE_NOGRAB")) return; @@ -834,7 +834,7 @@ static void try_mouse_grab(SpiceDisplay *display) static void mouse_wrap(SpiceDisplay *display, GdkEventMotion *motion) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; GdkScreen *screen = gtk_widget_get_screen(GTK_WIDGET(display)); gint xr = gdk_screen_get_width(screen) / 2; @@ -853,7 +853,7 @@ static void mouse_wrap(SpiceDisplay *display, GdkEventMotion *motion) static void try_mouse_ungrab(SpiceDisplay *display) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; if (!d->mouse_grab_active) return; @@ -872,7 +872,7 @@ static void try_mouse_ungrab(SpiceDisplay *display) static void update_mouse_grab(SpiceDisplay *display) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; if (d->mouse_grab_enable && !d->keyboard_grab_inhibit && @@ -884,7 +884,7 @@ static void update_mouse_grab(SpiceDisplay *display) static gint get_display_id(SpiceDisplay *display) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; /* supported monitor_id only with display channel #0 */ if (d->channel_id == 0 && d->monitor_id >= 0) @@ -898,7 +898,7 @@ static gint get_display_id(SpiceDisplay *display) static void recalc_geometry(GtkWidget *widget) { SpiceDisplay *display = SPICE_DISPLAY(widget); - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; gdouble zoom = 1.0; if (spicex_is_scaled(display)) @@ -931,7 +931,7 @@ static void recalc_geometry(GtkWidget *widget) static gboolean do_color_convert(SpiceDisplay *display, GdkRectangle *r) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; guint32 *dest = d->data; guint16 *src = d->data_origin; gint x, y; @@ -971,7 +971,7 @@ static gboolean do_color_convert(SpiceDisplay *display, GdkRectangle *r) static gboolean draw_event(GtkWidget *widget, cairo_t *cr) { SpiceDisplay *display = SPICE_DISPLAY(widget); - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; g_return_val_if_fail(d != NULL, false); if (d->mark == 0 || d->data == NULL || @@ -988,7 +988,7 @@ static gboolean draw_event(GtkWidget *widget, cairo_t *cr) static gboolean expose_event(GtkWidget *widget, GdkEventExpose *expose) { SpiceDisplay *display = SPICE_DISPLAY(widget); - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; g_return_val_if_fail(d != NULL, false); if (d->mark == 0 || d->data == NULL || @@ -1011,7 +1011,7 @@ typedef enum { static void key_press_and_release(SpiceDisplay *display) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; if (d->key_delayed_scancode == 0) return; @@ -1045,7 +1045,7 @@ static gboolean key_press_delayed(gpointer data) static void send_key(SpiceDisplay *display, int scancode, SendKeyType type, gboolean press_delayed) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; uint32_t i, b, m; g_return_if_fail(scancode != 0); @@ -1100,7 +1100,7 @@ static void send_key(SpiceDisplay *display, int scancode, SendKeyType type, gboo static void release_keys(SpiceDisplay *display) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; uint32_t i, b; SPICE_DEBUG("%s", __FUNCTION__); @@ -1116,7 +1116,7 @@ static void release_keys(SpiceDisplay *display) static gboolean check_for_grab_key(SpiceDisplay *display, int type, int keyval) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; int i; if (!d->grabseq->nkeysyms) @@ -1149,7 +1149,7 @@ static gboolean check_for_grab_key(SpiceDisplay *display, int type, int keyval) static gboolean key_event(GtkWidget *widget, GdkEventKey *key) { SpiceDisplay *display = SPICE_DISPLAY(widget); - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; int scancode; #ifdef WIN32 @@ -1199,7 +1199,7 @@ static gboolean key_event(GtkWidget *widget, GdkEventKey *key) static guint get_scancode_from_keyval(SpiceDisplay *display, guint keyval) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; guint keycode = 0; GdkKeymapKey *keys = NULL; gint n_keys = 0; @@ -1241,7 +1241,7 @@ void spice_display_send_keys(SpiceDisplay *display, const guint *keyvals, static gboolean enter_event(GtkWidget *widget, GdkEventCrossing *crossing G_GNUC_UNUSED) { SpiceDisplay *display = SPICE_DISPLAY(widget); - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; SPICE_DEBUG("%s", __FUNCTION__); d->mouse_have_pointer = true; @@ -1252,7 +1252,7 @@ static gboolean enter_event(GtkWidget *widget, GdkEventCrossing *crossing G_GNUC static gboolean leave_event(GtkWidget *widget, GdkEventCrossing *crossing G_GNUC_UNUSED) { SpiceDisplay *display = SPICE_DISPLAY(widget); - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; SPICE_DEBUG("%s", __FUNCTION__); @@ -1268,7 +1268,7 @@ static gboolean leave_event(GtkWidget *widget, GdkEventCrossing *crossing G_GNUC static gboolean focus_in_event(GtkWidget *widget, GdkEventFocus *focus G_GNUC_UNUSED) { SpiceDisplay *display = SPICE_DISPLAY(widget); - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; SPICE_DEBUG("%s", __FUNCTION__); @@ -1293,7 +1293,7 @@ static gboolean focus_in_event(GtkWidget *widget, GdkEventFocus *focus G_GNUC_UN static gboolean focus_out_event(GtkWidget *widget, GdkEventFocus *focus G_GNUC_UNUSED) { SpiceDisplay *display = SPICE_DISPLAY(widget); - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; SPICE_DEBUG("%s", __FUNCTION__); @@ -1379,7 +1379,7 @@ void spicex_transform_input (SpiceDisplay *display, static gboolean motion_event(GtkWidget *widget, GdkEventMotion *motion) { SpiceDisplay *display = SPICE_DISPLAY(widget); - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; int x, y; if (!d->inputs) @@ -1423,7 +1423,7 @@ static gboolean scroll_event(GtkWidget *widget, GdkEventScroll *scroll) { int button; SpiceDisplay *display = SPICE_DISPLAY(widget); - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; SPICE_DEBUG("%s", __FUNCTION__); @@ -1451,7 +1451,7 @@ static gboolean scroll_event(GtkWidget *widget, GdkEventScroll *scroll) static gboolean button_event(GtkWidget *widget, GdkEventButton *button) { SpiceDisplay *display = SPICE_DISPLAY(widget); - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; int x, y; SPICE_DEBUG("%s %s: button %d, state 0x%x", __FUNCTION__, @@ -1513,7 +1513,7 @@ static gboolean button_event(GtkWidget *widget, GdkEventButton *button) static gboolean configure_event(GtkWidget *widget, GdkEventConfigure *conf) { SpiceDisplay *display = SPICE_DISPLAY(widget); - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; if (conf->width != d->ww || conf->height != d->wh) { d->ww = conf->width; @@ -1525,7 +1525,7 @@ static gboolean configure_event(GtkWidget *widget, GdkEventConfigure *conf) static void update_image(SpiceDisplay *display) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; spicex_image_create(display); if (d->convert) @@ -1838,7 +1838,7 @@ static void spice_display_class_init(SpiceDisplayClass *klass) static void update_mouse_mode(SpiceChannel *channel, gpointer data) { SpiceDisplay *display = data; - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; g_object_get(channel, "mouse-mode", &d->mouse_mode, NULL); SPICE_DEBUG("mouse mode %d", d->mouse_mode); @@ -1861,7 +1861,7 @@ static void update_mouse_mode(SpiceChannel *channel, gpointer data) static void update_area(SpiceDisplay *display, gint x, gint y, gint width, gint height) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; GdkRectangle primary = { .x = 0, .y = 0, @@ -1899,7 +1899,7 @@ static void primary_create(SpiceChannel *channel, gint format, gint shmid, gpointer imgdata, gpointer data) { SpiceDisplay *display = data; - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; d->format = format; d->stride = stride; @@ -1914,7 +1914,7 @@ static void primary_create(SpiceChannel *channel, gint format, static void primary_destroy(SpiceChannel *channel, gpointer data) { SpiceDisplay *display = SPICE_DISPLAY(data); - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; spicex_image_destroy(display); d->width = 0; @@ -1930,7 +1930,7 @@ static void invalidate(SpiceChannel *channel, gint x, gint y, gint w, gint h, gpointer data) { SpiceDisplay *display = data; - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; int display_x, display_y; int x1, y1, x2, y2; double s; @@ -1966,7 +1966,7 @@ static void invalidate(SpiceChannel *channel, static void mark(SpiceDisplay *display, gint mark) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; g_return_if_fail(d != NULL); SPICE_DEBUG("widget mark: %d, %d:%d %p", mark, d->channel_id, d->monitor_id, display); @@ -1979,7 +1979,7 @@ static void cursor_set(SpiceCursorChannel *channel, gpointer rgba, gpointer data) { SpiceDisplay *display = data; - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; GdkCursor *cursor = NULL; cursor_invalidate(display); @@ -2025,7 +2025,7 @@ static void cursor_set(SpiceCursorChannel *channel, static void cursor_hide(SpiceCursorChannel *channel, gpointer data) { SpiceDisplay *display = data; - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; if (d->show_cursor != NULL) /* then we are already hidden */ return; @@ -2148,7 +2148,7 @@ static void cursor_reset(SpiceCursorChannel *channel, gpointer data) static void channel_new(SpiceSession *s, SpiceChannel *channel, gpointer data) { SpiceDisplay *display = data; - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; int id; g_object_get(channel, "channel-id", &id, NULL); @@ -2222,7 +2222,7 @@ static void channel_new(SpiceSession *s, SpiceChannel *channel, gpointer data) static void channel_destroy(SpiceSession *s, SpiceChannel *channel, gpointer data) { SpiceDisplay *display = data; - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; int id; g_object_get(channel, "channel-id", &id, NULL); @@ -2315,7 +2315,7 @@ void spice_display_mouse_ungrab(SpiceDisplay *display) **/ void spice_display_copy_to_guest(SpiceDisplay *display) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; g_return_if_fail(d->gtk_session != NULL); @@ -2332,7 +2332,7 @@ void spice_display_copy_to_guest(SpiceDisplay *display) **/ void spice_display_paste_from_guest(SpiceDisplay *display) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; g_return_if_fail(d->gtk_session != NULL); @@ -2349,7 +2349,7 @@ void spice_display_paste_from_guest(SpiceDisplay *display) **/ GdkPixbuf *spice_display_get_pixbuf(SpiceDisplay *display) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; GdkPixbuf *pixbuf; int x, y; guchar *src, *data, *dest; @@ -2401,7 +2401,7 @@ static guint32 get_keyboard_lock_modifiers(Display *x_display) static void sync_keyboard_lock_modifiers(SpiceDisplay *display) { Display *x_display; - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; guint32 modifiers; GdkWindow *w; @@ -2499,7 +2499,7 @@ static guint32 get_keyboard_lock_modifiers(void) static void sync_keyboard_lock_modifiers(SpiceDisplay *display) { - SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); + SpiceDisplayPrivate *d = display->priv; guint32 modifiers; GdkWindow *w; diff --git a/spice-common b/spice-common --- a/spice-common +++ b/spice-common @@ -1 +1 @@ -Subproject commit 8543d04cd238638ac54912f29a0990915ff51b6d +Subproject commit 8543d04cd238638ac54912f29a0990915ff51b6d-dirty