Support setting boolean hints.

This commit is contained in:
Christian Hammond 2005-07-28 06:10:32 +00:00
parent f40ef57aae
commit b2b4e09eb6
3 changed files with 25 additions and 1 deletions

View File

@ -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:

View File

@ -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

View File

@ -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);
/*@}*/