diff --git a/src/map/draw-layer.c b/src/map/draw-layer.c index 0bd6757..f8fe7d9 100644 --- a/src/map/draw-layer.c +++ b/src/map/draw-layer.c @@ -5,21 +5,11 @@ #include "draw-layer.h" -#include "shumate/shumate-enum-types.h" - #include #include #include #include -enum -{ - PROP_STROKE_WIDTH, - PROP_STROKE_COLOR, - PROP_STROKE, - N_PROPERTIES -}; - static GdkRGBA DEFAULT_STROKE_COLOR = { 0.64, 0.0, 0.0, 1.0 }; typedef struct @@ -34,51 +24,100 @@ typedef struct G_DEFINE_TYPE_WITH_PRIVATE (PicplannerDrawLayer, picplanner_draw_layer, SHUMATE_TYPE_LAYER); static void -on_view_longitude_changed (PicplannerDrawLayer *self, - GParamSpec *pspec, - ShumateViewport *view) +update_marker_visibility (PicplannerDrawLayer *layer, + PicplannerMarker *marker) { - (void) pspec; - (void) view; - g_assert (PICPLANNER_IS_DRAW_LAYER (self)); + ShumateViewport *viewport; + ShumateMapSource *map_source; + gboolean within_viewport; + double x, y; + int marker_width, marker_height; + int width, height; - gtk_widget_queue_draw (GTK_WIDGET (self)); + g_assert (PICPLANNER_IS_DRAW_LAYER (layer)); + + viewport = shumate_layer_get_viewport (SHUMATE_LAYER (layer)); + map_source = shumate_viewport_get_reference_map_source (viewport); + if (!map_source) + return; + + x = picplanner_marker_get_x (marker); + y = picplanner_marker_get_y (marker); + + width = gtk_widget_get_width (GTK_WIDGET (layer)); + height = gtk_widget_get_height (GTK_WIDGET (layer)); + + gtk_widget_measure (GTK_WIDGET (marker), GTK_ORIENTATION_HORIZONTAL, -1, 0, &marker_width, NULL, NULL); + gtk_widget_measure (GTK_WIDGET (marker), GTK_ORIENTATION_VERTICAL, -1, 0, &marker_height, NULL, NULL); + + x = floorf (x - marker_width/2.f); + y = floorf (y - marker_height/2.f); + + within_viewport = x > -marker_width && x <= width && + y > -marker_height && y <= height && + marker_width < width && marker_height < height; + + gtk_widget_set_child_visible (GTK_WIDGET (marker), within_viewport); + + if (within_viewport) + { + GtkAllocation marker_allocation; + + gtk_widget_get_allocation (GTK_WIDGET (marker), &marker_allocation); + + if (marker_allocation.x != (int)x || marker_allocation.y != (int)y) + { + gtk_widget_queue_allocate (GTK_WIDGET (layer)); + } + } } -static void -on_view_latitude_changed (PicplannerDrawLayer *self, - GParamSpec *pspec, - ShumateViewport *view) -{ - (void) pspec; - (void) view; - g_assert (PICPLANNER_IS_DRAW_LAYER (self)); - - gtk_widget_queue_draw (GTK_WIDGET (self)); -} static void -on_view_zoom_level_changed (PicplannerDrawLayer *self, - GParamSpec *pspec, - ShumateViewport *view) +picplanner_draw_layer_size_allocate (GtkWidget *widget, + int width, + int height, + int baseline) { - (void) pspec; - (void) view; - g_assert (PICPLANNER_IS_DRAW_LAYER (self)); + (void) baseline; + PicplannerDrawLayer *self = PICPLANNER_DRAW_LAYER (widget); + GtkAllocation allocation; + GtkWidget *child; - gtk_widget_queue_draw (GTK_WIDGET (self)); -} + for (child = gtk_widget_get_first_child (GTK_WIDGET (self)); + child != NULL; + child = gtk_widget_get_next_sibling (child)) + { + gboolean within_viewport; + double x, y; + int marker_width, marker_height; -static void -on_view_rotation_changed (PicplannerDrawLayer *self, - GParamSpec *pspec, - ShumateViewport *view) -{ - (void) pspec; - (void) view; - g_assert (PICPLANNER_IS_DRAW_LAYER (self)); + if (!gtk_widget_should_layout (child)) + continue; - gtk_widget_queue_draw (GTK_WIDGET (self)); + x = picplanner_marker_get_x (PICPLANNER_MARKER (child)); + y = picplanner_marker_get_y (PICPLANNER_MARKER (child)); + + gtk_widget_measure (child, GTK_ORIENTATION_HORIZONTAL, -1, 0, &marker_width, NULL, NULL); + gtk_widget_measure (child, GTK_ORIENTATION_VERTICAL, -1, 0, &marker_height, NULL, NULL); + + x = floorf (x - marker_width/2.f); + y = floorf (y - marker_height/2.f); + + allocation.x = x; + allocation.y = y; + allocation.width = marker_width; + allocation.height = marker_height; + + within_viewport = x > -allocation.width && x <= width && + y > -allocation.height && y <= height && + allocation.width < width && allocation.height < height; + + gtk_widget_set_child_visible (child, within_viewport); + + if (within_viewport) + gtk_widget_size_allocate (child, &allocation, -1); + } } @@ -88,30 +127,20 @@ picplanner_draw_layer_dispose (GObject *object) PicplannerDrawLayer *self = PICPLANNER_DRAW_LAYER (object); PicplannerDrawLayerPrivate *priv = picplanner_draw_layer_get_instance_private (self); ShumateViewport *viewport = shumate_layer_get_viewport (SHUMATE_LAYER (self)); + GtkWidget *child; g_signal_handlers_disconnect_by_data (viewport, self); if (priv->nodes) picplanner_draw_layer_remove_all (PICPLANNER_DRAW_LAYER (object)); + while ((child = gtk_widget_get_first_child (GTK_WIDGET (object)))) + gtk_widget_unparent (child); + + G_OBJECT_CLASS (picplanner_draw_layer_parent_class)->dispose (object); } -static void -picplanner_draw_layer_constructed (GObject *object) -{ - PicplannerDrawLayer *self = PICPLANNER_DRAW_LAYER (object); - ShumateViewport *viewport; - - G_OBJECT_CLASS (picplanner_draw_layer_parent_class)->constructed (object); - - viewport = shumate_layer_get_viewport (SHUMATE_LAYER (self)); - g_signal_connect_swapped (viewport, "notify::longitude", G_CALLBACK (on_view_longitude_changed), self); - g_signal_connect_swapped (viewport, "notify::latitude", G_CALLBACK (on_view_latitude_changed), self); - g_signal_connect_swapped (viewport, "notify::zoom-level", G_CALLBACK (on_view_zoom_level_changed), self); - g_signal_connect_swapped (viewport, "notify::rotation", G_CALLBACK (on_view_rotation_changed), self); -} - static void picplanner_draw_layer_finalize (GObject *object) @@ -124,6 +153,15 @@ picplanner_draw_layer_finalize (GObject *object) G_OBJECT_CLASS (picplanner_draw_layer_parent_class)->finalize (object); } + +static void +shumate_marker_layer_constructed (GObject *object) +{ + G_OBJECT_CLASS (picplanner_draw_layer_parent_class)->constructed (object); +} + + + static void picplanner_draw_layer_snapshot (GtkWidget *widget, GtkSnapshot *snapshot) @@ -157,18 +195,20 @@ picplanner_draw_layer_snapshot (GtkWidget *widget, if (priv->stroke) { - /* width of the backgroud-colored part of the stroke, - * will be reduced by the outline, when that is set (non-zero) - */ - gdk_cairo_set_source_rgba (cr, priv->stroke_color); cairo_set_line_width (cr, priv->stroke_width); cairo_stroke (cr); } cairo_destroy (cr); -} + GtkWidget *child; + + for (child = gtk_widget_get_first_child (widget); + child != NULL; + child = gtk_widget_get_next_sibling (child)) + gtk_widget_snapshot_child (widget, child, snapshot); +} static void picplanner_draw_layer_class_init (PicplannerDrawLayerClass *klass) @@ -178,9 +218,10 @@ picplanner_draw_layer_class_init (PicplannerDrawLayerClass *klass) object_class->finalize = picplanner_draw_layer_finalize; object_class->dispose = picplanner_draw_layer_dispose; - object_class->constructed = picplanner_draw_layer_constructed; + object_class->constructed = shumate_marker_layer_constructed; widget_class->snapshot = picplanner_draw_layer_snapshot; + widget_class->size_allocate = picplanner_draw_layer_size_allocate; } static void @@ -231,6 +272,19 @@ add_node (PicplannerDrawLayer *layer, } +void +picplanner_draw_layer_add_marker (PicplannerDrawLayer *layer, + PicplannerMarker *marker) +{ + g_return_if_fail (PICPLANNER_IS_DRAW_LAYER (layer)); + g_return_if_fail (PICPLANNER_IS_MARKER (marker)); + + gtk_widget_insert_before (GTK_WIDGET(marker), GTK_WIDGET (layer), NULL); + update_marker_visibility (layer, marker); +} + + + void picplanner_draw_layer_add_node (PicplannerDrawLayer *layer, double *location) @@ -250,6 +304,21 @@ picplanner_draw_layer_remove_all (PicplannerDrawLayer *layer) g_clear_pointer (&priv->nodes, g_list_free); gtk_widget_queue_draw (GTK_WIDGET (layer)); + + + + GtkWidget *child; + + child = gtk_widget_get_first_child (GTK_WIDGET (layer)); + while (child) + { + GtkWidget *next = gtk_widget_get_next_sibling (child); + + g_signal_handlers_disconnect_by_data (child, layer); + gtk_widget_unparent (child); + + child = next; + } } diff --git a/src/map/draw-layer.h b/src/map/draw-layer.h index 1099f2e..0d7c218 100644 --- a/src/map/draw-layer.h +++ b/src/map/draw-layer.h @@ -9,6 +9,7 @@ #include #include #include +#include "marker.h" G_BEGIN_DECLS @@ -22,27 +23,39 @@ struct _PicplannerDrawLayerClass PicplannerDrawLayer *picplanner_draw_layer_new (ShumateViewport *viewport); +void +picplanner_draw_layer_add_marker (PicplannerDrawLayer *layer, + PicplannerMarker *marker); + + void picplanner_draw_layer_add_node (PicplannerDrawLayer *layer, - double *location); + double *location); + void picplanner_draw_layer_remove_node (PicplannerDrawLayer *layer, - double *location); + double *location); + void picplanner_draw_layer_remove_all (PicplannerDrawLayer *layer); + void picplanner_draw_layer_insert_node (PicplannerDrawLayer *layer, - double *location, - guint position); + double *location, + guint position); + GList *picplanner_draw_layer_get_nodes (PicplannerDrawLayer *layer); GdkRGBA *picplanner_draw_layer_get_stroke_color (PicplannerDrawLayer *layer); + void picplanner_draw_layer_set_stroke_color (PicplannerDrawLayer *layer, - const GdkRGBA *color); + const GdkRGBA *color); gboolean picplanner_draw_layer_get_stroke (PicplannerDrawLayer *layer); + void picplanner_draw_layer_set_stroke (PicplannerDrawLayer *layer, - gboolean value); + gboolean value); double picplanner_draw_layer_get_stroke_width (PicplannerDrawLayer *layer); + void picplanner_draw_layer_set_stroke_width (PicplannerDrawLayer *layer, - double value); + double value); G_END_DECLS diff --git a/src/map/marker.c b/src/map/marker.c new file mode 100644 index 0000000..6f2b926 --- /dev/null +++ b/src/map/marker.c @@ -0,0 +1,141 @@ +/* + * Code mainly taken from https://gitlab.gnome.org/GNOME/libshumate/-/blob/main/shumate/shumate-marker.c + * This is a copy of the shumate-path-layer adjusted for the needs of PicPlanner + */ + +#include +#include +#include +#include "marker.h" + +typedef struct +{ + double x; + double y; + + GtkWidget *child; +} PicplannerMarkerPrivate; + +static void buildable_interface_init (GtkBuildableIface *iface); + +G_DEFINE_TYPE_WITH_CODE (PicplannerMarker, picplanner_marker, GTK_TYPE_WIDGET, + G_ADD_PRIVATE (PicplannerMarker) + G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, buildable_interface_init)); + +static GtkBuildableIface *parent_buildable_iface; + +void +picplanner_marker_set_location (PicplannerMarker *marker, + double x, + double y) +{ + PicplannerMarkerPrivate *priv = picplanner_marker_get_instance_private (marker); + + priv->x = x; + priv->y = y; +} + + +double +picplanner_marker_get_x (PicplannerMarker *marker) +{ + PicplannerMarkerPrivate *priv = picplanner_marker_get_instance_private (marker); + + return priv->x; +} + + +double +picplanner_marker_get_y (PicplannerMarker *marker) +{ + PicplannerMarkerPrivate *priv = picplanner_marker_get_instance_private (marker); + + return priv->y; +} + +static void +picplanner_marker_add_child (GtkBuildable *buildable, + GtkBuilder *builder, + GObject *child, + const char *type) +{ + if (GTK_IS_WIDGET (child)) + picplanner_marker_set_child (PICPLANNER_MARKER (buildable), GTK_WIDGET (child)); + else + parent_buildable_iface->add_child (buildable, builder, child, type); +} + + +static void +picplanner_marker_dispose (GObject *object) +{ + PicplannerMarker *marker = PICPLANNER_MARKER (object); + + picplanner_marker_set_child (marker, NULL); + + G_OBJECT_CLASS (picplanner_marker_parent_class)->dispose (object); +} + +static void +picplanner_marker_class_init (PicplannerMarkerClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + + object_class->dispose = picplanner_marker_dispose; + + gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT); + gtk_widget_class_set_css_name (widget_class, "map-marker"); +} + +static void +picplanner_marker_init (PicplannerMarker *self) +{ + PicplannerMarkerPrivate *priv = picplanner_marker_get_instance_private (self); + + priv->x = 0; + priv->y = 0; +} + +static void +buildable_interface_init (GtkBuildableIface *iface) +{ + parent_buildable_iface = g_type_interface_peek_parent (iface); + iface->add_child = picplanner_marker_add_child; +} + +PicplannerMarker * +picplanner_marker_new (void) +{ + return PICPLANNER_MARKER (g_object_new (PICPLANNER_TYPE_MARKER, NULL)); +} + +GtkWidget * +picplanner_marker_get_child (PicplannerMarker *marker) +{ + PicplannerMarkerPrivate *priv = picplanner_marker_get_instance_private (marker); + + g_return_val_if_fail (PICPLANNER_IS_MARKER (marker), NULL); + + return priv->child; +} + + +void +picplanner_marker_set_child (PicplannerMarker *marker, + GtkWidget *child) +{ + PicplannerMarkerPrivate *priv = picplanner_marker_get_instance_private (marker); + + g_return_if_fail (PICPLANNER_IS_MARKER (marker)); + + if (priv->child == child) + return; + + g_clear_pointer (&priv->child, gtk_widget_unparent); + + priv->child = child; + + if (priv->child) + gtk_widget_set_parent (priv->child, GTK_WIDGET (marker)); +} diff --git a/src/map/marker.h b/src/map/marker.h new file mode 100644 index 0000000..7b09597 --- /dev/null +++ b/src/map/marker.h @@ -0,0 +1,46 @@ +/* + * Code mainly taken from https://gitlab.gnome.org/GNOME/libshumate/-/blob/main/shumate/shumate-marker.h + * This is a copy of the shumate-path-layer adjusted for the needs of PicPlanner + */ + +#ifndef PICPLANNER_MARKER_H +#define PICPLANNER_MARKER_H + +#include +#include +#include + +G_BEGIN_DECLS + +#define PICPLANNER_TYPE_MARKER picplanner_marker_get_type () +G_DECLARE_DERIVABLE_TYPE (PicplannerMarker, picplanner_marker, PICPLANNER, MARKER, GtkWidget) + +struct _PicplannerMarkerClass +{ + GtkWidgetClass parent_class; +}; + +void +picplanner_marker_set_location (PicplannerMarker *marker, + double x, + double y); + +double +picplanner_marker_get_x (PicplannerMarker *marker); + +double +picplanner_marker_get_y (PicplannerMarker *marker); + +PicplannerMarker +*picplanner_marker_new (void); + +GtkWidget +*picplanner_marker_get_child (PicplannerMarker *marker); + +void picplanner_marker_set_child (PicplannerMarker *marker, + GtkWidget *child); + +G_END_DECLS + +#endif + diff --git a/src/meson.build b/src/meson.build index 3f16c57..d957b4d 100644 --- a/src/meson.build +++ b/src/meson.build @@ -13,6 +13,7 @@ picplanner_sources = [ 'calculations/calculations_milky_way.c', 'search/search.c', 'map/draw-layer.c', + 'map/marker.c', ] picplanner_deps = [ diff --git a/src/window/overview-page/overview-view.c b/src/window/overview-page/overview-view.c index eac95fa..d24520a 100644 --- a/src/window/overview-page/overview-view.c +++ b/src/window/overview-page/overview-view.c @@ -4,6 +4,7 @@ #include "calculations/calculations_moon.h" #include "calculations/calculations_milky_way.h" #include "map/draw-layer.h" +#include "map/marker.h" #define LENGTH_SCALE_FACTOR 0.38 @@ -34,25 +35,9 @@ struct _PicplannerOverview ShumateSimpleMap *map; ShumateViewport *viewport; - ShumateMarker *marker_center; - ShumateMarkerLayer *marker_layer_center; - - ShumateMarker *marker_sun; - ShumateMarkerLayer *marker_layer_sun; - ShumatePathLayer *path_layer_sun; - - PicplannerDrawLayer *path_layer_sun_rise_set; - double *coordinates_sunrise; - double *coordinates_sunset; - double *coordinates_center; - - ShumateMarker *marker_moon; - ShumateMarker *marker_moon_rise; - ShumateMarker *marker_moon_set; - ShumateMarkerLayer *marker_layer_moon; - ShumatePathLayer *path_layer_moon; - ShumatePathLayer *path_layer_moon_rise_set; + PicplannerMarker *pp_marker_center; + PicplannerDrawLayer *pp_layer_center; GDateTime *date_time; @@ -203,124 +188,26 @@ picplanner_overview_update_map_center (PicplannerOverview *overview, double latitude, double longitude) { + double x,y; GtkWidget *image_center; - shumate_marker_layer_remove_all (overview->marker_layer_center); - /* - * Center marker - */ + + picplanner_draw_layer_remove_all (overview->pp_layer_center); + image_center = gtk_image_new_from_icon_name ("location-icon-symbolic-red"); gtk_image_set_icon_size (GTK_IMAGE (image_center), GTK_ICON_SIZE_LARGE); - shumate_location_set_location (SHUMATE_LOCATION (overview->marker_center), - latitude, longitude); - shumate_marker_set_child (overview->marker_center, - image_center); - shumate_marker_layer_add_marker (overview->marker_layer_center, - overview->marker_center); -} - -void -picplanner_overview_update_map_sun (PicplannerOverview *overview, - double latitude, - double longitude, - double *array_coordinates_sun, - int *rise_upper_set_sun) -{ - int width, height, min_size; - double x = 0, y = 0; - double x_sun, y_sun; - double x_sun_rise, y_sun_rise; - double x_sun_set, y_sun_set; - double azimuth_sun, latitude_sun, longitude_sun; - double azimuth_sun_rise; - double azimuth_sun_set; - GdkRGBA sun_color = {1., 0.9, 0.0, 0.8}; - GdkRGBA sun_rise_set_color = {1., 0.7, 0.0, 0.8}; - - bool visible_sun = TRUE; - GtkWidget *image_sun; - - picplanner_draw_layer_remove_all (overview->path_layer_sun_rise_set); - - width = gtk_widget_get_allocated_width (GTK_WIDGET (overview->map)); - height = gtk_widget_get_allocated_height (GTK_WIDGET (overview->map)); - if (widthviewport, - GTK_WIDGET (overview->map), - latitude, longitude, - &x, &y); + GTK_WIDGET (overview->map), + latitude, longitude, + &x, &y); + picplanner_marker_set_location (overview->pp_marker_center, x, y); + picplanner_marker_set_child (overview->pp_marker_center, image_center); + picplanner_draw_layer_add_marker (overview->pp_layer_center, overview->pp_marker_center); - image_sun = gtk_image_new_from_icon_name ("sun"); - gtk_image_set_pixel_size (GTK_IMAGE (image_sun), 48); - shumate_marker_set_child (overview->marker_sun, - image_sun); - - - azimuth_sun = array_coordinates_sun[NUM_DATA_POINTS]; - if (array_coordinates_sun[NUM_DATA_POINTS+1]<0) - visible_sun = FALSE; - x_sun = x + sin(calc_deg_to_rad (azimuth_sun)) * min_size * LENGTH_SCALE_FACTOR; - y_sun = y - cos(calc_deg_to_rad (azimuth_sun)) * min_size * LENGTH_SCALE_FACTOR; - - azimuth_sun_rise = array_coordinates_sun[rise_upper_set_sun[0]*2]; - x_sun_rise = x + sin(calc_deg_to_rad (azimuth_sun_rise)) * min_size * LENGTH_SCALE_FACTOR; - y_sun_rise = y - cos(calc_deg_to_rad (azimuth_sun_rise)) * min_size * LENGTH_SCALE_FACTOR; - - azimuth_sun_set = array_coordinates_sun[rise_upper_set_sun[2]*2]; - x_sun_set = x + sin(calc_deg_to_rad (azimuth_sun_set)) * min_size * LENGTH_SCALE_FACTOR; - y_sun_set = y - cos(calc_deg_to_rad (azimuth_sun_set)) * min_size * LENGTH_SCALE_FACTOR; - - shumate_viewport_widget_coords_to_location (overview->viewport, - GTK_WIDGET (overview->map), - x_sun, - y_sun, - &latitude_sun, - &longitude_sun); - - - shumate_location_set_location (SHUMATE_LOCATION (overview->marker_sun), - latitude_sun, - longitude_sun); - - overview->coordinates_center[0] = x; - overview->coordinates_center[1] = y; - - overview->coordinates_sunrise[0] = x_sun_rise; - overview->coordinates_sunrise[1] = y_sun_rise; - - overview->coordinates_sunset[0] = x_sun_set; - overview->coordinates_sunset[1] = y_sun_set; - - - picplanner_draw_layer_add_node (overview->path_layer_sun_rise_set, - overview->coordinates_sunrise); - - picplanner_draw_layer_add_node (overview->path_layer_sun_rise_set, - overview->coordinates_center); - picplanner_draw_layer_add_node (overview->path_layer_sun_rise_set, - overview->coordinates_sunset); - picplanner_draw_layer_set_stroke_color (overview->path_layer_sun_rise_set, &sun_rise_set_color); - picplanner_draw_layer_set_stroke_width (overview->path_layer_sun_rise_set, 6.); - - - if (visible_sun) - { - /* - shumate_marker_layer_add_marker (overview->marker_layer_sun, - overview->marker_sun); - shumate_path_layer_add_node (overview->path_layer_sun, - SHUMATE_LOCATION (overview->marker_center)); - shumate_path_layer_add_node (overview->path_layer_sun, - SHUMATE_LOCATION (overview->marker_sun)); - shumate_path_layer_set_stroke_color (overview->path_layer_sun, &sun_color); - shumate_path_layer_set_stroke_width (overview->path_layer_sun, 6.); - */ - } + g_print ("Picplanner Marker x: %f, y: %f\n", + picplanner_marker_get_x (overview->pp_marker_center), + picplanner_marker_get_y (overview->pp_marker_center)); } @@ -491,29 +378,14 @@ picplanner_overview_init (PicplannerOverview *overview) shumate_simple_map_set_map_source (overview->map, map_source); - overview->marker_center = shumate_marker_new (); - g_object_ref (overview->marker_center); - overview->marker_sun = shumate_marker_new (); - g_object_ref (overview->marker_sun); + // TODO + overview->pp_marker_center = picplanner_marker_new (); + g_object_ref (overview->pp_marker_center); + overview->pp_layer_center = picplanner_draw_layer_new (overview->viewport); + shumate_simple_map_add_overlay_layer (overview->map, SHUMATE_LAYER (overview->pp_layer_center)); - overview->coordinates_center = malloc (sizeof (double) * 2); - overview->coordinates_sunrise = malloc (sizeof (double) * 2); - overview->coordinates_sunset = malloc (sizeof (double) * 2); - overview->marker_moon = shumate_marker_new (); - overview->marker_moon_rise = shumate_marker_new (); - overview->marker_moon_set = shumate_marker_new (); - - overview->path_layer_sun = shumate_path_layer_new (overview->viewport); - shumate_simple_map_add_overlay_layer (overview->map, SHUMATE_LAYER (overview->path_layer_sun)); - overview->path_layer_sun_rise_set = picplanner_draw_layer_new (overview->viewport); - shumate_simple_map_add_overlay_layer (overview->map, SHUMATE_LAYER (overview->path_layer_sun_rise_set)); - overview->marker_layer_sun = shumate_marker_layer_new (overview->viewport); - shumate_simple_map_add_overlay_layer (overview->map, SHUMATE_LAYER (overview->marker_layer_sun)); - - overview->marker_layer_center = shumate_marker_layer_new (overview->viewport); - shumate_simple_map_add_overlay_layer (overview->map, SHUMATE_LAYER (overview->marker_layer_center)); /* * Make all the bindings between widget properties and g_settings. diff --git a/src/window/overview-page/overview-view.h b/src/window/overview-page/overview-view.h index 144c730..70925a4 100644 --- a/src/window/overview-page/overview-view.h +++ b/src/window/overview-page/overview-view.h @@ -29,18 +29,4 @@ picplanner_overview_update_map_center (PicplannerOverview *overview, double latitude, double longitude); -void -picplanner_overview_update_map_sun (PicplannerOverview *overview, - double latitude, - double longitude, - double *array_coordinates_sun, - int *rise_upper_set_index_sun); - -void -picplanner_overview_update_map_moon (PicplannerOverview *overview, - double latitude, - double longitude, - double *array_coordinates_moon, - int *rise_upper_set_moon); - G_END_DECLS diff --git a/src/window/picplanner-window.c b/src/window/picplanner-window.c index f8aed97..06fe9c1 100644 --- a/src/window/picplanner-window.c +++ b/src/window/picplanner-window.c @@ -299,18 +299,6 @@ calculate_positions (PicplannerWindow *window) latitude, longitude); - picplanner_overview_update_map_sun (PICPLANNER_OVERVIEW (window->overview_box), - latitude, - longitude, - array_coordinates_sun, - rise_upper_set_index_sun); -/* - picplanner_overview_update_map_moon (PICPLANNER_OVERVIEW (window->overview_box), - latitude, - longitude, - array_coordinates_moon, - rise_upper_set_index_moon); -*/ g_free (rise_upper_set_index_sun); g_free (rise_upper_set_index_moon);