From 6a2da690ea97a4941aa718d09b96f5d664a419e6 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Sat, 14 Sep 2013 17:37:33 +0200 Subject: [PATCH] Created ag_chart_new_full() instead of ag_chart_new() --- src/ag-chart.c | 19 +++++++++++++++++-- src/ag-chart.h | 2 +- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/ag-chart.c b/src/ag-chart.c index 9a42b44..092c0ab 100644 --- a/src/ag-chart.c +++ b/src/ag-chart.c @@ -21,8 +21,23 @@ ag_chart_init(AgChart *chart) } AgChart * -ag_chart_new(void) +ag_chart_new_full(GsweTimestamp *timestamp, gdouble longitude, gdouble latitude, gdouble altitude, GsweHouseSystem house_system) { - return NULL; + AgChart *ret; + GsweCoordinates *coords = g_new0(GsweCoordinates, 1); + + coords->longitude = longitude; + coords->latitude = latitude; + coords->altitude = altitude; + + ret = AG_CHART(g_object_new(AG_TYPE_CHART, + "timestamp", timestamp, + "coordinates", coords, + "house-system", house_system, + NULL)); + + g_free(coords); + + return ret; } diff --git a/src/ag-chart.h b/src/ag-chart.h index 4e4e38b..d41de89 100644 --- a/src/ag-chart.h +++ b/src/ag-chart.h @@ -27,7 +27,7 @@ struct _AgChartClass { }; GType ag_chart_get_type(void) G_GNUC_CONST; -AgChart *ag_chart_new(void); +AgChart *ag_chart_new_full(GsweTimestamp *timestamp, gdouble longitude, gdouble latitude, gdouble altitude, GsweHouseSystem house_system); void ag_chart_load_from_file(const gchar *path, GError **err); void ag_chart_save_to_file(const gchar *path, GError **err);