Commit 43321a41 authored by Jiří Techet's avatar Jiří Techet Committed by Pierre-Luc Beaudoin

Coding style fixes

The most boring hour in my life...
Signed-off-by: default avatarJiří Techet <techet@gmail.com>
parent e7693b79
......@@ -71,9 +71,9 @@ G_DEFINE_TYPE (ChamplainBaseMarker, champlain_base_marker, CLUTTER_TYPE_GROUP);
static void
champlain_base_marker_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
ChamplainBaseMarker *base_marker = CHAMPLAIN_BASE_MARKER (object);
ChamplainBaseMarkerPrivate *priv = CHAMPLAIN_BASE_MARKER_GET_PRIVATE (base_marker);
......@@ -96,9 +96,9 @@ champlain_base_marker_get_property (GObject *object,
static void
champlain_base_marker_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
ChamplainBaseMarker *base_marker = CHAMPLAIN_BASE_MARKER (object);
ChamplainBaseMarkerPrivate *priv = CHAMPLAIN_BASE_MARKER_GET_PRIVATE (base_marker);
......
......@@ -3,7 +3,7 @@
*
* This file is inspired by clutter-color.c which is
* Copyright (C) 2006 OpenedHand, and has the same license.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
......@@ -90,7 +90,6 @@ champlain_bounding_box_copy (const ChamplainBoundingBox *bbox)
void
champlain_bounding_box_free (ChamplainBoundingBox *bbox)
{
if (G_UNLIKELY (bbox == NULL))
return;
......
......@@ -39,7 +39,8 @@ struct _ChamplainErrorTileSourcePrivate
ClutterActor *error_actor;
};
static void fill_tile (ChamplainMapSource *map_source, ChamplainTile *tile);
static void fill_tile (ChamplainMapSource *map_source,
ChamplainTile *tile);
static void
champlain_error_tile_source_dispose (GObject *object)
......@@ -90,7 +91,8 @@ ChamplainErrorTileSource* champlain_error_tile_source_new_full (guint tile_size)
}
static void
fill_tile (ChamplainMapSource *map_source, ChamplainTile *tile)
fill_tile (ChamplainMapSource *map_source,
ChamplainTile *tile)
{
g_return_if_fail (CHAMPLAIN_IS_ERROR_TILE_SOURCE (map_source));
g_return_if_fail (CHAMPLAIN_IS_TILE (tile));
......
This diff is collapsed.
......@@ -57,8 +57,8 @@ static guint get_tile_size (ChamplainMapSource *map_source);
static void fill_tile (ChamplainMapSource *map_source, ChamplainTile *tile);
static void on_set_next_source (ChamplainMapSource *map_source,
ChamplainMapSource *old_next_source,
ChamplainMapSource *new_next_source);
ChamplainMapSource *old_next_source,
ChamplainMapSource *new_next_source);
static void
champlain_map_source_chain_dispose (GObject *object)
......@@ -211,7 +211,7 @@ get_tile_size (ChamplainMapSource *map_source)
static void
fill_tile (ChamplainMapSource *map_source,
ChamplainTile *tile)
ChamplainTile *tile)
{
ChamplainMapSourceChain *source_chain = CHAMPLAIN_MAP_SOURCE_CHAIN (map_source);
g_return_if_fail (source_chain);
......@@ -224,8 +224,8 @@ fill_tile (ChamplainMapSource *map_source,
static void
on_set_next_source (ChamplainMapSource *map_source,
ChamplainMapSource *old_next_source,
ChamplainMapSource *new_next_source)
ChamplainMapSource *old_next_source,
ChamplainMapSource *new_next_source)
{
ChamplainMapSourceChain *source_chain = CHAMPLAIN_MAP_SOURCE_CHAIN (map_source);
ChamplainMapSourceChainPrivate *priv = GET_PRIVATE(source_chain);
......@@ -238,8 +238,8 @@ on_set_next_source (ChamplainMapSource *map_source,
static void
assign_cache_of_next_source_sequence (ChamplainMapSourceChain *source_chain,
ChamplainMapSource *start_map_source,
ChamplainTileCache *tile_cache)
ChamplainMapSource *start_map_source,
ChamplainTileCache *tile_cache)
{
ChamplainMapSource *map_source = start_map_source;
ChamplainMapSource *chain_next_source = champlain_map_source_get_next_source (CHAMPLAIN_MAP_SOURCE(source_chain));
......@@ -258,7 +258,8 @@ assign_cache_of_next_source_sequence (ChamplainMapSourceChain *source_chain,
}
static void
reload_tiles_cb (ChamplainMapSource *map_source, ChamplainMapSourceChain *source_chain)
reload_tiles_cb (ChamplainMapSource *map_source,
ChamplainMapSourceChain *source_chain)
{
/* propagate the signal from the chain that is inside champlain_map_source_chain */
g_signal_emit_by_name (source_chain, "reload-tiles", NULL);
......@@ -274,7 +275,8 @@ reload_tiles_cb (ChamplainMapSource *map_source, ChamplainMapSourceChain *source
* Since: 0.6
*/
void
champlain_map_source_chain_push (ChamplainMapSourceChain *source_chain, ChamplainMapSource *map_source)
champlain_map_source_chain_push (ChamplainMapSourceChain *source_chain,
ChamplainMapSource *map_source)
{
ChamplainMapSourceChainPrivate *priv = GET_PRIVATE(source_chain);
gboolean is_cache = FALSE;
......
......@@ -53,7 +53,8 @@ GType champlain_map_source_chain_get_type (void);
ChamplainMapSourceChain* champlain_map_source_chain_new (void);
void champlain_map_source_chain_push (ChamplainMapSourceChain *source_chain, ChamplainMapSource *map_source);
void champlain_map_source_chain_push (ChamplainMapSourceChain *source_chain,
ChamplainMapSource *map_source);
void champlain_map_source_chain_pop (ChamplainMapSourceChain *source_chain);
G_END_DECLS
......
......@@ -76,7 +76,7 @@ struct _ChamplainMapSourceFactoryPrivate
};
static ChamplainMapSource * champlain_map_source_new_generic (
ChamplainMapSourceDesc *desc, gpointer data);
ChamplainMapSourceDesc *desc, gpointer data);
static ChamplainMapSource * champlain_map_source_new_memphis (
ChamplainMapSourceDesc *desc, gpointer user_data);
......@@ -426,7 +426,8 @@ ChamplainMapSource * champlain_map_source_factory_create_cached_source (Champlai
*/
gboolean
champlain_map_source_factory_register (ChamplainMapSourceFactory *factory,
ChamplainMapSourceDesc *desc, ChamplainMapSourceConstructor constructor,
ChamplainMapSourceDesc *desc,
ChamplainMapSourceConstructor constructor,
gpointer data)
{
......@@ -439,7 +440,7 @@ champlain_map_source_factory_register (ChamplainMapSourceFactory *factory,
static ChamplainMapSource *
champlain_map_source_new_generic (
ChamplainMapSourceDesc *desc, gpointer user_data)
ChamplainMapSourceDesc *desc, gpointer user_data)
{
return CHAMPLAIN_MAP_SOURCE (champlain_network_tile_source_new_full (
desc->id,
......
......@@ -84,14 +84,14 @@ struct _ChamplainMapSourcePrivate
static void reload_tiles_cb (ChamplainMapSource *orig, ChamplainMapSource *self);
static void on_set_next_source (ChamplainMapSource *map_source,
ChamplainMapSource *old_next_source,
ChamplainMapSource *new_next_source);
ChamplainMapSource *old_next_source,
ChamplainMapSource *new_next_source);
static void
champlain_map_source_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
ChamplainMapSourcePrivate *priv = GET_PRIVATE(object);
......@@ -107,9 +107,9 @@ champlain_map_source_get_property (GObject *object,
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);
......@@ -244,8 +244,8 @@ void reload_tiles_cb (ChamplainMapSource *orig, ChamplainMapSource *self)
static void
on_set_next_source (ChamplainMapSource *map_source,
ChamplainMapSource *old_next_source,
ChamplainMapSource *new_next_source)
ChamplainMapSource *old_next_source,
ChamplainMapSource *new_next_source)
{
ChamplainMapSourcePrivate *priv = GET_PRIVATE(map_source);
if (old_next_source)
......@@ -272,7 +272,7 @@ on_set_next_source (ChamplainMapSource *map_source,
*/
void
champlain_map_source_set_next_source (ChamplainMapSource *map_source,
ChamplainMapSource *next_source)
ChamplainMapSource *next_source)
{
g_return_if_fail (CHAMPLAIN_IS_MAP_SOURCE (map_source));
......@@ -454,8 +454,8 @@ champlain_map_source_get_projection (ChamplainMapSource *map_source)
*/
guint
champlain_map_source_get_x (ChamplainMapSource *map_source,
guint zoom_level,
gdouble longitude)
guint zoom_level,
gdouble longitude)
{
g_return_val_if_fail (CHAMPLAIN_IS_MAP_SOURCE (map_source), 0);
......@@ -478,8 +478,8 @@ champlain_map_source_get_x (ChamplainMapSource *map_source,
*/
guint
champlain_map_source_get_y (ChamplainMapSource *map_source,
guint zoom_level,
gdouble latitude)
guint zoom_level,
gdouble latitude)
{
g_return_val_if_fail (CHAMPLAIN_IS_MAP_SOURCE (map_source), 0);
......@@ -504,8 +504,8 @@ champlain_map_source_get_y (ChamplainMapSource *map_source,
*/
gdouble
champlain_map_source_get_longitude (ChamplainMapSource *map_source,
guint zoom_level,
guint x)
guint zoom_level,
guint x)
{
g_return_val_if_fail (CHAMPLAIN_IS_MAP_SOURCE (map_source), 0);
//ChamplainMapSourcePrivate *priv = map_source->priv;
......@@ -529,8 +529,8 @@ champlain_map_source_get_longitude (ChamplainMapSource *map_source,
*/
gdouble
champlain_map_source_get_latitude (ChamplainMapSource *map_source,
guint zoom_level,
guint y)
guint zoom_level,
guint y)
{
g_return_val_if_fail (CHAMPLAIN_IS_MAP_SOURCE (map_source), 0);
//ChamplainMapSourcePrivate *priv = map_source->priv;
......@@ -553,7 +553,7 @@ champlain_map_source_get_latitude (ChamplainMapSource *map_source,
*/
guint
champlain_map_source_get_row_count (ChamplainMapSource *map_source,
guint zoom_level)
guint zoom_level)
{
g_return_val_if_fail (CHAMPLAIN_IS_MAP_SOURCE (map_source), 0);
......@@ -576,7 +576,7 @@ champlain_map_source_get_row_count (ChamplainMapSource *map_source,
*/
guint
champlain_map_source_get_column_count (ChamplainMapSource *map_source,
guint zoom_level)
guint zoom_level)
{
g_return_val_if_fail (CHAMPLAIN_IS_MAP_SOURCE (map_source), 0);
......@@ -632,7 +632,7 @@ champlain_map_source_get_meters_per_pixel (ChamplainMapSource *map_source,
*/
void
champlain_map_source_fill_tile (ChamplainMapSource *map_source,
ChamplainTile *tile)
ChamplainTile *tile)
{
g_return_if_fail (CHAMPLAIN_IS_MAP_SOURCE (map_source));
......
......@@ -84,11 +84,11 @@ guint champlain_map_source_get_tile_size (ChamplainMapSource *map_source);
ChamplainMapProjection champlain_map_source_get_projection (ChamplainMapSource *map_source);
guint champlain_map_source_get_x (ChamplainMapSource *map_source,
guint zoom_level,
gdouble longitude);
guint zoom_level,
gdouble longitude);
guint champlain_map_source_get_y (ChamplainMapSource *map_source,
guint zoom_level,
gdouble latitude);
guint zoom_level,
gdouble latitude);
gdouble champlain_map_source_get_longitude (ChamplainMapSource *map_source,
guint zoom_level,
guint x);
......@@ -105,7 +105,7 @@ gdouble champlain_map_source_get_meters_per_pixel (ChamplainMapSource *map_sourc
gdouble longitude);
void champlain_map_source_fill_tile (ChamplainMapSource *map_source,
ChamplainTile *tile);
ChamplainTile *tile);
G_END_DECLS
......
......@@ -178,9 +178,9 @@ champlain_marker_get_highlight_text_color ()
static void
champlain_marker_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
ChamplainMarkerPrivate *priv = GET_PRIVATE (object);
......@@ -229,9 +229,9 @@ champlain_marker_get_property (GObject *object,
static void
champlain_marker_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
ChamplainMarker *marker = CHAMPLAIN_MARKER (object);
//ChamplainMarkerPrivate *priv = marker->priv;
......
......@@ -101,14 +101,16 @@ struct _WorkerThreadData
/* lock to protect the renderer state while rendering */
GStaticRWLock MemphisLock = G_STATIC_RW_LOCK_INIT;
static void fill_tile (ChamplainMapSource *map_source, ChamplainTile *tile);
static void fill_tile (ChamplainMapSource *map_source,
ChamplainTile *tile);
static void reload_tiles (ChamplainMemphisTileSource *tile_source);
static void memphis_worker_thread (gpointer data, gpointer user_data);
static void map_data_changed_cb (ChamplainMapDataSource *map_data_source,
GParamSpec *gobject,
ChamplainMemphisTileSource *tile_source);
void argb_to_rgba (guchar *data, guint size);
GParamSpec *gobject,
ChamplainMemphisTileSource *tile_source);
void argb_to_rgba (guchar *data,
guint size);
static void
champlain_memphis_tile_source_get_property (GObject *object,
......@@ -219,12 +221,12 @@ champlain_memphis_tile_source_class_init (ChamplainMemphisTileSourceClass *klass
* Since: 0.6
*/
g_object_class_install_property (object_class,
PROP_MAP_DATA_SOURCE,
g_param_spec_object ("map-data-source",
"Map data source",
"The data source of the renderer",
CHAMPLAIN_TYPE_MAP_DATA_SOURCE,
G_PARAM_CONSTRUCT | G_PARAM_READWRITE));
PROP_MAP_DATA_SOURCE,
g_param_spec_object ("map-data-source",
"Map data source",
"The data source of the renderer",
CHAMPLAIN_TYPE_MAP_DATA_SOURCE,
G_PARAM_CONSTRUCT | G_PARAM_READWRITE));
}
static void
......@@ -239,12 +241,12 @@ champlain_memphis_tile_source_init (ChamplainMemphisTileSource *tile_source)
priv->rules = memphis_rule_set_new ();
memphis_rule_set_load_from_data (priv->rules, default_rules,
strlen (default_rules));
strlen (default_rules));
priv->renderer = memphis_renderer_new_full (priv->rules, memphis_map_new ());
priv->thpool = g_thread_pool_new (memphis_worker_thread, tile_source,
MAX_THREADS, FALSE, NULL);
MAX_THREADS, FALSE, NULL);
}
/**
......@@ -276,22 +278,22 @@ ChamplainMemphisTileSource* champlain_memphis_tile_source_new_full (const gchar
g_return_val_if_fail (CHAMPLAIN_IS_MAP_DATA_SOURCE (map_data_source), NULL);
return g_object_new (CHAMPLAIN_TYPE_MEMPHIS_TILE_SOURCE,
"id", id,
"name", name,
"license", license,
"license-uri", license_uri,
"min-zoom-level", min_zoom_level,
"max-zoom-level", max_zoom_level,
"tile-size", tile_size,
"projection", projection,
"map-data-source", map_data_source,
NULL);
"id", id,
"name", name,
"license", license,
"license-uri", license_uri,
"min-zoom-level", min_zoom_level,
"max-zoom-level", max_zoom_level,
"tile-size", tile_size,
"projection", projection,
"map-data-source", map_data_source,
NULL);
}
static void
map_data_changed_cb (ChamplainMapDataSource *map_data_source,
GParamSpec *gobject,
ChamplainMemphisTileSource *tile_source)
GParamSpec *gobject,
ChamplainMemphisTileSource *tile_source)
{
g_assert (CHAMPLAIN_IS_MAP_DATA_SOURCE (map_data_source) &&
CHAMPLAIN_IS_MEMPHIS_TILE_SOURCE (tile_source));
......@@ -326,7 +328,8 @@ map_data_changed_cb (ChamplainMapDataSource *map_data_source,
Transform ARGB (Cairo) to RGBA (GdkPixbuf). RGBA is actualy reversed in
memory, so the transformation is ARGB -> ABGR (i.e. swapping B and R)
*/
void argb_to_rgba (guchar *data, guint size)
void argb_to_rgba (guchar *data,
guint size)
{
guint32 *ptr;
guint32 *endptr = (guint32 *)data + size / 4;
......@@ -386,22 +389,14 @@ tile_loaded_cb (gpointer worker_data)
/* modify directly the buffer of cairo surface - we don't use it any more
and we close the surface anyway */
argb_to_rgba (cairo_image_surface_get_data (cst),
cairo_image_surface_get_stride (cst) * cairo_image_surface_get_height (cst));
cairo_image_surface_get_stride (cst) * cairo_image_surface_get_height (cst));
pixbuf = gdk_pixbuf_new_from_data (cairo_image_surface_get_data (cst),
GDK_COLORSPACE_RGB,
TRUE,
8,
size,
size,
cairo_image_surface_get_stride (cst),
NULL,
NULL);
GDK_COLORSPACE_RGB, TRUE, 8, size, size,
cairo_image_surface_get_stride (cst), NULL, NULL);
if (gdk_pixbuf_save_to_buffer (pixbuf, &buffer, &buffer_size, "png", &error, NULL))
{
champlain_tile_cache_store_tile (tile_cache, tile, buffer, buffer_size);
}
champlain_tile_cache_store_tile (tile_cache, tile, buffer, buffer_size);
g_free (buffer);
g_object_unref (pixbuf);
......@@ -419,7 +414,8 @@ cleanup:
}
static void
memphis_worker_thread (gpointer worker_data, gpointer user_data)
memphis_worker_thread (gpointer worker_data,
gpointer user_data)
{
WorkerThreadData *data = (WorkerThreadData *)worker_data;
ChamplainMapSource *map_source = data->map_source;
......@@ -453,7 +449,8 @@ memphis_worker_thread (gpointer worker_data, gpointer user_data)
}
static void
fill_tile (ChamplainMapSource *map_source, ChamplainTile *tile)
fill_tile (ChamplainMapSource *map_source,
ChamplainTile *tile)
{
g_return_if_fail (CHAMPLAIN_IS_MEMPHIS_TILE_SOURCE (map_source));
......@@ -564,8 +561,8 @@ champlain_memphis_tile_source_load_rules (
*/
void
champlain_memphis_tile_source_set_map_data_source (
ChamplainMemphisTileSource *tile_source,
ChamplainMapDataSource *map_data_source)
ChamplainMemphisTileSource *tile_source,
ChamplainMapDataSource *map_data_source)
{
g_return_if_fail (CHAMPLAIN_IS_MEMPHIS_TILE_SOURCE (tile_source) &&
CHAMPLAIN_IS_MAP_DATA_SOURCE (map_data_source));
......@@ -579,7 +576,7 @@ champlain_memphis_tile_source_set_map_data_source (
priv->map_data_source = g_object_ref_sink (map_data_source);
g_signal_connect (priv->map_data_source, "notify::state",
G_CALLBACK (map_data_changed_cb), tile_source);
G_CALLBACK (map_data_changed_cb), tile_source);
map = champlain_map_data_source_get_map_data (priv->map_data_source);
if (map == NULL)
......@@ -605,7 +602,7 @@ champlain_memphis_tile_source_set_map_data_source (
*/
ChamplainMapDataSource *
champlain_memphis_tile_source_get_map_data_source (
ChamplainMemphisTileSource *tile_source)
ChamplainMemphisTileSource *tile_source)
{
g_return_val_if_fail (CHAMPLAIN_IS_MEMPHIS_TILE_SOURCE (tile_source), NULL);
......@@ -622,8 +619,9 @@ champlain_memphis_tile_source_get_map_data_source (
*
* Since: 0.6
*/
ClutterColor * champlain_memphis_tile_source_get_background_color (
ChamplainMemphisTileSource *tile_source)
ClutterColor *
champlain_memphis_tile_source_get_background_color (
ChamplainMemphisTileSource *tile_source)
{
g_return_val_if_fail (CHAMPLAIN_IS_MEMPHIS_TILE_SOURCE (tile_source), NULL);
......@@ -653,8 +651,8 @@ ClutterColor * champlain_memphis_tile_source_get_background_color (
*/
void
champlain_memphis_tile_source_set_background_color (
ChamplainMemphisTileSource *tile_source,
const ClutterColor *color)
ChamplainMemphisTileSource *tile_source,
const ClutterColor *color)
{
g_return_if_fail (CHAMPLAIN_IS_MEMPHIS_TILE_SOURCE (tile_source));
......@@ -680,7 +678,7 @@ champlain_memphis_tile_source_set_background_color (
*/
void
champlain_memphis_tile_source_set_rule (ChamplainMemphisTileSource *tile_source,
MemphisRule *rule)
MemphisRule *rule)
{
g_return_if_fail (CHAMPLAIN_IS_MEMPHIS_TILE_SOURCE (tile_source) &&
MEMPHIS_RULE (rule));
......@@ -705,7 +703,7 @@ champlain_memphis_tile_source_set_rule (ChamplainMemphisTileSource *tile_source,
*/
MemphisRule *
champlain_memphis_tile_source_get_rule (ChamplainMemphisTileSource *tile_source,
const gchar *id)
const gchar *id)
{
g_return_val_if_fail (CHAMPLAIN_IS_MEMPHIS_TILE_SOURCE (tile_source) &&
id != NULL, NULL);
......@@ -756,8 +754,8 @@ champlain_memphis_tile_source_get_rule_ids (ChamplainMemphisTileSource *tile_sou
* Since: 0.6
*/
void champlain_memphis_tile_source_remove_rule (
ChamplainMemphisTileSource *tile_source,
const gchar *id)
ChamplainMemphisTileSource *tile_source,
const gchar *id)
{
g_return_if_fail (CHAMPLAIN_IS_MEMPHIS_TILE_SOURCE (tile_source));
......
......@@ -99,9 +99,9 @@ static void fill_tile (ChamplainMapSource *map_source,
static gchar *
get_tile_uri (ChamplainNetworkTileSource *source,
gint x,
gint y,
gint z);
gint x,
gint y,
gint z);
static void
champlain_network_tile_source_get_property (GObject *object,
......@@ -208,10 +208,10 @@ champlain_network_tile_source_class_init (ChamplainNetworkTileSourceClass *klass
* Since: 0.4
*/
pspec = g_param_spec_string ("uri-format",
"URI Format",
"The URI format",
"",
(G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
"URI Format",
"The URI format",
"",
(G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
g_object_class_install_property (object_class, PROP_URI_FORMAT, pspec);
/**
......@@ -222,10 +222,10 @@ champlain_network_tile_source_class_init (ChamplainNetworkTileSourceClass *klass
* Since: 0.4
*/
pspec = g_param_spec_boolean ("offline",
"Offline",
"Offline",
FALSE,
G_PARAM_READWRITE);
"Offline",
"Offline",
FALSE,
G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_OFFLINE, pspec);
/**
......@@ -236,10 +236,10 @@ champlain_network_tile_source_class_init (ChamplainNetworkTileSourceClass *klass
* Since: 0.4
*/
pspec = g_param_spec_string ("proxy-uri",
"Proxy URI",
"The proxy URI to use to access network",
"",
G_PARAM_READWRITE);
"Proxy URI",
"The proxy URI to use to access network",
"",
G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_PROXY_URI, pspec);
}
......@@ -259,8 +259,8 @@ champlain_network_tile_source_init (ChamplainNetworkTileSource *tile_source)
#endif
NULL);
g_object_set (G_OBJECT (priv->soup_session),
"user-agent", "libchamplain/" CHAMPLAIN_VERSION_S,
"max-conns-per-host", 2, NULL); // This is as required by OSM
"user-agent", "libchamplain/" CHAMPLAIN_VERSION_S,
"max-conns-per-host", 2, NULL); // This is as required by OSM
}
......@@ -284,21 +284,21 @@ champlain_network_tile_source_init (ChamplainNetworkTileSource *tile_source)
*/
ChamplainNetworkTileSource*
champlain_network_tile_source_new_full (const gchar *id,
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 *name,
const gchar *license,
const gchar *license_uri,
guint min_zoom,
guint max_zoom,
guint tile_size,
ChamplainMapProjection projection,
const gchar *uri_format)
{
ChamplainNetworkTileSource * source;
source = g_object_new (CHAMPLAIN_TYPE_NETWORK_TILE_SOURCE, "id", id,
"name", name, "license", license, "license-uri", license_uri,
"min-zoom-level", min_zoom, "max-zoom-level", max_zoom,
"tile-size", tile_size, "projection", projection,
"uri-format", uri_format, NULL);
"name", name, "license", license, "license-uri", license_uri,
"min-zoom-level", min_zoom, "max-zoom-level", max_zoom,
"tile-size", tile_size, "projection", projection,
"uri-format", uri_format, NULL);
return source;
}
......@@ -449,9 +449,9 @@ champlain_network_tile_source_set_offline (ChamplainNetworkTileSource *tile_sour
#define SIZE 8
static gchar *
get_tile_uri (ChamplainNetworkTileSource *source,
gint x,
gint y,
gint z)
gint x,
gint y,
gint z)
{
ChamplainNetworkTileSourcePrivate *priv = GET_PRIVATE(source);
......@@ -495,7 +495,8 @@ get_tile_uri (ChamplainNetworkTileSource *source,
}
static void
tile_destroyed_cb (ChamplainTile *tile, TileDestroyedCbData *data)
tile_destroyed_cb (ChamplainTile *tile,
TileDestroyedCbData *data)
{
if (data->map_source && data->msg)
{
......@@ -507,7 +508,8 @@ tile_destroyed_cb (ChamplainTile *tile, TileDestroyedCbData *data)
}
static void
destroy_cb_data (TileDestroyedCbData *data, GClosure *closure)
destroy_cb_data (TileDestroyedCbData *data,
GClosure *closure)
{
if (data->map_source)
g_object_remove_weak_pointer(G_OBJECT (data->map_source), (gpointer*)&data->map_source);
......@@ -517,8 +519,8 @@ destroy_cb_data (TileDestroyedCbData *data, GClosure *closure)
static void
tile_loaded_cb (SoupSession *session,
SoupMessage *msg,
gpointer user_data)
SoupMessage *msg,
gpointer user_data)
{
TileLoadedCallbackData *callback_data = (TileLoadedCallbackData *)user_data;
ChamplainMapSource *map_source = callback_data->map_source;
......@@ -605,14 +607,14 @@ tile_loaded_cb (SoupSession *session,
GdkPixbuf* pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
actor = clutter_texture_new ();
if (!clutter_texture_set_from_rgb_data (CLUTTER_TEXTURE (actor),
gdk_pixbuf_get_pixels (pixbuf),
gdk_pixbuf_get_has_alpha (pixbuf),
gdk_pixbuf_get_width (pixbuf),
gdk_pixbuf_get_height (pixbuf),
gdk_pixbuf_get_rowstride (pixbuf),
gdk_pixbuf_get_bits_per_sample (pixbuf) *
gdk_pixbuf_get_n_channels (pixbuf) / 8,
0, &error))
gdk_pixbuf_get_pixels (pixbuf),
gdk_pixbuf_get_has_alpha (pixbuf),
gdk_pixbuf_get_width (pixbuf),
gdk_pixbuf_get_height (pixbuf),
gdk_pixbuf_get_rowstride (pixbuf),
gdk_pixbuf_get_bits_per_sample (pixbuf) *
gdk_pixbuf_get_n_channels (pixbuf) / 8,
0, &error))
{
if (error)
{
......@@ -634,9 +636,7 @@ load_next_cleanup:
load_next:
if (next_source)
{
champlain_map_source_fill_tile (next_source, tile);
}
champlain_map_source_fill_tile (next_source, tile);
g_object_unref (map_source);
return;
......@@ -647,7 +647,7 @@ finish:
static void
fill_tile (ChamplainMapSource *map_source