[ekiga] Revert "DBUS: Dropped client component."



commit dfc6a62e9d8b20f75cd918d98584341df94191b8
Author: Damien Sandras <dsandras beip be>
Date:   Sun Apr 22 11:54:02 2012 +0200

    Revert "DBUS: Dropped client component."
    
    This reverts commit 4610f507e23d5515b42cbfa7e1c8afc74632d132.

 src/Makefile.am         |   30 ++++++++++++++++++++++++++++++
 src/ekiga.cpp           |   18 ++++++++++++++++++
 src/ekiga.h             |    4 ++++
 src/gui/call_window.cpp |    4 ++++
 src/gui/main_window.cpp |   23 +++++++++++++++++++++++
 5 files changed, 79 insertions(+), 0 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index af1952b..0c9eac7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -94,6 +94,36 @@ ekiga_SOURCES +=                   		\
 	$(top_srcdir)/win32/ekiga-rc.rc
 endif
 
+if HAVE_DBUS
+ekiga_SOURCES +=		\
+	dbus-helper/dbus.h	\
+	dbus-helper/dbus.cpp
+
+# find gmmarshallers.h
+INCLUDES += \
+	-I$(top_builddir)/lib
+
+nodist_ekiga_SOURCES +=		\
+	dbus-helper/dbus-stub.h
+
+bin_PROGRAMS += ekiga-helper
+
+ekiga_helper_SOURCES = 		\
+	dbus-helper/dbus-helper.cpp
+
+nodist_ekiga_helper_SOURCES = 	\
+	dbus-helper/dbus-helper-stub.h
+
+ekiga_helper_LDADD = $(DBUS_LIBS)
+
+BUILT_SOURCES += dbus-helper/dbus-helper-stub.h dbus-helper/dbus-stub.h
+
+dbus-helper/dbus-helper-stub.h: dbus-helper/dbus-helper-stub.xml build-subdir-stamp
+	$(LIBTOOL) --mode=execute dbus-binding-tool --prefix=helper --mode=glib-server --output=$@ $<
+
+dbus-helper/dbus-stub.h: dbus-helper/dbus-stub.xml build-subdir-stamp
+	$(LIBTOOL) --mode=execute dbus-binding-tool --prefix=ekiga_dbus_component --mode=glib-server --output=$@ $<
+endif
 
 build-subdir-stamp:
 	test -d dbus-helper || mkdir dbus-helper
diff --git a/src/ekiga.cpp b/src/ekiga.cpp
index e32ec88..b8dc6a5 100644
--- a/src/ekiga.cpp
+++ b/src/ekiga.cpp
@@ -47,6 +47,10 @@
 #include "notify.h"
 #include "gmstockicons.h"
 
+#ifdef HAVE_DBUS
+#include "dbus.h"
+#endif
+
 #define new PNEW
 
 
@@ -61,6 +65,9 @@ GnomeMeeting::GnomeMeeting ()
 
   assistant_window = NULL;
   prefs_window = NULL;
+#ifdef HAVE_DBUS
+  dbus_component = NULL;
+#endif
 }
 
 
@@ -98,6 +105,12 @@ GnomeMeeting::Exit ()
   if (statusicon)
     g_object_unref (statusicon);
   statusicon = NULL;
+
+#ifdef HAVE_DBUS
+  if (dbus_component)
+    g_object_unref (dbus_component);
+  dbus_component = NULL;
+#endif
 }
 
 
@@ -189,6 +202,11 @@ void GnomeMeeting::BuildGUI (Ekiga::ServiceCorePtr services)
 #else
   PTRACE (1, "Accelerated rendering support disabled");
 #endif
+#ifdef HAVE_DBUS
+  PTRACE (1, "DBUS support enabled");
+#else
+  PTRACE (1, "DBUS support disabled");
+#endif
 #ifdef HAVE_GCONF
   PTRACE (1, "GConf support enabled");
 #else
diff --git a/src/ekiga.h b/src/ekiga.h
index 1fcb477..5a3d7a8 100644
--- a/src/ekiga.h
+++ b/src/ekiga.h
@@ -157,6 +157,10 @@ class GnomeMeeting : public PProcess
   StatusIcon *statusicon;
 
   /* other things */
+#ifdef HAVE_DBUS
+  GObject *dbus_component;
+#endif
+
   static GnomeMeeting *GM;
 };
 
diff --git a/src/gui/call_window.cpp b/src/gui/call_window.cpp
index c3aef77..efc89f9 100644
--- a/src/gui/call_window.cpp
+++ b/src/gui/call_window.cpp
@@ -65,6 +65,10 @@
 #include <glib/gi18n.h>
 #include <gdk/gdkkeysyms.h>
 
+#ifdef HAVE_DBUS
+#include "dbus-helper/dbus.h"
+#endif
+
 #ifndef WIN32
 #include <signal.h>
 #include <gdk/gdkx.h>
diff --git a/src/gui/main_window.cpp b/src/gui/main_window.cpp
index a2b5860..974ec64 100644
--- a/src/gui/main_window.cpp
+++ b/src/gui/main_window.cpp
@@ -63,6 +63,10 @@
 #include <glib/gi18n.h>
 #include <gdk/gdkkeysyms.h>
 
+#ifdef HAVE_DBUS
+#include "dbus-helper/dbus.h"
+#endif
+
 #ifndef WIN32
 #include <signal.h>
 #include <gdk/gdkx.h>
@@ -2358,6 +2362,15 @@ main (int argc,
   // should come *after* ptrace initialisation, to track codec loading for ex.
   GnomeMeeting instance;
 
+#ifdef HAVE_DBUS
+  if (!ekiga_dbus_claim_ownership ()) {
+    ekiga_dbus_client_show ();
+    if (url != NULL)
+      ekiga_dbus_client_connect (url);
+    exit (0);
+  }
+#endif
+
   Ekiga::Runtime::init ();
   engine_init (service_core, argc, argv);
 
@@ -2391,9 +2404,19 @@ main (int argc,
   if (url)
     call_core->dial (url);
 
+#ifdef HAVE_DBUS
+  /* Create the dbus server instance */
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (main_window);
+  EkigaDBusComponent *dbus_component = ekiga_dbus_component_new (mw->priv->core);
+#endif
+
   /* The GTK loop */
   gtk_main ();
 
+#ifdef HAVE_DBUS
+  g_object_unref (dbus_component);
+#endif
+
   /* Exit Ekiga */
   GnomeMeeting::Process ()->Exit ();
   service_core.reset ();



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