Commit 580edf6c authored by Keith Preston's avatar Keith Preston

:Added initial master

parent 52a620b3
SUBDIRS = map_yahoo position_manual
SUBDIRS = map_yahoo position_manual geoclue_master
bin_PROGRAMS = geoclue-master
geoclue_master_SOURCES = geoclue_master.c \
geoclue_map_signal_marshal.c \
geoclue_position_signal_marshal.c
AM_CPPFLAGS = $(DEPS_CFLAGS) -I$(top_srcdir)
AM_LDFLAGS = $(DEPS_LIBS)
BUILT_SOURCES = \
geoclue_map_signal_marshal.c \
geoclue_map_signal_marshal.h \
geoclue_map_server_glue.h \
geoclue_position_signal_marshal.c \
geoclue_position_signal_marshal.h \
geoclue_position_server_glue.h
CLEANFILES = \
geoclue_map_signal_marshal.c \
geoclue_map_signal_marshal.h \
geoclue_map_server_glue.h \
geoclue_position_signal_marshal.c \
geoclue_position_signal_marshal.h \
geoclue_position_server_glue.h
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' > $@
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 $< > $@
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' > $@
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 $< > $@
/* 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_map_server_glue.h>
#include <geoclue_map_signal_marshal.h>
#include <dbus/dbus-glib-bindings.h>
G_DEFINE_TYPE(Geoclue, geoclue, G_TYPE_OBJECT)
/* Filter signals and args */
enum {
/* FILL ME */
GET_MAP_FINISHED,
LAST_SIGNAL
};
static guint signals[LAST_SIGNAL];
static void
geoclue_init (Geoclue *obj)
{
GError *error = NULL;
DBusGProxy *driver_proxy;
GeoclueClass *klass = GEOCLUE_GET_CLASS(obj);
guint request_ret;
/* Register DBUS path */
dbus_g_connection_register_g_object (klass->connection,
GEOCLUE_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_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);
exit(1);
}
}
static void
geoclue_class_init (GeoclueClass *klass)
{
GError *error = NULL;
klass->connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
/*
signals[GET_MAP_FINISHED] =
g_signal_new ("get_map_finished",
TYPE_GEOCLUE,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GeoclueClass, get_map_finished),
NULL, // accumulator
NULL, // accumulator data
_geoclue_map_VOID__INT_BOXED_STRING,
G_TYPE_NONE, 3 ,G_TYPE_INT, DBUS_TYPE_G_UCHAR_ARRAY , G_TYPE_STRING);
klass->get_map_finished = geoclue_map_get_map_finished;
*/
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, &dbus_glib_geoclue_map_object_info);
}
gboolean geoclue_map_version (Geoclue *obj, gint* OUT_major, gint* OUT_minor, gint* OUT_micro, GError **error)
{
return TRUE;
}
gboolean geoclue_map_service_provider(Geoclue *obj, char** name, GError **error)
{
return TRUE;
}
gboolean geoclue_map_max_zoom(Geoclue *obj, int* max_zoom, GError **error)
{
return TRUE;
}
gboolean geoclue_map_min_zoom(Geoclue *obj, int* min_zoom, GError **error)
{
return TRUE;
}
gboolean geoclue_map_max_height(Geoclue *obj, int* max_height, GError **error)
{
return TRUE;
}
gboolean geoclue_map_min_height(Geoclue *obj, int* min_height, GError **error)
{
return TRUE;
}
gboolean geoclue_map_max_width(Geoclue *obj, int* max_width, GError **error)
{
return TRUE;
}
gboolean geoclue_map_min_width(Geoclue *obj, int* min_width, GError **error)
{
return TRUE;
}
gboolean geoclue_map_get_map (Geoclue *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)
{
return TRUE;
}
gboolean geoclue_map_latlong_to_offset(Geoclue *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)
{
return TRUE;
}
gboolean geoclue_map_offset_to_latlong(Geoclue *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 )
{
return TRUE;
}
gboolean geoclue_map_find_zoom_level (Geoclue *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)
{
return TRUE;
}
int main( int argc,
char *argv[] )
{
guint request_name_result;
g_type_init ();
GMainLoop* loop = g_main_loop_new(NULL,TRUE);
Geoclue* obj = NULL;
obj = GEOCLUE(g_type_create_instance (geoclue_get_type()));
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_SERVER_H__
#define __GEOCLUE_SERVER_H__
#define DBUS_API_SUBJECT_TO_CHANGE
#include <dbus/dbus-glib.h>
#include <glib.h>
#include <stdio.h>
#include <string.h>
#define GEOCLUE_DBUS_SERVICE "org.foinse_project.geoclue"
#define GEOCLUE_DBUS_PATH "/org/foinse_project/geoclue"
#define GEOCLUE_DBUS_INTERFACE "org.foinse_project.geoclue"
G_BEGIN_DECLS
typedef struct Geoclue Geoclue;
typedef struct GeoclueClass GeoclueClass;
GType geoclue_get_type (void);
struct Geoclue
{
GObject parent;
};
struct GeoclueClass
{
GObjectClass parent;
DBusGConnection *connection;
};
#define TYPE_GEOCLUE (geoclue_get_type ())
#define GEOCLUE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), TYPE_GEOCLUE, Geoclue))
#define GEOCLUE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GEOCLUE, GeoclueClass))
#define IS_GEOCLUE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), TYPE_GEOCLUE))
#define IS_GEOCLUE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GEOCLUE))
#define GEOCLUE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GEOCLUE, GeoclueClass))
gboolean geoclue_map_version (Geoclue *obj, gint* OUT_major, gint* OUT_minor, gint* OUT_micro, GError **error);
gboolean geoclue_map_service_provider(Geoclue *obj, char** name, GError **error);
gboolean geoclue_map_max_zoom(Geoclue *obj, int* max_zoom, GError **error);
gboolean geoclue_map_min_zoom(Geoclue *obj, int* min_zoom, GError **error);
gboolean geoclue_map_max_height(Geoclue *obj, int* max_height, GError **error);
gboolean geoclue_map_min_height(Geoclue *obj, int* min_height, GError **error);
gboolean geoclue_map_max_width(Geoclue *obj, int* max_width, GError **error);
gboolean geoclue_map_min_width(Geoclue *obj, int* min_width, GError **error);
gboolean geoclue_map_get_map (Geoclue *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(Geoclue *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(Geoclue *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 (Geoclue *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);
G_END_DECLS
#endif
......@@ -35,6 +35,7 @@ AC_OUTPUT(Makefile
example/Makefile
geoclue.pc
backend/Makefile
backend/geoclue_master/Makefile
backend/map_yahoo/Makefile
backend/position_manual/Makefile
)
bin_PROGRAMS = geoclue_position_example geoclue_map_example geoclue_map_layout_example
bin_PROGRAMS = geoclue-position-example geoclue-map-example geoclue-map-layout-example
geoclue_map_example_SOURCES = geoclue_map_example.c
geoclue_map_layout_example_SOURCES = geoclue_map_layout_example.c
......
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