1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
|
/*
* gabble-media-session.c - Source for GabbleMediaSession
* Copyright (C) 2005 Collabora Ltd.
* Copyright (C) 2005 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
*/
#include <dbus/dbus-glib.h>
#include <stdio.h>
#include <stdlib.h>
#include "gabble-media-session.h"
#include "gabble-media-session-signals-marshal.h"
#include "gabble-media-session-glue.h"
G_DEFINE_TYPE(GabbleMediaSession, gabble_media_session, G_TYPE_OBJECT)
/* signal enum */
enum
{
NEW_STREAM_HANDLER,
LAST_SIGNAL
};
static guint signals[LAST_SIGNAL] = {0};
/* private structure */
typedef struct _GabbleMediaSessionPrivate GabbleMediaSessionPrivate;
struct _GabbleMediaSessionPrivate
{
gboolean dispose_has_run;
};
#define GABBLE_MEDIA_SESSION_GET_PRIVATE(obj) \
((GabbleMediaSessionPrivate *)obj->priv)
static void
gabble_media_session_init (GabbleMediaSession *self)
{
GabbleMediaSessionPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
GABBLE_TYPE_MEDIA_SESSION, GabbleMediaSessionPrivate);
self->priv = priv;
/* allocate any data required by the object here */
}
static void gabble_media_session_dispose (GObject *object);
static void gabble_media_session_finalize (GObject *object);
static void
gabble_media_session_class_init (GabbleMediaSessionClass *gabble_media_session_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (gabble_media_session_class);
g_type_class_add_private (gabble_media_session_class, sizeof (GabbleMediaSessionPrivate));
object_class->dispose = gabble_media_session_dispose;
object_class->finalize = gabble_media_session_finalize;
signals[NEW_STREAM_HANDLER] =
g_signal_new ("new-stream-handler",
G_OBJECT_CLASS_TYPE (gabble_media_session_class),
G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
0,
NULL, NULL,
gabble_media_session_marshal_VOID__STRING_UINT_UINT_UINT,
G_TYPE_NONE, 4, DBUS_TYPE_G_OBJECT_PATH, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT);
dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (gabble_media_session_class), &dbus_glib_gabble_media_session_object_info);
}
void
gabble_media_session_dispose (GObject *object)
{
GabbleMediaSession *self = GABBLE_MEDIA_SESSION (object);
GabbleMediaSessionPrivate *priv = GABBLE_MEDIA_SESSION_GET_PRIVATE (self);
if (priv->dispose_has_run)
return;
priv->dispose_has_run = TRUE;
/* release any references held by the object here */
if (G_OBJECT_CLASS (gabble_media_session_parent_class)->dispose)
G_OBJECT_CLASS (gabble_media_session_parent_class)->dispose (object);
}
void
gabble_media_session_finalize (GObject *object)
{
GabbleMediaSession *self = GABBLE_MEDIA_SESSION (object);
GabbleMediaSessionPrivate *priv = GABBLE_MEDIA_SESSION_GET_PRIVATE (self);
/* free any data held directly by the object here */
G_OBJECT_CLASS (gabble_media_session_parent_class)->finalize (object);
}
/**
* gabble_media_session_error
*
* Implements D-Bus method Error
* on interface org.freedesktop.Telepathy.Media.SessionHandler
*
* @error: Used to return a pointer to a GError detailing any error
* that occurred, D-Bus will throw the error only if this
* function returns FALSE.
*
* Returns: TRUE if successful, FALSE if an error was thrown.
*/
gboolean
gabble_media_session_error (GabbleMediaSession *self,
guint errno,
const gchar *message,
GError **error)
{
return TRUE;
}
/**
* gabble_media_session_ready
*
* Implements D-Bus method Ready
* on interface org.freedesktop.Telepathy.Media.SessionHandler
*
* @error: Used to return a pointer to a GError detailing any error
* that occurred, D-Bus will throw the error only if this
* function returns FALSE.
*
* Returns: TRUE if successful, FALSE if an error was thrown.
*/
gboolean
gabble_media_session_ready (GabbleMediaSession *self,
GError **error)
{
return TRUE;
}
|