ekiga r6212 - in trunk: . lib/engine lib/engine/components/avahi-publisher src src/clients src/endpoints



Author: dsandras
Date: Sun Apr 20 19:04:23 2008
New Revision: 6212
URL: http://svn.gnome.org/viewvc/ekiga?rev=6212&view=rev

Log:
Moved the old avahi publisher to the engine. Largely unfinished.


Added:
   trunk/lib/engine/components/avahi-publisher/avahi.cpp
      - copied, changed from r6210, /trunk/src/clients/avahi.cpp
   trunk/lib/engine/components/avahi-publisher/avahi.h
      - copied unchanged from r6210, /trunk/src/clients/avahi.h
Removed:
   trunk/lib/engine/components/avahi-publisher/avahi-publisher.cpp
   trunk/lib/engine/components/avahi-publisher/avahi-publisher.h
   trunk/src/clients/avahi.cpp
   trunk/src/clients/avahi.h
Modified:
   trunk/ChangeLog
   trunk/lib/engine/components/avahi-publisher/avahi-publisher-main.cpp
   trunk/lib/engine/engine.cpp
   trunk/src/Makefile.am
   trunk/src/endpoints/manager.cpp
   trunk/src/endpoints/manager.h

Modified: trunk/lib/engine/components/avahi-publisher/avahi-publisher-main.cpp
==============================================================================
--- trunk/lib/engine/components/avahi-publisher/avahi-publisher-main.cpp	(original)
+++ trunk/lib/engine/components/avahi-publisher/avahi-publisher-main.cpp	Sun Apr 20 19:04:23 2008
@@ -38,16 +38,17 @@
 #include "avahi-publisher-main.h"
 #include "avahi-publisher.h"
 
+#include <iostream>
+
 bool
 avahi_publisher_init (Ekiga::ServiceCore &core,
                       int* /*argc*/,
                       char* */*argv*/[])
 {
-  bool result = false;
   Ekiga::Service *service = NULL;
 
   service = new Avahi::PresencePublisher (core);
   core.add (*service);
 
-  return result;
+  return true;
 }

Copied: trunk/lib/engine/components/avahi-publisher/avahi.cpp (from r6210, /trunk/src/clients/avahi.cpp)
==============================================================================
--- /trunk/src/clients/avahi.cpp	(original)
+++ trunk/lib/engine/components/avahi-publisher/avahi.cpp	Sun Apr 20 19:04:23 2008
@@ -106,6 +106,7 @@
 GMZeroconfPublisher::GMZeroconfPublisher (GMManager & m)
   : manager (m)
 {  
+  std::cout << "Created publisher " << std::endl << std::flush;
   /* Create the GLIB Adaptor */
   glib_poll = avahi_glib_poll_new (NULL, G_PRIORITY_DEFAULT);
   poll_api = avahi_glib_poll_get (glib_poll);

Modified: trunk/lib/engine/engine.cpp
==============================================================================
--- trunk/lib/engine/engine.cpp	(original)
+++ trunk/lib/engine/engine.cpp	Sun Apr 20 19:04:23 2008
@@ -80,6 +80,7 @@
 
 #ifdef HAVE_AVAHI
 #include "avahi-main.h"
+#include "avahi-publisher-main.h"
 #endif
 
 #ifdef HAVE_EDS
@@ -195,6 +196,12 @@
     delete core;
     return;
   }
+  
+  if (!avahi_publisher_init (*core, &argc, &argv)) {
+    std::cout << "delete" << std::endl << std::flush;
+    delete core;
+    return;
+  }
 #endif
 
 #ifdef HAVE_EDS

Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am	(original)
+++ trunk/src/Makefile.am	Sun Apr 20 19:04:23 2008
@@ -151,14 +151,8 @@
 	(cd $(srcdir) && sed -e 's#\ bindir\@# bindir@#' $<) > $@
 endif
 
-if HAVE_AVAHI
-ekiga_SOURCES += 		\
-	clients/avahi.h		\
-	clients/avahi.cpp 	
-endif
-
-AM_CXXFLAGS = $(GTK_CFLAGS) $(GLIB_CFLAGS) $(GNOME_CFLAGS) $(AVAHI_CFLAGS) $(DBUS_CFLAGS) $(BONOBO_CFLAGS) $(OPAL_CFLAGS) $(PTLIB_CFLAGS) $(SIGC_CFLAGS) $(XML_CFLAGS)
-AM_LIBS = $(GTK_LIBS) $(GLIB_LIBS) $(GNOME_LIBS) $(AVAHI_LIBS) $(DBUS_LIBS) $(BONOBO_LIBS) $(OPAL_LIBS) $(PTLIB_LIBS) $(SIGC_LIBS) $(XML_LIBS)
+AM_CXXFLAGS = $(GTK_CFLAGS) $(GLIB_CFLAGS) $(GNOME_CFLAGS) $(DBUS_CFLAGS) $(BONOBO_CFLAGS) $(OPAL_CFLAGS) $(PTLIB_CFLAGS) $(SIGC_CFLAGS) $(XML_CFLAGS)
+AM_LIBS = $(GTK_LIBS) $(GLIB_LIBS) $(GNOME_LIBS) $(DBUS_LIBS) $(BONOBO_LIBS) $(OPAL_LIBS) $(PTLIB_LIBS) $(SIGC_LIBS) $(XML_LIBS)
 
 ekiga_LDADD = \
 	$(top_builddir)/lib/libekiga.la $(top_builddir)/lib/engine/libekiga_engine.la $(AM_LIBS) 

Modified: trunk/src/endpoints/manager.cpp
==============================================================================
--- trunk/src/endpoints/manager.cpp	(original)
+++ trunk/src/endpoints/manager.cpp	Sun Apr 20 19:04:23 2008
@@ -148,10 +148,6 @@
   //FIXME: we shouldnt call sound events here but signal to the frontend which then triggers them
 {
   /* Initialise the endpoint paramaters */
-#ifdef HAVE_AVAHI
-  zcp = NULL;
-#endif
-
   gk = NULL;
   sc = NULL;
 
@@ -561,10 +557,6 @@
 {
   ClearAllCalls (OpalConnection::EndedByLocalUser, TRUE);
 
-#ifdef HAVE_AVAHI
-  RemoveZeroconfClient ();
-#endif
-
   RemoveAccountsEndpoint ();
 
   RemoveSTUNClient ();
@@ -684,17 +676,6 @@
 
 
 void
-GMManager::UpdatePublishers (void)
-{
-#ifdef HAVE_AVAHI
-  PWaitAndSignal m(zcp_access_mutex);
-  if (zcp)  
-    zcp->Publish ();
-#endif
-}
-
-
-void
 GMManager::Register (GmAccount *account)
 {
   PWaitAndSignal m(manager_access_mutex);
@@ -718,33 +699,6 @@
 }
 
 
-#ifdef HAVE_AVAHI
-void 
-GMManager::CreateZeroconfClient ()
-{
-  PWaitAndSignal m(zcp_access_mutex);
-
-  if (zcp)
-    delete zcp;
-
-  zcp = new GMZeroconfPublisher (*this);
-}
-
-
-void 
-GMManager::RemoveZeroconfClient ()
-{
-  PWaitAndSignal m(zcp_access_mutex);
-
-  if (zcp) {
-
-    delete zcp;
-    zcp = NULL;
-  }
-}
-#endif
-
-
 void 
 GMManager::CreateSTUNClient (bool display_progress,
                              bool display_config_dialog,
@@ -858,14 +812,6 @@
   else
     SetTranslationAddress (PString ("0.0.0.0")); 
   
-  /* Create a Zeroconf client */
-#ifdef HAVE_AVAHI
-  CreateZeroconfClient ();
-#endif
-
-  /* Update publishers */
-  UpdatePublishers ();
-
   /* Set initial codecs */
   SetMediaFormatOrder (PStringArray ());
   SetMediaFormatMask (PStringArray ());

Modified: trunk/src/endpoints/manager.h
==============================================================================
--- trunk/src/endpoints/manager.h	(original)
+++ trunk/src/endpoints/manager.h	Sun Apr 20 19:04:23 2008
@@ -43,10 +43,6 @@
 
 #include "common.h"
 
-#ifdef HAVE_AVAHI
-#include "avahi.h"
-#endif
-
 #include "accounts.h"
 
 #include "stun.h"
@@ -230,23 +226,6 @@
   GMSIPEndpoint *GetSIPEndpoint ();
 
 
-#ifdef HAVE_AVAHI
-  /* DESCRIPTION  :  /
-   * BEHAVIOR     :  Create a zeroconf client that will publish information
-   *                 about Ekiga.
-   * PRE          :  /
-   */
-  void CreateZeroconfClient ();
-
-
-  /* DESCRIPTION  :  /
-   * BEHAVIOR     :  Remove any running Zeroconf client.
-   * PRE          :  /
-   */
-  void RemoveZeroconfClient ();
-#endif
-
-  
   /* DESCRIPTION  :  /
    * BEHAVIOR     :  Create a STUN client.
    * PRE          :  First parameter : TRUE if a progress dialog should be
@@ -271,13 +250,6 @@
   void RemoveSTUNClient ();
 
   
-  /* DESCRIPTION :  /
-   * BEHAVIOR    :  Update the various registrations (ILS, zeroconf, etc)
-   * PRE         :  /
-   */
-  void UpdatePublishers (void);
-
-  
   /* DESCRIPTION  :  /
    * BEHAVIOR     :  Register (or unregister) all accounts or the one provided.
    * 		     It launches an accounts manager to register the given
@@ -412,11 +384,6 @@
   PString tr_video_codec;
 
 
-#ifdef HAVE_AVAHI
-  GMZeroconfPublisher *zcp;
-  PMutex zcp_access_mutex;
-#endif
-
   Ekiga::ServiceCore & core;
   Ekiga::Runtime & runtime;
   Ekiga::ConfBridge *bridge;



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