libnotifymm r8 - in trunk: . libnotify/src
- From: daniel svn gnome org
- To: svn-commits-list gnome org
- Subject: libnotifymm r8 - in trunk: . libnotify/src
- Date: Wed, 18 Mar 2009 17:34:05 +0000 (UTC)
Author: daniel
Date: Wed Mar 18 17:34:05 2009
New Revision: 8
URL: http://svn.gnome.org/viewvc/libnotifymm?rev=8&view=rev
Log:
Do a bit of spring cleaning
Modified:
trunk/ChangeLog
trunk/libnotify/src/notification.ccg
trunk/libnotify/src/notification.hg
Modified: trunk/libnotify/src/notification.ccg
==============================================================================
--- trunk/libnotify/src/notification.ccg (original)
+++ trunk/libnotify/src/notification.ccg Wed Mar 18 17:34:05 2009
@@ -1,81 +1,79 @@
-// -*- C++ -*- //
-
-/* notification.ccg
- *
- * Copyright 2006 libnotifymm Development Team
+/*
+ * Copyright (c) 2003-2009 The libnotifymm Development Team
*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
*
- * This library 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
- * Library General Public License for more details.
+ * This library 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 Lesser General Public
+ * License for more details.
*
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-
+
#include <libnotify/notification.h>
#include <libnotify/notify-enum-types.h>
-namespace Notify
-{
-
-const int EXPIRES_DEFAULT = NOTIFY_EXPIRES_DEFAULT;
-const int EXPIRES_NEVER = NOTIFY_EXPIRES_NEVER;
-
-Notification::Notification(const Glib::ustring& summary, const Glib::ustring& body) :
- _CONSTRUCT("summary", summary.c_str(), "body", body.c_str(), "icon-name", NULL,
- "attach-widget", NULL)
-{
-
-}
-
-Notification::Notification(const Glib::ustring& summary, const Glib::ustring& body,
- const Glib::ustring& icon_name) :
- _CONSTRUCT("summary", summary.c_str(), "body", body.c_str(), "icon-name", icon_name.c_str(),
- "attach-widget", NULL)
-{
-
-}
-
-void Notification::set_hint(const Glib::ustring& key, const Glib::ArrayHandle<guchar>& values)
+namespace
{
- notify_notification_set_hint_byte_array (gobj(), key.c_str(), values.data(), values.size());
-}
-//We use a function instead of a static method, so we can make it static, so it is not exported.
+// We use a function instead of a static method, so we can make it static, so it is not exported.
static void SignalProxy_ActivateLink_gtk_callback(NotifyNotification* notify, gchar* action, gpointer data)
{
- Notify::Notification::SlotInvokeAction* the_slot = static_cast<Notify::Notification::SlotInvokeAction*>(data);
+ Notify::Notification::SlotInvokeAction*
+ the_slot = static_cast<Notify::Notification::SlotInvokeAction*>(data);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
try
+#endif
{
- #endif //GLIBMM_EXCEPTIONS_ENABLED
- (*the_slot)(Glib::convert_const_gchar_ptr_to_ustring(action) );
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ (*the_slot)(Glib::convert_const_gchar_ptr_to_ustring(action));
}
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
catch(...)
{
Glib::exception_handlers_invoke();
}
- #endif //GLIBMM_EXCEPTIONS_ENABLED
+#endif
}
static void SignalProxy_ActivateLink_gtk_callback_destroy(void* data)
{
- Notify::Notification::SlotInvokeAction* the_slot = static_cast<Notify::Notification::SlotInvokeAction*>(data);
- delete the_slot;
+ delete static_cast<Notify::Notification::SlotInvokeAction*>(data);
+}
+
+} // anonymous namespace
+
+namespace Notify
+{
+
+const int EXPIRES_DEFAULT = NOTIFY_EXPIRES_DEFAULT;
+const int EXPIRES_NEVER = NOTIFY_EXPIRES_NEVER;
+
+Notification::Notification(const Glib::ustring& summary, const Glib::ustring& body)
+:
+ _CONSTRUCT("summary", summary.c_str(), "body", body.c_str())
+{}
+
+Notification::Notification(const Glib::ustring& summary, const Glib::ustring& body,
+ const Glib::ustring& icon_name)
+:
+ _CONSTRUCT("summary", summary.c_str(), "body", body.c_str(), "icon-name", icon_name.c_str())
+{}
+
+void Notification::set_hint(const Glib::ustring& key, const Glib::ArrayHandle<guchar>& values)
+{
+ notify_notification_set_hint_byte_array(gobj(), key.c_str(), values.data(), values.size());
}
-void Notification::add_action(const Glib::ustring& action, const Glib::ustring& label, const SlotInvokeAction& slot)
+void Notification::add_action(const Glib::ustring& action, const Glib::ustring& label,
+ const SlotInvokeAction& slot)
{
- // Create a copy of the slot object. A pointer to this will be passed
+ // Create a copy of the slot object. A pointer to this will be passed
// through the callback's data parameter. It will be deleted
// when SignalProxy_SlotForwardPage_gtk_callback_destroy() is called.
SlotInvokeAction* slot_copy = new SlotInvokeAction(slot);
@@ -86,4 +84,3 @@
}
} // namespace Notify
-
Modified: trunk/libnotify/src/notification.hg
==============================================================================
--- trunk/libnotify/src/notification.hg (original)
+++ trunk/libnotify/src/notification.hg Wed Mar 18 17:34:05 2009
@@ -102,7 +102,7 @@
_WRAP_METHOD(void set_hint(const Glib::ustring& key, double value), notify_notification_set_hint_double)
_WRAP_METHOD(void set_hint(const Glib::ustring& key, const Glib::ustring& value), notify_notification_set_hint_string)
_WRAP_METHOD(void set_hint(const Glib::ustring& key, guchar value), notify_notification_set_hint_byte)
-
+
/** Set byte array hint
*
* @param key The hint.
@@ -112,13 +112,13 @@
*/
void set_hint(const Glib::ustring& key, const Glib::ArrayHandle<guchar>& values);
_IGNORE(notify_notification_set_hint_byte_array)
-
- /** For instance,
- * void on_invoke(const Glib::ustring& action);
- */
- typedef sigc::slot<void, const Glib::ustring& /* action */> SlotInvokeAction;
-
- /** Add an action to the notification
+
+ /** For instance,
+ * void on_invoke(const Glib::ustring& action);
+ */
+ typedef sigc::slot<void, const Glib::ustring& /* action */> SlotInvokeAction;
+
+ /** Add an action to the notification
*
* @param action The action id
* @param label The action label
@@ -127,16 +127,16 @@
* Adds an action to a notification. When the action is invoked, the
* specified callback function will be called.
*/
- void add_action(const Glib::ustring& action, const Glib::ustring& label, const SlotInvokeAction& slot);
- _IGNORE(notify_notification_add_action);
-
- _WRAP_METHOD(void clear_hints(), notify_notification_clear_hints);
-
- _WRAP_METHOD(void clear_actions(), notify_notification_clear_actions);
- _WRAP_METHOD(void close(), notify_notification_close, errthrow);
-
- _WRAP_SIGNAL(void closed(), "closed");
-
+ void add_action(const Glib::ustring& action, const Glib::ustring& label, const SlotInvokeAction& slot);
+ _IGNORE(notify_notification_add_action)
+
+ _WRAP_METHOD(void clear_hints(), notify_notification_clear_hints)
+
+ _WRAP_METHOD(void clear_actions(), notify_notification_clear_actions)
+ _WRAP_METHOD(void close(), notify_notification_close, errthrow)
+
+ _WRAP_SIGNAL(void closed(), "closed")
+
_WRAP_PROPERTY("id", int)
_WRAP_PROPERTY("summary", Glib::ustring)
_WRAP_PROPERTY("body", Glib::ustring)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]