diff --git a/src/calculations.c b/src/calculations.c index b7236d9..4bacac4 100644 --- a/src/calculations.c +++ b/src/calculations.c @@ -60,7 +60,6 @@ void utc_zone_to_time (int *time_utc, int *time_local){ } void time_to_utc (int *time_local, int *time_utc){ - calc_time_utc (time_utc); int sign = *(time_utc+5)/abs(*(time_utc+5)); *time_utc=*time_local; diff --git a/src/handler.c b/src/handler.c index 711923a..c33b81c 100644 --- a/src/handler.c +++ b/src/handler.c @@ -101,11 +101,6 @@ void hand_plot_sun(GtkBuilder *builder, float latitude, float longitude, int *ti int time_dyn[6] = {*time_utc, *(time_utc+1), *(time_utc+2), *(time_utc+3), *(time_utc+4), -*(time_utc+5)}; int time_dyn_local[6]; - float elevation[290]; - float result[2]; - float elevation_last; - float min_elevation, max_elevation; - float azimuth_max, azimuth_sunrise, azimuth_sunset; int time_max_elevation[2]={-90,0}; int time_sunrise[2]={-1,0}; int time_sunset[2]={-1,0}; @@ -118,6 +113,12 @@ void hand_plot_sun(GtkBuilder *builder, float latitude, float longitude, int *ti int time_dark_night_end[2]; int time_dark_night_begin[2]; + float azimuth[290], elevation[290]; + float result[2]; + float elevation_last; + float min_elevation, max_elevation; + float azimuth_max, azimuth_sunrise, azimuth_sunset; + char c_time_culmination[16]; char c_elevation_culmination[7]; char c_time_sunrise[16]; @@ -137,6 +138,7 @@ void hand_plot_sun(GtkBuilder *builder, float latitude, float longitude, int *ti hand_sun (latitude, longitude, time_dyn_local, result); if (i%5==0){ + azimuth[i/5+2] = result[0]; elevation[i/5+2] = result[1]; } @@ -204,6 +206,8 @@ void hand_plot_sun(GtkBuilder *builder, float latitude, float longitude, int *ti /* g_print("Time max elevation: %02d:%02d, Time sunrise: %02d:%02d, Time sunset: %02d:%02d\n", time_max_elevation[0],time_max_elevation[1],time_sunrise[0],time_sunrise[1],time_sunset[0],time_sunset[1]); */ + + elevation[0] = min_elevation; elevation[1] = max_elevation; @@ -221,6 +225,7 @@ void hand_plot_sun(GtkBuilder *builder, float latitude, float longitude, int *ti gtk_container_foreach (GTK_CONTAINER (box), (GtkCallback) gtk_widget_destroy, NULL); plot_elevation_sun (elevation, box); + course_sun_overview (azimuth, elevation); sprintf (c_time_culmination, "%02d:%02d (@ %.1f\u00B0)", time_max_elevation[0], time_max_elevation[1], azimuth_max); gtk_label_set_text (label_time_culmination, c_time_culmination); @@ -261,7 +266,7 @@ void hand_plot_moon(GtkBuilder *builder, float latitude, float longitude, int *t GtkWidget *box; int time_dyn[6] = {*time_utc, *(time_utc+1), *(time_utc+2), *(time_utc+3), *(time_utc+4), -*(time_utc+5)}; int time_dyn_local[6]; - float elevation[290]; + float azimuth[290], elevation[290]; float result[2]; float min_elevation, max_elevation; float elevation_last; @@ -290,6 +295,7 @@ void hand_plot_moon(GtkBuilder *builder, float latitude, float longitude, int *t hand_moon (latitude, longitude, time_dyn_local, result); if (i%5==0){ + azimuth[i/5+2] = result[0]; elevation[i/5+2] = result[1]; } @@ -327,6 +333,7 @@ void hand_plot_moon(GtkBuilder *builder, float latitude, float longitude, int *t box = GTK_WIDGET (gtk_builder_get_object(builder, "box_moon_elevation_plot")); gtk_container_foreach (GTK_CONTAINER (box), (GtkCallback) gtk_widget_destroy, NULL); plot_elevation_moon (elevation, box); + course_moon_overview (azimuth, elevation); label_rise = GTK_LABEL (gtk_builder_get_object (builder, "moon_rise")); label_set = GTK_LABEL (gtk_builder_get_object (builder, "moon_set")); @@ -351,7 +358,7 @@ void hand_plot_mw(GtkBuilder *builder, float latitude, float longitude, int *tim GtkWidget *box; int time_dyn[6] = {*time_utc, *(time_utc+1), *(time_utc+2), *(time_utc+3), *(time_utc+4), -*(time_utc+5)}; int time_dyn_local[6]; - float elevation[290]; + float azimuth[290], elevation[290]; float result[2]; float min_elevation, max_elevation; float elevation_last; @@ -380,6 +387,7 @@ void hand_plot_mw(GtkBuilder *builder, float latitude, float longitude, int *tim hand_milky_way (latitude, longitude, time_dyn_local, result); if (i%5==0){ + azimuth[i/5+2] = result[0]; elevation[i/5+2] = result[1]; } @@ -417,6 +425,7 @@ void hand_plot_mw(GtkBuilder *builder, float latitude, float longitude, int *tim box = GTK_WIDGET (gtk_builder_get_object(builder, "box_mw_elevation_plot")); gtk_container_foreach (GTK_CONTAINER (box), (GtkCallback) gtk_widget_destroy, NULL); plot_elevation_mw (elevation, box); + course_mw_overview (azimuth, elevation); label_rise = GTK_LABEL (gtk_builder_get_object (builder, "mw_rise")); label_set = GTK_LABEL (gtk_builder_get_object (builder, "mw_set")); diff --git a/src/main.c b/src/main.c index 2d66f9c..fe36525 100644 --- a/src/main.c +++ b/src/main.c @@ -5,6 +5,7 @@ #include #include #include +#include /* TODO * Clock should show allways TWO digits @@ -16,6 +17,8 @@ GtkWidget *button_search; GtkWidget *button_now; GtkWidget *button_calculate; GtkWidget *label_heading; +GtkWidget *box_scale; +GtkWidget *scale_button; GtkEntry *north_entry; GtkEntry *east_entry; @@ -203,6 +206,11 @@ static int adjust_time (GtkWidget *widget, gpointer data){ return 1; } +void scale_button_changed (GtkRange *range, GtkScrollType scroll, double value, gpointer user_data){ + if (plotted){ + plot_adjust_teta(G_PI/180*value); + } +} static gboolean delete_event(GtkWidget *widget, GdkEvent *event, gpointer data) @@ -252,6 +260,13 @@ int main( int argc, char *argv[] ) east_entry = GTK_ENTRY(gtk_builder_get_object(builder, "east_entry")); searchentry = GTK_SEARCH_ENTRY(gtk_builder_get_object(builder, "searchentry")); + box_scale = GTK_WIDGET (gtk_builder_get_object (builder, "scale_rotation")); + + scale_button = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, 0, 360, 1); + gtk_widget_set_hexpand (scale_button, TRUE); + gtk_container_add (GTK_CONTAINER (box_scale), scale_button); + + g_signal_connect (window, "delete-event", G_CALLBACK (delete_event), NULL); g_signal_connect (window, "destroy", G_CALLBACK (destroy), NULL); g_signal_connect (window, "configure-event", G_CALLBACK(hdy_size_config), NULL); @@ -262,14 +277,14 @@ int main( int argc, char *argv[] ) g_signal_connect (entry_year, "changed", G_CALLBACK (correct_time), NULL); g_signal_connect (entry_hour, "changed", G_CALLBACK (adjust_time), NULL); g_signal_connect (entry_min, "changed", G_CALLBACK (adjust_time), NULL); - g_signal_connect (searchentry, "activate", G_CALLBACK (search), NULL); + g_signal_connect (scale_button, "change-value", G_CALLBACK(scale_button_changed), NULL); set_time_now (window, NULL); - gtk_widget_show (window); + gtk_widget_show_all (window); gtk_main (); diff --git a/src/picplanner-window.ui b/src/picplanner-window.ui index 47ae7ea..9a60dcf 100644 --- a/src/picplanner-window.ui +++ b/src/picplanner-window.ui @@ -81,39 +81,210 @@ True True - + + + + True False - vertical + True + True + + True False - 10 vertical - + True False - start - start - Search location - - - + 10 + vertical + + + True + False + start + start + Search location + + + + + + + + True + True + start + 5 + + + + + Search + True + True + False + center + end + 10 + 10 + + + + + True + False + + - + True - True - start - 5 + False + 10 + vertical + + + True + False + start + end + Coordinates + + + + + + + + True + False + end + 5 + none + + + True + True + North + + + True + True + center + + + + + + + True + True + East + + + True + True + center + + + + + + + + + + True + False + 10 + center + horizontal + + + True + False + center + Date + + + + + + + + + + True + False + 5 + center + horizontal + + + True + False + vertical + + + True + True + d_adjustment + True + True + 1 + + + + + True + False + 1 + 2 + 150 + + January + February + March + April + May + June + July + August + September + October + November + December + + + + + + True + True + y_adjustment + True + True + 2020 + + + + + + + - - Search + + Calculate True True False @@ -123,164 +294,6 @@ 10 - - - True - False - - - - - - - True - False - 10 - vertical - - - True - False - start - end - Coordinates - - - - - - - - True - False - end - 5 - none - - - True - True - North - - - True - True - center - - - - - - - True - True - East - - - True - True - center - - - - - - - - - - True - False - 10 - center - horizontal - - - True - False - center - Date - - - - - - - - - - True - False - 5 - center - horizontal - - - True - False - vertical - - - True - True - d_adjustment - True - True - 1 - - - - - True - False - 1 - 2 - 150 - - January - February - March - April - May - June - July - August - September - October - November - December - - - - - - True - True - y_adjustment - True - True - 2020 - - - - - - - - - - - - Calculate - True - True - False - center - end - 10 - 10 @@ -306,6 +319,16 @@ True + + + + True + False + True + 10 + + + True @@ -386,208 +409,225 @@ True - - - True - False - 10 - Upper Culmination - - - - 10 + True False - end - none + True + True - - 5 - 25 - 25 + True False - Time - - - True - True - - True - - - - - - - 5 - 25 - 25 - True - False - Elevation - - - True - True - - True - - - - + vertical - - - - - True - False - Sunrise and Sunset - - - - - 10 - True - False - end - none - - - 5 - 25 - 25 - True - False - Sunrise - + True - True - True + False + 10 + Upper Culmination - - - - - 5 - 25 - 25 - True - False - Dark Night End + - + + 10 True - True - True + False + end + none + + + 5 + 25 + 25 + True + False + Time + + + True + True + + True + + + + + + + 5 + 25 + 25 + True + False + Elevation + + + True + True + + True + + + + + - - - - - 5 - 25 - 25 - True - False - Blue Hour - + True - True - True + False + Sunrise and Sunset - - - - - 5 - 25 - 25 - 15 - True - False - Golden Hour - + + 10 True - True - True - - - - - - - 5 - 25 - 25 - True - False - Sunset - - - True - True - True - - - - - - - 5 - 25 - 25 - True - False - Golden Hour - - - True - True - True - - - - - - - 5 - 25 - 25 - True - False - Blue Hour - - - True - True - True - - - - - - - 5 - 25 - 25 - True - False - Dark Night Begin - - - True - True - True + False + end + none + + + 5 + 25 + 25 + True + False + Sunrise + + + True + True + True + + + + + + + 5 + 25 + 25 + True + False + Dark Night End + + + True + True + True + + + + + + + 5 + 25 + 25 + True + False + Blue Hour + + + True + True + True + + + + + + + 5 + 25 + 25 + 15 + True + False + Golden Hour + + + True + True + True + + + + + + + 5 + 25 + 25 + True + False + Sunset + + + True + True + True + + + + + + + 5 + 25 + 25 + True + False + Golden Hour + + + True + True + True + + + + + + + 5 + 25 + 25 + True + False + Blue Hour + + + True + True + True + + + + + + + 5 + 25 + 25 + True + False + Dark Night Begin + + + True + True + True + + + + @@ -618,171 +658,184 @@ True - - - True - False - 10 - Upper Culmination - - - - - 10 - True - False - end - none + + + True + False + True + True - - 5 - 25 - 25 + True False - Time + vertical + - + True - True - - True + False + 10 + Upper Culmination - - - - - 5 - 25 - 25 - True - False - Elevation - + + 10 True - True - - True + False + end + none + + + + 5 + 25 + 25 + True + False + Time + + + True + True + + True + + + + + + + 5 + 25 + 25 + True + False + Elevation + + + True + True + + True + + + + + + + + + + True + False + Rise and Set + + + + + + 10 + True + False + end + none + + + 5 + 25 + 25 + True + False + Rise + + + True + True + + True + + + + + + + 5 + 25 + 25 + True + False + Set + + + True + True + + True + + + + + + + + + + True + False + Illumination + + + + + 10 + True + False + end + none + + + 5 + 25 + 25 + True + False + Illumination Intensity + + + True + True + + True + + + + + + + 5 + 25 + 25 + True + False + Phase Trend + + + True + True + + True + + + + - - - - True - False - Rise and Set - - - - - - 10 - True - False - end - none - - - 5 - 25 - 25 - True - False - Rise - - - True - True - - True - - - - - - - 5 - 25 - 25 - True - False - Set - - - True - True - - True - - - - - - - - - - True - False - Illumination - - - - - 10 - True - False - end - none - - - 5 - 25 - 25 - True - False - Illumination Intensity - - - True - True - - True - - - - - - - 5 - 25 - 25 - True - False - Phase Trend - - - True - True - - True - - - - - - - - - - moon @@ -807,118 +860,133 @@ True - - - True - False - 10 - Upper Culmination - - - - - 10 - True - False - end - none - - - 5 - 25 - 25 - True - False - Time - - - True - True - - True - - - - - - - 5 - 25 - 25 - True - False - Elevation - - - True - True - - True - - - - - - - - + True False - 10 - Rise and Set - - - - - 10 - True - False - end - none + True + True - - 5 - 25 - 25 + True False - Rise + vertical + - + True - True - - True + False + 10 + Upper Culmination - - - - - 5 - 25 - 25 - True - False - Set - + + 10 True - True - - True + False + end + none + + + + 5 + 25 + 25 + True + False + Time + + + True + True + + True + + + + + + + 5 + 25 + 25 + True + False + Elevation + + + True + True + + True + + + + + + + + + + + True + False + 10 + Rise and Set + + + + + 10 + True + False + end + none + + + 5 + 25 + 25 + True + False + Rise + + + True + True + + True + + + + + + + 5 + 25 + 25 + True + False + Set + + + True + True + + True + + + + - - - milkyway diff --git a/src/plot.c b/src/plot.c index 784bc1a..657624f 100644 --- a/src/plot.c +++ b/src/plot.c @@ -5,12 +5,13 @@ GtkWidget *da_overview; float coordinate_system_settings[5]; float teta; -float sun_az; -float sun_el; -float moon_az; -float moon_el; -float mw_az; -float mw_el; +float sun_x, sun_y, sun_z; +float moon_x, moon_y, moon_z; +float mw_x, mw_y, mw_z; + +float array_sun_x[288], array_sun_y[288], array_sun_z[288]; +float array_moon_x[288], array_moon_y[288], array_moon_z[288]; +float array_mw_x[288], array_mw_y[288], array_mw_z[288]; void plot_set_basic_coordinate_system_settings (void){ coordinate_system_settings[0] = -G_PI*3/5; @@ -20,9 +21,9 @@ void plot_set_basic_coordinate_system_settings (void){ coordinate_system_settings[4] = 1.5; } -void plot_adjust_teta (GtkRange *range, GtkScrollType scroll, double value, gpointer widget){ +void plot_adjust_teta (float value){ teta = -value; - gtk_widget_queue_draw (widget); + gtk_widget_queue_draw (da_overview); } void plot_adjust_coordinate_system_settings (double s0, double s1, double s2, double s3, double s4){ @@ -96,8 +97,8 @@ void plot_vector_to (cairo_t *cr, double a1, double a2, double a3) { float gamma = 0.5326; cairo_line_to (cr, x_2, y_2); - cairo_line_to (cr, x_2+(-direct_x*cos(gamma)+direct_y*sin(gamma))*0.2, y_2+(-direct_y*cos(gamma)-direct_x*sin(gamma))*0.2); - cairo_move_to (cr, x_2, y_2); + cairo_move_to (cr, x_2+(-direct_x*cos(gamma)+direct_y*sin(gamma))*0.2, y_2+(-direct_y*cos(gamma)-direct_x*sin(gamma))*0.2); + cairo_line_to (cr, x_2, y_2); cairo_line_to (cr, x_2+(-direct_x*cos(gamma)-direct_y*sin(gamma))*0.2, y_2+(-direct_y*cos(gamma)+direct_x*sin(gamma))*0.2); } @@ -180,15 +181,44 @@ void plot_overview (GtkWidget *box){ g_signal_connect (da_overview, "draw", G_CALLBACK (on_draw_overview), NULL); } -void update_overview (float sun_az_ud, float sun_el_ud, float moon_az_ud, float moon_el_ud, float mw_az_ud, float mw_el_ud){ - sun_az = sun_az_ud; - sun_el = sun_el_ud; - moon_az = moon_az_ud; - moon_el = moon_el_ud; - mw_az = mw_az_ud; - mw_el = mw_el_ud; +void course_sun_overview (float *array_az_sun, float *array_el_sun){ + for (int i=0; i<288; i++){ + array_sun_x[i] = cos(M_PI/180*array_az_sun[i+2])*cos(M_PI/180*array_el_sun[i+2]); + array_sun_y[i] = sin(M_PI/180*array_az_sun[i+2])*cos(M_PI/180*array_el_sun[i+2]); + array_sun_z[i] = -sin(M_PI/180*array_el_sun[i+2]); + } +} + +void course_moon_overview (float *array_az_moon, float *array_el_moon){ + for (int i=0; i<288; i++){ + array_moon_x[i] = cos(M_PI/180*array_az_moon[i+2])*cos(M_PI/180*array_el_moon[i+2]); + array_moon_y[i] = sin(M_PI/180*array_az_moon[i+2])*cos(M_PI/180*array_el_moon[i+2]); + array_moon_z[i] = -sin(M_PI/180*array_el_moon[i+2]); + } +} + +void course_mw_overview (float *array_az_mw, float *array_el_mw){ + for (int i=0; i<288; i++){ + array_mw_x[i] = cos(M_PI/180*array_az_mw[i+2])*cos(M_PI/180*array_el_mw[i+2]); + array_mw_y[i] = sin(M_PI/180*array_az_mw[i+2])*cos(M_PI/180*array_el_mw[i+2]); + array_mw_z[i] = -sin(M_PI/180*array_el_mw[i+2]); + } +} + +void update_overview (float sun_az, float sun_el, float moon_az, float moon_el, float mw_az, float mw_el){ + + sun_x = cos(M_PI/180*sun_az)*cos(M_PI/180*sun_el); + sun_y = sin(M_PI/180*sun_az)*cos(M_PI/180*sun_el); + sun_z = -sin(M_PI/180*sun_el); + + moon_x = cos(M_PI/180*moon_az)*cos(M_PI/180*moon_el); + moon_y = sin(M_PI/180*moon_az)*cos(M_PI/180*moon_el); + moon_z = -sin(M_PI/180*moon_el); + + mw_x = cos(M_PI/180*mw_az)*cos(M_PI/180*mw_el); + mw_y = sin(M_PI/180*mw_az)*cos(M_PI/180*mw_el); + mw_z = -sin(M_PI/180*mw_el); - g_print("Sun Elevation update: %f\n", sun_el); gtk_widget_queue_draw(da_overview); } @@ -198,25 +228,97 @@ gboolean on_draw_overview (GtkWidget *widget, cairo_t *cr, gpointer gpoint){ cairo_region_t *cairo_region; GdkDrawingContext *drawing_context; GdkRectangle da; + gdouble dx, dy; + gdouble clip_x1, clip_y1, clip_x2, clip_y2; drawing_window = gtk_widget_get_window (widget); - cairo_region = cairo_region_create(); drawing_context = gdk_window_begin_draw_frame (drawing_window,cairo_region); cr = gdk_drawing_context_get_cairo_context (drawing_context); gdk_window_get_geometry (drawing_window, &da.x, &da.y, &da.width, &da.height); - cairo_translate (cr, 0, da.height*0.4); + cairo_translate (cr, da.width*0.5, da.height*0.5); cairo_scale (cr, 100, 100); - gdouble dx = da.width, dy = da.height*0.4; - gdouble clip_x1 = 0.0, clip_y1 = 0.0, clip_x2 = 0.0, clip_y2 = 0.0; + dx = da.width, dy = da.height; + clip_x1 = 0.0, clip_y1 = 0.0, clip_x2 = 0.0, clip_y2 = 0.0; cairo_device_to_user_distance (cr, &dx, &dy); cairo_clip_extents (cr, &clip_x1, &clip_y1, &clip_x2, &clip_y2); - cairo_set_line_width (cr, 0.05); + + plot_set_basic_coordinate_system_settings(); cairo_set_source_rgb (cr, 0.8, 0.8, 0.8); cairo_paint (cr); + cairo_set_source_rgb (cr, 1, 1, 1); + cairo_set_line_width (cr, 0.02); + plot_move_to (cr, 0, 0, 0); + plot_circle (cr, 1, 0, 0, 50); + cairo_fill (cr); + cairo_stroke (cr); + + cairo_set_line_width (cr, 0.05); + + if (sun_z<0){ + cairo_set_source_rgb (cr, 1, 0, 0); + plot_move_to (cr, 0, 0, 0); + plot_vector_to (cr, sun_x, sun_y, sun_z); + cairo_stroke (cr); + } + + if (moon_z<0){ + cairo_set_source_rgb (cr, 0, 1, 0); + plot_move_to (cr, 0, 0, 0); + plot_vector_to (cr, moon_x, moon_y, moon_z); + cairo_stroke (cr); + } + if (mw_z<0){ + cairo_set_source_rgb (cr, 0, 0, 1); + plot_move_to (cr, 0, 0, 0); + plot_vector_to (cr, mw_x, mw_y, mw_z); + cairo_stroke (cr); + } + + cairo_set_source_rgb (cr, 1, 0.9, 0); + plot_move_to (cr, array_sun_x[0], array_sun_y[0], array_sun_z[0]); + for (int i=1; i<288; i++){ + if (array_sun_z[i]<0){ + plot_line_to (cr, array_sun_x[i], array_sun_y[i], array_sun_z[i]); + } + else{ + plot_move_to (cr, array_sun_x[i], array_sun_y[i], array_sun_z[i]); + + } + } + cairo_stroke (cr); + + cairo_set_source_rgb (cr, 0.1, 0.9, 1); + plot_move_to (cr, array_moon_x[0], array_moon_y[0], array_moon_z[0]); + for (int i=0; i<288; i++){ + if (array_moon_z[i]<0){ + plot_line_to (cr, array_moon_x[i], array_moon_y[i], array_moon_z[i]); + } + else{ + plot_move_to (cr, array_moon_x[i], array_moon_y[i], array_moon_z[i]); + } + } + cairo_stroke (cr); + + cairo_set_source_rgb (cr, 0.9, 0.9, 0.9); + plot_move_to (cr, array_mw_x[0], array_mw_y[0], array_mw_z[0]); + for (int i=0; i<288; i++){ + if (array_mw_z[i]<0){ + plot_line_to (cr, array_mw_x[i], array_mw_y[i], array_mw_z[i]); + } + else{ + plot_move_to (cr, array_mw_x[i], array_mw_y[i], array_mw_z[i]); + } + } + cairo_stroke (cr); + + cairo_surface_t *cairo_surface = cairo_get_target (cr); + unsigned char *data = cairo_image_surface_get_data(cairo_surface); + + gdk_window_end_draw_frame(drawing_window,drawing_context); cairo_region_destroy(cairo_region); diff --git a/src/plot.h b/src/plot.h index c16887d..cd01e8b 100644 --- a/src/plot.h +++ b/src/plot.h @@ -2,6 +2,8 @@ #include #include +void plot_adjust_teta (float value); + double plot_calc_coordinate_x (double a1, double a2); double plot_calc_coordinate_y (double a1, double a2, double a3); @@ -20,6 +22,12 @@ void plot_overview (GtkWidget *box); void update_overview (float sun_az_ud, float sun_el_ud, float moon_az_ud, float moon_el_ud, float mw_az_ud, float mw_el_ud); +void course_sun_overview (float *array_az_sun, float *array_el_sun); + +void course_moon_overview (float *array_az_moon, float *array_el_moon); + +void course_mw_overview (float *array_az_mw, float *array_el_mw); + gboolean on_draw_overview (GtkWidget *widget, cairo_t *cr, gpointer gpoint); void plot_elevation_mw (float *elevations, GtkWidget *box);