2013-09-01 11:52:18 +00:00
|
|
|
#ifndef __GSWE_MOMENT_H__
|
|
|
|
#define __GSWE_MOMENT_H__
|
|
|
|
|
|
|
|
#include <glib-object.h>
|
|
|
|
|
2013-09-01 12:21:21 +00:00
|
|
|
#include "gswe-timestamp.h"
|
|
|
|
|
2013-09-01 11:52:18 +00:00
|
|
|
#define GSWE_TYPE_MOMENT (gswe_moment_get_type())
|
|
|
|
#define GSWE_MOMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GSWE_TYPE_MOMENT, GsweMoment))
|
|
|
|
#define GSWE_IS_MOMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GSWE_TYPE_MOMENT))
|
|
|
|
#define GSWE_MOMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GSWE_TYPE_MOMENT, GsweMomentClass))
|
|
|
|
#define GSWE_IS_MOMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GSWE_TYPE_MOMENT))
|
|
|
|
#define GSWE_MOMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GSWE_TYPE_MOMENT, GsweMomentClass))
|
|
|
|
|
|
|
|
typedef struct _GsweMoment GsweMoment;
|
|
|
|
typedef struct _GsweMomentClass GsweMomentClass;
|
|
|
|
typedef struct _GsweMomentPrivate GsweMomentPrivate;
|
|
|
|
|
|
|
|
#define GSWE_MOMENT_ERROR gswe_moment_error_quark()
|
|
|
|
GQuark gswe_moment_error_quark(void);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* GsweMomentError:
|
|
|
|
*
|
|
|
|
* Error values for GsweTimestamp initialization
|
|
|
|
*/
|
|
|
|
//typedef enum {
|
|
|
|
//} GsweMomentError;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GsweCoordinates:
|
|
|
|
* @longitude: longitude part of the coordinates
|
|
|
|
* @latitude: latitude part of the coordinates
|
2013-09-01 20:30:51 +00:00
|
|
|
* @altitude: altitude relative to sea level
|
2013-09-01 11:52:18 +00:00
|
|
|
*
|
|
|
|
* GsweCoordinates specifies an exact point on Earth's surface
|
|
|
|
*/
|
|
|
|
typedef struct _GsweCoordinates {
|
|
|
|
gdouble longitude;
|
|
|
|
gdouble latitude;
|
2013-09-01 20:30:51 +00:00
|
|
|
gdouble altitude;
|
2013-09-01 11:52:18 +00:00
|
|
|
} GsweCoordinates;
|
|
|
|
|
2013-09-02 14:19:45 +00:00
|
|
|
/**
|
|
|
|
* GswePlanetData:
|
|
|
|
* @planet_id: A GswePlanet, the identifier of the planet
|
|
|
|
* @planet_info: A GswePlanetInfo structure, holding every information about the planet
|
|
|
|
* @position: The longitude position of the planet
|
|
|
|
* @house: Number of the house in which the planet is in
|
|
|
|
* @sign: A GsweSignInfo structure, holding every information about the sign the planet is in
|
|
|
|
* @revision: An internal version number of the calculation
|
|
|
|
*/
|
|
|
|
typedef struct {
|
|
|
|
GswePlanet planet_id;
|
|
|
|
GswePlanetInfo *planet_info;
|
|
|
|
gdouble position;
|
|
|
|
gboolean retrograde;
|
|
|
|
gint house;
|
|
|
|
GsweSignInfo *sign;
|
|
|
|
guint revision;
|
|
|
|
} GswePlanetData;
|
|
|
|
|
2013-09-02 21:29:58 +00:00
|
|
|
typedef struct {
|
|
|
|
guint house;
|
|
|
|
gdouble cusp_position;
|
|
|
|
GsweSignInfo *sign;
|
|
|
|
} GsweHouseData;
|
|
|
|
|
2013-09-02 21:12:56 +00:00
|
|
|
typedef struct {
|
|
|
|
GsweMoonPhase phase;
|
|
|
|
gdouble illumination;
|
|
|
|
} GsweMoonPhaseData;
|
|
|
|
|
2013-09-01 11:52:18 +00:00
|
|
|
struct _GsweMoment {
|
|
|
|
/* Parent instance structure */
|
|
|
|
GObject parent_instance;
|
|
|
|
|
|
|
|
/* Instance members */
|
|
|
|
|
|
|
|
/*< private >*/
|
|
|
|
GsweMomentPrivate *priv;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _GsweMomentClass {
|
|
|
|
/* Parent class structure */
|
|
|
|
GObjectClass parent_class;
|
|
|
|
|
|
|
|
/* Class members */
|
|
|
|
|
|
|
|
/*< private >*/
|
2013-09-01 12:18:57 +00:00
|
|
|
void (*changed)(GsweMoment *moment);
|
2013-09-01 11:52:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* used by GSWE_TYPE_MOMENT */
|
|
|
|
GType gswe_moment_get_type(void);
|
|
|
|
|
|
|
|
/* Method definitions */
|
|
|
|
GsweMoment *gswe_moment_new(void);
|
2013-09-01 20:30:51 +00:00
|
|
|
GsweMoment *gswe_moment_new_full(GsweTimestamp *timestamp, gdouble longitude, gdouble latitude, gdouble altitude, GsweHouseSystem house_system);
|
2013-09-01 11:52:18 +00:00
|
|
|
void gswe_moment_set_timestamp(GsweMoment *moment, GsweTimestamp *timestamp);
|
2013-09-01 20:30:51 +00:00
|
|
|
GList *gswe_moment_get_house_cusps(GsweMoment *moment);
|
2013-09-02 14:19:45 +00:00
|
|
|
gint gswe_moment_get_house(GsweMoment *moment, gdouble position);
|
|
|
|
gboolean gswe_moment_has_planet(GsweMoment *moment, GswePlanet planet);
|
|
|
|
void gswe_moment_add_planet(GsweMoment *moment, GswePlanet planet);
|
|
|
|
void gswe_moment_add_all_planets(GsweMoment *moment);
|
|
|
|
GList *gswe_moment_get_planets(GsweMoment *moment);
|
|
|
|
GswePlanetData *gswe_moment_get_planet(GsweMoment *moment, GswePlanet planet);
|
2013-09-02 21:10:35 +00:00
|
|
|
guint gswe_moment_get_element_points(GsweMoment *moment, GsweElement element);
|
|
|
|
guint gswe_moment_get_quality_points(GsweMoment *moment, GsweQuality quality);
|
2013-09-02 21:12:56 +00:00
|
|
|
GsweMoonPhaseData *gswe_moment_get_moon_phase(GsweMoment *moment);
|
2013-09-01 11:52:18 +00:00
|
|
|
|
|
|
|
#endif /* __GSWE_MOMENT_H__ */
|
|
|
|
|