From e3e5702a683c468ccc1742515b4033f32c7d1083 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Sat, 29 Sep 2007 12:08:45 +0000 Subject: Initial Voice+Video support Fixes bug #468204 (Elliot Fairweather, Xavier 2007-09-29 Xavier Claessens * libempathy-gtk/empathy-call-window.c: * libempathy-gtk/empathy-call-window.h: * libempathy-gtk/empathy-contact-list-view.c: * libempathy-gtk/empathy-call-window.glade: * libempathy-gtk/Makefile.am: * libempathy-gtk/empathy-chat-window.c: * src/empathy-call-chandler.c: * src/empathy-call.chandler: * src/org.gnome.Empathy.Call.service.in: * src/Makefile.am: * libempathy/empathy-utils.c: * libempathy/empathy-utils.h: * libempathy/empathy-tp-call.c: * libempathy/empathy-tp-call.h: * libempathy/Makefile.am: * libempathy/tp-stream-engine.xml: * configure.ac: * doc/libempathy-gtk/libempathy-gtk-docs.sgml: * doc/libempathy/libempathy.types: * doc/libempathy/libempathy-docs.sgml: * doc/libempathy/Makefile.am: * doc/libempathy/tmpl/empathy-utils.sgml: Initial Voice+Video support Fixes bug #468204 (Elliot Fairweather, Xavier Claessens). svn path=/trunk/; revision=339 --- src/Makefile.am | 17 ++++++-- src/empathy-call-chandler.c | 79 +++++++++++++++++++++++++++++++++++ src/empathy-call.chandler | 5 +++ src/org.gnome.Empathy.Call.service.in | 3 ++ 4 files changed, 100 insertions(+), 4 deletions(-) create mode 100644 src/empathy-call-chandler.c create mode 100644 src/empathy-call.chandler create mode 100644 src/org.gnome.Empathy.Call.service.in (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index d81601ed0..ae336df09 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -15,15 +15,18 @@ LDADD = \ bin_PROGRAMS = \ empathy \ - empathy-accounts + empathy-accounts \ + empathy-call-chandler empathy_SOURCES = empathy.c empathy_accounts_SOURCES = empathy-accounts.c +empathy_call_chandler_SOURCES = empathy-call-chandler.c -# Dbus service file +# Dbus service files servicedir = $(datadir)/dbus-1/services service_DATA = \ - org.gnome.Empathy.Chat.service + org.gnome.Empathy.Chat.service \ + org.gnome.Empathy.Call.service %.service: %.service.in Makefile @sed -e "s|\@bindir\@|$(bindir)|" $< > $@ @@ -31,11 +34,17 @@ chandlerdir = $(datadir)/telepathy/managers chandler_DATA = \ empathy-chat.chandler +if HAVE_VOIP +chandler_DATA += empathy-call.chandler +endif + BUILT_SOURCES = \ - org.gnome.Empathy.Chat.service + org.gnome.Empathy.Chat.service \ + org.gnome.Empathy.Call.service EXTRA_DIST = \ org.gnome.Empathy.Chat.service.in \ + org.gnome.Empathy.Call.service.in \ $(autostart_DATA) \ $(chandler_DATA) diff --git a/src/empathy-call-chandler.c b/src/empathy-call-chandler.c new file mode 100644 index 000000000..bb88747f4 --- /dev/null +++ b/src/empathy-call-chandler.c @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2007 Elliot Fairweather + * + * 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 + * + * Authors: Elliot Fairweather + */ + +#include + +#include + +#include + +#include +#include +#include +#include + +#include + +#define DEBUG_DOMAIN "EmpathyCall" + +#define BUS_NAME "org.gnome.Empathy.Call" +#define OBJECT_PATH "/org/freedesktop/Telepathy/ChannelHandler" + +static void +call_chandler_new_channel_cb (EmpathyChandler *chandler, + TpConn *tp_conn, + TpChan *tp_chan, + MissionControl *mc) +{ + EmpathyTpCall *call; + McAccount *account; + + account = mission_control_get_account_for_connection (mc, tp_conn, NULL); + + call = empathy_tp_call_new (account, tp_chan); + empathy_call_window_show (call); + g_object_unref (account); + g_object_unref (call); +} + +int +main (int argc, char *argv[]) +{ + EmpathyChandler *chandler; + MissionControl *mc; + + gtk_init (&argc, &argv); + + mc = empathy_mission_control_new (); + chandler = empathy_chandler_new (BUS_NAME, OBJECT_PATH); + g_signal_connect (chandler, "new-channel", + G_CALLBACK (call_chandler_new_channel_cb), + mc); + + empathy_debug (DEBUG_DOMAIN, "Ready to handle new streamed media channels"); + + gtk_main (); + + g_object_unref (chandler); + g_object_unref (mc); + + return EXIT_SUCCESS; +} + diff --git a/src/empathy-call.chandler b/src/empathy-call.chandler new file mode 100644 index 000000000..190494d3c --- /dev/null +++ b/src/empathy-call.chandler @@ -0,0 +1,5 @@ +[ChannelHandler] +BusName = org.gnome.Empathy.Call +ObjectPath = /org/freedesktop/Telepathy/ChannelHandler +ChannelType = org.freedesktop.Telepathy.Channel.Type.StreamedMedia +TypeSpecificCapabilities = 15 diff --git a/src/org.gnome.Empathy.Call.service.in b/src/org.gnome.Empathy.Call.service.in new file mode 100644 index 000000000..38d0e763a --- /dev/null +++ b/src/org.gnome.Empathy.Call.service.in @@ -0,0 +1,3 @@ +[D-BUS Service] +Name=org.gnome.Empathy.Call +Exec=@bindir@/empathy-call-chandler -- cgit v1.2.3