[gnome-desktop] gnome-xkb-info: Add public API to get an XKB option	group description
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gnome-desktop] gnome-xkb-info: Add public API to get an XKB option	group description
- Date: Fri,  5 Oct 2012 14:47:45 +0000 (UTC)
commit 1d11b25165887008854951ff5c49aecc0beb023c
Author: Rui Matos <tiagomatos gmail com>
Date:   Tue Sep 25 20:01:26 2012 +0200
    gnome-xkb-info: Add public API to get an XKB option group description
    
    https://bugzilla.gnome.org/show_bug.cgi?id=684803
 libgnome-desktop/gnome-xkb-info.c |   30 ++++++++++++++++++++++++++++++
 libgnome-desktop/gnome-xkb-info.h |    2 ++
 2 files changed, 32 insertions(+), 0 deletions(-)
---
diff --git a/libgnome-desktop/gnome-xkb-info.c b/libgnome-desktop/gnome-xkb-info.c
index b86b616..80729bb 100644
--- a/libgnome-desktop/gnome-xkb-info.c
+++ b/libgnome-desktop/gnome-xkb-info.c
@@ -690,6 +690,36 @@ gnome_xkb_info_get_all_option_groups (GnomeXkbInfo *self)
 }
 
 /**
+ * gnome_xkb_info_description_for_group:
+ * @self: a #GnomeXkbInfo
+ * @group_id: identifier for group
+ *
+ * Return value: the translated description for the group @group_id.
+ *
+ * Since: 3.8
+ */
+const gchar *
+gnome_xkb_info_description_for_group (GnomeXkbInfo *self,
+                                      const gchar  *group_id)
+{
+  GnomeXkbInfoPrivate *priv;
+  const XkbOptionGroup *group;
+
+  g_return_val_if_fail (GNOME_IS_XKB_INFO (self), NULL);
+
+  priv = self->priv;
+
+  if (!ensure_rules_are_parsed (self))
+    return NULL;
+
+  group = g_hash_table_lookup (priv->option_groups_table, group_id);
+  if (!group)
+    return NULL;
+
+  return XKEYBOARD_CONFIG_(group->description);
+}
+
+/**
  * gnome_xkb_info_get_options_for_group:
  * @self: a #GnomeXkbInfo
  * @group_id: group's identifier about which to retrieve the options
diff --git a/libgnome-desktop/gnome-xkb-info.h b/libgnome-desktop/gnome-xkb-info.h
index d667a65..44dd2d7 100644
--- a/libgnome-desktop/gnome-xkb-info.h
+++ b/libgnome-desktop/gnome-xkb-info.h
@@ -75,6 +75,8 @@ gboolean        gnome_xkb_info_get_layout_info_for_language     (GnomeXkbInfo *s
                                                                  const gchar **xkb_layout,
                                                                  const gchar **xkb_variant);
 GList          *gnome_xkb_info_get_all_option_groups            (GnomeXkbInfo *self);
+const gchar    *gnome_xkb_info_description_for_group            (GnomeXkbInfo *self,
+                                                                 const gchar  *group_id);
 GList          *gnome_xkb_info_get_options_for_group            (GnomeXkbInfo *self,
                                                                  const gchar  *group_id);
 const gchar    *gnome_xkb_info_description_for_option           (GnomeXkbInfo *self,
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]