diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2011-11-08 11:51:54 +0100 |
---|---|---|
committer | Xavier Claessens <xavier.claessens@collabora.co.uk> | 2012-01-10 09:52:43 +0100 |
commit | 3fb5a0f0d3b5cf26257ac972ebdc853dd88de2a1 (patch) | |
tree | 4cb3824c417a870860741338deeeda22521c8900 /telepathy-glib/call-content.c | |
parent | 45d9a2b8758edfedd15fc4203236918fdfa6fe14 (diff) | |
download | telepathy-glib-3fb5a0f0d3b5cf26257ac972ebdc853dd88de2a1.tar.gz |
Generate lowlevel API for Call1 spec
Add skeleton for TpCallChannel, TpCallContent and TpCallStream
Diffstat (limited to 'telepathy-glib/call-content.c')
-rw-r--r-- | telepathy-glib/call-content.c | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/telepathy-glib/call-content.c b/telepathy-glib/call-content.c new file mode 100644 index 000000000..92bacae50 --- /dev/null +++ b/telepathy-glib/call-content.c @@ -0,0 +1,124 @@ +/* + * call-content.h - high level API for Call contents + * + * Copyright (C) 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 + */ + +/** + * SECTION:call-content + * @title: TpCallContent + * @short_description: proxy object for a call content + * + * #TpCallContent is a sub-class of #TpProxy providing convenient API + * to represent #TpCallChannel's content. + */ + +/** + * TpCallContent: + * + * Data structure representing a #TpCallContent. + * + * Since: 0.UNRELEASED + */ + +/** + * TpCallContentClass: + * + * The class of a #TpCallContent. + * + * Since: 0.UNRELEASED + */ + +#include <config.h> + +#include "telepathy-glib/call-content.h" +#include "telepathy-glib/call-misc.h" +#include "telepathy-glib/errors.h" +#include "telepathy-glib/interfaces.h" +#include "telepathy-glib/proxy-subclass.h" + +#define DEBUG_FLAG TP_DEBUG_CALL +#include "telepathy-glib/debug-internal.h" + +#include "_gen/tp-cli-call-content-body.h" + +G_DEFINE_TYPE (TpCallContent, tp_call_content, TP_TYPE_PROXY) + +struct _TpCallContentPrivate +{ + gpointer dummy; +}; + +static void +tp_call_content_constructed (GObject *obj) +{ + void (*chain_up) (GObject *) = + ((GObjectClass *) tp_call_content_parent_class)->constructed; + + if (chain_up != NULL) + chain_up (obj); +} + +static void +tp_call_content_class_init (TpCallContentClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->constructed = tp_call_content_constructed; + + g_type_class_add_private (gobject_class, sizeof (TpCallContentPrivate)); + tp_call_content_init_known_interfaces (); + tp_call_mute_init_known_interfaces (); +} + +static void +tp_call_content_init (TpCallContent *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE ((self), TP_TYPE_CALL_CONTENT, + TpCallContentPrivate); +} + +/** + * tp_call_content_init_known_interfaces: + * + * Ensure that the known interfaces for #TpCallContent have been set up. + * This is done automatically when necessary, but for correct + * overriding of library interfaces by local extensions, you should + * call this function before calling + * tp_proxy_or_subclass_hook_on_interface_add() with first argument + * %TP_TYPE_CALL_CONTENT. + * + * Since: 0.UNRELEASED + */ +void +tp_call_content_init_known_interfaces (void) +{ + static gsize once = 0; + + if (g_once_init_enter (&once)) + { + GType tp_type = TP_TYPE_CALL_CONTENT; + + tp_proxy_init_known_interfaces (); + tp_proxy_or_subclass_hook_on_interface_add (tp_type, + tp_cli_call_content_add_signals); + tp_proxy_subclass_add_error_mapping (tp_type, + TP_ERROR_PREFIX, TP_ERRORS, TP_TYPE_ERROR); + + g_once_init_leave (&once, 1); + } +} |