30 #define ITEM2(x,y) type_##y=x,
31 #define ITEM(x) type_##x,
37 #define route_item_first type_street_0
38 #define route_item_last type_street_parking_lane
50 #define item_type_is_area(type) ((type) >= type_area)
51 #define item_is_town(item) ((item).type >= type_town_label && (item).type <= type_district_label_1e7)
52 #define item_is_district(item) ((item).type >= type_district_label && (item).type <= type_district_label_1e7)
53 #define item_is_poly_place(item) ((item).type >= type_poly_place1 && (item).type <= type_poly_place6)
54 #define item_is_point(item) ((item).type < type_line)
55 #define item_is_custom_poi(item) ((item).type >= type_poi_customg && (item).type < type_line)
56 #define item_is_street(item) (((item).type >= type_street_nopass && (item).type <= type_roundabout) \
57 || (item).type == type_street_service \
58 || ((item).type >= type_street_pedestrian && (item).type <= type_track_grass) \
59 || (item).type == type_living_street \
60 || (item).type == type_street_construction \
61 || (item).type == type_path \
62 || (item).type == type_street_parking_lane \
63 || (item).type == type_footway )
65 #define item_is_equal_id(a,b) ((a).id_hi == (b).id_hi && (a).id_lo == (b).id_lo)
66 #define item_is_equal(a,b) (item_is_equal_id(a,b) && (a).map == (b).map)
94 #define ITEM_ID_FMT "(0x%x,0x%x)"
95 #define ITEM_ID_ARGS(x) (x).id_hi,(x).id_lo
attr_type
Definition: attr.h:34
#define max(a, b)
Definition: garmin.c:685
unsigned char zoom
Definition: garmin_img.c:0
char type[3]
Definition: garmin_img.c:2
int item_range_intersects_range(struct item_range *range1, struct item_range *range2)
Definition: item.c:579
int item_coord_get_pro(struct item *it, struct coord *c, int count, enum projection to)
Gets the next coordinates from an item and reprojects them.
Definition: item.c:347
void item_dump_attr(struct item *item, struct map *map, FILE *out)
Definition: item.c:592
int item_range_contains_item(struct item_range *range, enum item_type type)
Definition: item.c:586
void item_attr_rewind(struct item *it)
Resets the "attribute pointer" of an item.
Definition: item.c:387
struct item busy_item
An item indicating that the map driver is busy fetching more items.
Definition: item.c:41
int item_attr_get(struct item *it, enum attr_type attr_type, struct attr *attr)
Gets the next matching attribute from an item.
Definition: item.c:414
void item_dump_filedesc(struct item *item, struct map *map, FILE *out)
Definition: item.c:599
item_type
Definition: item.h:29
int item_coord_get_within_selection(struct item *it, struct coord *c, int count, struct map_selection *sel)
Get coordinates within selection This function returns the coordinates of an item if at least one coo...
Definition: item.c:228
change_mode
Definition: item.h:70
@ change_mode_append
Definition: item.h:73
@ change_mode_prepend
Definition: item.h:74
@ change_mode_delete
Definition: item.h:71
@ change_mode_modify
Definition: item.h:72
int item_coord_set(struct item *it, struct coord *c, int count, enum change_mode mode)
Sets coordinates of an item.
Definition: item.c:208
struct item_hash * item_hash_new(void)
Definition: item.c:545
int item_coords_left(struct item *it)
Gets the number of coordinates left for this item.
Definition: item.c:176
int item_hash_remove(struct item_hash *h, struct item *item)
Definition: item.c:559
int item_attr_set(struct item *it, struct attr *attr, enum change_mode mode)
Sets an attribute of an item.
Definition: item.c:440
int item_coord_get_within_range(struct item *i, struct coord *c, int max, struct coord *start, struct coord *end)
Gets all the coordinates of an item within a specified range.
Definition: item.c:304
void item_coord_rewind(struct item *it)
Resets the "coordinate pointer" of an item.
Definition: item.c:137
struct item * item_new(char *type, int zoom)
Definition: item.c:460
void item_cleanup(void)
Definition: item.c:120
void item_create_hash(void)
Definition: item.c:96
int * item_get_default_flags(enum item_type type)
Definition: item.c:109
struct item_range item_range_all
unsigned int item_id_hash(const void *key)
Definition: item.c:511
void item_hash_destroy(struct item_hash *h)
Definition: item.c:574
void * item_hash_lookup(struct item_hash *h, struct item *item)
Definition: item.c:569
int item_id_equal(const void *a, const void *b)
Definition: item.c:516
int item_type_set(struct item *it, enum item_type type)
Sets the type of a map item.
Definition: item.c:454
void item_hash_insert(struct item_hash *h, struct item *item, void *val)
Definition: item.c:552
void item_id_from_ptr(struct item *item, void *id)
Derive item id_lo and id_hi from pointer, considering pointer could be 32 or 64 bit wide but both ids...
Definition: item.c:529
enum item_type item_from_name(const char *name)
Definition: item.c:470
char * item_to_name(enum item_type item)
Definition: item.c:483
int item_coord_get(struct item *it, struct coord *c, int count)
Gets the next coordinates from an item.
Definition: item.c:163
int item_coord_is_node(struct item *it)
Whether the current coordinates of an item correspond to a node.
Definition: item.c:369
void item_destroy_hash(void)
Definition: item.c:104
projection
Definition: projection.h:23
char name[0]
Definition: street.c:3
GHashTable * h
Definition: item.c:494
int id_hi
Definition: item.h:90
int id_lo
Definition: item.h:91
void(* item_coord_rewind)(void *priv_data)
Definition: item.h:78
int(* item_attr_get)(void *priv_data, enum attr_type attr_type, struct attr *attr)
Definition: item.h:81
int(* item_coords_left)(void *priv_data)
Definition: item.h:86
int(* item_type_set)(void *priv_data, enum item_type type)
Definition: item.h:85
int(* item_attr_set)(void *priv_data, struct attr *attr, enum change_mode mode)
Definition: item.h:83
int(* item_coord_get)(void *priv_data, struct coord *c, int count)
Definition: item.h:79
void(* item_attr_rewind)(void *priv_data)
Definition: item.h:80
int(* item_coord_is_node)(void *priv_data)
Definition: item.h:82
int(* item_coord_set)(void *priv_data, struct coord *c, int count, enum change_mode mode)
Definition: item.h:84
enum item_type min max
Definition: item.h:125
Represents an object on a map.
Definition: item.h:115
int id_hi
Definition: item.h:117
void * priv_data
Definition: item.h:121
enum item_type type
Definition: item.h:116
int id_lo
Definition: item.h:118
struct map * map
Definition: item.h:119
struct item_methods * meth
Definition: item.h:120
Used to select data from a map.
Definition: map.h:58
unsigned char key
Definition: tree.c:0