GList *mapsets;
GList *layouts;
struct gui *gui;
+ char *gui_type;
struct layout *layout_current;
struct graphics *gra;
+ char *gra_type;
struct action *action;
struct transformation *trans;
struct compass *compass;
}
void
-navit_set_gui(struct navit *this_, struct gui *gui)
+navit_set_gui(struct navit *this_, struct gui *gui, char *type)
{
this_->gui=gui;
+ this_->gui_type=g_strdup(type);
if (gui_has_main_loop(this_->gui)) {
if (! main_loop_gui) {
main_loop_gui=this_->gui;
}
void
-navit_set_graphics(struct navit *this_, struct graphics *gra)
+navit_set_graphics(struct navit *this_, struct graphics *gra, char *type)
{
this_->gra=gra;
+ this_->gra_type=g_strdup(type);
graphics_register_resize_callback(this_->gra, navit_resize, this_);
graphics_register_button_callback(this_->gra, navit_button, this_);
}
GList *l;
struct navit_vehicle *nv;
- if (!this_->gui || !this_->gra || gui_set_graphics(this_->gui, this_->gra)) {
- g_warning("failed to connect graphics to gui\n");
+ if (!this_->gui) {
+ g_warning("failed to instantiate gui '%s'\n",this_->gui_type);
+ navit_destroy(this_);
+ return;
+ }
+ if (!this_->gra) {
+ g_warning("failed to instantiate gui '%s'\n",this_->gra_type);
+ navit_destroy(this_);
+ return;
+ }
+ if (gui_set_graphics(this_->gui, this_->gra)) {
+ g_warning("failed to connect graphics '%s' to gui '%s'\n", this_->gra_type, this_->gui_type);
g_warning(" Please see http://navit.sourceforge.net/wiki/index.php/Failed_to_connect_graphics_to_gui\n");
g_warning(" for explanations and solutions\n");
struct vehicle;
void navit_add_mapset(struct navit *this_, struct mapset *ms);
struct mapset *navit_get_mapset(struct navit *this_);
+struct tracking *navit_get_tracking(struct navit *this_);
void navit_add_layout(struct navit *this_, struct layout *lay);
void navit_draw(struct navit *this_);
void navit_draw_displaylist(struct navit *this_);
void navit_zoom_in(struct navit *this_, int factor);
void navit_zoom_out(struct navit *this_, int factor);
struct navit *navit_new(struct coord *center, enum projection pro, int zoom);
-void navit_set_gui(struct navit *this_, struct gui *gui);
-void navit_set_graphics(struct navit *this_, struct graphics *gra);
-struct graphics * navit_get_graphics(struct navit *this_);
+void navit_set_gui(struct navit *this_, struct gui *gui, char *type);
+void navit_set_graphics(struct navit *this_, struct graphics *gra, char *type);
+struct graphics *navit_get_graphics(struct navit *this_);
void navit_set_destination(struct navit *this_, struct coord *c, char *description);
void navit_add_bookmark(struct navit *this_, struct coord *c, char *description);
void navit_add_menu_layouts(struct navit *this_, struct menu *men);
void navit_remove_init_cb(struct navit *this_, struct callback *cb);
void navit_set_vehicle(struct navit *this_, struct navit_vehicle *nv);
void navit_tracking_add(struct navit *this_, struct tracking *tracking);
-struct tracking * navit_get_tracking(struct navit *this_);
void navit_route_add(struct navit *this_, struct route *route);
void navit_navigation_add(struct navit *this_, struct navigation *navigation);
void navit_set_speech(struct navit *this_, struct speech *speech);
state->element_object = graphics_new(type, attrs);
if (! state->element_object)
return 0;
- navit_set_graphics(state->parent->element_object, state->element_object);
+ navit_set_graphics(state->parent->element_object, state->element_object, type);
return 1;
}
state->element_object = gui_new(state->parent->element_object, type, attrs);
if (! state->element_object)
return 0;
- navit_set_gui(state->parent->element_object, state->element_object);
+ navit_set_gui(state->parent->element_object, state->element_object, type);
return 1;
}