Skip to content

Commit 442b45e

Browse files
committed
gnome-xkb-info: Expose 'allows_multiple_selection'.
1 parent 2bb17da commit 442b45e

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

debian/libcinnamon-desktop4.symbols

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ libcinnamon-desktop.so.4 libcinnamon-desktop4 #MINVER#
200200
gnome_xkb_info_get_layouts_for_country@Base 6.2.0
201201
gnome_xkb_info_get_layouts_for_language@Base 6.2.0
202202
gnome_xkb_info_get_options_for_group@Base 2.0.4
203+
gnome_xkb_info_get_option_group_allows_multiple_selection@Base 6.6.2
203204
gnome_xkb_info_get_type@Base 2.0.4
204205
gnome_xkb_info_new@Base 2.0.4
205206
gnome_xkb_info_new_with_extras@Base 6.6.0

libcinnamon-desktop/gnome-xkb-info.c

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,36 @@ gnome_xkb_info_description_for_group (GnomeXkbInfo *self,
787787
return XKEYBOARD_CONFIG_(group->description);
788788
}
789789

790+
/**
791+
* gnome_xkb_info_get_option_group_allows_multiple_selection:
792+
* @self: a #GnomeXkbInfo
793+
* @group_id: identifier for group
794+
*
795+
* Gets whether multiple options can be selected for a given group.
796+
*
797+
* Return value: %TRUE if multiple selection is allowed, %FALSE otherwise.
798+
*/
799+
gboolean
800+
gnome_xkb_info_get_option_group_allows_multiple_selection (GnomeXkbInfo *self,
801+
const gchar *group_id)
802+
{
803+
GnomeXkbInfoPrivate *priv;
804+
const XkbOptionGroup *group;
805+
806+
g_return_val_if_fail (GNOME_IS_XKB_INFO (self), FALSE);
807+
808+
priv = self->priv;
809+
810+
if (!ensure_rules_are_parsed (self))
811+
return FALSE;
812+
813+
group = g_hash_table_lookup (priv->option_groups_table, group_id);
814+
if (!group)
815+
return FALSE;
816+
817+
return group->allow_multiple_selection;
818+
}
819+
790820
/**
791821
* gnome_xkb_info_get_options_for_group:
792822
* @self: a #GnomeXkbInfo
@@ -800,7 +830,7 @@ gnome_xkb_info_description_for_group (GnomeXkbInfo *self,
800830
* the strings themselves, those are internally allocated and must not
801831
* be modified.
802832
*
803-
* Since: 3.6
833+
* Since: 6.6
804834
*/
805835
GList *
806836
gnome_xkb_info_get_options_for_group (GnomeXkbInfo *self,

libcinnamon-desktop/gnome-xkb-info.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ gboolean gnome_xkb_info_get_layout_info (GnomeXkbInfo *s
7070
GList *gnome_xkb_info_get_all_option_groups (GnomeXkbInfo *self);
7171
const gchar *gnome_xkb_info_description_for_group (GnomeXkbInfo *self,
7272
const gchar *group_id);
73+
gboolean gnome_xkb_info_get_option_group_allows_multiple_selection (GnomeXkbInfo *self,
74+
const gchar *group_id);
7375
GList *gnome_xkb_info_get_options_for_group (GnomeXkbInfo *self,
7476
const gchar *group_id);
7577
const gchar *gnome_xkb_info_description_for_option (GnomeXkbInfo *self,

0 commit comments

Comments
 (0)