diff options
author | Guido Günther <agx@sigxcpu.org> | 2014-03-21 07:44:59 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2014-03-21 07:44:59 +0100 |
commit | e613f5b9ec103ac4b4b39e2897b70f135a82076c (patch) | |
tree | 527dc708b6ff2a288219fb2d3affe95704ddbd23 /libplanfahr | |
parent | 2fa6ec197f98760d859d14741b03f684558f4d7e (diff) |
LpfLoc: add getter to ease C usage
Diffstat (limited to 'libplanfahr')
-rw-r--r-- | libplanfahr/libplanfahr.sym | 3 | ||||
-rw-r--r-- | libplanfahr/lpf-loc.c | 42 | ||||
-rw-r--r-- | libplanfahr/lpf-loc.h | 7 |
3 files changed, 50 insertions, 2 deletions
diff --git a/libplanfahr/libplanfahr.sym b/libplanfahr/libplanfahr.sym index 2e1a694..419eb86 100644 --- a/libplanfahr/libplanfahr.sym +++ b/libplanfahr/libplanfahr.sym @@ -19,6 +19,9 @@ LIBPLANFAHR_0.0.0 { lpf_provider_get_type; /* LpfLoc */ lpf_loc_get_type; + lpf_loc_get_name; + lpf_loc_get_long; + lpf_loc_get_lat; /* LpfStop */ lpf_stop_get_type; /* LpfTrip */ diff --git a/libplanfahr/lpf-loc.c b/libplanfahr/lpf-loc.c index e51e70b..24a5013 100644 --- a/libplanfahr/lpf-loc.c +++ b/libplanfahr/lpf-loc.c @@ -210,3 +210,45 @@ lpf_loc_set_opaque(LpfLoc *self, gpointer opaque) priv->opaque = opaque; } + +/** + * lpf_loc_get_name: (transfer none): + * @self: a #LpfLoc + * + * Returns: the location's name + */ +const gchar* +lpf_loc_get_name(LpfLoc *self) +{ + LpfLocPrivate *priv = GET_PRIVATE (self); + + return priv->name; +} + +/** + * lpf_loc_get_long: + * @self: a #LpfLoc + * + * Returns: the locations longitude + */ +double +lpf_loc_get_long(LpfLoc *self) +{ + LpfLocPrivate *priv = GET_PRIVATE (self); + + return priv->long_; +} + +/** + * lpf_loc_get_lat: + * @self: a #LpfLoc + * + * Returns: the locations latitude + */ +double +lpf_loc_get_lat(LpfLoc *self) +{ + LpfLocPrivate *priv = GET_PRIVATE (self); + + return priv->lat; +} diff --git a/libplanfahr/lpf-loc.h b/libplanfahr/lpf-loc.h index 7dc8209..aeecaf9 100644 --- a/libplanfahr/lpf-loc.h +++ b/libplanfahr/lpf-loc.h @@ -56,8 +56,11 @@ typedef struct { GObjectClass parent_class; } LpfLocClass; -GType lpf_loc_get_type (void); -/* FIXME: Only used by providers, don't export symbol */ +GType lpf_loc_get_type (void); +const gchar *lpf_loc_get_name (LpfLoc* self); +double lpf_loc_get_lat (LpfLoc *self); +double lpf_loc_get_long (LpfLoc *self); + gpointer lpf_loc_get_opaque (LpfLoc *self); void lpf_loc_set_opaque (LpfLoc *self, gpointer opaque); |