25 |
#undef DESTROY_WAIT_FOR_GTK |
#undef DESTROY_WAIT_FOR_GTK |
26 |
|
|
27 |
static void map_statusbar(map_t *map, map_item_t *map_item) { |
static void map_statusbar(map_t *map, map_item_t *map_item) { |
28 |
item_id_t id = ID_ILLEGAL; |
tag_t *tag = OBJECT_TAG(map_item->object); |
|
tag_t *tag = NULL; |
|
29 |
char *str = NULL; |
char *str = NULL; |
|
|
|
|
id = OBJECT_ID(map_item->object); |
|
|
|
|
|
switch(map_item->object.type) { |
|
|
case NODE: |
|
|
tag = map_item->object.node->tag; |
|
|
break; |
|
|
|
|
|
case WAY: |
|
|
tag = map_item->object.way->tag; |
|
|
break; |
|
|
|
|
|
case RELATION: |
|
|
tag = map_item->object.relation->tag; |
|
|
break; |
|
|
|
|
|
default: |
|
|
break; |
|
|
} |
|
30 |
|
|
31 |
gboolean collision = FALSE; |
gboolean collision = FALSE; |
32 |
tag_t *tags = tag; |
tag_t *tags = tag; |
354 |
osm_tags_free(appdata->map->last_node_tags); |
osm_tags_free(appdata->map->last_node_tags); |
355 |
|
|
356 |
appdata->map->last_node_tags = |
appdata->map->last_node_tags = |
357 |
osm_tags_copy(appdata->map->selected.object.node->tag); |
osm_tags_copy(OBJECT_TAG(appdata->map->selected.object)); |
358 |
} else if(appdata->map->selected.object.type == WAY) { |
} else if(appdata->map->selected.object.type == WAY) { |
359 |
if(appdata->map->last_way_tags) |
if(appdata->map->last_way_tags) |
360 |
osm_tags_free(appdata->map->last_way_tags); |
osm_tags_free(appdata->map->last_way_tags); |
361 |
|
|
362 |
appdata->map->last_way_tags = |
appdata->map->last_way_tags = |
363 |
osm_tags_copy(appdata->map->selected.object.way->tag); |
osm_tags_copy(OBJECT_TAG(appdata->map->selected.object)); |
364 |
} |
} |
365 |
|
|
366 |
/* remove statusbar message */ |
/* remove statusbar message */ |
526 |
void map_way_draw(map_t *map, way_t *way) { |
void map_way_draw(map_t *map, way_t *way) { |
527 |
|
|
528 |
/* don't draw a way that's not there anymore */ |
/* don't draw a way that's not there anymore */ |
529 |
if(way->flags & (OSM_FLAG_DELETED | OSM_FLAG_HIDDEN)) |
if(OSM_FLAGS(way) & (OSM_FLAG_DELETED | OSM_FLAG_HIDDEN)) |
530 |
return; |
return; |
531 |
|
|
532 |
/* allocate space for nodes */ |
/* allocate space for nodes */ |
572 |
|
|
573 |
void map_node_draw(map_t *map, node_t *node) { |
void map_node_draw(map_t *map, node_t *node) { |
574 |
/* don't draw a node that's not there anymore */ |
/* don't draw a node that's not there anymore */ |
575 |
if(node->flags & OSM_FLAG_DELETED) |
if(OSM_FLAGS(node) & OSM_FLAG_DELETED) |
576 |
return; |
return; |
577 |
|
|
578 |
if(!node->ways) |
if(!node->ways) |
1325 |
while(!map->touchnode && node) { |
while(!map->touchnode && node) { |
1326 |
/* don't highlight the dragged node itself and don't highlight */ |
/* don't highlight the dragged node itself and don't highlight */ |
1327 |
/* deleted ones */ |
/* deleted ones */ |
1328 |
if((node != cur_node) && (!(node->flags & OSM_FLAG_DELETED))) { |
if((node != cur_node) && (!(OSM_FLAGS(node) & OSM_FLAG_DELETED))) { |
1329 |
gint nx = abs(x - node->lpos.x); |
gint nx = abs(x - node->lpos.x); |
1330 |
gint ny = abs(y - node->lpos.y); |
gint ny = abs(y - node->lpos.y); |
1331 |
|
|
2328 |
printf("hiding way #" ITEM_ID_FORMAT "\n", OSM_ID(way)); |
printf("hiding way #" ITEM_ID_FORMAT "\n", OSM_ID(way)); |
2329 |
|
|
2330 |
map_item_deselect(appdata); |
map_item_deselect(appdata); |
2331 |
way->flags |= OSM_FLAG_HIDDEN; |
OSM_FLAGS(way) |= OSM_FLAG_HIDDEN; |
2332 |
map_item_chain_destroy(&way->map_item_chain); |
map_item_chain_destroy(&way->map_item_chain); |
2333 |
|
|
2334 |
gtk_widget_set_sensitive(appdata->menu_item_map_show_all, TRUE); |
gtk_widget_set_sensitive(appdata->menu_item_map_show_all, TRUE); |
2340 |
|
|
2341 |
way_t *way = appdata->osm->way; |
way_t *way = appdata->osm->way; |
2342 |
while(way) { |
while(way) { |
2343 |
if(way->flags & OSM_FLAG_HIDDEN) { |
if(OSM_FLAGS(way) & OSM_FLAG_HIDDEN) { |
2344 |
way->flags &= ~OSM_FLAG_HIDDEN; |
OSM_FLAGS(way) &= ~OSM_FLAG_HIDDEN; |
2345 |
map_way_draw(map, way); |
map_way_draw(map, way); |
2346 |
} |
} |
2347 |
|
|