ekiga r5921 - in trunk: . lib/engine/components lib/engine/components/gmconf-personal-details lib/engine/framework



Author: dsandras
Date: Sat Jan 19 22:04:50 2008
New Revision: 5921
URL: http://svn.gnome.org/viewvc/ekiga?rev=5921&view=rev

Log:
Added new framework to manage personal details (display name, status,
...) and a GmConf implementation. When one detail change, interested
objects can react appropriately if they have connected to the right
signal.


Added:
   trunk/lib/engine/components/
   trunk/lib/engine/components/Makefile.am
   trunk/lib/engine/components/gmconf-personal-details/
   trunk/lib/engine/components/gmconf-personal-details/Makefile.am
   trunk/lib/engine/components/gmconf-personal-details/gmconf-personal-details-main.cpp
   trunk/lib/engine/components/gmconf-personal-details/gmconf-personal-details-main.h
   trunk/lib/engine/components/gmconf-personal-details/gmconf-personal-details.cpp
   trunk/lib/engine/components/gmconf-personal-details/gmconf-personal-details.h
   trunk/lib/engine/framework/personal-details.cpp
   trunk/lib/engine/framework/personal-details.h
Modified:
   trunk/ChangeLog
   trunk/lib/engine/framework/Makefile.am

Added: trunk/lib/engine/components/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/lib/engine/components/Makefile.am	Sat Jan 19 22:04:50 2008
@@ -0,0 +1,2 @@
+SUBDIRS = 				\
+	gmconf-personal-details 

Added: trunk/lib/engine/components/gmconf-personal-details/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/lib/engine/components/gmconf-personal-details/Makefile.am	Sat Jan 19 22:04:50 2008
@@ -0,0 +1,23 @@
+noinst_LTLIBRARIES = libgmconfpersonaldetails.la
+
+gmconf_personal_details_dir = $(top_srcdir)/lib/engine/components/gmconf-personal-details
+
+AM_CXXFLAGS = $(SIGC_CFLAGS) $(GLIB_CFLAGS)
+
+INCLUDES = 					\
+	-I$(top_srcdir)/lib/gmconf	 	\
+	-I$(top_srcdir)/lib/engine/include 	\
+	-I$(top_srcdir)/lib/engine/framework 
+
+libgmconfpersonaldetails_la_SOURCES = 						\
+	$(gmconf_personal_details_dir)/gmconf-personal-details.cpp		\
+	$(gmconf_personal_details_dir)/gmconf-personal-details.h		\
+	$(gmconf_personal_details_dir)/gmconf-personal-details-main.cpp		\
+	$(gmconf_personal_details_dir)/gmconf-personal-details-main.h
+
+
+
+libgmconfpersonaldetails_la_LIBADD = 						\
+	$(top_builddir)/lib/engine/framework/libgmframework.la
+
+libgmconfpersonaldetails_la_LDFLAGS = -export-dynamic -no-undefined $(SIGC_LIBS) $(GLIB_LIBS)

Added: trunk/lib/engine/components/gmconf-personal-details/gmconf-personal-details-main.cpp
==============================================================================
--- (empty file)
+++ trunk/lib/engine/components/gmconf-personal-details/gmconf-personal-details-main.cpp	Sat Jan 19 22:04:50 2008
@@ -0,0 +1,53 @@
+
+/* Ekiga -- A VoIP and Video-Conferencing application
+ * Copyright (C) 2000-2007 Damien Sandras
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *
+ * Ekiga is licensed under the GPL license and as a special exception,
+ * you have permission to link or otherwise combine this program with the
+ * programs OPAL, OpenH323 and PWLIB, and distribute the combination,
+ * without applying the requirements of the GNU GPL to the OPAL, OpenH323
+ * and PWLIB programs, as long as you do follow the requirements of the
+ * GNU GPL for all the rest of the software thus combined.
+ */
+
+
+/*
+ *                         gmconf-personal-details-main.cpp  -  description
+ *                         ------------------------------------------
+ *   begin                : written in 2007 by Damien Sandras 
+ *   copyright            : (c) 2007 by Damien Sandras
+ *   description          : code to hook gmconf personal details into the main program
+ *
+ */
+
+#include "gmconf-personal-details-main.h"
+#include "gmconf-personal-details.h"
+
+bool 
+gmconf_personal_details_init (Ekiga::ServiceCore &core,
+                              int * /*argc*/,
+                              char ** /*argv*/[])
+{
+  Ekiga::PersonalDetails *personal_details = NULL;
+
+  personal_details = new Gmconf::PersonalDetails ();
+  
+  core.add (*personal_details);
+
+  return true;
+}

Added: trunk/lib/engine/components/gmconf-personal-details/gmconf-personal-details-main.h
==============================================================================
--- (empty file)
+++ trunk/lib/engine/components/gmconf-personal-details/gmconf-personal-details-main.h	Sat Jan 19 22:04:50 2008
@@ -0,0 +1,47 @@
+
+/* Ekiga -- A VoIP and Video-Conferencing application
+ * Copyright (C) 2000-2007 Damien Sandras
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *
+ * Ekiga is licensed under the GPL license and as a special exception,
+ * you have permission to link or otherwise combine this program with the
+ * programs OPAL, OpenH323 and PWLIB, and distribute the combination,
+ * without applying the requirements of the GNU GPL to the OPAL, OpenH323
+ * and PWLIB programs, as long as you do follow the requirements of the
+ * GNU GPL for all the rest of the software thus combined.
+ */
+
+
+/*
+ *                         gmconf-personal-details-main.h  -  description
+ *                         ------------------------------------------
+ *   begin                : written in 2008 by Damien Sandras
+ *   copyright            : (c) 2008 by Damien Sandras 
+ *   description          : code to hook gmconf personal details into the main program
+ *
+ */
+
+#ifndef __GMCONF_PERSONAL_DETAILS_MAIN_H__
+#define __GMCONF_PERSONAL_DETAILS_MAIN_H__
+
+#include "services.h"
+
+bool gmconf_personal_details_init (Ekiga::ServiceCore &core,
+                                   int *argc,
+                                   char **argv[]);
+
+#endif

Added: trunk/lib/engine/components/gmconf-personal-details/gmconf-personal-details.cpp
==============================================================================
--- (empty file)
+++ trunk/lib/engine/components/gmconf-personal-details/gmconf-personal-details.cpp	Sat Jan 19 22:04:50 2008
@@ -0,0 +1,90 @@
+
+/*
+ * Ekiga -- A VoIP and Video-Conferencing application
+ * Copyright (C) 2000-2008 Damien Sandras
+
+ * This program is free software; you can  redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version. This program is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Ekiga is licensed under the GPL license and as a special exception, you
+ * have permission to link or otherwise combine this program with the
+ * programs OPAL, OpenH323 and PWLIB, and distribute the combination, without
+ * applying the requirements of the GNU GPL to the OPAL, OpenH323 and PWLIB
+ * programs, as long as you do follow the requirements of the GNU GPL for all
+ * the rest of the software thus combined.
+ */
+
+
+/*
+ *                         gmconf-personal-details.h  -  description
+ *                         ------------------------------------------
+ *   begin                : written in 2008 by Damien Sandras
+ *   copyright            : (c) 2008 by Damien Sandras
+ *   description          : declaration of the representation of personal details
+ *                          using gmconf
+ *
+ */
+
+#include <glib.h>
+
+#include "gmconf.h"
+#include "gmconf-personal-details.h"
+
+#include <iostream>
+
+using namespace Gmconf;
+
+static void
+display_name_changed_nt (gpointer /*id*/,
+                         GmConfEntry *entry,
+                         gpointer data)
+{
+  PersonalDetails *details = (PersonalDetails *) data;
+
+  if (gm_conf_entry_get_type (entry) == GM_CONF_STRING) 
+    details->set_display_name (gm_conf_entry_get_string (entry));
+  
+}
+
+static void
+short_status_changed_nt (gpointer /*id*/,
+                         GmConfEntry *entry,
+                         gpointer data)
+{
+  PersonalDetails *details = (PersonalDetails *) data;
+
+  if (gm_conf_entry_get_type (entry) == GM_CONF_STRING) 
+    details->set_short_status (gm_conf_entry_get_string (entry));
+  
+}
+
+static void
+long_status_changed_nt (gpointer /*id*/,
+                        GmConfEntry *entry,
+                        gpointer data)
+{
+  PersonalDetails *details = (PersonalDetails *) data;
+
+  if (gm_conf_entry_get_type (entry) == GM_CONF_STRING) 
+    details->set_long_status (gm_conf_entry_get_string (entry));
+}
+
+PersonalDetails::PersonalDetails () 
+{
+  gm_conf_notifier_add ("/apps/ekiga/general/personal_data/full_name",
+                        display_name_changed_nt, this);
+  gm_conf_notifier_add ("/apps/ekiga/general/personal_data/short_status",
+                        short_status_changed_nt, this);
+  gm_conf_notifier_add ("/apps/ekiga/general/personal_data/long_status",
+                        long_status_changed_nt, this);
+}
+

Added: trunk/lib/engine/components/gmconf-personal-details/gmconf-personal-details.h
==============================================================================
--- (empty file)
+++ trunk/lib/engine/components/gmconf-personal-details/gmconf-personal-details.h	Sat Jan 19 22:04:50 2008
@@ -0,0 +1,55 @@
+
+/*
+ * Ekiga -- A VoIP and Video-Conferencing application
+ * Copyright (C) 2000-2008 Damien Sandras
+
+ * This program is free software; you can  redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version. This program is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Ekiga is licensed under the GPL license and as a special exception, you
+ * have permission to link or otherwise combine this program with the
+ * programs OPAL, OpenH323 and PWLIB, and distribute the combination, without
+ * applying the requirements of the GNU GPL to the OPAL, OpenH323 and PWLIB
+ * programs, as long as you do follow the requirements of the GNU GPL for all
+ * the rest of the software thus combined.
+ */
+
+
+/*
+ *                         gmconf-personal-details.h  -  description
+ *                         ------------------------------------------
+ *   begin                : written in 2008 by Damien Sandras
+ *   copyright            : (c) 2008 by Damien Sandras
+ *   description          : declaration of the representation of personal details
+ *                          using gmconf
+ *
+ */
+
+#ifndef __GMCONF_PERSONAL_DETAILS_H__
+#define __GMCONF_PERSONAL_DETAILS_H__
+
+#include "personal-details.h"
+
+namespace Gmconf
+{
+  class PersonalDetails 
+    : public Ekiga::PersonalDetails
+  {
+  public:
+
+    PersonalDetails ();
+
+    virtual ~PersonalDetails () {};
+  };
+};
+
+#endif

Modified: trunk/lib/engine/framework/Makefile.am
==============================================================================
--- trunk/lib/engine/framework/Makefile.am	(original)
+++ trunk/lib/engine/framework/Makefile.am	Sat Jan 19 22:04:50 2008
@@ -32,6 +32,8 @@
 			    $(framework_dir)/services.cpp \
 			    $(framework_dir)/trigger.h \
 			    $(framework_dir)/menu-xml.h \
-			    $(framework_dir)/menu-xml.cpp 
+			    $(framework_dir)/menu-xml.cpp \
+			    $(framework_dir)/personal-details.h \
+			    $(framework_dir)/personal-details.cpp
 
 libgmframework_la_LDFLAGS = -export-dynamic -no-undefined $(SIGC_LIBS) $(GLIB_LIBS) $(XML_LIBS)

Added: trunk/lib/engine/framework/personal-details.cpp
==============================================================================
--- (empty file)
+++ trunk/lib/engine/framework/personal-details.cpp	Sat Jan 19 22:04:50 2008
@@ -0,0 +1,80 @@
+
+/*
+ * Ekiga -- A VoIP and Video-Conferencing application
+ * Copyright (C) 2000-2008 Damien Sandras
+
+ * This program is free software; you can  redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version. This program is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Ekiga is licensed under the GPL license and as a special exception, you
+ * have permission to link or otherwise combine this program with the
+ * programs OPAL, OpenH323 and PWLIB, and distribute the combination, without
+ * applying the requirements of the GNU GPL to the OPAL, OpenH323 and PWLIB
+ * programs, as long as you do follow the requirements of the GNU GPL for all
+ * the rest of the software thus combined.
+ */
+
+
+/*
+ *                         personal-details.h  -  description
+ *                         ------------------------------------------
+ *   begin                : written in 2008 by Damien Sandras
+ *   copyright            : (c) 2008 by Damien Sandras
+ *   description          : declaration of the representation of personal details
+ *
+ */
+
+
+#include "personal-details.h"
+
+using namespace Ekiga;
+
+
+const std::string & PersonalDetails::get_display_name () 
+{ 
+  return display_name; 
+}
+
+
+const std::string & PersonalDetails::get_short_status () 
+{ 
+  return short_status; 
+}
+
+
+const std::string & PersonalDetails::get_long_status () 
+{ 
+  return long_status; 
+}
+
+
+void PersonalDetails::set_display_name (const std::string & _display_name)
+{
+  display_name = _display_name;
+  personal_details_updated.emit (*this);
+}
+
+
+void PersonalDetails::set_short_status (const std::string & _short_status)
+{
+  short_status = _short_status;
+  personal_details_updated.emit (*this);
+}
+
+
+void PersonalDetails::set_long_status (const std::string & _long_status)
+{
+  long_status = _long_status;
+  personal_details_updated.emit (*this);
+}
+
+

Added: trunk/lib/engine/framework/personal-details.h
==============================================================================
--- (empty file)
+++ trunk/lib/engine/framework/personal-details.h	Sat Jan 19 22:04:50 2008
@@ -0,0 +1,92 @@
+
+/*
+ * Ekiga -- A VoIP and Video-Conferencing application
+ * Copyright (C) 2000-2008 Damien Sandras
+
+ * This program is free software; you can  redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version. This program is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Ekiga is licensed under the GPL license and as a special exception, you
+ * have permission to link or otherwise combine this program with the
+ * programs OPAL, OpenH323 and PWLIB, and distribute the combination, without
+ * applying the requirements of the GNU GPL to the OPAL, OpenH323 and PWLIB
+ * programs, as long as you do follow the requirements of the GNU GPL for all
+ * the rest of the software thus combined.
+ */
+
+
+/*
+ *                         personal-details.h  -  description
+ *                         ------------------------------------------
+ *   begin                : written in 2008 by Damien Sandras
+ *   copyright            : (c) 2008 by Damien Sandras
+ *   description          : declaration of the representation of personal details
+ *
+ */
+
+#ifndef __PERSONAL_DETAILS_H__
+#define __PERSONAL_DETAILS_H__
+
+#include <string>
+#include <sigc++/sigc++.h>
+
+#include "services.h"
+
+namespace Ekiga
+{
+  class PersonalDetails 
+    : public Service
+  {
+  public:
+    PersonalDetails () {};
+
+    virtual ~PersonalDetails () {}
+
+
+    /*** Service Implementation ***/
+  public:
+    /** Returns the name of the service.
+     * @return The service name.
+     */
+    const std::string get_name () const
+    { return "personal-details"; }
+
+    /** Returns the description of the service.
+     * @return The service description.
+     */
+    const std::string get_description () const
+    { return "\tPersonal details management object"; }
+
+
+    /*** PersonalDetails API ***/
+    const std::string & get_display_name (); 
+
+    const std::string & get_short_status ();
+
+    const std::string & get_long_status ();
+
+    void set_display_name (const std::string & display_name);
+
+    void set_short_status (const std::string & short_status);
+
+    void set_long_status (const std::string & long_status);
+
+    sigc::signal<void, PersonalDetails &> personal_details_updated;
+
+  private:
+    std::string display_name;
+    std::string short_status;
+    std::string long_status;
+  };
+};
+
+#endif



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