2 * Copyright (C) 2007 Elliot Fairweather
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 * Authors: Elliot Fairweather <elliot.fairweather@collabora.co.uk>
26 #include <glib/gi18n.h>
29 #include <libgnomevfs/gnome-vfs.h>
31 #include <libmissioncontrol/mission-control.h>
33 #include <libempathy/empathy-chandler.h>
34 #include <libempathy/empathy-utils.h>
35 #include <libempathy/empathy-tp-call.h>
36 #include <libempathy/empathy-debug.h>
38 #include <libempathy-gtk/empathy-call-window.h>
40 #define DEBUG_DOMAIN "EmpathyCall"
42 #define BUS_NAME "org.gnome.Empathy.CallChandler"
43 #define OBJECT_PATH "/org/gnome/Empathy/CallChandler"
45 static guint nb_calls = 0;
48 call_chandler_weak_notify (gpointer data,
49 GObject *where_the_object_was)
53 empathy_debug (DEBUG_DOMAIN, "No more calls, leaving...");
59 call_chandler_new_channel_cb (EmpathyChandler *chandler,
68 account = mission_control_get_account_for_connection (mc, tp_conn, NULL);
70 call = empathy_tp_call_new (account, tp_chan);
71 window = empathy_call_window_show (call);
72 g_object_unref (account);
73 g_object_unref (call);
76 g_object_weak_ref (G_OBJECT (window), call_chandler_weak_notify, NULL);
80 main (int argc, char *argv[])
82 EmpathyChandler *chandler;
85 empathy_debug_set_log_file_from_env ();
87 bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
88 bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
89 textdomain (GETTEXT_PACKAGE);
91 gtk_init (&argc, &argv);
93 gtk_window_set_default_icon_name ("empathy");
94 gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (),
95 PKGDATADIR G_DIR_SEPARATOR_S "icons");
97 mc = empathy_mission_control_new ();
98 chandler = empathy_chandler_new (BUS_NAME, OBJECT_PATH);
99 g_signal_connect (chandler, "new-channel",
100 G_CALLBACK (call_chandler_new_channel_cb),
103 empathy_debug (DEBUG_DOMAIN, "Ready to handle new streamed media channels");
107 g_object_unref (chandler);