ekiga r7675 - in trunk: . lib/engine lib/engine/notification



Author: jpuydt
Date: Sun Feb 22 10:47:14 2009
New Revision: 7675
URL: http://svn.gnome.org/viewvc/ekiga?rev=7675&view=rev

Log:
Added a new user notification framework

Added:
   trunk/lib/engine/notification/
   trunk/lib/engine/notification/Makefile.am
   trunk/lib/engine/notification/notification-core.h
Modified:
   trunk/configure.ac
   trunk/lib/engine/Makefile.am
   trunk/lib/engine/engine.cpp

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Sun Feb 22 10:47:14 2009
@@ -749,6 +749,7 @@
 lib/engine/components/kab/Makefile
 lib/engine/chat/Makefile
 lib/engine/framework/Makefile
+lib/engine/notification/Makefile
 lib/engine/plugin/Makefile
 lib/engine/presence/Makefile
 lib/engine/components/avahi/Makefile

Modified: trunk/lib/engine/Makefile.am
==============================================================================
--- trunk/lib/engine/Makefile.am	(original)
+++ trunk/lib/engine/Makefile.am	Sun Feb 22 10:47:14 2009
@@ -1,4 +1,4 @@
-SUBDIRS = framework plugin account addressbook presence chat gui protocol videooutput videoinput audioinput audiooutput hal components
+SUBDIRS = framework  plugin notification account addressbook presence chat gui protocol videooutput videoinput audioinput audiooutput hal components
 
 noinst_LTLIBRARIES = libekiga_engine.la
 
@@ -9,6 +9,7 @@
 	-I$(top_srcdir)/lib/engine/gui/gtk-frontend			\
 	-I$(top_srcdir)/lib/engine/framework/		 		\
 	-I$(top_srcdir)/lib/engine/chat					\
+	-I$(top_srcdir)/lib/engine/notification				\
 	-I$(top_srcdir)/lib/engine/videooutput				\
 	-I$(top_srcdir)/lib/engine/videoinput/  			\
 	-I$(top_srcdir)/lib/engine/hal					\
@@ -73,6 +74,7 @@
 
 libekiga_engine_la_LDFLAGS = -export-dynamic
 libekiga_engine_la_LIBADD = \
+	$(top_builddir)/lib/engine/notification/libnotification.la					\
 	$(top_builddir)/lib/engine/gui/gtk-core/libgmgtk-core.la 					\
 	$(top_builddir)/lib/engine/gui/gtk-frontend/libgmgtk-frontend.la 				\
 	$(top_builddir)/lib/engine/chat/libgmchat.la 							\

Modified: trunk/lib/engine/engine.cpp
==============================================================================
--- trunk/lib/engine/engine.cpp	(original)
+++ trunk/lib/engine/engine.cpp	Sun Feb 22 10:47:14 2009
@@ -42,6 +42,7 @@
 #include "services.h"
 #include "kickstart.h"
 
+#include "notification-core.h"
 #include "plugin-core.h"
 #include "presence-core.h"
 #include "account-core.h"
@@ -131,6 +132,9 @@
   service_core = new Ekiga::ServiceCore;
   Ekiga::KickStart kickstart;
 
+
+  service_core->add (gmref_ptr<Ekiga::Service>(new Ekiga::NotificationCore));
+
   /* VideoInputCore depends on VideoOutputCore and must this              *
    * be constructed thereafter                                      */
 

Added: trunk/lib/engine/notification/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/lib/engine/notification/Makefile.am	Sun Feb 22 10:47:14 2009
@@ -0,0 +1,14 @@
+noinst_LTLIBRARIES = libnotification.la
+
+notification_dir = $(top_srcdir)/lib/engine/notification
+
+AM_CPPFLAGS = $(SIGC_CFLAGS) $(GLIB_CFLAGS)
+
+INCLUDES = \
+	-I$(top_srcdir)/lib/gmconf \
+	-I$(top_srcdir)/lib/engine/framework
+
+libnotification_la_SOURCES = \
+	$(notification_dir)/notification-core.h
+
+libnotification_la_LDFLAGS = -export-dynamic -no-undefined $(SIGC_LIBS) $(GLIB_LIBS)

Added: trunk/lib/engine/notification/notification-core.h
==============================================================================
--- (empty file)
+++ trunk/lib/engine/notification/notification-core.h	Sun Feb 22 10:47:14 2009
@@ -0,0 +1,104 @@
+
+/*
+ * Ekiga -- A VoIP and Video-Conferencing application
+ * Copyright (C) 2000-2009 Damien Sandras <dsandras seconix com>
+
+ * 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.
+ */
+
+
+/*
+ *                         notification.h  -  description
+ *                         ------------------------------------------
+ *   begin                : written in 2009 by Julien Puydt
+ *   copyright            : (c) 2009 by Julien Puydt
+ *   description          : declaration of the interface for user notifications
+ *
+ */
+
+#ifndef __NOTIFICATION_H__
+#define __NOTIFICATION_H__
+
+#include "gmref.h"
+
+namespace Ekiga
+{
+  /* the following class is mostly a trivial structure, but it comes
+   * with a decent memory management and a signal to know if it's still
+   * there
+   */
+  class Notification: public virtual GmRefCounted
+  {
+  public:
+
+    typedef enum { Info, Warning, Error } NotificationLevel;
+
+    Notification (NotificationLevel level_,
+		  const std::string title_,
+		  const std::string body_)
+      : level(level_), title(title_), body(body_)
+    {}
+
+    ~Notification () {}
+
+    NotificationLevel get_level () const
+    { return level; }
+
+    const std::string get_title () const
+    { return title; }
+
+    const std::string get_body () const
+    { return body; }
+
+    sigc::signal0<void> removed;
+
+  private:
+
+    NotificationLevel level;
+    std::string title;
+    std::string body;
+  };
+
+  class NotificationCore: public Service
+  {
+  public:
+
+    /* First the boilerplate methods */
+
+    NotificationCore () {}
+
+    ~NotificationCore () {}
+
+    const std::string get_name () const
+    { return "notification-core"; }
+
+    const std::string get_description () const
+    { return "\tCentral notification object"; }
+
+    /*** Public API ***/
+
+    void push_notification (gmref_ptr<Notification> notification)
+    { notification_added.emit (notification); }
+
+    sigc::signal1<void, gmref_ptr<Notification> > notification_added;
+  };
+};
+
+#endif



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