[Galago-commits] r2998 - in trunk/notify-sharp: . docs docs/en docs/en/Notifications src

galago-commits at freedesktop.org galago-commits at freedesktop.org
Thu Nov 1 21:59:32 PDT 2007


Author: slomo
Date: 2007-11-01 21:59:30 -0700 (Thu, 01 Nov 2007)
New Revision: 2998

Added:
   trunk/notify-sharp/AUTHORS
   trunk/notify-sharp/COPYING
   trunk/notify-sharp/ChangeLog
   trunk/notify-sharp/Makefile.am
   trunk/notify-sharp/NEWS
   trunk/notify-sharp/README
   trunk/notify-sharp/autogen.sh
   trunk/notify-sharp/configure.ac
   trunk/notify-sharp/docs/
   trunk/notify-sharp/docs/Makefile.am
   trunk/notify-sharp/docs/en/
   trunk/notify-sharp/docs/en/Notifications.xml
   trunk/notify-sharp/docs/en/Notifications/
   trunk/notify-sharp/docs/en/Notifications/ActionArgs.xml
   trunk/notify-sharp/docs/en/Notifications/ActionHandler.xml
   trunk/notify-sharp/docs/en/Notifications/Global.xml
   trunk/notify-sharp/docs/en/Notifications/Notification.xml
   trunk/notify-sharp/docs/en/Notifications/ServerInformation.xml
   trunk/notify-sharp/docs/en/Notifications/Urgency.xml
   trunk/notify-sharp/docs/en/index.xml
   trunk/notify-sharp/docs/notify-sharp-docs.source
   trunk/notify-sharp/notify-sharp.pc.in
   trunk/notify-sharp/src/
   trunk/notify-sharp/src/AssemblyInfo.cs.in
   trunk/notify-sharp/src/Global.cs
   trunk/notify-sharp/src/Makefile.am
   trunk/notify-sharp/src/Notification.cs
   trunk/notify-sharp/src/notify-sharp.dll.config
   trunk/notify-sharp/src/notify-sharp.snk
Log:
Add managed notify-sharp implementation


Added: trunk/notify-sharp/AUTHORS
===================================================================
--- trunk/notify-sharp/AUTHORS	                        (rev 0)
+++ trunk/notify-sharp/AUTHORS	2007-11-02 04:59:30 UTC (rev 2998)
@@ -0,0 +1 @@
+Sebastian Dröge <slomo at circular-chaos.org>

Added: trunk/notify-sharp/COPYING
===================================================================
--- trunk/notify-sharp/COPYING	                        (rev 0)
+++ trunk/notify-sharp/COPYING	2007-11-02 04:59:30 UTC (rev 2998)
@@ -0,0 +1,20 @@
+Copyright (c) 2006-2007 Sebastian Dröge <slomo at circular-chaos.org>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+

Added: trunk/notify-sharp/ChangeLog
===================================================================
--- trunk/notify-sharp/ChangeLog	                        (rev 0)
+++ trunk/notify-sharp/ChangeLog	2007-11-02 04:59:30 UTC (rev 2998)
@@ -0,0 +1,3 @@
+2007-02-06  Sebastian Dröge  <slomo at circular-chaos.org>
+	* First public release 0.4.0.0
+

Added: trunk/notify-sharp/Makefile.am
===================================================================
--- trunk/notify-sharp/Makefile.am	                        (rev 0)
+++ trunk/notify-sharp/Makefile.am	2007-11-02 04:59:30 UTC (rev 2998)
@@ -0,0 +1,21 @@
+SUBDIRS = src docs
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = notify-sharp.pc
+
+EXTRA_DIST = \
+	notify-sharp.pc.in
+
+DISTCLEANFILES = \
+	notify-sharp.pc
+
+MAINTAINERCLEANFILES = \
+	INSTALL \
+	Makefile.in \
+	aclocal.m4 \
+	config.guess \
+	config.sub \
+	configure \
+	install-sh \
+	missing
+

Added: trunk/notify-sharp/NEWS
===================================================================
--- trunk/notify-sharp/NEWS	                        (rev 0)
+++ trunk/notify-sharp/NEWS	2007-11-02 04:59:30 UTC (rev 2998)
@@ -0,0 +1,5 @@
+=== 0.4.0.0 ===
+	This is the first public, installable release. Currently the complete
+	Desktop Notifications specification version 0.9[1] is implemented.
+	http://trac.galago-project.org/wiki/DesktopNotifications
+

Added: trunk/notify-sharp/README
===================================================================
--- trunk/notify-sharp/README	                        (rev 0)
+++ trunk/notify-sharp/README	2007-11-02 04:59:30 UTC (rev 2998)
@@ -0,0 +1,11 @@
+notify-sharp is a C# client implementation for Desktop Notifications,
+i.e. notification-daemon. It is inspired by the libnotify API.
+
+Desktop Notifications provide a standard way of doing passive pop-up
+notifications on the Linux desktop. These are designed to notify the
+user of something without interrupting their work with a dialog box
+that they must close. Passive popups can automatically disappear after
+a short period of time.
+
+http://trac.galago-project.org/wiki/DesktopNotifications
+

Added: trunk/notify-sharp/autogen.sh
===================================================================
--- trunk/notify-sharp/autogen.sh	                        (rev 0)
+++ trunk/notify-sharp/autogen.sh	2007-11-02 04:59:30 UTC (rev 2998)
@@ -0,0 +1,24 @@
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+PKG_NAME="notify-sharp"
+REQUIRED_AUTOMAKE_VERSION=1.9
+
+(test -f $srcdir/configure.ac \
+  && test -d $srcdir/src) || {
+    echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
+    echo " top-level notify-sharp directory"
+    exit 1
+}
+
+
+which gnome-autogen.sh || {
+    echo "You need to install gnome-common from the GNOME CVS"
+    exit 1
+}
+
+USE_GNOME2_MACROS=1 . gnome-autogen.sh
+


Property changes on: trunk/notify-sharp/autogen.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/notify-sharp/configure.ac
===================================================================
--- trunk/notify-sharp/configure.ac	                        (rev 0)
+++ trunk/notify-sharp/configure.ac	2007-11-02 04:59:30 UTC (rev 2998)
@@ -0,0 +1,94 @@
+AC_INIT(src/Global.cs)
+
+AC_CANONICAL_SYSTEM
+AC_PREREQ(2.13)
+
+API_VERSION=0.4
+VERSION=$API_VERSION.0
+
+AC_SUBST(API_VERSION)
+AC_SUBST(VERSION)
+
+AM_INIT_AUTOMAKE(notify-sharp, $VERSION)
+
+AM_MAINTAINER_MODE
+
+AC_PROG_INSTALL
+
+AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+if test "x$PKG_CONFIG" = "xno"; then
+	AC_MSG_ERROR([You need to install pkg-config])
+fi
+AC_SUBST(PKG_CONFIG)
+
+MONO_REQ_VERSION=1.1.13
+PKG_CHECK_MODULES(MONO, mono >= $MONO_REQ_VERSION)
+
+AC_PATH_PROG(GMCS, gmcs, no)
+if test "x$GMCS" = "xno"; then
+	AC_MSG_ERROR([You need to install gmcs])
+fi
+AC_SUBST(GMCS)
+
+AC_PATH_PROG(GACUTIL, gacutil, no)
+if test "x$GACUTIL" = "xno"; then
+	AC_MSG_ERROR([You need to install gacutil])
+fi
+AC_SUBST(GACUTIL)
+
+AC_ARG_ENABLE(docs, AC_HELP_STRING([--disable-docs], 
+	[Do not build documentation]), with_docs=no, with_docs=yes)
+
+MONODOC_REQ_VERSION=1.1.18
+
+if test "x$with_docs" = "xyes"; then
+	PKG_CHECK_MODULES(MONODOC, monodoc >= $MONODOC_REQ_VERSION,,
+		[AC_MSG_ERROR([You need to install monodoc, or pass --disable-docs to configure to skip documentation installation])])
+	AC_PATH_PROG(MONODOCER, monodocer, no)
+	if test "x$MONODOCER" = "xno"; then
+		AC_MSG_ERROR([You need to install monodoc, or pass --disable-docs to configure to skip documentation installation])
+	fi
+	
+	AC_PATH_PROG(MDASSEMBLER, mdassembler, no)
+	if test "x$MDASSEMBLER" = "xno"; then
+		AC_MSG_ERROR([You need to install mdassembler, or pass --disable-docs to configure to skip documentation installation])
+	fi
+	
+	DOCDIR=`$PKG_CONFIG monodoc --variable=sourcesdir`
+	AC_SUBST(DOCDIR)
+	AM_CONDITIONAL(BUILD_DOCS, true)
+else
+	AC_MSG_NOTICE([not building notify-sharp API documentation])
+	AM_CONDITIONAL(BUILD_DOCS, false)
+fi
+
+GTK_SHARP_REQ_VERSION=2.6
+PKG_CHECK_MODULES(GTK_SHARP, gtk-sharp-2.0 >= $GTK_SHARP_REQ_VERSION)
+AC_SUBST(GTK_SHARP_LIBS)
+
+NDESK_DBUS_REQ_VERSION=0.4
+NDESK_DBUS_GLIB_REQ_VERSION=0.3
+PKG_CHECK_MODULES(NDESK_DBUS, ndesk-dbus-1.0 >= $NDESK_DBUS_REQ_VERSION \
+                              ndesk-dbus-glib-1.0 >= $NDESK_DBUS_GLIB_REQ_VERSION)
+AC_SUBST(NDESK_DBUS_LIBS)
+
+required_assemblies="Mono.Posix"
+
+for asm in $required_assemblies; do
+	AC_MSG_CHECKING([for $asm.dll])
+	if test -n "`$GACUTIL /l $asm.dll | grep ^$asm.dll`"; then
+		AC_MSG_RESULT([not found])
+		AC_MSG_ERROR([missing required assembly in the GAC: $asm.dll])
+	else
+		AC_MSG_RESULT([found])
+	fi
+done
+
+AC_OUTPUT([
+Makefile
+notify-sharp.pc
+src/Makefile
+src/AssemblyInfo.cs
+docs/Makefile
+])
+

Added: trunk/notify-sharp/docs/Makefile.am
===================================================================
--- trunk/notify-sharp/docs/Makefile.am	                        (rev 0)
+++ trunk/notify-sharp/docs/Makefile.am	2007-11-02 04:59:30 UTC (rev 2998)
@@ -0,0 +1,38 @@
+DOC_UPDATER = @MONODOCER@ -delete
+DOC_ASSEMBLER = @MDASSEMBLER@ --out notify-sharp-docs --ecma
+
+ASSEMBLIES = \
+	$(top_builddir)/src/notify-sharp.dll
+
+ASSEMBLIES_BUILD = $(foreach asm,$(ASSEMBLIES),$(addprefix -assembly:,$(asm)))
+
+if BUILD_DOCS
+
+monodocdir = $(DOCDIR)
+monodoc_DATA = \
+	notify-sharp-docs.zip \
+	notify-sharp-docs.tree \
+	$(srcdir)/notify-sharp-docs.source
+
+all:
+
+update-docs: $(ASSEMBLIES)
+	$(DOC_UPDATER) $(ASSEMBLIES_BUILD) -path:en
+
+notify-sharp-docs.zip notify-sharp-docs.tree: $(srcdir)/en/*/*.xml $(srcdir)/en/*.xml
+	$(DOC_ASSEMBLER) $(srcdir)/en
+
+endif
+
+EXTRA_DIST = \
+	$(srcdir)/en/*.xml \
+	$(srcdir)/en/*/*.xml \
+	$(srcdir)/notify-sharp-docs.source
+
+DISTCLEANFILES = \
+	notify-sharp-docs.zip \
+	notify-sharp-docs.tree
+
+MAINTAINERCLEANFILES = \
+	Makefile.in
+

Added: trunk/notify-sharp/docs/en/Notifications/ActionArgs.xml
===================================================================
--- trunk/notify-sharp/docs/en/Notifications/ActionArgs.xml	                        (rev 0)
+++ trunk/notify-sharp/docs/en/Notifications/ActionArgs.xml	2007-11-02 04:59:30 UTC (rev 2998)
@@ -0,0 +1,41 @@
+<Type Name="ActionArgs" FullName="Notifications.ActionArgs">
+  <TypeSignature Language="C#" Value="public class ActionArgs : System.EventArgs" />
+  <AssemblyInfo>
+    <AssemblyName>notify-sharp</AssemblyName>
+    <AssemblyVersion>0.4.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>System.EventArgs</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Members>
+    <Member MemberName=".ctor">
+      <MemberSignature Language="C#" Value="public ActionArgs (string action);" />
+      <MemberType>Constructor</MemberType>
+      <Parameters>
+        <Parameter Name="action" Type="System.String" />
+      </Parameters>
+      <Docs>
+        <param name="action">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Action">
+      <MemberSignature Language="C#" Value="public string Action { get; };" />
+      <MemberType>Property</MemberType>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+  <Docs>
+    <summary>To be added.</summary>
+    <remarks>To be added.</remarks>
+  </Docs>
+</Type>

Added: trunk/notify-sharp/docs/en/Notifications/ActionHandler.xml
===================================================================
--- trunk/notify-sharp/docs/en/Notifications/ActionHandler.xml	                        (rev 0)
+++ trunk/notify-sharp/docs/en/Notifications/ActionHandler.xml	2007-11-02 04:59:30 UTC (rev 2998)
@@ -0,0 +1,23 @@
+<Type Name="ActionHandler" FullName="Notifications.ActionHandler">
+  <TypeSignature Language="C#" Value="public delegate void ActionHandler(object o, ActionArgs args);" />
+  <AssemblyInfo>
+    <AssemblyName>notify-sharp</AssemblyName>
+    <AssemblyVersion>0.4.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>System.Delegate</BaseTypeName>
+  </Base>
+  <Parameters>
+    <Parameter Name="o" Type="System.Object" />
+    <Parameter Name="args" Type="Notifications.ActionArgs" />
+  </Parameters>
+  <ReturnValue>
+    <ReturnType>System.Void</ReturnType>
+  </ReturnValue>
+  <Docs>
+    <param name="o">To be added.</param>
+    <param name="args">To be added.</param>
+    <summary>To be added.</summary>
+    <remarks>To be added.</remarks>
+  </Docs>
+</Type>

Added: trunk/notify-sharp/docs/en/Notifications/Global.xml
===================================================================
--- trunk/notify-sharp/docs/en/Notifications/Global.xml	                        (rev 0)
+++ trunk/notify-sharp/docs/en/Notifications/Global.xml	2007-11-02 04:59:30 UTC (rev 2998)
@@ -0,0 +1,41 @@
+<Type Name="Global" FullName="Notifications.Global">
+  <TypeSignature Language="C#" Value="public abstract sealed class Global" />
+  <AssemblyInfo>
+    <AssemblyName>notify-sharp</AssemblyName>
+    <AssemblyVersion>0.4.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>System.Object</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Members>
+    <Member MemberName="Capabilities">
+      <MemberSignature Language="C#" Value="public static string[] Capabilities { get; };" />
+      <MemberType>Property</MemberType>
+      <ReturnValue>
+        <ReturnType>System.String[]</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="ServerInformation">
+      <MemberSignature Language="C#" Value="public static Notifications.ServerInformation ServerInformation { get; };" />
+      <MemberType>Property</MemberType>
+      <ReturnValue>
+        <ReturnType>Notifications.ServerInformation</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+  <Docs>
+    <summary>To be added.</summary>
+    <remarks>To be added.</remarks>
+  </Docs>
+</Type>

Added: trunk/notify-sharp/docs/en/Notifications/Notification.xml
===================================================================
--- trunk/notify-sharp/docs/en/Notifications/Notification.xml	                        (rev 0)
+++ trunk/notify-sharp/docs/en/Notifications/Notification.xml	2007-11-02 04:59:30 UTC (rev 2998)
@@ -0,0 +1,339 @@
+<Type Name="Notification" FullName="Notifications.Notification">
+  <TypeSignature Language="C#" Value="public class Notification" />
+  <AssemblyInfo>
+    <AssemblyName>notify-sharp</AssemblyName>
+    <AssemblyVersion>0.4.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>System.Object</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Members>
+    <Member MemberName=".ctor">
+      <MemberSignature Language="C#" Value="public Notification ();" />
+      <MemberType>Constructor</MemberType>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName=".ctor">
+      <MemberSignature Language="C#" Value="public Notification (string summary, string body);" />
+      <MemberType>Constructor</MemberType>
+      <Parameters>
+        <Parameter Name="summary" Type="System.String" />
+        <Parameter Name="body" Type="System.String" />
+      </Parameters>
+      <Docs>
+        <param name="summary">To be added.</param>
+        <param name="body">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName=".ctor">
+      <MemberSignature Language="C#" Value="public Notification (string summary, string body, Gdk.Pixbuf icon);" />
+      <MemberType>Constructor</MemberType>
+      <Parameters>
+        <Parameter Name="summary" Type="System.String" />
+        <Parameter Name="body" Type="System.String" />
+        <Parameter Name="icon" Type="Gdk.Pixbuf" />
+      </Parameters>
+      <Docs>
+        <param name="summary">To be added.</param>
+        <param name="body">To be added.</param>
+        <param name="icon">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName=".ctor">
+      <MemberSignature Language="C#" Value="public Notification (string summary, string body, Gdk.Pixbuf icon, Gtk.Widget widget);" />
+      <MemberType>Constructor</MemberType>
+      <Parameters>
+        <Parameter Name="summary" Type="System.String" />
+        <Parameter Name="body" Type="System.String" />
+        <Parameter Name="icon" Type="Gdk.Pixbuf" />
+        <Parameter Name="widget" Type="Gtk.Widget" />
+      </Parameters>
+      <Docs>
+        <param name="summary">To be added.</param>
+        <param name="body">To be added.</param>
+        <param name="icon">To be added.</param>
+        <param name="widget">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName=".ctor">
+      <MemberSignature Language="C#" Value="public Notification (string summary, string body, string icon);" />
+      <MemberType>Constructor</MemberType>
+      <Parameters>
+        <Parameter Name="summary" Type="System.String" />
+        <Parameter Name="body" Type="System.String" />
+        <Parameter Name="icon" Type="System.String" />
+      </Parameters>
+      <Docs>
+        <param name="summary">To be added.</param>
+        <param name="body">To be added.</param>
+        <param name="icon">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName=".ctor">
+      <MemberSignature Language="C#" Value="public Notification (string summary, string body, string icon, Gtk.Widget widget);" />
+      <MemberType>Constructor</MemberType>
+      <Parameters>
+        <Parameter Name="summary" Type="System.String" />
+        <Parameter Name="body" Type="System.String" />
+        <Parameter Name="icon" Type="System.String" />
+        <Parameter Name="widget" Type="Gtk.Widget" />
+      </Parameters>
+      <Docs>
+        <param name="summary">To be added.</param>
+        <param name="body">To be added.</param>
+        <param name="icon">To be added.</param>
+        <param name="widget">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="AddAction">
+      <MemberSignature Language="C#" Value="public void AddAction (string action, string label, Notifications.ActionHandler handler);" />
+      <MemberType>Method</MemberType>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="action" Type="System.String" />
+        <Parameter Name="label" Type="System.String" />
+        <Parameter Name="handler" Type="Notifications.ActionHandler" />
+      </Parameters>
+      <Docs>
+        <param name="action">To be added.</param>
+        <param name="label">To be added.</param>
+        <param name="handler">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="AddHint">
+      <MemberSignature Language="C#" Value="public void AddHint (string name, object value);" />
+      <MemberType>Method</MemberType>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="name" Type="System.String" />
+        <Parameter Name="value" Type="System.Object" />
+      </Parameters>
+      <Docs>
+        <param name="name">To be added.</param>
+        <param name="value">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="AttachToWidget">
+      <MemberSignature Language="C#" Value="public void AttachToWidget (Gtk.Widget widget);" />
+      <MemberType>Method</MemberType>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="widget" Type="Gtk.Widget" />
+      </Parameters>
+      <Docs>
+        <param name="widget">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Body">
+      <MemberSignature Language="C#" Value="public string Body { set; get; };" />
+      <MemberType>Property</MemberType>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Category">
+      <MemberSignature Language="C#" Value="public string Category { set; get; };" />
+      <MemberType>Property</MemberType>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="ClearActions">
+      <MemberSignature Language="C#" Value="public void ClearActions ();" />
+      <MemberType>Method</MemberType>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Close">
+      <MemberSignature Language="C#" Value="public void Close ();" />
+      <MemberType>Method</MemberType>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Closed">
+      <MemberSignature Language="C#" Value="public event System.EventHandler Closed;" />
+      <MemberType>Event</MemberType>
+      <ReturnValue>
+        <ReturnType>System.EventHandler</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Icon">
+      <MemberSignature Language="C#" Value="public Gdk.Pixbuf Icon { set; };" />
+      <MemberType>Property</MemberType>
+      <ReturnValue>
+        <ReturnType>Gdk.Pixbuf</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IconName">
+      <MemberSignature Language="C#" Value="public string IconName { set; };" />
+      <MemberType>Property</MemberType>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="RemoveAction">
+      <MemberSignature Language="C#" Value="public void RemoveAction (string action);" />
+      <MemberType>Method</MemberType>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="action" Type="System.String" />
+      </Parameters>
+      <Docs>
+        <param name="action">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="RemoveHint">
+      <MemberSignature Language="C#" Value="public void RemoveHint (string name);" />
+      <MemberType>Method</MemberType>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="name" Type="System.String" />
+      </Parameters>
+      <Docs>
+        <param name="name">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="SetGeometryHints">
+      <MemberSignature Language="C#" Value="public void SetGeometryHints (Gdk.Screen screen, int x, int y);" />
+      <MemberType>Method</MemberType>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="screen" Type="Gdk.Screen" />
+        <Parameter Name="x" Type="System.Int32" />
+        <Parameter Name="y" Type="System.Int32" />
+      </Parameters>
+      <Docs>
+        <param name="screen">To be added.</param>
+        <param name="x">To be added.</param>
+        <param name="y">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Show">
+      <MemberSignature Language="C#" Value="public void Show ();" />
+      <MemberType>Method</MemberType>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Summary">
+      <MemberSignature Language="C#" Value="public string Summary { set; get; };" />
+      <MemberType>Property</MemberType>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Timeout">
+      <MemberSignature Language="C#" Value="public int Timeout { set; get; };" />
+      <MemberType>Property</MemberType>
+      <ReturnValue>
+        <ReturnType>System.Int32</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Urgency">
+      <MemberSignature Language="C#" Value="public Notifications.Urgency Urgency { set; get; };" />
+      <MemberType>Property</MemberType>
+      <ReturnValue>
+        <ReturnType>Notifications.Urgency</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+  <Docs>
+    <summary>To be added.</summary>
+    <remarks>To be added.</remarks>
+  </Docs>
+</Type>

Added: trunk/notify-sharp/docs/en/Notifications/ServerInformation.xml
===================================================================
--- trunk/notify-sharp/docs/en/Notifications/ServerInformation.xml	                        (rev 0)
+++ trunk/notify-sharp/docs/en/Notifications/ServerInformation.xml	2007-11-02 04:59:30 UTC (rev 2998)
@@ -0,0 +1,61 @@
+<Type Name="ServerInformation" FullName="Notifications.ServerInformation">
+  <TypeSignature Language="C#" Value="public struct ServerInformation" />
+  <AssemblyInfo>
+    <AssemblyName>notify-sharp</AssemblyName>
+    <AssemblyVersion>0.4.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>System.ValueType</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Members>
+    <Member MemberName="Name">
+      <MemberSignature Language="C#" Value="public string Name;" />
+      <MemberType>Field</MemberType>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="SpecVersion">
+      <MemberSignature Language="C#" Value="public string SpecVersion;" />
+      <MemberType>Field</MemberType>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Vendor">
+      <MemberSignature Language="C#" Value="public string Vendor;" />
+      <MemberType>Field</MemberType>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Version">
+      <MemberSignature Language="C#" Value="public string Version;" />
+      <MemberType>Field</MemberType>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+  <Docs>
+    <summary>To be added.</summary>
+    <remarks>To be added.</remarks>
+  </Docs>
+</Type>

Added: trunk/notify-sharp/docs/en/Notifications/Urgency.xml
===================================================================
--- trunk/notify-sharp/docs/en/Notifications/Urgency.xml	                        (rev 0)
+++ trunk/notify-sharp/docs/en/Notifications/Urgency.xml	2007-11-02 04:59:30 UTC (rev 2998)
@@ -0,0 +1,46 @@
+<Type Name="Urgency" FullName="Notifications.Urgency">
+  <TypeSignature Language="C#" Value="public enum Urgency" />
+  <AssemblyInfo>
+    <AssemblyName>notify-sharp</AssemblyName>
+    <AssemblyVersion>0.4.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>System.Enum</BaseTypeName>
+  </Base>
+  <Members>
+    <Member MemberName="Critical">
+      <MemberSignature Language="C#" Value="Critical" />
+      <MemberType>Field</MemberType>
+      <ReturnValue>
+        <ReturnType>Notifications.Urgency</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+    <Member MemberName="Low">
+      <MemberSignature Language="C#" Value="Low" />
+      <MemberType>Field</MemberType>
+      <ReturnValue>
+        <ReturnType>Notifications.Urgency</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+    <Member MemberName="Normal">
+      <MemberSignature Language="C#" Value="Normal" />
+      <MemberType>Field</MemberType>
+      <ReturnValue>
+        <ReturnType>Notifications.Urgency</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+  </Members>
+  <Docs>
+    <summary>To be added.</summary>
+    <remarks>To be added.</remarks>
+  </Docs>
+</Type>

Added: trunk/notify-sharp/docs/en/Notifications.xml
===================================================================
--- trunk/notify-sharp/docs/en/Notifications.xml	                        (rev 0)
+++ trunk/notify-sharp/docs/en/Notifications.xml	2007-11-02 04:59:30 UTC (rev 2998)
@@ -0,0 +1,6 @@
+<Namespace Name="Notifications">
+  <Docs>
+    <summary>To be added.</summary>
+    <remarks>To be added.</remarks>
+  </Docs>
+</Namespace>

Added: trunk/notify-sharp/docs/en/index.xml
===================================================================
--- trunk/notify-sharp/docs/en/index.xml	                        (rev 0)
+++ trunk/notify-sharp/docs/en/index.xml	2007-11-02 04:59:30 UTC (rev 2998)
@@ -0,0 +1,33 @@
+<Overview>
+  <Assemblies>
+    <Assembly Name="notify-sharp" Version="0.4.0.0">
+      <Attributes>
+        <Attribute>
+          <AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
+        </Attribute>
+        <Attribute>
+          <AttributeName>System.Reflection.AssemblyCopyright("Copyright (c) 2006-2007 Sebastian Dröge")</AttributeName>
+        </Attribute>
+        <Attribute>
+          <AttributeName>System.Reflection.AssemblyDescription("C# client library for notification-daemon")</AttributeName>
+        </Attribute>
+        <Attribute>
+          <AttributeName>System.Reflection.AssemblyTitle("notify-sharp")</AttributeName>
+        </Attribute>
+      </Attributes>
+    </Assembly>
+  </Assemblies>
+  <Remarks>To be added.</Remarks>
+  <Copyright>To be added.</Copyright>
+  <Types>
+    <Namespace Name="Notifications">
+      <Type Name="ServerInformation" />
+      <Type Name="Global" />
+      <Type Name="ActionArgs" />
+      <Type Name="Notification" />
+      <Type Name="ActionHandler" />
+      <Type Name="Urgency" />
+    </Namespace>
+  </Types>
+  <Title>notify-sharp</Title>
+</Overview>

Added: trunk/notify-sharp/docs/notify-sharp-docs.source
===================================================================
--- trunk/notify-sharp/docs/notify-sharp-docs.source	                        (rev 0)
+++ trunk/notify-sharp/docs/notify-sharp-docs.source	2007-11-02 04:59:30 UTC (rev 2998)
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<monodoc>
+  <source provider="ecma" basefile="notify-sharp-docs" path="various" title="Notifications" />
+</monodoc>
+

Added: trunk/notify-sharp/notify-sharp.pc.in
===================================================================
--- trunk/notify-sharp/notify-sharp.pc.in	                        (rev 0)
+++ trunk/notify-sharp/notify-sharp.pc.in	2007-11-02 04:59:30 UTC (rev 2998)
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+pkglibdir=${libdir}/mono/notify-sharp
+
+Name: notify-sharp
+Description: C# client library for notification-daemon
+Version: @VERSION@
+Requires: gtk-sharp-2.0
+Libs: -r:${pkglibdir}/notify-sharp.dll
+

Added: trunk/notify-sharp/src/AssemblyInfo.cs.in
===================================================================
--- trunk/notify-sharp/src/AssemblyInfo.cs.in	                        (rev 0)
+++ trunk/notify-sharp/src/AssemblyInfo.cs.in	2007-11-02 04:59:30 UTC (rev 2998)
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2006-2007 Sebastian Dröge <slomo at circular-chaos.org>
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+[assembly: AssemblyVersion("@API_VERSION at .0.0")]
+[assembly: AssemblyTitle ("notify-sharp")]
+[assembly: AssemblyDescription ("C# client library for notification-daemon")]
+[assembly: AssemblyCopyright ("Copyright (c) 2006-2007 Sebastian Dr\u00f6ge")]
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile("@srcdir@/notify-sharp.snk")]

Added: trunk/notify-sharp/src/Global.cs
===================================================================
--- trunk/notify-sharp/src/Global.cs	                        (rev 0)
+++ trunk/notify-sharp/src/Global.cs	2007-11-02 04:59:30 UTC (rev 2998)
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2006-2007 Sebastian Dröge <slomo at circular-chaos.org>
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Reflection;
+using System.Collections.Generic;
+
+using NDesk.DBus;
+using org.freedesktop;
+using org.freedesktop.DBus;
+
+namespace Notifications {
+	[Interface ("org.freedesktop.Notifications")]
+	internal interface INotifications : Introspectable, Properties {
+		ServerInformation ServerInformation { get; }
+		string[] Capabilities { get; }
+		void CloseNotification (uint id);
+		uint Notify (string app_name, uint id, string icon, string summary, string body,
+			string[] actions, IDictionary<string, object> hints, int timeout);
+		event NotificationClosedHandler NotificationClosed;
+		event ActionInvokedHandler ActionInvoked;
+	}
+
+	internal delegate void NotificationClosedHandler (uint id);
+	internal delegate void ActionInvokedHandler (uint id, string action);
+
+	public struct ServerInformation {
+		public string Name;
+		public string Vendor;
+		public string Version;
+		public string SpecVersion;
+	}
+
+	public static class Global {
+		private const string interface_name = "org.freedesktop.Notifications";
+		private const string object_path = "/org/freedesktop/Notifications";
+
+		private static INotifications dbus_object = null;
+		private static object dbus_object_lock = new object ();
+
+		internal static INotifications DBusObject {
+			get {
+				if (dbus_object != null)
+					return dbus_object;
+
+				lock (dbus_object_lock) {
+					if (! Bus.Session.NameHasOwner (interface_name))
+						Bus.Session.StartServiceByName (interface_name);
+
+					dbus_object = Bus.Session.GetObject<INotifications>
+						(interface_name, new ObjectPath (object_path));
+					return dbus_object;
+				}
+			}
+		}
+
+		public static string[] Capabilities {
+			get {
+				return DBusObject.Capabilities;
+			}
+		}
+		
+		public static ServerInformation ServerInformation {
+			get {
+				return DBusObject.ServerInformation;
+			}
+		}
+	}
+}

Added: trunk/notify-sharp/src/Makefile.am
===================================================================
--- trunk/notify-sharp/src/Makefile.am	                        (rev 0)
+++ trunk/notify-sharp/src/Makefile.am	2007-11-02 04:59:30 UTC (rev 2998)
@@ -0,0 +1,46 @@
+ASSEMBLY = notify-sharp
+TARGET = $(ASSEMBLY).dll
+
+CSFLAGS = \
+	-target:library
+
+LIBFLAGS = \
+	-r:Mono.Posix \
+	$(GTK_SHARP_LIBS) \
+	$(NDESK_DBUS_LIBS)
+
+CSFILES = \
+	$(srcdir)/Global.cs \
+	$(srcdir)/Notification.cs
+
+all: $(TARGET)
+
+$(TARGET): $(CSFILES) AssemblyInfo.cs
+	$(GMCS) -out:$@ $(CSFLAGS) $(LIBFLAGS) $^
+
+install-data-local:
+	@if test -n '$(TARGET)'; then                       \
+          echo "$(GACUTIL) /i $(TARGET) /f /gacdir $(DESTDIR)$(libdir)";    \
+          $(GACUTIL) /i $(TARGET) /package $(ASSEMBLY) /f /gacdir $(libdir) /root $(DESTDIR)$(libdir) || exit 1; \
+        fi
+
+uninstall-local:
+	@if test -n '$(TARGET)'; then                       \
+          echo "$(GACUTIL) /u $(ASSEMBLY) /gacdir $(DESTDIR)$(libdir)";  \
+          $(GACUTIL) /u $(ASSEMBLY) /package $(ASSEMBLY) /gacdir $(libdir) /root $(DESTDIR)$(libdir) || exit 1;   \
+        fi
+
+EXTRA_DIST = \
+	$(CSFILES) \
+	$(srcdir)/$(TARGET).config \
+	$(srcdir)/AssemblyInfo.cs.in \
+	$(srcdir)/notify-sharp.snk
+
+CLEANFILES = \
+	$(TARGET)
+
+DISTCLEANFILES = \
+	AssemblyInfo.cs
+
+MAINTAINERCLEANFILES = \
+	Makefile.in

Added: trunk/notify-sharp/src/Notification.cs
===================================================================
--- trunk/notify-sharp/src/Notification.cs	                        (rev 0)
+++ trunk/notify-sharp/src/Notification.cs	2007-11-02 04:59:30 UTC (rev 2998)
@@ -0,0 +1,313 @@
+/*
+ * Copyright (c) 2006-2007 Sebastian Dröge <slomo at circular-chaos.org>
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Reflection;
+using System.Collections.Generic;
+
+using GLib;
+using Gdk;
+using Gtk;
+
+using NDesk.DBus;
+using org.freedesktop;
+using org.freedesktop.DBus;
+
+namespace Notifications {
+	public enum Urgency : byte {
+		Low = 0,
+		Normal,
+		Critical
+	}
+
+	public class ActionArgs : EventArgs {
+		private string action;
+		public string Action {
+			get { return action; }
+		}
+
+		public ActionArgs (string action) {
+			this.action = action;
+		}
+	}
+
+	public delegate void ActionHandler (object o, ActionArgs args);
+	
+	public class Notification {
+		private struct IconData {
+			public int Width;
+			public int Height;
+			public int Rowstride;
+			public bool HasAlpha;
+			public int BitsPerSample;
+			public int NChannels;
+			public byte[] Pixels;		
+		}
+
+		private struct ActionTuple {
+			public string Label;
+			public ActionHandler Handler;
+
+			public ActionTuple (string label, ActionHandler handler) {
+				Label = label;
+				Handler = handler;
+			}
+		}
+
+		private INotifications nf;
+
+		private bool updates_pending = false;
+		private bool shown = false;
+
+		private string app_name;
+		private uint id = 0;
+		private int timeout = -1;
+		private string summary = String.Empty, body = String.Empty;
+		private string icon = String.Empty;
+		private IDictionary <string, ActionTuple> action_map = new Dictionary<string, ActionTuple> ();
+		private IDictionary <string, object> hints  = new Dictionary<string, object> ();
+
+		public event EventHandler Closed;
+
+		static Notification () {
+			BusG.Init ();
+		}
+		
+		public Notification () {
+			nf = Global.DBusObject;
+
+			nf.NotificationClosed += OnClosed;
+			nf.ActionInvoked += OnActionInvoked;
+
+			this.app_name = Assembly.GetCallingAssembly().GetName().Name;
+		}
+
+		public Notification (string summary, string body) : this () {
+			this.summary = summary;
+			this.body = body;
+		}
+
+		public Notification (string summary, string body, string icon) : this (summary, body) {
+			this.icon = icon;
+		}
+
+		public Notification (string summary, string body, Pixbuf icon) : this (summary, body) {
+			SetPixbufHint (icon);
+		}
+
+		public Notification (string summary, string body, Pixbuf icon, Gtk.Widget widget) : this (summary, body, icon) {
+			AttachToWidget (widget);
+		}
+		
+		public Notification (string summary, string body, string icon, Gtk.Widget widget) : this (summary, body, icon) {
+			AttachToWidget (widget);
+		}
+
+		public string Summary {
+			set {
+				summary = value;
+				Update ();
+			}
+			get {
+				return summary;
+			}
+		}
+
+		public string Body {
+			set {
+				body = value;
+				Update ();
+			}
+			get {
+				return body;
+			}
+		}
+
+		public int Timeout {
+			set {
+				timeout = value;
+				Update ();
+			}
+			get {
+				return timeout;
+			}
+		}
+
+		public Urgency Urgency {
+			set {
+				hints["urgency"] = (byte) value;
+				Update ();
+			}
+			get {
+				return hints.ContainsKey ("urgency") ? (Urgency) hints["urgency"] : Urgency.Normal;
+			}
+		}
+
+		public string Category {
+			set {
+				hints["category"] = value;
+				Update ();
+			}
+			get {
+				return hints.ContainsKey ("category") ? (string) hints["category"] : String.Empty;
+			}
+
+		}
+
+		public Pixbuf Icon {
+			set {
+				SetPixbufHint (value);
+				icon = String.Empty;
+				Update ();
+			}
+		}
+
+		public string IconName {
+			set {
+				icon = value;
+				hints.Remove ("icon_data");
+				Update ();
+			}
+		}
+
+		private void SetPixbufHint (Pixbuf pixbuf) {
+			IconData icon_data = new IconData ();
+			icon_data.Width = pixbuf.Width;
+			icon_data.Height = pixbuf.Height;
+			icon_data.Rowstride = pixbuf.Rowstride;
+			icon_data.HasAlpha = pixbuf.HasAlpha;
+			icon_data.BitsPerSample = pixbuf.BitsPerSample;
+			icon_data.NChannels = pixbuf.NChannels;
+
+			int len = (icon_data.Height - 1) * icon_data.Rowstride + icon_data.Width *
+				((icon_data.NChannels * icon_data.BitsPerSample + 7) / 8);
+			icon_data.Pixels = new byte[len];
+			System.Runtime.InteropServices.Marshal.Copy (pixbuf.Pixels, icon_data.Pixels, 0, len);
+
+			hints["icon_data"] = icon_data;
+		}
+
+		public void AttachToWidget (Gtk.Widget widget) {
+			int x, y;
+
+			widget.GdkWindow.GetOrigin (out x, out y);
+
+			if (widget.GetType() != typeof (Gtk.Window) || ! widget.GetType().IsSubclassOf(typeof (Gtk.Window))) {
+				x += widget.Allocation.X;
+				y += widget.Allocation.Y;
+			}
+
+			x += widget.Allocation.Width / 2;
+			y += widget.Allocation.Height / 2;
+
+			SetGeometryHints (widget.Screen, x, y);
+		}
+
+		public void SetGeometryHints (Screen screen, int x, int y) {
+			hints["x"] = x;
+			hints["y"] = y;
+			hints["xdisplay"] = screen.MakeDisplayName ();
+			Update ();
+		}
+
+		private void Update () {
+			if (shown && !updates_pending) {
+				updates_pending = true;
+				GLib.Timeout.Add (100, delegate {
+					if (updates_pending) {
+						Show ();
+						updates_pending = false;
+					}
+					return false;
+				});
+			}
+		}
+		
+		public void Show () {
+			string[] actions;
+			lock (action_map) {
+				actions = new string[action_map.Keys.Count * 2];
+				int i = 0;
+				foreach (KeyValuePair<string,ActionTuple> pair in action_map) {
+					actions[i++] = pair.Key;
+					actions[i++] = pair.Value.Label;
+				}
+			}
+			id = nf.Notify (app_name, id, icon, summary, body, actions, hints, timeout);
+			shown = true;
+		}
+
+		public void Close () {
+			nf.CloseNotification (id);
+			id = 0;
+			shown = false;
+		}
+
+		private void OnClosed (uint id) {
+			if (this.id == id) {
+				this.id = 0;
+				shown = false;
+				if (Closed != null) {
+					Closed (this, new EventArgs ());
+				}
+			}
+		}
+
+		public void AddAction (string action, string label, ActionHandler handler) {
+			lock (action_map) {
+				action_map[action] = new ActionTuple (label, handler);
+			}
+			Update ();
+		}
+
+		public void RemoveAction (string action) {
+			lock (action_map) {
+				action_map.Remove (action);
+			}
+			Update ();
+		}
+
+		public void ClearActions () {
+			lock (action_map) {
+				action_map.Clear ();
+			}
+			Update ();
+		}
+
+		private void OnActionInvoked (uint id, string action) {
+			lock (action_map) {
+				if (this.id == id && action_map.ContainsKey (action))
+					action_map[action].Handler (this, new ActionArgs (action));
+			}
+		}
+
+		public void AddHint (string name, object value) {
+			hints[name] = value;
+			Update ();
+		}
+
+		public void RemoveHint (string name) {
+			hints.Remove (name);
+			Update ();
+		}
+	}
+}

Added: trunk/notify-sharp/src/notify-sharp.dll.config
===================================================================
--- trunk/notify-sharp/src/notify-sharp.dll.config	                        (rev 0)
+++ trunk/notify-sharp/src/notify-sharp.dll.config	2007-11-02 04:59:30 UTC (rev 2998)
@@ -0,0 +1,5 @@
+<configuration>
+  <dllmap dll="libglib-2.0-0.dll" target="libglib-2.0.so.0"/>
+  <dllmap dll="libgobject-2.0-0.dll" target="libgobject-2.0.so.0"/>
+  <dllmap dll="libgthread-2.0-0.dll" target="libgthread-2.0.so.0"/>
+</configuration>

Added: trunk/notify-sharp/src/notify-sharp.snk
===================================================================
(Binary files differ)


Property changes on: trunk/notify-sharp/src/notify-sharp.snk
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream



More information about the galago-commits mailing list