| 1 |
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- |
| 2 |
* |
| 3 |
* This library is free software; you can redistribute it and/or |
| 4 |
* modify it under the terms of the GNU Lesser General Public |
| 5 |
* License as published by the Free Software Foundation; either |
| 6 |
* version 2.1 of the License, or(at your option) any later version. |
| 7 |
* |
| 8 |
* This library is distributed in the hope that it will be useful, |
| 9 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 |
* Lesser General Public License for more details. |
| 12 |
* |
| 13 |
* You should have received a copy of the GNU Lesser General Public |
| 14 |
* License along with this library; if not, write to the |
| 15 |
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 16 |
* Boston, MA 02111-1307, USA. |
| 17 |
*/ |
| 18 |
|
| 19 |
#include <libnotify/notify.h> |
| 20 |
#include <stdio.h> |
| 21 |
#include <unistd.h> |
| 22 |
#include <stdlib.h> |
| 23 |
#include <string.h> |
| 24 |
|
| 25 |
static GMainLoop *loop; |
| 26 |
|
| 27 |
int |
| 28 |
main (int argc, char **argv) |
| 29 |
{ |
| 30 |
NotifyNotification *n; |
| 31 |
GVariant *hint; |
| 32 |
|
| 33 |
if (!notify_init ("Transient Test")) |
| 34 |
exit (1); |
| 35 |
|
| 36 |
loop = g_main_loop_new (NULL, FALSE); |
| 37 |
|
| 38 |
n = notify_notification_new ("Some transient change", |
| 39 |
"Something happened", |
| 40 |
"audio-volume-medium"); |
| 41 |
hint = g_variant_new_boolean (TRUE); |
| 42 |
notify_notification_set_hint (n, "transient", hint); |
| 43 |
|
| 44 |
if (!notify_notification_show (n, NULL)) { |
| 45 |
fprintf (stderr, "failed to send notification\n"); |
| 46 |
return 1; |
| 47 |
} |
| 48 |
|
| 49 |
g_main_loop_run (loop); |
| 50 |
|
| 51 |
return 0; |
| 52 |
} |