2013-09-17 08:00:12 +00:00
|
|
|
#include <swe-glib.h>
|
|
|
|
|
2013-09-13 23:25:46 +00:00
|
|
|
#include "ag-chart.h"
|
|
|
|
|
|
|
|
struct _AgChartPrivate {
|
|
|
|
gchar *save_buffer;
|
|
|
|
};
|
|
|
|
|
|
|
|
G_DEFINE_TYPE(AgChart, ag_chart, GSWE_TYPE_MOMENT);
|
|
|
|
|
|
|
|
#define GET_PRIVATE(instance) (G_TYPE_INSTANCE_GET_PRIVATE((instance), AG_TYPE_CHART, AgChartPrivate))
|
|
|
|
|
|
|
|
static void
|
|
|
|
ag_chart_class_init(AgChartClass *klass)
|
|
|
|
{
|
|
|
|
g_type_class_add_private(klass, sizeof(AgChartPrivate));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
ag_chart_init(AgChart *chart)
|
|
|
|
{
|
|
|
|
chart->priv = GET_PRIVATE(chart);
|
|
|
|
}
|
|
|
|
|
|
|
|
AgChart *
|
2013-09-14 15:37:33 +00:00
|
|
|
ag_chart_new_full(GsweTimestamp *timestamp, gdouble longitude, gdouble latitude, gdouble altitude, GsweHouseSystem house_system)
|
2013-09-13 23:25:46 +00:00
|
|
|
{
|
2013-09-17 07:31:37 +00:00
|
|
|
AgChart *chart;
|
2013-09-14 15:37:33 +00:00
|
|
|
GsweCoordinates *coords = g_new0(GsweCoordinates, 1);
|
|
|
|
|
|
|
|
coords->longitude = longitude;
|
|
|
|
coords->latitude = latitude;
|
|
|
|
coords->altitude = altitude;
|
|
|
|
|
2013-09-17 07:31:37 +00:00
|
|
|
chart = AG_CHART(g_object_new(AG_TYPE_CHART,
|
2013-09-14 15:37:33 +00:00
|
|
|
"timestamp", timestamp,
|
|
|
|
"coordinates", coords,
|
|
|
|
"house-system", house_system,
|
|
|
|
NULL));
|
|
|
|
|
|
|
|
g_free(coords);
|
|
|
|
|
2013-09-17 08:00:12 +00:00
|
|
|
gswe_moment_add_all_planets(GSWE_MOMENT(chart));
|
|
|
|
|
2013-09-17 07:31:37 +00:00
|
|
|
return chart;
|
2013-09-13 23:25:46 +00:00
|
|
|
}
|
|
|
|
|