[ekiga] Opal: Simplified call related signals & call creation.
- From: Damien Sandras <dsandras src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga] Opal: Simplified call related signals & call creation.
- Date: Sun, 25 Jan 2015 11:29:32 +0000 (UTC)
commit f1e0fbf19a4ec4c8658bd05390470cd88fa29090
Author: Damien Sandras <dsandras seconix com>
Date: Sun Jan 25 12:28:09 2015 +0100
Opal: Simplified call related signals & call creation.
The relationship with Opal::CallManager was completely removed. It was
not used and complicated the code.
.../components/call-history/history-book.cpp | 10 +-
lib/engine/components/call-history/history-book.h | 6 +-
lib/engine/components/opal/opal-call-manager.cpp | 2 +-
lib/engine/components/opal/opal-call-manager.h | 5 -
lib/engine/components/opal/opal-call.cpp | 17 ++--
lib/engine/components/opal/opal-call.h | 7 +-
lib/engine/gui/gtk-frontend/call-window.cpp | 74 ++++++---------
lib/engine/gui/gtk-frontend/ekiga-app.cpp | 43 ++------
lib/engine/gui/gtk-frontend/main_window.cpp | 27 ++---
lib/engine/gui/gtk-frontend/statusicon.cpp | 16 +--
lib/engine/protocol/call-core.cpp | 103 +++-----------------
lib/engine/protocol/call-core.h | 39 +++-----
lib/engine/protocol/call.h | 3 +-
plugins/libnotify/libnotify-main.cpp | 10 +-
14 files changed, 106 insertions(+), 256 deletions(-)
---
diff --git a/lib/engine/components/call-history/history-book.cpp
b/lib/engine/components/call-history/history-book.cpp
index 4588339..2ccf39c 100644
--- a/lib/engine/components/call-history/history-book.cpp
+++ b/lib/engine/components/call-history/history-book.cpp
@@ -78,8 +78,8 @@ History::Book::Book (Ekiga::ServiceCore& core):
boost::shared_ptr<Ekiga::CallCore> call_core = core.get<Ekiga::CallCore> ("call-core");
- connections.add (call_core->missed_call.connect (boost::bind (&History::Book::on_missed_call, this, _1,
_2)));
- connections.add (call_core->cleared_call.connect (boost::bind (&History::Book::on_cleared_call, this, _1,
_2, _3)));
+ connections.add (call_core->missed_call.connect (boost::bind (&History::Book::on_missed_call, this, _1)));
+ connections.add (call_core->cleared_call.connect (boost::bind (&History::Book::on_cleared_call, this, _1,
_2)));
enforce_size_limit ();
@@ -192,8 +192,7 @@ History::Book::clear ()
}
void
-History::Book::on_missed_call (boost::shared_ptr<Ekiga::CallManager> /*manager*/,
- boost::shared_ptr<Ekiga::Call> call)
+History::Book::on_missed_call (boost::shared_ptr<Ekiga::Call> call)
{
add (call->get_remote_party_name (),
call->get_remote_uri (),
@@ -203,8 +202,7 @@ History::Book::on_missed_call (boost::shared_ptr<Ekiga::CallManager> /*manager*/
}
void
-History::Book::on_cleared_call (boost::shared_ptr<Ekiga::CallManager> /*manager*/,
- boost::shared_ptr<Ekiga::Call> call,
+History::Book::on_cleared_call (boost::shared_ptr<Ekiga::Call> call,
std::string /*message*/)
{
add (call->get_remote_party_name (),
diff --git a/lib/engine/components/call-history/history-book.h
b/lib/engine/components/call-history/history-book.h
index c82acb5..056812a 100644
--- a/lib/engine/components/call-history/history-book.h
+++ b/lib/engine/components/call-history/history-book.h
@@ -99,11 +99,9 @@ namespace History
void add (xmlNodePtr node);
- void on_missed_call (boost::shared_ptr<Ekiga::CallManager> manager,
- boost::shared_ptr<Ekiga::Call> call);
+ void on_missed_call (boost::shared_ptr<Ekiga::Call> call);
- void on_cleared_call (boost::shared_ptr<Ekiga::CallManager> manager,
- boost::shared_ptr<Ekiga::Call> call,
+ void on_cleared_call (boost::shared_ptr<Ekiga::Call> call,
std::string message);
void common_add (ContactPtr contact);
diff --git a/lib/engine/components/opal/opal-call-manager.cpp
b/lib/engine/components/opal/opal-call-manager.cpp
index 27a2acc..7f20496 100644
--- a/lib/engine/components/opal/opal-call-manager.cpp
+++ b/lib/engine/components/opal/opal-call-manager.cpp
@@ -731,7 +731,7 @@ CallManager::create_call_in_main (Opal::Call* _call)
call->set_engine_services (notification_core, ccore);
- ccore->add_call (call, boost::dynamic_pointer_cast<CallManager>(shared_from_this ()));
+ ccore->add_call (call);
}
OpalCall *CallManager::CreateCall (void *uri)
diff --git a/lib/engine/components/opal/opal-call-manager.h b/lib/engine/components/opal/opal-call-manager.h
index e93e9da..b5723b1 100644
--- a/lib/engine/components/opal/opal-call-manager.h
+++ b/lib/engine/components/opal/opal-call-manager.h
@@ -58,10 +58,6 @@
#include "actor.h"
#include "opal-codec-description.h"
-#include <boost/enable_shared_from_this.hpp>
-
-
-class GMLid;
class GMPCSSEndpoint;
namespace Opal {
@@ -71,7 +67,6 @@ namespace Opal {
namespace H323 { class EndPoint; };
class CallManager :
- public boost::enable_shared_from_this<CallManager>,
public Ekiga::CallManager,
public Ekiga::URIActionProvider,
public OpalManager
diff --git a/lib/engine/components/opal/opal-call.cpp b/lib/engine/components/opal/opal-call.cpp
index 3d8e751..57ed24b 100644
--- a/lib/engine/components/opal/opal-call.cpp
+++ b/lib/engine/components/opal/opal-call.cpp
@@ -98,8 +98,8 @@ private:
Opal::Call::Call (Opal::CallManager& _manager,
const std::string& uri)
- : OpalCall (_manager), Ekiga::Call (), manager(_manager), remote_uri (uri),
- call_setup(false), outgoing(false)
+ : OpalCall (_manager), Ekiga::Call (), remote_uri (uri),
+ call_setup(false), outgoing(false), auto_answer (_manager.get_auto_answer ())
{
NoAnswerTimer.SetNotifier (PCREATE_NOTIFIER (OnNoAnswerTimeout));
@@ -173,12 +173,14 @@ Opal::Call::transfer ()
}
-void
+bool
Opal::Call::transfer (std::string uri)
{
PSafePtr<OpalConnection> connection = get_remote_connection ();
if (connection != NULL)
- connection->TransferConnection (uri);
+ return connection->TransferConnection (uri);
+
+ return false;
}
@@ -200,11 +202,8 @@ Opal::Call::on_transfer_form_submitted (bool submitted,
idx = uri.find_first_of ("@");
if (idx == std::string::npos)
uri = uri + "@" + (const char *) PURL (remote_uri).GetHostName ();
- if (manager.is_supported_uri (uri)) {
-
- transfer (uri);
+ if (transfer (uri))
return true;
- }
else
error = _("You supplied an unsupported address");
@@ -653,7 +652,7 @@ Opal::Call::OnAnswerCall (OpalConnection & connection,
parse_info (connection);
- if (manager.get_auto_answer ())
+ if (auto_answer)
return OpalConnection::AnswerCallNow;
return OpalCall::OnAnswerCall (connection, caller);
diff --git a/lib/engine/components/opal/opal-call.h b/lib/engine/components/opal/opal-call.h
index 72badfc..7f74312 100644
--- a/lib/engine/components/opal/opal-call.h
+++ b/lib/engine/components/opal/opal-call.h
@@ -64,7 +64,7 @@ namespace Opal {
public:
- Call (CallManager &_manager,
+ Call (Opal::CallManager& _manager,
const std::string & uri);
~Call ();
@@ -88,7 +88,7 @@ public:
/** Transfer the call to the specified uri
* @param: uri: where to transfer the call
*/
- void transfer (std::string uri);
+ bool transfer (std::string uri);
/** Put the call on hold or retrieve it
*/
@@ -227,8 +227,6 @@ private:
/*
* Variables
*/
-
- CallManager & manager;
boost::shared_ptr<Ekiga::NotificationCore> notification_core;
boost::weak_ptr<Ekiga::CallCore> call_core;
@@ -255,6 +253,7 @@ private:
PTime start_time;
RTCPStatistics statistics;
+ bool auto_answer;
};
};
diff --git a/lib/engine/gui/gtk-frontend/call-window.cpp b/lib/engine/gui/gtk-frontend/call-window.cpp
index a59348a..5d2ddcc 100644
--- a/lib/engine/gui/gtk-frontend/call-window.cpp
+++ b/lib/engine/gui/gtk-frontend/call-window.cpp
@@ -279,44 +279,35 @@ static void on_audiooutput_device_error_cb (Ekiga::AudioOutputManager & /*manage
Ekiga::AudioOutputErrorCodes error_code,
gpointer self);
-static void on_ringing_call_cb (boost::shared_ptr<Ekiga::CallManager> manager,
- boost::shared_ptr<Ekiga::Call> call,
+static void on_ringing_call_cb (boost::shared_ptr<Ekiga::Call> call,
gpointer self);
-static void on_established_call_cb (boost::shared_ptr<Ekiga::CallManager> /*manager*/,
- boost::shared_ptr<Ekiga::Call> call,
+static void on_established_call_cb (boost::shared_ptr<Ekiga::Call> call,
gpointer self);
-static void on_cleared_call_cb (boost::shared_ptr<Ekiga::CallManager> /*manager*/,
- boost::shared_ptr<Ekiga::Call> call,
+static void on_cleared_call_cb (boost::shared_ptr<Ekiga::Call> call,
std::string reason,
gpointer self);
-static void on_missed_call_cb (boost::shared_ptr<Ekiga::CallManager> /*manager*/,
- boost::shared_ptr<Ekiga::Call> /*call*/,
+static void on_missed_call_cb (boost::shared_ptr<Ekiga::Call> /*call*/,
gpointer self);
-static void on_held_call_cb (boost::shared_ptr<Ekiga::CallManager> /*manager*/,
- boost::shared_ptr<Ekiga::Call> /*call*/,
+static void on_held_call_cb (boost::shared_ptr<Ekiga::Call> /*call*/,
gpointer self);
-static void on_setup_call_cb (boost::shared_ptr<Ekiga::CallManager> manager,
- boost::shared_ptr<Ekiga::Call> call,
+static void on_setup_call_cb (boost::shared_ptr<Ekiga::Call> call,
gpointer self);
-static void on_retrieved_call_cb (boost::shared_ptr<Ekiga::CallManager> /*manager*/,
- boost::shared_ptr<Ekiga::Call> /*call*/,
+static void on_retrieved_call_cb (boost::shared_ptr<Ekiga::Call> /*call*/,
gpointer self);
-static void on_stream_opened_cb (boost::shared_ptr<Ekiga::CallManager> /*manager*/,
- boost::shared_ptr<Ekiga::Call> /* call */,
+static void on_stream_opened_cb (boost::shared_ptr<Ekiga::Call> /* call */,
std::string name,
Ekiga::Call::StreamType type,
bool is_transmitting,
gpointer self);
-static void on_stream_closed_cb (boost::shared_ptr<Ekiga::CallManager> /*manager*/,
- boost::shared_ptr<Ekiga::Call> /* call */,
+static void on_stream_closed_cb (boost::shared_ptr<Ekiga::Call> /* call */,
G_GNUC_UNUSED std::string name,
Ekiga::Call::StreamType type,
bool is_transmitting,
@@ -789,8 +780,7 @@ on_audiooutput_device_error_cb (Ekiga::AudioOutputManager & /*manager */,
static void
-on_ringing_call_cb (G_GNUC_UNUSED boost::shared_ptr<Ekiga::CallManager> manager,
- G_GNUC_UNUSED boost::shared_ptr<Ekiga::Call> call,
+on_ringing_call_cb (G_GNUC_UNUSED boost::shared_ptr<Ekiga::Call> call,
gpointer data)
{
EkigaCallWindow *self = EKIGA_CALL_WINDOW (data);
@@ -803,8 +793,7 @@ on_ringing_call_cb (G_GNUC_UNUSED boost::shared_ptr<Ekiga::CallManager> manager,
static void
-on_setup_call_cb (boost::shared_ptr<Ekiga::CallManager> manager,
- boost::shared_ptr<Ekiga::Call> call,
+on_setup_call_cb (boost::shared_ptr<Ekiga::Call> call,
gpointer data)
{
EkigaCallWindow *self = EKIGA_CALL_WINDOW (data);
@@ -812,7 +801,7 @@ on_setup_call_cb (boost::shared_ptr<Ekiga::CallManager> manager,
self->priv->menu = Ekiga::GActorMenuPtr (new Ekiga::GActorMenu (*call));
- if (!call->is_outgoing () && !manager->get_auto_answer ()) {
+ if (!call->is_outgoing ()) {
if (self->priv->current_call)
return; // No call setup needed if already in a call
@@ -844,8 +833,7 @@ on_setup_call_cb (boost::shared_ptr<Ekiga::CallManager> manager,
static void
-on_established_call_cb (boost::shared_ptr<Ekiga::CallManager> /*manager*/,
- boost::shared_ptr<Ekiga::Call> call,
+on_established_call_cb (boost::shared_ptr<Ekiga::Call> call,
gpointer data)
{
EkigaCallWindow *self = EKIGA_CALL_WINDOW (data);
@@ -860,8 +848,7 @@ on_established_call_cb (boost::shared_ptr<Ekiga::CallManager> /*manager*/,
}
static void
-on_cleared_call_cb (G_GNUC_UNUSED boost::shared_ptr<Ekiga::CallManager> manager,
- boost::shared_ptr<Ekiga::Call> call,
+on_cleared_call_cb (boost::shared_ptr<Ekiga::Call> call,
G_GNUC_UNUSED std::string reason,
gpointer data)
{
@@ -890,8 +877,7 @@ on_cleared_call_cb (G_GNUC_UNUSED boost::shared_ptr<Ekiga::CallManager> manager,
GTK_MESSAGE_INFO, reason.c_str ());
}
-static void on_missed_call_cb (boost::shared_ptr<Ekiga::CallManager> /*manager*/,
- boost::shared_ptr<Ekiga::Call> call,
+static void on_missed_call_cb (boost::shared_ptr<Ekiga::Call> call,
gpointer data)
{
EkigaCallWindow *self = EKIGA_CALL_WINDOW (data);
@@ -908,8 +894,7 @@ static void on_missed_call_cb (boost::shared_ptr<Ekiga::CallManager> /*manager*
}
static void
-on_held_call_cb (boost::shared_ptr<Ekiga::CallManager> /*manager*/,
- boost::shared_ptr<Ekiga::Call> /*call*/,
+on_held_call_cb (boost::shared_ptr<Ekiga::Call> /*call*/,
gpointer data)
{
EkigaCallWindow *self = EKIGA_CALL_WINDOW (data);
@@ -920,8 +905,7 @@ on_held_call_cb (boost::shared_ptr<Ekiga::CallManager> /*manager*/,
static void
-on_retrieved_call_cb (boost::shared_ptr<Ekiga::CallManager> /*manager*/,
- boost::shared_ptr<Ekiga::Call> /*call*/,
+on_retrieved_call_cb (boost::shared_ptr<Ekiga::Call> /*call*/,
gpointer data)
{
EkigaCallWindow *self = EKIGA_CALL_WINDOW (data);
@@ -951,8 +935,7 @@ set_codec (EkigaCallWindowPrivate *priv,
}
static void
-on_stream_opened_cb (boost::shared_ptr<Ekiga::CallManager> /*manager*/,
- boost::shared_ptr<Ekiga::Call> /* call */,
+on_stream_opened_cb (boost::shared_ptr<Ekiga::Call> /* call */,
std::string name,
Ekiga::Call::StreamType type,
bool is_transmitting,
@@ -966,8 +949,7 @@ on_stream_opened_cb (boost::shared_ptr<Ekiga::CallManager> /*manager*/,
static void
-on_stream_closed_cb (boost::shared_ptr<Ekiga::CallManager> /*manager*/,
- boost::shared_ptr<Ekiga::Call> /* call */,
+on_stream_closed_cb (boost::shared_ptr<Ekiga::Call> /* call */,
G_GNUC_UNUSED std::string name,
Ekiga::Call::StreamType type,
bool is_transmitting,
@@ -1450,31 +1432,31 @@ ekiga_call_window_connect_engine_signals (EkigaCallWindow *self)
self->priv->connections.add (conn);
/* New Call Engine signals */
- conn = self->priv->call_core->setup_call.connect (boost::bind (&on_setup_call_cb, _1, _2, (gpointer)
self));
+ conn = self->priv->call_core->setup_call.connect (boost::bind (&on_setup_call_cb, _1, (gpointer) self));
self->priv->connections.add (conn);
- conn = self->priv->call_core->ringing_call.connect (boost::bind (&on_ringing_call_cb, _1, _2, (gpointer)
self));
+ conn = self->priv->call_core->ringing_call.connect (boost::bind (&on_ringing_call_cb, _1, (gpointer)
self));
self->priv->connections.add (conn);
- conn = self->priv->call_core->established_call.connect (boost::bind (&on_established_call_cb, _1, _2,
(gpointer) self));
+ conn = self->priv->call_core->established_call.connect (boost::bind (&on_established_call_cb, _1,
(gpointer) self));
self->priv->connections.add (conn);
- conn = self->priv->call_core->cleared_call.connect (boost::bind (&on_cleared_call_cb, _1, _2, _3,
(gpointer) self));
+ conn = self->priv->call_core->cleared_call.connect (boost::bind (&on_cleared_call_cb, _1, _2, (gpointer)
self));
self->priv->connections.add (conn);
- conn = self->priv->call_core->missed_call.connect (boost::bind (&on_missed_call_cb, _1, _2, (gpointer)
self));
+ conn = self->priv->call_core->missed_call.connect (boost::bind (&on_missed_call_cb, _1, (gpointer) self));
self->priv->connections.add (conn);
- conn = self->priv->call_core->held_call.connect (boost::bind (&on_held_call_cb, _1, _2, (gpointer) self));
+ conn = self->priv->call_core->held_call.connect (boost::bind (&on_held_call_cb, _1, (gpointer) self));
self->priv->connections.add (conn);
- conn = self->priv->call_core->retrieved_call.connect (boost::bind (&on_retrieved_call_cb, _1, _2,
(gpointer) self));
+ conn = self->priv->call_core->retrieved_call.connect (boost::bind (&on_retrieved_call_cb, _1, (gpointer)
self));
self->priv->connections.add (conn);
- conn = self->priv->call_core->stream_opened.connect (boost::bind (&on_stream_opened_cb, _1, _2, _3, _4,
_5, (gpointer) self));
+ conn = self->priv->call_core->stream_opened.connect (boost::bind (&on_stream_opened_cb, _1, _2, _3, _4,
(gpointer) self));
self->priv->connections.add (conn);
- conn = self->priv->call_core->stream_closed.connect (boost::bind (&on_stream_closed_cb, _1, _2, _3, _4,
_5, (gpointer) self));
+ conn = self->priv->call_core->stream_closed.connect (boost::bind (&on_stream_closed_cb, _1, _2, _3, _4,
(gpointer) self));
self->priv->connections.add (conn);
}
diff --git a/lib/engine/gui/gtk-frontend/ekiga-app.cpp b/lib/engine/gui/gtk-frontend/ekiga-app.cpp
index 7a7cf0d..86fa8ea 100644
--- a/lib/engine/gui/gtk-frontend/ekiga-app.cpp
+++ b/lib/engine/gui/gtk-frontend/ekiga-app.cpp
@@ -99,8 +99,6 @@
*/
struct _GmApplicationPrivate
{
- _GmApplicationPrivate () {}
-
Ekiga::ServiceCorePtr core;
GtkBuilder *builder;
@@ -124,8 +122,7 @@ static void gm_application_populate_application_menu (GmApplication *app);
static GtkWidget *gm_application_show_call_window (GmApplication *self);
-static void on_created_call_cb (boost::shared_ptr<Ekiga::CallManager> manager,
- boost::shared_ptr<Ekiga::Call> call,
+static void on_created_call_cb (boost::shared_ptr<Ekiga::Call> call,
gpointer data);
static bool on_visit_banks_cb (Ekiga::BankPtr bank,
@@ -223,8 +220,7 @@ gm_application_show_call_window (GmApplication *self)
/* Private callbacks */
static void
-on_created_call_cb (G_GNUC_UNUSED boost::shared_ptr<Ekiga::CallManager> manager,
- G_GNUC_UNUSED boost::shared_ptr<Ekiga::Call> call,
+on_created_call_cb (G_GNUC_UNUSED boost::shared_ptr<Ekiga::Call> call,
gpointer data)
{
g_return_if_fail (GM_IS_APPLICATION (data));
@@ -411,7 +407,6 @@ ekiga_main (int argc,
app->priv->main_window = gm_main_window_new (app);
gm_application_show_main_window (app);
- app->priv->chat_window = chat_window_new (app);
status_icon_new (app);
#ifdef HAVE_DBUS
@@ -431,7 +426,7 @@ ekiga_main (int argc,
g_return_if_fail (all_codecs.find ("VP8"));
g_return_if_fail (all_codecs.find ("H.264"));
g_return_if_fail (all_codecs.find ("Opus"));
- call_core->created_call.connect (boost::bind (&on_created_call_cb, _1, _2, (gpointer) app));
+ call_core->created_call.connect (boost::bind (&on_created_call_cb, _1, (gpointer) app));
boost::shared_ptr<Ekiga::AccountCore> account_core = app->priv->core->get<Ekiga::AccountCore>
("account-core");
g_return_if_fail (account_core);
@@ -479,6 +474,7 @@ gm_application_startup (GApplication *app)
signal (SIGPIPE, SIG_IGN);
#endif
+
/* initialize platform-specific code */
gm_platform_init ();
#ifdef WIN32
@@ -501,7 +497,6 @@ gm_application_startup (GApplication *app)
#endif
/* Priv building */
- self->priv = new _GmApplicationPrivate ();
self->priv->builder = gtk_builder_new ();
/* Menu */
@@ -564,43 +559,29 @@ gm_application_startup (GApplication *app)
static void
-gm_application_dispose (GObject *obj)
-{
- GmApplication *self = NULL;
-
- self = GM_APPLICATION (obj);
-
-#ifdef HAVE_DBUS
- g_object_unref (self->priv->dbus_component);
-#endif
- g_object_unref (self->priv->builder);
-
- delete self->priv;
-
- G_OBJECT_CLASS (gm_application_parent_class)->dispose (obj);
-}
-
-
-static void
gm_application_shutdown (GApplication *app)
{
GmApplication *self = GM_APPLICATION (app);
g_return_if_fail (self);
- gtk_widget_hide (GTK_WIDGET (self->priv->main_window));
-
self->priv->banks_menu.clear ();
self->priv->core.reset ();
Ekiga::Runtime::quit ();
gm_platform_shutdown ();
- PThread::Current()->Sleep (5000); // FIXME, This allows all threads to start and quit. Sucks.
+#ifdef HAVE_DBUS
+ g_object_unref (self->priv->dbus_component);
+#endif
+ g_object_unref (self->priv->builder);
+
+ delete self->priv;
G_APPLICATION_CLASS (gm_application_parent_class)->shutdown (app);
}
+
static gint
gm_application_command_line (GApplication *app,
GApplicationCommandLine *cl)
@@ -714,8 +695,6 @@ gm_application_class_init (GmApplicationClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GApplicationClass *app_class = G_APPLICATION_CLASS (klass);
- object_class->dispose = gm_application_dispose;
-
app_class->startup = gm_application_startup;
app_class->activate = gm_application_activate;
app_class->command_line = gm_application_command_line;
diff --git a/lib/engine/gui/gtk-frontend/main_window.cpp b/lib/engine/gui/gtk-frontend/main_window.cpp
index 795cdc5..cb311db 100644
--- a/lib/engine/gui/gtk-frontend/main_window.cpp
+++ b/lib/engine/gui/gtk-frontend/main_window.cpp
@@ -342,13 +342,12 @@ on_account_updated (Ekiga::BankPtr /*bank*/,
}
-static void on_setup_call_cb (boost::shared_ptr<Ekiga::CallManager> manager,
- boost::shared_ptr<Ekiga::Call> call,
+static void on_setup_call_cb (boost::shared_ptr<Ekiga::Call> call,
gpointer self)
{
EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
- if (!call->is_outgoing () && !manager->get_auto_answer ()) {
+ if (!call->is_outgoing ()) {
if (mw->priv->current_call)
return; // No call setup needed if already in a call
@@ -369,8 +368,7 @@ static void on_setup_call_cb (boost::shared_ptr<Ekiga::CallManager> manager,
}
-static void on_ringing_call_cb (boost::shared_ptr<Ekiga::CallManager> /*manager*/,
- boost::shared_ptr<Ekiga::Call> call,
+static void on_ringing_call_cb (boost::shared_ptr<Ekiga::Call> call,
gpointer self)
{
EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
@@ -381,8 +379,7 @@ static void on_ringing_call_cb (boost::shared_ptr<Ekiga::CallManager> /*manager
}
-static void on_established_call_cb (boost::shared_ptr<Ekiga::CallManager> /*manager*/,
- boost::shared_ptr<Ekiga::Call> /*call*/,
+static void on_established_call_cb (boost::shared_ptr<Ekiga::Call> /*call*/,
gpointer self)
{
EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
@@ -396,8 +393,7 @@ static void on_established_call_cb (boost::shared_ptr<Ekiga::CallManager> /*mana
}
-static void on_cleared_call_cb (boost::shared_ptr<Ekiga::CallManager> /*manager*/,
- boost::shared_ptr<Ekiga::Call> call,
+static void on_cleared_call_cb (boost::shared_ptr<Ekiga::Call> call,
std::string /*reason*/,
gpointer self)
{
@@ -423,8 +419,7 @@ static void on_cleared_call_cb (boost::shared_ptr<Ekiga::CallManager> /*manager
}
-static void on_missed_call_cb (boost::shared_ptr<Ekiga::CallManager> /*manager*/,
- boost::shared_ptr<Ekiga::Call> call,
+static void on_missed_call_cb (boost::shared_ptr<Ekiga::Call> call,
gpointer self)
{
EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (self);
@@ -914,19 +909,19 @@ ekiga_main_window_connect_engine_signals (EkigaMainWindow *mw)
conn = mw->priv->account_core->account_updated.connect (boost::bind (&on_account_updated, _1, _2,
(gpointer) mw));
mw->priv->connections.add (conn);
- conn = mw->priv->call_core->setup_call.connect (boost::bind (&on_setup_call_cb, _1, _2, (gpointer) mw));
+ conn = mw->priv->call_core->setup_call.connect (boost::bind (&on_setup_call_cb, _1, (gpointer) mw));
mw->priv->connections.add (conn);
- conn = mw->priv->call_core->ringing_call.connect (boost::bind (&on_ringing_call_cb, _1, _2, (gpointer)
mw));
+ conn = mw->priv->call_core->ringing_call.connect (boost::bind (&on_ringing_call_cb, _1, (gpointer) mw));
mw->priv->connections.add (conn);
- conn = mw->priv->call_core->established_call.connect (boost::bind (&on_established_call_cb, _1, _2,
(gpointer) mw));
+ conn = mw->priv->call_core->established_call.connect (boost::bind (&on_established_call_cb, _1, (gpointer)
mw));
mw->priv->connections.add (conn);
- conn = mw->priv->call_core->cleared_call.connect (boost::bind (&on_cleared_call_cb, _1, _2, _3, (gpointer)
mw));
+ conn = mw->priv->call_core->cleared_call.connect (boost::bind (&on_cleared_call_cb, _1, _2, (gpointer)
mw));
mw->priv->connections.add (conn);
- conn = mw->priv->call_core->missed_call.connect (boost::bind (&on_missed_call_cb, _1, _2, (gpointer) mw));
+ conn = mw->priv->call_core->missed_call.connect (boost::bind (&on_missed_call_cb, _1, (gpointer) mw));
mw->priv->connections.add (conn);
conn = mw->priv->call_core->errors.connect (boost::bind (&on_handle_errors, _1, (gpointer) mw));
diff --git a/lib/engine/gui/gtk-frontend/statusicon.cpp b/lib/engine/gui/gtk-frontend/statusicon.cpp
index e090839..d4deed7 100644
--- a/lib/engine/gui/gtk-frontend/statusicon.cpp
+++ b/lib/engine/gui/gtk-frontend/statusicon.cpp
@@ -128,13 +128,11 @@ statusicon_set_inacall (StatusIcon *widget,
bool inacall);
static void
-established_call_cb (boost::shared_ptr<Ekiga::CallManager> manager,
- boost::shared_ptr<Ekiga::Call> call,
+established_call_cb (boost::shared_ptr<Ekiga::Call> call,
gpointer self);
static void
-cleared_call_cb (boost::shared_ptr<Ekiga::CallManager> manager,
- boost::shared_ptr<Ekiga::Call> call,
+cleared_call_cb (boost::shared_ptr<Ekiga::Call> call,
std::string reason,
gpointer self);
@@ -367,8 +365,7 @@ personal_details_updated_cb (StatusIcon* self,
static void
-established_call_cb (boost::shared_ptr<Ekiga::CallManager> /*manager*/,
- boost::shared_ptr<Ekiga::Call> /*call*/,
+established_call_cb (boost::shared_ptr<Ekiga::Call> /*call*/,
gpointer self)
{
statusicon_set_inacall (STATUSICON (self), true);
@@ -376,8 +373,7 @@ established_call_cb (boost::shared_ptr<Ekiga::CallManager> /*manager*/,
static void
-cleared_call_cb (boost::shared_ptr<Ekiga::CallManager> /*manager*/,
- boost::shared_ptr<Ekiga::Call> /*call*/,
+cleared_call_cb (boost::shared_ptr<Ekiga::Call> /*call*/,
std::string /*reason*/,
gpointer self)
{
@@ -570,11 +566,11 @@ status_icon_new (GmApplication *app)
self->priv->connections.add (conn);
conn = call_core->established_call.connect (boost::bind (&established_call_cb,
- _1, _2, (gpointer) self));
+ _1, (gpointer) self));
self->priv->connections.add (conn);
conn = call_core->cleared_call.connect (boost::bind (&cleared_call_cb,
- _1, _2, _3, (gpointer) self));
+ _1, _2, (gpointer) self));
self->priv->connections.add (conn);
g_signal_connect (self, "activate",
diff --git a/lib/engine/protocol/call-core.cpp b/lib/engine/protocol/call-core.cpp
index 3c3102b..b519efb 100644
--- a/lib/engine/protocol/call-core.cpp
+++ b/lib/engine/protocol/call-core.cpp
@@ -151,7 +151,7 @@ CallCore::set_codecs (Ekiga::CodecList & codecs)
}
-void CallCore::add_call (boost::shared_ptr<Call> call, boost::shared_ptr<CallManager> manager)
+void CallCore::add_call (boost::shared_ptr<Call> call)
{
Ekiga::FriendOrFoe::Identification id = iff->decide ("call", call->get_remote_uri ());
@@ -161,32 +161,21 @@ void CallCore::add_call (boost::shared_ptr<Call> call, boost::shared_ptr<CallMan
return;
}
- created_call (manager, call);
+ created_call (call);
boost::shared_ptr<Ekiga::scoped_connections> conns(new Ekiga::scoped_connections);
- conns->add (call->ringing.connect (boost::bind (&CallCore::on_ringing_call, this,
- call, manager)));
- conns->add (call->setup.connect (boost::bind (&CallCore::on_setup_call, this,
- call, manager)));
- conns->add (call->missed.connect (boost::bind (&CallCore::on_missed_call, this,
- call, manager)));
- conns->add (call->cleared.connect (boost::bind (&CallCore::on_cleared_call, this,
- _1, call, manager)));
- conns->add (call->established.connect (boost::bind (&CallCore::on_established_call, this,
- call, manager)));
- conns->add (call->held.connect (boost::bind (&CallCore::on_held_call, this,
- call, manager)));
- conns->add (call->retrieved.connect (boost::bind (&CallCore::on_retrieved_call, this,
- call, manager)));
- conns->add (call->stream_opened.connect (boost::bind (&CallCore::on_stream_opened, this,
- _1, _2, _3, call, manager)));
- conns->add (call->stream_closed.connect (boost::bind (&CallCore::on_stream_closed, this,
- _1, _2, _3, call, manager)));
- conns->add (call->stream_paused.connect (boost::bind (&CallCore::on_stream_paused, this,
- _1, _2, call, manager)));
- conns->add (call->stream_resumed.connect (boost::bind (&CallCore::on_stream_resumed, this,
- _1, _2, call, manager)));
+ conns->add (call->ringing.connect (boost::bind (boost::ref (ringing_call), call)));
+ conns->add (call->setup.connect (boost::bind (boost::ref (setup_call), call)));
+ conns->add (call->missed.connect (boost::bind (boost::ref (missed_call), call)));
+ conns->add (call->cleared.connect (boost::bind (boost::ref (cleared_call), call, _1)));
+ conns->add (call->established.connect (boost::bind (boost::ref (established_call), call)));
+ conns->add (call->held.connect (boost::bind (boost::ref (held_call), call)));
+ conns->add (call->retrieved.connect (boost::bind (boost::ref (retrieved_call), call)));
+ conns->add (call->stream_opened.connect (boost::bind (boost::ref (stream_opened), call, _1, _2, _3)));
+ conns->add (call->stream_closed.connect (boost::bind (boost::ref (stream_closed), call, _1, _2, _3)));
+ conns->add (call->stream_paused.connect (boost::bind (boost::ref (stream_paused), call, _1, _2)));
+ conns->add (call->stream_resumed.connect (boost::bind (boost::ref (stream_resumed), call, _1, _2)));
conns->add (call->removed.connect (boost::bind (&CallCore::on_call_removed, this, call)));
call_connections [call->get_id ()] = conns;
@@ -199,72 +188,6 @@ void CallCore::remove_call (boost::shared_ptr<Call> call)
}
-void CallCore::on_ringing_call (boost::shared_ptr<Call> call, boost::shared_ptr<CallManager> manager)
-{
- ringing_call (manager, call);
-}
-
-
-void CallCore::on_setup_call (boost::shared_ptr<Call> call, boost::shared_ptr<CallManager> manager)
-{
- setup_call (manager, call);
-}
-
-
-void CallCore::on_missed_call (boost::shared_ptr<Call> call, boost::shared_ptr<CallManager> manager)
-{
- missed_call (manager, call);
-}
-
-
-void CallCore::on_cleared_call (std::string reason, boost::shared_ptr<Call> call,
boost::shared_ptr<CallManager> manager)
-{
- cleared_call (manager, call, reason);
-}
-
-
-void CallCore::on_established_call (boost::shared_ptr<Call> call, boost::shared_ptr<CallManager> manager)
-{
- established_call (manager, call);
-}
-
-
-void CallCore::on_held_call (boost::shared_ptr<Call> call, boost::shared_ptr<CallManager> manager)
-{
- held_call (manager, call);
-}
-
-
-void CallCore::on_retrieved_call (boost::shared_ptr<Call> call, boost::shared_ptr<CallManager> manager)
-{
- retrieved_call (manager, call);
-}
-
-
-void CallCore::on_stream_opened (std::string name, Call::StreamType type, bool is_transmitting,
boost::shared_ptr<Call> call, boost::shared_ptr<CallManager> manager)
-{
- stream_opened (manager, call, name, type, is_transmitting);
-}
-
-
-void CallCore::on_stream_closed (std::string name, Call::StreamType type, bool is_transmitting,
boost::shared_ptr<Call> call, boost::shared_ptr<CallManager> manager)
-{
- stream_closed (manager, call, name, type, is_transmitting);
-}
-
-
-void CallCore::on_stream_paused (std::string name, Call::StreamType type, boost::shared_ptr<Call> call,
boost::shared_ptr<CallManager> manager)
-{
- stream_paused (manager, call, name, type);
-}
-
-
-void CallCore::on_stream_resumed (std::string name, Call::StreamType type, boost::shared_ptr<Call> call,
boost::shared_ptr<CallManager> manager)
-{
- stream_resumed (manager, call, name, type);
-}
-
-
void CallCore::on_manager_ready (boost::shared_ptr<CallManager> manager)
{
manager_ready (manager);
diff --git a/lib/engine/protocol/call-core.h b/lib/engine/protocol/call-core.h
index fbcccfa..a68b85f 100644
--- a/lib/engine/protocol/call-core.h
+++ b/lib/engine/protocol/call-core.h
@@ -96,9 +96,8 @@ namespace Ekiga
/** Adds a call handled by the CallCore serice.
* @param call is the call to be added.
- * @param manager is the CallManager handling it.
*/
- void add_call (boost::shared_ptr<Call> call, boost::shared_ptr<CallManager> manager);
+ void add_call (boost::shared_ptr<Call> call);
/** Remove a call handled by the CallCore serice.
* @param call is the call to be removed.
@@ -167,18 +166,18 @@ namespace Ekiga
/** See call.h for the API
*/
- boost::signals2::signal<void(boost::shared_ptr<CallManager>, boost::shared_ptr<Call>)> ringing_call;
- boost::signals2::signal<void(boost::shared_ptr<CallManager>, boost::shared_ptr<Call>)> setup_call;
- boost::signals2::signal<void(boost::shared_ptr<CallManager>, boost::shared_ptr<Call>)> missed_call;
- boost::signals2::signal<void(boost::shared_ptr<CallManager>, boost::shared_ptr<Call>, std::string)>
cleared_call;
- boost::signals2::signal<void(boost::shared_ptr<CallManager>, boost::shared_ptr<Call>)> created_call;
- boost::signals2::signal<void(boost::shared_ptr<CallManager>, boost::shared_ptr<Call>)>
established_call;
- boost::signals2::signal<void(boost::shared_ptr<CallManager>, boost::shared_ptr<Call>)> held_call;
- boost::signals2::signal<void(boost::shared_ptr<CallManager>, boost::shared_ptr<Call>)> retrieved_call;
- boost::signals2::signal<void(boost::shared_ptr<CallManager>, boost::shared_ptr<Call>, std::string,
Call::StreamType, bool)> stream_opened;
- boost::signals2::signal<void(boost::shared_ptr<CallManager>, boost::shared_ptr<Call>, std::string,
Call::StreamType, bool)> stream_closed;
- boost::signals2::signal<void(boost::shared_ptr<CallManager>, boost::shared_ptr<Call>, std::string,
Call::StreamType)> stream_paused;
- boost::signals2::signal<void(boost::shared_ptr<CallManager>, boost::shared_ptr<Call>, std::string,
Call::StreamType)> stream_resumed;
+ boost::signals2::signal<void(boost::shared_ptr<Call>)> ringing_call;
+ boost::signals2::signal<void(boost::shared_ptr<Call>)> setup_call;
+ boost::signals2::signal<void(boost::shared_ptr<Call>)> missed_call;
+ boost::signals2::signal<void(boost::shared_ptr<Call>, std::string)> cleared_call;
+ boost::signals2::signal<void(boost::shared_ptr<Call>)> created_call;
+ boost::signals2::signal<void(boost::shared_ptr<Call>)> established_call;
+ boost::signals2::signal<void(boost::shared_ptr<Call>)> held_call;
+ boost::signals2::signal<void(boost::shared_ptr<Call>)> retrieved_call;
+ boost::signals2::signal<void(boost::shared_ptr<Call>, std::string, Call::StreamType, bool)>
stream_opened;
+ boost::signals2::signal<void(boost::shared_ptr<Call>, std::string, Call::StreamType, bool)>
stream_closed;
+ boost::signals2::signal<void(boost::shared_ptr<Call>, std::string, Call::StreamType)> stream_paused;
+ boost::signals2::signal<void(boost::shared_ptr<Call>, std::string, Call::StreamType)> stream_resumed;
/*** Misc ***/
boost::signals2::signal<void(boost::shared_ptr<CallManager>)> manager_ready;
@@ -189,18 +188,6 @@ namespace Ekiga
ChainOfResponsibility<std::string> errors;
private:
- void on_new_call (boost::shared_ptr<Call> call, boost::shared_ptr<CallManager> manager);
- void on_ringing_call (boost::shared_ptr<Call> call, boost::shared_ptr<CallManager> manager);
- void on_setup_call (boost::shared_ptr<Call> call, boost::shared_ptr<CallManager> manager);
- void on_missed_call (boost::shared_ptr<Call> call, boost::shared_ptr<CallManager> manager);
- void on_cleared_call (std::string, boost::shared_ptr<Call> call, boost::shared_ptr<CallManager>
manager);
- void on_established_call (boost::shared_ptr<Call> call, boost::shared_ptr<CallManager> manager);
- void on_held_call (boost::shared_ptr<Call> call, boost::shared_ptr<CallManager> manager);
- void on_retrieved_call (boost::shared_ptr<Call> call, boost::shared_ptr<CallManager> manager);
- void on_stream_opened (std::string name, Call::StreamType type, bool is_transmitting,
boost::shared_ptr<Call> call, boost::shared_ptr<CallManager> manager);
- void on_stream_closed (std::string name, Call::StreamType type, bool is_transmitting,
boost::shared_ptr<Call> call, boost::shared_ptr<CallManager> manager);
- void on_stream_paused (std::string name, Call::StreamType type, boost::shared_ptr<Call> call,
boost::shared_ptr<CallManager> manager);
- void on_stream_resumed (std::string name, Call::StreamType type, boost::shared_ptr<Call> call,
boost::shared_ptr<CallManager> manager);
void on_im_failed (std::string, std::string, boost::shared_ptr<CallManager> manager);
void on_im_sent (std::string, std::string, boost::shared_ptr<CallManager> manager);
diff --git a/lib/engine/protocol/call.h b/lib/engine/protocol/call.h
index 4b04238..55c033f 100644
--- a/lib/engine/protocol/call.h
+++ b/lib/engine/protocol/call.h
@@ -89,8 +89,9 @@ namespace Ekiga
/** Transfer the call to the specified uri
* @param uri is the uri where to transfer the call
+ * @return false if the transfer could not be tried
*/
- virtual void transfer (std::string uri) = 0;
+ virtual bool transfer (std::string uri) = 0;
/** Put the call on hold or retrieve it
*/
diff --git a/plugins/libnotify/libnotify-main.cpp b/plugins/libnotify/libnotify-main.cpp
index 9d1d351..a62e055 100644
--- a/plugins/libnotify/libnotify-main.cpp
+++ b/plugins/libnotify/libnotify-main.cpp
@@ -74,8 +74,7 @@ private:
void on_notification_added (boost::shared_ptr<Ekiga::Notification> notif);
void on_notification_removed (boost::shared_ptr<Ekiga::Notification> notif);
- void on_call_notification (boost::shared_ptr<Ekiga::CallManager> manager,
- boost::shared_ptr<Ekiga::Call> call);
+ void on_call_notification (boost::shared_ptr<Ekiga::Call> call);
void on_call_notification_closed (gpointer self);
typedef std::map<boost::shared_ptr<Ekiga::Notification>, std::pair<boost::signals2::connection,
boost::shared_ptr<NotifyNotification> > > container_type;
@@ -183,7 +182,7 @@ LibNotify::LibNotify (Ekiga::ServiceCore& core)
connections.add (notification_core->notification_added.connect (boost::bind
(&LibNotify::on_notification_added, this, _1)));
/* Specific notifications */
- connections.add (call_core->setup_call.connect (boost::bind (&LibNotify::on_call_notification, this, _1,
_2)));
+ connections.add (call_core->setup_call.connect (boost::bind (&LibNotify::on_call_notification, this, _1)));
}
LibNotify::~LibNotify ()
@@ -261,13 +260,12 @@ LibNotify::on_call_notification_closed (gpointer self)
}
void
-LibNotify::on_call_notification (boost::shared_ptr<Ekiga::CallManager> manager,
- boost::shared_ptr<Ekiga::Call> call)
+LibNotify::on_call_notification (boost::shared_ptr<Ekiga::Call> call)
{
NotifyNotification *notify = NULL;
call_reference* ref = NULL;
- if (call->is_outgoing () || manager->get_auto_answer ())
+ if (call->is_outgoing ())
return; // Ignore
gchar *title = g_strdup_printf (_("Incoming call from %s"), call->get_remote_party_name ().c_str ());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]