2
* manager.c - an example connection manager
4
* Copyright © 2007-2009 Collabora Ltd. <http://www.collabora.co.uk/>
5
* Copyright © 2007-2009 Nokia Corporation
7
* This library is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU Lesser General Public
9
* License as published by the Free Software Foundation; either
10
* version 2.1 of the License, or (at your option) any later version.
12
* This library is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Lesser General Public License for more details.
17
* You should have received a copy of the GNU Lesser General Public
18
* License along with this library; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
#include <dbus/dbus-glib.h>
26
#include <telepathy-glib/dbus.h>
27
#include <telepathy-glib/errors.h>
32
G_DEFINE_TYPE (ExampleCallConnectionManager,
33
example_call_connection_manager,
34
TP_TYPE_BASE_CONNECTION_MANAGER)
36
struct _ExampleCallConnectionManagerPrivate
42
example_call_connection_manager_init (ExampleCallConnectionManager *self)
44
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
45
EXAMPLE_TYPE_CALL_CONNECTION_MANAGER,
46
ExampleCallConnectionManagerPrivate);
50
example_call_connection_manager_constructed (GObject *object)
52
ExampleCallConnectionManager *self =
53
EXAMPLE_CALL_CONNECTION_MANAGER (object);
54
TpBaseConnectionManager *base = (TpBaseConnectionManager *) self;
55
void (*constructed) (GObject *) =
56
((GObjectClass *) example_call_connection_manager_parent_class)->constructed;
57
TpBaseProtocol *protocol;
59
if (constructed != NULL)
62
protocol = g_object_new (EXAMPLE_TYPE_CALL_PROTOCOL,
65
tp_base_connection_manager_add_protocol (base, protocol);
66
g_object_unref (protocol);
70
example_call_connection_manager_class_init (
71
ExampleCallConnectionManagerClass *klass)
73
GObjectClass *object_class = (GObjectClass *) klass;
74
TpBaseConnectionManagerClass *base_class =
75
(TpBaseConnectionManagerClass *) klass;
77
g_type_class_add_private (klass,
78
sizeof (ExampleCallConnectionManagerPrivate));
80
object_class->constructed = example_call_connection_manager_constructed;
81
base_class->cm_dbus_name = "example_call";