/* * 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 #include #include #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; }