ekiga r6524 - in trunk: . lib/engine/addressbook/ldap lib/engine/audioinput/null lib/engine/audioinput/ptlib lib/engine/audioinput/skel lib/engine/audiooutput/null lib/engine/audiooutput/ptlib lib/engine/audiooutput/skel lib/engine/framework lib/engine/videoinput/mlogo lib/engine/videoinput/ptlib lib/engine/videoinput/skel lib/engine/videooutput/common lib/engine/videooutput/x src/endpoints



Author: jpuydt
Date: Sun Jul 27 15:08:45 2008
New Revision: 6524
URL: http://svn.gnome.org/viewvc/ekiga?rev=6524&view=rev

Log:
Merge branch 'bugfixing'

* bugfixing:
  Changed the run_in_main method of Ekiga::Runtime to avoid crashes... uglier, but safer :-(

Modified:
   trunk/ChangeLog
   trunk/lib/engine/addressbook/ldap/ldap-book.cpp
   trunk/lib/engine/addressbook/ldap/ldap-book.h
   trunk/lib/engine/audioinput/null/audioinput-manager-null.cpp
   trunk/lib/engine/audioinput/ptlib/audioinput-manager-ptlib.cpp
   trunk/lib/engine/audioinput/skel/audioinput-core.cpp
   trunk/lib/engine/audiooutput/null/audiooutput-manager-null.cpp
   trunk/lib/engine/audiooutput/ptlib/audiooutput-manager-ptlib.cpp
   trunk/lib/engine/audiooutput/skel/audiooutput-core.cpp
   trunk/lib/engine/framework/runtime-glib.cpp
   trunk/lib/engine/framework/runtime-glib.h
   trunk/lib/engine/framework/runtime.h
   trunk/lib/engine/videoinput/mlogo/videoinput-manager-mlogo.cpp
   trunk/lib/engine/videoinput/ptlib/videoinput-manager-ptlib.cpp
   trunk/lib/engine/videoinput/skel/videoinput-core.cpp
   trunk/lib/engine/videooutput/common/videooutput-manager-common.cpp
   trunk/lib/engine/videooutput/x/videooutput-manager-x.cpp
   trunk/src/endpoints/h323.cpp
   trunk/src/endpoints/manager.cpp
   trunk/src/endpoints/opal-call.cpp
   trunk/src/endpoints/pcss.cpp
   trunk/src/endpoints/sip.cpp

Modified: trunk/lib/engine/addressbook/ldap/ldap-book.cpp
==============================================================================
--- trunk/lib/engine/addressbook/ldap/ldap-book.cpp	(original)
+++ trunk/lib/engine/addressbook/ldap/ldap-book.cpp	Sun Jul 27 15:08:45 2008
@@ -50,6 +50,32 @@
 #include "form-request-simple.h"
 #include "robust-xml.h"
 
+/* stupid run_in_main helpers */
+
+struct refresh_bound_in_main: public Ekiga::RuntimeCallback
+{
+  refresh_bound_in_main (OPENLDAP::Book* book_): book(book_)
+  {}
+
+  void run ()
+  { book-> refresh_bound (); }
+
+private:
+  OPENLDAP::Book* book;
+};
+
+struct refresh_result_in_main: public Ekiga::RuntimeCallback
+{
+  refresh_result_in_main (OPENLDAP::Book* book_): book(book_)
+  {}
+
+  void run ()
+  { book-> refresh_result (); }
+
+private:
+  OPENLDAP::Book* book;
+};
+
 /* little helper function... can probably be made more complete */
 static const std::string
 fix_to_utf8 (const std::string str)
@@ -422,7 +448,7 @@
   updated.emit ();
 
   patience = 3;
-  runtime.run_in_main (sigc::mem_fun (this, &OPENLDAP::Book::refresh_bound), 3);
+  runtime.run_in_main (new refresh_bound_in_main (this), 3);
 }
 
 void
@@ -444,15 +470,15 @@
 
     if (patience == 3) {
       patience--;
-      runtime.run_in_main (sigc::mem_fun (this, &OPENLDAP::Book::refresh_bound), 12);
+      runtime.run_in_main (new refresh_bound_in_main (this), 12);
     } else if (patience == 2) {
 
       patience--;
-      runtime.run_in_main (sigc::mem_fun (this, &OPENLDAP::Book::refresh_bound), 21);
+      runtime.run_in_main (new refresh_bound_in_main (this), 21);
     } else if (patience == 1) {
 
       patience--;
-      runtime.run_in_main (sigc::mem_fun (this, &OPENLDAP::Book::refresh_bound), 30);
+      runtime.run_in_main (new refresh_bound_in_main (this), 30);
     } else { // patience == 0
 
       status = std::string (_("Could not connect to server"));
@@ -518,7 +544,7 @@
   }
 
   patience = 3;
-  runtime.run_in_main (sigc::mem_fun (this, &OPENLDAP::Book::refresh_result), 3);
+  runtime.run_in_main (new refresh_result_in_main (this), 3);
 
 }
 
@@ -541,15 +567,15 @@
     if (patience == 3) {
 
       patience--;
-      runtime.run_in_main (sigc::mem_fun (this, &OPENLDAP::Book::refresh_result), 12);
+      runtime.run_in_main (new refresh_result_in_main (this), 12);
     } else if (patience == 2) {
 
       patience--;
-      runtime.run_in_main (sigc::mem_fun (this, &OPENLDAP::Book::refresh_result), 21);
+      runtime.run_in_main (new refresh_result_in_main (this), 21);
     } else if (patience == 1) {
 
       patience--;
-      runtime.run_in_main (sigc::mem_fun (this, &OPENLDAP::Book::refresh_result), 30);
+      runtime.run_in_main (new refresh_result_in_main (this), 30);
     } else { // patience == 0
 
       status = std::string (_("Could not search"));

Modified: trunk/lib/engine/addressbook/ldap/ldap-book.h
==============================================================================
--- trunk/lib/engine/addressbook/ldap/ldap-book.h	(original)
+++ trunk/lib/engine/addressbook/ldap/ldap-book.h	Sun Jul 27 15:08:45 2008
@@ -91,11 +91,13 @@
 
     sigc::signal<void> trigger_saving;
 
+    /* should be private, but have to be called by C code */
+    void refresh_bound ();
+    void refresh_result ();
+
   private:
 
     void refresh_start ();
-    void refresh_bound ();
-    void refresh_result ();
 
     void edit ();
     void on_edit_form_submitted (Ekiga::Form &);

Modified: trunk/lib/engine/audioinput/null/audioinput-manager-null.cpp
==============================================================================
--- trunk/lib/engine/audioinput/null/audioinput-manager-null.cpp	(original)
+++ trunk/lib/engine/audioinput/null/audioinput-manager-null.cpp	Sun Jul 27 15:08:45 2008
@@ -38,6 +38,47 @@
 #define DEVICE_SOURCE "NULL"
 #define DEVICE_NAME   "NULL"
 
+/* run_in_main helpers */
+
+struct device_opened_in_main: public Ekiga::RuntimeCallback
+{
+  device_opened_in_main (GMAudioInputManager_null* manager_,
+			 Ekiga::AudioInputDevice device_,
+			 Ekiga::AudioInputConfig settings_):
+    manager(manager_), device(device_), settings(settings_)
+  {}
+
+  void run ()
+  {
+    manager->device_opened.emit (device, settings);
+  }
+
+private:
+  GMAudioInputManager_null* manager;
+  Ekiga::AudioInputDevice device;
+  Ekiga::AudioInputConfig settings;
+};
+
+struct device_closed_in_main: public Ekiga::RuntimeCallback
+{
+  device_closed_in_main (GMAudioInputManager_null* manager_,
+			 Ekiga::AudioInputDevice device_):
+    manager(manager_), device(device_)
+  {}
+
+  void run ()
+  {
+    manager->device_closed.emit (device);
+  }
+
+private:
+  GMAudioInputManager_null* manager;
+  Ekiga::AudioInputDevice device;
+};
+
+
+
+
 GMAudioInputManager_null::GMAudioInputManager_null (Ekiga::ServiceCore & _core)
 :    core (_core), runtime (*(dynamic_cast<Ekiga::Runtime *> (_core.get ("runtime"))))
 {
@@ -81,7 +122,7 @@
   Ekiga::AudioInputConfig config;
   config.volume = 0;
   config.modifyable = false;
-  runtime.run_in_main (sigc::bind (device_opened.make_slot (), current_state.device, config));
+  runtime.run_in_main (new device_opened_in_main (this, current_state.device, config));
 
   return true;
 }
@@ -89,7 +130,7 @@
 void GMAudioInputManager_null::close()
 {
   current_state.opened = false;
-  runtime.run_in_main (sigc::bind (device_closed.make_slot (), current_state.device));
+  runtime.run_in_main (new device_closed_in_main (this, current_state.device));
 }
 
 

Modified: trunk/lib/engine/audioinput/ptlib/audioinput-manager-ptlib.cpp
==============================================================================
--- trunk/lib/engine/audioinput/ptlib/audioinput-manager-ptlib.cpp	(original)
+++ trunk/lib/engine/audioinput/ptlib/audioinput-manager-ptlib.cpp	Sun Jul 27 15:08:45 2008
@@ -40,6 +40,65 @@
 
 #define DEVICE_TYPE "PTLIB"
 
+/* run_in_main helpers */
+
+struct device_opened_in_main: public Ekiga::RuntimeCallback
+{
+  device_opened_in_main (GMAudioInputManager_ptlib* manager_,
+			 Ekiga::AudioInputDevice device_,
+			 Ekiga::AudioInputConfig config_):
+    manager(manager_), device(device_), config(config_)
+  {}
+
+  void run ()
+  {
+    manager->device_opened.emit (device, config);
+  }
+
+private:
+  GMAudioInputManager_ptlib* manager;
+  Ekiga::AudioInputDevice device;
+  Ekiga::AudioInputConfig config;
+};
+
+struct device_closed_in_main: public Ekiga::RuntimeCallback
+{
+  device_closed_in_main (GMAudioInputManager_ptlib* manager_,
+			 Ekiga::AudioInputDevice device_):
+    manager(manager_), device(device_)
+  {}
+
+  void run ()
+  {
+    manager->device_closed.emit (device);
+  }
+
+private:
+  GMAudioInputManager_ptlib* manager;
+  Ekiga::AudioInputDevice device;
+};
+
+struct device_error_in_main: public Ekiga::RuntimeCallback
+{
+  device_error_in_main (GMAudioInputManager_ptlib* manager_,
+			Ekiga::AudioInputDevice device_,
+			Ekiga::AudioInputErrorCodes error_code_):
+    manager(manager_), device(device_), error_code(error_code_)
+  {}
+
+  void run ()
+  {
+    manager->device_closed.emit (device);
+  }
+
+private:
+  GMAudioInputManager_ptlib* manager;
+  Ekiga::AudioInputDevice device;
+  Ekiga::AudioInputErrorCodes error_code;
+};
+
+
+
 GMAudioInputManager_ptlib::GMAudioInputManager_ptlib (Ekiga::ServiceCore & _core)
 : core (_core), 
   runtime (*(dynamic_cast<Ekiga::Runtime *> (_core.get ("runtime"))))
@@ -114,7 +173,7 @@
 
   if (error_code != Ekiga::AI_ERROR_NONE) {
     PTRACE(1, "GMAudioInputManager_ptlib\tEncountered error " << error_code << " while opening device ");
-    runtime.run_in_main (sigc::bind (device_error.make_slot (), current_state.device, error_code));
+    runtime.run_in_main (new device_error_in_main (this, current_state.device, error_code));
     return false;
   }
 
@@ -125,7 +184,7 @@
   Ekiga::AudioInputConfig config;
   config.volume = volume;
   config.modifyable = true;
-  runtime.run_in_main (sigc::bind (device_opened.make_slot (), current_state.device, config));
+  runtime.run_in_main (new device_opened_in_main (this, current_state.device, config));
 
   return true;
 }
@@ -138,7 +197,7 @@
      input_device = NULL;
   }
   current_state.opened = false;
-  runtime.run_in_main (sigc::bind (device_closed.make_slot (), current_state.device));
+  runtime.run_in_main (new device_closed_in_main (this, current_state.device));
 }
 
 void GMAudioInputManager_ptlib::set_buffer_size (unsigned buffer_size, unsigned num_buffers)
@@ -169,7 +228,7 @@
     }
     else {
       PTRACE(1, "GMAudioInputManager_ptlib\tEncountered error while trying to read data");
-      runtime.run_in_main (sigc::bind (device_error.make_slot (), current_state.device, Ekiga::AI_ERROR_READ));
+      runtime.run_in_main (new device_error_in_main (this, current_state.device, Ekiga::AI_ERROR_READ));
     }
   }
   return ret;

Modified: trunk/lib/engine/audioinput/skel/audioinput-core.cpp
==============================================================================
--- trunk/lib/engine/audioinput/skel/audioinput-core.cpp	(original)
+++ trunk/lib/engine/audioinput/skel/audioinput-core.cpp	Sun Jul 27 15:08:45 2008
@@ -43,6 +43,41 @@
 
 using namespace Ekiga;
 
+/* run_in_main helpers */
+struct device_added_in_main: public RuntimeCallback
+{
+  device_added_in_main (AudioInputCore* manager_,
+			AudioInputDevice device_):
+    manager(manager_), device(device_)
+  {}
+
+  void run ()
+  {
+    manager->device_added.emit (device);
+  }
+
+private:
+  AudioInputCore* manager;
+  AudioInputDevice device;
+};
+
+struct device_removed_in_main: public RuntimeCallback
+{
+  device_removed_in_main (AudioInputCore* manager_,
+			  AudioInputDevice device_):
+    manager(manager_), device(device_)
+  {}
+
+  void run ()
+  {
+    manager->device_removed.emit (device);
+  }
+
+private:
+  AudioInputCore* manager;
+  AudioInputDevice device;
+};
+
 AudioInputCore::AudioPreviewManager::AudioPreviewManager (AudioInputCore& _audio_input_core, AudioOutputCore& _audio_output_core)
 : PThread (1000, NoAutoDeleteThread, HighestPriority, "PreviewManager"),
   audio_input_core (_audio_input_core),
@@ -233,7 +268,7 @@
        if ( desired_device == device)
          internal_set_device(desired_device);
 
-       runtime.run_in_main (sigc::bind (device_added.make_slot (), device));
+       runtime.run_in_main (new device_added_in_main (this, device));
      }
   }
 }
@@ -258,7 +293,7 @@
             new_device.name = AUDIO_INPUT_FALLBACK_DEVICE_NAME;
             internal_set_device( new_device);
        }
-       runtime.run_in_main (sigc::bind (device_removed.make_slot (), device));
+       runtime.run_in_main (new device_removed_in_main (this, device));
      }
   }
 }

Modified: trunk/lib/engine/audiooutput/null/audiooutput-manager-null.cpp
==============================================================================
--- trunk/lib/engine/audiooutput/null/audiooutput-manager-null.cpp	(original)
+++ trunk/lib/engine/audiooutput/null/audiooutput-manager-null.cpp	Sun Jul 27 15:08:45 2008
@@ -38,6 +38,49 @@
 #define DEVICE_SOURCE "NULL"
 #define DEVICE_NAME   "NULL"
 
+/* run_in_main helpers */
+
+struct device_opened_in_main: public Ekiga::RuntimeCallback
+{
+
+  device_opened_in_main (GMAudioOutputManager_null* manager_,
+			 Ekiga::AudioOutputPS ps_,
+			 Ekiga::AudioOutputDevice device_,
+			 Ekiga::AudioOutputConfig config_):
+    manager(manager_), ps(ps_), device(device_), config(config_)
+  {}
+
+  void run ()
+  { manager->device_opened.emit (ps, device, config); }
+
+private:
+  GMAudioOutputManager_null* manager;
+  Ekiga::AudioOutputPS ps;
+  Ekiga::AudioOutputDevice device;
+  Ekiga::AudioOutputConfig config;
+};
+
+struct device_closed_in_main: public Ekiga::RuntimeCallback
+{
+
+  device_closed_in_main (GMAudioOutputManager_null* manager_,
+			 Ekiga::AudioOutputPS ps_,
+			 Ekiga::AudioOutputDevice device_):
+    manager(manager_), ps(ps_), device(device_)
+  {}
+
+  void run ()
+  { manager->device_closed.emit (ps, device); }
+
+private:
+  GMAudioOutputManager_null* manager;
+  Ekiga::AudioOutputPS ps;
+  Ekiga::AudioOutputDevice device;
+};
+
+
+
+
 GMAudioOutputManager_null::GMAudioOutputManager_null (Ekiga::ServiceCore & _core)
 : core (_core),
   runtime (*(dynamic_cast<Ekiga::Runtime *> (_core.get ("runtime"))))
@@ -84,7 +127,7 @@
   Ekiga::AudioOutputConfig config;
   config.volume = 0;
   config.modifyable = false;
-  runtime.run_in_main (sigc::bind (device_opened.make_slot (), ps, current_state[ps].device, config));
+  runtime.run_in_main (new device_opened_in_main (this, ps, current_state[ps].device, config));
 
   return true;
 }
@@ -92,7 +135,7 @@
 void GMAudioOutputManager_null::close(Ekiga::AudioOutputPS ps)
 {
   current_state[ps].opened = false;
-  runtime.run_in_main (sigc::bind (device_closed.make_slot (), ps, current_state[ps].device));
+  runtime.run_in_main (new device_closed_in_main (this, ps, current_state[ps].device));
 }
 
 

Modified: trunk/lib/engine/audiooutput/ptlib/audiooutput-manager-ptlib.cpp
==============================================================================
--- trunk/lib/engine/audiooutput/ptlib/audiooutput-manager-ptlib.cpp	(original)
+++ trunk/lib/engine/audiooutput/ptlib/audiooutput-manager-ptlib.cpp	Sun Jul 27 15:08:45 2008
@@ -40,6 +40,72 @@
 
 #define DEVICE_TYPE "PTLIB"
 
+/* run_in_main helpers */
+
+struct device_opened_in_main: public Ekiga::RuntimeCallback
+{
+  device_opened_in_main (GMAudioOutputManager_ptlib* manager_,
+			 Ekiga::AudioOutputPS ps_,
+			 Ekiga::AudioOutputDevice device_,
+			 Ekiga::AudioOutputConfig config_):
+    manager(manager_), ps(ps_), device(device_), config(config_)
+  {}
+
+  void run ()
+  {
+    manager->device_opened.emit (ps, device, config);
+  }
+
+private:
+  GMAudioOutputManager_ptlib* manager;
+  Ekiga::AudioOutputPS ps;
+  Ekiga::AudioOutputDevice device;
+  Ekiga::AudioOutputConfig config;
+};
+
+struct device_closed_in_main: public Ekiga::RuntimeCallback
+{
+  device_closed_in_main (GMAudioOutputManager_ptlib* manager_,
+			 Ekiga::AudioOutputPS ps_,
+			 Ekiga::AudioOutputDevice device_):
+    manager(manager_), ps(ps_), device(device_)
+  {}
+
+  void run ()
+  {
+    manager->device_closed.emit (ps, device);
+  }
+
+private:
+  GMAudioOutputManager_ptlib* manager;
+  Ekiga::AudioOutputPS ps;
+  Ekiga::AudioOutputDevice device;
+};
+
+struct device_error_in_main: public Ekiga::RuntimeCallback
+{
+  device_error_in_main (GMAudioOutputManager_ptlib* manager_,
+			Ekiga::AudioOutputPS ps_,
+			Ekiga::AudioOutputDevice device_,
+			Ekiga::AudioOutputErrorCodes error_code_):
+    manager(manager_), ps(ps_), device(device_), error_code(error_code_)
+  {}
+
+  void run ()
+  {
+    manager->device_closed.emit (ps, device);
+  }
+
+private:
+  GMAudioOutputManager_ptlib* manager;
+  Ekiga::AudioOutputPS ps;
+  Ekiga::AudioOutputDevice device;
+  Ekiga::AudioOutputErrorCodes error_code;
+};
+
+
+
+
 GMAudioOutputManager_ptlib::GMAudioOutputManager_ptlib (Ekiga::ServiceCore & _core)
 : core (_core),
   runtime (*(dynamic_cast<Ekiga::Runtime *> (_core.get ("runtime"))))
@@ -115,7 +181,7 @@
 
   if (error_code != Ekiga::AO_ERROR_NONE) {
     PTRACE(1, "GMAudioOutputManager_ptlib\tEncountered error " << error_code << " while opening device[" << ps << "]");
-    runtime.run_in_main (sigc::bind (device_error.make_slot (), ps, current_state[ps].device, error_code));
+    runtime.run_in_main (new device_error_in_main (this, ps, current_state[ps].device, error_code));
     return false;
   }
 
@@ -126,7 +192,7 @@
   Ekiga::AudioOutputConfig config;
   config.volume = volume;
   config.modifyable = true;
-  runtime.run_in_main (sigc::bind (device_opened.make_slot (), ps, current_state[ps].device, config));
+  runtime.run_in_main (new device_opened_in_main (this, ps, current_state[ps].device, config));
 
   return true;
 }
@@ -139,7 +205,7 @@
      output_device[ps] = NULL;
   }
   current_state[ps].opened = false;
-  runtime.run_in_main (sigc::bind (device_closed.make_slot (), ps, current_state[ps].device));
+  runtime.run_in_main (new device_closed_in_main (this, ps, current_state[ps].device));
 }
 
 void GMAudioOutputManager_ptlib::set_buffer_size (Ekiga::AudioOutputPS ps, unsigned buffer_size, unsigned num_buffers)
@@ -171,7 +237,7 @@
     }
     else {
       PTRACE(1, "GMAudioOutputManager_ptlib\tEncountered error while trying to write data");
-      runtime.run_in_main (sigc::bind (device_error.make_slot (), ps, current_state[ps].device, Ekiga::AO_ERROR_WRITE));
+      runtime.run_in_main (new device_error_in_main (this, ps, current_state[ps].device, Ekiga::AO_ERROR_WRITE));
 
     }
   }

Modified: trunk/lib/engine/audiooutput/skel/audiooutput-core.cpp
==============================================================================
--- trunk/lib/engine/audiooutput/skel/audiooutput-core.cpp	(original)
+++ trunk/lib/engine/audiooutput/skel/audiooutput-core.cpp	Sun Jul 27 15:08:45 2008
@@ -39,6 +39,44 @@
 #include <math.h>
 
 using namespace Ekiga;
+
+
+/* run_in_main helpers */
+
+struct device_added_in_main: public RuntimeCallback
+{
+  device_added_in_main (AudioOutputCore* manager_,
+			AudioOutputDevice device_):
+    manager(manager_), device(device_)
+  {}
+
+  void run ()
+  { manager->device_added.emit (device); }
+
+private:
+
+  AudioOutputCore* manager;
+  AudioOutputDevice device;
+};
+
+struct device_removed_in_main: public RuntimeCallback
+{
+  device_removed_in_main (AudioOutputCore* manager_,
+			  AudioOutputDevice device_):
+    manager(manager_), device(device_)
+  {}
+
+  void run ()
+  { manager->device_removed.emit (device); }
+
+private:
+
+  AudioOutputCore* manager;
+  AudioOutputDevice device;
+};
+
+
+
 AudioOutputCore::AudioOutputCore (Ekiga::Runtime & _runtime)
 :  runtime (_runtime),
    audio_event_scheduler(*this)
@@ -208,7 +246,7 @@
          internal_set_primary_device(desired_primary_device);
        }
 
-       runtime.run_in_main (sigc::bind (device_added.make_slot (), device));
+       runtime.run_in_main (new device_added_in_main (this, device));
      }
   }
 }
@@ -233,7 +271,7 @@
          internal_set_primary_device(new_device);
        }
 
-       runtime.run_in_main (sigc::bind (device_removed.make_slot (), device));
+       runtime.run_in_main (new device_removed_in_main (this, device));
      }
   }
 }

Modified: trunk/lib/engine/framework/runtime-glib.cpp
==============================================================================
--- trunk/lib/engine/framework/runtime-glib.cpp	(original)
+++ trunk/lib/engine/framework/runtime-glib.cpp	Sun Jul 27 15:08:45 2008
@@ -41,12 +41,11 @@
 
 struct message
 {
-  message (sigc::slot<void> _action,
-	   unsigned int _seconds): action(_action),
-				   seconds(_seconds)
+  message (Ekiga::RuntimeCallback* _callback,
+	   unsigned int _seconds): callback(_callback), seconds(_seconds)
   {}
 
-  sigc::slot<void> action;
+  Ekiga::RuntimeCallback* callback;
   unsigned int seconds;
 };
 
@@ -55,7 +54,8 @@
 {
   struct message *msg = (struct message *)data;
 
-  msg->action ();
+  msg->callback->run ();
+  delete msg->callback;
   delete msg;
 
   return FALSE;
@@ -153,8 +153,9 @@
 }
 
 void
-Ekiga::GlibRuntime::run_in_main (sigc::slot<void> action,
+Ekiga::GlibRuntime::run_in_main (RuntimeCallback* callback,
 				 unsigned int seconds)
 {
-  g_async_queue_push (queue, (gpointer)(new struct message (action, seconds)));
+  g_async_queue_push (queue,
+		      (gpointer)(new struct message (callback, seconds)));
 }

Modified: trunk/lib/engine/framework/runtime-glib.h
==============================================================================
--- trunk/lib/engine/framework/runtime-glib.h	(original)
+++ trunk/lib/engine/framework/runtime-glib.h	Sun Jul 27 15:08:45 2008
@@ -62,7 +62,7 @@
 
     void quit ();
 
-    void run_in_main (sigc::slot<void> action,
+    void run_in_main (RuntimeCallback* callback,
                       unsigned int seconds);
 
   private:

Modified: trunk/lib/engine/framework/runtime.h
==============================================================================
--- trunk/lib/engine/framework/runtime.h	(original)
+++ trunk/lib/engine/framework/runtime.h	Sun Jul 27 15:08:45 2008
@@ -49,6 +49,15 @@
  * @{
  */
 
+  /** FIXME: this is really ugly, but it seems sigc++ isn't thread-safe
+   * at all, so trying anything with signals is bound to give segfaults.
+   */
+  class RuntimeCallback
+  {
+  public:
+    virtual void run () = 0;
+  };
+
   class Runtime
     : public Service
   {
@@ -70,7 +79,12 @@
 
     virtual void quit () = 0;
 
-    virtual void run_in_main (sigc::slot<void> action,
+    /* Run a callback after a while
+     * @param callback the callback to run, on which delete will be called
+     * after use
+     * @param seconds how long should be waited before the callback is run
+     */
+    virtual void run_in_main (RuntimeCallback* callback,
 			      unsigned int seconds = 0) = 0;
   };
 

Modified: trunk/lib/engine/videoinput/mlogo/videoinput-manager-mlogo.cpp
==============================================================================
--- trunk/lib/engine/videoinput/mlogo/videoinput-manager-mlogo.cpp	(original)
+++ trunk/lib/engine/videoinput/mlogo/videoinput-manager-mlogo.cpp	Sun Jul 27 15:08:45 2008
@@ -41,6 +41,45 @@
 #define DEVICE_SOURCE "Moving Logo"
 #define DEVICE_NAME   "Moving Logo"
 
+/* run_in_main helpers */
+struct device_opened_in_main: public Ekiga::RuntimeCallback
+{
+  device_opened_in_main (GMVideoInputManager_mlogo* manager_,
+			 Ekiga::VideoInputDevice device_,
+			 Ekiga::VideoInputSettings settings_):
+    manager(manager_), device(device_), settings(settings_)
+  {}
+
+  void run ()
+  {
+    manager->device_opened.emit (device, settings);
+  }
+
+private:
+  GMVideoInputManager_mlogo* manager;
+  Ekiga::VideoInputDevice device;
+  Ekiga::VideoInputSettings settings;
+};
+
+struct device_closed_in_main: public Ekiga::RuntimeCallback
+{
+  device_closed_in_main (GMVideoInputManager_mlogo* manager_,
+			 Ekiga::VideoInputDevice device_):
+    manager(manager_), device(device_)
+  {}
+
+  void run ()
+  {
+    manager->device_closed.emit (device);
+  }
+
+private:
+  GMVideoInputManager_mlogo* manager;
+  Ekiga::VideoInputDevice device;
+};
+
+
+
 GMVideoInputManager_mlogo::GMVideoInputManager_mlogo (Ekiga::ServiceCore & _core)
 : core (_core),
   runtime (*(dynamic_cast<Ekiga::Runtime *> (_core.get ("runtime"))))
@@ -103,7 +142,7 @@
   settings.colour = 127;
   settings.contrast = 127;
   settings.modifyable = false;
-  runtime.run_in_main (sigc::bind (device_opened.make_slot (), current_state.device, settings));
+  runtime.run_in_main (new device_opened_in_main (this, current_state.device, settings));
   
   return true;
 }
@@ -113,7 +152,7 @@
   PTRACE(4, "GMVideoInputManager_mlogo\tClosing Moving Logo");
   free (background_frame);
   current_state.opened  = false;
-  runtime.run_in_main (sigc::bind (device_closed.make_slot (), current_state.device));
+  runtime.run_in_main (new device_closed_in_main (this, current_state.device));
 }
 
 bool GMVideoInputManager_mlogo::get_frame_data (char *data,

Modified: trunk/lib/engine/videoinput/ptlib/videoinput-manager-ptlib.cpp
==============================================================================
--- trunk/lib/engine/videoinput/ptlib/videoinput-manager-ptlib.cpp	(original)
+++ trunk/lib/engine/videoinput/ptlib/videoinput-manager-ptlib.cpp	Sun Jul 27 15:08:45 2008
@@ -40,6 +40,66 @@
 
 #define DEVICE_TYPE "PTLIB"
 
+/* run_in_main helpers */
+
+struct device_opened_in_main: public Ekiga::RuntimeCallback
+{
+  device_opened_in_main (GMVideoInputManager_ptlib* manager_,
+			 Ekiga::VideoInputDevice device_,
+			 Ekiga::VideoInputSettings settings_):
+    manager(manager_), device(device_), settings(settings_)
+  {}
+
+  void run ()
+  {
+    manager->device_opened.emit (device, settings);
+  }
+
+private:
+  GMVideoInputManager_ptlib* manager;
+  Ekiga::VideoInputDevice device;
+  Ekiga::VideoInputSettings settings;
+};
+
+struct device_closed_in_main: public Ekiga::RuntimeCallback
+{
+  device_closed_in_main (GMVideoInputManager_ptlib* manager_,
+			 Ekiga::VideoInputDevice device_):
+    manager(manager_), device(device_)
+  {}
+
+  void run ()
+  {
+    manager->device_closed.emit (device);
+  }
+
+private:
+  GMVideoInputManager_ptlib* manager;
+  Ekiga::VideoInputDevice device;
+};
+
+struct device_error_in_main: public Ekiga::RuntimeCallback
+{
+  device_error_in_main (GMVideoInputManager_ptlib* manager_,
+			Ekiga::VideoInputDevice device_,
+			Ekiga::VideoInputErrorCodes error_code_):
+    manager(manager_), device(device_), error_code(error_code_)
+  {}
+
+  void run ()
+  {
+    manager->device_closed.emit (device);
+  }
+
+private:
+  GMVideoInputManager_ptlib* manager;
+  Ekiga::VideoInputDevice device;
+  Ekiga::VideoInputErrorCodes error_code;
+};
+
+
+
+
 GMVideoInputManager_ptlib::GMVideoInputManager_ptlib (Ekiga::ServiceCore & _core)
 : core (_core), 
   runtime (*(dynamic_cast<Ekiga::Runtime *> (_core.get ("runtime"))))
@@ -127,7 +187,7 @@
 
   if (error_code != Ekiga::VI_ERROR_NONE) {
     PTRACE(1, "GMVideoInputManager_ptlib\tEncountered error " << error_code << " while opening device ");
-    runtime.run_in_main (sigc::bind (device_error.make_slot (), current_state.device, error_code));
+    runtime.run_in_main (new device_error_in_main (this, current_state.device, error_code));
     return false;
   }
 
@@ -142,7 +202,7 @@
   settings.contrast = contrast >> 8;
   settings.modifyable = true;
 
-  runtime.run_in_main (sigc::bind (device_opened.make_slot (), current_state.device, settings));
+  runtime.run_in_main (new device_opened_in_main (this, current_state.device, settings));
 
   return true;
 }
@@ -155,7 +215,7 @@
     input_device = NULL;
   }
   current_state.opened = false;
-  runtime.run_in_main (sigc::bind (device_closed.make_slot (), current_state.device));
+  runtime.run_in_main (new device_closed_in_main (this, current_state.device));
 }
 
 bool GMVideoInputManager_ptlib::get_frame_data (char *data,

Modified: trunk/lib/engine/videoinput/skel/videoinput-core.cpp
==============================================================================
--- trunk/lib/engine/videoinput/skel/videoinput-core.cpp	(original)
+++ trunk/lib/engine/videoinput/skel/videoinput-core.cpp	Sun Jul 27 15:08:45 2008
@@ -44,6 +44,42 @@
 
 using namespace Ekiga;
 
+/* run_in_main helpers */
+struct device_added_in_main: public Ekiga::RuntimeCallback
+{
+  device_added_in_main (VideoInputCore* manager_,
+			VideoInputDevice device_):
+    manager(manager_), device(device_)
+  {}
+
+  void run ()
+  {
+    manager->device_added.emit (device);
+  }
+
+private:
+  VideoInputCore* manager;
+  VideoInputDevice device;
+};
+
+struct device_removed_in_main: public Ekiga::RuntimeCallback
+{
+  device_removed_in_main (VideoInputCore* manager_,
+			  VideoInputDevice device_):
+    manager(manager_), device(device_)
+  {}
+
+  void run ()
+  {
+    manager->device_removed.emit (device);
+  }
+
+private:
+  VideoInputCore* manager;
+  VideoInputDevice device;
+};
+
+
 VideoInputCore::VideoPreviewManager::VideoPreviewManager (VideoInputCore& _videoinput_core, VideoOutputCore& _videooutput_core)
 : PThread (1000, NoAutoDeleteThread, HighestPriority, "VideoPreviewManager"),
     videoinput_core (_videoinput_core),
@@ -227,7 +263,7 @@
       if ( desired_device == device )
         internal_set_device(device, current_channel, current_format);
 
-      runtime.run_in_main (sigc::bind (device_added.make_slot (), device));
+      runtime.run_in_main (new device_added_in_main (this, device));
     }
   }
 }
@@ -251,7 +287,7 @@
             internal_set_device(new_device, current_channel, current_format);
        }
 
-       runtime.run_in_main (sigc::bind (device_removed.make_slot (), device));
+       runtime.run_in_main (new device_removed_in_main (this, device));
      }
   }
 }

Modified: trunk/lib/engine/videooutput/common/videooutput-manager-common.cpp
==============================================================================
--- trunk/lib/engine/videooutput/common/videooutput-manager-common.cpp	(original)
+++ trunk/lib/engine/videooutput/common/videooutput-manager-common.cpp	Sun Jul 27 15:08:45 2008
@@ -42,9 +42,35 @@
  *
  */
 
-
 #include "videooutput-manager-common.h"
 
+/* stupid run_in_main helper
+ */
+struct update_gui_device_in_main: public Ekiga::RuntimeCallback
+{
+  update_gui_device_in_main (GMVideoOutputManager* manager_,
+			     Ekiga::VideoOutputAccel accel_,
+			     Ekiga::VideoOutputMode mode_,
+			     unsigned int zoom_,
+			     bool both_streams_active_):
+    manager(manager_), accel(accel_), mode(mode_),
+    zoom(zoom_), both_streams_active(both_streams_active_)    
+  {}
+
+  void run ()
+  {
+    manager->device_closed.emit ();
+    manager->device_opened.emit (accel, mode, zoom, both_streams_active);
+  }
+
+private:
+  GMVideoOutputManager* manager;
+  Ekiga::VideoOutputAccel accel;
+  Ekiga::VideoOutputMode mode;
+  unsigned int zoom;
+  bool both_streams_active;
+};
+
 /* The functions */
 GMVideoOutputManager::GMVideoOutputManager(Ekiga::ServiceCore & _core)
   : PThread (1000, NoAutoDeleteThread, HighestPriority, "GMVideoOutputManager"),
@@ -230,10 +256,13 @@
 
 void GMVideoOutputManager::update_gui_device ()
 {
-  last_frame.both_streams_active = current_frame.both_streams_active;
-  runtime.run_in_main (device_closed.make_slot ());
-  runtime.run_in_main (sigc::bind (device_opened.make_slot (), current_frame.accel, current_frame.mode, current_frame.zoom, current_frame.both_streams_active));
+  update_gui_device_in_main* callback =
+    new update_gui_device_in_main (this, current_frame.accel,
+				   current_frame.mode, current_frame.zoom,
+				   current_frame.both_streams_active);
 
+  last_frame.both_streams_active = current_frame.both_streams_active;
+  runtime.run_in_main (callback);
 }
 
 

Modified: trunk/lib/engine/videooutput/x/videooutput-manager-x.cpp
==============================================================================
--- trunk/lib/engine/videooutput/x/videooutput-manager-x.cpp	(original)
+++ trunk/lib/engine/videooutput/x/videooutput-manager-x.cpp	Sun Jul 27 15:08:45 2008
@@ -43,6 +43,83 @@
 #include "xvwindow.h"
 #endif
 
+/* run_in_main helpers */
+struct size_changed_in_main: public Ekiga::RuntimeCallback
+{
+  size_changed_in_main (GMVideoOutputManager_x* manager_,
+			unsigned width_,
+			unsigned height_):
+    manager(manager_), width(width_), height(height_)
+  {}
+
+  void run ()
+  {
+    manager->size_changed.emit (width, height);
+  }
+
+private:
+  GMVideoOutputManager_x* manager;
+  unsigned width;
+  unsigned height;
+};
+
+struct device_opened_in_main: public Ekiga::RuntimeCallback
+{
+  device_opened_in_main (GMVideoOutputManager_x* manager_,
+			 Ekiga::VideoOutputAccel accel_,
+			 Ekiga::VideoOutputMode mode_,
+			 unsigned int zoom_,
+			 bool both_streams_active_):
+    manager(manager_), accel(accel_), mode(mode_),
+    zoom(zoom_), both_streams_active(both_streams_active_)    
+  {}
+
+  void run ()
+  {
+    manager->device_opened.emit (accel, mode, zoom, both_streams_active);
+  }
+
+private:
+  GMVideoOutputManager_x* manager;
+  Ekiga::VideoOutputAccel accel;
+  Ekiga::VideoOutputMode mode;
+  unsigned int zoom;
+  bool both_streams_active;
+};
+
+struct device_closed_in_main: public Ekiga::RuntimeCallback
+{
+  device_closed_in_main (GMVideoOutputManager_x* manager_): manager(manager_)
+  {}
+
+  void run ()
+  {
+    manager->device_closed.emit ();
+  }
+
+private:
+  GMVideoOutputManager_x* manager;
+};
+
+struct fullscreen_mode_changed_in_main: public Ekiga::RuntimeCallback
+{
+  fullscreen_mode_changed_in_main (GMVideoOutputManager_x* manager_,
+				   Ekiga::VideoOutputFSToggle mode_):
+    manager(manager_), mode(mode_)
+  {}
+
+  void run ()
+  {
+    manager->fullscreen_mode_changed.emit (mode);
+  }
+
+private:
+  GMVideoOutputManager_x* manager;
+  Ekiga::VideoOutputFSToggle mode;
+};
+
+
+
 GMVideoOutputManager_x::GMVideoOutputManager_x (Ekiga::ServiceCore & _core)
 : GMVideoOutputManager(_core)
 {
@@ -114,17 +191,17 @@
 
   switch (current_frame.mode) {
   case Ekiga::VO_MODE_LOCAL:
-    runtime.run_in_main (sigc::bind (size_changed.make_slot (), (unsigned) (current_frame.local_width * current_frame.zoom / 100), (unsigned) (current_frame.local_height * current_frame.zoom / 100)));
+    runtime.run_in_main (new size_changed_in_main (this, (unsigned) (current_frame.local_width * current_frame.zoom / 100), (unsigned) (current_frame.local_height * current_frame.zoom / 100)));
     break;
   case Ekiga::VO_MODE_REMOTE:
   case Ekiga::VO_MODE_PIP:
-    runtime.run_in_main (sigc::bind (size_changed.make_slot (), (unsigned) (current_frame.remote_width * current_frame.zoom / 100), (unsigned) (current_frame.remote_height * current_frame.zoom / 100)));
+    runtime.run_in_main (new size_changed_in_main (this, (unsigned) (current_frame.remote_width * current_frame.zoom / 100), (unsigned) (current_frame.remote_height * current_frame.zoom / 100)));
     break;
   case Ekiga::VO_MODE_FULLSCREEN:
-    runtime.run_in_main (sigc::bind (size_changed.make_slot (), 176, 144));
+    runtime.run_in_main (new size_changed_in_main (this, 176, 144));
     break;
   case Ekiga::VO_MODE_PIP_WINDOW:
-    runtime.run_in_main (sigc::bind (size_changed.make_slot (), 176, 144));
+    runtime.run_in_main (new size_changed_in_main (this, 176, 144));
     break;
   case Ekiga::VO_MODE_UNSET:
   default:
@@ -419,13 +496,13 @@
   }
 
   last_frame.both_streams_active = current_frame.both_streams_active;
-  runtime.run_in_main (sigc::bind (device_opened.make_slot (), current_frame.accel, current_frame.mode, current_frame.zoom, current_frame.both_streams_active));
+  runtime.run_in_main (new device_opened_in_main (this, current_frame.accel, current_frame.mode, current_frame.zoom, current_frame.both_streams_active));
 }
 
 void
 GMVideoOutputManager_x::close_frame_display ()
 {
-  runtime.run_in_main (device_closed.make_slot ());
+  runtime.run_in_main (new device_closed_in_main (this));
 
   if (rxWindow) 
     rxWindow->RegisterSlave (NULL);
@@ -476,7 +553,7 @@
     lxWindow->ProcessEvents();
 
   if (current_frame.mode == Ekiga::VO_MODE_FULLSCREEN && rxWindow && !rxWindow->IsFullScreen ())
-    runtime.run_in_main (sigc::bind (fullscreen_mode_changed.make_slot (), Ekiga::VO_FS_OFF));
+    runtime.run_in_main (new fullscreen_mode_changed_in_main (this, Ekiga::VO_FS_OFF));
 
   if (rxWindow && (update_required.remote || (!update_required.remote && !update_required.local)))
     rxWindow->PutFrame ((uint8_t *) remote_frame, rf_width, rf_height);

Modified: trunk/src/endpoints/h323.cpp
==============================================================================
--- trunk/src/endpoints/h323.cpp	(original)
+++ trunk/src/endpoints/h323.cpp	Sun Jul 27 15:08:45 2008
@@ -43,6 +43,26 @@
 #include "opal-call.h"
 #include "account-core.h"
 
+/* run_in_main helpers */
+struct registration_event_in_main: public Ekiga::RuntimeCallback
+{
+  registration_event_in_main (Opal::H323::CallProtocolManager* manager_,
+			      const Opal::Account* account_,
+			      Ekiga::AccountCore::RegistrationState state_,
+			      std::string info_):
+    manager(manager_), account(account_), state(state_), info(info_)
+  {}
+
+  void run ()
+  { manager->registration_event.emit (account, state, info); }
+
+private:
+  Opal::H323::CallProtocolManager* manager;
+  const Opal::Account* account;
+  Ekiga::AccountCore::RegistrationState state;
+  std::string info;
+};
+
 
 namespace Opal {
 
@@ -335,15 +355,11 @@
         info = _("Failed");
 
       /* Signal */
-      runtime.run_in_main (sigc::bind (registration_event.make_slot (), &account,
-                                       Ekiga::AccountCore::RegistrationFailed,
-                                       info));
+      runtime.run_in_main (new registration_event_in_main (this, &account, Ekiga::AccountCore::RegistrationFailed, info));
     }
     else {
 
-      runtime.run_in_main (sigc::bind (registration_event.make_slot (), &account,
-                                       Ekiga::AccountCore::Registered,
-                                       std::string ()));
+      runtime.run_in_main (new registration_event_in_main (this, &account, Ekiga::AccountCore::Registered, std::string ()));
     }
   }
   else if (unregister && IsRegisteredWithGatekeeper (account.get_host ())) {
@@ -352,9 +368,7 @@
     RemoveAliasName (account.get_username ());
 
     /* Signal */
-    runtime.run_in_main (sigc::bind (registration_event.make_slot (), &account,
-                                     Ekiga::AccountCore::Unregistered,
-                                     std::string ()));
+    runtime.run_in_main (new registration_event_in_main (this, &account, Ekiga::AccountCore::Unregistered, std::string ()));
   }
 }
 

Modified: trunk/src/endpoints/manager.cpp
==============================================================================
--- trunk/src/endpoints/manager.cpp	(original)
+++ trunk/src/endpoints/manager.cpp	Sun Jul 27 15:08:45 2008
@@ -50,6 +50,37 @@
 
 #include "call-manager.h"
 
+/* run_in_main helpers */
+
+struct manager_ready_in_main: public Ekiga::RuntimeCallback
+{
+  manager_ready_in_main (Ekiga::CallManager* manager_): manager(manager_)
+  {}
+
+  void run ()
+  { manager->ready.emit (); }
+
+private:
+  Ekiga::CallManager* manager;
+};
+
+struct mwi_event_in_main: public Ekiga::RuntimeCallback
+{
+  mwi_event_in_main (Ekiga::CallManager* manager_,
+		     std::string account_,
+		     std::string summary_):
+    manager(manager_), account(account_), summary(summary_)
+  {}
+
+  void run ()
+  { manager->mwi_event.emit (account, summary); }
+
+private:
+  Ekiga::CallManager* manager;
+  std::string account;
+  std::string summary;
+};
+
 static  bool same_codec_desc (Ekiga::CodecDescription a, Ekiga::CodecDescription b)
 { 
   return (a.name == b.name && a.rate == b.rate); 
@@ -86,7 +117,7 @@
          iter++) 
       (*iter)->set_listen_port ((*iter)->get_listen_interface ().port);
 
-    runtime.run_in_main (manager.ready.make_slot ());
+    runtime.run_in_main (new manager_ready_in_main (&manager));
   };
 
 private:
@@ -649,7 +680,7 @@
   std::string account = (const char *) _acc;
   std::string summary = (const char *) _msgs;
 
-  runtime.run_in_main (sigc::bind (mwi_event.make_slot (), account, summary));
+  runtime.run_in_main (new mwi_event_in_main (this, account, summary));
 }
 
 

Modified: trunk/src/endpoints/opal-call.cpp
==============================================================================
--- trunk/src/endpoints/opal-call.cpp	(original)
+++ trunk/src/endpoints/opal-call.cpp	Sun Jul 27 15:08:45 2008
@@ -52,6 +52,170 @@
 #include "opal-call.h"
 #include "call.h"
 
+/* run_in_main helpers */
+
+struct stream_resumed_in_main: public Ekiga::RuntimeCallback
+{
+
+  stream_resumed_in_main (Opal::Call* call_,
+			  std::string name_,
+			  Opal::Call::StreamType type_):
+    call(call_), name(name_), type(type_)
+  {}
+
+  void run ()
+  { call->stream_resumed.emit (name, type); }
+
+  private:
+
+  Opal::Call* call;
+  std::string name;
+  Opal::Call::StreamType type;
+};
+
+struct stream_paused_in_main: public Ekiga::RuntimeCallback
+{
+
+  stream_paused_in_main (Opal::Call* call_,
+			 std::string name_,
+			 Opal::Call::StreamType type_):
+    call(call_), name(name_), type(type_)
+  {}
+
+  void run ()
+  { call->stream_paused.emit (name, type); }
+
+  private:
+
+  Opal::Call* call;
+  std::string name;
+  Opal::Call::StreamType type;
+};
+
+struct stream_opened_in_main: public Ekiga::RuntimeCallback
+{
+
+  stream_opened_in_main (Opal::Call* call_,
+			 std::string name_,
+			 Opal::Call::StreamType type_,
+			 bool is_transmitting_):
+    call(call_), name(name_), type(type_), is_transmitting(is_transmitting_)
+  {}
+
+  void run ()
+  { call->stream_opened.emit (name, type, is_transmitting); }
+
+  private:
+
+  Opal::Call* call;
+  std::string name;
+  Opal::Call::StreamType type;
+  bool is_transmitting;
+};
+
+struct stream_closed_in_main: public Ekiga::RuntimeCallback
+{
+
+  stream_closed_in_main (Opal::Call* call_,
+			 std::string name_,
+			 Opal::Call::StreamType type_,
+			 bool is_transmitting_):
+    call(call_), name(name_), type(type_), is_transmitting(is_transmitting_)
+  {}
+
+  void run ()
+  { call->stream_closed.emit (name, type, is_transmitting); }
+
+  private:
+
+  Opal::Call* call;
+  std::string name;
+  Opal::Call::StreamType type;
+  bool is_transmitting;
+};
+
+struct established_in_main: public Ekiga::RuntimeCallback
+{
+  established_in_main (Opal::Call* call_): call(call_)
+  {}
+
+  void run ()
+  { call->established.emit (); }
+
+private:
+
+  Opal::Call* call;
+};
+
+struct missed_in_main: public Ekiga::RuntimeCallback
+{
+  missed_in_main (Opal::Call* call_): call(call_)
+  {}
+
+  void run ()
+  { call->missed.emit (); }
+
+private:
+
+  Opal::Call* call;
+};
+
+struct cleared_in_main: public Ekiga::RuntimeCallback
+{
+  cleared_in_main (Opal::Call* call_,
+		   std::string reason_):
+    call(call_), reason(reason_)
+  {}
+
+  void run ()
+  { call->missed.emit (); }
+
+private:
+
+  Opal::Call* call;
+  std::string reason;
+};
+
+struct setup_in_main: public Ekiga::RuntimeCallback
+{
+  setup_in_main (Opal::Call* call_): call(call_)
+  {}
+
+  void run ()
+  { call->setup.emit (); }
+
+private:
+
+  Opal::Call* call;
+};
+
+struct held_in_main: public Ekiga::RuntimeCallback
+{
+  held_in_main (Opal::Call* call_): call(call_)
+  {}
+
+  void run ()
+  { call->held.emit (); }
+
+private:
+
+  Opal::Call* call;
+};
+
+struct retrieved_in_main: public Ekiga::RuntimeCallback
+{
+  retrieved_in_main (Opal::Call* call_): call(call_)
+  {}
+
+  void run ()
+  { call->retrieved.emit (); }
+
+private:
+
+  Opal::Call* call;
+};
+
+
 using namespace Opal;
 
 
@@ -168,9 +332,11 @@
       stream->SetPaused (!paused);
 
       if (paused)
-        runtime.run_in_main (sigc::bind (stream_resumed, stream_name, type));
+        runtime.run_in_main (new stream_resumed_in_main (this,
+							 stream_name, type));
       else
-        runtime.run_in_main (sigc::bind (stream_paused, stream_name, type));
+        runtime.run_in_main (new stream_paused_in_main (this,
+							stream_name, type));
     }
   }
 }
@@ -311,7 +477,7 @@
   if (!PIsDescendant(&connection, OpalPCSSConnection)) {
 
     parse_info (connection);
-    runtime.run_in_main (established.make_slot ());
+    runtime.run_in_main (new established_in_main (this));
   }
 
   if (PIsDescendant(&connection, OpalRTPConnection)) {
@@ -348,7 +514,7 @@
         && !is_outgoing ()
         && connection.GetCallEndReason () != OpalConnection::EndedByAnswerDenied) {
 
-      runtime.run_in_main (missed.make_slot ());
+      runtime.run_in_main (new missed_in_main (this));
     }
     else {
 
@@ -434,7 +600,7 @@
         reason = _("Call completed");
       }
 
-      runtime.run_in_main (sigc::bind (cleared.make_slot (), reason));
+      runtime.run_in_main (new cleared_in_main (this, reason));
     }
   }
 
@@ -463,7 +629,7 @@
 
   outgoing = PIsDescendant(&connection, OpalPCSSConnection);
 
-  runtime.run_in_main (setup.make_slot ());
+  runtime.run_in_main (new setup_in_main (this));
 
   return OpalCall::OnSetUp (connection);
 }
@@ -474,9 +640,9 @@
                          bool on_hold)
 {
   if (on_hold)
-    runtime.run_in_main (held.make_slot ());
+    runtime.run_in_main (new held_in_main (this));
   else
-    runtime.run_in_main (retrieved.make_slot ());
+    runtime.run_in_main (new retrieved_in_main (this));
 }
 
 
@@ -491,7 +657,8 @@
   std::transform (stream_name.begin (), stream_name.end (), stream_name.begin (), (int (*) (int)) toupper);
   is_transmitting = !stream.IsSource ();
 
-  runtime.run_in_main (sigc::bind (stream_opened, stream_name, type, is_transmitting));
+  runtime.run_in_main (new stream_opened_in_main (this, stream_name,
+						  type, is_transmitting));
 }
 
 
@@ -506,7 +673,8 @@
   std::transform (stream_name.begin (), stream_name.end (), stream_name.begin (), (int (*) (int)) toupper);
   is_transmitting = !stream.IsSource ();
 
-  runtime.run_in_main (sigc::bind (stream_closed, stream_name, type, is_transmitting));
+  runtime.run_in_main (new stream_closed_in_main (this, stream_name,
+						  type, is_transmitting));
 }
 
 

Modified: trunk/src/endpoints/pcss.cpp
==============================================================================
--- trunk/src/endpoints/pcss.cpp	(original)
+++ trunk/src/endpoints/pcss.cpp	Sun Jul 27 15:08:45 2008
@@ -44,6 +44,19 @@
 #include "call.h"
 
 
+/* run_in_main helper */
+struct ringing_in_main: public Ekiga::RuntimeCallback
+{
+  ringing_in_main (Ekiga::Call* call_): call(call_)
+  {}
+
+  void run ()
+  { call->ringing.emit (); }
+
+private:
+  Ekiga::Call* call;
+};
+
 GMPCSSEndpoint::GMPCSSEndpoint (Opal::CallManager & ep,
                                 Ekiga::ServiceCore & _core) 
 :   OpalPCSSEndPoint (ep),
@@ -69,7 +82,7 @@
   Ekiga::Call *call = dynamic_cast<Ekiga::Call *> (&connection.GetCall ());
 
   if (call)
-    runtime.run_in_main (call->ringing.make_slot ());
+    runtime.run_in_main (new ringing_in_main (call));
 
   return true;
 }

Modified: trunk/src/endpoints/sip.cpp
==============================================================================
--- trunk/src/endpoints/sip.cpp	(original)
+++ trunk/src/endpoints/sip.cpp	Sun Jul 27 15:08:45 2008
@@ -51,6 +51,50 @@
 #include "personal-details.h"
 #include "opal-account.h"
 
+
+/* run_in_main helpers */
+struct registration_event_in_main: public Ekiga::RuntimeCallback
+{
+  registration_event_in_main (Opal::Sip::CallProtocolManager* manager_,
+			      Ekiga::Account* account_,
+			      Ekiga::AccountCore::RegistrationState state_,
+			      std::string info_):
+    manager(manager_), account(account_), state(state_), info(info_)
+  {}
+
+  void run ()
+  { manager->registration_event.emit (account, state, info); }
+
+private:
+  Opal::Sip::CallProtocolManager* manager;
+  Ekiga::Account* account;
+  Ekiga::AccountCore::RegistrationState state;
+  std::string info;
+};
+
+struct presence_status_received_in_main: public Ekiga::RuntimeCallback
+{
+  presence_status_received_in_main (Ekiga::PresenceCore& core_,
+				    std::string uri_,
+				    std::string presence_,
+				    std::string status_):
+    core(core_), uri(uri_), presence(presence_), status(status_)
+  {}
+
+  void run ()
+  {
+    core.presence_received.emit (uri, presence);
+    core.status_received.emit (uri, status);
+  }
+
+private:
+  Ekiga::PresenceCore &core;
+  std::string uri;
+  std::string presence;
+  std::string status;
+};
+
+
 namespace Opal {
 
   namespace Sip {
@@ -561,9 +605,7 @@
   /* Signal */
   Ekiga::Account *account = account_core.find_account (strm.str ());
   if (account)
-    runtime.run_in_main (sigc::bind (registration_event.make_slot (), account,
-                                     was_registering ? Ekiga::AccountCore::Registered : Ekiga::AccountCore::Unregistered,
-                                     std::string ()));
+    runtime.run_in_main (new registration_event_in_main (this, account, was_registering ? Ekiga::AccountCore::Registered : Ekiga::AccountCore::Unregistered, std::string ()));
 }
 
 
@@ -793,9 +835,7 @@
   /* Signal */
   Ekiga::Account *account = account_core.find_account (strm.str ());
   if (account)
-    runtime.run_in_main (sigc::bind (registration_event.make_slot (), account,
-                                     wasRegistering ? Ekiga::AccountCore::RegistrationFailed : Ekiga::AccountCore::UnregistrationFailed,
-                                     info));
+    runtime.run_in_main (new registration_event_in_main (this, account, wasRegistering ? Ekiga::AccountCore::RegistrationFailed : Ekiga::AccountCore::UnregistrationFailed, info));
 }
 
 
@@ -963,8 +1003,7 @@
    * TODO
    * Wouldn't it be convenient to emit the signal and have the presence core listen to it ?
    */
-  runtime.run_in_main (sigc::bind (presence_core.presence_received.make_slot (), _uri, presence));
-  runtime.run_in_main (sigc::bind (presence_core.status_received.make_slot (), _uri, status));
+  runtime.run_in_main (new presence_status_received_in_main (presence_core, _uri, presence, status));
 }
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]