cursor_action(GtkWidget *w, struct gui_priv *gui, void *dummy)
{
navit_toggle_cursor(gui->nav);
-#if 0
- ac->gui->co->flags->track=gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(w));
-#endif
}
static void
tracking_action(GtkWidget *w, struct gui_priv *gui, void *dummy)
{
navit_toggle_tracking(gui->nav);
-#if 0
- ac->gui->co->flags->track=gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(w));
-#endif
}
static void
orient_north_action(GtkWidget *w, struct gui_priv *gui, void *dummy)
{
-#if 0
- ac->gui->co->flags->orient_north=gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(w));
-#endif
+ navit_toggle_orient_north(gui->nav);
}
static void
#include <fcntl.h>
#include <glib.h>
#include <libintl.h>
+#include <math.h>
#include "debug.h"
#include "navit.h"
#include "callback.h"
struct displaylist *displaylist;
int cursor_flag;
int tracking_flag;
+ int orient_north_flag;
GList *vehicles;
GList *windows_items;
struct navit_vehicle *vehicle;
this_->tracking_flag=1-this_->tracking_flag;
}
+void
+navit_toggle_orient_north(struct navit *this_)
+{
+ this_->orient_north_flag=1-this_->orient_north_flag;
+}
+
static void
navit_cursor_update(struct navit *this_, struct cursor *cursor)
{
int dir=cursor_get_dir(cursor);
int speed=cursor_get_speed(cursor);
enum projection pro;
- int border=10;
+ int border=30;
if (!this_->vehicle || this_->vehicle->cursor != cursor)
return;
if (!transform(this_->trans, pro, cursor_c, &pnt) || !transform_within_border(this_->trans, &pnt, border)) {
if (!this_->cursor_flag)
return;
- navit_set_center(this_, cursor_c);
+ if(this_->orient_north_flag)
+ navit_set_center_cursor(this_, cursor_c, 0, 50 - 30.*sin(M_PI*dir/180.), 50 + 30.*cos(M_PI*dir/180.));
+ else
+ navit_set_center_cursor(this_, cursor_c, dir, 50, 80);
transform(this_->trans, pro, cursor_c, &pnt);
}
void navit_set_center_screen(struct navit *this_, struct point *p);
void navit_toggle_cursor(struct navit *this_);
void navit_toggle_tracking(struct navit *this_);
+void navit_toggle_orient_north(struct navit *this_);
void navit_set_position(struct navit *this_, struct coord *c);
struct navit_vehicle *navit_add_vehicle(struct navit *this_, struct vehicle *v, const char *name, struct color *c, int update, int follow);
void navit_add_vehicle_cb(struct navit *this_, struct callback *cb);