From eb8f8c1930f8412f2c227057f7527984da30b018 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Thu, 4 Oct 2007 17:52:22 +0300 Subject: [PATCH] Add functions to set waypoint and destination heading. --- src/gtkcompass.c | 27 +++++++++++++++++++++++++++ src/gtkcompass.h | 2 ++ 2 files changed, 29 insertions(+) diff --git a/src/gtkcompass.c b/src/gtkcompass.c index 2e143f5..d041197 100644 --- a/src/gtkcompass.c +++ b/src/gtkcompass.c @@ -437,3 +437,30 @@ g_return_if_fail(GTK_IS_COMPASS(widget)); compass=GTK_COMPASS(widget); gtk_compass_paint(compass); } + +void +gtk_compass_set_way_heading(GtkWidget *widget, gboolean valid, gfloat heading) +{ +GtkCompass *compass; +g_return_if_fail(GTK_IS_COMPASS(widget)); + +compass=GTK_COMPASS(widget); + +compass->way_valid=valid; +compass->way_heading=heading; + +gtk_compass_paint(compass); +} + +void +gtk_compass_set_dest_heading(GtkWidget *widget, gboolean valid, gfloat heading) +{ +g_return_if_fail(GTK_IS_COMPASS(widget)); + +compass->dest_valid=valid; +compass->dest_heading=heading; + +compass=GTK_COMPASS(widget); +gtk_compass_paint(compass); +} + diff --git a/src/gtkcompass.h b/src/gtkcompass.h index e2074aa..8496df6 100644 --- a/src/gtkcompass.h +++ b/src/gtkcompass.h @@ -61,6 +61,8 @@ struct _GtkCompassClass { GType gtk_compass_get_type(void); GtkWidget* gtk_compass_new(GpsData *data); void gtk_compass_refresh(GtkWidget *widget); +void gtk_compass_set_way_heading(GtkWidget *widget, gboolean valid, gfloat heading); +void gtk_compass_set_dest_heading(GtkWidget *widget, gboolean valid, gfloat heading); G_END_DECLS -- 2.39.5