diff options
-rw-r--r-- | libxklavier/xkl_config_rec.h | 42 | ||||
-rw-r--r-- | libxklavier/xklavier_props.c | 24 |
2 files changed, 66 insertions, 0 deletions
diff --git a/libxklavier/xkl_config_rec.h b/libxklavier/xkl_config_rec.h index 0658d04..1b837f3 100644 --- a/libxklavier/xkl_config_rec.h +++ b/libxklavier/xkl_config_rec.h @@ -239,6 +239,48 @@ extern "C" { extern gboolean xkl_config_rec_equals(XklConfigRec * data1, XklConfigRec * data2); +/** + * xkl_config_rec_set_layouts: + * @data: record to change + * @new_layouts: (array zero-terminated=1) (transfer none): zero terminated + * list of new layout names. + * + * Sets a new layout list. + * + * Frees the previous layout list. This is primarily useful for bindings, in C + * you can manipulate the @layouts record member directly. + */ + extern void xkl_config_rec_set_layouts(XklConfigRec * data, + const gchar ** new_layouts); + +/** + * xkl_config_rec_set_variants: + * @data: record to change + * @new_variants: (transfer none) (array zero-terminated=1): zero terminated + * list of new variant names. + * + * Sets a new variant list. + * + * Frees the previous variant list. This is primarily useful for bindings, in C + * you can manipulate the @variants record member directly. + */ + extern void xkl_config_rec_set_variants(XklConfigRec * data, + const gchar ** new_variants); + +/** + * xkl_config_rec_set_options: + * @data: record to change + * @new_options: (transfer none) (array zero-terminated=1): zero terminated + * list of new option names. + * + * Sets a new option list. + * + * Frees the previous option list. This is primarily useful for bindings, in C + * you can manipulate the @options record member directly. + */ + extern void xkl_config_rec_set_options(XklConfigRec * data, + const gchar ** new_options); + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/libxklavier/xklavier_props.c b/libxklavier/xklavier_props.c index 3ff7336..b8a2a2e 100644 --- a/libxklavier/xklavier_props.c +++ b/libxklavier/xklavier_props.c @@ -191,6 +191,30 @@ xkl_config_rec_equals(XklConfigRec * data1, XklConfigRec * data2) } void +xkl_config_rec_set_layouts(XklConfigRec * data, + const gchar ** new_layouts) +{ + g_strfreev (data->layouts); + data->layouts = g_strdupv ((gchar**) new_layouts); +} + +void +xkl_config_rec_set_variants(XklConfigRec * data, + const gchar ** new_variants) +{ + g_strfreev (data->variants); + data->variants = g_strdupv ((gchar**) new_variants); +} + +void +xkl_config_rec_set_options(XklConfigRec * data, + const gchar ** new_options) +{ + g_strfreev (data->options); + data->options = g_strdupv ((gchar**) new_options); +} + +void xkl_config_rec_init(XklConfigRec * data) { /* clear the structure VarDefsPtr... */ |