summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey V. Udaltsov <svu@gnome.org>2012-08-20 22:53:32 +0100
committerSergey V. Udaltsov <svu@gnome.org>2012-08-20 22:53:32 +0100
commit4c8a86b73b1ff9c0b688f6d8a2a3b065ac8e3894 (patch)
treee1703f3d6289acdf28b8080c0b4084140b50b480
parent766d25da9d06fc757894bf5d7ce36c7189435267 (diff)
downloadlibxklavier-4c8a86b73b1ff9c0b688f6d8a2a3b065ac8e3894.tar.gz
Added new API function for the XklConfigRec - set_model
Useful for bindings. https://bugs.freedesktop.org/show_bug.cgi?id=53547
-rw-r--r--configure.ac2
-rw-r--r--libxklavier/xkl_config_rec.h13
-rw-r--r--libxklavier/xklavier_props.c8
3 files changed, 22 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 1cde6f8..35c27b6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,7 +20,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
dnl for DLL
dnl http://sources.redhat.com/autobook/autobook/autobook_91.html
-VERSION_INFO=18:0:2
+VERSION_INFO=19:0:3
AC_SUBST(VERSION_INFO)
# Check for programs
diff --git a/libxklavier/xkl_config_rec.h b/libxklavier/xkl_config_rec.h
index 1b837f3..cb3bdb2 100644
--- a/libxklavier/xkl_config_rec.h
+++ b/libxklavier/xkl_config_rec.h
@@ -281,6 +281,19 @@ extern "C" {
extern void xkl_config_rec_set_options(XklConfigRec * data,
const gchar ** new_options);
+/**
+ * xkl_config_rec_set_model:
+ * @data: record to change
+ * @new_model: (transfer none): new keyboard name.
+ *
+ * Sets a new model.
+ *
+ * Frees the previous model. This is primarily useful for bindings, in C
+ * you can manipulate the @model record member directly.
+ */
+ extern void xkl_config_rec_set_model(XklConfigRec * data,
+ const gchar * new_model);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/libxklavier/xklavier_props.c b/libxklavier/xklavier_props.c
index dbe249e..8827200 100644
--- a/libxklavier/xklavier_props.c
+++ b/libxklavier/xklavier_props.c
@@ -215,6 +215,14 @@ xkl_config_rec_set_options(XklConfigRec * data,
}
void
+xkl_config_rec_set_model(XklConfigRec * data,
+ const gchar * new_model)
+{
+ g_free (data->model);
+ data->model = g_strdup (new_model);
+}
+
+void
xkl_config_rec_init(XklConfigRec * data)
{
/* clear the structure VarDefsPtr... */