/* gddcalc.h
 * Defines some externals used by GDDCALC subroutines.
 * 
 *********************************************************************
 * ALL MONTH QUANTITIES THAT APPEAR BELOW RUN FROM 1 TO 12.
 * SO WHENEVER THE VARIABLE MONTH IS USED AS AN INDEX, AS IN, SAY,
 * dayspermonth[month], WE MUST SUBTRACT 1 FROM month TO CREATE A
 * VARIABLE THAT RUNS FROM 0 TO 11. THE SAME HOLDS TRUE WHEN REFERING
 * TO THE ITEMS IN THE MONTHS COMBOBOX.
 *********************************************************************
 */

#include <gtk/gtk.h>
#include <gtk/gtkx.h>

#define LOGSTART    1
#define LOGSAVE     2

int northsouth, haveprefs, in_use, pass, oneormany;
int startday, stopday;
int startmonth_set, stopmonth_set;
int startmonth, stopmonth, monthflag, dayspermonth[12];
int active_year, active_month, active_day, active_daynum;
int active_startyear, active_startmonth, active_startday;
int active_stopyear, active_stopmonth, active_stopday;
int active_dt, active_hour, active_minute, active_second;
float active_latitude, active_longitude;
float active_aspect, active_tilt, active_elev;
float active_sunrise, active_sunset;
float active_temp, active_press, active_timezone;
float active_daysIrr, active_monthsIrr;
float active_daysGDD, active_monthsGDD;
float accumulatedIrr, accumulatedGDD;

/* The month_days array is used by solpos and several routines that call
 * solpos. The latter use it to calculate daynumber from day, month, and
 * year.
 */

static int  month_days[2][13] = {
	{0,   0,  31,  59,  90, 120, 151, 181, 212, 243, 273, 304, 334 },
	{0,   0,  31,  60,  91, 121, 152, 182, 213, 244, 274, 305, 335 }};
int in_use;
int error_watch;

GtkBuilder	*builder;
GtkWidget	*window;
GtkWidget	*fixed0;
// ------------------------------------------ the menu
GtkWidget	*menu1;
GtkWidget	*startlogging;
GtkWidget	*savelog;
GtkWidget	*locale;
GtkWidget	*quit;
GtkWidget	*oneday;
GtkWidget	*months;
GtkWidget	*testoneinstant;
GtkWidget	*testoneday;
GtkWidget	*testgrowingseason;
GtkWidget	*tutorial;
GtkWidget	*about;
// ------------------------------------------ test 1
GtkWidget	*t1_frame;
GtkWidget	*t1_fixed;
GtkWidget	*t1_entry1;
GtkWidget	*t1_entry2;
GtkWidget	*t1_entry3;
GtkWidget	*t1_entry4;
GtkWidget	*t1_entry5;
GtkWidget	*t1_entry6;
GtkWidget	*t1_entry7;
GtkWidget	*t1_entry8;
GtkWidget	*t1_entry9;
GtkWidget	*t1_entry10;
GtkWidget	*t1_entry11;
GtkWidget	*t1_entry12;
GtkWidget	*t1_calculate;
GtkWidget	*t1_close;
GtkWidget	*t1_topband;
GtkWidget	*t1_explanation;
// ------------------------------------------ test 2
GtkWidget	*t2_frame;
GtkWidget	*t2_fixed;
GtkWidget	*t2_frame1;
GtkWidget	*t2_fixed1;
GtkWidget	*t2_calculate;
GtkWidget	*t2_close;
GtkWidget	*t2_entry1;
GtkWidget	*t2_entry2;
GtkWidget	*t2_entry3;
GtkWidget	*t2_topband;
// ------------------------------------------ test 3
GtkWidget	*t3_frame;
GtkWidget	*t3_fixed;
GtkWidget	*t3_box;
GtkWidget	*t3_grid;
GtkWidget	*t3_calculate;
GtkWidget	*t3_close;
GtkWidget	*t3_entry1;
GtkWidget	*t3_entry2;
GtkWidget	*t3_entry3;
GtkWidget	*t3_entry4;
GtkWidget	*t3_entry5;
GtkWidget	*t3_entry6;
GtkWidget	*t3_entry7;
GtkWidget	*t3_entry8;
GtkWidget	*t3_topband;
// ------------------------------------------ choose 1 day
GtkWidget	*c1_window;
GtkWidget	*error_frame;
GtkWidget	*error_fixed;
GtkWidget	*error_topband;
GtkWidget	*error_box;
GtkWidget	*error_grid;
GtkWidget	*error_close;
// ------------------------------------------ choose months
GtkWidget	*c2_window;
// ------------------------------------------ locale
GtkWidget	*locale_frame;
GtkWidget	*locale_fixed;
GtkWidget	*locale_entry_lat;
GtkWidget	*locale_entry_lon;
GtkWidget	*locale_entry_elev;
GtkWidget	*locale_entry_aspect;
GtkWidget	*locale_entry_tilt;
GtkWidget	*locale_clear;
GtkWidget	*locale_save;
GtkWidget	*locale_close;
GtkWidget	*locale_topband;
// ------------------------------------------ tutorial
GtkWidget	*tutorial_frame;
GtkWidget	*tutorial_fixed;
GtkWidget	*tutorial_dismiss;
// ------------------------------------------ about
GtkWidget	*about_frame;
GtkWidget	*about_fixed;
GtkWidget	*about_dismiss;
