libeek: add wrapper functions to avoid exposing XKB/XKL structures to GIR
This commit is contained in:
@ -607,6 +607,42 @@ eek_xkb_layout_set_names (EekXkbLayout *layout, XkbComponentNamesRec *names)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* eek_xkb_layout_set_names_full:
|
||||
* @layout: an #EekXkbLayout
|
||||
* @keymap: keymap component name
|
||||
* @keycodes: keycodes component name
|
||||
* @types: types component name
|
||||
* @compat: compat component name
|
||||
* @symbols: symbols component name
|
||||
* @geometry: geometry component name
|
||||
*
|
||||
* Set the XKB component names to @layout. This function is merely a
|
||||
* wrapper around eek_xkb_layout_set_names() to avoid passing an
|
||||
* XkbComponentNamesRec pointer (which is not currently available in
|
||||
* the gobject-introspection repository).
|
||||
*
|
||||
* Returns: %TRUE if the component name is successfully set, %FALSE otherwise
|
||||
*/
|
||||
gboolean
|
||||
eek_xkb_layout_set_names_full (EekXkbLayout *layout,
|
||||
const gchar *keymap,
|
||||
const gchar *keycodes,
|
||||
const gchar *types,
|
||||
const gchar *compat,
|
||||
const gchar *symbols,
|
||||
const gchar *geometry)
|
||||
{
|
||||
XkbComponentNamesRec names;
|
||||
names.keymap = keymap;
|
||||
names.keycodes = keycodes;
|
||||
names.types = types;
|
||||
names.compat = compat;
|
||||
names.symbols = symbols;
|
||||
names.geometry = geometry;
|
||||
return eek_xkb_layout_set_names (layout, &names);
|
||||
}
|
||||
|
||||
/**
|
||||
* eek_xkb_layout_set_keycodes:
|
||||
* @layout: an #EekXkbLayout
|
||||
|
||||
@ -60,6 +60,16 @@ EekLayout *eek_xkb_layout_new (void);
|
||||
|
||||
gboolean eek_xkb_layout_set_names (EekXkbLayout *layout,
|
||||
XkbComponentNamesRec *names);
|
||||
|
||||
gboolean eek_xkb_layout_set_names_full
|
||||
(EekXkbLayout *layout,
|
||||
const gchar *keymap,
|
||||
const gchar *keycodes,
|
||||
const gchar *types,
|
||||
const gchar *compat,
|
||||
const gchar *symbols,
|
||||
const gchar *geometry);
|
||||
|
||||
gboolean eek_xkb_layout_set_keycodes
|
||||
(EekXkbLayout *layout,
|
||||
const gchar *keycodes);
|
||||
|
||||
@ -345,6 +345,42 @@ eek_xkl_layout_set_config (EekXklLayout *layout,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* eek_xkl_layout_set_config_full:
|
||||
* @layout: an #EekXklLayout
|
||||
* @model: Libxklavier model name
|
||||
* @layouts: Libxklavier layouts
|
||||
* @variants: Libxklavier variants
|
||||
* @options: Libxklavier options
|
||||
*
|
||||
* Reconfigure @layout with @model, @layouts, @variants, and @options.
|
||||
* This function is merely a wrapper around
|
||||
* eek_xkl_layout_set_config() to avoid passing an XklConfigRec
|
||||
* pointer (which is not currently available in the
|
||||
* gobject-introspection repository).
|
||||
*
|
||||
* Returns: %TRUE if the component name is successfully set, %FALSE otherwise
|
||||
*/
|
||||
gboolean
|
||||
eek_xkl_layout_set_config_full (EekXklLayout *layout,
|
||||
gchar *model,
|
||||
gchar **layouts,
|
||||
gchar **variants,
|
||||
gchar **options)
|
||||
{
|
||||
XklConfigRec *config;
|
||||
gboolean success;
|
||||
|
||||
config = xkl_config_rec_new ();
|
||||
config->model = g_strdup (model);
|
||||
config->layouts = g_strdupv (layouts);
|
||||
config->variants = g_strdupv (variants);
|
||||
config->options = g_strdupv (options);
|
||||
success = eek_xkl_layout_set_config (layout, config);
|
||||
g_object_unref (config);
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* eek_xkl_layout_set_model:
|
||||
* @layout: an #EekXklLayout
|
||||
|
||||
@ -61,6 +61,12 @@ EekLayout *eek_xkl_layout_new (void);
|
||||
gboolean eek_xkl_layout_set_config (EekXklLayout *layout,
|
||||
XklConfigRec *config);
|
||||
|
||||
gboolean eek_xkl_layout_set_config_full (EekXklLayout *layout,
|
||||
gchar *model,
|
||||
gchar **layouts,
|
||||
gchar **variants,
|
||||
gchar **options);
|
||||
|
||||
gboolean eek_xkl_layout_set_model (EekXklLayout *layout,
|
||||
const gchar *model);
|
||||
gboolean eek_xkl_layout_set_layouts (EekXklLayout *layout,
|
||||
|
||||
Reference in New Issue
Block a user