ekiga r6528 - 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: Mon Jul 28 08:00:56 2008
New Revision: 6528
URL: http://svn.gnome.org/viewvc/ekiga?rev=6528&view=rev

Log:
Revert the run_in_main change :-(

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	Mon Jul 28 08:00:56 2008
@@ -50,32 +50,6 @@
 #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)
@@ -448,7 +422,7 @@
   updated.emit ();
 
   patience = 3;
-  runtime.run_in_main (new refresh_bound_in_main (this), 3);
+  runtime.run_in_main (sigc::mem_fun (this, &OPENLDAP::Book::refresh_bound), 3);
 }
 
 void
@@ -470,15 +444,15 @@
 
     if (patience == 3) {
       patience--;
-      runtime.run_in_main (new refresh_bound_in_main (this), 12);
+      runtime.run_in_main (sigc::mem_fun (this, &OPENLDAP::Book::refresh_bound), 12);
     } else if (patience == 2) {
 
       patience--;
-      runtime.run_in_main (new refresh_bound_in_main (this), 21);
+      runtime.run_in_main (sigc::mem_fun (this, &OPENLDAP::Book::refresh_bound), 21);
     } else if (patience == 1) {
 
       patience--;
-      runtime.run_in_main (new refresh_bound_in_main (this), 30);
+      runtime.run_in_main (sigc::mem_fun (this, &OPENLDAP::Book::refresh_bound), 30);
     } else { // patience == 0
 
       status = std::string (_("Could not connect to server"));
@@ -544,7 +518,7 @@
   }
 
   patience = 3;
-  runtime.run_in_main (new refresh_result_in_main (this), 3);
+  runtime.run_in_main (sigc::mem_fun (this, &OPENLDAP::Book::refresh_result), 3);
 
 }
 
@@ -567,15 +541,15 @@
     if (patience == 3) {
 
       patience--;
-      runtime.run_in_main (new refresh_result_in_main (this), 12);
+      runtime.run_in_main (sigc::mem_fun (this, &OPENLDAP::Book::refresh_result), 12);
     } else if (patience == 2) {
 
       patience--;
-      runtime.run_in_main (new refresh_result_in_main (this), 21);
+      runtime.run_in_main (sigc::mem_fun (this, &OPENLDAP::Book::refresh_result), 21);
     } else if (patience == 1) {
 
       patience--;
-      runtime.run_in_main (new refresh_result_in_main (this), 30);
+      runtime.run_in_main (sigc::mem_fun (this, &OPENLDAP::Book::refresh_result), 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	Mon Jul 28 08:00:56 2008
@@ -91,13 +91,11 @@
 
     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	Mon Jul 28 08:00:56 2008
@@ -38,47 +38,6 @@
 #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"))))
 {
@@ -122,7 +81,7 @@
   Ekiga::AudioInputConfig config;
   config.volume = 0;
   config.modifyable = false;
-  runtime.run_in_main (new device_opened_in_main (this, current_state.device, config));
+  runtime.run_in_main (sigc::bind (device_opened.make_slot (), current_state.device, config));
 
   return true;
 }
@@ -130,7 +89,7 @@
 void GMAudioInputManager_null::close()
 {
   current_state.opened = false;
-  runtime.run_in_main (new device_closed_in_main (this, current_state.device));
+  runtime.run_in_main (sigc::bind (device_closed.make_slot (), 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	Mon Jul 28 08:00:56 2008
@@ -40,65 +40,6 @@
 
 #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"))))
@@ -173,7 +114,7 @@
 
   if (error_code != Ekiga::AI_ERROR_NONE) {
     PTRACE(1, "GMAudioInputManager_ptlib\tEncountered error " << error_code << " while opening device ");
-    runtime.run_in_main (new device_error_in_main (this, current_state.device, error_code));
+    runtime.run_in_main (sigc::bind (device_error.make_slot (), current_state.device, error_code));
     return false;
   }
 
@@ -184,7 +125,7 @@
   Ekiga::AudioInputConfig config;
   config.volume = volume;
   config.modifyable = true;
-  runtime.run_in_main (new device_opened_in_main (this, current_state.device, config));
+  runtime.run_in_main (sigc::bind (device_opened.make_slot (), current_state.device, config));
 
   return true;
 }
@@ -197,7 +138,7 @@
      input_device = NULL;
   }
   current_state.opened = false;
-  runtime.run_in_main (new device_closed_in_main (this, current_state.device));
+  runtime.run_in_main (sigc::bind (device_closed.make_slot (), current_state.device));
 }
 
 void GMAudioInputManager_ptlib::set_buffer_size (unsigned buffer_size, unsigned num_buffers)
@@ -228,7 +169,7 @@
     }
     else {
       PTRACE(1, "GMAudioInputManager_ptlib\tEncountered error while trying to read data");
-      runtime.run_in_main (new device_error_in_main (this, current_state.device, Ekiga::AI_ERROR_READ));
+      runtime.run_in_main (sigc::bind (device_error.make_slot (), 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	Mon Jul 28 08:00:56 2008
@@ -43,41 +43,6 @@
 
 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),
@@ -268,7 +233,7 @@
        if ( desired_device == device)
          internal_set_device(desired_device);
 
-       runtime.run_in_main (new device_added_in_main (this, device));
+       runtime.run_in_main (sigc::bind (device_added.make_slot (), device));
      }
   }
 }
@@ -293,7 +258,7 @@
             new_device.name = AUDIO_INPUT_FALLBACK_DEVICE_NAME;
             internal_set_device( new_device);
        }
-       runtime.run_in_main (new device_removed_in_main (this, device));
+       runtime.run_in_main (sigc::bind (device_removed.make_slot (), 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	Mon Jul 28 08:00:56 2008
@@ -38,49 +38,6 @@
 #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"))))
@@ -127,7 +84,7 @@
   Ekiga::AudioOutputConfig config;
   config.volume = 0;
   config.modifyable = false;
-  runtime.run_in_main (new device_opened_in_main (this, ps, current_state[ps].device, config));
+  runtime.run_in_main (sigc::bind (device_opened.make_slot (), ps, current_state[ps].device, config));
 
   return true;
 }
@@ -135,7 +92,7 @@
 void GMAudioOutputManager_null::close(Ekiga::AudioOutputPS ps)
 {
   current_state[ps].opened = false;
-  runtime.run_in_main (new device_closed_in_main (this, ps, current_state[ps].device));
+  runtime.run_in_main (sigc::bind (device_closed.make_slot (), 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	Mon Jul 28 08:00:56 2008
@@ -40,72 +40,6 @@
 
 #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"))))
@@ -181,7 +115,7 @@
 
   if (error_code != Ekiga::AO_ERROR_NONE) {
     PTRACE(1, "GMAudioOutputManager_ptlib\tEncountered error " << error_code << " while opening device[" << ps << "]");
-    runtime.run_in_main (new device_error_in_main (this, ps, current_state[ps].device, error_code));
+    runtime.run_in_main (sigc::bind (device_error.make_slot (), ps, current_state[ps].device, error_code));
     return false;
   }
 
@@ -192,7 +126,7 @@
   Ekiga::AudioOutputConfig config;
   config.volume = volume;
   config.modifyable = true;
-  runtime.run_in_main (new device_opened_in_main (this, ps, current_state[ps].device, config));
+  runtime.run_in_main (sigc::bind (device_opened.make_slot (), ps, current_state[ps].device, config));
 
   return true;
 }
@@ -205,7 +139,7 @@
      output_device[ps] = NULL;
   }
   current_state[ps].opened = false;
-  runtime.run_in_main (new device_closed_in_main (this, ps, current_state[ps].device));
+  runtime.run_in_main (sigc::bind (device_closed.make_slot (), ps, current_state[ps].device));
 }
 
 void GMAudioOutputManager_ptlib::set_buffer_size (Ekiga::AudioOutputPS ps, unsigned buffer_size, unsigned num_buffers)
@@ -237,7 +171,7 @@
     }
     else {
       PTRACE(1, "GMAudioOutputManager_ptlib\tEncountered error while trying to write data");
-      runtime.run_in_main (new device_error_in_main (this, ps, current_state[ps].device, Ekiga::AO_ERROR_WRITE));
+      runtime.run_in_main (sigc::bind (device_error.make_slot (), 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	Mon Jul 28 08:00:56 2008
@@ -39,44 +39,6 @@
 #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)
@@ -246,7 +208,7 @@
          internal_set_primary_device(desired_primary_device);
        }
 
-       runtime.run_in_main (new device_added_in_main (this, device));
+       runtime.run_in_main (sigc::bind (device_added.make_slot (), device));
      }
   }
 }
@@ -271,7 +233,7 @@
          internal_set_primary_device(new_device);
        }
 
-       runtime.run_in_main (new device_removed_in_main (this, device));
+       runtime.run_in_main (sigc::bind (device_removed.make_slot (), device));
      }
   }
 }

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

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

Modified: trunk/lib/engine/framework/runtime.h
==============================================================================
--- trunk/lib/engine/framework/runtime.h	(original)
+++ trunk/lib/engine/framework/runtime.h	Mon Jul 28 08:00:56 2008
@@ -49,18 +49,6 @@
  * @{
  */
 
-  /** 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 ~RuntimeCallback ()
-    {}
-
-    virtual void run () = 0;
-  };
-
   class Runtime
     : public Service
   {
@@ -82,12 +70,7 @@
 
     virtual void quit () = 0;
 
-    /* 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,
+    virtual void run_in_main (sigc::slot<void> action,
 			      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	Mon Jul 28 08:00:56 2008
@@ -41,45 +41,6 @@
 #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"))))
@@ -142,7 +103,7 @@
   settings.colour = 127;
   settings.contrast = 127;
   settings.modifyable = false;
-  runtime.run_in_main (new device_opened_in_main (this, current_state.device, settings));
+  runtime.run_in_main (sigc::bind (device_opened.make_slot (), current_state.device, settings));
   
   return true;
 }
@@ -152,7 +113,7 @@
   PTRACE(4, "GMVideoInputManager_mlogo\tClosing Moving Logo");
   free (background_frame);
   current_state.opened  = false;
-  runtime.run_in_main (new device_closed_in_main (this, current_state.device));
+  runtime.run_in_main (sigc::bind (device_closed.make_slot (), 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	Mon Jul 28 08:00:56 2008
@@ -40,66 +40,6 @@
 
 #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"))))
@@ -187,7 +127,7 @@
 
   if (error_code != Ekiga::VI_ERROR_NONE) {
     PTRACE(1, "GMVideoInputManager_ptlib\tEncountered error " << error_code << " while opening device ");
-    runtime.run_in_main (new device_error_in_main (this, current_state.device, error_code));
+    runtime.run_in_main (sigc::bind (device_error.make_slot (), current_state.device, error_code));
     return false;
   }
 
@@ -202,7 +142,7 @@
   settings.contrast = contrast >> 8;
   settings.modifyable = true;
 
-  runtime.run_in_main (new device_opened_in_main (this, current_state.device, settings));
+  runtime.run_in_main (sigc::bind (device_opened.make_slot (), current_state.device, settings));
 
   return true;
 }
@@ -215,7 +155,7 @@
     input_device = NULL;
   }
   current_state.opened = false;
-  runtime.run_in_main (new device_closed_in_main (this, current_state.device));
+  runtime.run_in_main (sigc::bind (device_closed.make_slot (), 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	Mon Jul 28 08:00:56 2008
@@ -44,42 +44,6 @@
 
 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),
@@ -263,7 +227,7 @@
       if ( desired_device == device )
         internal_set_device(device, current_channel, current_format);
 
-      runtime.run_in_main (new device_added_in_main (this, device));
+      runtime.run_in_main (sigc::bind (device_added.make_slot (), device));
     }
   }
 }
@@ -287,7 +251,7 @@
             internal_set_device(new_device, current_channel, current_format);
        }
 
-       runtime.run_in_main (new device_removed_in_main (this, device));
+       runtime.run_in_main (sigc::bind (device_removed.make_slot (), 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	Mon Jul 28 08:00:56 2008
@@ -42,34 +42,8 @@
  *
  */
 
-#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;
-};
+#include "videooutput-manager-common.h"
 
 /* The functions */
 GMVideoOutputManager::GMVideoOutputManager(Ekiga::ServiceCore & _core)
@@ -256,13 +230,10 @@
 
 void GMVideoOutputManager::update_gui_device ()
 {
-  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);
+  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));
+
 }
 
 

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	Mon Jul 28 08:00:56 2008
@@ -43,83 +43,6 @@
 #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)
 {
@@ -191,17 +114,17 @@
 
   switch (current_frame.mode) {
   case Ekiga::VO_MODE_LOCAL:
-    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)));
+    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)));
     break;
   case Ekiga::VO_MODE_REMOTE:
   case Ekiga::VO_MODE_PIP:
-    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)));
+    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)));
     break;
   case Ekiga::VO_MODE_FULLSCREEN:
-    runtime.run_in_main (new size_changed_in_main (this, 176, 144));
+    runtime.run_in_main (sigc::bind (size_changed.make_slot (), 176, 144));
     break;
   case Ekiga::VO_MODE_PIP_WINDOW:
-    runtime.run_in_main (new size_changed_in_main (this, 176, 144));
+    runtime.run_in_main (sigc::bind (size_changed.make_slot (), 176, 144));
     break;
   case Ekiga::VO_MODE_UNSET:
   default:
@@ -496,13 +419,13 @@
   }
 
   last_frame.both_streams_active = 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));
+  runtime.run_in_main (sigc::bind (device_opened.make_slot (), current_frame.accel, current_frame.mode, current_frame.zoom, current_frame.both_streams_active));
 }
 
 void
 GMVideoOutputManager_x::close_frame_display ()
 {
-  runtime.run_in_main (new device_closed_in_main (this));
+  runtime.run_in_main (device_closed.make_slot ());
 
   if (rxWindow) 
     rxWindow->RegisterSlave (NULL);
@@ -553,7 +476,7 @@
     lxWindow->ProcessEvents();
 
   if (current_frame.mode == Ekiga::VO_MODE_FULLSCREEN && rxWindow && !rxWindow->IsFullScreen ())
-    runtime.run_in_main (new fullscreen_mode_changed_in_main (this, Ekiga::VO_FS_OFF));
+    runtime.run_in_main (sigc::bind (fullscreen_mode_changed.make_slot (), 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	Mon Jul 28 08:00:56 2008
@@ -43,26 +43,6 @@
 #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 {
 
@@ -355,11 +335,15 @@
         info = _("Failed");
 
       /* Signal */
-      runtime.run_in_main (new registration_event_in_main (this, &account, Ekiga::AccountCore::RegistrationFailed, info));
+      runtime.run_in_main (sigc::bind (registration_event.make_slot (), &account,
+                                       Ekiga::AccountCore::RegistrationFailed,
+                                       info));
     }
     else {
 
-      runtime.run_in_main (new registration_event_in_main (this, &account, Ekiga::AccountCore::Registered, std::string ()));
+      runtime.run_in_main (sigc::bind (registration_event.make_slot (), &account,
+                                       Ekiga::AccountCore::Registered,
+                                       std::string ()));
     }
   }
   else if (unregister && IsRegisteredWithGatekeeper (account.get_host ())) {
@@ -368,7 +352,9 @@
     RemoveAliasName (account.get_username ());
 
     /* Signal */
-    runtime.run_in_main (new registration_event_in_main (this, &account, Ekiga::AccountCore::Unregistered, std::string ()));
+    runtime.run_in_main (sigc::bind (registration_event.make_slot (), &account,
+                                     Ekiga::AccountCore::Unregistered,
+                                     std::string ()));
   }
 }
 

Modified: trunk/src/endpoints/manager.cpp
==============================================================================
--- trunk/src/endpoints/manager.cpp	(original)
+++ trunk/src/endpoints/manager.cpp	Mon Jul 28 08:00:56 2008
@@ -50,37 +50,6 @@
 
 #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); 
@@ -117,7 +86,7 @@
          iter++) 
       (*iter)->set_listen_port ((*iter)->get_listen_interface ().port);
 
-    runtime.run_in_main (new manager_ready_in_main (&manager));
+    runtime.run_in_main (manager.ready.make_slot ());
   };
 
 private:
@@ -680,7 +649,7 @@
   std::string account = (const char *) _acc;
   std::string summary = (const char *) _msgs;
 
-  runtime.run_in_main (new mwi_event_in_main (this, account, summary));
+  runtime.run_in_main (sigc::bind (mwi_event.make_slot (), account, summary));
 }
 
 

Modified: trunk/src/endpoints/opal-call.cpp
==============================================================================
--- trunk/src/endpoints/opal-call.cpp	(original)
+++ trunk/src/endpoints/opal-call.cpp	Mon Jul 28 08:00:56 2008
@@ -52,170 +52,6 @@
 #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;
 
 
@@ -332,11 +168,9 @@
       stream->SetPaused (!paused);
 
       if (paused)
-        runtime.run_in_main (new stream_resumed_in_main (this,
-							 stream_name, type));
+        runtime.run_in_main (sigc::bind (stream_resumed, stream_name, type));
       else
-        runtime.run_in_main (new stream_paused_in_main (this,
-							stream_name, type));
+        runtime.run_in_main (sigc::bind (stream_paused, stream_name, type));
     }
   }
 }
@@ -477,7 +311,7 @@
   if (!PIsDescendant(&connection, OpalPCSSConnection)) {
 
     parse_info (connection);
-    runtime.run_in_main (new established_in_main (this));
+    runtime.run_in_main (established.make_slot ());
   }
 
   if (PIsDescendant(&connection, OpalRTPConnection)) {
@@ -514,7 +348,7 @@
         && !is_outgoing ()
         && connection.GetCallEndReason () != OpalConnection::EndedByAnswerDenied) {
 
-      runtime.run_in_main (new missed_in_main (this));
+      runtime.run_in_main (missed.make_slot ());
     }
     else {
 
@@ -600,7 +434,7 @@
         reason = _("Call completed");
       }
 
-      runtime.run_in_main (new cleared_in_main (this, reason));
+      runtime.run_in_main (sigc::bind (cleared.make_slot (), reason));
     }
   }
 
@@ -629,7 +463,7 @@
 
   outgoing = PIsDescendant(&connection, OpalPCSSConnection);
 
-  runtime.run_in_main (new setup_in_main (this));
+  runtime.run_in_main (setup.make_slot ());
 
   return OpalCall::OnSetUp (connection);
 }
@@ -640,9 +474,9 @@
                          bool on_hold)
 {
   if (on_hold)
-    runtime.run_in_main (new held_in_main (this));
+    runtime.run_in_main (held.make_slot ());
   else
-    runtime.run_in_main (new retrieved_in_main (this));
+    runtime.run_in_main (retrieved.make_slot ());
 }
 
 
@@ -657,8 +491,7 @@
   std::transform (stream_name.begin (), stream_name.end (), stream_name.begin (), (int (*) (int)) toupper);
   is_transmitting = !stream.IsSource ();
 
-  runtime.run_in_main (new stream_opened_in_main (this, stream_name,
-						  type, is_transmitting));
+  runtime.run_in_main (sigc::bind (stream_opened, stream_name, type, is_transmitting));
 }
 
 
@@ -673,8 +506,7 @@
   std::transform (stream_name.begin (), stream_name.end (), stream_name.begin (), (int (*) (int)) toupper);
   is_transmitting = !stream.IsSource ();
 
-  runtime.run_in_main (new stream_closed_in_main (this, stream_name,
-						  type, is_transmitting));
+  runtime.run_in_main (sigc::bind (stream_closed, stream_name, type, is_transmitting));
 }
 
 

Modified: trunk/src/endpoints/pcss.cpp
==============================================================================
--- trunk/src/endpoints/pcss.cpp	(original)
+++ trunk/src/endpoints/pcss.cpp	Mon Jul 28 08:00:56 2008
@@ -44,19 +44,6 @@
 #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),
@@ -82,7 +69,7 @@
   Ekiga::Call *call = dynamic_cast<Ekiga::Call *> (&connection.GetCall ());
 
   if (call)
-    runtime.run_in_main (new ringing_in_main (call));
+    runtime.run_in_main (call->ringing.make_slot ());
 
   return true;
 }

Modified: trunk/src/endpoints/sip.cpp
==============================================================================
--- trunk/src/endpoints/sip.cpp	(original)
+++ trunk/src/endpoints/sip.cpp	Mon Jul 28 08:00:56 2008
@@ -51,50 +51,6 @@
 #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 {
@@ -605,7 +561,9 @@
   /* Signal */
   Ekiga::Account *account = account_core.find_account (strm.str ());
   if (account)
-    runtime.run_in_main (new registration_event_in_main (this, account, was_registering ? Ekiga::AccountCore::Registered : Ekiga::AccountCore::Unregistered, std::string ()));
+    runtime.run_in_main (sigc::bind (registration_event.make_slot (), account,
+                                     was_registering ? Ekiga::AccountCore::Registered : Ekiga::AccountCore::Unregistered,
+                                     std::string ()));
 }
 
 
@@ -835,7 +793,9 @@
   /* Signal */
   Ekiga::Account *account = account_core.find_account (strm.str ());
   if (account)
-    runtime.run_in_main (new registration_event_in_main (this, account, wasRegistering ? Ekiga::AccountCore::RegistrationFailed : Ekiga::AccountCore::UnregistrationFailed, info));
+    runtime.run_in_main (sigc::bind (registration_event.make_slot (), account,
+                                     wasRegistering ? Ekiga::AccountCore::RegistrationFailed : Ekiga::AccountCore::UnregistrationFailed,
+                                     info));
 }
 
 
@@ -1003,7 +963,8 @@
    * TODO
    * Wouldn't it be convenient to emit the signal and have the presence core listen to it ?
    */
-  runtime.run_in_main (new presence_status_received_in_main (presence_core, _uri, presence, status));
+  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));
 }
 
 



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