www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - dnotify

reply David <d dav1d.de> writes:
https://github.com/Dav1dde/dnotify

Nothing special, this is just an abstraction for the libnotify binding 
in deimos (pull request not yet merged)

A simple notification bubble looks like this:

auto notification = new Notification("Hello D World", "The D programming 
language is just great and it has long sample texts", "icon.png");
notification.timeout = 5;
notification.urgency = NotifyUrgency.HIGH;
notification.show();
// 2 seconds later
notification.close();
int reason = notification.closed_reason;

As you can see it provides a D style higher level of libnotify. It also 
converts GError's into Exceptions (that's the reason why the C function 
for showing the notification returns a bool and the show method of 
dnotify nothing).

It also translates GList* (linked lists) into D arrays and it takes care 
of freeing memory allocated by libnotify.

Only thing which is not working yet is `notification.set_image` and I 
was not able to figure out the reason (it has to do with some gdk-pixbuf 
internals).

- david
Jul 28 2012
next sibling parent Marco Leise <Marco.Leise gmx.de> writes:
Am Sun, 29 Jul 2012 01:04:35 +0200
schrieb David <d dav1d.de>:

 https://github.com/Dav1dde/dnotify
 
 Nothing special, this is just an abstraction for the libnotify binding 
 in deimos (pull request not yet merged)

This is nice, if I had access to a Wiki about D, I'd add a list of libraries that can be used (name, C binding, D abstraction). I have to say that I was a bit confused at first, thinking you created a wrapper for the filesystem monitor 'dnotify' http://en.wikipedia.org/wiki/Dnotify -- Marco
Jul 29 2012
prev sibling next sibling parent Marco Leise <Marco.Leise gmx.de> writes:
P.S.:
"NotificationError" should probably be NotificationException, since the term
Error is used for unrecoverable exceptions in D and it does in fact inherit
from Exception.
Jul 29 2012
prev sibling next sibling parent Nick Sabalausky <SeeWebsiteToContactMe semitwist.com> writes:
On Sun, 29 Jul 2012 20:56:48 +0200
Marco Leise <Marco.Leise gmx.de> wrote:
 
 if I had access to a Wiki about D...
 

You do! http://www.prowiki.org/wiki4d/wiki.cgi
Jul 29 2012
prev sibling next sibling parent Marco Leise <Marco.Leise gmx.de> writes:
Am Mon, 30 Jul 2012 01:37:30 -0400
schrieb Nick Sabalausky <SeeWebsiteToContactMe semitwist.com>:

 On Sun, 29 Jul 2012 20:56:48 +0200
 Marco Leise <Marco.Leise gmx.de> wrote:
 
 if I had access to a Wiki about D...
 

You do! http://www.prowiki.org/wiki4d/wiki.cgi

I knew of this, but it didn't come to my head that I had to edit a non-existing page or save an existing page under a new name. I can add a page about C bindings now, but it conflicts with the category approach that is used there (e.g. "Database Bindings"). Also, I wouldn't count Deimos bindings as projects. Technically I'd prefer a database of existing D stuff, and dynamic web pages that filter by category/C bindings/last update etc. -- Marco
Jul 30 2012
prev sibling next sibling parent "David Nadlinger" <see klickverbot.at> writes:
On Monday, 30 July 2012 at 12:18:27 UTC, Marco Leise wrote:
 Technically I'd prefer a database of existing D stuff, and 
 dynamic web pages that filter by category/C bindings/last 
 update etc.

That's exactly what I have been planning to build on a free weekend – would be very useful, at least until we have an »official« package manager. Unfortunately, I won't have the time to do so for another month, so if somebody wants to beat me to it, feel free to. David
Jul 30 2012
prev sibling next sibling parent "David Nadlinger" <see klickverbot.at> writes:
On Monday, 30 July 2012 at 12:26:43 UTC, David Nadlinger wrote:
 That's exactly what I have been planning to build […]

(my concept also includes a few slightly more advanced features, like SCM activity monitoring to sort out dead projects, …)
Jul 30 2012
prev sibling next sibling parent Marco Leise <Marco.Leise gmx.de> writes:
Am Mon, 30 Jul 2012 14:28:01 +0200
schrieb "David Nadlinger" <see klickverbot.at>:

 On Monday, 30 July 2012 at 12:26:43 UTC, David Nadlinger wrote:
 That's exactly what I have been planning to build [=E2=80=A6]

(my concept also includes a few slightly more advanced features,=20 like SCM activity monitoring to sort out dead projects, =E2=80=A6)

Same ideas here. ;) And then you put on dlang.org/projects where everyone c= an see them. And since Deimos bindings will be added automatically by the "= advanced features" we have zero maintenance costs, just adding some URLs. Now I wonder if this is some German/Austrian disease, to centralize, catego= rize and order everything. --=20 Marco
Jul 30 2012
prev sibling parent "Adam D. Ruppe" <destructionator gmail.com> writes:
On Monday, 30 July 2012 at 12:26:43 UTC, David Nadlinger wrote:
 That's exactly what I have been planning to build on a free 
 weekend – would be very useful, at least until we have an 
 »official« package manager.

Me too... my little dpldocs.info http://dpldocs.info/ is supposed to be eventually expanded to take submissions too, becoming a doc search engine for hopefully all D libs. But I haven't even been keeping up with Phobos.... wow, I'm coming up on *two years* behind on that. I need to sit down and make that happen.
Jul 30 2012