diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2013-06-22 19:13:45 +0100 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2013-06-23 16:06:05 +0100 |
commit | 0ddbcae394fd661b539cf03bf1830d6935d18db1 (patch) | |
tree | 17349f92e73ef14741bc431ba62c4621ebeee1d6 /plugins | |
parent | ddb451a71569bdd6b7d9a673d12e8e83eddb818e (diff) |
console: rename ConsoleSidecar to ConsoleChannel
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Makefile.am | 4 | ||||
-rw-r--r-- | plugins/console/channel-manager.c | 6 | ||||
-rw-r--r-- | plugins/console/channel.c (renamed from plugins/console/sidecar.c) | 86 | ||||
-rw-r--r-- | plugins/console/channel.h | 53 | ||||
-rw-r--r-- | plugins/console/plugin.c | 2 | ||||
-rw-r--r-- | plugins/console/sidecar.h | 53 |
6 files changed, 102 insertions, 102 deletions
diff --git a/plugins/Makefile.am b/plugins/Makefile.am index 8cdbb423c..2b0007901 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -64,12 +64,12 @@ libgateways_la_SOURCES = \ libconsole_la_SOURCES = \ console/channel-manager.c \ console/channel-manager.h \ + console/channel.c \ + console/channel.h \ console/debug.c \ console/debug.h \ console/plugin.c \ console/plugin.h \ - console/sidecar.c \ - console/sidecar.h \ $(NULL) AM_CFLAGS = $(ERROR_CFLAGS) \ diff --git a/plugins/console/channel-manager.c b/plugins/console/channel-manager.c index b2a17902d..f2be4f776 100644 --- a/plugins/console/channel-manager.c +++ b/plugins/console/channel-manager.c @@ -21,7 +21,7 @@ #include "console/channel-manager.h" #include "extensions/extensions.h" -#include "console/sidecar.h" +#include "console/channel.h" static void channel_manager_iface_init (gpointer, gpointer); @@ -139,7 +139,7 @@ gabble_console_channel_manager_type_foreach_channel_class (GType type, static void console_channel_closed_cb ( - GabbleConsoleSidecar *channel, + GabbleConsoleChannel *channel, gpointer user_data) { GabbleConsoleChannelManager *self = GABBLE_CONSOLE_CHANNEL_MANAGER (user_data); @@ -184,7 +184,7 @@ gabble_console_channel_manager_create_channel ( &error)) goto error; - channel = g_object_new (GABBLE_TYPE_CONSOLE_SIDECAR, + channel = g_object_new (GABBLE_TYPE_CONSOLE_CHANNEL, "connection", self->plugin_connection, NULL); tp_base_channel_register (channel); diff --git a/plugins/console/sidecar.c b/plugins/console/channel.c index b224b7f48..390920375 100644 --- a/plugins/console/sidecar.c +++ b/plugins/console/channel.c @@ -18,7 +18,7 @@ */ #include "config.h" -#include "console/sidecar.h" +#include "console/channel.h" #include <string.h> #include <wocky/wocky.h> @@ -32,7 +32,7 @@ enum { PROP_SPEW }; -struct _GabbleConsoleSidecarPrivate +struct _GabbleConsoleChannelPrivate { WockySession *session; WockyXmppReader *reader; @@ -52,22 +52,22 @@ struct _GabbleConsoleSidecarPrivate static void console_iface_init ( gpointer g_iface, gpointer data); -static void gabble_console_sidecar_set_spew ( - GabbleConsoleSidecar *self, +static void gabble_console_channel_set_spew ( + GabbleConsoleChannel *self, gboolean spew); -static void gabble_console_sidecar_close (TpBaseChannel *chan); +static void gabble_console_channel_close (TpBaseChannel *chan); -G_DEFINE_TYPE_WITH_CODE (GabbleConsoleSidecar, gabble_console_sidecar, +G_DEFINE_TYPE_WITH_CODE (GabbleConsoleChannel, gabble_console_channel, TP_TYPE_BASE_CHANNEL, G_IMPLEMENT_INTERFACE (GABBLE_TYPE_SVC_GABBLE_PLUGIN_CONSOLE, console_iface_init); ) static void -gabble_console_sidecar_init (GabbleConsoleSidecar *self) +gabble_console_channel_init (GabbleConsoleChannel *self) { - self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GABBLE_TYPE_CONSOLE_SIDECAR, - GabbleConsoleSidecarPrivate); + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GABBLE_TYPE_CONSOLE_CHANNEL, + GabbleConsoleChannelPrivate); self->priv->reader = wocky_xmpp_reader_new_no_stream_ns ( WOCKY_XMPP_NS_JABBER_CLIENT); self->priv->writer = wocky_xmpp_writer_new_no_stream (); @@ -75,11 +75,11 @@ gabble_console_sidecar_init (GabbleConsoleSidecar *self) static void -gabble_console_sidecar_constructed (GObject *object) +gabble_console_channel_constructed (GObject *object) { - GabbleConsoleSidecar *self = GABBLE_CONSOLE_SIDECAR (object); + GabbleConsoleChannel *self = GABBLE_CONSOLE_CHANNEL (object); void (*chain_up)(GObject *) = - G_OBJECT_CLASS (gabble_console_sidecar_parent_class)->constructed; + G_OBJECT_CLASS (gabble_console_channel_parent_class)->constructed; if (chain_up != NULL) chain_up (object); @@ -93,13 +93,13 @@ gabble_console_sidecar_constructed (GObject *object) } static void -gabble_console_sidecar_get_property ( +gabble_console_channel_get_property ( GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { - GabbleConsoleSidecar *self = GABBLE_CONSOLE_SIDECAR (object); + GabbleConsoleChannel *self = GABBLE_CONSOLE_CHANNEL (object); switch (property_id) { @@ -113,18 +113,18 @@ gabble_console_sidecar_get_property ( } static void -gabble_console_sidecar_set_property ( +gabble_console_channel_set_property ( GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { - GabbleConsoleSidecar *self = GABBLE_CONSOLE_SIDECAR (object); + GabbleConsoleChannel *self = GABBLE_CONSOLE_CHANNEL (object); switch (property_id) { case PROP_SPEW: - gabble_console_sidecar_set_spew (self, g_value_get_boolean (value)); + gabble_console_channel_set_spew (self, g_value_get_boolean (value)); break; default: @@ -133,13 +133,13 @@ gabble_console_sidecar_set_property ( } static void -gabble_console_sidecar_dispose (GObject *object) +gabble_console_channel_dispose (GObject *object) { void (*chain_up) (GObject *) = - G_OBJECT_CLASS (gabble_console_sidecar_parent_class)->dispose; - GabbleConsoleSidecar *self = GABBLE_CONSOLE_SIDECAR (object); + G_OBJECT_CLASS (gabble_console_channel_parent_class)->dispose; + GabbleConsoleChannel *self = GABBLE_CONSOLE_CHANNEL (object); - gabble_console_sidecar_set_spew (self, FALSE); + gabble_console_channel_set_spew (self, FALSE); tp_clear_object (&self->priv->reader); tp_clear_object (&self->priv->writer); @@ -150,7 +150,7 @@ gabble_console_sidecar_dispose (GObject *object) } static void -gabble_console_sidecar_class_init (GabbleConsoleSidecarClass *klass) +gabble_console_channel_class_init (GabbleConsoleChannelClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); TpBaseChannelClass *channel_class = TP_BASE_CHANNEL_CLASS (klass); @@ -159,15 +159,15 @@ gabble_console_sidecar_class_init (GabbleConsoleSidecarClass *klass) { NULL }, }; - object_class->constructed = gabble_console_sidecar_constructed; - object_class->get_property = gabble_console_sidecar_get_property; - object_class->set_property = gabble_console_sidecar_set_property; - object_class->dispose = gabble_console_sidecar_dispose; + object_class->constructed = gabble_console_channel_constructed; + object_class->get_property = gabble_console_channel_get_property; + object_class->set_property = gabble_console_channel_set_property; + object_class->dispose = gabble_console_channel_dispose; channel_class->channel_type = GABBLE_IFACE_GABBLE_PLUGIN_CONSOLE; - channel_class->close = gabble_console_sidecar_close; + channel_class->close = gabble_console_channel_close; - g_type_class_add_private (klass, sizeof (GabbleConsoleSidecarPrivate)); + g_type_class_add_private (klass, sizeof (GabbleConsoleChannelPrivate)); g_object_class_install_property (object_class, PROP_SPEW, g_param_spec_boolean ("spew-stanzas", "SpewStanzas", @@ -183,11 +183,11 @@ gabble_console_sidecar_class_init (GabbleConsoleSidecarClass *klass) } static void -gabble_console_sidecar_close (TpBaseChannel *chan) +gabble_console_channel_close (TpBaseChannel *chan) { - GabbleConsoleSidecar *self = GABBLE_CONSOLE_SIDECAR (chan); + GabbleConsoleChannel *self = GABBLE_CONSOLE_CHANNEL (chan); - gabble_console_sidecar_set_spew (self, FALSE); + gabble_console_channel_set_spew (self, FALSE); tp_base_channel_destroyed (chan); } @@ -197,7 +197,7 @@ incoming_cb ( WockyStanza *stanza, gpointer user_data) { - GabbleConsoleSidecar *self = GABBLE_CONSOLE_SIDECAR (user_data); + GabbleConsoleChannel *self = GABBLE_CONSOLE_CHANNEL (user_data); const guint8 *body; gsize length; @@ -213,7 +213,7 @@ sending_cb ( WockyStanza *stanza, gpointer user_data) { - GabbleConsoleSidecar *self = GABBLE_CONSOLE_SIDECAR (user_data); + GabbleConsoleChannel *self = GABBLE_CONSOLE_CHANNEL (user_data); if (stanza != NULL) { @@ -228,11 +228,11 @@ sending_cb ( } static void -gabble_console_sidecar_set_spew ( - GabbleConsoleSidecar *self, +gabble_console_channel_set_spew ( + GabbleConsoleChannel *self, gboolean spew) { - GabbleConsoleSidecarPrivate *priv = self->priv; + GabbleConsoleChannelPrivate *priv = self->priv; if (!spew != !priv->spew) { @@ -273,7 +273,7 @@ return_from_send_iq ( GAsyncResult *result, gpointer user_data) { - GabbleConsoleSidecar *self = GABBLE_CONSOLE_SIDECAR (source); + GabbleConsoleChannel *self = GABBLE_CONSOLE_CHANNEL (source); DBusGMethodInvocation *context = user_data; GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result); GError *error = NULL; @@ -372,12 +372,12 @@ validate_jid (const gchar **to, */ static gboolean parse_me_a_stanza ( - GabbleConsoleSidecar *self, + GabbleConsoleChannel *self, const gchar *xml, WockyStanza **stanza_out, GError **error) { - GabbleConsoleSidecarPrivate *priv = self->priv; + GabbleConsoleChannelPrivate *priv = self->priv; WockyStanza *stanza; wocky_xmpp_reader_reset (priv->reader); @@ -403,13 +403,13 @@ parse_me_a_stanza ( static void console_send_iq ( - GabbleSvcGabblePluginConsole *sidecar, + GabbleSvcGabblePluginConsole *channel, const gchar *type_str, const gchar *to, const gchar *body, DBusGMethodInvocation *context) { - GabbleConsoleSidecar *self = GABBLE_CONSOLE_SIDECAR (sidecar); + GabbleConsoleChannel *self = GABBLE_CONSOLE_CHANNEL (channel); WockyPorter *porter = wocky_session_get_porter (self->priv->session); WockyStanzaSubType sub_type; WockyStanza *fragment; @@ -489,11 +489,11 @@ stanza_looks_coherent ( static void console_send_stanza ( - GabbleSvcGabblePluginConsole *sidecar, + GabbleSvcGabblePluginConsole *channel, const gchar *xml, DBusGMethodInvocation *context) { - GabbleConsoleSidecar *self = GABBLE_CONSOLE_SIDECAR (sidecar); + GabbleConsoleChannel *self = GABBLE_CONSOLE_CHANNEL (channel); WockyPorter *porter = wocky_session_get_porter (self->priv->session); WockyStanza *stanza = NULL; GError *error = NULL; diff --git a/plugins/console/channel.h b/plugins/console/channel.h new file mode 100644 index 000000000..7e41c5ad2 --- /dev/null +++ b/plugins/console/channel.h @@ -0,0 +1,53 @@ +/* XML console plugin + * + * Copyright © 2011 Collabora Ltd. <http://www.collabora.co.uk/> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <glib-object.h> +#include <telepathy-glib/telepathy-glib.h> + +typedef struct _GabbleConsoleChannel GabbleConsoleChannel; +typedef struct _GabbleConsoleChannelClass GabbleConsoleChannelClass; +typedef struct _GabbleConsoleChannelPrivate GabbleConsoleChannelPrivate; + +struct _GabbleConsoleChannel { + TpBaseChannel parent; + + GabbleConsoleChannelPrivate *priv; +}; + +struct _GabbleConsoleChannelClass { + TpBaseChannelClass parent; +}; + +GType gabble_console_channel_get_type (void); + +#define GABBLE_TYPE_CONSOLE_CHANNEL \ + (gabble_console_channel_get_type ()) +#define GABBLE_CONSOLE_CHANNEL(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), GABBLE_TYPE_CONSOLE_CHANNEL, \ + GabbleConsoleChannel)) +#define GABBLE_CONSOLE_CHANNEL_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), GABBLE_TYPE_CONSOLE_CHANNEL, \ + GabbleConsoleChannelClass)) +#define GABBLE_IS_CONSOLE_CHANNEL(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GABBLE_TYPE_CONSOLE_CHANNEL)) +#define GABBLE_IS_CONSOLE_CHANNEL_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), GABBLE_TYPE_CONSOLE_CHANNEL)) +#define GABBLE_CONSOLE_CHANNEL_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_CONSOLE_CHANNEL, \ + GabbleConsoleChannelClass)) diff --git a/plugins/console/plugin.c b/plugins/console/plugin.c index 52386016d..c17cf71b0 100644 --- a/plugins/console/plugin.c +++ b/plugins/console/plugin.c @@ -26,8 +26,8 @@ #include "extensions/extensions.h" #include "console/channel-manager.h" +#include "console/channel.h" #include "console/debug.h" -#include "console/sidecar.h" static void plugin_iface_init ( gpointer g_iface, diff --git a/plugins/console/sidecar.h b/plugins/console/sidecar.h deleted file mode 100644 index 9045b1f02..000000000 --- a/plugins/console/sidecar.h +++ /dev/null @@ -1,53 +0,0 @@ -/* XML console plugin - * - * Copyright © 2011 Collabora Ltd. <http://www.collabora.co.uk/> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include <glib-object.h> -#include <telepathy-glib/telepathy-glib.h> - -typedef struct _GabbleConsoleSidecar GabbleConsoleSidecar; -typedef struct _GabbleConsoleSidecarClass GabbleConsoleSidecarClass; -typedef struct _GabbleConsoleSidecarPrivate GabbleConsoleSidecarPrivate; - -struct _GabbleConsoleSidecar { - TpBaseChannel parent; - - GabbleConsoleSidecarPrivate *priv; -}; - -struct _GabbleConsoleSidecarClass { - TpBaseChannelClass parent; -}; - -GType gabble_console_sidecar_get_type (void); - -#define GABBLE_TYPE_CONSOLE_SIDECAR \ - (gabble_console_sidecar_get_type ()) -#define GABBLE_CONSOLE_SIDECAR(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), GABBLE_TYPE_CONSOLE_SIDECAR, \ - GabbleConsoleSidecar)) -#define GABBLE_CONSOLE_SIDECAR_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), GABBLE_TYPE_CONSOLE_SIDECAR, \ - GabbleConsoleSidecarClass)) -#define GABBLE_IS_CONSOLE_SIDECAR(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GABBLE_TYPE_CONSOLE_SIDECAR)) -#define GABBLE_IS_CONSOLE_SIDECAR_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), GABBLE_TYPE_CONSOLE_SIDECAR)) -#define GABBLE_CONSOLE_SIDECAR_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_CONSOLE_SIDECAR, \ - GabbleConsoleSidecarClass)) |