diff options
author | Christian Hammond <chipx86@chipx86.com> | 2005-07-28 06:10:32 +0000 |
---|---|---|
committer | Christian Hammond <chipx86@chipx86.com> | 2005-07-28 06:10:32 +0000 |
commit | b2b4e09eb67d2daff1b79585cd0c213561b70a4b (patch) | |
tree | af52e6a7f3485e0bd4a542bbaed47f3c2734fa41 | |
parent | f40ef57aae2814e9c7f2be5687bd42c8da43e157 (diff) | |
download | libnotify-b2b4e09eb67d2daff1b79585cd0c213561b70a4b.tar.gz |
Support setting boolean hints.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | libnotify/notify.c | 10 | ||||
-rw-r--r-- | libnotify/notify.h | 10 |
3 files changed, 25 insertions, 1 deletions
@@ -1,3 +1,9 @@ +Wed Jul 27 23:08:43 PDT 2005 Christian Hammond <chipx86@chipx86.com> + + * libnotify/notify.c: + * libnotify/notify.h: + - Support setting boolean hints. + Mon Jul 25 18:03:12 PDT 2005 Christian Hammond <chipx86@gnupdate.org> * libnotify/notify.c: diff --git a/libnotify/notify.c b/libnotify/notify.c index ecf8aa1..ff9e144 100644 --- a/libnotify/notify.c +++ b/libnotify/notify.c @@ -608,6 +608,16 @@ notify_hints_set_int(NotifyHints *hints, const char *key, int value) g_hash_table_replace(hints, g_strdup(key), g_strdup_printf("%d", value)); } +void +notify_hints_set_bool(NotifyHints *hints, const char *key, gboolean value) +{ + g_return_if_fail(hints != NULL); + g_return_if_fail(key != NULL && *key != '\0'); + + g_hash_table_replace(hints, g_strdup(key), + g_strdup(value? "true" : "false")); +} + /************************************************************************** * Icon API diff --git a/libnotify/notify.h b/libnotify/notify.h index 8b23058..ba3460f 100644 --- a/libnotify/notify.h +++ b/libnotify/notify.h @@ -20,7 +20,6 @@ * Boston, MA 02111-1307, USA. * * @todo We talk about URIs, but they are actually file paths not URIs - * @todo Un-glibify? */ #ifndef _LIBNOTIFY_NOTIFY_H_ @@ -161,6 +160,15 @@ void notify_hints_set_string(NotifyHints *hints, const char *key, */ void notify_hints_set_int(NotifyHints *hints, const char *key, int value); +/** + * Adds a boolean value to the hints table. + * + * @param hints The hints table. + * @param key The key. + * @param value The value. + */ +void notify_hints_set_bool(NotifyHints *hints, const char *key, gboolean value); + /*@}*/ |