Made GsweCoordinates a boxed type

This commit is contained in:
Gergely Polonkai 2013-09-11 03:32:20 +02:00
parent cfd9c1a983
commit 9588ed6447
2 changed files with 28 additions and 0 deletions

View File

@ -1095,3 +1095,28 @@ gswe_planet_data_get_type(void)
return g_boxed_type_register_static("GswePlanetData", (GBoxedCopyFunc)gswe_planet_data_copy, (GBoxedFreeFunc)g_free);
}
static GsweCoordinates *
gswe_coordinates_copy(GsweCoordinates *coordinates)
{
GsweCoordinates *ret = g_new0(GsweCoordinates, 1);
ret->longitude = coordinates->longitude;
ret->latitude = coordinates->latitude;
ret->altitude = coordinates->altitude;
return ret;
}
/**
* gswe_coordinates_get_type:
*
* Register the #Gswecoordinates struct as a #GBoxedType. It is required for GObject Introspection. You should never need to call this directly.
*
* Returns: the newly registered type ID
*/
GType
gswe_coordinates_get_type(void)
{
return g_boxed_type_register_static("GsweCoordinates", (GBoxedCopyFunc)gswe_coordinates_copy, (GBoxedFreeFunc)g_free);
}

View File

@ -212,5 +212,8 @@ GType gswe_moon_phase_data_get_type(void);
GType gswe_planet_data_get_type(void);
#define GSWE_TYPE_PLANET_DATA (gswe_planet_data_get_type())
GType gswe_coordinates_get_type(void);
#define GSWE_TYPE_COORDINATES (gswe_coordinates_get_type())
#endif /* __GSWE_MOMENT_H__ */