static const gchar * get_id (ChamplainMapSource *map_source) { ChamplainMapSourceChain *source_chain = CHAMPLAIN_MAP_SOURCE_CHAIN (map_source); g_return_val_if_fail (source_chain, NULL); ChamplainMapSourceChainPrivate *priv = source_chain->priv; g_return_val_if_fail (priv->stack_top, NULL); return champlain_map_source_get_id (priv->stack_top); }
static const gchar * get_id (ChamplainMapSource *map_source) { g_return_val_if_fail (CHAMPLAIN_IS_TILE_CACHE (map_source), NULL); ChamplainMapSource *next_source = champlain_map_source_get_next_source (map_source); g_return_val_if_fail (CHAMPLAIN_IS_MAP_SOURCE (next_source), NULL); return champlain_map_source_get_id (next_source); }
const gchar *bar_pane_gps_get_map_id(PaneGPSData *pgd) { const gchar *map_id; ChamplainMapSource *mapsource; g_object_get(G_OBJECT(pgd->gps_view), "map-source", &mapsource, NULL); map_id = champlain_map_source_get_id(mapsource); g_object_unref(mapsource); return map_id; }
static void bar_pane_gps_write_config(GtkWidget *pane, GString *outstr, gint indent) { PaneGPSData *pgd; gint zoom; ChamplainMapSource *mapsource; const gchar *map_id; gchar *str = NULL; GString *buffer = g_string_new(str); gdouble position; gint int_position; pgd = g_object_get_data(G_OBJECT(pane), "pane_data"); if (!pgd) return; WRITE_NL(); WRITE_STRING("<pane_gps "); write_char_option(outstr, indent, "id", pgd->pane.id); write_char_option(outstr, indent, "title", gtk_label_get_text(GTK_LABEL(pgd->pane.title))); WRITE_BOOL(pgd->pane, expanded); WRITE_INT(*pgd, height); indent++; g_object_get(G_OBJECT(pgd->gps_view), "map-source", &mapsource, NULL); map_id = champlain_map_source_get_id(mapsource); WRITE_NL(); write_char_option(outstr, indent, "map-id", map_id); g_object_get(G_OBJECT(pgd->gps_view), "zoom-level", &zoom, NULL); g_string_printf(buffer, "%d", zoom); WRITE_NL(); write_char_option(outstr, indent, "zoom-level", buffer->str); g_object_get(G_OBJECT(pgd->gps_view), "latitude", &position, NULL); int_position = position * 1000000; g_string_printf(buffer, "%i", int_position); WRITE_NL(); write_char_option(outstr, indent, "latitude", buffer->str); g_object_get(G_OBJECT(pgd->gps_view), "longitude", &position, NULL); int_position = position * 1000000; g_string_printf(buffer, "%i", int_position); WRITE_NL(); write_char_option(outstr, indent, "longitude", buffer->str); indent--; WRITE_NL(); WRITE_STRING("/>"); g_object_unref(mapsource); }
static gchar * generate_queue_key (ChamplainMemoryCache *memory_cache, ChamplainTile *tile) { g_return_val_if_fail (CHAMPLAIN_IS_MEMORY_CACHE (memory_cache), NULL); g_return_val_if_fail (CHAMPLAIN_IS_TILE (tile), NULL); ChamplainMapSource *map_source = CHAMPLAIN_MAP_SOURCE (memory_cache); gchar *key; key = g_strdup_printf ("%d/%d/%d/%s", champlain_tile_get_zoom_level (tile), champlain_tile_get_x (tile), champlain_tile_get_y (tile), champlain_map_source_get_id (map_source)); return key; }