From: horwitz Date: Sun, 28 Dec 2008 21:23:41 +0000 (+0000) Subject: core:fix:Fix some warnings and do some small cleanups X-Git-Tag: navit-0.5.0.5194svn~3294 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7ed222774be142497467ef72b67e7d1ef5570af8;p=profile%2Fivi%2Fnavit.git core:fix:Fix some warnings and do some small cleanups git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@1864 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- diff --git a/navit/navit/attr.c b/navit/navit/attr.c index 9e87374..007ad85 100644 --- a/navit/navit/attr.c +++ b/navit/navit/attr.c @@ -74,7 +74,7 @@ attr_new_from_text(const char *name, const char *value) struct attr *ret; struct coord_geo *g; struct coord c; - char *pos,*type_str,*str,*tok,*saveptr=NULL; + char *pos,*type_str,*str,*tok; int min,max,count; ret=g_new0(struct attr, 1); diff --git a/navit/navit/cache.c b/navit/navit/cache.c index 252fcc7..cd12a82 100644 --- a/navit/navit/cache.c +++ b/navit/navit/cache.c @@ -334,7 +334,7 @@ cache_insert_new(struct cache *cache, void *id, int size) return data; } -void +static void cache_stats(struct cache *cache) { dbg(0,"hits %d misses %d hitratio %d size %d entry_size %d id_size %d T1 target %d\n", cache->hits, cache->misses, cache->hits*100/(cache->hits+cache->misses), cache->size, cache->entry_size, cache->id_size, cache->t1_target); diff --git a/navit/navit/event_glib.c b/navit/navit/event_glib.c index 7a3c6f5..5387d54 100644 --- a/navit/navit/event_glib.c +++ b/navit/navit/event_glib.c @@ -22,6 +22,7 @@ #include "event_glib.h" #include "debug.h" #include "callback.h" +#include "plugin.h" static GMainLoop *loop; @@ -77,7 +78,6 @@ event_glib_add_watch(void *fd, enum event_watch_cond cond, struct callback *cb) static void event_glib_remove_watch(struct event_watch *ev) { - GError *error = NULL; if (! ev) return; g_source_remove(ev->source); diff --git a/navit/navit/file.c b/navit/navit/file.c index 59bdebe..6ca957c 100644 --- a/navit/navit/file.c +++ b/navit/navit/file.c @@ -43,8 +43,9 @@ #define O_BINARY 0 #endif +#if 0 static GHashTable *file_name_hash; -static int file_name_id; +#endif static struct cache *file_cache; struct file_cache_id { diff --git a/navit/navit/graphics.c b/navit/navit/graphics.c index b107156..04a89ea 100644 --- a/navit/navit/graphics.c +++ b/navit/navit/graphics.c @@ -885,9 +885,9 @@ graphics_draw_polyline_as_polygon(struct graphics *gra, struct graphics_gc *gc, { int maxpoints=200; struct point res[maxpoints], pos, poso, neg, nego; - int i, j, dx, dy, l, dxo, dyo; + int i, dx=0, dy=0, l=0, dxo=0, dyo=0; struct offset o,oo; - int fow, fowo, delta; + int fow=0, fowo=0, delta; int wi, ppos = maxpoints/2, npos = maxpoints/2; int state,prec=5; int max_circle_points=20; @@ -902,9 +902,6 @@ graphics_draw_polyline_as_polygon(struct graphics *gra, struct graphics_gc *gc, } if (! l) l=1; -#if 0 - dbg(0,"p[%d of %d]=%d,%d wi=%d l=%d\n", i,count-1,pnt[i].x,pnt[i].y, wi, l); -#endif calc_offsets(wi, l, dx, dy, &o); pos.x = pnt[i].x + o.ny; pos.y = pnt[i].y + o.px; @@ -918,9 +915,6 @@ graphics_draw_polyline_as_polygon(struct graphics *gra, struct graphics_gc *gc, state=3; else state=1; -#if 0 - dbg(0,"state=%d npos=%d ppos=%d\n", state, npos, ppos); -#endif switch (state) { case 1: if (fowo != fow) { @@ -954,16 +948,9 @@ graphics_draw_polyline_as_polygon(struct graphics *gra, struct graphics_gc *gc, draw_circle(&pnt[i], wi, prec, fow-512, -512, res, &npos, -1); res[npos] = pos; res[ppos++] = pos; -#if 0 - dbg(0,"npos=%d ppos=%d\n", npos, ppos); -#endif dbg_assert(npos > 0); dbg_assert(ppos < maxpoints); gra->meth.draw_polygon(gra->priv, gc->priv, res+npos, ppos-npos); -#if 0 - for (j = npos ; j < ppos ; j++) - dbg(0,"res[%d]=%d,%d\n", j-npos, res[j].x, res[j].y); -#endif if (state == 2) break; npos=maxpoints/2; @@ -1073,8 +1060,7 @@ graphics_draw_polyline_clipped(struct graphics *gra, struct graphics_gc *gc, str struct point p[count+1]; int w[count*step+1]; struct wpoint p1,p2; - int i,code,out=0,codeo=0; - int dx,dy; + int i,code,out=0; int wmax; struct point_rect r=gra->r; @@ -1091,11 +1077,6 @@ graphics_draw_polyline_clipped(struct graphics *gra, struct graphics_gc *gc, str r.lu.y-=wmax; r.rl.x+=wmax; r.rl.y+=wmax; -#if 0 - for (i = 0 ; i < count ; i++) { - dbg(0,"in[%d]=%d,%d (%d)\n", i, pa[i].x, pa[i].y, width[i*step]); - } -#endif for (i = 0 ; i < count ; i++) { if (i) { p1.x=pa[i-1].x; @@ -1106,34 +1087,19 @@ graphics_draw_polyline_clipped(struct graphics *gra, struct graphics_gc *gc, str p2.w=width[i*step]; /* 0 = invisible, 1 = completely visible, 3 = start point clipped, 5 = end point clipped, 7 both points clipped */ code=clip_line(&p1, &p2, &r); -#if 0 - dbg(0,"code=%d\n", code); -#endif if (((code == 1 || code == 5) && i == 1) || (code & 2)) { -#if 0 - dbg(0,"start = %d,%d\n", p1.x, p1.y); -#endif p[out].x=p1.x; p[out].y=p1.y; w[out*step]=p1.w; out++; } if (code) { -#if 0 - dbg(0,"end = %d,%d\n", p2.x, p2.y); -#endif p[out].x=p2.x; p[out].y=p2.y; w[out*step]=p2.w; out++; } if (i == count-1 || (code & 4)) { -#if 0 - int j; - for (j = 0 ; j < out ; j++) { - dbg(0,"out[%d]=%d,%d (%d)\n", j, p[j].x, p[j].y, w[j*step]); - } -#endif if (out > 1) { if (poly) { graphics_draw_polyline_as_polygon(gra, gc, p, out, w, step); @@ -1144,9 +1110,6 @@ graphics_draw_polyline_clipped(struct graphics *gra, struct graphics_gc *gc, str } } } -#if 0 - dbg(0,"done\n"); -#endif } static int @@ -1161,6 +1124,8 @@ is_inside(struct point *p, struct point_rect *r, int edge) return p->y >= r->lu.y; case 3: return p->y <= r->rl.y; + default: + return 0; } } diff --git a/navit/navit/graphics.h b/navit/navit/graphics.h index 69e0231..1e78c36 100644 --- a/navit/navit/graphics.h +++ b/navit/navit/graphics.h @@ -122,6 +122,7 @@ struct point; struct transformation; struct callback; struct itemgra; +void graphics_set_rect(struct graphics *gra, struct point_rect *pr); void graphics_resize(struct graphics *gra, int w, int h); struct graphics *graphics_new(struct attr *parent, struct attr **attrs); int graphics_get_attr(struct graphics *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter); diff --git a/navit/navit/gui/gtk/gui_gtk_window.c b/navit/navit/gui/gtk/gui_gtk_window.c index 1178cb3..159545c 100644 --- a/navit/navit/gui/gtk/gui_gtk_window.c +++ b/navit/navit/gui/gtk/gui_gtk_window.c @@ -114,32 +114,32 @@ keypress(GtkWidget *widget, GdkEventKey *event, struct gui_priv *this) break; case 'a': t=navit_get_trans(this->nav); - transform_set_yaw(t, (transform_get_yaw(t,0)+15)%360); + transform_set_yaw(t, (transform_get_yaw(t)+15)%360); navit_draw(this->nav); break; case 'd': t=navit_get_trans(this->nav); - transform_set_yaw(t, (transform_get_yaw(t,0)-15)%360); + transform_set_yaw(t, (transform_get_yaw(t)-15)%360); navit_draw(this->nav); break; case 'w': t=navit_get_trans(this->nav); - transform_set_pitch(t, (transform_get_pitch(t,0)+5)%360); + transform_set_pitch(t, (transform_get_pitch(t)+5)%360); navit_draw(this->nav); break; case 'x': t=navit_get_trans(this->nav); - transform_set_pitch(t, (transform_get_pitch(t,0)-5)%360); + transform_set_pitch(t, (transform_get_pitch(t)-5)%360); navit_draw(this->nav); break; case 'r': t=navit_get_trans(this->nav); - transform_set_distance(t, (transform_get_distance(t,0)-5)); + transform_set_distance(t, (transform_get_distance(t)-5)); navit_draw(this->nav); break; case 'f': t=navit_get_trans(this->nav); - transform_set_distance(t, (transform_get_distance(t,0)+5)); + transform_set_distance(t, (transform_get_distance(t)+5)); navit_draw(this->nav); break; case 't': @@ -150,8 +150,8 @@ keypress(GtkWidget *widget, GdkEventKey *event, struct gui_priv *this) struct coord *c=transform_center(t); p=transform_center(t); pc.pro=projection_mg; - p->y+=50*cos(transform_get_yaw(t, 0)*M_PI/180); - p->x+=50*sin(transform_get_yaw(t, 0)*M_PI/180); + p->y+=50*cos(transform_get_yaw(t)*M_PI/180); + p->x+=50*sin(transform_get_yaw(t)*M_PI/180); pc.x=p->x; pc.y=p->y; navit_set_center(this->nav, &pc); @@ -165,8 +165,8 @@ keypress(GtkWidget *widget, GdkEventKey *event, struct gui_priv *this) struct coord *c=transform_center(t); p=transform_center(t); pc.pro=projection_mg; - p->y-=50*cos(transform_get_yaw(t, 0)*M_PI/180); - p->x-=50*sin(transform_get_yaw(t, 0)*M_PI/180); + p->y-=50*cos(transform_get_yaw(t)*M_PI/180); + p->x-=50*sin(transform_get_yaw(t)*M_PI/180); pc.x=p->x; pc.y=p->y; navit_set_center(this->nav, &pc); diff --git a/navit/navit/item.c b/navit/navit/item.c index 73444a0..5de4bf7 100644 --- a/navit/navit/item.c +++ b/navit/navit/item.c @@ -22,6 +22,8 @@ #include "coord.h" #include "debug.h" #include "item.h" +#include "map.h" +#include "transform.h" struct item_name { enum item_type item; diff --git a/navit/navit/item.h b/navit/navit/item.h index 8722e47..7e25e6b 100644 --- a/navit/navit/item.h +++ b/navit/navit/item.h @@ -92,6 +92,8 @@ void item_hash_insert(struct item_hash *h, struct item *item, void *val); int item_hash_remove(struct item_hash *h, struct item *item); void *item_hash_lookup(struct item_hash *h, struct item *item); void item_hash_destroy(struct item_hash *h); +int item_range_intersects_range(struct item_range *range1, struct item_range *range2); +int item_range_contains_item(struct item_range *range, enum item_type type); /* end of prototypes */ diff --git a/navit/navit/main.c b/navit/navit/main.c index 8857cdf..a547782 100644 --- a/navit/navit/main.c +++ b/navit/navit/main.c @@ -61,7 +61,7 @@ static void sigchld(int sig) #endif } - +#if 0 static gchar *get_home_directory(void) { static gchar *homedir = NULL; @@ -77,6 +77,7 @@ static gchar *get_home_directory(void) } return homedir; } +#endif static GList *navit; diff --git a/navit/navit/map.c b/navit/navit/map.c index e8da215..2967a89 100644 --- a/navit/navit/map.c +++ b/navit/navit/map.c @@ -464,7 +464,6 @@ map_search_destroy(struct map_search *this_) struct map_selection * map_selection_rect_new(struct pcoord *center, int distance, int order) { - int i; struct map_selection *ret=g_new0(struct map_selection, 1); ret->order=order; ret->range=item_range_all; diff --git a/navit/navit/map.h b/navit/navit/map.h index 663a540..9383130 100644 --- a/navit/navit/map.h +++ b/navit/navit/map.h @@ -248,7 +248,11 @@ struct map_selection *map_selection_dup_pro(struct map_selection *sel, enum proj struct map_selection *map_selection_dup(struct map_selection *sel); void map_selection_destroy(struct map_selection *sel); int map_selection_contains_item_rect(struct map_selection *sel, struct item *item); +int map_selection_contains_item_range(struct map_selection *sel, int follow, struct item_range *range, int count); +int map_selection_contains_item(struct map_selection *sel, int follow, enum item_type type); int map_priv_is(struct map *map, struct map_priv *priv); +void map_dump_filedesc(struct map *map, FILE *out); +void map_dump_file(struct map *map, char *file); void map_dump(struct map *map); /* end of prototypes */ diff --git a/navit/navit/navigation.c b/navit/navit/navigation.c index 97b8d2c..0e7b969 100644 --- a/navit/navit/navigation.c +++ b/navit/navit/navigation.c @@ -748,6 +748,7 @@ is_same_street2(char *old_name1, char *old_name2, char *new_name1, char *new_nam return 0; } +#if 0 /** * @brief Checks if two navigation items are on the same street * @@ -823,6 +824,7 @@ maneuver_straight(struct navigation_itm *new, int diff) } return 1; } +#endif static int maneuver_category(enum item_type type) { @@ -892,7 +894,7 @@ is_way_allowed(struct navigation_way *way) static int maneuver_required2(struct navigation_itm *old, struct navigation_itm *new, int *delta, char **reason) { - int ret=0,d,dw,dlim,straight_limit=20,ext_straight_limit=45; + int ret=0,d,dw,dlim; char *r=NULL; struct navigation_way *w; int cat,ncat,wcat,maxcat,left=-180,right=180,is_unambigous=0,is_same_street; diff --git a/navit/navit/navit.c b/navit/navit/navit.c index 08556de..860e30a 100644 --- a/navit/navit/navit.c +++ b/navit/navit/navit.c @@ -268,12 +268,11 @@ navit_ignore_graphics_events(struct navit *this_, int ignore) this_->ignore_graphics_events=ignore; } -void +static void update_transformation(struct transformation *tr, struct point *old, struct point *new, struct point *rot) { struct coord co,cn; struct coord c,*cp; - int dx,dy; int yaw; double angle; @@ -341,7 +340,7 @@ navit_handle_button(struct navit *this_, int pressed, int button, struct point * this_->motion_timeout=NULL; } if (this_->moved) { - struct point pt,pr; + struct point pr; pr.x=this_->w/2; pr.y=0; #if 0 @@ -1121,176 +1120,6 @@ navit_window_roadbook_new(struct navit *this_) navit_window_roadbook_update(this_); } -static void -get_direction(char *buffer, int angle, int mode) -{ - angle=angle%360; - switch (mode) { - case 0: - sprintf(buffer,"%d",angle); - break; - case 1: - if (angle < 69 || angle > 291) - *buffer++='N'; - if (angle > 111 && angle < 249) - *buffer++='S'; - if (angle > 22 && angle < 158) - *buffer++='E'; - if (angle > 202 && angle < 338) - *buffer++='W'; - *buffer++='\0'; - break; - case 2: - angle=(angle+15)/30; - if (! angle) - angle=12; - sprintf(buffer,"%d H", angle); - break; - } -} - -struct navit_window_items { - struct datawindow *win; - struct callback *click; - char *name; - int distance; - GHashTable *hash; - GList *list; -}; - -static void -navit_window_items_click(struct navit *this_, struct navit_window_items *nwi, char **col) -{ - struct pcoord c; - char *description; - - // FIXME - dbg(0,"enter col=%s,%s,%s,%s,%s\n", col[0], col[1], col[2], col[3], col[4]); - sscanf(col[4], "0x%x,0x%x", &c.x, &c.y); - c.pro = projection_mg; - dbg(0,"0x%x,0x%x\n", c.x, c.y); - description=g_strdup_printf("%s %s", nwi->name, col[3]); - navit_set_destination(this_, &c, description); - g_free(description); -} - -static void -navit_window_items_open(struct navit *this_, struct navit_window_items *nwi) -{ - struct map_selection sel; - struct coord c,*center; - struct mapset_handle *h; - struct map *m; - struct map_rect *mr; - struct item *item; - struct attr attr; - int idist,dist; - struct param_list param[5]; - char distbuf[32]; - char dirbuf[32]; - char coordbuf[64]; - - dbg(0, "distance=%d\n", nwi->distance); - if (nwi->distance == -1) - dist=40000000; - else - dist=nwi->distance*1000; - param[0].name="Distance"; - param[1].name="Direction"; - param[2].name="Type"; - param[3].name="Name"; - param[4].name=NULL; - sel.next=NULL; -#if 0 - sel.order[layer_town]=18; - sel.order[layer_street]=18; - sel.order[layer_poly]=18; -#else - sel.order=0; - sel.range=item_range_all; -#endif - center=transform_center(this_->trans); - sel.u.c_rect.lu.x=center->x-dist; - sel.u.c_rect.lu.y=center->y+dist; - sel.u.c_rect.rl.x=center->x+dist; - sel.u.c_rect.rl.y=center->y-dist; - dbg(2,"0x%x,0x%x - 0x%x,0x%x\n", sel.u.c_rect.lu.x, sel.u.c_rect.lu.y, sel.u.c_rect.rl.x, sel.u.c_rect.rl.y); - nwi->click=callback_new_2(callback_cast(navit_window_items_click), this_, nwi); - nwi->win=gui_datawindow_new(this_->gui, nwi->name, nwi->click, NULL); - h=mapset_open(navit_get_mapset(this_)); - while ((m=mapset_next(h, 1))) { -#if 0 - dbg(2,"m=%p %s\n", m, map_get_filename(m)); -#endif - mr=map_rect_new(m, &sel); - dbg(2,"mr=%p\n", mr); - while ((item=map_rect_get_item(mr))) { - if (item_coord_get(item, &c, 1)) { - if (coord_rect_contains(&sel.u.c_rect, &c) && g_hash_table_lookup(nwi->hash, &item->type)) { - if (! item_attr_get(item, attr_label, &attr)) - attr.u.str=""; - idist=transform_distance(map_projection(item->map), center, &c); - if (idist < dist) { - get_direction(dirbuf, transform_get_angle_delta(center, &c, 0), 1); - param[0].value=distbuf; - param[1].value=dirbuf; - param[2].value=item_to_name(item->type); - sprintf(distbuf,"%d", idist/1000); - param[3].value=attr.u.str; - sprintf(coordbuf, "0x%x,0x%x", c.x, c.y); - param[4].value=coordbuf; - datawindow_add(nwi->win, param, 5); - } - /* printf("gefunden %s %s %d\n",item_to_name(item->type), attr.u.str, idist/1000); */ - } - if (item->type >= type_line) - while (item_coord_get(item, &c, 1)); - } - } - map_rect_destroy(mr); - } - mapset_close(h); -} - -struct navit_window_items * -navit_window_items_new(const char *name, int distance) -{ - struct navit_window_items *nwi=g_new0(struct navit_window_items, 1); - nwi->name=g_strdup(name); - nwi->distance=distance; - nwi->hash=g_hash_table_new(g_int_hash, g_int_equal); - - return nwi; -} - -void -navit_window_items_add_item(struct navit_window_items *nwi, enum item_type type) -{ - nwi->list=g_list_prepend(nwi->list, (void *)type); - g_hash_table_insert(nwi->hash, &nwi->list->data, (void *)1); -} - -void -navit_add_window_items(struct navit *this_, struct navit_window_items *nwi) -{ - this_->windows_items=g_list_append(this_->windows_items, nwi); -} - -static void -navit_add_menu_windows_items(struct navit *this_, struct menu *men) -{ - struct navit_window_items *nwi; - struct callback *cb; - GList *l; - l=this_->windows_items; - while (l) { - nwi=l->data; - cb=callback_new_2(callback_cast(navit_window_items_open), this_, nwi); - menu_add(men, nwi->name, menu_type_menu, cb); - l=g_list_next(l); - } -} - void navit_init(struct navit *this_) { @@ -1484,7 +1313,6 @@ navit_set_center_cursor(struct navit *this_, struct coord *cursor, int dir, int { int width, height; struct point pn; - struct coord cnew; transform_get_size(this_->trans, &width, &height); transform_set_yaw(this_->trans, dir); @@ -1784,7 +1612,7 @@ navit_vehicle_draw(struct navit *this_, struct navit_vehicle *nv, struct point * pro=transform_get_projection(this_->trans); transform(this_->trans, pro, &nv->coord, &cursor_pnt, 1, 0, 0, NULL); } - cursor_draw(cursor.u.cursor, this_->gra, &cursor_pnt, pnt ? 0:1, nv->dir-transform_get_yaw(this_->trans, 0), nv->speed); + cursor_draw(cursor.u.cursor, this_->gra, &cursor_pnt, pnt ? 0:1, nv->dir-transform_get_yaw(this_->trans), nv->speed); #if 0 if (pnt) pnt2=*pnt; diff --git a/navit/navit/transform.c b/navit/navit/transform.c index 9c87889..850886c 100644 --- a/navit/navit/transform.c +++ b/navit/navit/transform.c @@ -262,16 +262,10 @@ transform(struct transformation *t, enum projection pro, struct coord *c, struct struct coord c1; int xcn, ycn; struct coord_geo g; - int z; -#ifdef AVOID_FLOAT - int xc,yc,zc,xco,yco,zco; -#else - int xc,yc,zc,xco,yco,zco,xc2,yc2,zc2; -#endif - int xm,ym,xr,yr,zct; + int xc, yc, zc=0, xco=0, yco=0, zco=0; + int xm,ym,zct; int zlimit=1000; int visible, visibleo=-1; - int limit=t->screen_center.y+250; int i,j = 0; dbg(1,"count=%d\n", count); for (i=0; i < count; i++) { @@ -359,7 +353,6 @@ transform(struct transformation *t, enum projection pro, struct coord *c, struct yc+=t->offy; dbg(1,"xc=%d yc=%d\n", xc, yc); if (j == 0 || !unique || p[j-1].x != xc || p[j-1].y != yc) { - struct coord cn; p[j].x=xc; p[j].y=yc; if (width_return) { @@ -524,7 +517,7 @@ transform_set_pitch(struct transformation *this_,int pitch) transform_setup_matrix(this_); } int -transform_get_pitch(struct transformation *this_,int angle) +transform_get_pitch(struct transformation *this_) { return this_->pitch; } @@ -552,7 +545,7 @@ transform_set_distance(struct transformation *this_,int distance) } int -transform_get_distance(struct transformation *this_,int angle) +transform_get_distance(struct transformation *this_) { return this_->screen_dist; } diff --git a/navit/navit/transform.h b/navit/navit/transform.h index 6599c92..b9528c7 100644 --- a/navit/navit/transform.h +++ b/navit/navit/transform.h @@ -35,6 +35,7 @@ struct pcoord; struct point; struct transformation; struct transformation *transform_new(void); +struct transformation * transform_dup(struct transformation *t); void transform_to_geo(enum projection pro, struct coord *c, struct coord_geo *g); void transform_from_geo(enum projection pro, struct coord_geo *g, struct coord *c); void transform_from_to(struct coord *cfrom, enum projection from, struct coord *cto, enum projection to); @@ -45,6 +46,20 @@ int transform(struct transformation *t, enum projection pro, struct coord *c, st void transform_reverse(struct transformation *t, struct point *p, struct coord *c); enum projection transform_get_projection(struct transformation *this_); void transform_set_projection(struct transformation *this_, enum projection pro); +struct map_selection * transform_get_selection(struct transformation *this_, enum projection pro, int order); +struct coord * transform_center(struct transformation *this_); +struct coord * transform_get_center(struct transformation *this_); +void transform_set_center(struct transformation *this_, struct coord *c); +void transform_set_yaw(struct transformation *t,int yaw); +int transform_get_yaw(struct transformation *this_); +void transform_set_pitch(struct transformation *this_,int pitch); +int transform_get_pitch(struct transformation *this_); +#ifdef ENABLE_ROLL +void transform_set_roll(struct transformation *this_,int roll); +void transform_get_roll(struct transformation *this_); +#endif +void transform_set_distance(struct transformation *this_,int distance); +int transform_get_distance(struct transformation *this_); struct map_selection *transform_get_selection(struct transformation *this_, enum projection pro, int order); struct coord *transform_center(struct transformation *this_); void transform_set_angle(struct transformation *t, int angle); diff --git a/navit/navit/xmlconfig.c b/navit/navit/xmlconfig.c index 4777bcc..a38ffd6 100644 --- a/navit/navit/xmlconfig.c +++ b/navit/navit/xmlconfig.c @@ -181,41 +181,13 @@ xmlconfig_config(struct xmlstate *state) } static int -xmlconfig_window_items(struct xmlstate *state) -{ - int distance=-1; - enum item_type itype; - const char *name=find_attribute(state, "name", 1); - const char *value=find_attribute(state, "distance", 0); - const char *type=find_attribute(state, "type", 1); - char *tok,*str,*type_str,*saveptr=NULL; - if (! name || !type) - return 0; - if (value) - distance=convert_number(value); - state->element_attr.u.data = navit_window_items_new(name, distance); - type_str=g_strdup(type); - str=type_str; - while ((tok=strtok(str, ","))) { - itype=item_from_name(tok); - navit_window_items_add_item(state->element_attr.u.data, itype); - str=NULL; - } - g_free(type_str); - - navit_add_window_items(state->parent->element_attr.u.data, state->element_attr.u.data); - - return 1; -} - -static int xmlconfig_speed(struct xmlstate *state) { const char *type; const char *value; int v; enum item_type itype; - char *saveptr=NULL, *tok, *type_str, *str; + char *tok, *type_str, *str; type=find_attribute(state, "type", 1); if (! type) @@ -245,7 +217,7 @@ xmlconfig_announce(struct xmlstate *state) int level[3]; int i; enum item_type itype; - char *saveptr=NULL, *tok, *type_str, *str; + char *tok, *type_str, *str; type=find_attribute(state, "type", 1); if (! type) @@ -315,7 +287,6 @@ struct element_func { { "itemgra", "cursor", NULL, NEW(itemgra_new), ADD(itemgra_add_attr)}, { "log", "vehicle", NULL, NEW(log_new)}, { "log", "navit", NULL, NEW(log_new)}, - { "window_items", "navit", xmlconfig_window_items}, { "plugins", "config", NULL, NEW(plugins_new), NULL, INIT(plugins_init)}, { "plugin", "plugins", NULL, NEW(plugin_new)}, {},