Add constructor ag_chart_new_preview()

It creates a new AgChart object with Sun as the only added planet.
This commit is contained in:
Gergely Polonkai 2014-09-27 22:38:59 +02:00
parent 2ed2718514
commit 02fcb0ad93
2 changed files with 33 additions and 0 deletions

View File

@ -308,6 +308,33 @@ ag_chart_new_full(GsweTimestamp *timestamp,
return chart; return chart;
} }
AgChart *
ag_chart_new_preview(GsweTimestamp *timestamp,
gdouble longitude,
gdouble latitude,
gdouble altitude,
GsweHouseSystem house_system)
{
static const GswePlanet planets[] = {
GSWE_PLANET_SUN,
GSWE_PLANET_ASCENDANT,
GSWE_PLANET_MC
};
static const gint planet_count = sizeof(planets) / sizeof(GswePlanet);
AgChart *chart = ag_chart_new_generic(
timestamp,
longitude,
latitude,
altitude,
house_system
);
ag_chart_add_planets(chart, planets, planet_count);
return chart;
}
void void
ag_chart_set_name(AgChart *chart, const gchar *name) ag_chart_set_name(AgChart *chart, const gchar *name)
{ {

View File

@ -79,6 +79,12 @@ AgChart *ag_chart_new_full(GsweTimestamp *timestamp,
gdouble altitude, gdouble altitude,
GsweHouseSystem house_system); GsweHouseSystem house_system);
AgChart *ag_chart_new_preview(GsweTimestamp *timestamp,
gdouble longitude,
gdouble latitude,
gdouble altitude,
GsweHouseSystem house_system);
AgChart *ag_chart_load_from_agc(GFile *file, AgChart *ag_chart_load_from_agc(GFile *file,
GError **err); GError **err);