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;
|
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:
|
* eek_xkb_layout_set_keycodes:
|
||||||
* @layout: an #EekXkbLayout
|
* @layout: an #EekXkbLayout
|
||||||
|
|||||||
@ -60,6 +60,16 @@ EekLayout *eek_xkb_layout_new (void);
|
|||||||
|
|
||||||
gboolean eek_xkb_layout_set_names (EekXkbLayout *layout,
|
gboolean eek_xkb_layout_set_names (EekXkbLayout *layout,
|
||||||
XkbComponentNamesRec *names);
|
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
|
gboolean eek_xkb_layout_set_keycodes
|
||||||
(EekXkbLayout *layout,
|
(EekXkbLayout *layout,
|
||||||
const gchar *keycodes);
|
const gchar *keycodes);
|
||||||
|
|||||||
@ -345,6 +345,42 @@ eek_xkl_layout_set_config (EekXklLayout *layout,
|
|||||||
return FALSE;
|
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:
|
* eek_xkl_layout_set_model:
|
||||||
* @layout: an #EekXklLayout
|
* @layout: an #EekXklLayout
|
||||||
|
|||||||
@ -54,32 +54,38 @@ struct _EekXklLayoutClass
|
|||||||
gpointer pdummy[24];
|
gpointer pdummy[24];
|
||||||
};
|
};
|
||||||
|
|
||||||
GType eek_xkl_layout_get_type (void) G_GNUC_CONST;
|
GType eek_xkl_layout_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
EekLayout *eek_xkl_layout_new (void);
|
EekLayout *eek_xkl_layout_new (void);
|
||||||
|
|
||||||
gboolean eek_xkl_layout_set_config (EekXklLayout *layout,
|
gboolean eek_xkl_layout_set_config (EekXklLayout *layout,
|
||||||
XklConfigRec *config);
|
XklConfigRec *config);
|
||||||
|
|
||||||
gboolean eek_xkl_layout_set_model (EekXklLayout *layout,
|
gboolean eek_xkl_layout_set_config_full (EekXklLayout *layout,
|
||||||
const gchar *model);
|
gchar *model,
|
||||||
gboolean eek_xkl_layout_set_layouts (EekXklLayout *layout,
|
gchar **layouts,
|
||||||
gchar **layouts);
|
gchar **variants,
|
||||||
gboolean eek_xkl_layout_set_variants (EekXklLayout *layout,
|
gchar **options);
|
||||||
gchar **variants);
|
|
||||||
gboolean eek_xkl_layout_set_options (EekXklLayout *layout,
|
|
||||||
gchar **options);
|
|
||||||
gboolean eek_xkl_layout_enable_option (EekXklLayout *layout,
|
|
||||||
const gchar *option);
|
|
||||||
gboolean eek_xkl_layout_disable_option (EekXklLayout *layout,
|
|
||||||
const gchar *option);
|
|
||||||
|
|
||||||
gchar *eek_xkl_layout_get_model (EekXklLayout *layout);
|
gboolean eek_xkl_layout_set_model (EekXklLayout *layout,
|
||||||
gchar **eek_xkl_layout_get_layouts (EekXklLayout *layout);
|
const gchar *model);
|
||||||
gchar **eek_xkl_layout_get_variants (EekXklLayout *layout);
|
gboolean eek_xkl_layout_set_layouts (EekXklLayout *layout,
|
||||||
gchar **eek_xkl_layout_get_options (EekXklLayout *layout);
|
gchar **layouts);
|
||||||
gboolean eek_xkl_layout_get_option (EekXklLayout *layout,
|
gboolean eek_xkl_layout_set_variants (EekXklLayout *layout,
|
||||||
const gchar *option);
|
gchar **variants);
|
||||||
|
gboolean eek_xkl_layout_set_options (EekXklLayout *layout,
|
||||||
|
gchar **options);
|
||||||
|
gboolean eek_xkl_layout_enable_option (EekXklLayout *layout,
|
||||||
|
const gchar *option);
|
||||||
|
gboolean eek_xkl_layout_disable_option (EekXklLayout *layout,
|
||||||
|
const gchar *option);
|
||||||
|
|
||||||
|
gchar *eek_xkl_layout_get_model (EekXklLayout *layout);
|
||||||
|
gchar **eek_xkl_layout_get_layouts (EekXklLayout *layout);
|
||||||
|
gchar **eek_xkl_layout_get_variants (EekXklLayout *layout);
|
||||||
|
gchar **eek_xkl_layout_get_options (EekXklLayout *layout);
|
||||||
|
gboolean eek_xkl_layout_get_option (EekXklLayout *layout,
|
||||||
|
const gchar *option);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
#endif /* #ifndef EEK_XKL_LAYOUT_H */
|
#endif /* #ifndef EEK_XKL_LAYOUT_H */
|
||||||
|
|||||||
Reference in New Issue
Block a user