XAppKbdLayoutController: XApp Reference Manual

## XAppKbdLayoutController XAppKbdLayoutController — Keyboard layout selection UI element provider. |

## Functions

XAppKbdLayoutController * | xapp_kbd_layout_controller_new ()
gboolean | xapp_kbd_layout_controller_get_enabled ()
guint | xapp_kbd_layout_controller_get_current_group ()
void | xapp_kbd_layout_controller_set_current_group ()
void | xapp_kbd_layout_controller_next_group ()
void | xapp_kbd_layout_controller_previous_group ()
gchar * | xapp_kbd_layout_controller_get_current_name ()
gchar ** | xapp_kbd_layout_controller_get_all_names ()
gchar * | xapp_kbd_layout_controller_get_current_icon_name ()
gchar * | xapp_kbd_layout_controller_get_icon_name_for_group ()
gint | xapp_kbd_layout_controller_get_current_flag_id ()
gint | xapp_kbd_layout_controller_get_flag_id_for_group ()
gchar * | xapp_kbd_layout_controller_get_current_short_group_label ()
gchar * | xapp_kbd_layout_controller_get_short_group_label_for_group ()
gchar * | xapp_kbd_layout_controller_get_current_variant_label ()
gchar * | xapp_kbd_layout_controller_get_variant_label_for_group ()
void | xapp_kbd_layout_controller_render_cairo_subscript ()

## Properties

gboolean | enabled | Read

## Signals

void | config-changed | Run Last
void | layout-changed | Run Last

## Object Hierarchy

        GObject
        ╰── XAppKbdLayoutController

## Description

A GObject wrapper for Gkbd that provides additional UI element support for keyboard layout flags and abbreviations, as well as Wfacilities to distinguish regional and hardware-based variants which might otherwise appear identical in a layout list.

## Functions

### xapp_kbd_layout_controller_new ()

    XAppKbdLayoutController *
    xapp_kbd_layout_controller_new (void);

Creates a new XAppKbdLayoutController instance.

#### Returns

a new XAppKbdLayoutController instance.

[transfer full]

### xapp_kbd_layout_controller_get_enabled ()

    gboolean
    xapp_kbd_layout_controller_get_enabled
                                   (XAppKbdLayoutController *controller);

Returns whether or not the layout controller is enabled

#### Parameters

controller | the XAppKbdLayoutController |

### xapp_kbd_layout_controller_get_current_group ()

    guint
    xapp_kbd_layout_controller_get_current_group
                                   (XAppKbdLayoutController *controller);

Selects the previous group in the group list.

#### Parameters

controller | the XAppKbdLayoutController |

### xapp_kbd_layout_controller_set_current_group ()

    void
    xapp_kbd_layout_controller_set_current_group
                                   (XAppKbdLayoutController *controller,
                                    guint group);

Selects the given group number as active.

#### Parameters

controller | the XAppKbdLayoutController |
group | the group number to make active |

### xapp_kbd_layout_controller_next_group ()

    void
    xapp_kbd_layout_controller_next_group (XAppKbdLayoutController *controller);

Selects the next group in the group list.

#### Parameters

controller | the XAppKbdLayoutController |

### xapp_kbd_layout_controller_previous_group ()

    void
    xapp_kbd_layout_controller_previous_group
                                   (XAppKbdLayoutController *controller);

Selects the previous group in the group list.

#### Parameters

controller | the XAppKbdLayoutController |

### xapp_kbd_layout_controller_get_current_name ()

    gchar *
    xapp_kbd_layout_controller_get_current_name
                                   (XAppKbdLayoutController *controller);

Returns the full name of the current keyboard layout.

#### Parameters

controller | the XAppKbdLayoutController |

#### Returns

the newly created string or NULL if something went wrong.

[transfer full]

### xapp_kbd_layout_controller_get_all_names ()

    gchar **
    xapp_kbd_layout_controller_get_all_names
                                   (XAppKbdLayoutController *controller);

Returns an array of all full layout names

#### Parameters

controller | the XAppKbdLayoutController |

#### Returns

array of names.

[transfer none][array zero-terminated=1]

### xapp_kbd_layout_controller_get_current_icon_name ()

    gchar *
    xapp_kbd_layout_controller_get_current_icon_name
                                   (XAppKbdLayoutController *controller);

Returns the icon file name (no path or extension) to use for the current layout

#### Parameters

controller | the XAppKbdLayoutController |

#### Returns

a new string with the icon name.

[transfer full]

### xapp_kbd_layout_controller_get_icon_name_for_group ()

    gchar *
    xapp_kbd_layout_controller_get_icon_name_for_group
                                   (XAppKbdLayoutController *controller,
                                    guint group);

Returns the icon file name (no path or extension) to use for the specified layout.

#### Parameters

controller | the XAppKbdLayoutController |
group | a group number |

#### Returns

a new string with the icon name.

[transfer full]

### xapp_kbd_layout_controller_get_current_flag_id ()

    gint
    xapp_kbd_layout_controller_get_current_flag_id
                                   (XAppKbdLayoutController *controller);

Returns the duplicate id for the current layout

#### Parameters

controller | the XAppKbdLayoutController |

#### Returns

the id

### xapp_kbd_layout_controller_get_flag_id_for_group ()

    gint
    xapp_kbd_layout_controller_get_flag_id_for_group
                                   (XAppKbdLayoutController *controller,
                                    guint group);

### xapp_kbd_layout_controller_get_current_short_group_label ()

    gchar *
    xapp_kbd_layout_controller_get_current_short_group_label
                                   (XAppKbdLayoutController *controller);

Returns the short group label (and subscript, if any) of the current layout

#### Parameters

controller | the XAppKbdLayoutController |

#### Returns

a new string or NULL.

[transfer full]

### xapp_kbd_layout_controller_get_short_group_label_for_group ()

    gchar *
    xapp_kbd_layout_controller_get_short_group_label_for_group
                                   (XAppKbdLayoutController *controller,
                                    guint group);

Returns the short group label and subscript of the specified layout.

#### Parameters

controller | the XAppKbdLayoutController |
group | a group number |

#### Returns

a new string or NULL.

[transfer full]

### xapp_kbd_layout_controller_get_current_variant_label ()

    gchar *
    xapp_kbd_layout_controller_get_current_variant_label
                                   (XAppKbdLayoutController *controller);

Returns the variant label (and subscript, if any) of the current layout

#### Parameters

controller | the XAppKbdLayoutController |

#### Returns

a new string or NULL.

[transfer full]

### xapp_kbd_layout_controller_get_variant_label_for_group ()

    gchar *
    xapp_kbd_layout_controller_get_variant_label_for_group
                                   (XAppKbdLayoutController *controller,
                                    guint group);

Returns the variant label and subscript of the specified layout.

#### Parameters

controller | the XAppKbdLayoutController |
group | a group number |

#### Returns

a new string or NULL.

[transfer full]

### xapp_kbd_layout_controller_render_cairo_subscript ()

    void
    xapp_kbd_layout_controller_render_cairo_subscript
                                   (cairo_t *cr,
                                    gdouble x,
                                    gdouble y,
                                    gdouble width,
                                    gdouble height,
                                    gint subscript);

Renders a subscript number in the given work area. This should be called from within a "draw" or "paint" widget/actor function, where a valid cairo_t is provided to draw with.

#### Parameters

cr | a cairo_t |
x | the x position of the drawing area |
y | the y position of the drawing area |
width | the width of the drawing area |
height | the height of the drawing area |
subscript | the number to render |

## Types and Values

## Property Details

### The `“enabled”` property

      “enabled”                  gboolean

Whether we're enabled (more than one keyboard layout is installed).

Flags: Read

Default value: FALSE

## Signal Details

### The `“config-changed”` signal

    void
    user_function (XAppKbdLayoutController *xappkbdlayoutcontroller,
                   gpointer                 user_data)

Flags: Run Last

### The `“layout-changed”` signal

    void
    user_function (XAppKbdLayoutController *xappkbdlayoutcontroller,
                   guint                    arg1,
                   gpointer                 user_data)

Flags: Run Last