Commit 7ebbbf74 authored by Keith Preston's avatar Keith Preston

:made master functional, working on hostip.info and yahoo geocoding next

parent 486dafc9
SUBDIRS = map_yahoo position_manual geoclue_master
SUBDIRS = map_yahoo position_manual
bin_PROGRAMS = geoclue-map-server-yahoo
geoclue_map_server_yahoo_SOURCES = geoclue_map_server_yahoo.c \
geomapserver_signal_marshal.c
geoclue_map_signal_marshal.c
AM_CPPFLAGS = $(YAHOO_CFLAGS) -I$(top_srcdir)
AM_LDFLAGS = $(YAHOO_LIBS)
AM_LDFLAGS = $(YAHOO_LIBS)
BUILT_SOURCES = \
geomapserver_signal_marshal.c \
geomapserver_signal_marshal.h \
geomapserver_server_glue.h
geoclue_map_signal_marshal.c \
geoclue_map_signal_marshal.h \
geoclue_map_server_glue.h
CLEANFILES = \
geomapserver_signal_marshal.c \
geomapserver_signal_marshal.h \
geomapserver_server_glue.h
geoclue_map_signal_marshal.c \
geoclue_map_signal_marshal.h \
geoclue_map_server_glue.h
geomapserver_server_glue.h:../../geoclue/map_glue.xml
$(DBUS_BINDING_TOOL) --prefix=geomapserver --mode=glib-server $< | sed 's;\data = user_data;\data = (DBusGAsyncData\*)user_data;g' > $@
geoclue_map_server_glue.h:../../geoclue/map_glue.xml
$(DBUS_BINDING_TOOL) --prefix=geoclue_map --mode=glib-server $< | sed 's;\data = user_data;\data = (DBusGAsyncData\*)user_data;g' > $@
geomapserver_signal_marshal.h:../../geoclue/map_signal_marshal.list
glib-genmarshal --prefix _geomapserver --header $< > $@
geomapserver_signal_marshal.c:../../geoclue/map_signal_marshal.list
glib-genmarshal --prefix _geomapserver --body $< > $@
geoclue_map_signal_marshal.h:../../geoclue/map_signal_marshal.list
glib-genmarshal --prefix _geoclue_map --header $< > $@
geoclue_map_signal_marshal.c:../../geoclue/map_signal_marshal.list
glib-genmarshal --prefix _geoclue_map --body $< > $@
......@@ -16,8 +16,8 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GEOMAPSERVER_SERVER_H__
#define __GEOMAPSERVER_SERVER_H__
#ifndef __GEOCLUE_MAP_SERVER_H__
#define __GEOCLUE_MAP_SERVER_H__
#define DBUS_API_SUBJECT_TO_CHANGE
......@@ -26,9 +26,9 @@
#include <glib.h>
#include <stdio.h>
#include <string.h>
#define GEOMAPSERVER_DBUS_SERVICE "org.foinse_project.geomap"
#define GEOMAPSERVER_DBUS_PATH "/org/foinse_project/geomap"
#define GEOMAPSERVER_DBUS_INTERFACE "org.foinse_project.geomap"
#define GEOCLUE_MAP_DBUS_SERVICE "org.foinse_project.geoclue.map.yahoo"
#define GEOCLUE_MAP_DBUS_PATH "/org/foinse_project/geoclue/map/yahoo"
#define GEOCLUE_MAP_DBUS_INTERFACE "org.foinse_project.geoclue.map"
......@@ -36,12 +36,12 @@
G_BEGIN_DECLS
//Let's create a geomapserver object that has one method of geomapserver
typedef struct Geomapserver Geomapserver;
typedef struct GeomapserverClass GeomapserverClass;
//Let's create a geoclue_map object that has one method of geoclue_map
typedef struct GeoclueMap GeoclueMap;
typedef struct GeoclueMapClass GeoclueMapClass;
GType geomapserver_get_type (void);
struct Geomapserver
GType geoclue_map_get_type (void);
struct GeoclueMap
{
GObject parent;
......@@ -55,7 +55,7 @@ struct Geomapserver
};
struct GeomapserverClass
struct GeoclueMapClass
{
GObjectClass parent;
DBusGConnection *connection;
......@@ -63,28 +63,28 @@ struct GeomapserverClass
/* Signals */
void (*get_map_finished) (Geomapserver*, gint, GArray* , gchar* );
void (*get_map_finished) (GeoclueMap*, gint, GArray* , gchar* );
};
#define TYPE_GEOMAPSERVER (geomapserver_get_type ())
#define GEOMAPSERVER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), TYPE_GEOMAPSERVER, Geomapserver))
#define GEOMAPSERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GEOMAPSERVER, GeomapserverClass))
#define IS_GEOMAPSERVER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), TYPE_GEOMAPSERVER))
#define IS_GEOMAPSERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GEOMAPSERVER))
#define GEOMAPSERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GEOMAPSERVER, GeomapserverClass))
gboolean geomapserver_version (Geomapserver *obj, gint* OUT_major, gint* OUT_minor, gint* OUT_micro, GError **error);
gboolean geomapserver_service_provider(Geomapserver *obj, char** name, GError **error);
gboolean geomapserver_max_zoom(Geomapserver *obj, int* max_zoom, GError **error);
gboolean geomapserver_min_zoom(Geomapserver *obj, int* min_zoom, GError **error);
gboolean geomapserver_max_height(Geomapserver *obj, int* max_height, GError **error);
gboolean geomapserver_min_height(Geomapserver *obj, int* min_height, GError **error);
gboolean geomapserver_max_width(Geomapserver *obj, int* max_width, GError **error);
gboolean geomapserver_min_width(Geomapserver *obj, int* min_width, GError **error);
gboolean geomapserver_get_map (Geomapserver *obj, const gdouble IN_latitude, const gdouble IN_longitude, const gint IN_width, const gint IN_height, const gint IN_zoom, int* return_code, GError **error);
gboolean geomapserver_latlong_to_offset(Geomapserver *obj, const gdouble IN_latitude, const gdouble IN_longitude, const gint IN_zoom, const gdouble IN_center_latitude, const gdouble IN_center_longitude, int* OUT_x_offset, int* OUT_y_offset, GError **error);
gboolean geomapserver_offset_to_latlong(Geomapserver *obj, const int IN_x_offset,const int IN_y_offset, const gint IN_zoom, const gdouble IN_center_latitude, const gdouble IN_center_longitude, gdouble* OUT_latitude, gdouble* OUT_longitude, GError **error );
gboolean geomapserver_find_zoom_level (Geomapserver *obj, const gdouble IN_latitude_top_left, const gdouble IN_longitude_top_left, const gdouble IN_latitude_bottom_right, const gdouble IN_longitude_bottom_right, const gint IN_width, const gint IN_height, gint* OUT_zoom, GError** error);
#define TYPE_GEOCLUE_MAP (geoclue_map_get_type ())
#define GEOCLUE_MAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), TYPE_GEOCLUE_MAP, GeoclueMap))
#define GEOCLUE_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GEOCLUE_MAP, GeoclueMapClass))
#define IS_GEOCLUE_MAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), TYPE_GEOCLUE_MAP))
#define IS_GEOCLUE_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GEOCLUE_MAP))
#define GEOCLUE_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GEOCLUE_MAP, GeoclueMapClass))
gboolean geoclue_map_version (GeoclueMap *obj, gint* OUT_major, gint* OUT_minor, gint* OUT_micro, GError **error);
gboolean geoclue_map_service_provider(GeoclueMap *obj, char** name, GError **error);
gboolean geoclue_map_max_zoom(GeoclueMap *obj, int* max_zoom, GError **error);
gboolean geoclue_map_min_zoom(GeoclueMap *obj, int* min_zoom, GError **error);
gboolean geoclue_map_max_height(GeoclueMap *obj, int* max_height, GError **error);
gboolean geoclue_map_min_height(GeoclueMap *obj, int* min_height, GError **error);
gboolean geoclue_map_max_width(GeoclueMap *obj, int* max_width, GError **error);
gboolean geoclue_map_min_width(GeoclueMap *obj, int* min_width, GError **error);
gboolean geoclue_map_get_map (GeoclueMap *obj, const gdouble IN_latitude, const gdouble IN_longitude, const gint IN_width, const gint IN_height, const gint IN_zoom, int* return_code, GError **error);
gboolean geoclue_map_latlong_to_offset(GeoclueMap *obj, const gdouble IN_latitude, const gdouble IN_longitude, const gint IN_zoom, const gdouble IN_center_latitude, const gdouble IN_center_longitude, int* OUT_x_offset, int* OUT_y_offset, GError **error);
gboolean geoclue_map_offset_to_latlong(GeoclueMap *obj, const int IN_x_offset,const int IN_y_offset, const gint IN_zoom, const gdouble IN_center_latitude, const gdouble IN_center_longitude, gdouble* OUT_latitude, gdouble* OUT_longitude, GError **error );
gboolean geoclue_map_find_zoom_level (GeoclueMap *obj, const gdouble IN_latitude_top_left, const gdouble IN_longitude_top_left, const gdouble IN_latitude_bottom_right, const gdouble IN_longitude_bottom_right, const gint IN_width, const gint IN_height, gint* OUT_zoom, GError** error);
......
bin_PROGRAMS = geoclue-position-server-yahoo
geoclue_position_server_yahoo_SOURCES = geoclue_position_server_yahoo.c \
geoclueserver_signal_marshal.c
geoclue_position_signal_marshal.c
AM_CPPFLAGS = $(YAHOO_CFLAGS) -I$(top_srcdir)
AM_LDFLAGS = $(YAHOO_LIBS)
AM_LDFLAGS = $(YAHOO_LIBS) ../../geoclue/libgeoclue.la
BUILT_SOURCES = \
geoclueserver_signal_marshal.c \
geoclueserver_signal_marshal.h \
geoclueserver_server_glue.h
geoclue_position_signal_marshal.c \
geoclue_position_signal_marshal.h \
geoclue_position_server_glue.h
CLEANFILES = \
geoclueserver_signal_marshal.c \
geoclueserver_signal_marshal.h \
geoclueserver_server_glue.h
geoclue_position_signal_marshal.c \
geoclue_position_signal_marshal.h \
geoclue_position_server_glue.h
geoclueserver_server_glue.h:../../geoclue/position_glue.xml
$(DBUS_BINDING_TOOL) --prefix=geoclueserver --mode=glib-server $< | sed 's;\data = user_data;\data = (DBusGAsyncData\*)user_data;g' > $@
geoclue_position_server_glue.h:../../geoclue/position_glue.xml
$(DBUS_BINDING_TOOL) --prefix=geoclue_position --mode=glib-server $< | sed 's;\data = user_data;\data = (DBusGAsyncData\*)user_data;g' > $@
geoclueserver_signal_marshal.h:../../geoclue/position_signal_marshal.list
glib-genmarshal --prefix _geoclueserver --header $< > $@
geoclueserver_signal_marshal.c:../../geoclue/position_signal_marshal.list
glib-genmarshal --prefix _geoclueserver --body $< > $@
geoclue_position_signal_marshal.h:../../geoclue/position_signal_marshal.list
glib-genmarshal --prefix _geoclue_position --header $< > $@
geoclue_position_signal_marshal.c:../../geoclue/position_signal_marshal.list
glib-genmarshal --prefix _geoclue_position --body $< > $@
......@@ -17,63 +17,63 @@
* Boston, MA 02111-1307, USA.
*/
#ifndef __GEOCLUESERVER_SERVER_H__
#define __GEOCLUESERVER_SERVER_H__
#ifndef __GEOCLUE_POSITION_SERVER_H__
#define __GEOCLUE_POSITION_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"
#define GEOCLUE_POSITION_DBUS_SERVICE "org.foinse_project.geoclue.position.manual"
#define GEOCLUE_POSITION_DBUS_PATH "/org/foinse_project/geoclue/position/manual"
#define GEOCLUE_POSITION_DBUS_INTERFACE "org.foinse_project.geoclue.position"
G_BEGIN_DECLS
//Let's create a geoclueserver object that has one method of geoclueserver
typedef struct Geoclueserver Geoclueserver;
typedef struct GeoclueserverClass GeoclueserverClass;
//Let's create a geoclue_position object that has one method of geoclue_position
typedef struct GeocluePosition GeocluePosition;
typedef struct GeocluePositionClass GeocluePositionClass;
GType geoclueserver_get_type (void);
struct Geoclueserver
GType geoclue_position_get_type (void);
struct GeocluePosition
{
GObject parent;
};
struct GeoclueserverClass
struct GeocluePositionClass
{
GObjectClass parent;
DBusGConnection *connection;
/* Signals */
void (*current_position_changed) (Geoclueserver*, gdouble, gdouble );
void (*current_position_changed) (GeocluePosition*, 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 );
#define TYPE_GEOCLUE_POSITION (geoclue_position_get_type ())
#define GEOCLUE_POSITION(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), TYPE_GEOCLUE_POSITION, GeocluePosition))
#define GEOCLUE_POSITION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GEOCLUE_POSITION, GeocluePositionClass))
#define IS_GEOCLUE_POSITION(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), TYPE_GEOCLUE_POSITION))
#define IS_GEOCLUE_POSITION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GEOCLUE_POSITION))
#define GEOCLUE_POSITION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GEOCLUE_POSITION, GeocluePositionClass))
gboolean geoclue_position_version (GeocluePosition *obj, gint* OUT_major, gint* OUT_minor, gint* OUT_micro, GError **error);
gboolean geoclue_position_service_provider(GeocluePosition *obj, char** name, GError **error);
gboolean geoclue_position_current_position(GeocluePosition *obj, gdouble* OUT_latitude, gdouble* OUT_longitude, GError **error );
gboolean geoclue_position_current_position_error(GeocluePosition *obj, gdouble* OUT_latitude_error, gdouble* OUT_longitude_error, GError **error );
gboolean geoclue_position_current_altitude(GeocluePosition *obj, gdouble* OUT_altitude, GError **error );
gboolean geoclue_position_current_velocity(GeocluePosition *obj, gdouble* OUT_north_velocity, gdouble* OUT_east_velocity, GError **error );
gboolean geoclue_position_current_time(GeocluePosition *obj, gint* OUT_year, gint* OUT_month, gint* OUT_day, gint* OUT_hours, gint* OUT_minutes, gint* OUT_seconds, GError **error );
gboolean geoclue_position_satellites_in_view(GeocluePosition *obj, GArray** OUT_prn_numbers, GError **error );
gboolean geoclue_position_satellites_data(GeocluePosition *obj, const gint IN_prn_number, gdouble* OUT_elevation, gdouble* OUT_azimuth, gdouble* OUT_signal_noise_ratio, GError **error );
gboolean geoclue_position_sun_rise(GeocluePosition *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 geoclue_position_sun_set(GeocluePosition *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 geoclue_position_moon_rise(GeocluePosition *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 geoclue_position_moon_set(GeocluePosition *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 geoclue_position_geocode(GeocluePosition *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 geoclue_position_geocode_free_text(GeocluePosition *obj, const char * IN_free_text, gdouble* OUT_latitude, gdouble* OUT_longitude, gint* OUT_return_code, GError **error );
......
......@@ -17,7 +17,7 @@ AC_SUBST(DBUS_BINDING_TOOL)
AM_CONFIG_HEADER(config.h)
PKG_CHECK_MODULES(YAHOO, libsoup-2.2 libxml-2.0 dbus-glib-1 geomap gtk+-2.0)
PKG_CHECK_MODULES(YAHOO, libsoup-2.2 libxml-2.0 dbus-glib-1 gtk+-2.0)
AC_SUBST(YAHOO_CFLAGS)
AC_SUBST(YAHOO_LIBS)
......
lib_LTLIBRARIES = libgeoclue.la
bin_PROGRAMS = geoclue-master
geoclue_master_SOURCES = geoclue_master.c \
geoclue_master_signal_marshal.c
AM_CPPFLAGS = $(DEPS_CFLAGS) -I$(top_srcdir)
AM_LDFLAGS = $(DEPS_LIBS)
EXTRA_DIST = \
position_glue.xml \
position_signal_marshal.list \
map_glue.xml \
map_signal_marshal.list
map_signal_marshal.list \
master_glue.xml
libgeoclue_la_SOURCES = position.c \
position_signal_marshal.c \
......@@ -30,7 +42,10 @@ BUILT_SOURCES = \
position_signal_marshal.c \
map_client_glue.h \
map_signal_marshal.h \
map_signal_marshal.c
map_signal_marshal.c \
geoclue_master_signal_marshal.c \
geoclue_master_server_glue.h \
geoclue_master_client_glue.h
CLEANFILES = \
position_client_glue.h \
......@@ -38,7 +53,10 @@ CLEANFILES = \
position_signal_marshal.c \
map_client_glue.h \
map_signal_marshal.h \
map_signal_marshal.c
map_signal_marshal.c \
geoclue_master_signal_marshal.c \
geoclue_master_server_glue.h \
geoclue_master_client_glue.h
dbusspecdir = $(datadir)/geoclue/dbus
......@@ -66,5 +84,22 @@ map_signal_marshal.h:map_signal_marshal.list
glib-genmarshal --prefix _geoclue_map --header $< > $@
map_signal_marshal.c:map_signal_marshal.list
glib-genmarshal --prefix _geoclue_map --body $< > $@
geoclue_master_server_glue.h:master_glue.xml
$(DBUS_BINDING_TOOL) --prefix=geoclue_master --mode=glib-server $< | sed 's;\data = user_data;\data = (DBusGAsyncData\*)user_data;g' > $@
geoclue_master_client_glue.h:master_glue.xml
$(DBUS_BINDING_TOOL) --prefix=geoclue_client --mode=glib-client $< | sed 's;\data = user_data;\data = (DBusGAsyncData\*)user_data;g' > $@
geoclue_master_signal_marshal.h:master_signal_marshal.list
glib-genmarshal --prefix _geoclue_master --header $< > $@
geoclue_master_signal_marshal.c:master_signal_marshal.list
glib-genmarshal --prefix _geoclue_master --body $< > $@
/* Geomap - A DBus api and wrapper for getting geography pictures
* 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 <geoclue_master.h>
#include <geoclue_master_server_glue.h>
//#include <geoclue_map_signal_marshal.h>
#include <dbus/dbus-glib-bindings.h>
//#include <geoclue_map_client_glue.h>
G_DEFINE_TYPE(GeoclueMaster, geoclueserver_map, G_TYPE_OBJECT)
/* Filter signals and args */
enum {
/* FILL ME */
LAST_SIGNAL
};
static guint signals[LAST_SIGNAL];
static void
geoclueserver_map_init (GeoclueMaster *obj)
{
GError *error = NULL;
DBusGProxy *driver_proxy;
GeoclueMasterClass *klass = GEOCLUE_MASTER_GET_CLASS(obj);
guint request_ret;
/* Register DBUS path */
dbus_g_connection_register_g_object (klass->connection,
GEOCLUE_MASTER_DBUS_PATH ,
G_OBJECT (obj));
/* Register the service name, the constant here are defined in dbus-glib-bindings.h */
driver_proxy = dbus_g_proxy_new_for_name (klass->connection,
DBUS_SERVICE_DBUS,
DBUS_PATH_DBUS,
DBUS_INTERFACE_DBUS);
if(!org_freedesktop_DBus_request_name (driver_proxy,
GEOCLUE_MASTER_DBUS_SERVICE,
0, &request_ret, /* See tutorial for more infos about these */
&error))
{
g_printerr("Unable to register geomap service: %s", error->message);
g_error_free (error);
}
}
static void
geoclueserver_map_class_init (GeoclueMasterClass *klass)
{
GError *error = NULL;
klass->connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
if (klass->connection == NULL)
{
g_printerr("Unable to connect to dbus: %s", error->message);
g_error_free (error);
return;
}
/* &dbus_glib__object_info is provided in the server-bindings.h file */
/* OBJECT_TYPE_SERVER is the GType of your server object */
dbus_g_object_type_install_info (TYPE_GEOCLUE_MASTER, &dbus_glib_geoclue_master_object_info);
}
gboolean geoclue_master_version (GeoclueMaster *obj, gint* OUT_major, gint* OUT_minor, gint* OUT_micro, GError **error)
{
return TRUE;
}
gboolean geoclue_master_get_best_position_provider (GeoclueMaster *obj, char ** OUT_service, char ** OUT_path, GError **error)
{
*OUT_service = strdup("org.foinse_project.geoclue.position.manual");
*OUT_path = strdup("/org/foinse_project/geoclue/position/manual");
return TRUE;
}
gboolean geoclue_master_get_all_position_providers (GeoclueMaster *obj, char *** OUT_service, char *** OUT_path, GError **error)
{
*OUT_service = malloc(3 * sizeof(char*));
*OUT_path = malloc(3 * sizeof(char*));
(*OUT_service)[0] = strdup("org.foinse_project.geoclue.position.manual");
(*OUT_path)[0] = strdup("/org/foinse_project/geoclue/position/manual");
(*OUT_service)[1] = strdup("org.foinse_project.geoclue.position.hostipinfo");
(*OUT_path)[1] = strdup("/org/foinse_project/geoclue/position/hostipinfo");
(*OUT_service)[2] = NULL;
(*OUT_path)[2] = NULL;
return TRUE;
}
gboolean geoclue_master_provider_update (GeoclueMaster *obj, const char * IN_service, const char * IN_path, const gint IN_accuracy, const gboolean IN_active, GError **error)
{
return TRUE;
}
int main( int argc,
char *argv[] )
{
g_type_init ();
GMainLoop* loop = g_main_loop_new(NULL,TRUE);
GeoclueMaster* obj = NULL;
obj = GEOCLUE_MASTER(g_type_create_instance (TYPE_GEOCLUE_MASTER));
g_main_loop_run(loop);
g_object_unref(obj);
g_main_loop_unref(loop);
return 0;
}
/* Geomap - A DBus api and wrapper for getting geography pictures
* 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 __GEOCLUE_MASTER_H__
#define __GEOCLUE_MASTER_H__
#define DBUS_API_SUBJECT_TO_CHANGE
#include <dbus/dbus-glib.h>
#include <glib.h>
#include <stdio.h>
#include <string.h>
#define GEOCLUE_MASTER_DBUS_SERVICE "org.foinse_project.geoclue.master"
#define GEOCLUE_MASTER_DBUS_PATH "/org/foinse_project/geoclue/master"
#define GEOCLUE_MASTER_DBUS_INTERFACE "org.foinse_project.geoclue.master"
G_BEGIN_DECLS
typedef struct GeoclueMaster GeoclueMaster;
typedef struct GeoclueMasterClass GeoclueMasterClass;
GType geoclueserver_map_get_type (void);
struct GeoclueMaster
{
GObject parent;
};
struct GeoclueMasterClass
{
GObjectClass parent;
DBusGConnection *connection;
};
#define TYPE_GEOCLUE_MASTER (geoclueserver_map_get_type ())
#define GEOCLUE_MASTER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), TYPE_GEOCLUE_MASTER, GeoclueMaster))
#define GEOCLUE_MASTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GEOCLUE_MASTER, GeoclueMasterClass))
#define IS_GEOCLUE_MASTER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), TYPE_GEOCLUE_MASTER))
#define IS_GEOCLUE_MASTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GEOCLUE_MASTER))
#define GEOCLUE_MASTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GEOCLUE_MASTER, GeoclueMasterClass))
gboolean geoclue_master_version (GeoclueMaster *obj, gint* OUT_major, gint* OUT_minor, gint* OUT_micro, GError **error);
gboolean geoclue_master_version (GeoclueMaster *obj, gint* OUT_major, gint* OUT_minor, gint* OUT_micro, GError **error);
gboolean geoclue_master_get_best_position_provider (GeoclueMaster *obj, char ** OUT_service, char ** OUT_path, GError **error);
gboolean geoclue_master_get_all_position_providers (GeoclueMaster *obj, char *** OUT_service, char *** OUT_path, GError **error);
gboolean geoclue_master_provider_update (GeoclueMaster *obj, const char * IN_service, const char * IN_path, const gint IN_accuracy, const gboolean IN_active, GError **error);
G_END_DECLS
#endif
......@@ -27,9 +27,9 @@
#include <stdio.h>
#include <map_signal_marshal.h>
#define GEOCLUE_MAP_DBUS_SERVICE "org.foinse_project.geoclue.map"
#define GEOCLUE_MAP_DBUS_PATH "/org/foinse_project/geoclue/map"
//Change to yahoo hard code for now
#define GEOCLUE_MAP_DBUS_SERVICE "org.foinse_project.geoclue.map.yahoo"
#define GEOCLUE_MAP_DBUS_PATH "/org/foinse_project/geoclue/map/yahoo"
#define GEOCLUE_MAP_DBUS_INTERFACE "org.foinse_project.geoclue.map"
static DBusGConnection* geoclue_map_connection = NULL;
......@@ -39,7 +39,7 @@ static void* userdatastore = NULL;
void geoclue_map_get_geoclue_map_finished(void* userdata, GEOCLUE_MAP_RETURNCODE returncode, GArray* geoclue_map_buffer, gchar* buffer_mime_type)
void geoclue_map_get_map_finished(void* userdata, GEOCLUE_MAP_RETURNCODE returncode, GArray* geoclue_map_buffer, gchar* buffer_mime_type)
{
// printf("\n\n\nGet Map Finished returned \n\n\n\n");
if(returncode == GEOCLUE_MAP_SUCCESS)
......@@ -112,11 +112,11 @@ GEOCLUE_MAP_RETURNCODE geoclue_map_init()
G_TYPE_NONE,
G_TYPE_INT, DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_STRING, G_TYPE_INVALID);
dbus_g_proxy_add_signal (geoclue_map_proxy,
"get_geoclue_map_finished",
"get_map_finished",
G_TYPE_INT, DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_STRING, G_TYPE_INVALID);
dbus_g_proxy_connect_signal (geoclue_map_proxy,
"get_geoclue_map_finished",
(GCallback) geoclue_map_get_geoclue_map_finished,
"get_map_finished",
(GCallback) geoclue_map_get_map_finished,
(gpointer)NULL,
(GClosureNotify) NULL);
......
<?xml version="1.0" encoding="UTF-8" ?>
<!-- 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.
-->
<node name="/org/foinse_project/geoclue/master">
<interface name="org.foinse_project.geoclue.master">
<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>
<!-- client methods -->
<method name="get_best_position_provider">
<arg type="s" name="service" direction="out" />
<arg type="s" name="path" direction="out" />