ekiga r7561 - in trunk/lib/engine: . components/resource-list components/xcap



Author: jpuydt
Date: Fri Jan 16 13:48:44 2009
New Revision: 7561
URL: http://svn.gnome.org/viewvc/ekiga?rev=7561&view=rev

Log:
The resource-lists and XCAP code now kickstart too

Modified:
   trunk/lib/engine/components/resource-list/resource-list-main.cpp
   trunk/lib/engine/components/resource-list/resource-list-main.h
   trunk/lib/engine/components/xcap/xcap-main.cpp
   trunk/lib/engine/components/xcap/xcap-main.h
   trunk/lib/engine/engine.cpp

Modified: trunk/lib/engine/components/resource-list/resource-list-main.cpp
==============================================================================
--- trunk/lib/engine/components/resource-list/resource-list-main.cpp	(original)
+++ trunk/lib/engine/components/resource-list/resource-list-main.cpp	Fri Jan 16 13:48:44 2009
@@ -41,27 +41,42 @@
 #include "xcap-core.h"
 #include "rl-cluster.h"
 
-bool
-resource_list_init (Ekiga::ServiceCore& services,
-		    int* /*argc*/,
-		    char** /*argv*/[])
+struct RLSpark: public Ekiga::Spark
 {
-  bool result = false;
-  gmref_ptr<Ekiga::Service> service = services.get ("resource-list");
+  RLSpark (): result(false)
+  {}
 
-  if ( !service) {
-
-    gmref_ptr<Ekiga::PresenceCore> core = services.get ("presence-core");
-    gmref_ptr<XCAP::Core> xcap = services.get ("xcap-core");
-
-    if (core && xcap) {
-
-      gmref_ptr<RL::Cluster> cluster (new RL::Cluster (services));
-      services.add (cluster);
-      core->add_cluster (cluster);
+  bool try_initialize_more (Ekiga::ServiceCore& core,
+			    int* /*argc*/,
+			    char** /*argv*/[])
+  {
+    gmref_ptr<Ekiga::Service> service = core.get ("resource-list");
+    gmref_ptr<Ekiga::PresenceCore> presence_core = core.get ("presence-core");
+    gmref_ptr<XCAP::Core> xcap = core.get ("xcap-core");
+
+    if ( !service && presence_core && xcap) {
+
+      gmref_ptr<RL::Cluster> cluster (new RL::Cluster (core));
+      core.add (cluster);
+      presence_core->add_cluster (cluster);
       result = true;
     }
+
+    return result;
   }
 
-  return result;
+  Ekiga::Spark::state get_state () const
+  { return result?FULL:BLANK; }
+
+  const std::string get_name () const
+  { return "RL"; }
+
+  bool result;
+};
+
+void
+resource_list_init (Ekiga::KickStart& kickstart)
+{
+  gmref_ptr<Ekiga::Spark> spark(new RLSpark);
+  kickstart.add_spark (spark);
 }

Modified: trunk/lib/engine/components/resource-list/resource-list-main.h
==============================================================================
--- trunk/lib/engine/components/resource-list/resource-list-main.h	(original)
+++ trunk/lib/engine/components/resource-list/resource-list-main.h	Fri Jan 16 13:48:44 2009
@@ -39,10 +39,8 @@
 #ifndef __RL_MAIN_H__
 #define __RL_MAIN_H__
 
-#include "services.h"
+#include "kickstart.h"
 
-bool resource_list_init (Ekiga::ServiceCore& services,
-			 int* argc,
-			 char** argv[]);
+void resource_list_init (Ekiga::KickStart& kickstart);
 
 #endif

Modified: trunk/lib/engine/components/xcap/xcap-main.cpp
==============================================================================
--- trunk/lib/engine/components/xcap/xcap-main.cpp	(original)
+++ trunk/lib/engine/components/xcap/xcap-main.cpp	Fri Jan 16 13:48:44 2009
@@ -38,12 +38,41 @@
 #include "xcap-main.h"
 #include "xcap-core.h"
 
-bool
-xcap_init (Ekiga::ServiceCore& core)
+struct XCAPSpark: public Ekiga::Spark
 {
-  gmref_ptr<XCAP::Core> xcap(new XCAP::Core ());
+  XCAPSpark (): result(false)
+  {}
 
-  core.add (xcap);
+  bool try_initialize_more (Ekiga::ServiceCore& core,
+			    int* /*argc*/,
+			    char** /*argv*/[])
+  {
+    gmref_ptr<Ekiga::Service> xcap = core.get ("xcap-core");
 
-  return true;
+    if ( !xcap) {
+
+      gmref_ptr<XCAP::Core> xcap(new XCAP::Core ());
+
+      core.add (xcap);
+      result = true;
+    }
+
+    return result;
+  }
+
+  Ekiga::Spark::state get_state () const
+  { return result?FULL:BLANK; }
+
+  const std::string get_name () const
+  { return "XCAP"; }
+
+  bool result;
+};
+
+
+void
+xcap_init (Ekiga::KickStart& kickstart)
+{
+  gmref_ptr<Ekiga::Spark> spark(new XCAPSpark);
+  kickstart.add_spark (spark);
 }

Modified: trunk/lib/engine/components/xcap/xcap-main.h
==============================================================================
--- trunk/lib/engine/components/xcap/xcap-main.h	(original)
+++ trunk/lib/engine/components/xcap/xcap-main.h	Fri Jan 16 13:48:44 2009
@@ -38,8 +38,8 @@
 #ifndef __XCAP_MAIN_H__
 #define __XCAP_MAIN_H__
 
-#include "services.h"
+#include "kickstart.h"
 
-bool xcap_init (Ekiga::ServiceCore& core);
+void xcap_init (Ekiga::KickStart& kickstart);
 
 #endif

Modified: trunk/lib/engine/engine.cpp
==============================================================================
--- trunk/lib/engine/engine.cpp	(original)
+++ trunk/lib/engine/engine.cpp	Fri Jan 16 13:48:44 2009
@@ -169,10 +169,6 @@
   }
 #endif
 
-#ifdef HAVE_XCAP
-  xcap_init (*service_core);
-#endif
-
 #ifdef HAVE_DX
   if (!videooutput_dx_init (*service_core, &argc, &argv)) {
     delete service_core;
@@ -255,7 +251,8 @@
 #endif
 
 #ifdef HAVE_XCAP
-  resource_list_init (*service_core, &argc, &argv);
+  xcap_init (kickstart);
+  resource_list_init (kickstart);
 #endif
 
   if (!history_init (*service_core, &argc, &argv)) {



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