Made GsweMoonPhaseData and GswePlanetData boxed types
This is required for introspection to work correctly
This commit is contained in:
parent
3195fa266b
commit
da35567f71
@ -970,3 +970,54 @@ gswe_moment_get_mirror_planet_mirrorpoints(GsweMoment *moment, GsweMirror mirror
|
||||
return ret;
|
||||
}
|
||||
|
||||
static GsweMoonPhaseData *
|
||||
gswe_moon_phase_data_copy(GsweMoonPhaseData *moon_phase_data)
|
||||
{
|
||||
GsweMoonPhaseData *ret = g_new0(GsweMoonPhaseData, 1);
|
||||
|
||||
ret->phase = moon_phase_data->phase;
|
||||
ret->illumination = moon_phase_data->illumination;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
gswe_moon_phase_data_free(GsweMoonPhaseData *moon_phase_data)
|
||||
{
|
||||
g_free(moon_phase_data);
|
||||
}
|
||||
|
||||
GType
|
||||
gswe_moon_phase_data_get_type(void)
|
||||
{
|
||||
return g_boxed_type_register_static("GsweMoonPhaseData", (GBoxedCopyFunc)gswe_moon_phase_data_copy, (GBoxedFreeFunc)gswe_moon_phase_data_free);
|
||||
}
|
||||
|
||||
GswePlanetData *
|
||||
gswe_planet_data_copy(GswePlanetData *planet_data)
|
||||
{
|
||||
GswePlanetData *ret = g_new0(GswePlanetData, 1);
|
||||
|
||||
ret->planet_id = planet_data->planet_id;
|
||||
ret->planet_info = planet_data->planet_info;
|
||||
ret->position = planet_data->position;
|
||||
ret->retrograde = planet_data->retrograde;
|
||||
ret->house = planet_data->house;
|
||||
ret->sign = planet_data->sign;
|
||||
ret->revision = planet_data->revision;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
gswe_planet_data_free(GswePlanetData *planet_data)
|
||||
{
|
||||
g_free(planet_data);
|
||||
}
|
||||
|
||||
GType
|
||||
gswe_planet_data_get_type(void)
|
||||
{
|
||||
return g_boxed_type_register_static("GswePlanetData", (GBoxedCopyFunc)gswe_planet_data_copy, (GBoxedFreeFunc)gswe_planet_data_free);
|
||||
}
|
||||
|
||||
|
@ -169,5 +169,11 @@ GList *gswe_moment_get_all_planet_mirrorpoints(GsweMoment *moment, GswePlanet pl
|
||||
GList *gswe_moment_get_mirror_mirrorpoints(GsweMoment *moment, GsweMirror mirror);
|
||||
GList *gswe_moment_get_mirror_planet_mirrorpoints(GsweMoment *moment, GsweMirror mirror, GswePlanet planet);
|
||||
|
||||
GType gswe_moon_phase_data_get_type(void);
|
||||
#define GSWE_TYPE_MOON_PHASE_DATA (gswe_moon_phase_data_get_type())
|
||||
|
||||
GType gswe_planet_data_get_type(void);
|
||||
#define GSWE_TYPE_PLANET_DATA (gswe_planet_data_get_type());
|
||||
|
||||
#endif /* __GSWE_MOMENT_H__ */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user