From 115a22dfff5ea59cdcf8a5a7f8e15ffd71164c1c Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 22 Apr 2013 14:36:27 -0400 Subject: XklConfigItem: Add accessors for name, short_description, description The interpretation of fixed-size arrays of gchar changed in pygobject; these accessors should provide a predictable way to get these values as strings. See: https://bugzilla.gnome.org/show_bug.cgi?id=698416 See: https://bugzilla.redhat.com/show_bug.cgi?id=920595 --- configure.ac | 2 +- libxklavier/libxklavier.public | 3 +++ libxklavier/xkl_config_item.h | 27 +++++++++++++++++++++++++++ libxklavier/xklavier_props.c | 18 ++++++++++++++++++ 4 files changed, 49 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index cdb9fd5..0f28147 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=19:0:3 +VERSION_INFO=20:0:4 AC_SUBST(VERSION_INFO) # Check for programs diff --git a/libxklavier/libxklavier.public b/libxklavier/libxklavier.public index baf6db1..11f27d5 100644 --- a/libxklavier/libxklavier.public +++ b/libxklavier/libxklavier.public @@ -1,7 +1,10 @@ xkl_config_item_get_type xkl_config_item_new +xkl_config_item_get_description xkl_config_item_set_description +xkl_config_item_get_name xkl_config_item_set_name +xkl_config_item_get_short_description xkl_config_item_set_short_description xkl_config_rec_activate xkl_config_rec_dump diff --git a/libxklavier/xkl_config_item.h b/libxklavier/xkl_config_item.h index 0aa90ed..46eff0e 100644 --- a/libxklavier/xkl_config_item.h +++ b/libxklavier/xkl_config_item.h @@ -131,6 +131,15 @@ extern "C" { */ extern XklConfigItem *xkl_config_item_new(void); +/** + * xkl_config_item_get_name: + * @item: the XklConfigItem object + * + * Returns: The @name field of a XklConfigItem. This is mostly useful for + * language bindings, in C you can manipulate the member directly. + */ +extern const gchar * xkl_config_item_get_name(XklConfigItem * item); + /** * xkl_config_item_set_name: * @item: the XklConfigItem object to be changed @@ -142,6 +151,15 @@ extern "C" { extern void xkl_config_item_set_name(XklConfigItem * item, const gchar * name); +/** + * xkl_config_item_get_short_description: + * @item: the XklConfigItem object + * + * Returns: The @short_description field of a XklConfigItem. This is mostly useful for + * language bindings, in C you can manipulate the member directly. + */ +extern const gchar * xkl_config_item_get_short_description(XklConfigItem * item); + /** * xkl_config_item_set_short_description: * @item: the XklConfigItem object to be changed @@ -153,6 +171,15 @@ extern "C" { */ extern void xkl_config_item_set_short_description(XklConfigItem * item, const gchar * short_description); +/** + * xkl_config_item_get_description: + * @item: the XklConfigItem object + * + * Returns: The @description field of a XklConfigItem. This is mostly useful for + * language bindings, in C you can manipulate the member directly. + */ +extern const gchar * xkl_config_item_get_description(XklConfigItem * item); + /** * xkl_config_item_set_description: * @item: the XklConfigItem object to be changed diff --git a/libxklavier/xklavier_props.c b/libxklavier/xklavier_props.c index 8827200..95f38e2 100644 --- a/libxklavier/xklavier_props.c +++ b/libxklavier/xklavier_props.c @@ -54,6 +54,12 @@ xkl_config_item_new(void) (xkl_config_item_get_type(), NULL)); } +const gchar * +xkl_config_item_get_name(XklConfigItem * item) +{ + return item->name; +} + void xkl_config_item_set_name(XklConfigItem * item, const gchar * name) @@ -64,6 +70,12 @@ xkl_config_item_set_name(XklConfigItem * item, item->name[0] = '\0'; } +const gchar * +xkl_config_item_get_short_description(XklConfigItem * item) +{ + return item->short_description; +} + void xkl_config_item_set_short_description(XklConfigItem * item, const gchar * short_description) @@ -74,6 +86,12 @@ xkl_config_item_set_short_description(XklConfigItem * item, item->short_description[0] = '\0'; } +const gchar * +xkl_config_item_get_description(XklConfigItem * item) +{ + return item->description; +} + void xkl_config_item_set_description(XklConfigItem * item, const gchar * description) -- cgit v1.2.1