CinnamonDesktop.XkbInfo

g CinnamonDesktop.XkbInfo CinnamonDesktop.XkbInfo GObject.Object GObject.Object GObject.Object->CinnamonDesktop.XkbInfo

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

description_for_option (group_id, id)

get_all_layouts ()

get_all_option_groups ()

get_layout_info (id)

get_layout_info_for_language (language)

get_options_for_group (group_id)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_object

GObject.Object

r

Class Details

class CinnamonDesktop.XkbInfo(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

CinnamonDesktop.XkbInfoClass

classmethod new()
Returns:

a new CinnamonDesktop.XkbInfo instance.

Return type:

CinnamonDesktop.XkbInfo

description_for_option(group_id, id)
Parameters:
  • group_id (str) – identifier for group containing the option

  • id (str) – option identifier

Returns:

the translated description for the option id.

Return type:

str

New in version 3.6.

get_all_layouts()
Returns:

the list of layout names. The caller takes ownership of the GLib.List but not of the strings themselves, those are internally allocated and must not be modified.

Return type:

[str]

Returns a list of all layout identifiers we know about.

New in version 3.6.

get_all_option_groups()
Returns:

the list of option group ids. The caller takes ownership of the GLib.List but not of the strings themselves, those are internally allocated and must not be modified.

Return type:

[str]

Returns a list of all option group identifiers we know about.

New in version 3.6.

get_layout_info(id)
Parameters:

id (str) – layout’s identifier about which to retrieve the info

Returns:

True if the layout exists or False otherwise.

display_name:

location to store the layout’s display name, or None

short_name:

location to store the layout’s short name, or None

xkb_layout:

location to store the layout’s XKB name, or None

xkb_variant:

location to store the layout’s XKB variant, or None

Return type:

(bool, display_name: str, short_name: str, xkb_layout: str, xkb_variant: str)

Retrieves information about a layout. Both display_name and short_name are suitable to show in UIs and might be localized if translations are available.

Some layouts don’t provide a short name (2 or 3 letters) or don’t specify a XKB variant, in those cases short_name or xkb_variant are empty strings, i.e. “”.

If the given layout doesn’t exist the return value is False and all the (out) parameters are set to None.

New in version 3.6.

get_layout_info_for_language(language)
Parameters:

language (str) – an ISO 639 code

Returns:

True if a layout exists or False otherwise.

id:

location to store the layout’s indentifier, or None

display_name:

location to store the layout’s display name, or None

short_name:

location to store the layout’s short name, or None

xkb_layout:

location to store the layout’s XKB name, or None

xkb_variant:

location to store the layout’s XKB variant, or None

Return type:

(bool, id: str, display_name: str, short_name: str, xkb_layout: str, xkb_variant: str)

Retrieves the layout that better fits language. It also fetches information about that layout like CinnamonDesktop.XkbInfo.get_layout_info().

If a layout can’t be found the return value is False and all the (out) parameters are set to None.

New in version 3.6.

get_options_for_group(group_id)
Parameters:

group_id (str) – group’s identifier about which to retrieve the options

Returns:

the list of option ids. The caller takes ownership of the GLib.List but not of the strings themselves, those are internally allocated and must not be modified.

Return type:

[str]

Returns a list of all option identifiers we know about for group group_id.

New in version 3.6.