From 387b65c7928f8b24ba0437f56e9f9c001f619233 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Wed, 11 Sep 2013 03:41:42 +0200 Subject: [PATCH] Added gswe_moment_{set,get}_house_system() to the API --- src/gswe-moment.c | 28 ++++++++++++++++++++++++++++ src/gswe-moment.h | 2 ++ 2 files changed, 30 insertions(+) diff --git a/src/gswe-moment.c b/src/gswe-moment.c index 44b345e..85e51ee 100644 --- a/src/gswe-moment.c +++ b/src/gswe-moment.c @@ -283,6 +283,34 @@ gswe_moment_get_coordinates(GsweMoment *moment) return gswe_coordinates_copy(&(moment->priv->coordinates)); } +/** + * gswe_moment_set_house_system: + * @moment: a GsweMoment object + * @house_system: the new house system to associate with @moment + * + * Associates a new house system with @moment. Emits the ::changed signal. + * House cusp positions are recalculated upon next fetch. + */ +void +gswe_moment_set_house_system(GsweMoment *moment, GsweHouseSystem house_system) +{ + moment->priv->house_system = house_system; + moment->priv->revision++; + gswe_moment_emit_changed(moment); +} + +/** + * gswe_moment_get_house_system: + * @moment: a GsweMoment object + * + * Returns: The house system currently associated with @moment + */ +GsweHouseSystem +gswe_moment_get_house_system(GsweMoment *moment) +{ + return moment->priv->house_system; +} + /** * gswe_moment_error_quark: * diff --git a/src/gswe-moment.h b/src/gswe-moment.h index 1f727a8..d7309db 100644 --- a/src/gswe-moment.h +++ b/src/gswe-moment.h @@ -191,6 +191,8 @@ void gswe_moment_set_timestamp(GsweMoment *moment, GsweTimestamp *timestamp); GsweTimestamp *gswe_moment_get_timestamp(GsweMoment *moment); void gswe_moment_set_coordinates(GsweMoment *moment, gdouble longitude, gdouble latitude, gdouble altitude); GsweCoordinates *gswe_moment_get_coordinates(GsweMoment *moment); +void gswe_moment_set_house_system(GsweMoment *moment, GsweHouseSystem house_system); +GsweHouseSystem gswe_moment_get_house_system(GsweMoment *moment); GList *gswe_moment_get_house_cusps(GsweMoment *moment, GError **err); gint gswe_moment_get_house(GsweMoment *moment, gdouble position, GError **err); gboolean gswe_moment_has_planet(GsweMoment *moment, GswePlanet planet);