2
* test_libnotify.c -- Test libnotify
4
* Copyright (C) 2010 Johannes H. Jensen <joh@pseudoberries.com>
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
* Johannes H. Jensen <joh@pseudoberries.com>
24
#include <libnotify/notify.h>
30
#include <dbus/dbus.h>
31
#include <dbus/dbus-glib.h>
32
#include <dbus/dbus-glib-lowlevel.h>*/
35
NotifyNotification *n;
38
close_notify (gpointer data)
40
g_debug("CLOSE NOTIFY: %d", notify_notification_close (n, NULL));
46
main(int argc, char *argv[])
48
gtk_init(&argc, &argv);
50
if (!notify_init("Alarm Clock"))
53
GtkStatusIcon *si = gtk_status_icon_new_from_icon_name ("alarm-clock");
56
n = notify_notification_new_with_status_icon("Alarm & <b>Test</b>",
57
"Click the alarm icon to snooze",
60
if (!notify_notification_show(n, NULL))
62
fprintf(stderr, "failed to send notification\n");
66
g_timeout_add_seconds (1, close_notify, NULL);