diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2011-03-21 08:58:09 +0000 |
---|---|---|
committer | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2011-03-21 08:58:09 +0000 |
commit | cde06ccf071f793a81e0f71627719d7753d9430d (patch) | |
tree | f0b43c4009b70f92e89b0e41ddfb406dcf6b3611 /salut | |
parent | 3c112f53e732306b95f1c01050972ac5fd6ecae2 (diff) | |
parent | 14e2d72bbeae565a53fe8bd32f375c0cec3715c0 (diff) |
Merge branch 'sidetzars'
Conflicts:
extensions/all.xml
salut/Makefile.am
src/salut-connection.c
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Diffstat (limited to 'salut')
-rw-r--r-- | salut/Makefile.am | 4 | ||||
-rw-r--r-- | salut/connection.h | 47 | ||||
-rw-r--r-- | salut/plugin.h | 43 | ||||
-rw-r--r-- | salut/sidecar.h | 67 |
4 files changed, 160 insertions, 1 deletions
diff --git a/salut/Makefile.am b/salut/Makefile.am index af96051c..d2878b10 100644 --- a/salut/Makefile.am +++ b/salut/Makefile.am @@ -4,10 +4,12 @@ pkgconfig_DATA = telepathy-salut.pc salutincludedir = $(includedir)/telepathy-salut-0/salut salutinclude_HEADERS = \ + connection.h \ plugin.h \ protocol.h \ capabilities-set.h \ caps-channel-manager.h \ - capabilities.h + capabilities.h \ + sidecar.h endif diff --git a/salut/connection.h b/salut/connection.h new file mode 100644 index 00000000..79f3a37b --- /dev/null +++ b/salut/connection.h @@ -0,0 +1,47 @@ +/* + * connection.h - connection API available to telepathy-salut plugins + * Copyright © 2010 Collabora Ltd. + * Copyright © 2010 Nokia Corporation + * + * 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 SALUT_PLUGINS_CONNECTION_H +#define SALUT_PLUGINS_CONNECTION_H + +G_BEGIN_DECLS + +#define SALUT_TYPE_CONNECTION (salut_connection_get_type ()) +#define SALUT_CONNECTION(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), SALUT_TYPE_CONNECTION, SalutConnection)) +#define SALUT_CONNECTION_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), SALUT_TYPE_CONNECTION, \ + SalutConnectionClass)) +#define SALUT_IS_CONNECTION(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), SALUT_TYPE_CONNECTION)) +#define SALUT_IS_CONNECTION_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), SALUT_TYPE_CONNECTION)) +#define SALUT_CONNECTION_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), SALUT_TYPE_CONNECTION, \ + SalutConnectionClass)) + +typedef struct _SalutConnection SalutConnection; +typedef struct _SalutConnectionClass SalutConnectionClass; + +GType salut_connection_get_type (void); + +G_END_DECLS + +#endif diff --git a/salut/plugin.h b/salut/plugin.h index 975446c6..c0f2a062 100644 --- a/salut/plugin.h +++ b/salut/plugin.h @@ -26,6 +26,11 @@ #include <telepathy-glib/base-connection-manager.h> #include <telepathy-glib/base-connection.h> +#include <wocky/wocky-session.h> + +#include <salut/connection.h> +#include <salut/sidecar.h> + G_BEGIN_DECLS #define SALUT_TYPE_PLUGIN (salut_plugin_get_type ()) @@ -40,6 +45,14 @@ G_BEGIN_DECLS typedef struct _SalutPlugin SalutPlugin; typedef struct _SalutPluginInterface SalutPluginInterface; +typedef void (*SalutPluginCreateSidecarImpl) ( + SalutPlugin *plugin, + const gchar *sidecar_interface, + SalutConnection *connection, + WockySession *session, + GAsyncReadyCallback callback, + gpointer user_data); + /* The caller of this function takes ownership of the returned * GPtrArray and the channel managers inside the array. This has the * same semantics as TpBaseConnectionCreateChannelManagersImpl. */ @@ -75,6 +88,17 @@ struct _SalutPluginInterface const gchar *version; /** + * A %NULL-terminated array of strings listing the sidecar D-Bus interfaces + * implemented by this plugin. + */ + const gchar * const *sidecar_interfaces; + + /** + * An implementation of salut_plugin_create_sidecar(). + */ + SalutPluginCreateSidecarImpl create_sidecar; + + /** * An implementation of salut_plugin_initialize(). */ SalutPluginInitializeImpl initialize; @@ -93,6 +117,25 @@ const gchar * salut_plugin_get_name ( SalutPlugin *plugin); const gchar * salut_plugin_get_version ( SalutPlugin *plugin); +const gchar * const *salut_plugin_get_sidecar_interfaces ( + SalutPlugin *plugin); + +gboolean salut_plugin_implements_sidecar ( + SalutPlugin *plugin, + const gchar *sidecar_interface); + +void salut_plugin_create_sidecar_async ( + SalutPlugin *plugin, + const gchar *sidecar_interface, + SalutConnection *connection, + WockySession *session, + GAsyncReadyCallback callback, + gpointer user_data); + +SalutSidecar * salut_plugin_create_sidecar_finish ( + SalutPlugin *plugin, + GAsyncResult *result, + GError **error); void salut_plugin_initialize ( SalutPlugin *plugin, diff --git a/salut/sidecar.h b/salut/sidecar.h new file mode 100644 index 00000000..1f5e78ff --- /dev/null +++ b/salut/sidecar.h @@ -0,0 +1,67 @@ +/* + * sidecar.h — sidecar API available to telepathy-salut plugins + * Copyright © 2009-2011 Collabora Ltd. + * Copyright © 2009 Nokia Corporation + * + * 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 SALUT_PLUGINS_SIDECAR_H +#define SALUT_PLUGINS_SIDECAR_H + +#include <glib-object.h> + +#include <salut/connection.h> + +G_BEGIN_DECLS + +#define SALUT_TYPE_SIDECAR (salut_sidecar_get_type ()) +#define SALUT_SIDECAR(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), SALUT_TYPE_SIDECAR, SalutSidecar)) +#define SALUT_IS_SIDECAR(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SALUT_TYPE_SIDECAR)) +#define SALUT_SIDECAR_GET_INTERFACE(obj) \ + (G_TYPE_INSTANCE_GET_INTERFACE ((obj), SALUT_TYPE_SIDECAR, \ + SalutSidecarInterface)) + +typedef struct _SalutSidecar SalutSidecar; +typedef struct _SalutSidecarInterface SalutSidecarInterface; + +typedef GHashTable * (*SalutSidecarGetImmutablePropertiesImpl) ( + SalutSidecar *); + +struct _SalutSidecarInterface +{ + GTypeInterface parent; + + /** + * The D-Bus interface implemented by this sidecar. + */ + const gchar *interface; + + /** + * An implementation of salut_sidecar_get_immutable_properties(). + */ + SalutSidecarGetImmutablePropertiesImpl get_immutable_properties; +}; + +GType salut_sidecar_get_type (void); + +const gchar * salut_sidecar_get_interface (SalutSidecar *sidecar); +GHashTable * salut_sidecar_get_immutable_properties (SalutSidecar *sidecar); + +G_END_DECLS + +#endif |