2014-09-26 13:01:19 +00:00
|
|
|
/* ag-chart.h - Chart manipulation object for Astrognome
|
|
|
|
*
|
|
|
|
* Copyright (C) 2014 Polonkai Gergely
|
|
|
|
*
|
|
|
|
* Astrognome is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published
|
|
|
|
* by the Free Software Foundation; either version 3 of the License,
|
|
|
|
* or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Astrognome is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this software; if not, see
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2013-09-13 23:25:46 +00:00
|
|
|
#ifndef __AG_CHART_H__
|
|
|
|
#define __AG_CHART_H__
|
|
|
|
|
|
|
|
#include <glib-object.h>
|
2014-07-21 21:36:09 +00:00
|
|
|
#include <gtk/gtk.h>
|
2013-09-13 23:25:46 +00:00
|
|
|
#include <swe-glib.h>
|
2014-09-27 22:38:56 +00:00
|
|
|
#include <gdk-pixbuf/gdk-pixbuf.h>
|
2013-09-13 23:25:46 +00:00
|
|
|
|
2014-07-30 22:37:17 +00:00
|
|
|
#include "ag-db.h"
|
2014-09-21 21:00:45 +00:00
|
|
|
#include "ag-display-theme.h"
|
2014-07-30 22:37:17 +00:00
|
|
|
|
2014-09-27 20:18:34 +00:00
|
|
|
#define AG_CHART_DEFAULT_RING_SIZE 600
|
|
|
|
#define AG_CHART_DEFAULT_ICON_SIZE 30
|
|
|
|
|
2013-09-13 23:25:46 +00:00
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2013-09-18 08:02:23 +00:00
|
|
|
typedef enum {
|
|
|
|
AG_CHART_ERROR_LIBXML,
|
|
|
|
AG_CHART_ERROR_CORRUPT_FILE,
|
2014-07-30 22:37:17 +00:00
|
|
|
AG_CHART_ERROR_EMPTY_RECORD,
|
|
|
|
AG_CHART_ERROR_INVALID_HOUSE_SYSTEM,
|
2014-08-10 11:54:51 +00:00
|
|
|
AG_CHART_ERROR_NOT_IMPLEMENTED,
|
|
|
|
AG_CHART_ERROR_INVALID_PLAC_FILE,
|
|
|
|
AG_CHART_ERROR_UNSUPPORTED_PLAC_FILE,
|
2014-09-17 09:22:49 +00:00
|
|
|
AG_CHART_ERROR_RENDERING_ERROR,
|
2013-09-18 08:02:23 +00:00
|
|
|
} AgChartError;
|
|
|
|
|
2013-09-13 23:25:46 +00:00
|
|
|
#define AG_TYPE_CHART (ag_chart_get_type())
|
2014-07-11 08:33:04 +00:00
|
|
|
#define AG_CHART(o) (G_TYPE_CHECK_INSTANCE_CAST((o), \
|
|
|
|
AG_TYPE_CHART, \
|
|
|
|
AgChart))
|
|
|
|
#define AG_CHART_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), \
|
|
|
|
AG_TYPE_CHART, \
|
|
|
|
AgChartClass))
|
2013-09-13 23:25:46 +00:00
|
|
|
#define AG_IS_CHART(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), AG_TYPE_CHART))
|
|
|
|
#define AG_IS_CHART_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), AG_TYPE_CHART))
|
2014-07-11 08:33:04 +00:00
|
|
|
#define AG_CHART_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), \
|
|
|
|
AG_TYPE_CHART, \
|
|
|
|
AgChartClass))
|
2013-09-13 23:25:46 +00:00
|
|
|
|
2013-09-21 16:37:27 +00:00
|
|
|
typedef struct _AgChart AgChart;
|
|
|
|
typedef struct _AgChartClass AgChartClass;
|
2013-09-13 23:25:46 +00:00
|
|
|
|
|
|
|
struct _AgChart {
|
2013-09-21 16:37:27 +00:00
|
|
|
GsweMoment parent_instance;
|
2013-09-13 23:25:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _AgChartClass {
|
|
|
|
GsweMomentClass parent_class;
|
|
|
|
};
|
|
|
|
|
2014-09-27 20:18:34 +00:00
|
|
|
typedef void (*AgChartSaveImageFunc)(AgChart *,
|
|
|
|
GFile *,
|
|
|
|
AgDisplayTheme *,
|
|
|
|
GError **);
|
2014-09-17 08:38:00 +00:00
|
|
|
|
2013-09-13 23:25:46 +00:00
|
|
|
GType ag_chart_get_type(void) G_GNUC_CONST;
|
2014-07-21 21:38:22 +00:00
|
|
|
|
2013-09-21 16:37:27 +00:00
|
|
|
AgChart *ag_chart_new_full(GsweTimestamp *timestamp,
|
|
|
|
gdouble longitude,
|
|
|
|
gdouble latitude,
|
|
|
|
gdouble altitude,
|
|
|
|
GsweHouseSystem house_system);
|
2014-07-21 21:38:22 +00:00
|
|
|
|
2014-09-27 20:38:59 +00:00
|
|
|
AgChart *ag_chart_new_preview(GsweTimestamp *timestamp,
|
|
|
|
gdouble longitude,
|
|
|
|
gdouble latitude,
|
|
|
|
gdouble altitude,
|
|
|
|
GsweHouseSystem house_system);
|
|
|
|
|
2014-08-10 08:15:04 +00:00
|
|
|
AgChart *ag_chart_load_from_agc(GFile *file,
|
|
|
|
GError **err);
|
2014-07-21 21:38:22 +00:00
|
|
|
|
2014-08-10 11:54:51 +00:00
|
|
|
AgChart *ag_chart_load_from_placidus_file(GFile *file,
|
|
|
|
GError **err);
|
|
|
|
|
2014-09-27 22:35:17 +00:00
|
|
|
AgChart *ag_chart_new_from_db_save(AgDbChartSave *save_data,
|
|
|
|
gboolean preview,
|
|
|
|
GError **err);
|
2014-07-30 22:37:17 +00:00
|
|
|
|
2013-09-21 16:37:27 +00:00
|
|
|
void ag_chart_save_to_file(AgChart *chart,
|
|
|
|
GFile *file,
|
|
|
|
GError **err);
|
2013-09-13 23:25:46 +00:00
|
|
|
|
2014-09-21 21:00:45 +00:00
|
|
|
void ag_chart_export_svg_to_file(AgChart *chart,
|
|
|
|
GFile *file,
|
|
|
|
AgDisplayTheme *theme,
|
|
|
|
GError **err);
|
2014-09-17 09:22:49 +00:00
|
|
|
|
2014-09-21 21:00:45 +00:00
|
|
|
void ag_chart_export_jpg_to_file(AgChart *chart,
|
|
|
|
GFile *file,
|
|
|
|
AgDisplayTheme *theme,
|
|
|
|
GError **err);
|
2014-06-27 14:52:52 +00:00
|
|
|
|
2014-10-05 17:36:44 +00:00
|
|
|
void ag_chart_export_png_to_file(AgChart *chart,
|
|
|
|
GFile *file,
|
|
|
|
AgDisplayTheme *theme,
|
|
|
|
GError **err);
|
|
|
|
|
2013-09-21 16:37:27 +00:00
|
|
|
void ag_chart_set_name(AgChart *chart,
|
|
|
|
const gchar *name);
|
2014-07-21 21:38:22 +00:00
|
|
|
|
2014-08-26 11:19:17 +00:00
|
|
|
const gchar *ag_chart_get_name(AgChart *chart);
|
2014-07-21 21:38:22 +00:00
|
|
|
|
2013-09-21 16:37:27 +00:00
|
|
|
void ag_chart_set_country(AgChart *chart,
|
|
|
|
const gchar *country);
|
2014-07-21 21:38:22 +00:00
|
|
|
|
2014-08-26 11:19:17 +00:00
|
|
|
const gchar *ag_chart_get_country(AgChart *chart);
|
2014-07-21 21:38:22 +00:00
|
|
|
|
2013-09-21 16:37:27 +00:00
|
|
|
void ag_chart_set_city(AgChart *chart,
|
|
|
|
const gchar *city);
|
2014-07-21 21:38:22 +00:00
|
|
|
|
2014-08-26 11:19:17 +00:00
|
|
|
const gchar *ag_chart_get_city(AgChart *chart);
|
2014-07-21 21:38:22 +00:00
|
|
|
|
2014-09-21 21:00:45 +00:00
|
|
|
gchar *ag_chart_create_svg(AgChart *chart,
|
|
|
|
gsize *length,
|
|
|
|
gboolean rendering,
|
|
|
|
AgDisplayTheme *theme,
|
2014-09-27 20:21:50 +00:00
|
|
|
guint image_size,
|
2014-09-27 22:38:20 +00:00
|
|
|
guint icon_size,
|
2014-09-21 21:00:45 +00:00
|
|
|
GError **err);
|
2014-07-21 21:38:22 +00:00
|
|
|
|
2014-06-15 08:00:07 +00:00
|
|
|
GList *ag_chart_get_planets(AgChart *chart);
|
2014-07-21 21:38:22 +00:00
|
|
|
|
2014-07-08 22:38:04 +00:00
|
|
|
void ag_chart_set_note(AgChart *chart, const gchar *note);
|
2014-07-21 21:38:22 +00:00
|
|
|
|
2014-07-08 22:38:04 +00:00
|
|
|
const gchar *ag_chart_get_note(AgChart *chart);
|
2013-09-17 20:18:24 +00:00
|
|
|
|
2014-10-01 21:42:25 +00:00
|
|
|
AgDbChartSave *ag_chart_get_db_save(AgChart *chart);
|
2014-07-21 21:36:09 +00:00
|
|
|
|
2014-09-27 22:38:56 +00:00
|
|
|
GdkPixbuf *ag_chart_get_pixbuf(AgChart *chart,
|
|
|
|
guint image_size,
|
|
|
|
guint icon_size,
|
|
|
|
AgDisplayTheme *theme,
|
|
|
|
GError **err);
|
|
|
|
|
2014-10-01 21:21:38 +00:00
|
|
|
void ag_chart_set_db_id(AgChart *chart, gint db_id);
|
|
|
|
|
|
|
|
gint ag_chart_get_db_id(AgChart *chart);
|
|
|
|
|
2013-09-18 08:02:23 +00:00
|
|
|
#define AG_CHART_ERROR (ag_chart_error_quark())
|
|
|
|
GQuark ag_chart_error_quark(void);
|
|
|
|
|
2013-09-13 23:25:46 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __AG_CHART_H__ */
|
|
|
|
|