diff options
Diffstat (limited to 'src/libical-glib/api/i-cal-geo.xml')
-rw-r--r-- | src/libical-glib/api/i-cal-geo.xml | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/src/libical-glib/api/i-cal-geo.xml b/src/libical-glib/api/i-cal-geo.xml index cf647976..644f5edf 100644 --- a/src/libical-glib/api/i-cal-geo.xml +++ b/src/libical-glib/api/i-cal-geo.xml @@ -1,25 +1,17 @@ <!-- - Copyright (C) 2015 William Yu <williamyu@gnome.org> + SPDX-FileCopyrightText: 2015 William Yu <williamyu@gnome.org> - This library is free software: you can redistribute it and/or modify it - under the terms of version 2.1. of the GNU Lesser General Public License - as published by the Free Software Foundation. + SPDX-License-Identifier: LGPL-2.1-only OR MPL-2.0 - This library is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - for more details. - You should have received a copy of the GNU Lesser General Public License - along with this library. If not, see <https://www.gnu.org/licenses/>. --> <structure namespace="ICal" name="Geo" native="struct icalgeotype" is_bare="true" default_native="i_cal_geo_new_default ()"> <method name="i_cal_geo_new_default" corresponds="CUSTOM" annotation="skip" kind="private" since="1.0"> <returns type="struct icalgeotype" annotation="transfer full" comment="The newly created #ICalGeo" /> <comment xml:space="preserve">Creates a new default #ICalGeo.</comment> <custom> struct icalgeotype geotype; - geotype.lat = 0; - geotype.lon = 0; + memset(geotype.lat, 0, ICAL_GEO_LEN); + memset(geotype.lon, 0, ICAL_GEO_LEN); return geotype;</custom> </method> <method name="i_cal_geo_new" corresponds="CUSTOM" kind="constructor" since="1.0"> @@ -28,10 +20,9 @@ <returns type="ICalGeo *" annotation="transfer full" comment="The newly created #ICalGeo." /> <comment xml:space="preserve">Creates a new #ICalGeo.</comment> <custom> struct icalgeotype geo; - geo = i_cal_geo_new_default(); - geo.lat = lat; - geo.lon = lon; + g_ascii_dtostr(geo.lat, ICAL_GEO_LEN, lat); + g_ascii_dtostr(geo.lon, ICAL_GEO_LEN, lon); return i_cal_geo_new_full(geo);</custom> </method> @@ -41,7 +32,7 @@ <comment xml:space="preserve">Creates a new #ICalGeo, copy of @geo.</comment> <custom> struct icalgeotype *src; - g_return_val_if_fail(I_CAL_IS_GEO(geo), NULL); + g_return_val_if_fail(I_CAL_IS_GEO((ICalGeo *)geo), NULL); src = (struct icalgeotype *)i_cal_object_get_native((ICalObject *)geo); g_return_val_if_fail(src != NULL, NULL); @@ -52,28 +43,36 @@ <parameter type="ICalGeo *" name="geo" comment="The #ICalGeo to be queried"/> <returns type="gdouble" comment="The latitude." /> <comment xml:space="preserve">Gets the latitude of #ICalGeo.</comment> - <custom> g_return_val_if_fail (geo != NULL, 0); - return ((struct icalgeotype *)i_cal_object_get_native ((ICalObject *)geo))->lat;</custom> + <custom> struct icalgeotype *native; + g_return_val_if_fail (geo != NULL, 0); + native = (struct icalgeotype *)i_cal_object_get_native ((ICalObject *)geo); + return g_ascii_strtod(native->lat, NULL);</custom> </method> <method name="i_cal_geo_set_lat" corresponds="CUSTOM" kind="set" since="1.0"> <parameter type="ICalGeo *" name="geo" comment="The #ICalGeo to be set"/> <parameter type="gdouble" name="lat" comment="The latitude"/> <comment>Sets the latitude of #ICalGeo.</comment> - <custom> g_return_if_fail (geo != NULL && I_CAL_IS_GEO (geo)); - ((struct icalgeotype *)i_cal_object_get_native ((ICalObject *)geo))->lat = lat;</custom> + <custom> struct icalgeotype *native; + g_return_if_fail (geo != NULL && I_CAL_IS_GEO (geo)); + native = (struct icalgeotype *)i_cal_object_get_native ((ICalObject *)geo); + g_ascii_dtostr(native->lat, ICAL_GEO_LEN, lat);</custom> </method> <method name="i_cal_geo_get_lon" corresponds="CUSTOM" kind="get" since="1.0"> <parameter type="ICalGeo *" name="geo" comment="The #ICalGeo to be queried"/> <returns type="gdouble" comment="The longitude." /> <comment xml:space="preserve">Gets the longitude of #ICalGeo.</comment> - <custom> g_return_val_if_fail (geo != NULL, 0); - return ((struct icalgeotype *)i_cal_object_get_native ((ICalObject *)geo))->lon;</custom> + <custom> struct icalgeotype *native; + g_return_val_if_fail (geo != NULL, 0); + native = (struct icalgeotype *)i_cal_object_get_native ((ICalObject *)geo); + return g_ascii_strtod(native->lon, NULL);</custom> </method> <method name="i_cal_geo_set_lon" corresponds="CUSTOM" kind="set" since="1.0"> <parameter type="ICalGeo *" name="geo" comment="The #ICalGeo to be set"/> <parameter type="gdouble" name="lon" comment="The longitude"/> <comment>Sets the longitude of #ICalGeo.</comment> - <custom> g_return_if_fail (geo != NULL && I_CAL_IS_GEO (geo)); - ((struct icalgeotype *)i_cal_object_get_native ((ICalObject *)geo))->lon = lon;</custom> + <custom> struct icalgeotype *native; + g_return_if_fail (geo != NULL && I_CAL_IS_GEO (geo)); + native = (struct icalgeotype *)i_cal_object_get_native ((ICalObject *)geo); + g_ascii_dtostr(native->lon, ICAL_GEO_LEN, lon);</custom> </method> </structure> |