extern void *route_selection;
static void
-do_draw(struct displaylist *displaylist, int cancel)
+do_draw(struct displaylist *displaylist, int cancel, int flags)
{
struct item *item;
int count,max=16384,workload=0;
profile(1,"process_selection\n");
event_remove_idle(displaylist->idle_ev);
displaylist->idle_ev=NULL;
+ callback_destroy(displaylist->idle_cb);
+ displaylist->idle_cb=NULL;
displaylist->busy=0;
graphics_process_selection(displaylist->dc.gra, displaylist);
profile(1,"draw\n");
if (! cancel)
- graphics_displaylist_draw(displaylist->dc.gra, displaylist, displaylist->dc.trans, displaylist->layout, 1);
+ graphics_displaylist_draw(displaylist->dc.gra, displaylist, displaylist->dc.trans, displaylist->layout, flags);
map_rect_destroy(displaylist->mr);
map_selection_destroy(displaylist->sel);
mapset_close(displaylist->msh);
gra->meth.draw_mode(gra->priv, draw_mode_end);
}
-static void graphics_load_mapset(struct graphics *gra, struct displaylist *displaylist, struct mapset *mapset, struct transformation *trans, struct layout *l, int async, struct callback *cb)
+static void graphics_load_mapset(struct graphics *gra, struct displaylist *displaylist, struct mapset *mapset, struct transformation *trans, struct layout *l, int async, struct callback *cb, int flags)
{
int order=transform_get_order(trans);
if (displaylist->busy) {
if (async == 1)
return;
- do_draw(displaylist, 1);
+ do_draw(displaylist, 1, flags);
}
xdisplay_free(displaylist->dl);
dbg(1,"order=%d\n", order);
displaylist->layout=l;
if (async) {
if (! displaylist->idle_cb)
- displaylist->idle_cb=callback_new_2(callback_cast(do_draw), displaylist, 0);
+ displaylist->idle_cb=callback_new_3(callback_cast(do_draw), displaylist, 0, flags);
displaylist->idle_ev=event_add_idle(50, displaylist->idle_cb);
- }
+ } else
+ do_draw(displaylist, 0, flags);
}
/**
* FIXME
* @returns <>
* @author Martin Schaller (04/2008)
*/
-void graphics_draw(struct graphics *gra, struct displaylist *displaylist, struct mapset *mapset, struct transformation *trans, struct layout *l, int async, struct callback *cb)
+void graphics_draw(struct graphics *gra, struct displaylist *displaylist, struct mapset *mapset, struct transformation *trans, struct layout *l, int async, struct callback *cb, int flags)
{
- graphics_load_mapset(gra, displaylist, mapset, trans, l, async, cb);
- if (! async)
- do_draw(displaylist, 0);
+ graphics_load_mapset(gra, displaylist, mapset, trans, l, async, cb, flags);
}
int
{
if (!displaylist->busy)
return 0;
- do_draw(displaylist, 1);
+ do_draw(displaylist, 1, 0);
return 1;
}
char *graphics_icon_path(char *icon);
void graphics_draw_itemgra(struct graphics *gra, struct itemgra *itm, struct transformation *t);
void graphics_displaylist_draw(struct graphics *gra, struct displaylist *displaylist, struct transformation *trans, struct layout *l, int callback);
-void graphics_draw(struct graphics *gra, struct displaylist *displaylist, struct mapset *mapset, struct transformation *trans, struct layout *l, int async, struct callback *cb);
+void graphics_draw(struct graphics *gra, struct displaylist *displaylist, struct mapset *mapset, struct transformation *trans, struct layout *l, int async, struct callback *cb, int flags);
int graphics_draw_cancel(struct graphics *gra, struct displaylist *displaylist);
struct displaylist_handle *graphics_displaylist_open(struct displaylist *displaylist);
struct displayitem *graphics_displaylist_next(struct displaylist_handle *dlh);
int pitch;
int follow_cursor;
int prevTs;
+ int graphics_flags;
};
struct gui *main_loop_gui;
navit_vehicle_draw(this_, nv, NULL);
l=g_list_next(l);
}
- graphics_draw(this_->gra, this_->displaylist, this_->mapsets->data, this_->trans, this_->layout_current, async, NULL);
+ graphics_draw(this_->gra, this_->displaylist, this_->mapsets->data, this_->trans, this_->layout_current, async, NULL, this_->graphics_flags|1);
}
void
navit_draw_displaylist(struct navit *this_)
{
if (this_->ready == 3)
- graphics_displaylist_draw(this_->gra, this_->displaylist, this_->trans, this_->layout_current, 1);
+ graphics_displaylist_draw(this_->gra, this_->displaylist, this_->trans, this_->layout_current, this_->graphics_flags|1);
}
static void
graphics_displaylist_move(this_->displaylist, dx, dy);
#endif
graphics_draw_cancel(this_->gra, this_->displaylist);
- graphics_displaylist_draw(this_->gra, this_->displaylist, tr, this_->layout_current, 0);
+ graphics_displaylist_draw(this_->gra, this_->displaylist, tr, this_->layout_current, this_->graphics_flags);
transform_destroy(tr);
this_->moved=1;
}
attr_updated=(this_->drag_bitmap != !!attr->u.num);
this_->drag_bitmap=!!attr->u.num;
break;
+ case attr_flags_graphics:
+ attr_updated=(this_->graphics_flags != attr->u.num);
+ this_->graphics_flags=attr->u.num;
+ break;
case attr_follow:
if (!this_->vehicle)
return 0;