Compare commits
89 Commits
v2.0.3
...
timestamp-
Author | SHA1 | Date | |
---|---|---|---|
fe19bacfc3 | |||
1c14b451fd | |||
6187d45177 | |||
b4612e1e89 | |||
a8844a3ed8 | |||
2a615e44c8 | |||
e850018d62 | |||
34ded1881f | |||
02703b7045 | |||
efa7b7fab3 | |||
bf5a839511 | |||
4d5866b405 | |||
714f3dbcb0 | |||
68351b2177 | |||
9b47d216e3 | |||
121357e863 | |||
|
fc1a6328f1 | ||
|
5b7124aca5 | ||
c461b743e4 | |||
|
c03f1eac6a | ||
820a41cb8f | |||
185c235b6b | |||
bf4fad5388 | |||
2dd4ea1ca7 | |||
46b6b86f88 | |||
0b190d47d0 | |||
385458d655 | |||
5b61a42976 | |||
9991269c8e | |||
b34fc1c8a0 | |||
510e440ef4 | |||
188a12d1ee | |||
a3a1dd0bd4 | |||
f21ce84b17 | |||
06fce9c9d5 | |||
366155b835 | |||
b981ed1b3b | |||
68994b8cb5 | |||
c9e382d04b | |||
fbc5a4e922 | |||
b77aae9f5c | |||
e16c4eca70 | |||
c10881fff1 | |||
aae1f06ed7 | |||
8bf5a49c4b | |||
68b46d2aee | |||
e621a2eda2 | |||
600712c901 | |||
dca2071c88 | |||
cb9cf3a4ce | |||
1225c5c8ed | |||
0caebd4f94 | |||
80b5da88a3 | |||
d5bea25e4d | |||
95e89a4c25 | |||
cb1fa1f67a | |||
078ff3370d | |||
66c8c3371c | |||
d2638adf8a | |||
4b61c453fd | |||
105cf7c83b | |||
8adfd0b966 | |||
8dd6eedb88 | |||
89baa44005 | |||
a50a967ad3 | |||
75a9318629 | |||
8a5d700d93 | |||
95face8294 | |||
fbf341dcec | |||
784987a2b6 | |||
07a351c373 | |||
55621bc25d | |||
a120b22861 | |||
c9a0944504 | |||
9d7eedb371 | |||
cd36bafe9c | |||
d3e4443922 | |||
6a69271007 | |||
b6071a4e46 | |||
21298fb219 | |||
243eac9de8 | |||
97dceeb45c | |||
45833584b7 | |||
26dcd74338 | |||
3296f9dfce | |||
eec99bcb05 | |||
de5ac1b63b | |||
97df73c64f | |||
2d75226310 |
7
.gitignore
vendored
7
.gitignore
vendored
@@ -14,6 +14,7 @@
|
||||
/.dirstamp
|
||||
*.gir
|
||||
*.typelib
|
||||
*.gschema.valid
|
||||
ChangeLog
|
||||
|
||||
# Files created by the build tools
|
||||
@@ -56,7 +57,9 @@ Makefile.in
|
||||
/tests/*-test
|
||||
/tests/*-test.log
|
||||
/tests/*-test.trs
|
||||
/tests/test-suite.log
|
||||
/swe-glib-lcov*
|
||||
test-suite.log
|
||||
/tests/gswe-timestamp-test.gc??
|
||||
|
||||
# Translation related files
|
||||
/ABOUT-NLS
|
||||
@@ -89,6 +92,8 @@ Makefile.in
|
||||
/data/swe-glib.pc
|
||||
/data/swe-glib.spec
|
||||
/src/*.vapi
|
||||
/src/gswe-version.h
|
||||
/data/*.gschema.xml
|
||||
|
||||
# Documentation related files
|
||||
/docs/reference/*/*.args
|
||||
|
@@ -1,3 +1,3 @@
|
||||
language: c
|
||||
install: sudo apt-get install libglib2.0-dev gobject-introspection gnome-common && ./autogen.sh
|
||||
script: ./configure && make && make check
|
||||
script: make && make check
|
||||
|
@@ -1,3 +1,5 @@
|
||||
include $(top_srcdir)/swe-glib.mk
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
SUBDIRS = swe swe/src swe/doc src po data tests
|
||||
|
||||
@@ -9,11 +11,11 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
|
||||
|
||||
intltool_extra = intltool-extract.in intltool-merge.in intltool-update.in
|
||||
|
||||
EXTRA_DIST = $(intltool_extra) $(header_DATA) autogen.sh
|
||||
EXTRA_DIST += $(intltool_extra) $(header_DATA) autogen.sh
|
||||
|
||||
DISTCLEANFILES = intltool-extract intltool-merge intltool-update
|
||||
DISTCLEANFILES += intltool-extract intltool-merge intltool-update
|
||||
|
||||
MAINTAINERCLEANFILES = ChangeLog
|
||||
MAINTAINERCLEANFILES += ChangeLog
|
||||
|
||||
distclean-local:
|
||||
if test "$(srcdir)" = "."; then :; else \
|
||||
|
@@ -59,3 +59,5 @@ fi
|
||||
echo "Running automake"
|
||||
automake --gnu --add-missing --copy -Wno-portability || exit $?
|
||||
|
||||
"$srcdir/configure" "$@"
|
||||
|
||||
|
101
configure.ac
101
configure.ac
@@ -1,14 +1,24 @@
|
||||
m4_define([swe_glib_major_version], [2])
|
||||
m4_define([swe_glib_minor_version], [0])
|
||||
m4_define([swe_glib_micro_version], [3])
|
||||
m4_define([swe_glib_minor_version], [1])
|
||||
m4_define([swe_glib_micro_version], [0])
|
||||
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_major_version], [2])
|
||||
m4_define([swe_minor_version], [0])
|
||||
m4_define([swe_version], [swe_major_version.swe_minor_version])
|
||||
|
||||
AC_INIT([SWE-GLib], [swe_glib_version], [gergely@polonkai.eu], [swe-glib])
|
||||
AM_INIT_AUTOMAKE([-Wall foreign])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AM_SILENT_RULES([yes])
|
||||
AC_ARG_ENABLE(debug, [AC_HELP_STRING([--enable-debug], [compile with debugging support])], , enable_debug=no)
|
||||
|
||||
dnl ********************************
|
||||
dnl *** Enable debugging support ***
|
||||
dnl ********************************
|
||||
AC_ARG_ENABLE(debug,
|
||||
AC_HELP_STRING([--enable-debug],
|
||||
[compile with debugging support]),
|
||||
[enable_debug=$enableval], [enable_debug=no])
|
||||
|
||||
if test "x$enable_debug" = "xyes" ; then
|
||||
AC_DEFINE([DEBUG], [1], [Define if debugging is enabled])
|
||||
@@ -26,6 +36,7 @@ AC_SUBST([SWE_GLIB_MICRO_VERSION], [swe_glib_micro_version])
|
||||
AC_SUBST([SWE_GLIB_VERSION], [swe_glib_version])
|
||||
AC_SUBST([SWE_GLIB_API_VERSION], [swe_glib_api_version])
|
||||
AC_SUBST([SWE_GLIB_API_VERSION_U], [AS_TR_SH([swe_glib_api_version])])
|
||||
AC_SUBST([SWE_VERSION], [swe_version])
|
||||
|
||||
AC_PROG_CC
|
||||
AM_PROG_CC_C_O
|
||||
@@ -64,11 +75,92 @@ AM_CONDITIONAL(OS_WIN32, [test "$native_win32" = "yes"])
|
||||
AM_CONDITIONAL(OS_UNIX, [test "$native_win32" != "yes"])
|
||||
AC_PATH_PROG([GTESTER], [gtester])
|
||||
AC_PATH_PROG([GTESTER_REPORT], [gtester-report])
|
||||
|
||||
dnl ************************************
|
||||
dnl *** Enable lcov coverage reports ***
|
||||
dnl ************************************
|
||||
|
||||
AC_ARG_ENABLE(coverage,
|
||||
AS_HELP_STRING([--enable-coverage],
|
||||
[enable coverage testing with gcov]),
|
||||
[use_gcov=$enableval], [use_gcov=no])
|
||||
|
||||
AS_IF([ test "x$use_gcov" = "xyes"], [
|
||||
dnl we need gcc:
|
||||
if test "$GCC" != "yes"; then
|
||||
AC_MSG_ERROR([GCC is required for --enable-coverage])
|
||||
fi
|
||||
|
||||
dnl Check if ccache is being used
|
||||
AC_CHECK_PROG(SHTOOL, shtool, shtool)
|
||||
case `$SHTOOL path $CC` in
|
||||
*ccache*[)] gcc_ccache=yes;;
|
||||
*[)] gcc_ccache=no;;
|
||||
esac
|
||||
|
||||
if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then
|
||||
AC_MSG_ERROR([ccache must be disabled when --enable-coverage option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
|
||||
fi
|
||||
|
||||
ltp_version_list="1.6 1.7 1.8 1.9 1.10"
|
||||
AC_CHECK_PROG(LTP, lcov, lcov)
|
||||
AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
|
||||
|
||||
AS_IF([ test "$LTP" ], [
|
||||
AC_CACHE_CHECK([for ltp version], sw_glib_cv_ltp_version, [
|
||||
swe_glib_cv_ltp_version=invalid
|
||||
ltp_version=`$LTP -v 2>/dev/null | $SED -e 's/^.* //'`
|
||||
for ltp_check_version in $ltp_version_list; do
|
||||
if test "$ltp_version" = "$ltp_check_version"; then
|
||||
swe_glib_cv_ltp_version="$ltp_check_version (ok)"
|
||||
fi
|
||||
done
|
||||
])
|
||||
], [
|
||||
ltp_msg="To enable code coverage reporting you must have one of the following LTP versions installed: $ltp_version_list"
|
||||
AC_MSG_ERROR([$ltp_msg])
|
||||
])
|
||||
|
||||
case $swe_glib_cv_ltp_version in
|
||||
""|invalid[)]
|
||||
ltp_msg="You must have one of the following versions of LTP: $ltp_version_list (found: $ltp_version)."
|
||||
AC_MSG_ERROR([$ltp_msg])
|
||||
LTP="exit 0;"
|
||||
;;
|
||||
esac
|
||||
|
||||
if test -z "$LTP_GENHTML"; then
|
||||
AC_MSG_ERROR([Could not find genhtml from the LTP package])
|
||||
fi
|
||||
|
||||
dnl Remove all optimization flags from CFLAGS
|
||||
changequote({,})
|
||||
CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
|
||||
changequote([,])
|
||||
|
||||
dnl Add the special gcc flags
|
||||
CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage"
|
||||
LDFLAGS="$LDFLAGS -lgcov"
|
||||
])
|
||||
|
||||
if test "x$enable_debug" = "xyes" ; then
|
||||
AC_DEFINE([DEBUG], [1], [Define if debugging is enabled])
|
||||
if test x$cflags_set != xset ; then
|
||||
case " $CFLAGS " in
|
||||
*[[\ \ ]]-g[[\ \ ]]*) ;;
|
||||
*) CFLAGS="$CFLAGS -g" ;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
|
||||
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.32.0])
|
||||
PKG_CHECK_MODULES([GOBJECT], [gobject-2.0 >= 2.32.0])
|
||||
PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.26])
|
||||
|
||||
GLIB_GSETTINGS
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
LIBSWE_LIBS='$(top_builddir)/swe/src/libswe-1.76.la'
|
||||
LIBSWE_LIBS='$(top_builddir)/swe/src/libswe-$(SWE_VERSION).la'
|
||||
AC_SUBST(LIBSWE_LIBS)
|
||||
|
||||
LIBSWE_GLIB_LIBS='$(top_builddir)/src/libswe-glib-$(SWE_GLIB_API_VERSION).la'
|
||||
@@ -85,6 +177,7 @@ AC_CONFIG_FILES([
|
||||
tests/Makefile
|
||||
data/swe-glib.pc
|
||||
data/swe-glib.spec
|
||||
src/gswe-version.h
|
||||
])
|
||||
AM_COND_IF([ENABLE_GTK_DOC], [
|
||||
AC_CONFIG_FILES([
|
||||
|
@@ -1,6 +1,14 @@
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = swe-glib.pc $(NULL)
|
||||
|
||||
eu.polonkai.gergely.swe-glib.gschema.xml: gschema.template $(top_builddir)/src/gswe-types.h
|
||||
$(GLIB_MKENUMS) --comments "<!-- @comment@ -->" --template $(filter %.template,$^) $(filter-out %.template,$^) > \
|
||||
$@.tmp && mv $@.tmp $@
|
||||
|
||||
gsettings_SCHEMAS = eu.polonkai.gergely.swe-glib.gschema.xml
|
||||
|
||||
@GSETTINGS_RULES@
|
||||
|
||||
swephdir = $(pkgdatadir)
|
||||
sweph_DATA = \
|
||||
sweph-data/seas_00.se1 \
|
||||
@@ -57,9 +65,24 @@ sweph_DATA = \
|
||||
sweph-data/seplm42.se1 \
|
||||
sweph-data/seplm48.se1 \
|
||||
sweph-data/seplm54.se1 \
|
||||
sweph-data/seleapsec.txt \
|
||||
sweph-data/s136199.se1 \
|
||||
sweph-data/s136199s.se1 \
|
||||
sweph-data/se00010s.se1 \
|
||||
sweph-data/se00034s.se1 \
|
||||
sweph-data/se00157s.se1 \
|
||||
sweph-data/se07066s.se1 \
|
||||
sweph-data/se08405s.se1 \
|
||||
sweph-data/se10199s.se1 \
|
||||
sweph-data/se90377.se1 \
|
||||
sweph-data/se90377s.se1 \
|
||||
sweph-data/se90482.se1 \
|
||||
sweph-data/se90482s.se1 \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_DIST = \
|
||||
$(sweph_DATA) \
|
||||
swe-glib.spec
|
||||
swe-glib.spec \
|
||||
gschema.template
|
||||
|
||||
DISTCLEANFILES = $(gsettings_SCHEMAS)
|
||||
|
22
data/gschema.template
Normal file
22
data/gschema.template
Normal file
@@ -0,0 +1,22 @@
|
||||
/*** BEGIN file-header ***/
|
||||
<schemalist>
|
||||
/*** END file-header ***/
|
||||
|
||||
/*** BEGIN file-production ***/
|
||||
/*** END file-production ***/
|
||||
|
||||
/*** BEGIN value-header ***/
|
||||
<enum id="eu.polonkai.gergely.swe-glib.@EnumName@">
|
||||
/*** END value-header ***/
|
||||
|
||||
/*** BEGIN value-production ***/
|
||||
<value nick="@valuenick@" value="@valuenum@"/>
|
||||
/*** END value-production ***/
|
||||
|
||||
/*** BEGIN value-tail ***/
|
||||
</enum>
|
||||
/*** END value-tail ***/
|
||||
|
||||
/*** BEGIN file-tail ***/
|
||||
</schemalist>
|
||||
/*** END file-tail ***/
|
@@ -70,12 +70,13 @@ rm -f $RPM_BUILD_ROOT%{_datadir}/locale/hu/LC_MESSAGES/swe-glib.mo
|
||||
|
||||
%files
|
||||
%doc ChangeLog
|
||||
%{_libdir}/libswe-1.76.so.*
|
||||
%{_libdir}/libswe-@SWE_VERSION@.so.*
|
||||
%{_libdir}/libswe-glib-@SWE_GLIB_API_VERSION@.so.*
|
||||
%{_libdir}/girepository-1.0/SweGlib-@SWE_GLIB_API_VERSION@.typelib
|
||||
|
||||
%files data
|
||||
%{_datadir}/swe-glib/*.se1
|
||||
%{_datadir}/swe-glib/seleapsec.txt
|
||||
|
||||
%files doc
|
||||
%doc %{_datadir}/gtk-doc/html/*
|
||||
@@ -84,7 +85,7 @@ rm -f $RPM_BUILD_ROOT%{_datadir}/locale/hu/LC_MESSAGES/swe-glib.mo
|
||||
%{_includedir}/*
|
||||
%{_libdir}/pkgconfig/*
|
||||
%{_datadir}/gir-1.0/SweGlib-@SWE_GLIB_API_VERSION@.gir
|
||||
%{_libdir}/libswe-1.76.so
|
||||
%{_libdir}/libswe-@SWE_VERSION@.so
|
||||
%{_libdir}/libswe-glib-@SWE_GLIB_API_VERSION@.so
|
||||
%{_datadir}/vala/vapi/SweGlib-@SWE_GLIB_API_VERSION@.vapi
|
||||
|
||||
|
BIN
data/sweph-data/s136199.se1
Normal file
BIN
data/sweph-data/s136199.se1
Normal file
Binary file not shown.
BIN
data/sweph-data/s136199s.se1
Normal file
BIN
data/sweph-data/s136199s.se1
Normal file
Binary file not shown.
BIN
data/sweph-data/se00010s.se1
Normal file
BIN
data/sweph-data/se00010s.se1
Normal file
Binary file not shown.
BIN
data/sweph-data/se00034s.se1
Normal file
BIN
data/sweph-data/se00034s.se1
Normal file
Binary file not shown.
BIN
data/sweph-data/se00157s.se1
Normal file
BIN
data/sweph-data/se00157s.se1
Normal file
Binary file not shown.
BIN
data/sweph-data/se07066s.se1
Normal file
BIN
data/sweph-data/se07066s.se1
Normal file
Binary file not shown.
BIN
data/sweph-data/se08405s.se1
Normal file
BIN
data/sweph-data/se08405s.se1
Normal file
Binary file not shown.
BIN
data/sweph-data/se10199s.se1
Normal file
BIN
data/sweph-data/se10199s.se1
Normal file
Binary file not shown.
BIN
data/sweph-data/se90377.se1
Normal file
BIN
data/sweph-data/se90377.se1
Normal file
Binary file not shown.
BIN
data/sweph-data/se90377s.se1
Normal file
BIN
data/sweph-data/se90377s.se1
Normal file
Binary file not shown.
BIN
data/sweph-data/se90482.se1
Normal file
BIN
data/sweph-data/se90482.se1
Normal file
Binary file not shown.
BIN
data/sweph-data/se90482s.se1
Normal file
BIN
data/sweph-data/se90482s.se1
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
393347
data/sweph-data/seasnam.txt
Normal file
393347
data/sweph-data/seasnam.txt
Normal file
File diff suppressed because it is too large
Load Diff
@@ -2,4 +2,28 @@
|
||||
# by the Swiss Ephemeris.
|
||||
# For each new leap second add the date of its insertion in the format
|
||||
# yyyymmdd, e.g. "20081231" for 21 december 2008
|
||||
19720630
|
||||
19721231
|
||||
19731231
|
||||
19741231
|
||||
19751231
|
||||
19761231
|
||||
19771231
|
||||
19781231
|
||||
19791231
|
||||
19810630
|
||||
19820630
|
||||
19830630
|
||||
19850630
|
||||
19871231
|
||||
19891231
|
||||
19901231
|
||||
19920630
|
||||
19930630
|
||||
19949630
|
||||
19951231
|
||||
19970630
|
||||
19981231
|
||||
20051231
|
||||
20081231
|
||||
20120630
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
77
data/sweph-data/seorbel.txt
Normal file
77
data/sweph-data/seorbel.txt
Normal file
@@ -0,0 +1,77 @@
|
||||
# Orbital elements of ficticious planets
|
||||
# 27 Jan. 2000
|
||||
#
|
||||
# This file is part of the Swiss Ephemeris, from Version 1.52 on.
|
||||
#
|
||||
# Warning! These planets do not exist!
|
||||
#
|
||||
# The user can add his or her own elements.
|
||||
# 960 is the maximum number of ficticious planets.
|
||||
#
|
||||
# The elements order is as follows:
|
||||
# 1. epoch of elements (Julian day)
|
||||
# 2. equinox (Julian day or "J1900" or "B1950" or "J2000")
|
||||
# 3. mean anomaly at epoch
|
||||
# 4. semi-axis
|
||||
# 5. eccentricity
|
||||
# 6. argument of perihelion (ang. distance of perihelion from node)
|
||||
# 7. ascending node
|
||||
# 8. inclination
|
||||
# 9. name of planet
|
||||
#
|
||||
# use '#' for comments
|
||||
# to compute a body with swe_calc(), use planet number
|
||||
# ipl = SE_FICT_OFFSET_1 + number_of_elements_set,
|
||||
# e.g. number of Kronos is ipl = 39 + 4 = 43
|
||||
#
|
||||
# Witte/Sieggruen planets, refined by James Neely
|
||||
#2456200.5, J2000, 143.49291, 1.4579341, 0.2225740, 178.78899, 304.33810, 10.82816, Eros # 1
|
||||
J1900, J1900, 163.7409, 40.99837, 0.00460, 171.4333, 129.8325, 1.0833, Cupido # 1
|
||||
J1900, J1900, 27.6496, 50.66744, 0.00245, 148.1796, 161.3339, 1.0500, Hades # 2
|
||||
J1900, J1900, 165.1232, 59.21436, 0.00120, 299.0440, 0.0000, 0.0000, Zeus # 3
|
||||
J1900, J1900, 169.0193, 64.81960, 0.00305, 208.8801, 0.0000, 0.0000, Kronos # 4
|
||||
J1900, J1900, 138.0533, 70.29949, 0.00000, 0.0000, 0.0000, 0.0000, Apollon # 5
|
||||
J1900, J1900, 351.3350, 73.62765, 0.00000, 0.0000, 0.0000, 0.0000, Admetos # 6
|
||||
J1900, J1900, 55.8983, 77.25568, 0.00000, 0.0000, 0.0000, 0.0000, Vulcanus # 7
|
||||
J1900, J1900, 165.5163, 83.66907, 0.00000, 0.0000, 0.0000, 0.0000, Poseidon # 8
|
||||
#
|
||||
# Isis-Transpluto; elements from "Die Sterne" 3/1952, p. 70ff.
|
||||
# Strubell does not give an equinox. 1945 is taken in order to
|
||||
# reproduce the as best as ASTRON ephemeris. (This is a strange
|
||||
# choice, though.)
|
||||
# The epoch according to Strubell is 1772.76.
|
||||
# 1772 is a leap year!
|
||||
# The fraction is counted from 1 Jan. 1772
|
||||
2368547.66, 2431456.5, 0.0, 77.775, 0.3, 0.7, 0, 0, Isis-Transpluto # 9
|
||||
# Nibiru, elements from Christian Woeltge, Hannover
|
||||
1856113.380954, 1856113.380954, 0.0, 234.8921, 0.981092, 103.966, -44.567, 158.708, Nibiru # 10
|
||||
# Harrington, elements from Astronomical Journal 96(4), Oct. 1988
|
||||
2374696.5, J2000, 0.0, 101.2, 0.411, 208.5, 275.4, 32.4, Harrington # 11
|
||||
# according to W.G. Hoyt, "Planets X and Pluto", Tucson 1980, p. 63
|
||||
2395662.5, 2395662.5, 34.05, 36.15, 0.10761, 284.75, 0, 0, Leverrier (Neptune) # 12
|
||||
2395662.5, 2395662.5, 24.28, 37.25, 0.12062, 299.11, 0, 0, Adams (Neptune) # 13
|
||||
2425977.5, 2425977.5, 281, 43.0, 0.202, 204.9, 0, 0, Lowell (Pluto) # 14
|
||||
2425977.5, 2425977.5, 48.95, 55.1, 0.31, 280.1, 100, 15, Pickering (Pluto) # 15
|
||||
# intramercurian hypothetical Vulcan acc. to L.H. Weston
|
||||
J1900,JDATE, 252.8987988 + 707550.7341 * T, 0.13744, 0.019, 322.212069+1670.056*T, 47.787931-1670.056*T, 7.5, Vulcan # 16
|
||||
# Selena/White Moon
|
||||
J2000,JDATE, 242.2205555 + 5143.5418158 * T, 0.05280098949, 0.0, 0.0, 0.0, 0.0, Selena/White Moon, geo # 17
|
||||
# Hypothetical planet Proserpina, according to http://www.geocities.com/Hollywood/Academy/7519/proserpina.html
|
||||
# J1900, 170.73 + 51.05 * T
|
||||
J1900,JDATE, 170.73, 79.225630, 0, 0, 0, 0, Proserpina #18
|
||||
# Waldemath's Second Earth Moon
|
||||
# Elements were derived by D.Koch from Waldemaths original elements as given in
|
||||
# David Walters' book on Vulcan. They differ from Solar Fire (Graham Dawsons)
|
||||
# elements, which are based on the assumption that the "mean longitude" given
|
||||
# by Waldemath is an observation (a true longitude)
|
||||
# Neither Swisseph nor Solar fire elements agree with Delphine Jay's ephemeris,
|
||||
# which is obviously wrong.
|
||||
2414290.95827875,2414290.95827875, 70.3407215 + 109023.2634989 * T, 0.0068400705250028, 0.1587, 8.14049594 + 2393.47417444 * T, 136.24878256 - 1131.71719709 * T, 2.5, Waldemath, geo # 19
|
||||
##############################################
|
||||
# The following elements are for test only
|
||||
# (Selena without T)
|
||||
J2000,JDATE, 242.2205555, 0.05279142865925, 0.0, 0.0, 0.0, 0.0, Selena/White Moon, geo # 17
|
||||
# (Selena with T, gives exactly the same position)
|
||||
J2000,JDATE, 242.2205555 + 5143.5418158 * T, 0.05279142865925, 0.0, 0.0, 0.0, 0.0, Selena/White Moon with T Terms, geo # 17
|
||||
J2000, JDATE, 174.794787 + 149472.5157715 * T, 0.38709831, 0.20563175 + 0.000020406 * T, 29.125226 + 0.3702885 * T, 48.330893 + 1.186189 * T, 7.004986 + 0.0018215 * T, Mercury elem. for equ. of date # 18
|
||||
J2000, J2000, 174.794787 + 149472.5157715 * T, 0.38709831, 0.20563175 + 0.000020406 * T, 29.125226 + 0.2842872 * T, 48.330893 - 0.1254229 * T, 7.004986 - 0.0059516 * T, Mercury Test J2000 Elements# 18
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -29,7 +29,7 @@ SCANGOBJ_OPTIONS=
|
||||
|
||||
# Extra options to supply to gtkdoc-scan.
|
||||
# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED"
|
||||
SCAN_OPTIONS=--rebuild-types
|
||||
SCAN_OPTIONS=--rebuild-types --deprecated-guards="GSWE_DISABLE_DEPRECATED"
|
||||
|
||||
# Extra options to supply to gtkdoc-mkdb.
|
||||
# e.g. MKDB_OPTIONS=--xml-mode --output-format=xml
|
||||
|
@@ -32,6 +32,7 @@
|
||||
<xi:include href="xml/swe-glib.xml"/>
|
||||
<xi:include href="xml/gswe-moment.xml"/>
|
||||
<xi:include href="xml/gswe-timestamp.xml"/>
|
||||
<xi:include href="xml/gswe-version.xml"/>
|
||||
|
||||
</chapter>
|
||||
<chapter id="object-tree">
|
||||
|
@@ -60,6 +60,7 @@ gswe_moon_phase_data_get_type
|
||||
<SECTION>
|
||||
<FILE>gswe-sign-info</FILE>
|
||||
GsweSignInfo
|
||||
gswe_find_sign_info_by_id
|
||||
gswe_sign_info_new
|
||||
gswe_sign_info_ref
|
||||
gswe_sign_info_unref
|
||||
@@ -79,6 +80,8 @@ gswe_sign_info_get_type
|
||||
<SECTION>
|
||||
<FILE>gswe-planet-info</FILE>
|
||||
GswePlanetInfo
|
||||
gswe_find_planet_info_by_id
|
||||
gswe_all_planets
|
||||
gswe_planet_info_new
|
||||
gswe_planet_info_ref
|
||||
gswe_planet_info_unref
|
||||
@@ -122,6 +125,8 @@ gswe_planet_data_get_type
|
||||
<SECTION>
|
||||
<FILE>gswe-aspect-info</FILE>
|
||||
GsweAspectInfo
|
||||
gswe_find_aspect_info_by_id
|
||||
gswe_all_aspects
|
||||
gswe_aspect_info_new
|
||||
gswe_aspect_info_ref
|
||||
gswe_aspect_info_unref
|
||||
@@ -165,6 +170,8 @@ gswe_aspect_data_get_type
|
||||
<SECTION>
|
||||
<FILE>gswe-antiscion-axis-info</FILE>
|
||||
GsweAntiscionAxisInfo
|
||||
gswe_find_antiscion_axis_info_by_id
|
||||
gswe_all_antiscion_axes
|
||||
gswe_antiscion_axis_info_new
|
||||
gswe_antiscion_axis_info_ref
|
||||
gswe_antiscion_axis_info_unref
|
||||
@@ -206,6 +213,8 @@ gswe_antiscion_data_get_type
|
||||
<SECTION>
|
||||
<FILE>gswe-house-system-info</FILE>
|
||||
GsweHouseSystemInfo
|
||||
gswe_find_house_system_info_by_id
|
||||
gswe_all_house_systems
|
||||
gswe_house_system_info_new
|
||||
gswe_house_system_info_ref
|
||||
gswe_house_system_info_unref
|
||||
@@ -240,9 +249,11 @@ gswe_house_data_get_type
|
||||
<TITLE>GsweTimestamp</TITLE>
|
||||
GsweTimestamp
|
||||
GsweTimestampClass
|
||||
GsweTimestampValidityFlags
|
||||
gswe_timestamp_new
|
||||
gswe_timestamp_new_from_julian_day
|
||||
gswe_timestamp_new_from_gregorian_full
|
||||
gswe_timestamp_new_from_now_local
|
||||
gswe_timestamp_set_gregorian_full
|
||||
gswe_timestamp_set_instant_recalc
|
||||
gswe_timestamp_get_instant_recalc
|
||||
@@ -262,8 +273,14 @@ gswe_timestamp_set_gregorian_microsecond
|
||||
gswe_timestamp_get_gregorian_microsecond
|
||||
gswe_timestamp_set_gregorian_timezone
|
||||
gswe_timestamp_get_gregorian_timezone
|
||||
gswe_timestamp_set_now_local
|
||||
gswe_timestamp_set_julian_day
|
||||
gswe_timestamp_get_julian_day
|
||||
gswe_timestamp_set_julian_day_et
|
||||
gswe_timestamp_get_julian_day_et
|
||||
gswe_timestamp_set_julian_day_ut
|
||||
gswe_timestamp_get_julian_day_ut
|
||||
gswe_timestamp_get_sidereal_time
|
||||
<SUBSECTION Standard>
|
||||
GSWE_IS_TIMESTAMP
|
||||
GSWE_IS_TIMESTAMP_CLASS
|
||||
@@ -278,6 +295,11 @@ gswe_timestamp_get_type
|
||||
<SECTION>
|
||||
<FILE>gswe-types</FILE>
|
||||
GswePlanet
|
||||
GSWE_PLANET_LILITH
|
||||
GSWE_PLANET_OFFSET_VIRTUAL_NODES
|
||||
GSWE_PLANET_OFFSET_PLANETS
|
||||
GSWE_PLANET_OFFSET_ASTEROIDS
|
||||
GSWE_PLANET_OFFSET_CUSTOM
|
||||
GsweZodiac
|
||||
GsweAspect
|
||||
GsweAntiscionAxis
|
||||
@@ -299,3 +321,11 @@ GSWE_ERROR
|
||||
gswe_init
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gswe-version</FILE>
|
||||
GSWE_MAJOR_VERSION
|
||||
GSWE_MINOR_VERSION
|
||||
GSWE_MICRO_VERSION
|
||||
GSWE_CHECK_VERSION
|
||||
gswe_check_version
|
||||
</SECTION>
|
||||
|
@@ -1,4 +1,8 @@
|
||||
var Swe = imports.gi.SweGlib;
|
||||
const GLib = imports.gi.GLib;
|
||||
const Swe = imports.gi.SweGlib;
|
||||
const Format = imports.format;
|
||||
|
||||
String.prototype.format = Format.format;
|
||||
|
||||
Swe.init();
|
||||
|
||||
@@ -8,7 +12,7 @@ timestamp.set_gregorian_full(1983, 3, 7, 11, 54, 45, 0, 1);
|
||||
var moment = new Swe.Moment();
|
||||
moment.add_all_planets();
|
||||
moment.set_timestamp(timestamp);
|
||||
moment.set_coordinates(19.03990999, 47.49801000, 280);
|
||||
moment.set_coordinates(19.03991, 47.49801, 280);
|
||||
moment.set_house_system(Swe.HouseSystem.PLACIDUS);
|
||||
|
||||
var all_planets = moment.get_all_planets()
|
||||
@@ -20,7 +24,7 @@ for (var i = 0; i < all_planets.length; i++) {
|
||||
var minute = Math.floor((sign_position - degree) * 60);
|
||||
var second = Math.floor(((sign_position - degree) * 60 - minute) * 60)
|
||||
|
||||
log(planet.get_planet_info().get_name() + ": " + position + " (" + degree + "°" + minute + "′" + second + "″ " + planet.get_sign_info().get_name() + ")");
|
||||
print("%s: %.6f (%d°%d′%d″ %s)".format(planet.get_planet_info().get_name(), position, degree, minute, second, planet.get_sign_info().get_name()));
|
||||
}
|
||||
|
||||
var all_aspects = moment.get_all_aspects();
|
||||
@@ -31,7 +35,7 @@ for (var i = 0; i < all_aspects.length; i++) {
|
||||
var planet1 = aspect.get_planet1();
|
||||
var planet2 = aspect.get_planet2();
|
||||
|
||||
log(planet1.get_planet_info().get_name() + " in " + aspect.get_aspect_info().get_name() + " with " + planet2.get_planet_info().get_name() + "(±" + aspect.get_difference() + "%)");
|
||||
print("%s in %s with %s (±%.2f%%)".format(planet1.get_planet_info().get_name(), aspect.get_aspect_info().get_name(), planet2.get_planet_info().get_name(), aspect.get_difference()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +47,6 @@ for (var i = 0; i < all_antiscia.length; i++) {
|
||||
var planet1 = antiscion.get_planet1();
|
||||
var planet2 = antiscion.get_planet2();
|
||||
|
||||
log(planet1.get_planet_info().get_name() + " is antiscion of " + planet2.get_planet_info().get_name() + " on axis " + antiscion.get_antiscion_axis_info().get_name() + " (±" + antiscion.get_difference() + "%)");
|
||||
print("%s is antiscion of %s on axis %s (±%.2f%%)".format(planet1.get_planet_info().get_name(), planet2.get_planet_info().get_name(), antiscion.get_antiscion_axis_info().get_name(), antiscion.get_difference().toFixed(2)));
|
||||
}
|
||||
}
|
||||
|
||||
|
44
examples/basic.lua
Normal file
44
examples/basic.lua
Normal file
@@ -0,0 +1,44 @@
|
||||
local lgi = require 'lgi'
|
||||
local SweGlib = lgi.require('SweGlib', '2.0')
|
||||
|
||||
SweGlib.init()
|
||||
|
||||
local timestamp = SweGlib.Timestamp.new()
|
||||
timestamp:set_gregorian_full(1983, 3, 7, 11, 54, 45, 0, 1)
|
||||
|
||||
local moment = SweGlib.Moment.new()
|
||||
moment:set_timestamp(timestamp)
|
||||
moment:set_timestamp(timestamp)
|
||||
moment:set_coordinates(19.03990999, 47.49801000, 280)
|
||||
moment:set_house_system(SweGlib.HouseSystem.PLACIDUS)
|
||||
moment:add_all_planets()
|
||||
|
||||
local all_planets = moment:get_all_planets()
|
||||
for _, planet in ipairs(all_planets) do
|
||||
local position = planet:get_position()
|
||||
local sign_position = math.fmod(position, 30)
|
||||
local degree = math.floor(sign_position)
|
||||
local minute = math.floor((sign_position - degree) * 60)
|
||||
local second = math.floor(((sign_position - degree) * 60 - minute) * 60)
|
||||
io.write(string.format("%s: %f (%d°%d′%d″ %s)\n", planet:get_planet_info():get_name(), position, degree, minute, second, planet:get_sign_info():get_name()))
|
||||
end
|
||||
|
||||
local all_aspects = moment:get_all_aspects()
|
||||
for _, aspect in ipairs(all_aspects) do
|
||||
if aspect:get_aspect() ~= "NONE" then
|
||||
local planet1 = aspect:get_planet1()
|
||||
local planet2 = aspect:get_planet2()
|
||||
|
||||
io.write(string.format("%s in %s with %s (±%.2f%%)\n", planet1:get_planet_info():get_name(), aspect:get_aspect_info():get_name(), planet2:get_planet_info():get_name(), aspect:get_difference()))
|
||||
end
|
||||
end
|
||||
|
||||
local all_antiscia = moment:get_all_antiscia()
|
||||
for _, antiscion in ipairs(all_antiscia) do
|
||||
if antiscion:get_axis() ~= "NONE" then
|
||||
local planet1 = antiscion:get_planet1()
|
||||
local planet2 = antiscion:get_planet2()
|
||||
|
||||
io.write(string.format("%s is antiscion of %s on axis %s (±%.2f%%)\n", planet1:get_planet_info():get_name(), planet2:get_planet_info():get_name(), antiscion:get_antiscion_axis_info():get_name(), antiscion:get_difference()))
|
||||
end
|
||||
end
|
@@ -1,10 +1,12 @@
|
||||
#!/bin/env perl
|
||||
package SweGlib;
|
||||
|
||||
use utf8;
|
||||
use strict;
|
||||
use POSIX;
|
||||
use Glib::Object::Introspection;
|
||||
|
||||
use Data::Dumper;
|
||||
binmode STDOUT, ':encoding(UTF-8)';
|
||||
|
||||
Glib::Object::Introspection->setup(basename => 'SweGlib', version => '2.0', package => 'SweGlib');
|
||||
|
||||
@@ -17,7 +19,7 @@ $timestamp->set_gregorian_full(1983, 3, 7, 11, 54, 45, 0, 1);
|
||||
|
||||
my $moment = SweGlib::Moment->new();
|
||||
$moment->set_timestamp($timestamp);
|
||||
$moment->set_coordinates(19.0390999, 47.49801000, 280);
|
||||
$moment->set_coordinates(19.03991, 47.49801, 280);
|
||||
$moment->set_house_system("placidus");
|
||||
$moment->add_all_planets();
|
||||
|
||||
@@ -51,4 +53,3 @@ foreach my $antiscion (@{$all_antiscia}) {
|
||||
printf("%s is antiscion of %s on axis %s (±%.2f%%)\n", $planet1->get_planet_info()->get_name(), $planet2->get_planet_info()->get_name(), $antiscion->get_antiscion_axis_info()->get_name(), $antiscion->get_difference());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,6 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from gi.repository import SweGlib
|
||||
import math
|
||||
import codecs
|
||||
import sys
|
||||
|
||||
sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
|
||||
|
||||
SweGlib.init()
|
||||
|
||||
@@ -9,7 +13,7 @@ timestamp.set_gregorian_full(1983, 3, 7, 11, 54, 45, 0, 1)
|
||||
|
||||
moment = SweGlib.Moment()
|
||||
moment.set_timestamp(timestamp)
|
||||
moment.set_coordinates(19.03990999, 47.49801000, 280)
|
||||
moment.set_coordinates(19.03991, 47.49801, 280)
|
||||
moment.set_house_system(SweGlib.HouseSystem.PLACIDUS)
|
||||
moment.add_all_planets()
|
||||
|
||||
@@ -37,5 +41,4 @@ for antiscion in all_antiscia:
|
||||
planet1 = antiscion.get_planet1()
|
||||
planet2 = antiscion.get_planet2()
|
||||
|
||||
print "%s is antiscion of %s on axis %s (±%.2f%%)" % (planet1.get_planet_info().get_name(), planet2.get_planet_info().get_name(), antiscion.get_antiscion_axis_info().get_name(), antiscion.get_difference())
|
||||
|
||||
print u"%s is antiscion of %s on axis %s (±%.2f%%)" % (planet1.get_planet_info().get_name(), planet2.get_planet_info().get_name(), antiscion.get_antiscion_axis_info().get_name(), antiscion.get_difference())
|
||||
|
@@ -1,4 +1,7 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
include $(top_srcdir)/swe-glib.mk
|
||||
|
||||
AM_CPPFLAGS = -DG_LOG_DOMAIN=\"SWE-GLib\" -DLOCALEDIR=\"$(localedir)\" -D__SWE_GLIB_BUILDING__ -DPKGDATADIR=\"$(pkgdatadir)\"
|
||||
|
||||
lib_LTLIBRARIES = libswe-glib-2.0.la
|
||||
@@ -21,7 +24,9 @@ INST_H_SRC_FILES = \
|
||||
$(NULL)
|
||||
|
||||
INST_H_BUILT_FILES = \
|
||||
gswe-enumtypes.h
|
||||
gswe-enumtypes.h \
|
||||
gswe-version.h \
|
||||
$(NULL)
|
||||
|
||||
PRIV_H_SRC_FILES = \
|
||||
swe-glib-private.h \
|
||||
@@ -55,6 +60,7 @@ libswe_glib_2_0_la_SOURCES = \
|
||||
gswe-moment.c \
|
||||
gswe-timestamp.c \
|
||||
gswe-enumtypes.c \
|
||||
gswe-version.c \
|
||||
$(NULL)
|
||||
|
||||
libswe_glib_2_0_la_CFLAGS = $(GLIB_CFLAGS) $(GOBJECT_CFLAGS) -Wall
|
||||
|
@@ -30,7 +30,12 @@
|
||||
* The #GsweAntiscionAxisInfo stores information about an antiscion axis.
|
||||
*/
|
||||
|
||||
G_DEFINE_BOXED_TYPE(GsweAntiscionAxisInfo, gswe_antiscion_axis_info, (GBoxedCopyFunc)gswe_antiscion_axis_info_ref, (GBoxedFreeFunc)gswe_antiscion_axis_info_unref);
|
||||
G_DEFINE_BOXED_TYPE(
|
||||
GsweAntiscionAxisInfo,
|
||||
gswe_antiscion_axis_info,
|
||||
(GBoxedCopyFunc)gswe_antiscion_axis_info_ref,
|
||||
(GBoxedFreeFunc)gswe_antiscion_axis_info_unref
|
||||
);
|
||||
|
||||
static void
|
||||
gswe_antiscion_axis_info_free(GsweAntiscionAxisInfo *antiscion_axis_info)
|
||||
@@ -84,7 +89,8 @@ gswe_antiscion_axis_info_ref(GsweAntiscionAxisInfo *antiscion_axis_info)
|
||||
* gswe_antiscion_axis_info_unref:
|
||||
* @antiscion_axis_info: (in): a #GsweAntiscionAxisInfo
|
||||
*
|
||||
* Decreases reference count on @antiscion_axis_info. If reference count reaches zero, @antiscion_axis_info is freed.
|
||||
* Decreases reference count on @antiscion_axis_info. If reference count
|
||||
* reaches zero, @antiscion_axis_info is freed.
|
||||
*/
|
||||
void
|
||||
gswe_antiscion_axis_info_unref(GsweAntiscionAxisInfo *antiscion_axis_info)
|
||||
@@ -102,7 +108,9 @@ gswe_antiscion_axis_info_unref(GsweAntiscionAxisInfo *antiscion_axis_info)
|
||||
* Sets the axis ID.
|
||||
*/
|
||||
void
|
||||
gswe_antiscion_axis_info_set_axis(GsweAntiscionAxisInfo *antiscion_axis_info, GsweAntiscionAxis axis)
|
||||
gswe_antiscion_axis_info_set_axis(
|
||||
GsweAntiscionAxisInfo *antiscion_axis_info,
|
||||
GsweAntiscionAxis axis)
|
||||
{
|
||||
antiscion_axis_info->axis = axis;
|
||||
}
|
||||
@@ -124,12 +132,15 @@ gswe_antiscion_axis_info_get_axis(GsweAntiscionAxisInfo *antiscion_axis_info)
|
||||
/**
|
||||
* gswe_antiscion_axis_info_set_start_sign_info:
|
||||
* @antiscion_axis_info: (in): a #GsweAntiscionAxisInfo
|
||||
* @sign_info: a #GsweSignInfo to set as the starting sign of @antiscion_axis_info
|
||||
* @sign_info: a #GsweSignInfo to set as the starting sign of
|
||||
* @antiscion_axis_info
|
||||
*
|
||||
* Sets the starting sign of the axis.
|
||||
*/
|
||||
void
|
||||
gswe_antiscion_axis_info_set_start_sign_info(GsweAntiscionAxisInfo *antiscion_axis_info, GsweSignInfo *sign_info)
|
||||
gswe_antiscion_axis_info_set_start_sign_info(
|
||||
GsweAntiscionAxisInfo *antiscion_axis_info,
|
||||
GsweSignInfo *sign_info)
|
||||
{
|
||||
if (antiscion_axis_info->start_sign != NULL) {
|
||||
gswe_sign_info_unref(antiscion_axis_info->start_sign);
|
||||
@@ -144,10 +155,12 @@ gswe_antiscion_axis_info_set_start_sign_info(GsweAntiscionAxisInfo *antiscion_ax
|
||||
*
|
||||
* Gets the starting sign of the axis.
|
||||
*
|
||||
* Returns: (transfer none): the #GsweSignInfo of the sign in which this axis starts
|
||||
* Returns: (transfer none): the #GsweSignInfo of the sign in which this axis
|
||||
* starts
|
||||
*/
|
||||
GsweSignInfo *
|
||||
gswe_antiscion_axis_info_get_start_sign_info(GsweAntiscionAxisInfo *antiscion_axis_info)
|
||||
gswe_antiscion_axis_info_get_start_sign_info(
|
||||
GsweAntiscionAxisInfo *antiscion_axis_info)
|
||||
{
|
||||
return antiscion_axis_info->start_sign;
|
||||
}
|
||||
@@ -165,13 +178,23 @@ gswe_antiscion_axis_info_get_start_sign_info(GsweAntiscionAxisInfo *antiscion_ax
|
||||
* be found.
|
||||
*/
|
||||
void
|
||||
gswe_antiscion_axis_info_set_start_sign(GsweAntiscionAxisInfo *antiscion_axis_info, GsweZodiac sign, GError **err)
|
||||
gswe_antiscion_axis_info_set_start_sign(
|
||||
GsweAntiscionAxisInfo *antiscion_axis_info,
|
||||
GsweZodiac sign,
|
||||
GError **err)
|
||||
{
|
||||
GsweSignInfo *sign_info;
|
||||
|
||||
if ((sign_info = g_hash_table_lookup(gswe_sign_info_table, GINT_TO_POINTER(sign))) == NULL) {
|
||||
if ((sign_info = g_hash_table_lookup(
|
||||
gswe_sign_info_table,
|
||||
GINT_TO_POINTER(sign)
|
||||
)) == NULL) {
|
||||
g_warning("Trying to fetch an unregistered sign");
|
||||
g_set_error(err, GSWE_ERROR, GSWE_ERROR_UNKNOWN_SIGN, "The requested sign is not registered");
|
||||
g_set_error(
|
||||
err,
|
||||
GSWE_ERROR, GSWE_ERROR_UNKNOWN_SIGN,
|
||||
"The requested sign is not registered"
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -192,7 +215,8 @@ gswe_antiscion_axis_info_set_start_sign(GsweAntiscionAxisInfo *antiscion_axis_in
|
||||
* Returns: the corresponding sign ID
|
||||
*/
|
||||
GsweZodiac
|
||||
gswe_antiscion_axis_info_get_start_sign(GsweAntiscionAxisInfo *antiscion_axis_info)
|
||||
gswe_antiscion_axis_info_get_start_sign(
|
||||
GsweAntiscionAxisInfo *antiscion_axis_info)
|
||||
{
|
||||
if (antiscion_axis_info->start_sign) {
|
||||
return antiscion_axis_info->start_sign->sign;
|
||||
@@ -209,7 +233,9 @@ gswe_antiscion_axis_info_get_start_sign(GsweAntiscionAxisInfo *antiscion_axis_in
|
||||
* Sets the name of the axis
|
||||
*/
|
||||
void
|
||||
gswe_antiscion_axis_info_set_name(GsweAntiscionAxisInfo *antiscion_axis_info, const gchar *name)
|
||||
gswe_antiscion_axis_info_set_name(
|
||||
GsweAntiscionAxisInfo *antiscion_axis_info,
|
||||
const gchar *name)
|
||||
{
|
||||
if (antiscion_axis_info->name != NULL) {
|
||||
g_free(antiscion_axis_info->name);
|
||||
@@ -240,7 +266,9 @@ gswe_antiscion_axis_info_get_name(GsweAntiscionAxisInfo *antiscion_axis_info)
|
||||
* Sets the offset at which the axis starts.
|
||||
*/
|
||||
void
|
||||
gswe_antiscion_axis_info_set_sign_offset(GsweAntiscionAxisInfo *antiscion_axis_info, gdouble sign_offset)
|
||||
gswe_antiscion_axis_info_set_sign_offset(
|
||||
GsweAntiscionAxisInfo *antiscion_axis_info,
|
||||
gdouble sign_offset)
|
||||
{
|
||||
antiscion_axis_info->sign_offset = sign_offset;
|
||||
}
|
||||
@@ -254,7 +282,8 @@ gswe_antiscion_axis_info_set_sign_offset(GsweAntiscionAxisInfo *antiscion_axis_i
|
||||
* Returns: the offset, in degrees
|
||||
*/
|
||||
gdouble
|
||||
gswe_antiscion_axis_info_get_sign_offset(GsweAntiscionAxisInfo *antiscion_axis_info)
|
||||
gswe_antiscion_axis_info_get_sign_offset(
|
||||
GsweAntiscionAxisInfo *antiscion_axis_info)
|
||||
{
|
||||
return antiscion_axis_info->sign_offset;
|
||||
}
|
||||
|
@@ -28,8 +28,8 @@ G_BEGIN_DECLS
|
||||
/**
|
||||
* GsweAntiscionAxisInfo:
|
||||
*
|
||||
* <structname>GsweAntiscionAxisInfo</structname> is an opaque structure whose members
|
||||
* cannot be accessed directly.
|
||||
* <structname>GsweAntiscionAxisInfo</structname> is an opaque structure whose
|
||||
* members cannot be accessed directly.
|
||||
*
|
||||
* Since: 1.1
|
||||
*/
|
||||
@@ -40,23 +40,47 @@ GType gswe_antiscion_axis_info_get_type(void);
|
||||
|
||||
GsweAntiscionAxisInfo *gswe_antiscion_axis_info_new(void);
|
||||
|
||||
GsweAntiscionAxisInfo *gswe_antiscion_axis_info_ref(GsweAntiscionAxisInfo *antiscion_axis_info);
|
||||
void gswe_antiscion_axis_info_unref(GsweAntiscionAxisInfo *antiscion_axis_info);
|
||||
GsweAntiscionAxisInfo *gswe_antiscion_axis_info_ref(
|
||||
GsweAntiscionAxisInfo *antiscion_axis_info);
|
||||
|
||||
void gswe_antiscion_axis_info_set_axis(GsweAntiscionAxisInfo *antiscion_axis_info, GsweAntiscionAxis axis);
|
||||
GsweAntiscionAxis gswe_antiscion_axis_info_get_axis(GsweAntiscionAxisInfo *antiscion_axis_info);
|
||||
void gswe_antiscion_axis_info_unref(
|
||||
GsweAntiscionAxisInfo *antiscion_axis_info);
|
||||
|
||||
void gswe_antiscion_axis_info_set_start_sign_info(GsweAntiscionAxisInfo *antiscion_axis_info, GsweSignInfo *sign_info);
|
||||
GsweSignInfo *gswe_antiscion_axis_info_get_start_sign_info(GsweAntiscionAxisInfo *antiscion_axis_info);
|
||||
void gswe_antiscion_axis_info_set_axis(
|
||||
GsweAntiscionAxisInfo *antiscion_axis_info,
|
||||
GsweAntiscionAxis axis);
|
||||
|
||||
void gswe_antiscion_axis_info_set_start_sign(GsweAntiscionAxisInfo *antiscion_axis_info, GsweZodiac sign, GError **err);
|
||||
GsweZodiac gswe_antiscion_axis_info_get_start_sign(GsweAntiscionAxisInfo *antiscion_axis_info);
|
||||
GsweAntiscionAxis gswe_antiscion_axis_info_get_axis(
|
||||
GsweAntiscionAxisInfo *antiscion_axis_info);
|
||||
|
||||
void gswe_antiscion_axis_info_set_name(GsweAntiscionAxisInfo *antiscion_axis_info, const gchar *name);
|
||||
const gchar *gswe_antiscion_axis_info_get_name(GsweAntiscionAxisInfo *antiscion_axis_info);
|
||||
void gswe_antiscion_axis_info_set_start_sign_info(
|
||||
GsweAntiscionAxisInfo *antiscion_axis_info,
|
||||
GsweSignInfo *sign_info);
|
||||
|
||||
void gswe_antiscion_axis_info_set_sign_offset(GsweAntiscionAxisInfo *antiscion_axis_info, gdouble sign_offset);
|
||||
gdouble gswe_antiscion_axis_info_get_sign_offset(GsweAntiscionAxisInfo *antiscion_axis_info);
|
||||
GsweSignInfo *gswe_antiscion_axis_info_get_start_sign_info(
|
||||
GsweAntiscionAxisInfo *antiscion_axis_info);
|
||||
|
||||
void gswe_antiscion_axis_info_set_start_sign(
|
||||
GsweAntiscionAxisInfo *antiscion_axis_info,
|
||||
GsweZodiac sign,
|
||||
GError **err);
|
||||
|
||||
GsweZodiac gswe_antiscion_axis_info_get_start_sign(
|
||||
GsweAntiscionAxisInfo *antiscion_axis_info);
|
||||
|
||||
void gswe_antiscion_axis_info_set_name(
|
||||
GsweAntiscionAxisInfo *antiscion_axis_info,
|
||||
const gchar *name);
|
||||
|
||||
const gchar *gswe_antiscion_axis_info_get_name(
|
||||
GsweAntiscionAxisInfo *antiscion_axis_info);
|
||||
|
||||
void gswe_antiscion_axis_info_set_sign_offset(
|
||||
GsweAntiscionAxisInfo *antiscion_axis_info,
|
||||
gdouble sign_offset);
|
||||
|
||||
gdouble gswe_antiscion_axis_info_get_sign_offset(
|
||||
GsweAntiscionAxisInfo *antiscion_axis_info);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -33,7 +33,8 @@ struct _GsweAntiscionData {
|
||||
/* the #GsweAntiscionAxisInfo structure associated with this antiscion */
|
||||
GsweAntiscionAxisInfo *antiscion_axis_info;
|
||||
|
||||
/* the difference in degrees between an exact antiscion and this given antiscion */
|
||||
/* the difference in degrees between an exact antiscion and this given
|
||||
* antiscion */
|
||||
gdouble difference;
|
||||
|
||||
/* reference count */
|
||||
|
@@ -35,7 +35,12 @@
|
||||
* between two planets, based on a specified axis.
|
||||
*/
|
||||
|
||||
G_DEFINE_BOXED_TYPE(GsweAntiscionData, gswe_antiscion_data, (GBoxedCopyFunc)gswe_antiscion_data_ref, (GBoxedFreeFunc)gswe_antiscion_data_unref);
|
||||
G_DEFINE_BOXED_TYPE(
|
||||
GsweAntiscionData,
|
||||
gswe_antiscion_data,
|
||||
(GBoxedCopyFunc)gswe_antiscion_data_ref,
|
||||
(GBoxedFreeFunc)gswe_antiscion_data_unref
|
||||
);
|
||||
|
||||
static void
|
||||
gswe_antiscion_data_free(GsweAntiscionData *antiscion_data)
|
||||
@@ -51,6 +56,8 @@ gswe_antiscion_data_free(GsweAntiscionData *antiscion_data)
|
||||
if (antiscion_data->antiscion_axis_info) {
|
||||
gswe_antiscion_axis_info_unref(antiscion_data->antiscion_axis_info);
|
||||
}
|
||||
|
||||
g_free(antiscion_data);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,15 +81,20 @@ gswe_antiscion_data_new(void)
|
||||
/*
|
||||
* find_antiscion:
|
||||
* @axis_p: a pointer made with GINT_TO_POINTER(), holding the antiscion axis ID
|
||||
* @antiscion_axis_info: a GsweAntiscionAxisInfo, which will be checked against @antiscion_data
|
||||
* @antiscion_data: a GsweAntiscionData, whose planets' positions will be checked against @antiscion_axis_info
|
||||
* @antiscion_axis_info: a GsweAntiscionAxisInfo, which will be checked against
|
||||
* @antiscion_data
|
||||
* @antiscion_data: a GsweAntiscionData, whose planets' positions will be
|
||||
* checked against @antiscion_axis_info
|
||||
*
|
||||
* This function is called internally by gswe_antiscion_data_calculate() to
|
||||
* check if the two planets in @antiscion_data are antiscia of each other on
|
||||
* the axis in @antiscion_axis_info
|
||||
*/
|
||||
static gboolean
|
||||
find_antiscion(gpointer axis_p, GsweAntiscionAxisInfo *antiscion_axis_info, GsweAntiscionData *antiscion_data)
|
||||
find_antiscion(
|
||||
gpointer axis_p,
|
||||
GsweAntiscionAxisInfo *antiscion_axis_info,
|
||||
GsweAntiscionData *antiscion_data)
|
||||
{
|
||||
GsweAntiscionAxis axis;
|
||||
gdouble start_point,
|
||||
@@ -93,7 +105,10 @@ find_antiscion(gpointer axis_p, GsweAntiscionAxisInfo *antiscion_axis_info, Gswe
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
planet_orb = fmin(antiscion_data->planet1->planet_info->orb, antiscion_data->planet2->planet_info->orb);
|
||||
planet_orb = fmin(
|
||||
antiscion_data->planet1->planet_info->orb,
|
||||
antiscion_data->planet2->planet_info->orb
|
||||
);
|
||||
start_point = (antiscion_axis_info->start_sign->sign - 1) * 30.0;
|
||||
|
||||
start_point += antiscion_axis_info->sign_offset;
|
||||
@@ -104,7 +119,9 @@ find_antiscion(gpointer axis_p, GsweAntiscionAxisInfo *antiscion_axis_info, Gswe
|
||||
axis_position += 360.0;
|
||||
}
|
||||
|
||||
if ((antiscion_data->difference = fabs(antiscion_data->planet2->position - axis_position)) <= planet_orb) {
|
||||
if ((antiscion_data->difference = fabs(
|
||||
antiscion_data->planet2->position - axis_position
|
||||
)) <= planet_orb) {
|
||||
antiscion_data->antiscion_axis_info = antiscion_axis_info;
|
||||
|
||||
return TRUE;
|
||||
@@ -137,8 +154,17 @@ find_antiscion(gpointer axis_p, GsweAntiscionAxisInfo *antiscion_axis_info, Gswe
|
||||
void
|
||||
gswe_antiscion_data_calculate(GsweAntiscionData *antiscion_data)
|
||||
{
|
||||
if ((antiscion_data->antiscion_axis_info = g_hash_table_find(gswe_antiscion_axis_info_table, (GHRFunc)find_antiscion, antiscion_data)) == NULL) {
|
||||
antiscion_data->antiscion_axis_info = gswe_antiscion_axis_info_ref(g_hash_table_lookup(gswe_antiscion_axis_info_table, GINT_TO_POINTER(GSWE_ANTISCION_AXIS_NONE)));
|
||||
if ((antiscion_data->antiscion_axis_info = g_hash_table_find(
|
||||
gswe_antiscion_axis_info_table,
|
||||
(GHRFunc)find_antiscion,
|
||||
antiscion_data
|
||||
)) == NULL) {
|
||||
antiscion_data->antiscion_axis_info = gswe_antiscion_axis_info_ref(
|
||||
g_hash_table_lookup(
|
||||
gswe_antiscion_axis_info_table,
|
||||
GINT_TO_POINTER(GSWE_ANTISCION_AXIS_NONE)
|
||||
)
|
||||
);
|
||||
} else {
|
||||
gswe_antiscion_axis_info_ref(antiscion_data->antiscion_axis_info);
|
||||
}
|
||||
@@ -155,7 +181,9 @@ gswe_antiscion_data_calculate(GsweAntiscionData *antiscion_data)
|
||||
* Returns: (transfer full): a new #GsweAntiscionData
|
||||
*/
|
||||
GsweAntiscionData *
|
||||
gswe_antiscion_data_new_with_planets(GswePlanetData *planet1, GswePlanetData *planet2)
|
||||
gswe_antiscion_data_new_with_planets(
|
||||
GswePlanetData *planet1,
|
||||
GswePlanetData *planet2)
|
||||
{
|
||||
GsweAntiscionData *ret;
|
||||
|
||||
@@ -188,11 +216,16 @@ gswe_antiscion_data_ref(GsweAntiscionData *antiscion_data)
|
||||
* gswe_antiscion_data_unref:
|
||||
* @antiscion_data: (in): a #GsweAntiscionData
|
||||
*
|
||||
* Decreases reference count on @antiscion_data. If reference count reaches zero, @antiscion_data is freed.
|
||||
* Decreases reference count on @antiscion_data. If reference count reaches
|
||||
* zero, @antiscion_data is freed.
|
||||
*/
|
||||
void
|
||||
gswe_antiscion_data_unref(GsweAntiscionData *antiscion_data)
|
||||
{
|
||||
if (antiscion_data == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (--antiscion_data->refcount == 0) {
|
||||
gswe_antiscion_data_free(antiscion_data);
|
||||
}
|
||||
@@ -206,7 +239,9 @@ gswe_antiscion_data_unref(GsweAntiscionData *antiscion_data)
|
||||
* Sets @planet1 as the first planet of the antiscion.
|
||||
*/
|
||||
void
|
||||
gswe_antiscion_data_set_planet1(GsweAntiscionData *antiscion_data, GswePlanetData *planet1)
|
||||
gswe_antiscion_data_set_planet1(
|
||||
GsweAntiscionData *antiscion_data,
|
||||
GswePlanetData *planet1)
|
||||
{
|
||||
if (antiscion_data->planet1) {
|
||||
gswe_planet_data_unref(antiscion_data->planet1);
|
||||
@@ -221,7 +256,8 @@ gswe_antiscion_data_set_planet1(GsweAntiscionData *antiscion_data, GswePlanetDat
|
||||
*
|
||||
* Gets the first in the antiscion relationship.
|
||||
*
|
||||
* Returns: (transfer none): The #GswePlanetData associated with the first planet.
|
||||
* Returns: (transfer none): The #GswePlanetData associated with the first
|
||||
* planet.
|
||||
*/
|
||||
GswePlanetData *
|
||||
gswe_antiscion_data_get_planet1(GsweAntiscionData *antiscion_data)
|
||||
@@ -237,7 +273,9 @@ gswe_antiscion_data_get_planet1(GsweAntiscionData *antiscion_data)
|
||||
* Sets @planet2 as the second planet of the antiscion.
|
||||
*/
|
||||
void
|
||||
gswe_antiscion_data_set_planet2(GsweAntiscionData *antiscion_data, GswePlanetData *planet2)
|
||||
gswe_antiscion_data_set_planet2(
|
||||
GsweAntiscionData *antiscion_data,
|
||||
GswePlanetData *planet2)
|
||||
{
|
||||
if (antiscion_data->planet2) {
|
||||
gswe_planet_data_unref(antiscion_data->planet2);
|
||||
@@ -252,7 +290,8 @@ gswe_antiscion_data_set_planet2(GsweAntiscionData *antiscion_data, GswePlanetDat
|
||||
*
|
||||
* Gets the second in the antiscion relationship.
|
||||
*
|
||||
* Returns: (transfer none): The #GswePlanetData associated with the second planet.
|
||||
* Returns: (transfer none): The #GswePlanetData associated with the second
|
||||
* planet.
|
||||
*/
|
||||
GswePlanetData *
|
||||
gswe_antiscion_data_get_planet2(GsweAntiscionData *antiscion_data)
|
||||
@@ -271,12 +310,22 @@ gswe_antiscion_data_get_planet2(GsweAntiscionData *antiscion_data)
|
||||
* the axis is not known.
|
||||
*/
|
||||
void
|
||||
gswe_antiscion_data_set_axis(GsweAntiscionData *antiscion_data, GsweAntiscionAxis axis, GError **err)
|
||||
gswe_antiscion_data_set_axis(
|
||||
GsweAntiscionData *antiscion_data,
|
||||
GsweAntiscionAxis axis,
|
||||
GError **err)
|
||||
{
|
||||
GsweAntiscionAxisInfo *antiscion_axis_info;
|
||||
|
||||
if ((antiscion_axis_info = g_hash_table_lookup(gswe_antiscion_axis_info_table, GINT_TO_POINTER(axis))) == NULL) {
|
||||
g_set_error(err, GSWE_ERROR, GSWE_ERROR_UNKNOWN_ANTISCION_AXIS, "Unknown antiscion axis");
|
||||
if ((antiscion_axis_info = g_hash_table_lookup(
|
||||
gswe_antiscion_axis_info_table,
|
||||
GINT_TO_POINTER(axis)
|
||||
)) == NULL) {
|
||||
g_set_error(
|
||||
err,
|
||||
GSWE_ERROR, GSWE_ERROR_UNKNOWN_ANTISCION_AXIS,
|
||||
"Unknown antiscion axis"
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -285,7 +334,9 @@ gswe_antiscion_data_set_axis(GsweAntiscionData *antiscion_data, GsweAntiscionAxi
|
||||
gswe_antiscion_axis_info_unref(antiscion_data->antiscion_axis_info);
|
||||
}
|
||||
|
||||
antiscion_data->antiscion_axis_info = gswe_antiscion_axis_info_ref(antiscion_axis_info);
|
||||
antiscion_data->antiscion_axis_info = gswe_antiscion_axis_info_ref(
|
||||
antiscion_axis_info
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -314,13 +365,17 @@ gswe_antiscion_data_get_axis(GsweAntiscionData *antiscion_data)
|
||||
* Sets @antiscion_axis_info as the axis of this #GsweAntiscionData.
|
||||
*/
|
||||
void
|
||||
gswe_antiscion_data_set_antiscion_axis_info(GsweAntiscionData *antiscion_data, GsweAntiscionAxisInfo *antiscion_axis_info)
|
||||
gswe_antiscion_data_set_antiscion_axis_info(
|
||||
GsweAntiscionData *antiscion_data,
|
||||
GsweAntiscionAxisInfo *antiscion_axis_info)
|
||||
{
|
||||
if (antiscion_data->antiscion_axis_info) {
|
||||
gswe_antiscion_axis_info_unref(antiscion_data->antiscion_axis_info);
|
||||
}
|
||||
|
||||
antiscion_data->antiscion_axis_info = gswe_antiscion_axis_info_ref(antiscion_axis_info);
|
||||
antiscion_data->antiscion_axis_info = gswe_antiscion_axis_info_ref(
|
||||
antiscion_axis_info
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -329,7 +384,8 @@ gswe_antiscion_data_set_antiscion_axis_info(GsweAntiscionData *antiscion_data, G
|
||||
*
|
||||
* Gets the axis information related to the antiscion relationship's axis.
|
||||
*
|
||||
* Returns: (transfer none): the #GsweAntiscionAxisInfo associated with this axis
|
||||
* Returns: (transfer none): the #GsweAntiscionAxisInfo associated with this
|
||||
* axis
|
||||
*/
|
||||
GsweAntiscionAxisInfo *
|
||||
gswe_antiscion_data_get_antiscion_axis_info(GsweAntiscionData *antiscion_data)
|
||||
@@ -345,7 +401,9 @@ gswe_antiscion_data_get_antiscion_axis_info(GsweAntiscionData *antiscion_data)
|
||||
* Sets the difference of this antiscion from an exact antiscion.
|
||||
*/
|
||||
void
|
||||
gswe_antiscion_data_set_difference(GsweAntiscionData *antiscion_data, gdouble difference)
|
||||
gswe_antiscion_data_set_difference(
|
||||
GsweAntiscionData *antiscion_data,
|
||||
gdouble difference)
|
||||
{
|
||||
antiscion_data->difference = difference;
|
||||
}
|
||||
@@ -354,7 +412,8 @@ gswe_antiscion_data_set_difference(GsweAntiscionData *antiscion_data, gdouble di
|
||||
* gswe_antiscion_data_get_difference:
|
||||
* @antiscion_data: (in): a #GsweAntiscionData
|
||||
*
|
||||
* Gets the difference between an exact antiscion and this antiscion relationship.
|
||||
* Gets the difference between an exact antiscion and this antiscion
|
||||
* relationship.
|
||||
*
|
||||
* Returns: the difference, in degrees
|
||||
*/
|
||||
|
@@ -28,8 +28,8 @@ G_BEGIN_DECLS
|
||||
/**
|
||||
* GsweAntiscionData:
|
||||
*
|
||||
* <structname>GsweAntiscionData</structname> is an opaque structure whose members
|
||||
* cannot be accessed directly.
|
||||
* <structname>GsweAntiscionData</structname> is an opaque structure whose
|
||||
* members cannot be accessed directly.
|
||||
*
|
||||
* Since: 1.1
|
||||
*/
|
||||
@@ -39,21 +39,37 @@ GType gswe_antiscion_data_get_type(void);
|
||||
#define GSWE_TYPE_ANTISCION_DATA (gswe_antiscion_data_get_type())
|
||||
|
||||
GsweAntiscionData *gswe_antiscion_data_new(void);
|
||||
GsweAntiscionData *gswe_antiscion_data_new_with_planets(GswePlanetData *planet1, GswePlanetData *planet2);
|
||||
|
||||
GsweAntiscionData *gswe_antiscion_data_new_with_planets(
|
||||
GswePlanetData *planet1,
|
||||
GswePlanetData *planet2);
|
||||
|
||||
GsweAntiscionData *gswe_antiscion_data_ref(GsweAntiscionData *antiscion_data);
|
||||
|
||||
void gswe_antiscion_data_unref(GsweAntiscionData *antiscion_data);
|
||||
|
||||
void gswe_antiscion_data_calculate(GsweAntiscionData *antiscion_data);
|
||||
|
||||
void gswe_antiscion_data_set_planet1(GsweAntiscionData *antiscion_data, GswePlanetData *planet1);
|
||||
GswePlanetData *gswe_antiscion_data_get_planet1(GsweAntiscionData *antiscion_data);
|
||||
void gswe_antiscion_data_set_planet1(
|
||||
GsweAntiscionData *antiscion_data,
|
||||
GswePlanetData *planet1);
|
||||
|
||||
void gswe_antiscion_data_set_planet2(GsweAntiscionData *antiscion_data, GswePlanetData *planet2);
|
||||
GswePlanetData *gswe_antiscion_data_get_planet2(GsweAntiscionData *antiscion_data);
|
||||
GswePlanetData *gswe_antiscion_data_get_planet1(
|
||||
GsweAntiscionData *antiscion_data);
|
||||
|
||||
void gswe_antiscion_data_set_planet2(
|
||||
GsweAntiscionData *antiscion_data,
|
||||
GswePlanetData *planet2);
|
||||
|
||||
GswePlanetData *gswe_antiscion_data_get_planet2(
|
||||
GsweAntiscionData *antiscion_data);
|
||||
|
||||
GsweAntiscionAxis gswe_antiscion_data_get_axis(
|
||||
GsweAntiscionData *antiscion_data);
|
||||
|
||||
GsweAntiscionAxisInfo *gswe_antiscion_data_get_antiscion_axis_info(
|
||||
GsweAntiscionData *antiscion_data);
|
||||
|
||||
GsweAntiscionAxis gswe_antiscion_data_get_axis(GsweAntiscionData *antiscion_data);
|
||||
GsweAntiscionAxisInfo *gswe_antiscion_data_get_antiscion_axis_info(GsweAntiscionData *antiscion_data);
|
||||
gdouble gswe_antiscion_data_get_difference(GsweAntiscionData *antiscion_data);
|
||||
|
||||
G_END_DECLS
|
||||
|
@@ -35,7 +35,8 @@ struct _GsweAspectData {
|
||||
/* the #GsweAspectInfo structure associated with the aspect */
|
||||
GsweAspectInfo *aspect_info;
|
||||
|
||||
/* the difference in percent between an exact aspect and this given aspect */
|
||||
/* the difference in percent between an exact aspect and this given
|
||||
* aspect */
|
||||
gdouble difference;
|
||||
|
||||
/* reference count */
|
||||
|
@@ -38,7 +38,12 @@
|
||||
* #GsweAspectData is a structure that represents two planets relation to each
|
||||
* other, like their aspect and the aspect's difference from an exact aspect.
|
||||
*/
|
||||
G_DEFINE_BOXED_TYPE(GsweAspectData, gswe_aspect_data, (GBoxedCopyFunc)gswe_aspect_data_ref, (GBoxedFreeFunc)gswe_aspect_data_unref);
|
||||
G_DEFINE_BOXED_TYPE(
|
||||
GsweAspectData,
|
||||
gswe_aspect_data,
|
||||
(GBoxedCopyFunc)gswe_aspect_data_ref,
|
||||
(GBoxedFreeFunc)gswe_aspect_data_unref
|
||||
);
|
||||
|
||||
static void
|
||||
gswe_aspect_data_free(GsweAspectData *aspect_data)
|
||||
@@ -62,20 +67,27 @@ gswe_aspect_data_free(GsweAspectData *aspect_data)
|
||||
* find_aspect:
|
||||
* @aspect_p: a pointer made with GINT_TO_POINTER(), holding the aspect ID
|
||||
* @aspect_info: a GsweAspectInfo, which will be checked against @aspect_data
|
||||
* @aspect_data: a GsweAspectData, whose planets' positions will be checked against @aspect_info
|
||||
* @aspect_data: a GsweAspectData, whose planets' positions will be checked
|
||||
* against @aspect_info
|
||||
*
|
||||
* This function is called internally by gswe_aspect_data_calculate() to check
|
||||
* if the two planets in @aspect_data are in aspect according to @aspect_info
|
||||
*/
|
||||
static gboolean
|
||||
find_aspect(gpointer aspect_p, GsweAspectInfo *aspect_info, GsweAspectData *aspect_data)
|
||||
find_aspect(
|
||||
gpointer aspect_p,
|
||||
GsweAspectInfo *aspect_info,
|
||||
GsweAspectData *aspect_data)
|
||||
{
|
||||
gdouble diff,
|
||||
planet_orb,
|
||||
aspect_orb;
|
||||
|
||||
diff = fabs(aspect_info->size - aspect_data->distance);
|
||||
planet_orb = fmin(aspect_data->planet1->planet_info->orb, aspect_data->planet2->planet_info->orb);
|
||||
planet_orb = fmin(
|
||||
aspect_data->planet1->planet_info->orb,
|
||||
aspect_data->planet2->planet_info->orb
|
||||
);
|
||||
aspect_orb = fmax(1.0, planet_orb - aspect_info->orb_modifier);
|
||||
|
||||
if (diff < aspect_orb) {
|
||||
@@ -84,7 +96,8 @@ find_aspect(gpointer aspect_p, GsweAspectInfo *aspect_info, GsweAspectData *aspe
|
||||
if (aspect_info->size == 0) {
|
||||
aspect_data->difference = (1 - ((360.0 - diff) / 360.0)) * 100.0;
|
||||
} else {
|
||||
aspect_data->difference = (1 - ((aspect_info->size - diff) / aspect_info->size)) * 100.0;
|
||||
aspect_data->difference = (1
|
||||
- ((aspect_info->size - diff) / aspect_info->size)) * 100.0;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@@ -96,12 +109,23 @@ find_aspect(gpointer aspect_p, GsweAspectInfo *aspect_info, GsweAspectData *aspe
|
||||
void
|
||||
gswe_aspect_data_calculate(GsweAspectData *aspect_data)
|
||||
{
|
||||
if ((aspect_data->distance = fabs(aspect_data->planet1->position - aspect_data->planet2->position)) > 180.0) {
|
||||
if ((aspect_data->distance = fabs(
|
||||
aspect_data->planet1->position
|
||||
- aspect_data->planet2->position
|
||||
)) > 180.0) {
|
||||
aspect_data->distance = 360.0 - aspect_data->distance;
|
||||
}
|
||||
|
||||
if ((aspect_data->aspect_info = g_hash_table_find(gswe_aspect_info_table, (GHRFunc)find_aspect, aspect_data)) == NULL) {
|
||||
aspect_data->aspect_info = gswe_aspect_info_ref(g_hash_table_lookup(gswe_aspect_info_table, GINT_TO_POINTER(GSWE_ASPECT_NONE)));
|
||||
if ((aspect_data->aspect_info = g_hash_table_find(
|
||||
gswe_aspect_info_table,
|
||||
(GHRFunc)find_aspect, aspect_data
|
||||
)) == NULL) {
|
||||
aspect_data->aspect_info = gswe_aspect_info_ref(
|
||||
g_hash_table_lookup(
|
||||
gswe_aspect_info_table,
|
||||
GINT_TO_POINTER(GSWE_ASPECT_NONE)
|
||||
)
|
||||
);
|
||||
} else {
|
||||
gswe_aspect_info_ref(aspect_data->aspect_info);
|
||||
}
|
||||
@@ -138,7 +162,9 @@ gswe_aspect_data_new(void)
|
||||
* Returns: (transfer full): a new #GsweAspectData with all data set.
|
||||
*/
|
||||
GsweAspectData *
|
||||
gswe_aspect_data_new_with_planets(GswePlanetData *planet1, GswePlanetData *planet2)
|
||||
gswe_aspect_data_new_with_planets(
|
||||
GswePlanetData *planet1,
|
||||
GswePlanetData *planet2)
|
||||
{
|
||||
GsweAspectData *ret;
|
||||
|
||||
@@ -171,11 +197,16 @@ gswe_aspect_data_ref(GsweAspectData *aspect_data)
|
||||
* gswe_aspect_data_unref:
|
||||
* @aspect_data: (in): a #GsweAspectData
|
||||
*
|
||||
* Decreases reference count on @aspect_data. If reference count reaches zero, @aspect_data is freed.
|
||||
* Decreases reference count on @aspect_data. If reference count reaches zero,
|
||||
* @aspect_data is freed.
|
||||
*/
|
||||
void
|
||||
gswe_aspect_data_unref(GsweAspectData *aspect_data)
|
||||
{
|
||||
if (aspect_data == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (--aspect_data->refcount == 0) {
|
||||
gswe_aspect_data_free(aspect_data);
|
||||
}
|
||||
@@ -189,7 +220,9 @@ gswe_aspect_data_unref(GsweAspectData *aspect_data)
|
||||
* Sets @planet1 as the first planet of the aspect.
|
||||
*/
|
||||
void
|
||||
gswe_aspect_data_set_planet1(GsweAspectData *aspect_data, GswePlanetData *planet1)
|
||||
gswe_aspect_data_set_planet1(
|
||||
GsweAspectData *aspect_data,
|
||||
GswePlanetData *planet1)
|
||||
{
|
||||
if (aspect_data->planet1) {
|
||||
gswe_planet_data_unref(aspect_data->planet1);
|
||||
@@ -197,7 +230,7 @@ gswe_aspect_data_set_planet1(GsweAspectData *aspect_data, GswePlanetData *planet
|
||||
|
||||
aspect_data->planet1 = gswe_planet_data_ref(planet1);
|
||||
|
||||
if (aspect_data->planet2) {
|
||||
if (planet1 && aspect_data->planet2) {
|
||||
gswe_aspect_data_calculate(aspect_data);
|
||||
}
|
||||
}
|
||||
@@ -208,7 +241,8 @@ gswe_aspect_data_set_planet1(GsweAspectData *aspect_data, GswePlanetData *planet
|
||||
*
|
||||
* Gets the first planet in the aspect.
|
||||
*
|
||||
* Returns: (transfer none): The #GswePlanetData associated with the first planet
|
||||
* Returns: (transfer none): The #GswePlanetData associated with the first
|
||||
* planet
|
||||
*/
|
||||
GswePlanetData *
|
||||
gswe_aspect_data_get_planet1(GsweAspectData *aspect_data)
|
||||
@@ -224,7 +258,9 @@ gswe_aspect_data_get_planet1(GsweAspectData *aspect_data)
|
||||
* Sets @planet2 as the second planet of the aspect.
|
||||
*/
|
||||
void
|
||||
gswe_aspect_data_set_planet2(GsweAspectData *aspect_data, GswePlanetData *planet2)
|
||||
gswe_aspect_data_set_planet2(
|
||||
GsweAspectData *aspect_data,
|
||||
GswePlanetData *planet2)
|
||||
{
|
||||
if (aspect_data->planet2) {
|
||||
gswe_planet_data_unref(aspect_data->planet2);
|
||||
@@ -232,7 +268,7 @@ gswe_aspect_data_set_planet2(GsweAspectData *aspect_data, GswePlanetData *planet
|
||||
|
||||
aspect_data->planet2 = gswe_planet_data_ref(planet2);
|
||||
|
||||
if (aspect_data->planet1) {
|
||||
if (aspect_data->planet1 && planet2) {
|
||||
gswe_aspect_data_calculate(aspect_data);
|
||||
}
|
||||
}
|
||||
@@ -243,7 +279,8 @@ gswe_aspect_data_set_planet2(GsweAspectData *aspect_data, GswePlanetData *planet
|
||||
*
|
||||
* Gets the second planet in the aspect.
|
||||
*
|
||||
* Returns: (transfer none): The #GswePlanetData associated with the second planet
|
||||
* Returns: (transfer none): The #GswePlanetData associated with the second
|
||||
* planet
|
||||
*/
|
||||
GswePlanetData *
|
||||
gswe_aspect_data_get_planet2(GsweAspectData *aspect_data)
|
||||
|
@@ -37,23 +37,37 @@ G_BEGIN_DECLS
|
||||
typedef struct _GsweAspectData GsweAspectData;
|
||||
|
||||
GType gswe_aspect_data_get_type(void);
|
||||
|
||||
#define GSWE_TYPE_ASPECT_DATA (gswe_aspect_data_get_type())
|
||||
|
||||
GsweAspectData *gswe_aspect_data_new(void);
|
||||
GsweAspectData *gswe_aspect_data_new_with_planets(GswePlanetData *planet1, GswePlanetData *planet2);
|
||||
|
||||
GsweAspectData *gswe_aspect_data_new_with_planets(
|
||||
GswePlanetData *planet1,
|
||||
GswePlanetData *planet2);
|
||||
|
||||
GsweAspectData *gswe_aspect_data_ref(GsweAspectData *aspect_data);
|
||||
|
||||
void gswe_aspect_data_unref(GsweAspectData *aspect_data);
|
||||
|
||||
void gswe_aspect_data_set_planet1(GsweAspectData *aspect_data, GswePlanetData *planet1);
|
||||
void gswe_aspect_data_set_planet1(
|
||||
GsweAspectData *aspect_data,
|
||||
GswePlanetData *planet1);
|
||||
|
||||
GswePlanetData *gswe_aspect_data_get_planet1(GsweAspectData *aspect_data);
|
||||
|
||||
void gswe_aspect_data_set_planet2(GsweAspectData *aspect_data, GswePlanetData *planet2);
|
||||
void gswe_aspect_data_set_planet2(
|
||||
GsweAspectData *aspect_data,
|
||||
GswePlanetData *planet2);
|
||||
|
||||
GswePlanetData *gswe_aspect_data_get_planet2(GsweAspectData *aspect_data);
|
||||
|
||||
gdouble gswe_aspect_data_get_distance(GsweAspectData *aspect_data);
|
||||
|
||||
GsweAspect gswe_aspect_data_get_aspect(GsweAspectData *aspect_data);
|
||||
|
||||
GsweAspectInfo *gswe_aspect_data_get_aspect_info(GsweAspectData *aspect_data);
|
||||
|
||||
gdouble gswe_aspect_data_get_difference(GsweAspectData *aspect_data);
|
||||
|
||||
G_END_DECLS
|
||||
|
@@ -32,7 +32,8 @@ struct _GsweAspectInfo {
|
||||
/* the size of the aspect, in degrees */
|
||||
guint size;
|
||||
|
||||
/* the modifier of the orb (the maximum allowable difference from an exact orb) */
|
||||
/* the modifier of the orb (the maximum allowable difference from an exact
|
||||
* orb) */
|
||||
gdouble orb_modifier;
|
||||
|
||||
/* shows whether this aspect is harmonic or not */
|
||||
|
@@ -37,7 +37,12 @@
|
||||
* possible; until then, you should never use such functions.</para></warning>
|
||||
*/
|
||||
|
||||
G_DEFINE_BOXED_TYPE(GsweAspectInfo, gswe_aspect_info, (GBoxedCopyFunc)gswe_aspect_info_ref, (GBoxedFreeFunc)gswe_aspect_info_unref);
|
||||
G_DEFINE_BOXED_TYPE(
|
||||
GsweAspectInfo,
|
||||
gswe_aspect_info,
|
||||
(GBoxedCopyFunc)gswe_aspect_info_ref,
|
||||
(GBoxedFreeFunc)gswe_aspect_info_unref
|
||||
);
|
||||
|
||||
static void
|
||||
gswe_aspect_info_free(GsweAspectInfo *aspect_info)
|
||||
@@ -194,7 +199,9 @@ gswe_aspect_info_get_size(GsweAspectInfo *aspect_info)
|
||||
* between two positions exceeds this limit, the aspect is not considered.
|
||||
*/
|
||||
void
|
||||
gswe_aspect_info_set_orb_modifier(GsweAspectInfo *aspect_info, gdouble orb_modifier)
|
||||
gswe_aspect_info_set_orb_modifier(
|
||||
GsweAspectInfo *aspect_info,
|
||||
gdouble orb_modifier)
|
||||
{
|
||||
aspect_info->orb_modifier = orb_modifier;
|
||||
}
|
||||
@@ -217,7 +224,8 @@ gswe_aspect_info_get_orb_modifier(GsweAspectInfo *aspect_info)
|
||||
/**
|
||||
* gswe_aspect_info_set_harmonic:
|
||||
* @aspect_info: (in): a #GsweAspectInfo
|
||||
* @harmonic: TRUE, if @aspect_info should be considered harmonic; FALSE otherwise
|
||||
* @harmonic: TRUE, if @aspect_info should be considered harmonic; FALSE
|
||||
* otherwise
|
||||
*
|
||||
* Sets the harmonic state of @aspect_info.
|
||||
*/
|
||||
@@ -244,11 +252,13 @@ gswe_aspect_info_get_harmonic(GsweAspectInfo *aspect_info)
|
||||
/**
|
||||
* gswe_aspect_info_set_major:
|
||||
* @aspect_info: (in): a #GsweAspectInfo
|
||||
* @major: TRUE, if @aspect_info should be considered major (Ptolemaic); FALSE otherwise
|
||||
* @major: TRUE, if @aspect_info should be considered major (Ptolemaic); FALSE
|
||||
* otherwise
|
||||
*
|
||||
* Sets the major state of @aspect_info.
|
||||
*
|
||||
* <note><para>As all Ptolemaic aspects are registered during gswe_init(), you should never set @major to TRUE on new aspects.</para></note>
|
||||
* <note><para>As all Ptolemaic aspects are registered during gswe_init(), you
|
||||
* should never set @major to TRUE on new aspects.</para></note>
|
||||
*/
|
||||
void
|
||||
gswe_aspect_info_set_major(GsweAspectInfo *aspect_info, gboolean major)
|
||||
|
@@ -40,21 +40,33 @@ GType gswe_aspect_info_get_type(void);
|
||||
GsweAspectInfo *gswe_aspect_info_new(void);
|
||||
|
||||
GsweAspectInfo *gswe_aspect_info_ref(GsweAspectInfo *aspect_info);
|
||||
|
||||
void gswe_aspect_info_unref(GsweAspectInfo *aspect_info);
|
||||
|
||||
void gswe_aspect_info_set_aspect(GsweAspectInfo *aspect_info, GsweAspect aspect);
|
||||
void gswe_aspect_info_set_aspect(
|
||||
GsweAspectInfo *aspect_info,
|
||||
GsweAspect aspect);
|
||||
|
||||
GsweAspect gswe_aspect_info_get_aspect(GsweAspectInfo *aspect_info);
|
||||
|
||||
void gswe_aspect_info_set_name(GsweAspectInfo *aspect_info, const gchar *name);
|
||||
|
||||
const gchar *gswe_aspect_info_get_name(GsweAspectInfo *aspect_info);
|
||||
|
||||
void gswe_aspect_info_set_size(GsweAspectInfo *aspect_info, gdouble size);
|
||||
|
||||
gdouble gswe_aspect_info_get_size(GsweAspectInfo *aspect_info);
|
||||
|
||||
void gswe_aspect_info_set_orb_modifier(GsweAspectInfo *aspect_info, gdouble orb_modifier);
|
||||
void gswe_aspect_info_set_orb_modifier(
|
||||
GsweAspectInfo *aspect_info,
|
||||
gdouble orb_modifier);
|
||||
|
||||
gdouble gswe_aspect_info_get_orb_modifier(GsweAspectInfo *aspect_info);
|
||||
|
||||
void gswe_aspect_info_set_harmonic(GsweAspectInfo *aspect_info, gboolean harmonic);
|
||||
void gswe_aspect_info_set_harmonic(
|
||||
GsweAspectInfo *aspect_info,
|
||||
gboolean harmonic);
|
||||
|
||||
gboolean gswe_aspect_info_get_harmonic(GsweAspectInfo *aspect_info);
|
||||
|
||||
void gswe_aspect_info_set_major(GsweAspectInfo *aspect_info, gboolean major);
|
||||
|
@@ -39,14 +39,21 @@ GType
|
||||
/*** END value-header ***/
|
||||
|
||||
/*** BEGIN value-production ***/
|
||||
{ @VALUENAME@, "@VALUENAME@", "@valuenick@" },
|
||||
{
|
||||
@VALUENAME@,
|
||||
"@VALUENAME@",
|
||||
"@valuenick@"
|
||||
},
|
||||
/*** END value-production ***/
|
||||
|
||||
/*** BEGIN value-tail ***/
|
||||
{ 0, NULL, NULL }
|
||||
};
|
||||
|
||||
GType g_define_type_id = g_@type@_register_static(g_intern_static_string("@EnumName@"), values);
|
||||
GType g_define_type_id = g_@type@_register_static(
|
||||
g_intern_static_string("@EnumName@"),
|
||||
values
|
||||
);
|
||||
|
||||
g_once_init_leave(&g_define_type_id__volatile, g_define_type_id);
|
||||
}
|
||||
|
@@ -22,13 +22,15 @@
|
||||
#include "gswe-house-data.h"
|
||||
|
||||
struct _GsweHouseData {
|
||||
/* the number of the house (usually in the range [1;12]. Sometimes may be [1;36]) */
|
||||
/* the number of the house (usually in the range [1;12]. Sometimes may be
|
||||
* [1;36]) */
|
||||
guint house;
|
||||
|
||||
/* the position of the house's cusp on the sky */
|
||||
gdouble cusp_position;
|
||||
|
||||
/* the #GsweSignInfo structure associated with the sign in which the house cusp is in */
|
||||
/* the #GsweSignInfo structure associated with the sign in which the house
|
||||
* cusp is in */
|
||||
GsweSignInfo *sign_info;
|
||||
|
||||
/* reference count */
|
||||
|
@@ -33,7 +33,12 @@
|
||||
* #GsweHouseData is a structure that represents a house's position.
|
||||
*/
|
||||
|
||||
G_DEFINE_BOXED_TYPE(GsweHouseData, gswe_house_data, (GBoxedCopyFunc)gswe_house_data_ref, (GBoxedFreeFunc)gswe_house_data_unref);
|
||||
G_DEFINE_BOXED_TYPE(
|
||||
GsweHouseData,
|
||||
gswe_house_data,
|
||||
(GBoxedCopyFunc)gswe_house_data_ref,
|
||||
(GBoxedFreeFunc)gswe_house_data_unref
|
||||
);
|
||||
|
||||
static void
|
||||
gswe_house_data_free(GsweHouseData *house_data)
|
||||
@@ -83,11 +88,16 @@ gswe_house_data_ref(GsweHouseData *house_data)
|
||||
* gswe_house_data_unref:
|
||||
* @house_data: a #GsweHouseData
|
||||
*
|
||||
* Decreases reference count on @house_data by one. If reference count drops to zero, @house_data is freed.
|
||||
* Decreases reference count on @house_data by one. If reference count drops to
|
||||
* zero, @house_data is freed.
|
||||
*/
|
||||
void
|
||||
gswe_house_data_unref(GsweHouseData *house_data)
|
||||
{
|
||||
if (house_data == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (--house_data->refcount == 0) {
|
||||
gswe_house_data_free(house_data);
|
||||
}
|
||||
|
@@ -27,7 +27,8 @@ struct _GsweHouseSystemInfo {
|
||||
/* the house system's ID */
|
||||
GsweHouseSystem house_system;
|
||||
|
||||
/* the character value that represents this house system in the Swiss Ephemeris library */
|
||||
/* the character value that represents this house system in the Swiss
|
||||
* Ephemeris library */
|
||||
gchar sweph_id;
|
||||
|
||||
/* the name of this house system */
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user