From 930c4710953ad43360b5c28db5788450848059b7 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 29 Aug 2013 16:53:47 +0100 Subject: [PATCH 15/16] Remove the remains of McdTransportPlugin --- src/Makefile.am | 7 +- src/kludge-transport.c | 153 ------------------------------------------- src/kludge-transport.h | 63 ------------------ src/mcd-account-connection.c | 16 ----- src/mcd-account.c | 1 - src/mcd-account.h | 4 ++ src/mcd-connection-plugin.h | 48 -------------- src/mcd-master.c | 46 ------------- src/mcd-master.h | 13 ---- src/mcd-transport.c | 141 --------------------------------------- src/mcd-transport.h | 71 -------------------- 11 files changed, 5 insertions(+), 558 deletions(-) delete mode 100644 src/kludge-transport.c delete mode 100644 src/kludge-transport.h delete mode 100644 src/mcd-connection-plugin.h delete mode 100644 src/mcd-transport.c delete mode 100644 src/mcd-transport.h diff --git a/src/Makefile.am b/src/Makefile.am index 4d679cd..980fd80 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -26,12 +26,10 @@ mc_headers = \ mcd-master.h \ mcd-manager.h \ mcd-connection.h \ - mcd-connection-plugin.h \ mcd-connection-service-points.h \ mcd-channel.h \ mcd-dispatcher.h \ mcd-service.h \ - mcd-transport.h \ mcd-storage.h if ENABLE_LIBACCOUNTS_SSO @@ -137,8 +135,6 @@ libmcd_convenience_la_SOURCES = \ connectivity-monitor.c \ connectivity-monitor.h \ gtypes.c \ - kludge-transport.c \ - kludge-transport.h \ mcd-dbusprop.c \ mcd-dbusprop.h \ mcd-debug.c \ @@ -165,7 +161,6 @@ libmcd_convenience_la_SOURCES = \ mcd-service.c \ mcd-slacker.c \ mcd-slacker.h \ - mcd-transport.c \ mcd-storage.c \ mcd-storage.h \ plugin-dispatch-operation.c \ @@ -196,7 +191,7 @@ mcd-enum-types.h: stamp-mcd-enum-types.h $(AM_V_GEN)true stamp-mcd-enum-types.h: Makefile $(mc_headers) mcd-enum-types.c $(AM_V_GEN)( cd $(srcdir) && glib-mkenums \ - --fhead "#ifndef __MCD_ENUM_TYPES_H__\n#define __MCD_ENUM_TYPES_H__\n\n#include \"mcd-mission.h\"\n#include \"mcd-channel.h\"\n#include \"mcd-transport.h\"\n\nG_BEGIN_DECLS\n" \ + --fhead "#ifndef __MCD_ENUM_TYPES_H__\n#define __MCD_ENUM_TYPES_H__\n\n#include \"mcd-mission.h\"\n#include \"mcd-channel.h\"\n\nG_BEGIN_DECLS\n" \ --fprod "/* enumerations from \"@filename@\" */\n" \ --vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define MCD_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ --ftail "G_END_DECLS\n\n#endif /* __MCD_ENUM_TYPES_H__ */" \ diff --git a/src/kludge-transport.c b/src/kludge-transport.c deleted file mode 100644 index 5af099a..0000000 --- a/src/kludge-transport.c +++ /dev/null @@ -1,153 +0,0 @@ -/* - * kludge-transport.c - the shortest path to NM integration - * Copyright ©2011 Collabora Ltd. - * - * 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 "config.h" - -#include "kludge-transport.h" - -#include - -#include "mcd-debug.h" - -#include "connectivity-monitor.h" - -struct _McdKludgeTransportPrivate { - /* Rawr! I'm a mythical creature. */ - McdConnectivityMonitor *minotaur; - - /* Pointers representing network connections, exposed to the application as - * opaque McdTransport pointers. - * - * In this generate example of an McdTransportPlugin, we only have one - * transport, representing "the internet". So in fact this list always - * contains a single pointer, namely the McdKludgeTransport instance - * itself. - */ - GList *transports; -}; - -static void transport_iface_init ( - gpointer g_iface, - gpointer iface_data); - -G_DEFINE_TYPE_WITH_CODE (McdKludgeTransport, mcd_kludge_transport, - G_TYPE_OBJECT, - G_IMPLEMENT_INTERFACE (MCD_TYPE_TRANSPORT_PLUGIN, transport_iface_init); - ) - -static void -mcd_kludge_transport_init (McdKludgeTransport *self) -{ - self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, - MCD_TYPE_KLUDGE_TRANSPORT, McdKludgeTransportPrivate); -} - -static void -mcd_kludge_transport_constructed (GObject *object) -{ - McdKludgeTransport *self = MCD_KLUDGE_TRANSPORT (object); - McdKludgeTransportPrivate *priv = self->priv; - GObjectClass *parent_class = mcd_kludge_transport_parent_class; - - if (parent_class->constructed != NULL) - parent_class->constructed (object); - - /* We just use ourself as the McdTransport pointer... */ - priv->transports = g_list_prepend (NULL, self); -} - -static void -mcd_kludge_transport_dispose (GObject *object) -{ - McdKludgeTransport *self = MCD_KLUDGE_TRANSPORT (object); - McdKludgeTransportPrivate *priv = self->priv; - GObjectClass *parent_class = mcd_kludge_transport_parent_class; - - tp_clear_object (&priv->minotaur); - g_list_free (priv->transports); - priv->transports = NULL; - - if (parent_class->dispose != NULL) - parent_class->dispose (object); -} - -static void -mcd_kludge_transport_class_init (McdKludgeTransportClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - object_class->constructed = mcd_kludge_transport_constructed; - object_class->dispose = mcd_kludge_transport_dispose; - - g_type_class_add_private (klass, sizeof (McdKludgeTransportPrivate)); -} - -static const GList * -mcd_kludge_transport_get_transports ( - McdTransportPlugin *plugin) -{ - McdKludgeTransport *self = MCD_KLUDGE_TRANSPORT (plugin); - - g_return_val_if_fail (MCD_IS_KLUDGE_TRANSPORT (plugin), NULL); - - return self->priv->transports; -} - -static const gchar * -mcd_kludge_transport_get_transport_name ( - McdTransportPlugin *plugin, - McdTransport *transport) -{ - g_return_val_if_fail (MCD_IS_KLUDGE_TRANSPORT (plugin), NULL); - g_return_val_if_fail (plugin == (McdTransportPlugin *) transport, NULL); - - return "i love the internet"; -} - -static void -transport_iface_init ( - gpointer g_iface, - gpointer iface_data) -{ - McdTransportPluginIface *klass = g_iface; - - klass->get_transports = mcd_kludge_transport_get_transports; - klass->get_transport_name = mcd_kludge_transport_get_transport_name; -} - -static McdTransportPlugin * -mcd_kludge_transport_new (McdConnectivityMonitor *connectivity_monitor) -{ - McdKludgeTransport *self = g_object_new (MCD_TYPE_KLUDGE_TRANSPORT, NULL); - - /* Strictly speaking this should be done with properties, but I'm - * going to delete this class soon anyway. */ - self->priv->minotaur = connectivity_monitor; - - return MCD_TRANSPORT_PLUGIN (self); -} - -void -mcd_kludge_transport_install (McdMaster *master, - McdConnectivityMonitor *connectivity_monitor) -{ - McdTransportPlugin *self = mcd_kludge_transport_new (connectivity_monitor); - - mcd_master_register_transport (master, self); -} diff --git a/src/kludge-transport.h b/src/kludge-transport.h deleted file mode 100644 index b246f21..0000000 --- a/src/kludge-transport.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * kludge-transport.h - header for the shortest path to NM integration - * Copyright ©2011 Collabora Ltd. - * - * 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 - */ - -#ifndef MCD_KLUDGE_TRANSPORT_H -#define MCD_KLUDGE_TRANSPORT_H - -#include -#include "mcd-master.h" -#include "mcd-transport.h" -#include "connectivity-monitor.h" - -typedef struct _McdKludgeTransport McdKludgeTransport; -typedef struct _McdKludgeTransportClass McdKludgeTransportClass; -typedef struct _McdKludgeTransportPrivate McdKludgeTransportPrivate; - -struct _McdKludgeTransportClass { - GObjectClass parent_class; -}; - -struct _McdKludgeTransport { - GObject parent; - - McdKludgeTransportPrivate *priv; -}; - -GType mcd_kludge_transport_get_type (void); - -void mcd_kludge_transport_install (McdMaster *master, - McdConnectivityMonitor *connectivity_monitor); - -/* TYPE MACROS */ -#define MCD_TYPE_KLUDGE_TRANSPORT \ - (mcd_kludge_transport_get_type ()) -#define MCD_KLUDGE_TRANSPORT(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), MCD_TYPE_KLUDGE_TRANSPORT, McdKludgeTransport)) -#define MCD_KLUDGE_TRANSPORT_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), MCD_TYPE_KLUDGE_TRANSPORT,\ - McdKludgeTransportClass)) -#define MCD_IS_KLUDGE_TRANSPORT(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj), MCD_TYPE_KLUDGE_TRANSPORT)) -#define MCD_IS_KLUDGE_TRANSPORT_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass), MCD_TYPE_KLUDGE_TRANSPORT)) -#define MCD_KLUDGE_TRANSPORT_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), MCD_TYPE_KLUDGE_TRANSPORT, \ - McdKludgeTransportClass)) - -#endif /* MCD_KLUDGE_TRANSPORT_H */ diff --git a/src/mcd-account-connection.c b/src/mcd-account-connection.c index 8eca282..f03c5bf 100644 --- a/src/mcd-account-connection.c +++ b/src/mcd-account-connection.c @@ -167,19 +167,3 @@ _mcd_account_connection_class_init (McdAccountClass *klass) NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN); } - -/** - * Returns: %TRUE if the current attempt to connect was user-initiated. - */ -gboolean -mcd_account_connection_is_user_initiated (McdAccount *account) -{ - McdAccountConnectionContext *ctx; - - ctx = _mcd_account_get_connection_context (account); - - if (ctx == NULL) - return FALSE; - - return ctx->user_initiated; -} diff --git a/src/mcd-account.c b/src/mcd-account.c index 658c186..82f37a7 100644 --- a/src/mcd-account.c +++ b/src/mcd-account.c @@ -37,7 +37,6 @@ #include "mcd-account-conditions.h" #include "mcd-account-manager-priv.h" #include "mcd-account-addressing.h" -#include "mcd-connection-plugin.h" #include "mcd-connection-priv.h" #include "mcd-misc.h" #include "mcd-manager.h" diff --git a/src/mcd-account.h b/src/mcd-account.h index 62191d5..7843c27 100644 --- a/src/mcd-account.h +++ b/src/mcd-account.h @@ -154,6 +154,10 @@ gboolean mcd_account_get_waiting_for_connectivity (McdAccount *self); void mcd_account_set_waiting_for_connectivity (McdAccount *self, gboolean waiting); +void mcd_account_connection_proceed (McdAccount *account, gboolean success); +void mcd_account_connection_proceed_with_reason + (McdAccount *account, gboolean success, TpConnectionStatusReason reason); + G_END_DECLS #endif diff --git a/src/mcd-connection-plugin.h b/src/mcd-connection-plugin.h deleted file mode 100644 index 1e070e4..0000000 --- a/src/mcd-connection-plugin.h +++ /dev/null @@ -1,48 +0,0 @@ -/* vi: set et sw=4 ts=8 cino=t0,(0: */ -/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ -/* - * This file is part of mission-control - * - * Copyright (C) 2008-2009 Nokia Corporation. - * - * Contact: Alberto Mardegan - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * 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 - * - */ - -#ifndef __MCD_CONNECTION_PLUGIN_H__ -#define __MCD_CONNECTION_PLUGIN_H__ - -#include -#include -#include "mcd-transport.h" - -#include - -G_BEGIN_DECLS - -void mcd_account_connection_proceed (McdAccount *account, gboolean success); -void mcd_account_connection_proceed_with_reason - (McdAccount *account, gboolean success, TpConnectionStatusReason reason); -gboolean mcd_account_connection_is_user_initiated (McdAccount *account); - -#define MCD_ACCOUNT_CONNECTION_PRIORITY_POLICY 10000 -#define MCD_ACCOUNT_CONNECTION_PRIORITY_TRANSPORT 20000 -#define MCD_ACCOUNT_CONNECTION_PRIORITY_PARAMS 30000 - -G_END_DECLS - -#endif /* __MCD_CONNECTION_PLUGIN_H__ */ diff --git a/src/mcd-master.c b/src/mcd-master.c index 77182f1..b123fab 100644 --- a/src/mcd-master.c +++ b/src/mcd-master.c @@ -65,7 +65,6 @@ #include #endif -#include "kludge-transport.h" #include "mcd-master.h" #include "mcd-master-priv.h" #include "mcd-manager.h" @@ -74,7 +73,6 @@ #include "mcd-account-manager-priv.h" #include "mcd-account-conditions.h" #include "mcd-account-priv.h" -#include "mcd-transport.h" #include "plugin-loader.h" #ifdef G_OS_UNIX @@ -94,8 +92,6 @@ struct _McdMasterPrivate TpDBusDaemon *dbus_daemon; TpSimpleClientFactory *client_factory; - GPtrArray *transport_plugins; - /* Current pending sleep timer */ gint shutdown_timeout_id; @@ -114,12 +110,6 @@ enum PROP_ACCOUNT_MANAGER, }; -typedef struct { - gint priority; - McdAccountConnectionFunc func; - gpointer userdata; -} McdAccountConnectionData; - /* Used to poison 'default_master' when the object it points to is disposed. * The default_master should basically be alive for the duration of the MC run. */ @@ -182,20 +172,6 @@ _mcd_master_dispose (GObject * object) } priv->is_disposed = TRUE; - if (priv->transport_plugins) - { - guint i; - - for (i = 0; i < priv->transport_plugins->len; i++) - { - McdTransportPlugin *plugin; - plugin = g_ptr_array_index (priv->transport_plugins, i); - g_object_unref (plugin); - } - g_ptr_array_unref (priv->transport_plugins); - priv->transport_plugins = NULL; - } - tp_clear_object (&priv->account_manager); tp_clear_object (&priv->dbus_daemon); tp_clear_object (&priv->dispatcher); @@ -240,9 +216,6 @@ mcd_master_constructor (GType type, guint n_params, tp_proxy_get_dbus_connection (TP_PROXY (priv->dbus_daemon))), TRUE); - mcd_kludge_transport_install (master, - mcd_account_manager_get_connectivity_monitor (priv->account_manager)); - return (GObject *) master; } @@ -296,8 +269,6 @@ mcd_master_init (McdMaster * master) if (!default_master) default_master = master; - master->priv->transport_plugins = g_ptr_array_new (); - /* This newer plugin API is currently always enabled */ /* .... and is enabled before anything else as potentially * * any mcd component could have a new-API style plugin */ @@ -367,23 +338,6 @@ mcd_master_get_dbus_daemon (McdMaster *master) return master->priv->dbus_daemon; } -/** - * mcd_plugin_register_transport: - * @master: the #McdMaster. - * @transport_plugin: the #McdTransportPlugin. - * - * Registers @transport_plugin as a transport monitoring object. - * The @master takes ownership of the transport (i.e., it doesn't increment its - * reference count). - */ -void -mcd_master_register_transport (McdMaster *master, - McdTransportPlugin *transport_plugin) -{ - DEBUG ("called"); - g_ptr_array_add (master->priv->transport_plugins, transport_plugin); -} - /* Milliseconds to wait for Connectivity coming back up before exiting MC */ #define EXIT_COUNTDOWN_TIME 5000 diff --git a/src/mcd-master.h b/src/mcd-master.h index e9a0a6b..185b760 100644 --- a/src/mcd-master.h +++ b/src/mcd-master.h @@ -43,7 +43,6 @@ typedef struct _McdMasterPrivate McdMasterPrivate; #include #include -#include struct _McdMaster { @@ -62,17 +61,5 @@ McdMaster *mcd_master_get_default (void); TpDBusDaemon *mcd_master_get_dbus_daemon (McdMaster *master); void mcd_master_shutdown (McdMaster *self, const gchar *reason); -void mcd_master_register_transport (McdMaster *master, - McdTransportPlugin *transport_plugin); - -typedef void (*McdAccountConnectionFunc) (McdAccount *account, - GHashTable *parameters, - gpointer userdata); - -void mcd_master_register_account_connection (McdMaster *master, - McdAccountConnectionFunc func, - gint priority, - gpointer userdata); - G_END_DECLS #endif /* MCD_MASTER_H */ diff --git a/src/mcd-transport.c b/src/mcd-transport.c deleted file mode 100644 index 15aee23..0000000 --- a/src/mcd-transport.c +++ /dev/null @@ -1,141 +0,0 @@ -/* vi: set et sw=4 ts=8 cino=t0,(0: */ -/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ -/* - * This file is part of mission-control - * - * Copyright (C) 2008 Nokia Corporation. - * - * Contact: Alberto Mardegan - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * 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 "config.h" - -#include -#include "mcd-transport.h" -#include "mcd-enum-types.h" - -/** - * SECTION:mcd-transport - * @title: McdTransportPlugin - * @short_description: Interface to provide connectivity monitoring plugins. - * - * The #McdTransportPlugin interface is to be implemented by objects which can - * provide information about connectivity status. Such an object can advertise - * changes in connectivity by emitting the "status-changed" signal. - * - * To register an McdTransportPlugin into mission-control, a plugin should use - * the mcd_plugin_register_transport() function. - */ - -enum -{ - STATUS_CHANGED, - LAST_SIGNAL -}; - -static guint signals[LAST_SIGNAL] = { 0 }; - -static void -mcd_transport_plugin_base_init (gpointer iface) -{ - static gboolean initialized = FALSE; - - if (!initialized) - { - /** - * McdTransportPlugin::status-changed: - * @plugin: The #McdTransportPlugin. - * @transport: The #McdTransport. - * @status: the new status of the transport - * - * Signals that the status of @transport has changed. Signalling - * MCD_TRANSPORT_STATUS_CONNECTED and MCD_TRANSPORT_STATUS_DISCONNECTED - * is mandatory. - */ - signals[STATUS_CHANGED] = g_signal_new ("status-changed", - G_TYPE_FROM_INTERFACE (iface), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (McdTransportPluginIface, status_changed), - NULL, NULL, NULL, - G_TYPE_NONE, 2, - G_TYPE_POINTER, MCD_TYPE_TRANSPORT_STATUS); - initialized = TRUE; - } -} - -GType -mcd_transport_plugin_get_type (void) -{ - static GType type = 0; - - if (!type) { - static const GTypeInfo info = { - sizeof (McdTransportPluginIface), - mcd_transport_plugin_base_init, - NULL, - NULL, - NULL, - NULL, - 0, - 0, - NULL - }; - type = g_type_register_static (G_TYPE_INTERFACE, - "McdTransportPlugin", &info, 0); - g_type_interface_add_prerequisite (type, G_TYPE_OBJECT); - } - return type; -} - -/** - * mcd_transport_plugin_get_transports: - * @plugin: the #McdTransportPlugin. - * - * Get a #list of all the transport known to the plugin. Transports which are - * in disconnected status can be skipped from the return value. - * - * Returns: a #GList of all the known McdTransports. Must not be freed. - */ -const GList * -mcd_transport_plugin_get_transports (McdTransportPlugin *plugin) -{ - McdTransportPluginIface *iface; - - iface = MCD_TRANSPORT_PLUGIN_GET_IFACE (plugin); - g_return_val_if_fail (iface->get_transports != NULL, NULL); - return iface->get_transports (plugin); -} - -/** - * mcd_transport_get_name: - * @plugin: the #McdTransportPlugin. - * @transport: a #McdTransport. - * - * Gets the name of @transport. - * - * Returns: the name of the transport. - */ -const gchar * -mcd_transport_get_name (McdTransportPlugin *plugin, McdTransport *transport) -{ - McdTransportPluginIface *iface; - - iface = MCD_TRANSPORT_PLUGIN_GET_IFACE (plugin); - g_return_val_if_fail (iface->get_transport_name != NULL, NULL); - return iface->get_transport_name (plugin, transport); -} diff --git a/src/mcd-transport.h b/src/mcd-transport.h deleted file mode 100644 index 0f35d1e..0000000 --- a/src/mcd-transport.h +++ /dev/null @@ -1,71 +0,0 @@ -/* vi: set et sw=4 ts=8 cino=t0,(0: */ -/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ -/* - * This file is part of mission-control - * - * Copyright (C) 2008 Nokia Corporation. - * - * Contact: Alberto Mardegan - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * 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 - * - */ - -#ifndef __MCD_TRANSPORT_PLUGIN_H__ -#define __MCD_TRANSPORT_PLUGIN_H__ - -#include -#include - -G_BEGIN_DECLS - -#define MCD_TYPE_TRANSPORT_PLUGIN (mcd_transport_plugin_get_type ()) -#define MCD_TRANSPORT_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MCD_TYPE_TRANSPORT_PLUGIN, McdTransportPlugin)) -#define MCD_IS_TRANSPORT_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MCD_TYPE_TRANSPORT_PLUGIN)) -#define MCD_TRANSPORT_PLUGIN_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), MCD_TYPE_TRANSPORT_PLUGIN, McdTransportPluginIface)) - -typedef struct _McdTransportPlugin McdTransportPlugin; -typedef struct _McdTransportPluginIface McdTransportPluginIface; -typedef struct _McdTransport McdTransport; - -typedef enum { - MCD_TRANSPORT_STATUS_CONNECTED, - MCD_TRANSPORT_STATUS_CONNECTING, - MCD_TRANSPORT_STATUS_DISCONNECTED, - MCD_TRANSPORT_STATUS_DISCONNECTING, -} McdTransportStatus; - -struct _McdTransportPluginIface -{ - GTypeInterface g_iface; - - /* methods */ - const GList * (*get_transports) (McdTransportPlugin *plugin); - const gchar * (*get_transport_name) (McdTransportPlugin *plugin, - McdTransport *transport); - /* signals */ - void (*status_changed) (McdTransportPlugin *plugin, McdTransport *transport, - McdTransportStatus status); -}; - -GType mcd_transport_plugin_get_type (void) G_GNUC_CONST; - -const GList *mcd_transport_plugin_get_transports (McdTransportPlugin *plugin); - -const gchar *mcd_transport_get_name (McdTransportPlugin *plugin, - McdTransport *transport); - -G_END_DECLS -#endif /* __MCD_TRANSPORT_PLUGIN_H__ */ -- 1.8.4.rc3