From 9588ed644799709a4e44b7f8f5e652fa9f19c3ad Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Wed, 11 Sep 2013 03:32:20 +0200 Subject: [PATCH] Made GsweCoordinates a boxed type --- src/gswe-moment.c | 25 +++++++++++++++++++++++++ src/gswe-moment.h | 3 +++ 2 files changed, 28 insertions(+) diff --git a/src/gswe-moment.c b/src/gswe-moment.c index a28fe26..b645679 100644 --- a/src/gswe-moment.c +++ b/src/gswe-moment.c @@ -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); +} + diff --git a/src/gswe-moment.h b/src/gswe-moment.h index a34168e..fc459d2 100644 --- a/src/gswe-moment.h +++ b/src/gswe-moment.h @@ -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__ */