1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
<!--
SPDX-FileCopyrightText: 2015 William Yu <williamyu@gnome.org>
SPDX-License-Identifier: LGPL-2.1-only OR MPL-2.0
-->
<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;
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">
<parameter type="gdouble" name="lat" comment="Latitude"/>
<parameter type="gdouble" name="lon" comment="Longitude"/>
<returns type="ICalGeo *" annotation="transfer full" comment="The newly created #ICalGeo." />
<comment xml:space="preserve">Creates a new #ICalGeo.</comment>
<custom> struct icalgeotype geo;
char dval[ICAL_GEO_LEN];
geo = i_cal_geo_new_default();
memset(dval, 0, ICAL_GEO_LEN);
snprintf(dval, ICAL_GEO_LEN, "%lf", lat);
strncpy(geo.lat, dval, ICAL_GEO_LEN-1);
memset(dval, 0, ICAL_GEO_LEN);
snprintf(dval, ICAL_GEO_LEN, "%lf", lon);
strncpy(geo.lon, dval, ICAL_GEO_LEN-1);
return i_cal_geo_new_full(geo);</custom>
</method>
<method name="i_cal_geo_clone" corresponds="CUSTOM" kind="clone" since="1.0">
<parameter type="const ICalGeo *" name="geo" comment="The #ICalGeo to clone"/>
<returns type="ICalGeo *" annotation="transfer full" comment="The newly created #ICalGeo, copy of @geo." />
<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((ICalGeo *)geo), NULL);
src = (struct icalgeotype *)i_cal_object_get_native((ICalObject *)geo);
g_return_val_if_fail(src != NULL, NULL);
return i_cal_geo_new_full(*src);</custom>
</method>
<method name="i_cal_geo_get_lat" corresponds="CUSTOM" kind="get" since="1.0">
<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 atof(((struct icalgeotype *)i_cal_object_get_native ((ICalObject *)geo))->lat);</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> char dval[ICAL_GEO_LEN];
g_return_if_fail (geo != NULL && I_CAL_IS_GEO (geo));
memset(dval, 0, ICAL_GEO_LEN);
snprintf(dval, ICAL_GEO_LEN, "%lf", lat);
strncpy(((struct icalgeotype *)i_cal_object_get_native ((ICalObject *)geo))->lat, dval, ICAL_GEO_LEN-1);</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 atof(((struct icalgeotype *)i_cal_object_get_native ((ICalObject *)geo))->lon);</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> char dval[ICAL_GEO_LEN];
g_return_if_fail (geo != NULL && I_CAL_IS_GEO (geo));
memset(dval, 0, ICAL_GEO_LEN);
snprintf(dval, ICAL_GEO_LEN, "%lf", lon);
strncpy(((struct icalgeotype *)i_cal_object_get_native ((ICalObject *)geo))->lon, dval, ICAL_GEO_LEN-1);</custom>
</method>
</structure>
|