Moved GsweHouseData to its own sources
This commit is contained in:
parent
20c3aafe85
commit
9ee5569bb1
@ -70,6 +70,7 @@ IGNORE_HFILES = \
|
|||||||
gswe-antiscion-axis-info-private.h \
|
gswe-antiscion-axis-info-private.h \
|
||||||
gswe-antiscion-data-private.h \
|
gswe-antiscion-data-private.h \
|
||||||
gswe-house-system-info-private.h \
|
gswe-house-system-info-private.h \
|
||||||
|
gswe-house-data-private.h \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
# Images to copy into HTML directory.
|
# Images to copy into HTML directory.
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
<xi:include href="xml/gswe-antiscion-axis-info.xml" />
|
<xi:include href="xml/gswe-antiscion-axis-info.xml" />
|
||||||
<xi:include href="xml/gswe-antiscion-data.xml" />
|
<xi:include href="xml/gswe-antiscion-data.xml" />
|
||||||
<xi:include href="xml/gswe-house-system-info.xml" />
|
<xi:include href="xml/gswe-house-system-info.xml" />
|
||||||
|
<xi:include href="xml/gswe-house-data.xml" />
|
||||||
<xi:include href="xml/swe-glib.xml"/>
|
<xi:include href="xml/swe-glib.xml"/>
|
||||||
<xi:include href="xml/gswe-moment.xml"/>
|
<xi:include href="xml/gswe-moment.xml"/>
|
||||||
<xi:include href="xml/gswe-timestamp.xml"/>
|
<xi:include href="xml/gswe-timestamp.xml"/>
|
||||||
|
@ -159,6 +159,17 @@ GSWE_TYPE_HOUSE_SYSTEM_INFO
|
|||||||
gswe_house_system_info_get_type
|
gswe_house_system_info_get_type
|
||||||
</SECTION>
|
</SECTION>
|
||||||
|
|
||||||
|
<SECTION>
|
||||||
|
<FILE>gswe-house-data</FILE>
|
||||||
|
GsweHouseData
|
||||||
|
gswe_house_data_get_cusp_position
|
||||||
|
gswe_house_data_get_house
|
||||||
|
gswe_house_data_get_sign
|
||||||
|
<SUBSECTION Standard>
|
||||||
|
GSWE_TYPE_HOUSE_DATA
|
||||||
|
gswe_house_data_get_type
|
||||||
|
</SECTION>
|
||||||
|
|
||||||
<SECTION>
|
<SECTION>
|
||||||
<FILE>gswe-timestamp</FILE>
|
<FILE>gswe-timestamp</FILE>
|
||||||
<TITLE>GsweTimestamp</TITLE>
|
<TITLE>GsweTimestamp</TITLE>
|
||||||
@ -213,12 +224,9 @@ GsweQuality
|
|||||||
GsweHouseSystem
|
GsweHouseSystem
|
||||||
GsweMoonPhase
|
GsweMoonPhase
|
||||||
GsweCoordinates
|
GsweCoordinates
|
||||||
GsweHouseData
|
|
||||||
<SUBSECTION Standard>
|
<SUBSECTION Standard>
|
||||||
GSWE_TYPE_COORDINATES
|
GSWE_TYPE_COORDINATES
|
||||||
GSWE_TYPE_HOUSE_DATA
|
|
||||||
gswe_coordinates_get_type
|
gswe_coordinates_get_type
|
||||||
gswe_house_data_get_type
|
|
||||||
</SECTION>
|
</SECTION>
|
||||||
|
|
||||||
<SECTION>
|
<SECTION>
|
||||||
|
@ -15,6 +15,7 @@ INST_H_SRC_FILES = \
|
|||||||
gswe-antiscion-axis-info.h \
|
gswe-antiscion-axis-info.h \
|
||||||
gswe-antiscion-data.h \
|
gswe-antiscion-data.h \
|
||||||
gswe-house-system-info.h \
|
gswe-house-system-info.h \
|
||||||
|
gswe-house-data.h \
|
||||||
gswe-moment.h \
|
gswe-moment.h \
|
||||||
gswe-timestamp.h \
|
gswe-timestamp.h \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
@ -36,6 +37,7 @@ libswe_glib_1_0_la_SOURCES = \
|
|||||||
gswe-antiscion-axis-info.c \
|
gswe-antiscion-axis-info.c \
|
||||||
gswe-antiscion-data.c \
|
gswe-antiscion-data.c \
|
||||||
gswe-house-system-info.c \
|
gswe-house-system-info.c \
|
||||||
|
gswe-house-data.c \
|
||||||
gswe-moment.c \
|
gswe-moment.c \
|
||||||
gswe-timestamp.c \
|
gswe-timestamp.c \
|
||||||
gswe-enumtypes.c \
|
gswe-enumtypes.c \
|
||||||
|
41
src/gswe-house-data-private.h
Normal file
41
src/gswe-house-data-private.h
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
/* gswe-house-data-private.h: Private parts of GsweHouseData
|
||||||
|
*
|
||||||
|
* 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_HOUSE_DATA_PRIVATE_H__
|
||||||
|
#define __SWE_GLIB_GSWE_HOUSE_DATA_PRIVATE_H__
|
||||||
|
|
||||||
|
#include "gswe-house-data.h"
|
||||||
|
|
||||||
|
struct _GsweHouseData {
|
||||||
|
/* 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 */
|
||||||
|
GsweSignInfo *sign;
|
||||||
|
};
|
||||||
|
|
||||||
|
GsweHouseData *gswe_house_data_copy(GsweHouseData *house_data);
|
||||||
|
|
||||||
|
#endif /* __SWE_GLIB_GSWE_HOUSE_DATA_PRIVATE_H__ */
|
||||||
|
#else /* not defined __SWE_GLIB_BUILDING__ */
|
||||||
|
#error __FILE__ "Can not be included, unless building SWE-GLib"
|
||||||
|
#endif /* __SWE_GLIB_BUILDING__ */
|
||||||
|
|
101
src/gswe-house-data.c
Normal file
101
src/gswe-house-data.c
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
/* gswe-house-data.c: House related data
|
||||||
|
*
|
||||||
|
* 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-house-data.h"
|
||||||
|
#include "gswe-house-data-private.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SECTION:gswe-house-data
|
||||||
|
* @short_description: a structure representing a house's position-related data
|
||||||
|
* @title: GsweHouseData
|
||||||
|
* @stability: Stable
|
||||||
|
* @include: swe-glib.h
|
||||||
|
* @see_also: #GsweHouseSystemInfo
|
||||||
|
*
|
||||||
|
* #GsweHouseData is a structure that represents a house's position.
|
||||||
|
*/
|
||||||
|
|
||||||
|
G_DEFINE_BOXED_TYPE(GsweHouseData, gswe_house_data, (GBoxedCopyFunc)gswe_house_data_copy, (GBoxedFreeFunc)g_free);
|
||||||
|
|
||||||
|
GsweHouseData *
|
||||||
|
gswe_house_data_copy(GsweHouseData *house_data)
|
||||||
|
{
|
||||||
|
GsweHouseData *ret = g_new0(GsweHouseData, 1);
|
||||||
|
|
||||||
|
ret->house = house_data->house;
|
||||||
|
ret->cusp_position = house_data->cusp_position;
|
||||||
|
ret->sign = house_data->sign;
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gswe_house_data_get_house:
|
||||||
|
* @house_data: (in) (allow-none): a #GsweHouseData
|
||||||
|
*
|
||||||
|
* Gets the number of the house.
|
||||||
|
*
|
||||||
|
* Returns: the house number
|
||||||
|
*/
|
||||||
|
guint
|
||||||
|
gswe_house_data_get_house(GsweHouseData *house_data)
|
||||||
|
{
|
||||||
|
if (house_data) {
|
||||||
|
return house_data->house;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gswe_house_data_get_cusp_position:
|
||||||
|
* @house_data: (in) (allow-none): a #GsweHouseData
|
||||||
|
*
|
||||||
|
* Gets the position of the house's cusp.
|
||||||
|
*
|
||||||
|
* Returns: the cusp position, in degrees
|
||||||
|
*/
|
||||||
|
gdouble
|
||||||
|
gswe_house_data_get_cusp_position(GsweHouseData *house_data)
|
||||||
|
{
|
||||||
|
if (house_data) {
|
||||||
|
return house_data->cusp_position;
|
||||||
|
} else {
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gswe_house_data_get_sign:
|
||||||
|
* @house_data: (in) (allow-none): a #GsweHouseData
|
||||||
|
*
|
||||||
|
* Gets the sign in which the house's cusp is.
|
||||||
|
*
|
||||||
|
* Returns: (transfer none): a #GsweSignInfo representing the sign
|
||||||
|
*/
|
||||||
|
GsweSignInfo *
|
||||||
|
gswe_house_data_get_sign(GsweHouseData *house_data)
|
||||||
|
{
|
||||||
|
if (house_data) {
|
||||||
|
return house_data->sign;
|
||||||
|
} else {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
47
src/gswe-house-data.h
Normal file
47
src/gswe-house-data.h
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
/* gswe-house-data.h: House related data
|
||||||
|
*
|
||||||
|
* 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_HOUSE_DATA_H__
|
||||||
|
#define __SWE_GLIB_GSWE_HOUSE_DATA_H__
|
||||||
|
|
||||||
|
#include <glib-object.h>
|
||||||
|
|
||||||
|
#include "gswe-sign-info.h"
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GsweHouseData:
|
||||||
|
*
|
||||||
|
* <structname>GsweHouseData</structname> is an opaque structure whose members
|
||||||
|
* cannot be accessed directly.
|
||||||
|
*
|
||||||
|
* Since: 1.1
|
||||||
|
*/
|
||||||
|
typedef struct _GsweHouseData GsweHouseData;
|
||||||
|
|
||||||
|
GType gswe_house_data_get_type(void);
|
||||||
|
#define GSWE_TYPE_HOUSE_DATA (gswe_house_data_get_type())
|
||||||
|
|
||||||
|
guint gswe_house_data_get_house(GsweHouseData *house_data);
|
||||||
|
gdouble gswe_house_data_get_cusp_position(GsweHouseData *house_data);
|
||||||
|
GsweSignInfo *gswe_house_data_get_sign(GsweHouseData *house_data);
|
||||||
|
|
||||||
|
G_END_DECLS
|
||||||
|
|
||||||
|
#endif /* __SWE_GLIB_GSWE_HOUSE_DATA_H__ */
|
||||||
|
|
@ -32,17 +32,3 @@ gswe_coordinates_copy(GsweCoordinates *coordinates)
|
|||||||
|
|
||||||
G_DEFINE_BOXED_TYPE(GsweCoordinates, gswe_coordinates, (GBoxedCopyFunc)gswe_coordinates_copy, (GBoxedFreeFunc)g_free);
|
G_DEFINE_BOXED_TYPE(GsweCoordinates, gswe_coordinates, (GBoxedCopyFunc)gswe_coordinates_copy, (GBoxedFreeFunc)g_free);
|
||||||
|
|
||||||
static GsweHouseData *
|
|
||||||
gswe_house_data_copy(GsweHouseData *house_data)
|
|
||||||
{
|
|
||||||
GsweHouseData *ret = g_new0(GsweHouseData, 1);
|
|
||||||
|
|
||||||
ret->house = house_data->house;
|
|
||||||
ret->cusp_position = house_data->cusp_position;
|
|
||||||
ret->sign = house_data->sign;
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
G_DEFINE_BOXED_TYPE(GsweHouseData, gswe_house_data, (GBoxedCopyFunc)gswe_house_data_copy, (GBoxedFreeFunc)g_free);
|
|
||||||
|
|
||||||
|
@ -266,24 +266,5 @@ typedef struct _GsweCoordinates {
|
|||||||
GType gswe_coordinates_get_type(void);
|
GType gswe_coordinates_get_type(void);
|
||||||
#define GSWE_TYPE_COORDINATES (gswe_coordinates_get_type())
|
#define GSWE_TYPE_COORDINATES (gswe_coordinates_get_type())
|
||||||
|
|
||||||
/**
|
|
||||||
* GsweHouseData:
|
|
||||||
* @house: the number of the house (usually in the range [1;12]. Sometimes may
|
|
||||||
* be [1;36].
|
|
||||||
* @cusp_position: the position of the house's cusp on the sky
|
|
||||||
* @sign: the #GsweSignInfo structure associated with the sign in which the
|
|
||||||
* house cusp is in
|
|
||||||
*
|
|
||||||
* Holds information of a given house.
|
|
||||||
*/
|
|
||||||
typedef struct {
|
|
||||||
guint house;
|
|
||||||
gdouble cusp_position;
|
|
||||||
GsweSignInfo *sign;
|
|
||||||
} GsweHouseData;
|
|
||||||
|
|
||||||
GType gswe_house_data_get_type(void);
|
|
||||||
#define GSWE_TYPE_HOUSE_DATA (gswe_house_data_get_type())
|
|
||||||
|
|
||||||
#endif /* __SWE_GLIB_GSWE_TYPES_H__ */
|
#endif /* __SWE_GLIB_GSWE_TYPES_H__ */
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "gswe-antiscion-axis-info-private.h"
|
#include "gswe-antiscion-axis-info-private.h"
|
||||||
#include "gswe-antiscion-data-private.h"
|
#include "gswe-antiscion-data-private.h"
|
||||||
#include "gswe-house-system-info-private.h"
|
#include "gswe-house-system-info-private.h"
|
||||||
|
#include "gswe-house-data-private.h"
|
||||||
|
|
||||||
extern gchar *gswe_ephe_path;
|
extern gchar *gswe_ephe_path;
|
||||||
extern GsweTimestamp *gswe_full_moon_base_date;
|
extern GsweTimestamp *gswe_full_moon_base_date;
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include "gswe-antiscion-axis-info.h"
|
#include "gswe-antiscion-axis-info.h"
|
||||||
#include "gswe-antiscion-data.h"
|
#include "gswe-antiscion-data.h"
|
||||||
#include "gswe-house-system-info.h"
|
#include "gswe-house-system-info.h"
|
||||||
|
#include "gswe-house-data.h"
|
||||||
#include "gswe-timestamp.h"
|
#include "gswe-timestamp.h"
|
||||||
#include "gswe-moment.h"
|
#include "gswe-moment.h"
|
||||||
#include "gswe-enumtypes.h"
|
#include "gswe-enumtypes.h"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user