Diff of /trunk/src/osm.h

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

revision 54 by harbaum, Fri Feb 6 12:06:30 2009 UTC revision 155 by harbaum, Tue Mar 31 10:19:50 2009 UTC
# Line 27  Line 27 
27  #define OSM_FLAG_NEW      (1<<2)  #define OSM_FLAG_NEW      (1<<2)
28  #define OSM_FLAG_HIDDEN   (1<<3)  #define OSM_FLAG_HIDDEN   (1<<3)
29    
30  typedef gulong item_id_t;  /* item_id_t needs to be signed as osm2go uses negative ids for items */
31    /* not yet registered with the main osm database */
32    typedef glong item_id_t;
33    #define G_TYPE_ITEM_ID_T G_TYPE_LONG
34    
35  #define ID_ILLEGAL  ((item_id_t)0)  #define ID_ILLEGAL  ((item_id_t)0)
36    
# Line 164  typedef enum { Line 167  typedef enum {
167    ILLEGAL=0, NODE, WAY, RELATION, NODE_ID, WAY_ID, RELATION_ID    ILLEGAL=0, NODE, WAY, RELATION, NODE_ID, WAY_ID, RELATION_ID
168  } type_t;  } type_t;
169    
170  typedef struct member_s {  typedef struct {
171    type_t type;    type_t type;
   char   *role;  
   
172    union {    union {
173      node_t *node;      node_t *node;
174      way_t *way;      way_t *way;
175      relation_t *relation;      relation_t *relation;
176      item_id_t id;      item_id_t id;
177        void *ptr;
178    };    };
179    } object_t;
180    
181    typedef struct member_s {
182      object_t object;
183      char   *role;
184    struct member_s *next;    struct member_s *next;
185  } member_t;  } member_t;
186    
# Line 248  way_chain_t *osm_node_to_way(osm_t *osm, Line 254  way_chain_t *osm_node_to_way(osm_t *osm,
254  /* ----------- edit functions ----------- */  /* ----------- edit functions ----------- */
255  node_t *osm_node_new(osm_t *osm, gint x, gint y);  node_t *osm_node_new(osm_t *osm, gint x, gint y);
256  void osm_node_attach(osm_t *osm, node_t *node);  void osm_node_attach(osm_t *osm, node_t *node);
257    void osm_node_restore(osm_t *osm, node_t *node);
258  way_chain_t *osm_node_delete(osm_t *osm, struct icon_s **icon, node_t *node,  way_chain_t *osm_node_delete(osm_t *osm, struct icon_s **icon, node_t *node,
259                               gboolean permanently, gboolean affect_ways);                               gboolean permanently, gboolean affect_ways);
260  void osm_way_delete(osm_t *osm, struct icon_s **icon, way_t *way,  void osm_way_delete(osm_t *osm, struct icon_s **icon, way_t *way,
# Line 260  gboolean osm_position_within_bounds(osm_ Line 267  gboolean osm_position_within_bounds(osm_
267  item_id_t osm_new_way_id(osm_t *osm);  item_id_t osm_new_way_id(osm_t *osm);
268  gboolean osm_way_ends_with_node(way_t *way, node_t *node);  gboolean osm_way_ends_with_node(way_t *way, node_t *node);
269    
270  void osm_way_revert(way_t *way);  void osm_way_reverse(way_t *way);
271    guint osm_way_reverse_direction_sensitive_tags(way_t *way);
272    guint osm_way_reverse_direction_sensitive_roles(osm_t *osm, way_t *way);
273    
274  void osm_node_remove_from_relation(osm_t *osm, node_t *node);  void osm_node_remove_from_relation(osm_t *osm, node_t *node);
275  void osm_way_remove_from_relation(osm_t *osm, way_t *way);  void osm_way_remove_from_relation(osm_t *osm, way_t *way);
# Line 271  void osm_way_rotate(way_t *way, gint off Line 280  void osm_way_rotate(way_t *way, gint off
280    
281  tag_t *osm_tags_copy(tag_t *tag, gboolean update_creator);  tag_t *osm_tags_copy(tag_t *tag, gboolean update_creator);
282    
283  char *osm_type_string(type_t type);  relation_t *osm_relation_new(void);
284    void osm_relation_free(relation_t *relation);
285    void osm_relation_attach(osm_t *osm, relation_t *relation);
286    void osm_relation_delete(osm_t *osm, relation_t *relation,
287                             gboolean permanently);
288    gint osm_relation_members_num(relation_t *relation);
289    
290    char *osm_object_type_string(object_t *object);
291    char *osm_object_id_string(object_t *object);
292    char *osm_object_string(object_t *object);
293    tag_t *osm_object_get_tags(object_t *object);
294    void osm_object_set_flags(object_t *map_item, int set, int clr);
295    
296  #endif /* OSM_H */  #endif /* OSM_H */
297    

Legend:
Removed from v.54  
changed lines
  Added in v.155