diff options
-rw-r--r-- | src/gwacom/wacom-device.c | 21 | ||||
-rw-r--r-- | src/gwacom/wacom-device.h | 8 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/gwacom/wacom-device.c b/src/gwacom/wacom-device.c index 2f149fb..78be3fa 100644 --- a/src/gwacom/wacom-device.c +++ b/src/gwacom/wacom-device.c @@ -118,6 +118,27 @@ void wacom_options_set(WacomOptions *opts, const char *key, const char *value) g_hash_table_replace(opts->ht, g_ascii_strdown(key, -1), g_strdup(value)); } + +static void append_slist(gpointer key, gpointer value, gpointer user_data) +{ + GSList **list = user_data; + *list = g_slist_append(*list, g_strdup(key)); +} + +/** + * wacom_options_list_keys: + * + * Returns: (element-type utf8) (transfer full): + */ +GSList *wacom_options_list_keys(WacomOptions *opts) +{ + GSList *list = NULL; + + g_hash_table_foreach(opts->ht, append_slist, &list); + + return list; +} + static void wacom_options_finalize(GObject *gobject) { diff --git a/src/gwacom/wacom-device.h b/src/gwacom/wacom-device.h index 532b425..a40b263 100644 --- a/src/gwacom/wacom-device.h +++ b/src/gwacom/wacom-device.h @@ -68,6 +68,14 @@ const char *wacom_options_get(WacomOptions *opts, const char *key); */ void wacom_options_set(WacomOptions *opts, const char *key, const char *value); +/*** + * wacom_options_list_keys: + * + * Returns: (element-type utf8) (transfer full): The List of keys in these + * options + */ +GSList *wacom_options_list_keys(WacomOptions *opts); + #define WACOM_TYPE_DEVICE (wacom_device_get_type()) G_DECLARE_FINAL_TYPE (WacomDevice, wacom_device, WACOM, DEVICE, GObject) |