Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
ae3393133a | |||
903beaf2c2 | |||
e3a6e25bda | |||
6566e5356a | |||
cef7815268 | |||
12c08c865d | |||
2116c8103a | |||
8cd8cd67e2 | |||
f2bc764f87 | |||
b394e31f0a |
7
.gitignore
vendored
7
.gitignore
vendored
@@ -83,11 +83,12 @@ Makefile.in
|
|||||||
/intltool-update.in
|
/intltool-update.in
|
||||||
|
|
||||||
# SWE-GLib related files
|
# SWE-GLib related files
|
||||||
src/gswe-enumtypes.c
|
/src/gswe-enumtypes.c
|
||||||
src/gswe-enumtypes.h
|
/src/gswe-enumtypes.h
|
||||||
src/gswetest
|
/src/gswetest
|
||||||
/data/swe-glib.pc
|
/data/swe-glib.pc
|
||||||
/data/swe-glib.spec
|
/data/swe-glib.spec
|
||||||
|
/src/*.vapi
|
||||||
|
|
||||||
# Documentation related files
|
# Documentation related files
|
||||||
/docs/reference/*/*.args
|
/docs/reference/*/*.args
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
m4_define([swe_glib_major_version], [2])
|
m4_define([swe_glib_major_version], [2])
|
||||||
m4_define([swe_glib_minor_version], [0])
|
m4_define([swe_glib_minor_version], [0])
|
||||||
m4_define([swe_glib_micro_version], [0])
|
m4_define([swe_glib_micro_version], [3])
|
||||||
m4_define([swe_glib_version], [swe_glib_major_version.swe_glib_minor_version.swe_glib_micro_version])
|
m4_define([swe_glib_version], [swe_glib_major_version.swe_glib_minor_version.swe_glib_micro_version])
|
||||||
m4_define([swe_glib_api_version], [swe_glib_major_version.0])
|
m4_define([swe_glib_api_version], [swe_glib_major_version.0])
|
||||||
|
|
||||||
@@ -45,6 +45,12 @@ GTK_DOC_CHECK([1.19], [--flavour no-tmpl])
|
|||||||
AM_CONDITIONAL([ENABLE_GTK_DOC], false)
|
AM_CONDITIONAL([ENABLE_GTK_DOC], false)
|
||||||
])
|
])
|
||||||
GOBJECT_INTROSPECTION_CHECK([1.0])
|
GOBJECT_INTROSPECTION_CHECK([1.0])
|
||||||
|
m4_ifdef([VALA_PROG_VAPIGEN], [
|
||||||
|
VALA_PROG_VAPIGEN([0.21])
|
||||||
|
AM_CONDITIONAL([HAVE_VAPIGEN], true)
|
||||||
|
],[
|
||||||
|
AM_CONDITIONAL([HAVE_VAPIGEN], false)
|
||||||
|
])
|
||||||
PKG_PROG_PKG_CONFIG
|
PKG_PROG_PKG_CONFIG
|
||||||
AC_PATH_PROG([GLIB_MKENUMS], [glib-mkenums])
|
AC_PATH_PROG([GLIB_MKENUMS], [glib-mkenums])
|
||||||
AC_CANONICAL_HOST
|
AC_CANONICAL_HOST
|
||||||
|
@@ -6,7 +6,7 @@ Summary: A GLib style wrapper library around the Swiss Ephemeris library, create
|
|||||||
Group: Development/Libraries
|
Group: Development/Libraries
|
||||||
License: LGPLv3+
|
License: LGPLv3+
|
||||||
URL: http://gergely.polonkai.eu/swe-glib/
|
URL: http://gergely.polonkai.eu/swe-glib/
|
||||||
Source: https://github.com/gergelypolonkai/%{name}/archive/v%{version}.tar.gz
|
Source: http://gergely.polonkai.eu/download/%{name}-%{version}.tar.gz
|
||||||
|
|
||||||
BuildRequires: pkgconfig
|
BuildRequires: pkgconfig
|
||||||
BuildRequires: glib2-devel
|
BuildRequires: glib2-devel
|
||||||
@@ -86,6 +86,7 @@ rm -f $RPM_BUILD_ROOT%{_datadir}/locale/hu/LC_MESSAGES/swe-glib.mo
|
|||||||
%{_datadir}/gir-1.0/SweGlib-@SWE_GLIB_API_VERSION@.gir
|
%{_datadir}/gir-1.0/SweGlib-@SWE_GLIB_API_VERSION@.gir
|
||||||
%{_libdir}/libswe-1.76.so
|
%{_libdir}/libswe-1.76.so
|
||||||
%{_libdir}/libswe-glib-@SWE_GLIB_API_VERSION@.so
|
%{_libdir}/libswe-glib-@SWE_GLIB_API_VERSION@.so
|
||||||
|
%{_datadir}/vala/vapi/SweGlib-@SWE_GLIB_API_VERSION@.vapi
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
|
||||||
|
@@ -25,10 +25,12 @@ gswe_moment_get_quality_points
|
|||||||
gswe_moment_get_moon_phase
|
gswe_moment_get_moon_phase
|
||||||
gswe_moment_get_all_aspects
|
gswe_moment_get_all_aspects
|
||||||
gswe_moment_get_planet_aspects
|
gswe_moment_get_planet_aspects
|
||||||
|
gswe_moment_get_aspect_by_planets
|
||||||
gswe_moment_get_all_antiscia
|
gswe_moment_get_all_antiscia
|
||||||
gswe_moment_get_all_planet_antiscia
|
gswe_moment_get_all_planet_antiscia
|
||||||
gswe_moment_get_axis_all_antiscia
|
gswe_moment_get_axis_all_antiscia
|
||||||
gswe_moment_get_axis_planet_antiscia
|
gswe_moment_get_axis_planet_antiscia
|
||||||
|
gswe_moment_get_antiscion_by_planets
|
||||||
<SUBSECTION Standard>
|
<SUBSECTION Standard>
|
||||||
GSWE_IS_MOMENT
|
GSWE_IS_MOMENT
|
||||||
GSWE_IS_MOMENT_CLASS
|
GSWE_IS_MOMENT_CLASS
|
||||||
|
@@ -59,6 +59,8 @@ libswe_glib_2_0_la_SOURCES = \
|
|||||||
|
|
||||||
libswe_glib_2_0_la_CFLAGS = $(GLIB_CFLAGS) $(GOBJECT_CFLAGS) -Wall
|
libswe_glib_2_0_la_CFLAGS = $(GLIB_CFLAGS) $(GOBJECT_CFLAGS) -Wall
|
||||||
libswe_glib_2_0_la_LIBADD = $(GLIB_LIBS) $(GOBJECT_LIBS) $(LIBSWE_LIBS)
|
libswe_glib_2_0_la_LIBADD = $(GLIB_LIBS) $(GOBJECT_LIBS) $(LIBSWE_LIBS)
|
||||||
|
libswe_glib_2_0_la_DEPENDENCIES = \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
BUILT_SOURCES = gswe-enumtypes.c gswe-enumtypes.h
|
BUILT_SOURCES = gswe-enumtypes.c gswe-enumtypes.h
|
||||||
|
|
||||||
@@ -74,6 +76,9 @@ gswe-enumtypes.c: $(gswe_enum_headers) gswe-enumtypes.h gswe-enumtypes.c.templat
|
|||||||
$(GLIB_MKENUMS) --template $(filter %.template,$^) $(filter-out %.template,$^) > \
|
$(GLIB_MKENUMS) --template $(filter %.template,$^) $(filter-out %.template,$^) > \
|
||||||
gswe-enumtypes.c.tmp && mv gswe-enumtypes.c.tmp gswe-enumtypes.c
|
gswe-enumtypes.c.tmp && mv gswe-enumtypes.c.tmp gswe-enumtypes.c
|
||||||
|
|
||||||
|
SweGlib-2.0.vapi: SweGlib-$(SWE_GLIB_API_VERSION).gir
|
||||||
|
$(AM_V_GEN)$(VAPIGEN) --library=SweGlib-2.0 SweGlib-2.0.gir
|
||||||
|
|
||||||
if HAVE_INTROSPECTION
|
if HAVE_INTROSPECTION
|
||||||
|
|
||||||
include $(INTROSPECTION_MAKEFILE)
|
include $(INTROSPECTION_MAKEFILE)
|
||||||
@@ -100,4 +105,9 @@ header_DATA = \
|
|||||||
|
|
||||||
CLEANFILES += $(gir_DATA) $(typelibs_DATA)
|
CLEANFILES += $(gir_DATA) $(typelibs_DATA)
|
||||||
|
|
||||||
|
if HAVE_VAPIGEN
|
||||||
|
vapidir = $(datadir)/vala/vapi
|
||||||
|
vapi_DATA = SweGlib-$(SWE_GLIB_API_VERSION).vapi
|
||||||
|
endif
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
@@ -883,7 +883,14 @@ gswe_moment_get_house(GsweMoment *moment, gdouble position, GError **err)
|
|||||||
GswePlanetData *
|
GswePlanetData *
|
||||||
gswe_moment_get_planet(GsweMoment *moment, GswePlanet planet, GError **err)
|
gswe_moment_get_planet(GsweMoment *moment, GswePlanet planet, GError **err)
|
||||||
{
|
{
|
||||||
GswePlanetData *planet_data = (GswePlanetData *)(g_list_find_custom(moment->priv->planet_list, &planet, (GCompareFunc)find_planet_by_id)->data);
|
GList *planet_element;
|
||||||
|
GswePlanetData *planet_data;
|
||||||
|
|
||||||
|
if ((planet_element = g_list_find_custom(moment->priv->planet_list, &planet, (GCompareFunc)find_planet_by_id)) == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
planet_data = (GswePlanetData *)(planet_element->data);
|
||||||
|
|
||||||
if (planet_data == NULL) {
|
if (planet_data == NULL) {
|
||||||
g_set_error(err, GSWE_ERROR, GSWE_ERROR_UNKNOWN_PLANET, "Specified planet is not added to the moment object");
|
g_set_error(err, GSWE_ERROR, GSWE_ERROR_UNKNOWN_PLANET, "Specified planet is not added to the moment object");
|
||||||
@@ -1114,6 +1121,43 @@ gswe_moment_get_planet_aspects(GsweMoment *moment, GswePlanet planet, GError **e
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gswe_moment_get_aspect_by_planets:
|
||||||
|
* @moment: the GsweMoment to operate on
|
||||||
|
* @planet1: the first planet
|
||||||
|
* @planet2: the second planet
|
||||||
|
* @err: a #GError
|
||||||
|
*
|
||||||
|
* Get the aspect between two given planets. The order of @planet1 and @planet2
|
||||||
|
* doesn’t matter.
|
||||||
|
*
|
||||||
|
* Returns: (transfer none): a #GsweAspectData containing the aspect data of the
|
||||||
|
* two planets. If an error occurs, like when one of the planets are
|
||||||
|
* not added to the planet list, returns NULL, and @err is set
|
||||||
|
* accordingly.
|
||||||
|
*/
|
||||||
|
GsweAspectData *
|
||||||
|
gswe_moment_get_aspect_by_planets(GsweMoment *moment, GswePlanet planet1, GswePlanet planet2, GError **err)
|
||||||
|
{
|
||||||
|
struct GsweAspectFinder aspect_finder;
|
||||||
|
GList *aspect_data_element;
|
||||||
|
|
||||||
|
if (!gswe_moment_has_planet(moment, planet1) || !gswe_moment_has_planet(moment, planet2)) {
|
||||||
|
g_set_error(err, GSWE_ERROR, GSWE_ERROR_UNKNOWN_PLANET, "One of the requested planets is not found in the planet list");
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
aspect_finder.planet1 = planet1;
|
||||||
|
aspect_finder.planet2 = planet2;
|
||||||
|
|
||||||
|
if ((aspect_data_element = g_list_find_custom(moment->priv->aspect_list, &aspect_finder, (GCompareFunc)find_aspect_by_both_planets)) != NULL) {
|
||||||
|
return aspect_data_element->data;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static gint
|
static gint
|
||||||
find_antiscion_by_both_planets(GsweAntiscionData *antiscion, struct GsweAspectFinder *antiscion_finder)
|
find_antiscion_by_both_planets(GsweAntiscionData *antiscion, struct GsweAspectFinder *antiscion_finder)
|
||||||
{
|
{
|
||||||
@@ -1307,3 +1351,40 @@ gswe_moment_get_axis_planet_antiscia(GsweMoment *moment, GsweAntiscionAxis axis,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gswe_moment_get_antiscion_by_planets:
|
||||||
|
* @moment: the GsweMoment to operate on
|
||||||
|
* @planet1: the first planet
|
||||||
|
* @planet2: the second planet
|
||||||
|
* @err: a #GError
|
||||||
|
*
|
||||||
|
* Get the aspect between two given planets. The order of @planet1 and @planet2
|
||||||
|
* doesn’t matter.
|
||||||
|
*
|
||||||
|
* Returns: (transfer none): a #GsweAspectData containing the aspect data of the
|
||||||
|
* two planets. If an error occurs, like when one of the planets are
|
||||||
|
* not added to the planet list, returns NULL, and @err is set
|
||||||
|
* accordingly.
|
||||||
|
*/
|
||||||
|
GsweAntiscionData *
|
||||||
|
gswe_moment_get_antiscion_by_planets(GsweMoment *moment, GswePlanet planet1, GswePlanet planet2, GError **err)
|
||||||
|
{
|
||||||
|
struct GsweAspectFinder antiscion_finder;
|
||||||
|
GList *antiscion_data_element;
|
||||||
|
|
||||||
|
if (!gswe_moment_has_planet(moment, planet1) || !gswe_moment_has_planet(moment, planet2)) {
|
||||||
|
g_set_error(err, GSWE_ERROR, GSWE_ERROR_UNKNOWN_PLANET, "One of the planets is not found in the planet list");
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
antiscion_finder.planet1 = planet1;
|
||||||
|
antiscion_finder.planet2 = planet2;
|
||||||
|
|
||||||
|
if ((antiscion_data_element = g_list_find_custom(moment->priv->antiscia_list, &antiscion_finder, (GCompareFunc)find_antiscion_by_both_planets)) != NULL) {
|
||||||
|
return antiscion_data_element->data;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -119,11 +119,13 @@ GsweMoonPhaseData *gswe_moment_get_moon_phase(GsweMoment *moment, GError **err);
|
|||||||
|
|
||||||
GList *gswe_moment_get_all_aspects(GsweMoment *moment);
|
GList *gswe_moment_get_all_aspects(GsweMoment *moment);
|
||||||
GList *gswe_moment_get_planet_aspects(GsweMoment *moment, GswePlanet planet, GError **err);
|
GList *gswe_moment_get_planet_aspects(GsweMoment *moment, GswePlanet planet, GError **err);
|
||||||
|
GsweAspectData *gswe_moment_get_aspect_by_planets(GsweMoment *moment, GswePlanet planet1, GswePlanet planet2, GError **err);
|
||||||
|
|
||||||
GList *gswe_moment_get_all_antiscia(GsweMoment *moment);
|
GList *gswe_moment_get_all_antiscia(GsweMoment *moment);
|
||||||
GList *gswe_moment_get_all_planet_antiscia(GsweMoment *moment, GswePlanet planet, GError **err);
|
GList *gswe_moment_get_all_planet_antiscia(GsweMoment *moment, GswePlanet planet, GError **err);
|
||||||
GList *gswe_moment_get_axis_all_antiscia(GsweMoment *moment, GsweAntiscionAxis axis);
|
GList *gswe_moment_get_axis_all_antiscia(GsweMoment *moment, GsweAntiscionAxis axis);
|
||||||
GList *gswe_moment_get_axis_planet_antiscia(GsweMoment *moment, GsweAntiscionAxis axis, GswePlanet planet, GError **err);
|
GList *gswe_moment_get_axis_planet_antiscia(GsweMoment *moment, GsweAntiscionAxis axis, GswePlanet planet, GError **err);
|
||||||
|
GsweAntiscionData *gswe_moment_get_antiscion_by_planets(GsweMoment *moment, GswePlanet planet1, GswePlanet planet2, GError **err);
|
||||||
|
|
||||||
#endif /* __GSWE_MOMENT_H__ */
|
#endif /* __GSWE_MOMENT_H__ */
|
||||||
|
|
||||||
|
@@ -138,6 +138,10 @@ gswe_planet_data_set_planet(GswePlanetData *planet_data, GswePlanet planet, GErr
|
|||||||
GswePlanet
|
GswePlanet
|
||||||
gswe_planet_data_get_planet(GswePlanetData *planet_data)
|
gswe_planet_data_get_planet(GswePlanetData *planet_data)
|
||||||
{
|
{
|
||||||
|
if (planet_data == NULL) {
|
||||||
|
return GSWE_PLANET_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
if (planet_data->planet_info) {
|
if (planet_data->planet_info) {
|
||||||
return planet_data->planet_info->planet;
|
return planet_data->planet_info->planet;
|
||||||
} else {
|
} else {
|
||||||
@@ -155,6 +159,10 @@ gswe_planet_data_get_planet(GswePlanetData *planet_data)
|
|||||||
void
|
void
|
||||||
gswe_planet_data_set_planet_info(GswePlanetData *planet_data, GswePlanetInfo *planet_info)
|
gswe_planet_data_set_planet_info(GswePlanetData *planet_data, GswePlanetInfo *planet_info)
|
||||||
{
|
{
|
||||||
|
if (planet_data == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (planet_data->planet_info) {
|
if (planet_data->planet_info) {
|
||||||
gswe_planet_info_unref(planet_data->planet_info);
|
gswe_planet_info_unref(planet_data->planet_info);
|
||||||
}
|
}
|
||||||
@@ -173,6 +181,10 @@ gswe_planet_data_set_planet_info(GswePlanetData *planet_data, GswePlanetInfo *pl
|
|||||||
GswePlanetInfo *
|
GswePlanetInfo *
|
||||||
gswe_planet_data_get_planet_info(GswePlanetData *planet_data)
|
gswe_planet_data_get_planet_info(GswePlanetData *planet_data)
|
||||||
{
|
{
|
||||||
|
if (planet_data == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return planet_data->planet_info;
|
return planet_data->planet_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -187,6 +199,10 @@ gswe_planet_data_get_planet_info(GswePlanetData *planet_data)
|
|||||||
gdouble
|
gdouble
|
||||||
gswe_planet_data_get_position(GswePlanetData *planet_data)
|
gswe_planet_data_get_position(GswePlanetData *planet_data)
|
||||||
{
|
{
|
||||||
|
if (planet_data == NULL) {
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
return planet_data->position;
|
return planet_data->position;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -202,6 +218,10 @@ gswe_planet_data_get_position(GswePlanetData *planet_data)
|
|||||||
gboolean
|
gboolean
|
||||||
gswe_planet_data_get_retrograde(GswePlanetData *planet_data)
|
gswe_planet_data_get_retrograde(GswePlanetData *planet_data)
|
||||||
{
|
{
|
||||||
|
if (planet_data == NULL) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
return planet_data->retrograde;
|
return planet_data->retrograde;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -216,6 +236,10 @@ gswe_planet_data_get_retrograde(GswePlanetData *planet_data)
|
|||||||
guint
|
guint
|
||||||
gswe_planet_data_get_house(GswePlanetData *planet_data)
|
gswe_planet_data_get_house(GswePlanetData *planet_data)
|
||||||
{
|
{
|
||||||
|
if (planet_data == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
return planet_data->house;
|
return planet_data->house;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -230,6 +254,10 @@ gswe_planet_data_get_house(GswePlanetData *planet_data)
|
|||||||
GsweZodiac
|
GsweZodiac
|
||||||
gswe_planet_data_get_sign(GswePlanetData *planet_data)
|
gswe_planet_data_get_sign(GswePlanetData *planet_data)
|
||||||
{
|
{
|
||||||
|
if (planet_data == NULL) {
|
||||||
|
return GSWE_SIGN_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
if (planet_data->sign_info) {
|
if (planet_data->sign_info) {
|
||||||
return planet_data->sign_info->sign;
|
return planet_data->sign_info->sign;
|
||||||
} else {
|
} else {
|
||||||
@@ -248,6 +276,10 @@ gswe_planet_data_get_sign(GswePlanetData *planet_data)
|
|||||||
GsweSignInfo *
|
GsweSignInfo *
|
||||||
gswe_planet_data_get_sign_info(GswePlanetData *planet_data)
|
gswe_planet_data_get_sign_info(GswePlanetData *planet_data)
|
||||||
{
|
{
|
||||||
|
if (planet_data == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return planet_data->sign_info;
|
return planet_data->sign_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -50,6 +50,9 @@
|
|||||||
* @GSWE_PLANET_PALLAS: dwarf planet Pallas
|
* @GSWE_PLANET_PALLAS: dwarf planet Pallas
|
||||||
* @GSWE_PLANET_JUNO: dwarf planet Juno
|
* @GSWE_PLANET_JUNO: dwarf planet Juno
|
||||||
* @GSWE_PLANET_VESTA: dwarf planet Vesta
|
* @GSWE_PLANET_VESTA: dwarf planet Vesta
|
||||||
|
* @GSWE_PLANET_PHOLUS: asteroid Pholus
|
||||||
|
* @GSWE_PLANET_NESSUS: asteroid Nessus
|
||||||
|
* @GSWE_PLANET_CHARIKLO: asteroid Chariklo
|
||||||
* @GSWE_PLANET_MOON_NODE: the mean ascending (north) Moon node
|
* @GSWE_PLANET_MOON_NODE: the mean ascending (north) Moon node
|
||||||
* @GSWE_PLANET_MOON_APOGEE: the mean Moon apogee (sometimes called Dark Moon,
|
* @GSWE_PLANET_MOON_APOGEE: the mean Moon apogee (sometimes called Dark Moon,
|
||||||
* or Lilith)
|
* or Lilith)
|
||||||
@@ -78,6 +81,9 @@ typedef enum {
|
|||||||
GSWE_PLANET_PALLAS,
|
GSWE_PLANET_PALLAS,
|
||||||
GSWE_PLANET_JUNO,
|
GSWE_PLANET_JUNO,
|
||||||
GSWE_PLANET_VESTA,
|
GSWE_PLANET_VESTA,
|
||||||
|
GSWE_PLANET_PHOLUS,
|
||||||
|
GSWE_PLANET_NESSUS,
|
||||||
|
GSWE_PLANET_CHARIKLO,
|
||||||
GSWE_PLANET_MOON_NODE,
|
GSWE_PLANET_MOON_NODE,
|
||||||
GSWE_PLANET_MOON_APOGEE,
|
GSWE_PLANET_MOON_APOGEE,
|
||||||
GSWE_PLANET_ASCENDANT,
|
GSWE_PLANET_ASCENDANT,
|
||||||
|
@@ -106,13 +106,14 @@ gswe_error_quark(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gswe_init:
|
* gswe_init_with_dir:
|
||||||
|
* @directory: the path that contains the Swiss Ephemeris data files
|
||||||
*
|
*
|
||||||
* Initializes the SWE-GLib library. It must be called before any calculations
|
* Initializes the SWE-GLib library with @directory as the Swiss Ephemeris
|
||||||
* are made.
|
* data files' location. This, or gswe_init() must be called before any
|
||||||
|
* calculations are made.
|
||||||
*/
|
*/
|
||||||
void
|
void gswe_init_with_dir(gchar *directory)
|
||||||
gswe_init(void)
|
|
||||||
{
|
{
|
||||||
GswePlanetInfo *planet_info;
|
GswePlanetInfo *planet_info;
|
||||||
GsweSignInfo *sign_info;
|
GsweSignInfo *sign_info;
|
||||||
@@ -140,26 +141,29 @@ gswe_init(void)
|
|||||||
|
|
||||||
gswe_planet_info_table = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, (GDestroyNotify)gswe_planet_info_unref);
|
gswe_planet_info_table = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, (GDestroyNotify)gswe_planet_info_unref);
|
||||||
|
|
||||||
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_SUN, SE_SUN, TRUE, _("Sun"), 13.0, 2);
|
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_SUN, SE_SUN, TRUE, _("Sun"), 13.0, 2);
|
||||||
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_MOON, SE_MOON, TRUE, _("Moon"), 9.0, 2);
|
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_MOON, SE_MOON, TRUE, _("Moon"), 9.0, 2);
|
||||||
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_MERCURY, SE_MERCURY, TRUE, _("Mercury"), 7.0, 2);
|
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_MERCURY, SE_MERCURY, TRUE, _("Mercury"), 7.0, 2);
|
||||||
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_VENUS, SE_VENUS, TRUE, _("Venus"), 7.0, 1);
|
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_VENUS, SE_VENUS, TRUE, _("Venus"), 7.0, 1);
|
||||||
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_MARS, SE_MARS, TRUE, _("Mars"), 7.0, 1);
|
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_MARS, SE_MARS, TRUE, _("Mars"), 7.0, 1);
|
||||||
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_JUPITER, SE_JUPITER, TRUE, _("Jupiter"), 9.0, 1);
|
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_JUPITER, SE_JUPITER, TRUE, _("Jupiter"), 9.0, 1);
|
||||||
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_SATURN, SE_SATURN, TRUE, _("Saturn"), 7.0, 1);
|
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_SATURN, SE_SATURN, TRUE, _("Saturn"), 7.0, 1);
|
||||||
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_URANUS, SE_URANUS, TRUE, _("Uranus"), 5.0, 1);
|
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_URANUS, SE_URANUS, TRUE, _("Uranus"), 5.0, 1);
|
||||||
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_NEPTUNE, SE_NEPTUNE, TRUE, _("Neptune"), 5.0, 1);
|
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_NEPTUNE, SE_NEPTUNE, TRUE, _("Neptune"), 5.0, 1);
|
||||||
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_PLUTO, SE_PLUTO, TRUE, _("Pluto"), 3.0, 1);
|
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_PLUTO, SE_PLUTO, TRUE, _("Pluto"), 3.0, 1);
|
||||||
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_CHIRON, SE_CHIRON, TRUE, _("Chiron"), 2.0, 0);
|
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_CHIRON, SE_CHIRON, TRUE, _("Chiron"), 2.0, 0);
|
||||||
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_CERES, SE_CERES, TRUE, _("Ceres"), 2.0, 0);
|
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_CERES, SE_CERES, TRUE, _("Ceres"), 2.0, 0);
|
||||||
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_PALLAS, SE_PALLAS, TRUE, _("Pallas"), 2.0, 0);
|
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_PALLAS, SE_PALLAS, TRUE, _("Pallas"), 2.0, 0);
|
||||||
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_JUNO, SE_JUNO, TRUE, _("Juno"), 2.0, 0);
|
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_JUNO, SE_JUNO, TRUE, _("Juno"), 2.0, 0);
|
||||||
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_VESTA, SE_VESTA, TRUE, _("Vesta"), 2.0, 0);
|
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_VESTA, SE_VESTA, TRUE, _("Vesta"), 2.0, 0);
|
||||||
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_MOON_NODE, SE_MEAN_NODE, TRUE, _("Ascending Moon Node"), 2.0, 1);
|
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_PHOLUS, SE_PHOLUS, TRUE, _("Pholus"), 2.0, 0);
|
||||||
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_MOON_APOGEE, SE_MEAN_APOG, TRUE, _("Dark Moon"), 2.0, 0);
|
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_NESSUS, SE_AST_OFFSET + 7066, TRUE, _("Nessus"), 2.0, 0);
|
||||||
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_ASCENDANT, -1, FALSE, _("Ascendant"), 9.0, 2);
|
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_CHARIKLO, SE_AST_OFFSET + 10199, TRUE, _("Chariklo"), 2.0, 0);
|
||||||
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_MC, -1, FALSE, _("Midheaven"), 5.0, 1);
|
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_MOON_NODE, SE_MEAN_NODE, TRUE, _("Ascending Moon Node"), 2.0, 1);
|
||||||
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_VERTEX, -1, FALSE, _("Vertex"), 2.0, 0);
|
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_MOON_APOGEE, SE_MEAN_APOG, TRUE, _("Dark Moon"), 2.0, 0);
|
||||||
|
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_ASCENDANT, -1, FALSE, _("Ascendant"), 9.0, 2);
|
||||||
|
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_MC, -1, FALSE, _("Midheaven"), 5.0, 1);
|
||||||
|
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_VERTEX, -1, FALSE, _("Vertex"), 2.0, 0);
|
||||||
|
|
||||||
gswe_sign_info_table = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, (GDestroyNotify)gswe_sign_info_unref);
|
gswe_sign_info_table = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, (GDestroyNotify)gswe_sign_info_unref);
|
||||||
|
|
||||||
@@ -210,8 +214,21 @@ gswe_init(void)
|
|||||||
|
|
||||||
gswe_full_moon_base_date = gswe_timestamp_new_from_gregorian_full(2005, 5, 8, 3, 48, 0, 0, 0.0);
|
gswe_full_moon_base_date = gswe_timestamp_new_from_gregorian_full(2005, 5, 8, 3, 48, 0, 0, 0.0);
|
||||||
|
|
||||||
gswe_ephe_path = g_strdup(PKGDATADIR);
|
gswe_ephe_path = g_strdup(directory);
|
||||||
swe_set_ephe_path(PKGDATADIR);
|
g_print("Starting with %s\n", directory);
|
||||||
|
swe_set_ephe_path(directory);
|
||||||
gswe_initialized = TRUE;
|
gswe_initialized = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gswe_init:
|
||||||
|
*
|
||||||
|
* Initializes the SWE-GLib library. It must be called before any calculations
|
||||||
|
* are made.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
gswe_init(void)
|
||||||
|
{
|
||||||
|
gswe_init_with_dir(PKGDATADIR);
|
||||||
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user