Commit 940acbe8 authored by Keith Preston's avatar Keith Preston

Initial Commit

Keith
parents
Keith Preston <keithpre@gmail.com>
This diff is collapsed.
SUBDIRS = geoclue example @YAHOOBACKEND@
EXTRA_DIST = geoclue.pc.in
DISTCLEANFILES = geoclue.pc
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = geoclue.pc
#! /bin/sh
LIBTOOLIZE=libtoolize
AUTOMAKE=automake-1.8
ACLOCAL=aclocal-1.8
AUTOCONF=autoconf
AUTOHEADER=autoheader
# Check for binaries
[ "x$(which ${LIBTOOLIZE})x" = "xx" ] && {
echo "${LIBTOOLIZE} not found. Please install it."
exit 1
}
[ "x$(which ${AUTOMAKE})x" = "xx" ] && {
echo "${AUTOMAKE} not found. Please install it."
exit 1
}
[ "x$(which ${ACLOCAL})x" = "xx" ] && {
echo "${ACLOCAL} not found. Please install it."
exit 1
}
[ "x$(which ${AUTOCONF})x" = "xx" ] && {
echo "${AUTOCONF} not found. Please install it."
exit 1
}
"${ACLOCAL}" \
&& "${LIBTOOLIZE}" \
&& "${AUTOHEADER}" \
&& "${AUTOMAKE}" --add-missing \
&& "${AUTOCONF}"
$(dirname "${0}")/configure "$@"
AC_INIT(geoclue/geoclue.c)
PACKAGE=geoclue
VERSION=0.1
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_PATH_PROG(DBUS_BINDING_TOOL, dbus-binding-tool)
AC_SUBST(DBUS_BINDING_TOOL)
AM_CONFIG_HEADER(config.h)
AC_ARG_ENABLE(yahoo-backend, AS_HELP_STRING([--enable-yahoo-backend],[enable yahoo backend]), enable_yahoo_backend=yes, enable_yahoo_backend=no)
if test $enable_yahoo_backend = yes; then
AC_OUTPUT( yahoobackend/Makefile )
PKG_CHECK_MODULES(YAHOO, libsoup-2.2 libxml-2.0 dbus-glib-1 geomap gtk+-2.0)
AC_SUBST(YAHOO_CFLAGS)
AC_SUBST(YAHOO_LIBS)
YAHOOBACKEND=yahoobackend
fi
AC_SUBST(YAHOOBACKEND)
PKG_CHECK_MODULES(DEPS, dbus-glib-1)
AC_SUBST(DEPS_CFLAGS)
AC_SUBST(DEPS_LIBS)
AC_OUTPUT(Makefile
geoclue/Makefile
example/Makefile
geoclue.pc
)
bin_PROGRAMS = example
example_SOURCES = example.c
AM_CPPFLAGS = $(DEPS_CFLAGS) -I$(top_srcdir)
AM_LDFLAGS = $(DEPS_LIBS) $(top_builddir)/geoclue/libgeoclue.la
/* Geoclue - A DBus api and wrapper for geography information
* Copyright (C) 2006 Garmin
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2 as published by the Free Software Foundation;
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include <stdio.h>
#include <geoclue/geoclue.h>
#include <glib.h>
int main (int argc, char** argv)
{
g_type_init();
geoclue_init();
gdouble lat, lon;
geoclue_current_position(&lat, &lon);
printf("You are at %f %f\n", lat, lon);
return 0;
}
\ No newline at end of file
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
datadir=@datadir@
Name: geoclue
Description: This library provide an abstract interface to get Geography Location Information
Requires: dbus-glib-1
Version: @VERSION@
Libs: -L${libdir} -lgeoclue
Cflags: -I${includedir}/geoclue -I${libdir}/geoclue/include
geocluexml=${datadir}/geoclue/dbus/geoclue_glue.xml
geocluemarshallist=${datadir}/geoclue/dbus/geoclue_signal_marshal.list
\ No newline at end of file
lib_LTLIBRARIES = libgeoclue.la
EXTRA_DIST = \
geoclue_glue.xml \
geoclue_signal_marshal.list
libgeoclue_la_SOURCES = geoclue.c \
geoclue_signal_marshal.c
libgeoclue_la_CFLAGS = $(DEPS_CFLAGS) -I$(top_srcdir)
libgeoclue_la_LIBADD = $(DEPS_LIBS)
libgeoclue_ladir=$(includedir)/geoclue/geoclue
libgeoclue_la_HEADERS = geoclue.h
BUILT_SOURCES = \
geoclue_client_glue.h \
geoclue_signal_marshal.h \
geoclue_signal_marshal.c
CLEANFILES = \
geoclue_client_glue.h \
geoclue_signal_marshal.h \
geoclue_signal_marshal.c
dbusspecdir = $(datadir)/geoclue/dbus
dbusspec_DATA = \
geoclue_glue.xml \
geoclue_signal_marshal.list
geoclue_client_glue.h:geoclue_glue.xml
$(DBUS_BINDING_TOOL) --prefix=geoclue --mode=glib-client $< > $@
geoclue_signal_marshal.h:geoclue_signal_marshal.list
glib-genmarshal --prefix _geoclue --header $< > $@
geoclue_signal_marshal.c:geoclue_signal_marshal.list
glib-genmarshal --prefix _geoclue --body $< > $@
This diff is collapsed.
/* Geoclue - A DBus api and wrapper for geography information
* Copyright (C) 2006 Garmin
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2 as published by the Free Software Foundation;
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ORG_FOINSE_PROJECT_GEOCLUE_GEOCLUE_H__
#define __ORG_FOINSE_PROJECT_GEOCLUE_GEOCLUE_H__
#include <dbus/dbus-glib.h>
G_BEGIN_DECLS
typedef enum _geoclue_returncode
{
GEOCLUE_SUCCESS = 0,
GEOCLUE_NOT_INITIALIZED = -1,
GEOCLUE_DBUS_ERROR = -2,
GEOCLUE_SERVICE_NOT_AVAILABLE = -3,
} GEOCLUE_RETURNCODE;
typedef void (*GEOCLUE_CALLBACK)(gdouble lat, gdouble lon, void* userdata);
GEOCLUE_RETURNCODE geoclue_version(int* major, int* minor, int* micro);
GEOCLUE_RETURNCODE geoclue_init();
GEOCLUE_RETURNCODE geoclue_close();
GEOCLUE_RETURNCODE geoclue_service_provider(char** name);
GEOCLUE_RETURNCODE geoclue_current_position ( gdouble* OUT_latitude, gdouble* OUT_longitude );
GEOCLUE_RETURNCODE geoclue_current_position_error ( gdouble* OUT_latitude_error, gdouble* OUT_longitude_error );
GEOCLUE_RETURNCODE geoclue_current_altitude ( gdouble* OUT_altitude );
GEOCLUE_RETURNCODE geoclue_current_velocity ( gdouble* OUT_north_velocity, gdouble* OUT_east_velocity );
GEOCLUE_RETURNCODE geoclue_current_time ( gint* OUT_year, gint* OUT_month, gint* OUT_day, gint* OUT_hours, gint* OUT_minutes, gint* OUT_seconds );
GEOCLUE_RETURNCODE geoclue_satellites_in_view ( GArray** OUT_prn_numbers );
GEOCLUE_RETURNCODE geoclue_satellites_data ( const gint IN_prn_number, gdouble* OUT_elevation, gdouble* OUT_azimuth, gdouble* OUT_signal_noise_ratio );
GEOCLUE_RETURNCODE geoclue_sun_rise ( const gdouble IN_latitude, const gdouble IN_longitude, const gint IN_year, const gint IN_month, const gint IN_day, gint* OUT_hours, gint* OUT_minutes, gint* OUT_seconds );
GEOCLUE_RETURNCODE geoclue_sun_set ( const gdouble IN_latitude, const gdouble IN_longitude, const gint IN_year, const gint IN_month, const gint IN_day, gint* OUT_hours, gint* OUT_minutes, gint* OUT_seconds );
GEOCLUE_RETURNCODE geoclue_moon_rise ( const gdouble IN_latitude, const gdouble IN_longitude, const gint IN_year, const gint IN_month, const gint IN_day, gint* OUT_hours, gint* OUT_minutes, gint* OUT_seconds );
GEOCLUE_RETURNCODE geoclue_moon_set ( const gdouble IN_latitude, const gdouble IN_longitude, const gint IN_year, const gint IN_month, const gint IN_day, gint* OUT_hours, gint* OUT_minutes, gint* OUT_seconds );
GEOCLUE_RETURNCODE geoclue_geocode ( const char * IN_street, const char * IN_city, const char * IN_state, const char * IN_zip, gdouble* OUT_latitude, gdouble* OUT_longitude, gint* OUT_return_code );
GEOCLUE_RETURNCODE geoclue_geocode_free_text ( const char * IN_free_text, gdouble* OUT_latitude, gdouble* OUT_longitude, gint* OUT_return_code );
G_END_DECLS
#endif // __ORG_FOINSE_PROJECT_GEOCLUE_GEOCLUE_H__
<!-- Geoclue - A DBus api and wrapper for geography information
* Copyright (C) 2006 Garmin
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2 as published by the Free Software Foundation;
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
-->
<?xml version="1.0" encoding="UTF-8" ?>
<node name="/org/foinse_project/geoclue">
<interface name="org.foinse_project.geoclue">
<method name="version">
<arg type="i" name="major" direction="out" />
<arg type="i" name="minor" direction="out" />
<arg type="i" name="micro" direction="out" />
</method>
<method name="service_provider">
<arg type="s" name="name" direction="out" />
</method>
<signal name="current_position_changed">
<arg type="d" name="latitude" direction="out" />
<arg type="d" name="longitude" direction="out" />
</signal>
<method name="current_position">
<arg type="d" name="latitude" direction="out" />
<arg type="d" name="longitude" direction="out" />
</method>
<method name="current_position_error">
<arg type="d" name="latitude_error" direction="out" /><!-- Meters -->
<arg type="d" name="longitude_error" direction="out" /><!-- Meters -->
</method>
<method name="current_altitude">
<arg type="d" name="altitude" direction="out" /><!-- Meters -->
</method>
<method name="current_velocity">
<arg type="d" name="north_velocity" direction="out" /><!-- Meters per Second -->
<arg type="d" name="east_velocity" direction="out" /><!-- Meters per Second -->
</method>
<method name="current_time">
<arg type="i" name="year" direction="out" />
<arg type="i" name="month" direction="out" />
<arg type="i" name="day" direction="out" />
<arg type="i" name="hours" direction="out" />
<arg type="i" name="minutes" direction="out" />
<arg type="i" name="seconds" direction="out" />
</method>
<method name="satellites_in_view">
<arg type="ai" name="prn_numbers" direction="out" />
</method>
<method name="satellites_data">
<arg type="i" name="prn_number" direction="in" />
<arg type="d" name="elevation" direction="out" /><!-- Degrees -->
<arg type="d" name="azimuth" direction="out" /><!-- Degrees -->
<arg type="d" name="signal_noise_ratio" direction="out" />
</method>
<method name="sun_rise">
<arg type="d" name="latitude" direction="in" />
<arg type="d" name="longitude" direction="in" />
<arg type="i" name="year" direction="in" />
<arg type="i" name="month" direction="in" />
<arg type="i" name="day" direction="in" />
<arg type="i" name="hours" direction="out" />
<arg type="i" name="minutes" direction="out" />
<arg type="i" name="seconds" direction="out" />
</method>
<method name="sun_set">
<arg type="d" name="latitude" direction="in" />
<arg type="d" name="longitude" direction="in" />
<arg type="i" name="year" direction="in" />
<arg type="i" name="month" direction="in" />
<arg type="i" name="day" direction="in" />
<arg type="i" name="hours" direction="out" />
<arg type="i" name="minutes" direction="out" />
<arg type="i" name="seconds" direction="out" />
</method>
<method name="moon_rise">
<arg type="d" name="latitude" direction="in" />
<arg type="d" name="longitude" direction="in" />
<arg type="i" name="year" direction="in" />
<arg type="i" name="month" direction="in" />
<arg type="i" name="day" direction="in" />
<arg type="i" name="hours" direction="out" />
<arg type="i" name="minutes" direction="out" />
<arg type="i" name="seconds" direction="out" />
</method>
<method name="moon_set">
<arg type="d" name="latitude" direction="in" />
<arg type="d" name="longitude" direction="in" />
<arg type="i" name="year" direction="in" />
<arg type="i" name="month" direction="in" />
<arg type="i" name="day" direction="in" />
<arg type="i" name="hours" direction="out" />
<arg type="i" name="minutes" direction="out" />
<arg type="i" name="seconds" direction="out" />
</method>
<method name="geocode">
<arg type="s" name="street" direction="in" />
<arg type="s" name="city" direction="in" />
<arg type="s" name="state" direction="in" />
<arg type="s" name="zip" direction="in" />
<arg type="d" name="latitude" direction="out" />
<arg type="d" name="longitude" direction="out" />
<arg type="i" name="return_code" direction="out" />
</method>
<method name="geocode_free_text">
<arg type="s" name="free_text" direction="in" />
<arg type="d" name="latitude" direction="out" />
<arg type="d" name="longitude" direction="out" />
<arg type="i" name="return_code" direction="out" />
</method>
</interface>
</node>
\ No newline at end of file
bin_PROGRAMS = geoclueserver-yahoo
geoclueserver_yahoo_SOURCES = geoclueserver-yahoo.c \
geoclueserver_signal_marshal.c
AM_CPPFLAGS = $(YAHOO_CFLAGS) -I$(top_srcdir)
AM_LDFLAGS = $(YAHOO_LIBS)
BUILT_SOURCES = \
geoclueserver_signal_marshal.c \
geoclueserver_signal_marshal.h \
geoclueserver_server_glue.h
CLEANFILES = \
geoclueserver_signal_marshal.c \
geoclueserver_signal_marshal.h \
geoclueserver_server_glue.h
geoclueserver_server_glue.h:../geoclue/geoclue_glue.xml
$(DBUS_BINDING_TOOL) --prefix=geoclueserver --mode=glib-server $< | sed 's;\data = user_data;\data = (DBusGAsyncData\*)user_data;g' > $@
geoclueserver_signal_marshal.h:../geoclue/geoclue_signal_marshal.list
glib-genmarshal --prefix _geoclueserver --header $< > $@
geoclueserver_signal_marshal.c:../geoclue/geoclue_signal_marshal.list
glib-genmarshal --prefix _geoclueserver --body $< > $@
This diff is collapsed.
/* Geoclue - A DBus api and wrapper for geography information
* Copyright (C) 2006 Garmin
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2 as published by the Free Software Foundation;
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GEOCLUESERVER_SERVER_H__
#define __GEOCLUESERVER_SERVER_H__
#define DBUS_API_SUBJECT_TO_CHANGE
#include <dbus/dbus-glib.h>
#include <glib.h>
#define GEOCLUESERVER_DBUS_SERVICE "org.foinse_project.geoclue"
#define GEOCLUESERVER_DBUS_PATH "/org/foinse_project/geoclue"
#define GEOCLUESERVER_DBUS_INTERFACE "org.foinse_project.geoclue"
G_BEGIN_DECLS
//Let's create a geoclueserver object that has one method of geoclueserver
typedef struct Geoclueserver Geoclueserver;
typedef struct GeoclueserverClass GeoclueserverClass;
GType geoclueserver_get_type (void);
struct Geoclueserver
{
GObject parent;
};
struct GeoclueserverClass
{
GObjectClass parent;
DBusGConnection *connection;
/* Signals */
void (*current_position_changed) (Geoclueserver*, gdouble, gdouble );
};
#define TYPE_GEOCLUESERVER (geoclueserver_get_type ())
#define GEOCLUESERVER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), TYPE_GEOCLUESERVER, Geoclueserver))
#define GEOCLUESERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GEOCLUESERVER, GeoclueserverClass))
#define IS_GEOCLUESERVER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), TYPE_GEOCLUESERVER))
#define IS_GEOCLUESERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GEOCLUESERVER))
#define GEOCLUESERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GEOCLUESERVER, GeoclueserverClass))
gboolean geoclueserver_version (Geoclueserver *obj, gint* OUT_major, gint* OUT_minor, gint* OUT_micro, GError **error);
gboolean geoclueserver_service_provider(Geoclueserver *obj, char** name, GError **error);
gboolean geoclueserver_current_position(Geoclueserver *obj, gdouble* OUT_latitude, gdouble* OUT_longitude, GError **error );
gboolean geoclueserver_current_position_error(Geoclueserver *obj, gdouble* OUT_latitude_error, gdouble* OUT_longitude_error, GError **error );
gboolean geoclueserver_current_altitude(Geoclueserver *obj, gdouble* OUT_altitude, GError **error );
gboolean geoclueserver_current_velocity(Geoclueserver *obj, gdouble* OUT_north_velocity, gdouble* OUT_east_velocity, GError **error );
gboolean geoclueserver_current_time(Geoclueserver *obj, gint* OUT_year, gint* OUT_month, gint* OUT_day, gint* OUT_hours, gint* OUT_minutes, gint* OUT_seconds, GError **error );
gboolean geoclueserver_satellites_in_view(Geoclueserver *obj, GArray** OUT_prn_numbers, GError **error );
gboolean geoclueserver_satellites_data(Geoclueserver *obj, const gint IN_prn_number, gdouble* OUT_elevation, gdouble* OUT_azimuth, gdouble* OUT_signal_noise_ratio, GError **error );
gboolean geoclueserver_sun_rise(Geoclueserver *obj, const gdouble IN_latitude, const gdouble IN_longitude, const gint IN_year, const gint IN_month, const gint IN_day, gint* OUT_hours, gint* OUT_minutes, gint* OUT_seconds, GError **error );
gboolean geoclueserver_sun_set(Geoclueserver *obj, const gdouble IN_latitude, const gdouble IN_longitude, const gint IN_year, const gint IN_month, const gint IN_day, gint* OUT_hours, gint* OUT_minutes, gint* OUT_seconds, GError **error );
gboolean geoclueserver_moon_rise(Geoclueserver *obj, const gdouble IN_latitude, const gdouble IN_longitude, const gint IN_year, const gint IN_month, const gint IN_day, gint* OUT_hours, gint* OUT_minutes, gint* OUT_seconds, GError **error );
gboolean geoclueserver_moon_set(Geoclueserver *obj, const gdouble IN_latitude, const gdouble IN_longitude, const gint IN_year, const gint IN_month, const gint IN_day, gint* OUT_hours, gint* OUT_minutes, gint* OUT_seconds, GError **error );
gboolean geoclueserver_geocode(Geoclueserver *obj, const char * IN_street, const char * IN_city, const char * IN_state, const char * IN_zip, gdouble* OUT_latitude, gdouble* OUT_longitude, gint* OUT_return_code, GError **error );
gboolean geoclueserver_geocode_free_text(Geoclueserver *obj, const char * IN_free_text, gdouble* OUT_latitude, gdouble* OUT_longitude, gint* OUT_return_code, GError **error );
G_END_DECLS
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment