#pragma once #include #include #include #include #include #include "gtkmm/scrolledwindow.h" class WeatherWidget : public Gtk::Box { public: struct CurrentWeather { double temperature; double apparent_temperature; double precipitation; int weather_code; }; struct DailyWeather { double temperature_2m_max; double temperature_2m_min; double apparent_temperature_min; double apparent_temperature_max; double precipitation_sum; int weather_code; std::string time; }; struct HourlyWeather { double temperature_2m; double apparent_temperature; double precipitation_probability; double precipitation; int weather_code; std::string time; }; WeatherWidget(); private: std::array daily_weather{}; std::array hourly_weather{}; CurrentWeather current_weather{}; Gtk::ScrolledWindow currentScroll; Gtk::ScrolledWindow hourlyScroll; Gtk::ScrolledWindow dailyScroll; Glib::Dispatcher m_dispatcher; bool onRefreshTick(); void fetchWeather(); void refreshCurrentWeather(); void refreshHourlyWeather(); void refreshDailyWeather(); };