static void
champlain_map_source_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
{
ChamplainMapSource *map_source = CHAMPLAIN_MAP_SOURCE(object);
ChamplainMapSourcePrivate *priv = map_source->priv;
static void
champlain_map_source_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
ChamplainMapSource *map_source = CHAMPLAIN_MAP_SOURCE(object);
ChamplainMapSourcePrivate *priv = map_source->priv;
guint
champlain_map_source_get_x (ChamplainMapSource *map_source,
- gint zoom_level,
- gdouble longitude)
+ gint zoom_level,
+ gdouble longitude)
{
ChamplainMapSourcePrivate *priv = map_source->priv;
// FIXME: support other projections
guint
champlain_map_source_get_y (ChamplainMapSource *map_source,
- gint zoom_level,
- gdouble latitude)
+ gint zoom_level,
+ gdouble latitude)
{
ChamplainMapSourcePrivate *priv = map_source->priv;
// FIXME: support other projections
guint
champlain_map_source_get_row_count (ChamplainMapSource *map_source,
- gint zoom_level)
+ gint zoom_level)
{
//ChamplainMapSourcePrivate *priv = map_source->priv;
// FIXME: support other projections
guint
champlain_map_source_get_column_count (ChamplainMapSource *map_source,
- gint zoom_level)
+ gint zoom_level)
{
//ChamplainMapSourcePrivate *priv = map_source->priv;
// FIXME: support other projections
void
champlain_map_source_get_tile (ChamplainMapSource *map_source,
- ChamplainView *view,
- ChamplainZoomLevel *zoom_level,
- ChamplainTile *tile)
+ ChamplainView *view,
+ ChamplainZoomLevel *zoom_level,
+ ChamplainTile *tile)
{
g_return_if_fail (CHAMPLAIN_IS_MAP_SOURCE (map_source));
void
champlain_map_source_real_get_tile (ChamplainMapSource *map_source,
- ChamplainView *view,
- ChamplainZoomLevel *zoom_level,
- ChamplainTile *tile)
+ ChamplainView *view,
+ ChamplainZoomLevel *zoom_level,
+ ChamplainTile *tile)
{
g_error ("Should not be reached");
}
gdouble
champlain_map_source_get_longitude (ChamplainMapSource *map_source,
- gint zoom_level,
- guint x)
+ gint zoom_level,
+ guint x)
{
//ChamplainMapSourcePrivate *priv = map_source->priv;
// FIXME: support other projections
gdouble
champlain_map_source_get_latitude (ChamplainMapSource *map_source,
- gint zoom_level,
- guint y)
+ gint zoom_level,
+ guint y)
{
//ChamplainMapSourcePrivate *priv = map_source->priv;
// FIXME: support other projections
void
champlain_map_source_set_name (ChamplainMapSource *map_source,
- const gchar *name)
+ const gchar *name)
{
ChamplainMapSourcePrivate *priv = map_source->priv;
void
champlain_map_source_set_license (ChamplainMapSource *map_source,
- const gchar *license)
+ const gchar *license)
{
ChamplainMapSourcePrivate *priv = map_source->priv;
guint champlain_map_source_get_tile_size (ChamplainMapSource *map_source);
guint champlain_map_source_get_x (ChamplainMapSource *map_source,
- gint zoom_level, gdouble longitude);
+ gint zoom_level,
+ gdouble longitude);
guint champlain_map_source_get_y (ChamplainMapSource *map_source,
- gint zoom_level, gdouble latitude);
+ gint zoom_level,
+ gdouble latitude);
gdouble champlain_map_source_get_longitude (ChamplainMapSource *map_source,
- gint zoom_level, guint x);
+ gint zoom_level,
+ guint x);
gdouble champlain_map_source_get_latitude (ChamplainMapSource *map_source,
- gint zoom_level, guint y);
+ gint zoom_level,
+ guint y);
guint champlain_map_source_get_row_count (ChamplainMapSource *map_source,
gint zoom_level);
gint zoom_level);
void champlain_map_source_get_tile (ChamplainMapSource *map_source,
- ChamplainView *view, ChamplainZoomLevel *level, ChamplainTile *tile);
+ ChamplainView *view,
+ ChamplainZoomLevel *level,
+ ChamplainTile *tile);
void champlain_map_source_set_name (ChamplainMapSource *map_source,
const gchar *name);
const gchar *license);
const gchar * champlain_map_source_get_license (ChamplainMapSource *map_source);
-
#endif
static void
champlain_network_map_source_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
{
ChamplainNetworkMapSource *network_map_source = CHAMPLAIN_NETWORK_MAP_SOURCE(object);
ChamplainNetworkMapSourcePrivate *priv = network_map_source->priv;
static void
champlain_network_map_source_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
ChamplainNetworkMapSource *network_map_source = CHAMPLAIN_NETWORK_MAP_SOURCE(object);
ChamplainNetworkMapSourcePrivate *priv = network_map_source->priv;
{
ChamplainNetworkMapSource *network_map_source = CHAMPLAIN_NETWORK_MAP_SOURCE (object);
ChamplainNetworkMapSourcePrivate *priv = network_map_source->priv;
-
+
g_free (priv->proxy_uri);
g_free (priv->uri_format);
ChamplainNetworkMapSource*
champlain_network_map_source_new_full (const gchar *name,
- const gchar *license,
- const gchar *license_uri,
- guint min_zoom,
- guint max_zoom,
- guint tile_size,
- ChamplainMapProjection projection,
- const gchar *uri_format)
+ const gchar *license,
+ const gchar *license_uri,
+ guint min_zoom,
+ guint max_zoom,
+ guint tile_size,
+ ChamplainMapProjection projection,
+ const gchar *uri_format)
{
ChamplainNetworkMapSource * network_map_source;
network_map_source = g_object_new (CHAMPLAIN_TYPE_NETWORK_MAP_SOURCE, "name", name,
#define SIZE 8
gchar *
champlain_network_map_source_get_tile_uri (ChamplainNetworkMapSource *network_map_source,
- gint x,
- gint y,
- gint z)
+ gint x,
+ gint y,
+ gint z)
{
ChamplainNetworkMapSourcePrivate *priv = network_map_source->priv;
void
champlain_network_map_source_set_tile_uri (ChamplainNetworkMapSource *network_map_source,
- const gchar *uri_format)
+ const gchar *uri_format)
{
ChamplainNetworkMapSourcePrivate *priv = network_map_source->priv;
static gchar *
get_filename (ChamplainNetworkMapSource *network_map_source,
- ChamplainZoomLevel *level,
- ChamplainTile *tile)
+ ChamplainZoomLevel *level,
+ ChamplainTile *tile)
{
//ChamplainNetworkMapSourcePrivate *priv = network_map_source->priv;
return g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s" G_DIR_SEPARATOR_S
static void
file_loaded_cb (SoupSession *session,
- SoupMessage *msg,
- gpointer user_data)
+ SoupMessage *msg,
+ gpointer user_data)
{
FileLoadedCallbackContext *ctx = (FileLoadedCallbackContext*) user_data;
GdkPixbufLoader* loader;
void
champlain_network_map_source_get_tile (ChamplainMapSource *map_source,
- ChamplainView *view,
- ChamplainZoomLevel *zoom_level,
- ChamplainTile *tile)
+ ChamplainView *view,
+ ChamplainZoomLevel *zoom_level,
+ ChamplainTile *tile)
{
gchar* filename;
gboolean use_cache = FALSE;
ChamplainMapSource * champlain_map_source_new_mff_relief (void);
gchar * champlain_network_map_source_get_tile_uri (ChamplainNetworkMapSource *source,
- gint x, gint y, gint z);
+ gint x,
+ gint y,
+ gint z);
void champlain_network_map_source_set_tile_uri (ChamplainNetworkMapSource *network_map_source,
const gchar *uri_format);
void champlain_network_map_source_get_tile (ChamplainMapSource *map_source,
- ChamplainView *view, ChamplainZoomLevel *level, ChamplainTile *tile);
+ ChamplainView *view,
+ ChamplainZoomLevel *level,
+ ChamplainTile *tile);
#endif
static gboolean
scroll_event (ClutterActor *actor,
- ClutterScrollEvent *event,
- ChamplainView *view)
+ ClutterScrollEvent *event,
+ ChamplainView *view)
{
ChamplainViewPrivate *priv = view->priv;
static void
marker_reposition_cb (ChamplainMarker *marker,
- ChamplainView *view)
+ ChamplainView *view)
{
ChamplainViewPrivate *priv = view->priv;
ChamplainMarkerPrivate *marker_priv = CHAMPLAIN_MARKER_GET_PRIVATE (marker);
static void
notify_marker_reposition_cb (ChamplainMarker *marker,
- GParamSpec *arg1,
- ChamplainView *view)
+ GParamSpec *arg1,
+ ChamplainView *view)
{
marker_reposition_cb (marker, view);
}
static void
layer_add_marker_cb (ClutterGroup *layer,
- ChamplainMarker *marker,
- ChamplainView *view)
+ ChamplainMarker *marker,
+ ChamplainView *view)
{
g_signal_connect (marker, "notify::longitude",
G_CALLBACK (notify_marker_reposition_cb), view);
static void
connect_marker_notify_cb (ChamplainMarker *marker,
- ChamplainView *view)
+ ChamplainView *view)
{
g_signal_connect (marker, "notify::longitude",
G_CALLBACK (notify_marker_reposition_cb), view);
static void
layer_reposition_cb (ClutterActor *layer,
- ChamplainView *view)
+ ChamplainView *view)
{
clutter_container_foreach (CLUTTER_CONTAINER (layer),
CLUTTER_CALLBACK (marker_reposition_cb), view);
static void
champlain_view_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
{
ChamplainView *view = CHAMPLAIN_VIEW (object);
ChamplainViewPrivate *priv = view->priv;
static void
champlain_view_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
ChamplainView *view = CHAMPLAIN_VIEW (object);
ChamplainViewPrivate *priv = view->priv;
clutter_container_add_actor (CLUTTER_CONTAINER (priv->viewport),
priv->user_layers);
clutter_actor_raise (priv->user_layers, priv->map_layer);
-
+
champlain_view_set_size(view, priv->viewport_size.width,
priv->viewport_size.height);
static void
viewport_x_changed_cb (GObject *gobject,
- GParamSpec *arg1,
- ChamplainView *view)
+ GParamSpec *arg1,
+ ChamplainView *view)
{
ChamplainViewPrivate *priv = view->priv;
//FIXME: move to an handler of actor size change
void
champlain_view_set_size (ChamplainView *view,
- guint width,
- guint height)
+ guint width,
+ guint height)
{
g_return_if_fail (CHAMPLAIN_IS_VIEW (view));
static gboolean
finger_scroll_button_press_cb (ClutterActor *actor,
- ClutterButtonEvent *event,
- ChamplainView *view)
+ ClutterButtonEvent *event,
+ ChamplainView *view)
{
ChamplainViewPrivate *priv = view->priv;
}
static void
-view_update_anchor (ChamplainView *view, gint x, gint y)
+view_update_anchor (ChamplainView *view,
+ gint x,
+ gint y)
{
ChamplainViewPrivate *priv = view->priv;
gboolean need_anchor = FALSE;
*/
void
champlain_view_center_on (ChamplainView *view,
- gdouble latitude,
- gdouble longitude)
+ gdouble latitude,
+ gdouble longitude)
{
g_return_if_fail (CHAMPLAIN_IS_VIEW (view));
static void
timeline_new_frame (ClutterTimeline *timeline,
- gint frame_num,
- GoToContext *ctx)
+ gint frame_num,
+ GoToContext *ctx)
{
gdouble alpha;
gdouble lat;
*/
void
champlain_view_go_to (ChamplainView *view,
- gdouble latitude,
- gdouble longitude)
+ gdouble latitude,
+ gdouble longitude)
{
g_return_if_fail (CHAMPLAIN_IS_VIEW (view));
* Since: 0.4
*/
void
-champlain_view_set_min_zoom_level (ChamplainView *view, gint min_zoom_level)
+champlain_view_set_min_zoom_level (ChamplainView *view,
+ gint min_zoom_level)
{
g_return_if_fail (CHAMPLAIN_IS_VIEW (view));
* Since: 0.4
*/
void
-champlain_view_set_max_zoom_level (ChamplainView *view, gint max_zoom_level)
+champlain_view_set_max_zoom_level (ChamplainView *view,
+ gint max_zoom_level)
{
g_return_if_fail (CHAMPLAIN_IS_VIEW (view));
* Since: 0.2
*/
void
-champlain_view_add_layer (ChamplainView *view, ChamplainLayer *layer)
+champlain_view_add_layer (ChamplainView *view,
+ ChamplainLayer *layer)
{
g_return_if_fail (CHAMPLAIN_IS_VIEW (view));
g_return_if_fail (CLUTTER_IS_ACTOR (layer));
*/
gboolean
champlain_view_get_coords_from_event (ChamplainView *view,
- ClutterEvent *event,
- gdouble *latitude,
- gdouble *longitude)
+ ClutterEvent *event,
+ gdouble *latitude,
+ gdouble *longitude)
{
g_return_val_if_fail (CHAMPLAIN_IS_VIEW (view), FALSE);
/* Apparently there isn a more precise test */
}
static void
-view_position_tile (ChamplainView* view, ChamplainTile* tile)
+view_position_tile (ChamplainView* view,
+ ChamplainTile* tile)
{
ChamplainViewPrivate *priv = view->priv;
void
champlain_view_tile_ready (ChamplainView *view,
- ChamplainZoomLevel *level,
- ChamplainTile *tile,
- gboolean animate)
+ ChamplainZoomLevel *level,
+ ChamplainTile *tile,
+ gboolean animate)
{
ClutterActor *actor;
ClutterEffectTemplate *etemplate;
*/
void
champlain_view_set_map_source (ChamplainView *view,
- ChamplainMapSource *source)
+ ChamplainMapSource *source)
{
g_return_if_fail (CHAMPLAIN_IS_VIEW (view) &&
CHAMPLAIN_IS_MAP_SOURCE (source));
g_object_unref (priv->map_source);
priv->map_source = g_object_ref (source);
-
+
priv->min_zoom_level = champlain_map_source_get_min_zoom_level (priv->map_source);
priv->max_zoom_level = champlain_map_source_get_max_zoom_level (priv->map_source);
*/
void
champlain_view_set_decel_rate (ChamplainView *view,
- gdouble rate)
+ gdouble rate)
{
g_return_if_fail (CHAMPLAIN_IS_VIEW (view) &&
rate > 2.0 &&
*/
void
champlain_view_set_scroll_mode (ChamplainView *view,
- ChamplainScrollMode mode)
+ ChamplainScrollMode mode)
{
g_return_if_fail (CHAMPLAIN_IS_VIEW (view));
*/
void
champlain_view_set_keep_center_on_resize (ChamplainView *view,
- gboolean value)
+ gboolean value)
{
g_return_if_fail (CHAMPLAIN_IS_VIEW (view));
*/
void
champlain_view_set_show_license (ChamplainView *view,
- gboolean value)
+ gboolean value)
{
g_return_if_fail (CHAMPLAIN_IS_VIEW (view));
*/
void
champlain_view_set_zoom_on_double_click (ChamplainView *view,
- gboolean value)
+ gboolean value)
{
g_return_if_fail (CHAMPLAIN_IS_VIEW (view));
*/
void
champlain_view_ensure_visible (ChamplainView *view,
- gdouble lat1,
- gdouble lon1,
- gdouble lat2,
- gdouble lon2,
- gboolean animate)
+ gdouble lat1,
+ gdouble lon1,
+ gdouble lat2,
+ gdouble lon2,
+ gboolean animate)
{
ChamplainViewPrivate *priv = view->priv;
gint zoom_level = priv->zoom_level;
gdouble width, height;
gdouble min_lat,min_lon,max_lat,max_lon;
gboolean good_size = FALSE;
-
+
/*We first sort the lat,lon in order to have min and max */
if (lat1 < lat2)
{
max_lat = lat1;
min_lat = lat2;
}
-
+
if (lon1 < lon2)
{
min_lon = lon1;
*/
void
champlain_view_ensure_markers_visible (ChamplainView *view,
- ChamplainMarker *markers[],
- gboolean animate)
+ ChamplainMarker *markers[],
+ gboolean animate)
{
gdouble min_lat, min_lon, max_lat, max_lon;
ChamplainMarker *marker = NULL;
ClutterActor *champlain_view_new (void);
-void champlain_view_center_on (ChamplainView *view, gdouble latitude, gdouble longitude);
-void champlain_view_go_to (ChamplainView *view, gdouble latitude, gdouble longitude);
+void champlain_view_center_on (ChamplainView *view,
+ gdouble latitude,
+ gdouble longitude);
+void champlain_view_go_to (ChamplainView *view,
+ gdouble latitude,
+ gdouble longitude);
void champlain_view_stop_go_to (ChamplainView *view);
void champlain_view_zoom_in (ChamplainView *champlainView);
void champlain_view_zoom_out (ChamplainView *champlainView);
void champlain_view_set_zoom_level (ChamplainView *champlainView,
gint zoom_level);
-void champlain_view_set_min_zoom_level (ChamplainView *view,
+void champlain_view_set_min_zoom_level (ChamplainView *view,
gint zoom_level);
-void champlain_view_set_max_zoom_level (ChamplainView *view,
+void champlain_view_set_max_zoom_level (ChamplainView *view,
gint zoom_level);
-void champlain_view_ensure_visible (ChamplainView *view, gdouble lat1,
- gdouble lon1, gdouble lat2, gdouble lon2, gboolean animate);
+void champlain_view_ensure_visible (ChamplainView *view,
+ gdouble lat1,
+ gdouble lon1,
+ gdouble lat2,
+ gdouble lon2,
+ gboolean animate);
void champlain_view_ensure_markers_visible (ChamplainView *view,
- ChamplainMarker *markers[], gboolean animate);
+ ChamplainMarker *markers[],
+ gboolean animate);
void champlain_view_set_map_source (ChamplainView *champlainView,
ChamplainMapSource *map_source);
-void champlain_view_set_size (ChamplainView *view, guint width, guint height);
-void champlain_view_set_decel_rate (ChamplainView *view, gdouble rate);
+void champlain_view_set_size (ChamplainView *view,
+ guint width,
+ guint height);
+void champlain_view_set_decel_rate (ChamplainView *view,
+ gdouble rate);
void champlain_view_set_scroll_mode (ChamplainView *view,
ChamplainScrollMode mode);
void champlain_view_set_keep_center_on_resize (ChamplainView *view,
void champlain_view_set_zoom_on_double_click (ChamplainView *view,
gboolean value);
-void champlain_view_add_layer (ChamplainView *champlainView, ChamplainLayer *layer);
+void champlain_view_add_layer (ChamplainView *champlainView,
+ ChamplainLayer *layer);
-gboolean champlain_view_get_coords_from_event (ChamplainView *view, ClutterEvent *event, gdouble *lat, gdouble *lon);
+gboolean champlain_view_get_coords_from_event (ChamplainView *view,
+ ClutterEvent *event,
+ gdouble *lat,
+ gdouble *lon);
-void champlain_view_tile_ready (ChamplainView *view, ChamplainZoomLevel *level, ChamplainTile *tile, gboolean animate);
+void champlain_view_tile_ready (ChamplainView *view,
+ ChamplainZoomLevel *level,
+ ChamplainTile *tile,
+ gboolean animate);
#endif