From: Andy Spencer Date: Mon, 8 Feb 2010 22:29:48 +0000 (+0000) Subject: Document GisObject X-Git-Tag: v0.4~57 X-Git-Url: http://pileus.org/git/?p=grits;a=commitdiff_plain;h=2ff4eb1f35e8300a2fdfdb6d38389284d483ba1d Document GisObject --- diff --git a/src/objects/gis-object.c b/src/objects/gis-object.c index ac01a29..84e5c47 100644 --- a/src/objects/gis-object.c +++ b/src/objects/gis-object.c @@ -15,16 +15,46 @@ * along with this program. If not, see . */ +/** + * SECTION:gis-object + * @short_description: Base classes for drawing operations + * + * Objects in libgis are things which can be added to the viewer and will be + * displayed to the user. Each object has information such as it's location and + * level of detail which are used by the viewer to determine which objects + * should be drawn. + * + * Each #GisObject is also a #GObject, but not every GObject in libgis is a + * GisObject. The "Object" part of the name is just coincidence. + */ + #include #include "gis-object.h" - -/* GisPoint */ +/************ + * GisPoint * + ************/ +/** + * gis_point_new: + * + * Create a new #GisPoint + * + * Returns: the new point + */ GisPoint *gis_point_new() { return g_new0(GisPoint, 1); } +/** + * gis_point_set_lle: + * @point: the point to modify + * @lat: the new latitude + * @lon: the new longitude + * @elev: the new elevation + * + * Set the latitude, longitude, and elevation for a point. + */ void gis_point_set_lle(GisPoint *point, gdouble lat, gdouble lon, gdouble elev) { point->lat = lat; @@ -32,13 +62,22 @@ void gis_point_set_lle(GisPoint *point, gdouble lat, gdouble lon, gdouble elev) point->elev = elev; } +/** + * gis_point_free: + * @point: The point to free + * + * Free data used by a #GisPoint + */ void gis_point_free(GisPoint *point) { g_free(point); } -/* GisObject */ +/************* + * GisObject * + *************/ +/* GObject stuff */ G_DEFINE_ABSTRACT_TYPE(GisObject, gis_object, G_TYPE_OBJECT); static void gis_object_init(GisObject *object) { diff --git a/src/objects/gis-object.h b/src/objects/gis-object.h index 313f454..4f105d8 100644 --- a/src/objects/gis-object.h +++ b/src/objects/gis-object.h @@ -56,6 +56,14 @@ struct _GisObjectClass { GType gis_object_get_type(void); +/** + * gis_object_center: + * @object: The #GisObject to get the center of + * + * Get the #GisPoint representing the center of an object + * + * Returns: the center point + */ #define gis_object_center(object) \ (&GIS_OBJECT(object)->center)