Diff of /trunk/src/map.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 156 by harbaum, Wed Apr 1 12:47:35 2009 UTC revision 161 by harbaum, Sat Apr 11 11:28:56 2009 UTC
# Line 59  static void map_statusbar(map_t *map, ma Line 59  static void map_statusbar(map_t *map, ma
59    if(id == ID_ILLEGAL)    if(id == ID_ILLEGAL)
60      str = g_strdup_printf(_("Unknown item"));      str = g_strdup_printf(_("Unknown item"));
61    else {    else {
62      str = g_strdup_printf("%s #%ld", item_str, id);      str = g_strdup_printf("%s #" ITEM_ID_FORMAT, item_str, id);
63    
64      /* add some tags ... */      /* add some tags ... */
65      /*      /*
# Line 299  void map_way_select(appdata_t *appdata, Line 299  void map_way_select(appdata_t *appdata,
299  void map_relation_select(appdata_t *appdata, relation_t *relation) {  void map_relation_select(appdata_t *appdata, relation_t *relation) {
300    map_t *map = appdata->map;    map_t *map = appdata->map;
301    
302    printf("highlighting relation %ld\n", relation->id);    printf("highlighting relation "ITEM_ID_FORMAT"\n", relation->id);
303    
304    g_assert(!map->highlight);    g_assert(!map->highlight);
305    map_highlight_t **hl = &map->highlight;    map_highlight_t **hl = &map->highlight;
# Line 322  void map_relation_select(appdata_t *appd Line 322  void map_relation_select(appdata_t *appd
322    
323      case NODE: {      case NODE: {
324        node_t *node = member->object.node;        node_t *node = member->object.node;
325        printf("  -> node %ld\n", node->id);        printf("  -> node "ITEM_ID_FORMAT"\n", node->id);
326    
327        item = canvas_circle_new(map->canvas, CANVAS_GROUP_NODES_HL,        item = canvas_circle_new(map->canvas, CANVAS_GROUP_NODES_HL,
328                          node->lpos.x, node->lpos.y,                          node->lpos.x, node->lpos.y,
# Line 882  map_item_t *map_item_at(map_t *map, gint Line 882  map_item_t *map_item_at(map_t *map, gint
882    
883    switch(map_item->object.type) {    switch(map_item->object.type) {
884    case NODE:    case NODE:
885      printf("  item is node #%ld\n", map_item->object.node->id);      printf("  item is node #"ITEM_ID_FORMAT"\n", map_item->object.node->id);
886      break;      break;
887    case WAY:    case WAY:
888      printf("  item is way #%ld\n", map_item->object.way->id);      printf("  item is way #"ITEM_ID_FORMAT"\n", map_item->object.way->id);
889      break;      break;
890    default:    default:
891      printf("  unknown item\n");      printf("  unknown item\n");
# Line 911  map_item_t *map_real_item_at(map_t *map, Line 911  map_item_t *map_real_item_at(map_t *map,
911        parent = map_item->object.node->map_item_chain->map_item;        parent = map_item->object.node->map_item_chain->map_item;
912    
913      if(parent)      if(parent)
914        printf("  using parent item node #%ld\n", parent->object.node->id);        printf("  using parent item node #" ITEM_ID_FORMAT "\n",
915                 parent->object.node->id);
916      break;      break;
917    
918    case WAY:    case WAY:
# Line 919  map_item_t *map_real_item_at(map_t *map, Line 920  map_item_t *map_real_item_at(map_t *map,
920        parent = map_item->object.way->map_item_chain->map_item;        parent = map_item->object.way->map_item_chain->map_item;
921    
922      if(parent)      if(parent)
923        printf("  using parent item way #%ld\n", parent->object.way->id);        printf("  using parent item way #" ITEM_ID_FORMAT "\n",
924                 parent->object.way->id);
925      break;      break;
926    
927    default:    default:
# Line 1286  void map_highlight_refresh(appdata_t *ap Line 1288  void map_highlight_refresh(appdata_t *ap
1288  }  }
1289    
1290  void map_way_delete(appdata_t *appdata, way_t *way) {  void map_way_delete(appdata_t *appdata, way_t *way) {
1291    printf("deleting way #%ld from map and osm\n", way->id);    printf("deleting way #" ITEM_ID_FORMAT " from map and osm\n", way->id);
1292    
1293    /* remove it visually from the screen */    /* remove it visually from the screen */
1294    map_item_chain_destroy(&way->map_item_chain);    map_item_chain_destroy(&way->map_item_chain);
# Line 1971  void map_delete_selected(appdata_t *appd Line 1973  void map_delete_selected(appdata_t *appd
1973    
1974    switch(item.object.type) {    switch(item.object.type) {
1975    case NODE:    case NODE:
1976      printf("request to delete node #%ld\n", item.object.node->id);      printf("request to delete node #" ITEM_ID_FORMAT "\n",
1977               item.object.node->id);
1978    
1979      /* check if this node is part of a way with two nodes only. */      /* check if this node is part of a way with two nodes only. */
1980      /* we cannot delete this as this would also delete the way */      /* we cannot delete this as this would also delete the way */
# Line 2032  void map_delete_selected(appdata_t *appd Line 2035  void map_delete_selected(appdata_t *appd
2035      break;      break;
2036    
2037    case WAY:    case WAY:
2038      printf("request to delete way #%ld\n", item.object.way->id);      printf("request to delete way #" ITEM_ID_FORMAT "\n", item.object.way->id);
2039      map_way_delete(appdata, item.object.way);      map_way_delete(appdata, item.object.way);
2040      break;      break;
2041    
# Line 2343  void map_hide_selected(appdata_t *appdat Line 2346  void map_hide_selected(appdata_t *appdat
2346    }    }
2347    
2348    way_t *way = map->selected.object.way;    way_t *way = map->selected.object.way;
2349    printf("hiding way #%ld\n", way->id);    printf("hiding way #" ITEM_ID_FORMAT "\n", way->id);
2350    
2351    map_item_deselect(appdata);    map_item_deselect(appdata);
2352    way->flags |= OSM_FLAG_HIDDEN;    way->flags |= OSM_FLAG_HIDDEN;

Legend:
Removed from v.156  
changed lines
  Added in v.161