Moved GswePlanetInfo to its own sources
This commit is contained in:
parent
886ff03353
commit
ebeaf1eb4d
@ -62,6 +62,7 @@ IGNORE_HFILES = \
|
|||||||
swe-glib-private.h \
|
swe-glib-private.h \
|
||||||
gswe-enumtypes.h \
|
gswe-enumtypes.h \
|
||||||
gswe-moon-phase-data-private.h \
|
gswe-moon-phase-data-private.h \
|
||||||
|
gswe-planet-info-private.h \
|
||||||
gswe-planet-data-private.h \
|
gswe-planet-data-private.h \
|
||||||
gswe-aspect-info-private.h \
|
gswe-aspect-info-private.h \
|
||||||
gswe-aspect-data-private.h \
|
gswe-aspect-data-private.h \
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
<chapter>
|
<chapter>
|
||||||
<title>SWE-GLib</title>
|
<title>SWE-GLib</title>
|
||||||
<xi:include href="xml/gswe-types.xml"/>
|
<xi:include href="xml/gswe-types.xml"/>
|
||||||
|
<xi:include href="xml/gswe-planet-info.xml" />
|
||||||
<xi:include href="xml/gswe-planet-data.xml" />
|
<xi:include href="xml/gswe-planet-data.xml" />
|
||||||
<xi:include href="xml/gswe-moon-phase-data.xml"/>
|
<xi:include href="xml/gswe-moon-phase-data.xml"/>
|
||||||
<xi:include href="xml/gswe-aspect-data.xml" />
|
<xi:include href="xml/gswe-aspect-data.xml" />
|
||||||
|
@ -55,6 +55,20 @@ GSWE_TYPE_MOON_PHASE_DATA
|
|||||||
gswe_moon_phase_data_get_type
|
gswe_moon_phase_data_get_type
|
||||||
</SECTION>
|
</SECTION>
|
||||||
|
|
||||||
|
<SECTION>
|
||||||
|
<FILE>gswe-planet-info</FILE>
|
||||||
|
GswePlanetInfo
|
||||||
|
gswe_planet_info_get_name
|
||||||
|
gswe_planet_info_get_orb
|
||||||
|
gswe_planet_info_get_planet
|
||||||
|
gswe_planet_info_get_points
|
||||||
|
gswe_planet_info_get_real_body
|
||||||
|
gswe_planet_info_get_sweph_id
|
||||||
|
<SUBSECTION Standard>
|
||||||
|
GSWE_TYPE_PLANET_INFO
|
||||||
|
gswe_planet_info_get_type
|
||||||
|
</SECTION>
|
||||||
|
|
||||||
<SECTION>
|
<SECTION>
|
||||||
<FILE>gswe-planet-data</FILE>
|
<FILE>gswe-planet-data</FILE>
|
||||||
GswePlanetData
|
GswePlanetData
|
||||||
@ -175,7 +189,6 @@ GsweElement
|
|||||||
GsweQuality
|
GsweQuality
|
||||||
GsweHouseSystem
|
GsweHouseSystem
|
||||||
GsweMoonPhase
|
GsweMoonPhase
|
||||||
GswePlanetInfo
|
|
||||||
GsweSignInfo
|
GsweSignInfo
|
||||||
GsweHouseSystemInfo
|
GsweHouseSystemInfo
|
||||||
GsweCoordinates
|
GsweCoordinates
|
||||||
@ -191,9 +204,7 @@ gswe_house_data_get_type
|
|||||||
<FILE>swe-glib</FILE>
|
<FILE>swe-glib</FILE>
|
||||||
gswe_init
|
gswe_init
|
||||||
<SUBSECTION Standard>
|
<SUBSECTION Standard>
|
||||||
GSWE_TYPE_PLANET_INFO
|
|
||||||
GSWE_TYPE_SIGN_INFO
|
GSWE_TYPE_SIGN_INFO
|
||||||
gswe_planet_info_get_type
|
|
||||||
gswe_sign_info_get_type
|
gswe_sign_info_get_type
|
||||||
</SECTION>
|
</SECTION>
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ INST_H_SRC_FILES = \
|
|||||||
gswe-aspect-data.h \
|
gswe-aspect-data.h \
|
||||||
gswe-antiscion-axis-info.h \
|
gswe-antiscion-axis-info.h \
|
||||||
gswe-antiscion-data.h \
|
gswe-antiscion-data.h \
|
||||||
|
gswe-planet-info.h \
|
||||||
gswe-planet-data.h \
|
gswe-planet-data.h \
|
||||||
gswe-moment.h \
|
gswe-moment.h \
|
||||||
gswe-timestamp.h \
|
gswe-timestamp.h \
|
||||||
@ -25,6 +26,7 @@ libswe_glib_1_0_la_SOURCES = \
|
|||||||
swe-glib.c \
|
swe-glib.c \
|
||||||
gswe-types.c \
|
gswe-types.c \
|
||||||
gswe-moon-phase-data.c \
|
gswe-moon-phase-data.c \
|
||||||
|
gswe-planet-info.c \
|
||||||
gswe-planet-data.c \
|
gswe-planet-data.c \
|
||||||
gswe-aspect-info.c \
|
gswe-aspect-info.c \
|
||||||
gswe-aspect-data.c \
|
gswe-aspect-data.c \
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#define __SWE_GLIB_GSWE_PLANET_DATA_PRIVATE_H__
|
#define __SWE_GLIB_GSWE_PLANET_DATA_PRIVATE_H__
|
||||||
|
|
||||||
#include "gswe-planet-data.h"
|
#include "gswe-planet-data.h"
|
||||||
|
#include "gswe-planet-info.h"
|
||||||
|
|
||||||
struct _GswePlanetData {
|
struct _GswePlanetData {
|
||||||
/* A GswePlanet, the identifier of the planet */
|
/* A GswePlanet, the identifier of the planet */
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "gswe-types.h"
|
#include "gswe-types.h"
|
||||||
|
#include "gswe-planet-info.h"
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
52
src/gswe-planet-info-private.h
Normal file
52
src/gswe-planet-info-private.h
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
/* gswe-planet-info-private.h: Private parts of GswePlanetInfo
|
||||||
|
*
|
||||||
|
* Copyright © 2013 Gergely Polonkai
|
||||||
|
*
|
||||||
|
* SWE-GLib is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* SWE-GLib is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#ifdef __SWE_GLIB_BUILDING__
|
||||||
|
#ifndef __SWE_GLIB_GSWE_PLANET_INFO_PRIVATE_H__
|
||||||
|
#define __SWE_GLIB_GSWE_PLANET_INFO_PRIVATE_H__
|
||||||
|
|
||||||
|
#include "gswe-types.h"
|
||||||
|
#include "gswe-planet-info.h"
|
||||||
|
|
||||||
|
struct _GswePlanetInfo {
|
||||||
|
/* the planet ID */
|
||||||
|
GswePlanet planet;
|
||||||
|
|
||||||
|
/* the planet ID according to the Swiss Ephemeris libarary (or -1, if the planet has no such ID) */
|
||||||
|
gint32 sweph_id;
|
||||||
|
|
||||||
|
/* TRUE if the planet is a "real" celestial body on the sky. Please note that this will be true for Dark Moon (Lilith). Everything that has a planet ID in Swiss Ephemeris is treated as a real celestial body. */
|
||||||
|
gboolean real_body;
|
||||||
|
|
||||||
|
/* the planet's “personal” orb */
|
||||||
|
gdouble orb;
|
||||||
|
|
||||||
|
/* the planet's name */
|
||||||
|
gchar *name;
|
||||||
|
|
||||||
|
/* the value this planet counts in the element/quality points table */
|
||||||
|
gint points;
|
||||||
|
};
|
||||||
|
|
||||||
|
void gswe_planet_info_free(GswePlanetInfo *planet_info);
|
||||||
|
GswePlanetInfo *gswe_planet_info_copy(GswePlanetInfo *planet_info);
|
||||||
|
|
||||||
|
#endif /* __SWE_GLIB_GSWE_PLANET_INFO_PRIVATE_H__ */
|
||||||
|
#else /* not defined __SWE_GLIB_BUILDING__ */
|
||||||
|
#error __FILE__ "Can not be included, unless building SWE-GLib"
|
||||||
|
#endif /* __SWE_GLIB_BUILDING__ */
|
||||||
|
|
164
src/gswe-planet-info.c
Normal file
164
src/gswe-planet-info.c
Normal file
@ -0,0 +1,164 @@
|
|||||||
|
/* gswe-planet-info.c: Planet related information
|
||||||
|
*
|
||||||
|
* Copyright © 2013 Gergely Polonkai
|
||||||
|
*
|
||||||
|
* SWE-GLib is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* SWE-GLib is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include "gswe-types.h"
|
||||||
|
|
||||||
|
#include "gswe-planet-info.h"
|
||||||
|
#include "gswe-planet-info-private.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SECTION:gswe-planet-info
|
||||||
|
* @short_description: a structure storing information about a planet
|
||||||
|
* @title: GswePlanetInfo
|
||||||
|
* @stability: Stable
|
||||||
|
* @include: swe-glib.h
|
||||||
|
*
|
||||||
|
* The #GswePlanetInfo structure stores information about a planet.
|
||||||
|
*/
|
||||||
|
|
||||||
|
G_DEFINE_BOXED_TYPE(GswePlanetInfo, gswe_planet_info, (GBoxedCopyFunc)gswe_planet_info_copy, (GBoxedFreeFunc)gswe_planet_info_free);
|
||||||
|
|
||||||
|
GswePlanetInfo *
|
||||||
|
gswe_planet_info_copy(GswePlanetInfo *planet_info)
|
||||||
|
{
|
||||||
|
GswePlanetInfo *ret = g_new0(GswePlanetInfo, 1);
|
||||||
|
|
||||||
|
ret->planet = planet_info->planet;
|
||||||
|
ret->sweph_id = planet_info->sweph_id;
|
||||||
|
ret->real_body = planet_info->real_body;
|
||||||
|
ret->orb = planet_info->orb;
|
||||||
|
ret->name = g_strdup(planet_info->name);
|
||||||
|
ret->points = planet_info->points;
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gswe_planet_info_free(GswePlanetInfo *planet_info)
|
||||||
|
{
|
||||||
|
g_free(planet_info->name);
|
||||||
|
g_free(planet_info);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gswe_planet_info_get_planet:
|
||||||
|
* @planet_info: (in) (allow-none): A #GswePlanetInfo
|
||||||
|
*
|
||||||
|
* Gets the planet ID represented by this #GswePlanetInfo.
|
||||||
|
*
|
||||||
|
* Returns: the planet ID
|
||||||
|
*/
|
||||||
|
GswePlanet
|
||||||
|
gswe_planet_info_get_planet(GswePlanetInfo *planet_info)
|
||||||
|
{
|
||||||
|
if (planet_info) {
|
||||||
|
return planet_info->planet;
|
||||||
|
} else {
|
||||||
|
return GSWE_PLANET_NONE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gswe_planet_info_get_sweph_id:
|
||||||
|
* @planet_info: (in) (allow-none): A #GswePlanetInfo
|
||||||
|
*
|
||||||
|
* Gets the Swiss Ephemeris planet ID associated with this planet.
|
||||||
|
*
|
||||||
|
* Returns: the Swiss Ephemeris planet ID
|
||||||
|
*/
|
||||||
|
gint32
|
||||||
|
gswe_planet_info_get_sweph_id(GswePlanetInfo *planet_info)
|
||||||
|
{
|
||||||
|
if (planet_info) {
|
||||||
|
return planet_info->sweph_id;
|
||||||
|
} else {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gswe_planet_info_get_real_body:
|
||||||
|
* @planet_info: (in) (allow-none): A #GswePlanetInfo
|
||||||
|
*
|
||||||
|
* Checks weather this planet is a real celestial body (e.g. it has a Swiss Ephemeris planet ID) or not.
|
||||||
|
*
|
||||||
|
* Returns: TRUE if the planet has a Swiss Ephemeris planet ID; FALSE otherwise
|
||||||
|
*/
|
||||||
|
gboolean
|
||||||
|
gswe_planet_info_get_real_body(GswePlanetInfo *planet_info)
|
||||||
|
{
|
||||||
|
if (planet_info) {
|
||||||
|
return planet_info->real_body;
|
||||||
|
} else {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gswe_planet_info_get_orb:
|
||||||
|
* @planet_info: (in) (allow-none): A #GswePlanetInfo
|
||||||
|
*
|
||||||
|
* Gets the orb of the planet.
|
||||||
|
*
|
||||||
|
* Returns: the orb, in degrees
|
||||||
|
*/
|
||||||
|
gdouble
|
||||||
|
gswe_planet_info_get_orb(GswePlanetInfo *planet_info)
|
||||||
|
{
|
||||||
|
if (planet_info) {
|
||||||
|
return planet_info->orb;
|
||||||
|
} else {
|
||||||
|
return -1.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gswe_planet_info_get_name:
|
||||||
|
* @planet_info: (in) (allow-none): A #GswePlanetInfo
|
||||||
|
*
|
||||||
|
* Gets the name of the planet.
|
||||||
|
*
|
||||||
|
* Returns: (transfer none): the planet's name
|
||||||
|
*/
|
||||||
|
const gchar *
|
||||||
|
gswe_planet_info_get_name(GswePlanetInfo *planet_info)
|
||||||
|
{
|
||||||
|
if (planet_info) {
|
||||||
|
return planet_info->name;
|
||||||
|
} else {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gswe_planet_info_get_points:
|
||||||
|
* @planet_info: (in) (allow-none): A #GswePlanetInfo
|
||||||
|
*
|
||||||
|
* Gets the value this planet counts in point calculations.
|
||||||
|
*
|
||||||
|
* Returns: the point value
|
||||||
|
*/
|
||||||
|
gint
|
||||||
|
gswe_planet_info_get_points(GswePlanetInfo *planet_info)
|
||||||
|
{
|
||||||
|
if (planet_info) {
|
||||||
|
return planet_info->points;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
50
src/gswe-planet-info.h
Normal file
50
src/gswe-planet-info.h
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
/* gswe-planet-info.h: Planet related information
|
||||||
|
*
|
||||||
|
* Copyright © 2013 Gergely Polonkai
|
||||||
|
*
|
||||||
|
* SWE-GLib is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* SWE-GLib is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#ifndef __SWE_GLIB_GSWE_PLANET_INFO_H__
|
||||||
|
#define __SWE_GLIB_GSWE_PLANET_INFO_H__
|
||||||
|
|
||||||
|
#include <glib-object.h>
|
||||||
|
|
||||||
|
#include "gswe-types.h"
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GswePlanetInfo:
|
||||||
|
*
|
||||||
|
* <structname>GswePlanetInfo</structname> is an opaque structure whose members
|
||||||
|
* cannot be accessed directly.
|
||||||
|
*
|
||||||
|
* Since: 1.1
|
||||||
|
*/
|
||||||
|
typedef struct _GswePlanetInfo GswePlanetInfo;
|
||||||
|
|
||||||
|
GType gswe_planet_info_get_type(void);
|
||||||
|
#define GSWE_TYPE_PLANET_INFO (gswe_planet_info_get_type())
|
||||||
|
|
||||||
|
GswePlanet gswe_planet_info_get_planet(GswePlanetInfo *planet_info);
|
||||||
|
gint32 gswe_planet_info_get_sweph_id(GswePlanetInfo *planet_info);
|
||||||
|
gboolean gswe_planet_info_get_real_body(GswePlanetInfo *planet_info);
|
||||||
|
gdouble gswe_planet_info_get_orb(GswePlanetInfo *planet_info);
|
||||||
|
const gchar *gswe_planet_info_get_name(GswePlanetInfo *planet_info);
|
||||||
|
gint gswe_planet_info_get_points(GswePlanetInfo *planet_info);
|
||||||
|
|
||||||
|
G_END_DECLS
|
||||||
|
|
||||||
|
#endif /* __SWE_GLIB_GSWE_PLANET_INFO_PRIVATE_H__ */
|
||||||
|
|
@ -249,44 +249,6 @@ typedef enum {
|
|||||||
GSWE_MOON_PHASE_DARK
|
GSWE_MOON_PHASE_DARK
|
||||||
} GsweMoonPhase;
|
} GsweMoonPhase;
|
||||||
|
|
||||||
/**
|
|
||||||
* GswePlanetInfo:
|
|
||||||
* @planet: the planet ID
|
|
||||||
* @sweph_id: the planet ID according to the Swiss Ephemeris libarary
|
|
||||||
* (or -1, if the planet has no such ID)
|
|
||||||
* @real_body: TRUE if the planet is a "real" celestial body on the sky.
|
|
||||||
* Please note that this will be true for Dark Moon (Lilith).
|
|
||||||
* Everything that has a planet ID in Swiss Ephemeris is
|
|
||||||
* treated as a real celestial body.
|
|
||||||
* @orb: the planet's “personal” orb
|
|
||||||
* @name: the planet's name
|
|
||||||
* @points: the value this planet counts in the element/quality points
|
|
||||||
* table
|
|
||||||
* @domicile_sign_1: the first sign in which the planet is domicile
|
|
||||||
* @domicile_sign_2: the second sign in which the planet is domicile
|
|
||||||
* @exile_sign_1: the first sign in which the planet is in exile
|
|
||||||
* @exile_sign_2: the second sign in which the planet is in exile
|
|
||||||
* @exalted_sign: the sign in which the planet is exalted
|
|
||||||
* @fall_sign: the sign in which the planet is in fall
|
|
||||||
*
|
|
||||||
* This struct holds different informations of planets. You should never modify
|
|
||||||
* such a structure unless you really know what you are doing.
|
|
||||||
*/
|
|
||||||
typedef struct {
|
|
||||||
GswePlanet planet;
|
|
||||||
gint sweph_id;
|
|
||||||
gboolean real_body;
|
|
||||||
gdouble orb;
|
|
||||||
gchar *name;
|
|
||||||
gint points;
|
|
||||||
GsweZodiac domicile_sign_1;
|
|
||||||
GsweZodiac domicile_sign_2;
|
|
||||||
GsweZodiac exile_sign_1;
|
|
||||||
GsweZodiac exile_sign_2;
|
|
||||||
GsweZodiac exalted_sign;
|
|
||||||
GsweZodiac fall_sign;
|
|
||||||
} GswePlanetInfo;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GsweSignInfo:
|
* GsweSignInfo:
|
||||||
* @sign_id: the identifier for this sign
|
* @sign_id: the identifier for this sign
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include "gswe-timestamp.h"
|
#include "gswe-timestamp.h"
|
||||||
#include "gswe-types.h"
|
#include "gswe-types.h"
|
||||||
#include "gswe-moon-phase-data-private.h"
|
#include "gswe-moon-phase-data-private.h"
|
||||||
|
#include "gswe-planet-info-private.h"
|
||||||
#include "gswe-planet-data-private.h"
|
#include "gswe-planet-data-private.h"
|
||||||
#include "gswe-aspect-info-private.h"
|
#include "gswe-aspect-info-private.h"
|
||||||
#include "gswe-aspect-data-private.h"
|
#include "gswe-aspect-data-private.h"
|
||||||
|
@ -43,35 +43,33 @@ GHashTable *gswe_aspect_info_table;
|
|||||||
GHashTable *gswe_antiscion_axis_info_table;
|
GHashTable *gswe_antiscion_axis_info_table;
|
||||||
GsweTimestamp *gswe_full_moon_base_date;
|
GsweTimestamp *gswe_full_moon_base_date;
|
||||||
|
|
||||||
#define ADD_PLANET(ht, v, i, s, r, n, o, h, dom1, dom2, exi1, exi2, exa, fal) (v) = g_new0(GswePlanetInfo, 1); \
|
#define ADD_PLANET(ht, v, i, s, r, n, o, h) \
|
||||||
|
(v) = g_new0(GswePlanetInfo, 1); \
|
||||||
(v)->planet = (i); \
|
(v)->planet = (i); \
|
||||||
(v)->sweph_id = (s); \
|
(v)->sweph_id = (s); \
|
||||||
(v)->real_body = (r); \
|
(v)->real_body = (r); \
|
||||||
(v)->orb = (o); \
|
(v)->orb = (o); \
|
||||||
(v)->name = g_strdup(n); \
|
(v)->name = g_strdup(n); \
|
||||||
(v)->points = (h); \
|
(v)->points = (h); \
|
||||||
(v)->domicile_sign_1 = (dom1); \
|
|
||||||
(v)->domicile_sign_2 = (dom2); \
|
|
||||||
(v)->exile_sign_1 = (exi1); \
|
|
||||||
(v)->exile_sign_2 = (exi2); \
|
|
||||||
(v)->exalted_sign = (exa); \
|
|
||||||
(v)->fall_sign = (fal); \
|
|
||||||
g_hash_table_replace((ht), GINT_TO_POINTER(i), (v));
|
g_hash_table_replace((ht), GINT_TO_POINTER(i), (v));
|
||||||
|
|
||||||
#define ADD_SIGN(ht, v, s, n, e, q) (v) = g_new0(GsweSignInfo, 1); \
|
#define ADD_SIGN(ht, v, s, n, e, q) \
|
||||||
|
(v) = g_new0(GsweSignInfo, 1); \
|
||||||
(v)->sign_id = (s); \
|
(v)->sign_id = (s); \
|
||||||
(v)->name = g_strdup(n); \
|
(v)->name = g_strdup(n); \
|
||||||
(v)->element = (e); \
|
(v)->element = (e); \
|
||||||
(v)->quality = (q); \
|
(v)->quality = (q); \
|
||||||
g_hash_table_replace((ht), GINT_TO_POINTER(s), (v));
|
g_hash_table_replace((ht), GINT_TO_POINTER(s), (v));
|
||||||
|
|
||||||
#define ADD_HOUSE_SYSTEM(ht, v, i, s, n) (v) = g_new0(GsweHouseSystemInfo, 1); \
|
#define ADD_HOUSE_SYSTEM(ht, v, i, s, n) \
|
||||||
|
(v) = g_new0(GsweHouseSystemInfo, 1); \
|
||||||
(v)->system = i; \
|
(v)->system = i; \
|
||||||
(v)->sweph_id = s; \
|
(v)->sweph_id = s; \
|
||||||
(v)->name = g_strdup(n); \
|
(v)->name = g_strdup(n); \
|
||||||
g_hash_table_replace((ht), GINT_TO_POINTER(i), (v));
|
g_hash_table_replace((ht), GINT_TO_POINTER(i), (v));
|
||||||
|
|
||||||
#define ADD_ASPECT(ht, v, i, n, s, o, h, m) (v) = g_new0(GsweAspectInfo, 1); \
|
#define ADD_ASPECT(ht, v, i, n, s, o, h, m) \
|
||||||
|
(v) = g_new0(GsweAspectInfo, 1); \
|
||||||
(v)->aspect = (i); \
|
(v)->aspect = (i); \
|
||||||
(v)->name = g_strdup(n); \
|
(v)->name = g_strdup(n); \
|
||||||
(v)->size = (s); \
|
(v)->size = (s); \
|
||||||
@ -80,13 +78,15 @@ GsweTimestamp *gswe_full_moon_base_date;
|
|||||||
(v)->major = (m); \
|
(v)->major = (m); \
|
||||||
g_hash_table_replace((ht), GINT_TO_POINTER(i), (v));
|
g_hash_table_replace((ht), GINT_TO_POINTER(i), (v));
|
||||||
|
|
||||||
#define ADD_ANTISCION(ht, v, hts, vs, i, n, s, m) (v) = g_new0(GsweAntiscionAxisInfo, 1); \
|
#define ADD_ANTISCION(ht, v, hts, vs, i, n, s, m) \
|
||||||
|
(v) = g_new0(GsweAntiscionAxisInfo, 1); \
|
||||||
(vs) = g_hash_table_lookup((hts), GINT_TO_POINTER(i)); \
|
(vs) = g_hash_table_lookup((hts), GINT_TO_POINTER(i)); \
|
||||||
(v)->axis = (i); \
|
(v)->axis = (i); \
|
||||||
(v)->start_sign = (vs); \
|
(v)->start_sign = (vs); \
|
||||||
(v)->name = g_strdup(n); \
|
(v)->name = g_strdup(n); \
|
||||||
(v)->sign_offset = m; \
|
(v)->sign_offset = m; \
|
||||||
g_hash_table_replace((ht), GINT_TO_POINTER(i), (v));
|
g_hash_table_replace((ht), GINT_TO_POINTER(i), (v));
|
||||||
|
|
||||||
void
|
void
|
||||||
gswe_free_planet_info(gpointer planet_info)
|
gswe_free_planet_info(gpointer planet_info)
|
||||||
{
|
{
|
||||||
@ -142,26 +142,26 @@ gswe_init(void)
|
|||||||
|
|
||||||
gswe_planet_info_table = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, gswe_free_planet_info);
|
gswe_planet_info_table = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, gswe_free_planet_info);
|
||||||
|
|
||||||
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_SUN, SE_SUN, TRUE, _("Sun"), 13.0, 2, GSWE_SIGN_LEO, GSWE_SIGN_NONE, GSWE_SIGN_AQUARIUS, GSWE_SIGN_NONE, GSWE_SIGN_ARIES, GSWE_SIGN_LIBRA);
|
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, GSWE_SIGN_CANCER, GSWE_SIGN_NONE, GSWE_SIGN_CAPRICORN, GSWE_SIGN_NONE, GSWE_SIGN_TAURUS, GSWE_SIGN_SCORPIO);
|
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, GSWE_SIGN_GEMINI, GSWE_SIGN_VIRGO, GSWE_SIGN_SAGITTARIUS, GSWE_SIGN_PISCES, GSWE_SIGN_VIRGO, GSWE_SIGN_PISCES);
|
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, GSWE_SIGN_TAURUS, GSWE_SIGN_LIBRA, GSWE_SIGN_SCORPIO, GSWE_SIGN_ARIES, GSWE_SIGN_PISCES, GSWE_SIGN_VIRGO);
|
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, GSWE_SIGN_ARIES, GSWE_SIGN_SCORPIO, GSWE_SIGN_LIBRA, GSWE_SIGN_TAURUS, GSWE_SIGN_CAPRICORN, GSWE_SIGN_CANCER);
|
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, GSWE_SIGN_SAGITTARIUS, GSWE_SIGN_PISCES, GSWE_SIGN_GEMINI, GSWE_SIGN_VIRGO, GSWE_SIGN_CANCER, GSWE_SIGN_CAPRICORN);
|
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, GSWE_SIGN_CAPRICORN, GSWE_SIGN_AQUARIUS, GSWE_SIGN_CANCER, GSWE_SIGN_LEO, GSWE_SIGN_LIBRA, GSWE_SIGN_ARIES);
|
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, GSWE_SIGN_AQUARIUS, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE);
|
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, GSWE_SIGN_PISCES, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE);
|
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, GSWE_SIGN_SCORPIO, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE);
|
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, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE);
|
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, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE);
|
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, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE);
|
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, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE);
|
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, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE);
|
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, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE);
|
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_MOON_APOGEE, SE_MEAN_APOG, TRUE, _("Dark Moon"), 2.0, 0, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE);
|
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_ASCENDENT, -1, FALSE, _("Ascendent"), 9.0, 2, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE);
|
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_ASCENDENT, -1, FALSE, _("Ascendent"), 9.0, 2);
|
||||||
ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_MC, -1, FALSE, _("Midheaven"), 5.0, 1, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE);
|
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_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE, GSWE_SIGN_NONE);
|
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, gswe_free_sign_info);
|
gswe_sign_info_table = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, gswe_free_sign_info);
|
||||||
|
|
||||||
@ -217,36 +217,6 @@ gswe_init(void)
|
|||||||
gswe_initialized = TRUE;
|
gswe_initialized = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GswePlanetInfo *
|
|
||||||
gswe_planet_info_copy(GswePlanetInfo *planet_info)
|
|
||||||
{
|
|
||||||
GswePlanetInfo *ret = g_new0(GswePlanetInfo, 1);
|
|
||||||
|
|
||||||
ret->planet = planet_info->planet;
|
|
||||||
ret->sweph_id = planet_info->sweph_id;
|
|
||||||
ret->real_body = planet_info->real_body;
|
|
||||||
ret->orb = planet_info->orb;
|
|
||||||
ret->name = g_strdup(planet_info->name);
|
|
||||||
ret->points = planet_info->points;
|
|
||||||
ret->domicile_sign_1 = planet_info->domicile_sign_1;
|
|
||||||
ret->domicile_sign_2 = planet_info->domicile_sign_2;
|
|
||||||
ret->exile_sign_1 = planet_info->exile_sign_1;
|
|
||||||
ret->exile_sign_2 = planet_info->exile_sign_2;
|
|
||||||
ret->exalted_sign = planet_info->exalted_sign;
|
|
||||||
ret->fall_sign = planet_info->fall_sign;
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gswe_planet_info_free(GswePlanetInfo *planet_info)
|
|
||||||
{
|
|
||||||
g_free(planet_info->name);
|
|
||||||
g_free(planet_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
G_DEFINE_BOXED_TYPE(GswePlanetInfo, gswe_planet_info, (GBoxedCopyFunc)gswe_planet_info_copy, (GBoxedFreeFunc)gswe_planet_info_free);
|
|
||||||
|
|
||||||
static GsweSignInfo *
|
static GsweSignInfo *
|
||||||
gswe_sign_info_copy(GsweSignInfo *sign_info)
|
gswe_sign_info_copy(GsweSignInfo *sign_info)
|
||||||
{
|
{
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include "gswe-types.h"
|
#include "gswe-types.h"
|
||||||
#include "gswe-moon-phase-data.h"
|
#include "gswe-moon-phase-data.h"
|
||||||
|
#include "gswe-planet-info.h"
|
||||||
#include "gswe-planet-data.h"
|
#include "gswe-planet-data.h"
|
||||||
#include "gswe-aspect-info.h"
|
#include "gswe-aspect-info.h"
|
||||||
#include "gswe-aspect-data.h"
|
#include "gswe-aspect-data.h"
|
||||||
@ -32,9 +33,6 @@
|
|||||||
|
|
||||||
void gswe_init();
|
void gswe_init();
|
||||||
|
|
||||||
GType gswe_planet_info_get_type(void);
|
|
||||||
#define GSWE_TYPE_PLANET_INFO (gswe_planet_info_get_type())
|
|
||||||
|
|
||||||
GType gswe_sign_info_get_type(void);
|
GType gswe_sign_info_get_type(void);
|
||||||
#define GSWE_TYPE_SIGN_INFO (gswe_sign_info_get_type())
|
#define GSWE_TYPE_SIGN_INFO (gswe_sign_info_get_type())
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user