/* desktop_weather.c generated by valac 0.56.19, the Vala compiler
 * generated from desktop_weather.vala, do not modify */

#include <gtk/gtk.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <float.h>
#include <math.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gtk-layer-shell/gtk-layer-shell.h>
#include <gdk/gdk.h>
#include <cairo-gobject.h>
#include <libxfce4windowing/libxfce4windowing.h>
#include <config.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define TYPE_DESKTOP_WEATHER (desktop_weather_get_type ())
#define DESKTOP_WEATHER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DESKTOP_WEATHER, DesktopWeather))
#define DESKTOP_WEATHER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DESKTOP_WEATHER, DesktopWeatherClass))
#define IS_DESKTOP_WEATHER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DESKTOP_WEATHER))
#define IS_DESKTOP_WEATHER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DESKTOP_WEATHER))
#define DESKTOP_WEATHER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DESKTOP_WEATHER, DesktopWeatherClass))

typedef struct _DesktopWeather DesktopWeather;
typedef struct _DesktopWeatherClass DesktopWeatherClass;
typedef struct _DesktopWeatherPrivate DesktopWeatherPrivate;
enum  {
	DESKTOP_WEATHER_0_PROPERTY,
	DESKTOP_WEATHER_NUM_PROPERTIES
};
static GParamSpec* desktop_weather_properties[DESKTOP_WEATHER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block1Data Block1Data;
typedef struct _Block2Data Block2Data;
typedef struct _Block3Data Block3Data;
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
#define _g_dir_close0(var) ((var == NULL) ? NULL : (var = (g_dir_close (var), NULL)))

struct _DesktopWeather {
	GtkWindow parent_instance;
	DesktopWeatherPrivate * priv;
};

struct _DesktopWeatherClass {
	GtkWindowClass parent_class;
};

struct _DesktopWeatherPrivate {
	GFile* datasrc;
	GFileMonitor* monitor;
	GtkGrid* maingrid;
	GtkLabel* locationlabel;
	GtkLabel* weatherlabel;
	GSettings* desktop_settings;
	gchar* css_data;
	gchar* css_template;
	GtkCssProvider* css_provider;
	gdouble new_transp;
	GdkPixbuf** iconpixbufs_1;
	gint iconpixbufs_1_length1;
	gint _iconpixbufs_1_size_;
	GdkPixbuf** iconpixbufs_2;
	gint iconpixbufs_2_length1;
	gint _iconpixbufs_2_size_;
	GdkPixbuf** iconpixbufs_3;
	gint iconpixbufs_3_length1;
	gint _iconpixbufs_3_size_;
	gint currscale;
	gchar** iconnames;
	gint iconnames_length1;
	gint _iconnames_size_;
	GtkImage* weather_image;
};

struct _Block1Data {
	int _ref_count_;
	DesktopWeather* self;
	gchar** applets;
	gint applets_length1;
	gint _applets_size_;
	gchar* uuid;
};

struct _Block2Data {
	int _ref_count_;
	Block1Data * _data1_;
	GSettings* currpanelsubject_settings;
};

struct _Block3Data {
	int _ref_count_;
	DesktopWeather* self;
	gchar* uuid;
};

static gint DesktopWeather_private_offset;
static gpointer desktop_weather_parent_class = NULL;

VALA_EXTERN GType desktop_weather_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DesktopWeather, g_object_unref)
static gboolean desktop_weather_find_applet (DesktopWeather* self,
                                      const gchar* uuid,
                                      gchar** applets,
                                      gint applets_length1);
static void desktop_weather_watchapplet (DesktopWeather* self,
                                  const gchar* uuid);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static void _____lambda4_ (Block2Data* _data2_);
static void ______lambda4__g_settings_changed (GSettings* _sender,
                                        const gchar* key,
                                        gpointer self);
VALA_EXTERN DesktopWeather* desktop_weather_new (const gchar* uuid);
VALA_EXTERN DesktopWeather* desktop_weather_construct (GType object_type,
                                           const gchar* uuid);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
static gboolean __lambda5_ (Block3Data* _data3_);
static gboolean ___lambda5__gsource_func (gpointer self);
static void desktop_weather_get_icondata (DesktopWeather* self);
static void desktop_weather_check_res (DesktopWeather* self);
static GSettings* desktop_weather_get_settings (DesktopWeather* self,
                                         const gchar* path);
static void desktop_weather_set_windowpos (DesktopWeather* self);
static void _desktop_weather_set_windowpos_g_settings_changed (GSettings* _sender,
                                                        const gchar* key,
                                                        gpointer self);
static void __lambda6_ (DesktopWeather* self);
static void ___lambda6__g_settings_changed (GSettings* _sender,
                                     const gchar* key,
                                     gpointer self);
static void __lambda7_ (DesktopWeather* self);
static void desktop_weather_update_style (DesktopWeather* self);
static void ___lambda7__g_settings_changed (GSettings* _sender,
                                     const gchar* key,
                                     gpointer self);
static void __lambda8_ (DesktopWeather* self);
static void ___lambda8__g_settings_changed (GSettings* _sender,
                                     const gchar* key,
                                     gpointer self);
static void __lambda9_ (DesktopWeather* self);
static void ___lambda9__g_settings_changed (GSettings* _sender,
                                     const gchar* key,
                                     gpointer self);
static gchar* desktop_weather_get_css (DesktopWeather* self);
static gboolean desktop_weather_on_draw (DesktopWeather* self,
                                  GtkWidget* da,
                                  cairo_t* ctx);
static gboolean _desktop_weather_on_draw_gtk_widget_draw (GtkWidget* _sender,
                                                   cairo_t* cr,
                                                   gpointer self);
static void desktop_weather_load_css (DesktopWeather* self,
                               const gchar* css_data);
static void desktop_weather_update_content (DesktopWeather* self);
static void _desktop_weather_update_content_g_file_monitor_changed (GFileMonitor* _sender,
                                                             GFile* file,
                                                             GFile* other_file,
                                                             GFileMonitorEvent event_type,
                                                             gpointer self);
static gint desktop_weather_get_stringindex (DesktopWeather* self,
                                      const gchar* s,
                                      gchar** arr,
                                      gint arr_length1);
static GdkPixbuf** _vala_array_dup1 (GdkPixbuf** self,
                              gssize length);
static GdkPixbuf** _vala_array_dup2 (GdkPixbuf** self,
                              gssize length);
static GdkPixbuf** _vala_array_dup3 (GdkPixbuf** self,
                              gssize length);
static void _vala_array_add1 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static gchar* desktop_weather_find_mappedid (DesktopWeather* self,
                                      const gchar* icon_id);
static void _vala_array_add2 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static void _vala_array_add3 (GdkPixbuf** * array,
                       gint* length,
                       gint* size,
                       GdkPixbuf* value);
static void _vala_array_add4 (GdkPixbuf** * array,
                       gint* length,
                       gint* size,
                       GdkPixbuf* value);
static void _vala_array_add5 (GdkPixbuf** * array,
                       gint* length,
                       gint* size,
                       GdkPixbuf* value);
static void desktop_weather_main (gchar** args,
                           gint args_length1);
static void _gtk_main_quit_gtk_widget_destroy (GtkWidget* _sender,
                                        gpointer self);
static void desktop_weather_finalize (GObject * obj);
static GType desktop_weather_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);

static inline gpointer
desktop_weather_get_instance_private (DesktopWeather* self)
{
	return G_STRUCT_MEMBER_P (self, DesktopWeather_private_offset);
}

static gboolean
desktop_weather_find_applet (DesktopWeather* self,
                             const gchar* uuid,
                             gchar** applets,
                             gint applets_length1)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (uuid != NULL, FALSE);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				const gchar* _tmp2_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				if (!(i < applets_length1)) {
					break;
				}
				_tmp2_ = applets[i];
				if (g_strcmp0 (_tmp2_, uuid) == 0) {
					result = TRUE;
					return result;
				}
			}
		}
	}
	result = FALSE;
	return result;
}

static Block1Data*
block1_data_ref (Block1Data* _data1_)
{
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}

static void
block1_data_unref (void * _userdata_)
{
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		DesktopWeather* self;
		self = _data1_->self;
		_data1_->applets = (_vala_array_free (_data1_->applets, _data1_->applets_length1, (GDestroyNotify) g_free), NULL);
		_g_free0 (_data1_->uuid);
		_g_object_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}

static Block2Data*
block2_data_ref (Block2Data* _data2_)
{
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}

static void
block2_data_unref (void * _userdata_)
{
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		DesktopWeather* self;
		self = _data2_->_data1_->self;
		_g_object_unref0 (_data2_->currpanelsubject_settings);
		block1_data_unref (_data2_->_data1_);
		_data2_->_data1_ = NULL;
		g_slice_free (Block2Data, _data2_);
	}
}

static void
_____lambda4_ (Block2Data* _data2_)
{
	Block1Data* _data1_;
	DesktopWeather* self;
	GSettings* _tmp0_;
	gchar** _tmp1_;
	gchar** _tmp2_;
	gchar** _tmp3_;
	gint _tmp3__length1;
	_data1_ = _data2_->_data1_;
	self = _data1_->self;
	_tmp0_ = _data2_->currpanelsubject_settings;
	_tmp2_ = _tmp1_ = g_settings_get_strv (_tmp0_, "applets");
	_data1_->applets = (_vala_array_free (_data1_->applets, _data1_->applets_length1, (GDestroyNotify) g_free), NULL);
	_data1_->applets = _tmp2_;
	_data1_->applets_length1 = _vala_array_length (_tmp1_);
	_data1_->_applets_size_ = _data1_->applets_length1;
	_tmp3_ = _data1_->applets;
	_tmp3__length1 = _data1_->applets_length1;
	if (!desktop_weather_find_applet (self, _data1_->uuid, _tmp3_, (gint) _tmp3__length1)) {
		gtk_main_quit ();
	}
}

static void
______lambda4__g_settings_changed (GSettings* _sender,
                                   const gchar* key,
                                   gpointer self)
{
	_____lambda4_ (self);
}

static void
desktop_weather_watchapplet (DesktopWeather* self,
                             const gchar* uuid)
{
	Block1Data* _data1_;
	gchar* _tmp0_;
	gchar* general_path = NULL;
	gchar* _tmp1_;
	GSettings* panel_settings = NULL;
	const gchar* _tmp2_;
	GSettings* _tmp3_;
	gchar** allpanels_list = NULL;
	GSettings* _tmp4_;
	gchar** _tmp5_;
	gchar** _tmp6_;
	gint allpanels_list_length1;
	gint _allpanels_list_size_;
	gchar** _tmp7_;
	gint _tmp7__length1;
	g_return_if_fail (self != NULL);
	g_return_if_fail (uuid != NULL);
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	_data1_->self = g_object_ref (self);
	_tmp0_ = g_strdup (uuid);
	_g_free0 (_data1_->uuid);
	_data1_->uuid = _tmp0_;
	_tmp1_ = g_strdup ("com.solus-project.budgie-panel");
	general_path = _tmp1_;
	_tmp2_ = general_path;
	_tmp3_ = g_settings_new (_tmp2_);
	panel_settings = _tmp3_;
	_tmp4_ = panel_settings;
	_tmp6_ = _tmp5_ = g_settings_get_strv (_tmp4_, "panels");
	allpanels_list = _tmp6_;
	allpanels_list_length1 = _vala_array_length (_tmp5_);
	_allpanels_list_size_ = allpanels_list_length1;
	_tmp7_ = allpanels_list;
	_tmp7__length1 = allpanels_list_length1;
	{
		gchar** p_collection = NULL;
		gint p_collection_length1 = 0;
		gint _p_collection_size_ = 0;
		gint p_it = 0;
		p_collection = _tmp7_;
		p_collection_length1 = _tmp7__length1;
		for (p_it = 0; p_it < p_collection_length1; p_it = p_it + 1) {
			gchar* _tmp8_;
			gchar* p = NULL;
			_tmp8_ = g_strdup (p_collection[p_it]);
			p = _tmp8_;
			{
				Block2Data* _data2_;
				gchar* panelpath = NULL;
				const gchar* _tmp9_;
				gchar* _tmp10_;
				const gchar* _tmp11_;
				gchar* _tmp12_;
				gchar* _tmp13_;
				const gchar* _tmp14_;
				GSettings* _tmp15_;
				GSettings* _tmp16_;
				GSettings* _tmp17_;
				gchar** _tmp18_;
				gchar** _tmp19_;
				gchar** _tmp20_;
				gint _tmp20__length1;
				_data2_ = g_slice_new0 (Block2Data);
				_data2_->_ref_count_ = 1;
				_data2_->_data1_ = block1_data_ref (_data1_);
				_tmp9_ = p;
				_tmp10_ = g_strconcat ("/com/solus-project/budgie-panel/panels/", "{", _tmp9_, "}/", NULL);
				panelpath = _tmp10_;
				_tmp11_ = general_path;
				_tmp12_ = g_strconcat (_tmp11_, ".panel", NULL);
				_tmp13_ = _tmp12_;
				_tmp14_ = panelpath;
				_tmp15_ = g_settings_new_with_path (_tmp13_, _tmp14_);
				_tmp16_ = _tmp15_;
				_g_free0 (_tmp13_);
				_data2_->currpanelsubject_settings = _tmp16_;
				_tmp17_ = _data2_->currpanelsubject_settings;
				_tmp19_ = _tmp18_ = g_settings_get_strv (_tmp17_, "applets");
				_data1_->applets = (_vala_array_free (_data1_->applets, _data1_->applets_length1, (GDestroyNotify) g_free), NULL);
				_data1_->applets = _tmp19_;
				_data1_->applets_length1 = _vala_array_length (_tmp18_);
				_data1_->_applets_size_ = _data1_->applets_length1;
				_tmp20_ = _data1_->applets;
				_tmp20__length1 = _data1_->applets_length1;
				if (desktop_weather_find_applet (self, _data1_->uuid, _tmp20_, (gint) _tmp20__length1)) {
					GSettings* _tmp21_;
					_tmp21_ = _data2_->currpanelsubject_settings;
					g_signal_connect_data (_tmp21_, "changed::applets", (GCallback) ______lambda4__g_settings_changed, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
					_g_free0 (panelpath);
					_g_free0 (p);
					block2_data_unref (_data2_);
					_data2_ = NULL;
					break;
				}
				_g_free0 (panelpath);
				_g_free0 (p);
				block2_data_unref (_data2_);
				_data2_ = NULL;
			}
		}
	}
	allpanels_list = (_vala_array_free (allpanels_list, allpanels_list_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (panel_settings);
	_g_free0 (general_path);
	block1_data_unref (_data1_);
	_data1_ = NULL;
}

static Block3Data*
block3_data_ref (Block3Data* _data3_)
{
	g_atomic_int_inc (&_data3_->_ref_count_);
	return _data3_;
}

static void
block3_data_unref (void * _userdata_)
{
	Block3Data* _data3_;
	_data3_ = (Block3Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
		DesktopWeather* self;
		self = _data3_->self;
		_g_free0 (_data3_->uuid);
		_g_object_unref0 (self);
		g_slice_free (Block3Data, _data3_);
	}
}

static gboolean
__lambda5_ (Block3Data* _data3_)
{
	DesktopWeather* self;
	gboolean result;
	self = _data3_->self;
	desktop_weather_watchapplet (self, _data3_->uuid);
	result = FALSE;
	return result;
}

static gboolean
___lambda5__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda5_ (self);
	return result;
}

static void
_desktop_weather_set_windowpos_g_settings_changed (GSettings* _sender,
                                                   const gchar* key,
                                                   gpointer self)
{
	desktop_weather_set_windowpos ((DesktopWeather*) self);
}

static void
__lambda6_ (DesktopWeather* self)
{
	gboolean newval = FALSE;
	GSettings* _tmp0_;
	_tmp0_ = self->priv->desktop_settings;
	newval = g_settings_get_boolean (_tmp0_, "desktopweather");
	if (newval == FALSE) {
		gtk_main_quit ();
	}
}

static void
___lambda6__g_settings_changed (GSettings* _sender,
                                const gchar* key,
                                gpointer self)
{
	__lambda6_ ((DesktopWeather*) self);
}

static void
__lambda7_ (DesktopWeather* self)
{
	desktop_weather_update_style (self);
}

static void
___lambda7__g_settings_changed (GSettings* _sender,
                                const gchar* key,
                                gpointer self)
{
	__lambda7_ ((DesktopWeather*) self);
}

static void
__lambda8_ (DesktopWeather* self)
{
	gint transparency = 0;
	GSettings* _tmp0_;
	_tmp0_ = self->priv->desktop_settings;
	transparency = 100 - g_settings_get_int (_tmp0_, "transparency");
	self->priv->new_transp = transparency / 100.0;
	gtk_widget_queue_draw ((GtkWidget*) self);
}

static void
___lambda8__g_settings_changed (GSettings* _sender,
                                const gchar* key,
                                gpointer self)
{
	__lambda8_ ((DesktopWeather*) self);
}

static void
__lambda9_ (DesktopWeather* self)
{
	gboolean newval = FALSE;
	GSettings* _tmp0_;
	_tmp0_ = self->priv->desktop_settings;
	newval = g_settings_get_boolean (_tmp0_, "desktopweather");
	if (newval == FALSE) {
		gtk_main_quit ();
	}
}

static void
___lambda9__g_settings_changed (GSettings* _sender,
                                const gchar* key,
                                gpointer self)
{
	__lambda9_ ((DesktopWeather*) self);
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static gboolean
_desktop_weather_on_draw_gtk_widget_draw (GtkWidget* _sender,
                                          cairo_t* cr,
                                          gpointer self)
{
	gboolean result;
	result = desktop_weather_on_draw ((DesktopWeather*) self, _sender, cr);
	return result;
}

static void
_desktop_weather_update_content_g_file_monitor_changed (GFileMonitor* _sender,
                                                        GFile* file,
                                                        GFile* other_file,
                                                        GFileMonitorEvent event_type,
                                                        gpointer self)
{
	desktop_weather_update_content ((DesktopWeather*) self);
}

DesktopWeather*
desktop_weather_construct (GType object_type,
                           const gchar* uuid)
{
	DesktopWeather * self = NULL;
	Block3Data* _data3_;
	gchar* _tmp0_;
	gchar* _tmp1_;
	GSettings* _tmp2_;
	GSettings* _tmp3_;
	GSettings* _tmp4_;
	GSettings* _tmp5_;
	GSettings* _tmp6_;
	GSettings* _tmp7_;
	GSettings* _tmp8_;
	gchar* _tmp9_;
	gint transparency = 0;
	GSettings* _tmp10_;
	GdkScreen* screen = NULL;
	GdkScreen* _tmp11_;
	GdkScreen* _tmp12_;
	GdkVisual* visual = NULL;
	GdkScreen* _tmp13_;
	GdkVisual* _tmp14_;
	GdkVisual* _tmp15_;
	GdkVisual* _tmp16_;
	const gchar* _tmp17_ = NULL;
	const gchar* _tmp18_;
	gchar* tmpdir = NULL;
	gchar* _tmp20_;
	gchar* src = NULL;
	gchar* _tmp21_;
	GFile* _tmp22_;
	GtkGrid* _tmp23_;
	GtkGrid* _tmp24_;
	GtkGrid* _tmp25_;
	GtkLabel* _tmp26_;
	GtkLabel* _tmp27_;
	GtkGrid* _tmp28_;
	GtkLabel* _tmp29_;
	GtkLabel* _tmp30_;
	GtkGrid* _tmp31_;
	GtkLabel* _tmp32_;
	GtkLabel* _tmp33_;
	GtkLabel* _tmp34_;
	GtkLabel* _tmp35_;
	GtkCssProvider* _tmp36_;
	const gchar* _tmp37_;
	GdkScreen* _tmp38_;
	GtkCssProvider* _tmp39_;
	GtkLabel* _tmp40_;
	GtkStyleContext* _tmp41_;
	GtkLabel* _tmp42_;
	GtkStyleContext* _tmp43_;
	GtkGrid* _tmp44_;
	GtkLabel* _tmp45_;
	GtkGrid* _tmp46_;
	GtkLabel* _tmp47_;
	GtkImage* _tmp48_;
	GtkGrid* _tmp49_;
	GtkImage* _tmp50_;
	GError* _inner_error0_ = NULL;
	g_return_val_if_fail (uuid != NULL, NULL);
	_data3_ = g_slice_new0 (Block3Data);
	_data3_->_ref_count_ = 1;
	_tmp0_ = g_strdup (uuid);
	_g_free0 (_data3_->uuid);
	_data3_->uuid = _tmp0_;
	self = (DesktopWeather*) g_object_new (object_type, NULL);
	_data3_->self = g_object_ref (self);
	g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 1, ___lambda5__gsource_func, block3_data_ref (_data3_), block3_data_unref);
	gtk_layer_init_for_window ((GtkWindow*) self);
	gtk_layer_set_layer ((GtkWindow*) self, GTK_LAYER_SHELL_LAYER_BOTTOM);
	gtk_window_set_decorated ((GtkWindow*) self, FALSE);
	gtk_window_set_type_hint ((GtkWindow*) self, GDK_WINDOW_TYPE_HINT_DESKTOP);
	self->priv->currscale = 1;
	desktop_weather_get_icondata (self);
	desktop_weather_check_res (self);
	_tmp1_ = g_strdup ("\n" \
"            .biglabel {\n" \
"                font-size: bigfontpx;\n" \
"                color: xxx-xxx-xxx;\n" \
"\n" \
"            }\n" \
"            .label {\n" \
"                font-size: smallfontpx;\n" \
"                color: xxx-xxx-xxx;\n" \
"            }\n" \
"            ");
	_g_free0 (self->priv->css_template);
	self->priv->css_template = _tmp1_;
	_tmp2_ = desktop_weather_get_settings (self, "org.ubuntubudgie.plugins.weathershow");
	_g_object_unref0 (self->priv->desktop_settings);
	self->priv->desktop_settings = _tmp2_;
	desktop_weather_set_windowpos (self);
	_tmp3_ = self->priv->desktop_settings;
	g_signal_connect_object (_tmp3_, "changed::xposition", (GCallback) _desktop_weather_set_windowpos_g_settings_changed, self, 0);
	_tmp4_ = self->priv->desktop_settings;
	g_signal_connect_object (_tmp4_, "changed::yposition", (GCallback) _desktop_weather_set_windowpos_g_settings_changed, self, 0);
	_tmp5_ = self->priv->desktop_settings;
	g_signal_connect_object (_tmp5_, "changed::desktopweather", (GCallback) ___lambda6__g_settings_changed, self, 0);
	_tmp6_ = self->priv->desktop_settings;
	g_signal_connect_object (_tmp6_, "changed::textcolor", (GCallback) ___lambda7__g_settings_changed, self, 0);
	_tmp7_ = self->priv->desktop_settings;
	g_signal_connect_object (_tmp7_, "changed::transparency", (GCallback) ___lambda8__g_settings_changed, self, 0);
	_tmp8_ = self->priv->desktop_settings;
	g_signal_connect_object (_tmp8_, "changed::desktopweather", (GCallback) ___lambda9__g_settings_changed, self, 0);
	_tmp9_ = desktop_weather_get_css (self);
	_g_free0 (self->priv->css_data);
	self->priv->css_data = _tmp9_;
	_tmp10_ = self->priv->desktop_settings;
	transparency = 100 - g_settings_get_int (_tmp10_, "transparency");
	self->priv->new_transp = transparency / 100.0;
	_tmp11_ = gtk_window_get_screen ((GtkWindow*) self);
	_tmp12_ = _g_object_ref0 (_tmp11_);
	screen = _tmp12_;
	gtk_widget_set_app_paintable ((GtkWidget*) self, TRUE);
	_tmp13_ = screen;
	_tmp14_ = gdk_screen_get_rgba_visual (_tmp13_);
	_tmp15_ = _g_object_ref0 (_tmp14_);
	visual = _tmp15_;
	_tmp16_ = visual;
	gtk_widget_set_visual ((GtkWidget*) self, _tmp16_);
	g_signal_connect_object ((GtkWidget*) self, "draw", (GCallback) _desktop_weather_on_draw_gtk_widget_draw, self, 0);
	_tmp18_ = g_getenv ("XDG_RUNTIME_DIR");
	_tmp17_ = _tmp18_;
	if (_tmp17_ == NULL) {
		const gchar* _tmp19_;
		_tmp19_ = g_getenv ("HOME");
		_tmp17_ = _tmp19_;
	}
	_tmp20_ = g_strdup (_tmp17_);
	tmpdir = _tmp20_;
	_tmp21_ = g_build_path (G_DIR_SEPARATOR_S, tmpdir, ".weatherdata", NULL);
	src = _tmp21_;
	_tmp22_ = g_file_new_for_path (src);
	_g_object_unref0 (self->priv->datasrc);
	self->priv->datasrc = _tmp22_;
	_tmp23_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp23_);
	_g_object_unref0 (self->priv->maingrid);
	self->priv->maingrid = _tmp23_;
	_tmp24_ = self->priv->maingrid;
	gtk_grid_set_column_spacing (_tmp24_, (guint) 20);
	_tmp25_ = self->priv->maingrid;
	_tmp26_ = (GtkLabel*) gtk_label_new (" ");
	g_object_ref_sink (_tmp26_);
	_tmp27_ = _tmp26_;
	gtk_grid_attach (_tmp25_, (GtkWidget*) _tmp27_, 0, 0, 1, 1);
	_g_object_unref0 (_tmp27_);
	_tmp28_ = self->priv->maingrid;
	_tmp29_ = (GtkLabel*) gtk_label_new (" ");
	g_object_ref_sink (_tmp29_);
	_tmp30_ = _tmp29_;
	gtk_grid_attach (_tmp28_, (GtkWidget*) _tmp30_, 10, 10, 1, 1);
	_g_object_unref0 (_tmp30_);
	_tmp31_ = self->priv->maingrid;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp31_);
	_tmp32_ = (GtkLabel*) gtk_label_new ("");
	g_object_ref_sink (_tmp32_);
	_g_object_unref0 (self->priv->locationlabel);
	self->priv->locationlabel = _tmp32_;
	_tmp33_ = (GtkLabel*) gtk_label_new ("");
	g_object_ref_sink (_tmp33_);
	_g_object_unref0 (self->priv->weatherlabel);
	self->priv->weatherlabel = _tmp33_;
	_tmp34_ = self->priv->weatherlabel;
	gtk_label_set_xalign (_tmp34_, (gfloat) 0);
	_tmp35_ = self->priv->locationlabel;
	gtk_label_set_xalign (_tmp35_, (gfloat) 0);
	_tmp36_ = gtk_css_provider_new ();
	_g_object_unref0 (self->priv->css_provider);
	self->priv->css_provider = _tmp36_;
	_tmp37_ = self->priv->css_data;
	desktop_weather_load_css (self, _tmp37_);
	_tmp38_ = screen;
	_tmp39_ = self->priv->css_provider;
	gtk_style_context_add_provider_for_screen (_tmp38_, (GtkStyleProvider*) _tmp39_, (guint) GTK_STYLE_PROVIDER_PRIORITY_USER);
	_tmp40_ = self->priv->weatherlabel;
	_tmp41_ = gtk_widget_get_style_context ((GtkWidget*) _tmp40_);
	gtk_style_context_add_class (_tmp41_, "label");
	_tmp42_ = self->priv->locationlabel;
	_tmp43_ = gtk_widget_get_style_context ((GtkWidget*) _tmp42_);
	gtk_style_context_add_class (_tmp43_, "biglabel");
	_tmp44_ = self->priv->maingrid;
	_tmp45_ = self->priv->locationlabel;
	gtk_grid_attach (_tmp44_, (GtkWidget*) _tmp45_, 2, 1, 1, 1);
	_tmp46_ = self->priv->maingrid;
	_tmp47_ = self->priv->weatherlabel;
	gtk_grid_attach (_tmp46_, (GtkWidget*) _tmp47_, 2, 2, 1, 1);
	_tmp48_ = (GtkImage*) gtk_image_new ();
	g_object_ref_sink (_tmp48_);
	_g_object_unref0 (self->priv->weather_image);
	self->priv->weather_image = _tmp48_;
	_tmp49_ = self->priv->maingrid;
	_tmp50_ = self->priv->weather_image;
	gtk_grid_attach (_tmp49_, (GtkWidget*) _tmp50_, 1, 1, 1, 5);
	{
		GFileMonitor* _tmp51_ = NULL;
		GFile* _tmp52_;
		GFileMonitor* _tmp53_;
		GFileMonitor* _tmp54_;
		GFileMonitor* _tmp55_;
		_tmp52_ = self->priv->datasrc;
		_tmp53_ = g_file_monitor (_tmp52_, G_FILE_MONITOR_NONE, NULL, &_inner_error0_);
		_tmp51_ = _tmp53_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp54_ = _tmp51_;
		_tmp51_ = NULL;
		_g_object_unref0 (self->priv->monitor);
		self->priv->monitor = _tmp54_;
		_tmp55_ = self->priv->monitor;
		g_signal_connect_object (_tmp55_, "changed", (GCallback) _desktop_weather_update_content_g_file_monitor_changed, self, 0);
		_g_object_unref0 (_tmp51_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
		g_print ("Error setting up monitor\n");
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (src);
		_g_free0 (tmpdir);
		_g_object_unref0 (visual);
		_g_object_unref0 (screen);
		block3_data_unref (_data3_);
		_data3_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	desktop_weather_update_content (self);
	_g_free0 (src);
	_g_free0 (tmpdir);
	_g_object_unref0 (visual);
	_g_object_unref0 (screen);
	block3_data_unref (_data3_);
	_data3_ = NULL;
	return self;
}

DesktopWeather*
desktop_weather_new (const gchar* uuid)
{
	return desktop_weather_construct (TYPE_DESKTOP_WEATHER, uuid);
}

static gboolean
desktop_weather_on_draw (DesktopWeather* self,
                         GtkWidget* da,
                         cairo_t* ctx)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (da != NULL, FALSE);
	g_return_val_if_fail (ctx != NULL, FALSE);
	cairo_set_source_rgba (ctx, (gdouble) 0, (gdouble) 0, (gdouble) 0, self->priv->new_transp);
	cairo_set_operator (ctx, CAIRO_OPERATOR_SOURCE);
	cairo_paint (ctx);
	cairo_set_operator (ctx, CAIRO_OPERATOR_OVER);
	result = FALSE;
	return result;
}

static void
desktop_weather_check_res (DesktopWeather* self)
{
	XfwMonitor* prim = NULL;
	XfwScreen* _tmp0_;
	XfwScreen* _tmp1_;
	XfwMonitor* _tmp2_;
	XfwMonitor* _tmp3_;
	XfwMonitor* _tmp4_;
	GdkRectangle geo = {0};
	XfwMonitor* _tmp5_;
	GdkRectangle _tmp6_ = {0};
	gint height = 0;
	GdkRectangle _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = xfw_screen_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = xfw_screen_get_primary_monitor (_tmp1_);
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_tmp4_ = _tmp3_;
	_g_object_unref0 (_tmp1_);
	prim = _tmp4_;
	_tmp5_ = prim;
	xfw_monitor_get_physical_geometry (_tmp5_, &_tmp6_);
	geo = _tmp6_;
	_tmp7_ = geo;
	height = _tmp7_.height;
	if (height < 1100) {
		self->priv->currscale = 1;
	} else {
		if (height < 1600) {
			self->priv->currscale = 2;
		} else {
			self->priv->currscale = 3;
		}
	}
	_g_object_unref0 (prim);
}

static void
desktop_weather_set_windowpos (DesktopWeather* self)
{
	XfwMonitor* prim = NULL;
	XfwScreen* _tmp0_;
	XfwScreen* _tmp1_;
	XfwMonitor* _tmp2_;
	XfwMonitor* _tmp3_;
	XfwMonitor* _tmp4_;
	gint currscale = 0;
	gint xpos = 0;
	GSettings* _tmp5_;
	gint ypos = 0;
	GSettings* _tmp6_;
	GdkMonitor* _tmp7_;
	GdkMonitor* _tmp8_;
	GdkMonitor* _tmp9_;
	g_return_if_fail (self != NULL);
	_tmp0_ = xfw_screen_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = xfw_screen_get_primary_monitor (_tmp1_);
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_tmp4_ = _tmp3_;
	_g_object_unref0 (_tmp1_);
	prim = _tmp4_;
	currscale = (gint) xfw_monitor_get_scale (prim);
	_tmp5_ = self->priv->desktop_settings;
	xpos = g_settings_get_int (_tmp5_, "xposition") / currscale;
	_tmp6_ = self->priv->desktop_settings;
	ypos = g_settings_get_int (_tmp6_, "yposition") / currscale;
	g_object_get (prim, "gdk-monitor", &_tmp7_, NULL);
	_tmp8_ = _tmp7_;
	_tmp9_ = _tmp8_;
	gtk_layer_set_monitor ((GtkWindow*) self, _tmp9_);
	_g_object_unref0 (_tmp9_);
	gtk_layer_set_margin ((GtkWindow*) self, GTK_LAYER_SHELL_EDGE_LEFT, xpos);
	gtk_layer_set_margin ((GtkWindow*) self, GTK_LAYER_SHELL_EDGE_TOP, ypos);
	gtk_layer_set_anchor ((GtkWindow*) self, GTK_LAYER_SHELL_EDGE_LEFT, TRUE);
	gtk_layer_set_anchor ((GtkWindow*) self, GTK_LAYER_SHELL_EDGE_TOP, TRUE);
	_g_object_unref0 (prim);
}

static GSettings*
desktop_weather_get_settings (DesktopWeather* self,
                              const gchar* path)
{
	GSettings* settings = NULL;
	GSettings* _tmp0_;
	GSettings* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (path != NULL, NULL);
	_tmp0_ = g_settings_new (path);
	settings = _tmp0_;
	result = settings;
	return result;
}

static gchar*
string_replace (const gchar* self,
                const gchar* old,
                const gchar* replacement)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (replacement != NULL, NULL);
	if ((*((gchar*) self)) == '\0') {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = (*((gchar*) old)) == '\0';
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = g_strcmp0 (old, replacement) == 0;
	}
	if (_tmp0_) {
		gchar* _tmp2_;
		_tmp2_ = g_strdup (self);
		result = _tmp2_;
		return result;
	}
	{
		GRegex* regex = NULL;
		gchar* _tmp3_;
		gchar* _tmp4_;
		GRegex* _tmp5_;
		GRegex* _tmp6_;
		gchar* _tmp7_ = NULL;
		GRegex* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		_tmp3_ = g_regex_escape_string (old, -1);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_regex_new (_tmp4_, 0, 0, &_inner_error0_);
		_tmp6_ = _tmp5_;
		_g_free0 (_tmp4_);
		regex = _tmp6_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp8_ = regex;
		_tmp9_ = g_regex_replace_literal (_tmp8_, self, (gssize) -1, 0, replacement, 0, &_inner_error0_);
		_tmp7_ = _tmp9_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_regex_unref0 (regex);
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp10_ = _tmp7_;
		_tmp7_ = NULL;
		result = _tmp10_;
		_g_free0 (_tmp7_);
		_g_regex_unref0 (regex);
		return result;
	}
	goto __finally0;
	__catch0_g_regex_error:
	{
		g_clear_error (&_inner_error0_);
		g_assert_not_reached ();
	}
	__finally0:
	g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
	g_clear_error (&_inner_error0_);
	return NULL;
}

static gchar*
_vala_g_strjoinv (const gchar* separator,
                  gchar** str_array,
                  gint str_array_length1)
{
	gboolean _tmp0_ = FALSE;
	gchar* result;
	if (separator == NULL) {
		separator = "";
	}
	if (str_array != NULL) {
		gboolean _tmp1_ = FALSE;
		if (str_array_length1 > 0) {
			_tmp1_ = TRUE;
		} else {
			gboolean _tmp2_ = FALSE;
			if (str_array_length1 == -1) {
				const gchar* _tmp3_;
				_tmp3_ = str_array[0];
				_tmp2_ = _tmp3_ != NULL;
			} else {
				_tmp2_ = FALSE;
			}
			_tmp1_ = _tmp2_;
		}
		_tmp0_ = _tmp1_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gint i = 0;
		gsize len = 0UL;
		gint _tmp16_;
		gint _tmp17_;
		const gchar* res = NULL;
		void* _tmp18_;
		const gchar* _tmp19_ = NULL;
		const gchar* _tmp20_;
		void* ptr = NULL;
		const gchar* _tmp22_;
		void* _tmp23_;
		const gchar* _tmp33_;
		len = (gsize) 1;
		{
			gboolean _tmp4_ = FALSE;
			i = 0;
			_tmp4_ = TRUE;
			while (TRUE) {
				gboolean _tmp6_ = FALSE;
				gboolean _tmp7_ = FALSE;
				gint _tmp10_ = 0;
				const gchar* _tmp11_;
				if (!_tmp4_) {
					gint _tmp5_;
					_tmp5_ = i;
					i = _tmp5_ + 1;
				}
				_tmp4_ = FALSE;
				if (str_array_length1 != -1) {
					_tmp7_ = i < str_array_length1;
				} else {
					_tmp7_ = FALSE;
				}
				if (_tmp7_) {
					_tmp6_ = TRUE;
				} else {
					gboolean _tmp8_ = FALSE;
					if (str_array_length1 == -1) {
						const gchar* _tmp9_;
						_tmp9_ = str_array[i];
						_tmp8_ = _tmp9_ != NULL;
					} else {
						_tmp8_ = FALSE;
					}
					_tmp6_ = _tmp8_;
				}
				if (!_tmp6_) {
					break;
				}
				_tmp11_ = str_array[i];
				if (_tmp11_ != NULL) {
					const gchar* _tmp12_;
					gint _tmp13_;
					gint _tmp14_;
					_tmp12_ = str_array[i];
					_tmp13_ = strlen ((const gchar*) _tmp12_);
					_tmp14_ = _tmp13_;
					_tmp10_ = _tmp14_;
				} else {
					_tmp10_ = 0;
				}
				len += (gsize) _tmp10_;
			}
		}
		if (i == 0) {
			gchar* _tmp15_;
			_tmp15_ = g_strdup ("");
			result = _tmp15_;
			return result;
		}
		str_array_length1 = i;
		_tmp16_ = strlen ((const gchar*) separator);
		_tmp17_ = _tmp16_;
		len += (gsize) (_tmp17_ * (i - 1));
		_tmp18_ = g_malloc (len);
		res = _tmp18_;
		_tmp20_ = str_array[0];
		if (_tmp20_ != NULL) {
			const gchar* _tmp21_;
			_tmp21_ = str_array[0];
			_tmp19_ = (const gchar*) _tmp21_;
		} else {
			_tmp19_ = "";
		}
		_tmp22_ = res;
		_tmp23_ = g_stpcpy ((void*) _tmp22_, _tmp19_);
		ptr = _tmp23_;
		{
			gboolean _tmp24_ = FALSE;
			i = 1;
			_tmp24_ = TRUE;
			while (TRUE) {
				void* _tmp26_;
				void* _tmp27_;
				const gchar* _tmp28_ = NULL;
				const gchar* _tmp29_;
				void* _tmp31_;
				void* _tmp32_;
				if (!_tmp24_) {
					gint _tmp25_;
					_tmp25_ = i;
					i = _tmp25_ + 1;
				}
				_tmp24_ = FALSE;
				if (!(i < str_array_length1)) {
					break;
				}
				_tmp26_ = ptr;
				_tmp27_ = g_stpcpy (_tmp26_, (const gchar*) separator);
				ptr = _tmp27_;
				_tmp29_ = str_array[i];
				if (_tmp29_ != NULL) {
					const gchar* _tmp30_;
					_tmp30_ = str_array[i];
					_tmp28_ = (const gchar*) _tmp30_;
				} else {
					_tmp28_ = "";
				}
				_tmp31_ = ptr;
				_tmp32_ = g_stpcpy (_tmp31_, _tmp28_);
				ptr = _tmp32_;
			}
		}
		_tmp33_ = res;
		res = NULL;
		result = (gchar*) _tmp33_;
		return result;
	} else {
		gchar* _tmp34_;
		_tmp34_ = g_strdup ("");
		result = _tmp34_;
		return result;
	}
}

static gchar*
desktop_weather_get_css (DesktopWeather* self)
{
	gchar** currcolor = NULL;
	GSettings* _tmp0_;
	gchar** _tmp1_;
	gchar** _tmp2_;
	gint currcolor_length1;
	gint _currcolor_size_;
	gchar* temp_css = NULL;
	const gchar* _tmp3_;
	gchar** _tmp4_;
	gint _tmp4__length1;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* bigfont = NULL;
	gchar* _tmp11_;
	gchar* smallfont = NULL;
	gchar* _tmp12_;
	const gchar* _tmp19_;
	const gchar* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	const gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->desktop_settings;
	_tmp2_ = _tmp1_ = g_settings_get_strv (_tmp0_, "textcolor");
	currcolor = _tmp2_;
	currcolor_length1 = _vala_array_length (_tmp1_);
	_currcolor_size_ = currcolor_length1;
	_tmp3_ = self->priv->css_template;
	_tmp4_ = currcolor;
	_tmp4__length1 = currcolor_length1;
	_tmp5_ = _vala_g_strjoinv (", ", _tmp4_, (gint) _tmp4__length1);
	_tmp6_ = _tmp5_;
	_tmp7_ = g_strconcat ("rgb(", _tmp6_, ")", NULL);
	_tmp8_ = _tmp7_;
	_tmp9_ = string_replace (_tmp3_, "xxx-xxx-xxx", _tmp8_);
	_tmp10_ = _tmp9_;
	_g_free0 (_tmp8_);
	_g_free0 (_tmp6_);
	temp_css = _tmp10_;
	_tmp11_ = g_strdup ("20");
	bigfont = _tmp11_;
	_tmp12_ = g_strdup ("15");
	smallfont = _tmp12_;
	switch (self->priv->currscale) {
		case 1:
		{
			gchar* _tmp13_;
			gchar* _tmp14_;
			_tmp13_ = g_strdup ("25");
			_g_free0 (bigfont);
			bigfont = _tmp13_;
			_tmp14_ = g_strdup ("17");
			_g_free0 (smallfont);
			smallfont = _tmp14_;
			break;
		}
		case 2:
		{
			gchar* _tmp15_;
			gchar* _tmp16_;
			_tmp15_ = g_strdup ("37");
			_g_free0 (bigfont);
			bigfont = _tmp15_;
			_tmp16_ = g_strdup ("22");
			_g_free0 (smallfont);
			smallfont = _tmp16_;
			break;
		}
		case 3:
		{
			gchar* _tmp17_;
			gchar* _tmp18_;
			_tmp17_ = g_strdup ("50");
			_g_free0 (bigfont);
			bigfont = _tmp17_;
			_tmp18_ = g_strdup ("32");
			_g_free0 (smallfont);
			smallfont = _tmp18_;
			break;
		}
		default:
		break;
	}
	_tmp19_ = temp_css;
	_tmp20_ = bigfont;
	_tmp21_ = string_replace (_tmp19_, "bigfont", _tmp20_);
	_tmp22_ = _tmp21_;
	_tmp23_ = smallfont;
	_tmp24_ = string_replace (_tmp22_, "smallfont", _tmp23_);
	_tmp25_ = _tmp24_;
	_g_free0 (_tmp22_);
	result = _tmp25_;
	_g_free0 (smallfont);
	_g_free0 (bigfont);
	_g_free0 (temp_css);
	currcolor = (_vala_array_free (currcolor, currcolor_length1, (GDestroyNotify) g_free), NULL);
	return result;
}

static gint
desktop_weather_get_stringindex (DesktopWeather* self,
                                 const gchar* s,
                                 gchar** arr,
                                 gint arr_length1)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	g_return_val_if_fail (s != NULL, -1);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				const gchar* _tmp2_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				if (!(i < arr_length1)) {
					break;
				}
				_tmp2_ = arr[i];
				if (g_strcmp0 (s, _tmp2_) == 0) {
					result = i;
					return result;
				}
			}
		}
	}
	result = -1;
	return result;
}

static GdkPixbuf**
_vala_array_dup1 (GdkPixbuf** self,
                  gssize length)
{
	if (length >= 0) {
		GdkPixbuf** result;
		gssize i;
		result = g_new0 (GdkPixbuf*, length + 1);
		for (i = 0; i < length; i++) {
			GdkPixbuf* _tmp0_;
			_tmp0_ = _g_object_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static GdkPixbuf**
_vala_array_dup2 (GdkPixbuf** self,
                  gssize length)
{
	if (length >= 0) {
		GdkPixbuf** result;
		gssize i;
		result = g_new0 (GdkPixbuf*, length + 1);
		for (i = 0; i < length; i++) {
			GdkPixbuf* _tmp0_;
			_tmp0_ = _g_object_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static GdkPixbuf**
_vala_array_dup3 (GdkPixbuf** self,
                  gssize length)
{
	if (length >= 0) {
		GdkPixbuf** result;
		gssize i;
		result = g_new0 (GdkPixbuf*, length + 1);
		for (i = 0; i < length; i++) {
			GdkPixbuf* _tmp0_;
			_tmp0_ = _g_object_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static void
_vala_array_add1 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	return result;
}

static void
desktop_weather_update_content (DesktopWeather* self)
{
	GdkPixbuf** currimages = NULL;
	GdkPixbuf** _tmp0_;
	gint currimages_length1;
	gint _currimages_size_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_new0 (GdkPixbuf*, 0 + 1);
	currimages = _tmp0_;
	currimages_length1 = 0;
	_currimages_size_ = currimages_length1;
	switch (self->priv->currscale) {
		case 1:
		{
			GdkPixbuf** _tmp1_;
			gint _tmp1__length1;
			GdkPixbuf** _tmp2_;
			gint _tmp2__length1;
			_tmp1_ = self->priv->iconpixbufs_1;
			_tmp1__length1 = self->priv->iconpixbufs_1_length1;
			_tmp2_ = (_tmp1_ != NULL) ? _vala_array_dup1 (_tmp1_, _tmp1__length1) : _tmp1_;
			_tmp2__length1 = _tmp1__length1;
			currimages = (_vala_array_free (currimages, currimages_length1, (GDestroyNotify) g_object_unref), NULL);
			currimages = _tmp2_;
			currimages_length1 = _tmp2__length1;
			_currimages_size_ = currimages_length1;
			break;
		}
		case 2:
		{
			GdkPixbuf** _tmp3_;
			gint _tmp3__length1;
			GdkPixbuf** _tmp4_;
			gint _tmp4__length1;
			_tmp3_ = self->priv->iconpixbufs_2;
			_tmp3__length1 = self->priv->iconpixbufs_2_length1;
			_tmp4_ = (_tmp3_ != NULL) ? _vala_array_dup2 (_tmp3_, _tmp3__length1) : _tmp3_;
			_tmp4__length1 = _tmp3__length1;
			currimages = (_vala_array_free (currimages, currimages_length1, (GDestroyNotify) g_object_unref), NULL);
			currimages = _tmp4_;
			currimages_length1 = _tmp4__length1;
			_currimages_size_ = currimages_length1;
			break;
		}
		case 3:
		{
			GdkPixbuf** _tmp5_;
			gint _tmp5__length1;
			GdkPixbuf** _tmp6_;
			gint _tmp6__length1;
			_tmp5_ = self->priv->iconpixbufs_3;
			_tmp5__length1 = self->priv->iconpixbufs_3_length1;
			_tmp6_ = (_tmp5_ != NULL) ? _vala_array_dup3 (_tmp5_, _tmp5__length1) : _tmp5_;
			_tmp6__length1 = _tmp5__length1;
			currimages = (_vala_array_free (currimages, currimages_length1, (GDestroyNotify) g_object_unref), NULL);
			currimages = _tmp6_;
			currimages_length1 = _tmp6__length1;
			_currimages_size_ = currimages_length1;
			break;
		}
		default:
		break;
	}
	{
		GFileInputStream* _tmp7_ = NULL;
		GFile* _tmp8_;
		GFileInputStream* _tmp9_;
		GDataInputStream* dis = NULL;
		GDataInputStream* _tmp10_;
		gchar* line = NULL;
		gchar** weatherlines = NULL;
		gchar** _tmp11_;
		gint weatherlines_length1;
		gint _weatherlines_size_;
		gint len_content = 0;
		gchar** _tmp19_;
		gint _tmp19__length1;
		_tmp8_ = self->priv->datasrc;
		_tmp9_ = g_file_read (_tmp8_, NULL, &_inner_error0_);
		_tmp7_ = _tmp9_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp10_ = g_data_input_stream_new ((GInputStream*) _tmp7_);
		dis = _tmp10_;
		_tmp11_ = g_new0 (gchar*, 0 + 1);
		weatherlines = _tmp11_;
		weatherlines_length1 = 0;
		_weatherlines_size_ = weatherlines_length1;
		while (TRUE) {
			gchar* _tmp12_ = NULL;
			GDataInputStream* _tmp13_;
			gchar* _tmp14_;
			gchar* _tmp15_;
			const gchar* _tmp16_;
			const gchar* _tmp17_;
			gchar* _tmp18_;
			_tmp13_ = dis;
			_tmp14_ = g_data_input_stream_read_line (_tmp13_, NULL, NULL, &_inner_error0_);
			_tmp12_ = _tmp14_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				weatherlines = (_vala_array_free (weatherlines, weatherlines_length1, (GDestroyNotify) g_free), NULL);
				_g_free0 (line);
				_g_object_unref0 (dis);
				_g_object_unref0 (_tmp7_);
				goto __catch0_g_error;
			}
			_tmp15_ = _tmp12_;
			_tmp12_ = NULL;
			_g_free0 (line);
			line = _tmp15_;
			_tmp16_ = line;
			if (!(_tmp16_ != NULL)) {
				_g_free0 (_tmp12_);
				break;
			}
			_tmp17_ = line;
			_tmp18_ = g_strdup (_tmp17_);
			_vala_array_add1 (&weatherlines, &weatherlines_length1, &_weatherlines_size_, _tmp18_);
			_g_free0 (_tmp12_);
		}
		_tmp19_ = weatherlines;
		_tmp19__length1 = weatherlines_length1;
		len_content = _tmp19__length1;
		if (len_content != 0) {
			gchar* newicon = NULL;
			gchar** _tmp20_;
			gint _tmp20__length1;
			const gchar* _tmp21_;
			gchar* _tmp22_;
			gchar* _tmp23_;
			gchar** _tmp24_;
			gint _tmp24__length1;
			const gchar* _tmp25_;
			gchar* _tmp26_;
			gchar* _tmp27_;
			gint ic_index = 0;
			const gchar* _tmp28_;
			gchar** _tmp29_;
			gint _tmp29__length1;
			gboolean _tmp30_ = FALSE;
			GtkImage* _tmp33_;
			GdkPixbuf** _tmp34_;
			gint _tmp34__length1;
			GdkPixbuf* _tmp35_;
			gint n_lines = 0;
			gchar** _tmp36_;
			gint _tmp36__length1;
			gchar* weathersection = NULL;
			gchar** _tmp37_;
			gint _tmp37__length1;
			gchar* _tmp38_;
			GtkLabel* _tmp39_;
			gchar** _tmp40_;
			gint _tmp40__length1;
			const gchar* _tmp41_;
			gchar* _tmp42_;
			gchar* _tmp43_;
			GtkLabel* _tmp44_;
			const gchar* _tmp45_;
			_tmp20_ = weatherlines;
			_tmp20__length1 = weatherlines_length1;
			_tmp21_ = _tmp20_[0];
			_tmp22_ = desktop_weather_find_mappedid (self, _tmp21_);
			_tmp23_ = _tmp22_;
			_tmp24_ = weatherlines;
			_tmp24__length1 = weatherlines_length1;
			_tmp25_ = _tmp24_[1];
			_tmp26_ = g_strconcat (_tmp23_, _tmp25_, NULL);
			_tmp27_ = _tmp26_;
			_g_free0 (_tmp23_);
			newicon = _tmp27_;
			_tmp28_ = newicon;
			_tmp29_ = self->priv->iconnames;
			_tmp29__length1 = self->priv->iconnames_length1;
			ic_index = desktop_weather_get_stringindex (self, _tmp28_, _tmp29_, (gint) _tmp29__length1);
			if (ic_index < 0) {
				_tmp30_ = TRUE;
			} else {
				GdkPixbuf** _tmp31_;
				gint _tmp31__length1;
				_tmp31_ = currimages;
				_tmp31__length1 = currimages_length1;
				_tmp30_ = ic_index > (_tmp31__length1 - 1);
			}
			if (_tmp30_) {
				gchar** _tmp32_;
				gint _tmp32__length1;
				_tmp32_ = self->priv->iconnames;
				_tmp32__length1 = self->priv->iconnames_length1;
				ic_index = desktop_weather_get_stringindex (self, "erro", _tmp32_, (gint) _tmp32__length1);
			}
			_tmp33_ = self->priv->weather_image;
			_tmp34_ = currimages;
			_tmp34__length1 = currimages_length1;
			_tmp35_ = _tmp34_[ic_index];
			gtk_image_set_from_pixbuf (_tmp33_, _tmp35_);
			_tmp36_ = weatherlines;
			_tmp36__length1 = weatherlines_length1;
			n_lines = _tmp36__length1;
			_tmp37_ = weatherlines;
			_tmp37__length1 = weatherlines_length1;
			_tmp38_ = _vala_g_strjoinv ("\n", _tmp37_ + 3, (gint) (n_lines - 3));
			weathersection = _tmp38_;
			_tmp39_ = self->priv->locationlabel;
			_tmp40_ = weatherlines;
			_tmp40__length1 = weatherlines_length1;
			_tmp41_ = _tmp40_[2];
			_tmp42_ = string_strip (_tmp41_);
			_tmp43_ = _tmp42_;
			gtk_label_set_label (_tmp39_, _tmp43_);
			_g_free0 (_tmp43_);
			_tmp44_ = self->priv->weatherlabel;
			_tmp45_ = weathersection;
			gtk_label_set_label (_tmp44_, _tmp45_);
			_g_free0 (weathersection);
			_g_free0 (newicon);
		}
		weatherlines = (_vala_array_free (weatherlines, weatherlines_length1, (GDestroyNotify) g_free), NULL);
		_g_free0 (line);
		_g_object_unref0 (dis);
		_g_object_unref0 (_tmp7_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		currimages = (_vala_array_free (currimages, currimages_length1, (GDestroyNotify) g_object_unref), NULL);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	currimages = (_vala_array_free (currimages, currimages_length1, (GDestroyNotify) g_object_unref), NULL);
}

static void
desktop_weather_load_css (DesktopWeather* self,
                          const gchar* css_data)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (css_data != NULL);
	{
		GtkCssProvider* _tmp0_;
		_tmp0_ = self->priv->css_provider;
		gtk_css_provider_load_from_data (_tmp0_, css_data, (gssize) -1, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
		g_print ("Error loading css\n");
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
desktop_weather_update_style (DesktopWeather* self)
{
	gchar* _tmp0_;
	GtkLabel* _tmp1_;
	GtkStyleContext* _tmp2_;
	GtkLabel* _tmp3_;
	GtkStyleContext* _tmp4_;
	const gchar* _tmp5_;
	GtkLabel* _tmp6_;
	GtkStyleContext* _tmp7_;
	GtkLabel* _tmp8_;
	GtkStyleContext* _tmp9_;
	g_return_if_fail (self != NULL);
	_tmp0_ = desktop_weather_get_css (self);
	_g_free0 (self->priv->css_data);
	self->priv->css_data = _tmp0_;
	_tmp1_ = self->priv->weatherlabel;
	_tmp2_ = gtk_widget_get_style_context ((GtkWidget*) _tmp1_);
	gtk_style_context_remove_class (_tmp2_, "label");
	_tmp3_ = self->priv->locationlabel;
	_tmp4_ = gtk_widget_get_style_context ((GtkWidget*) _tmp3_);
	gtk_style_context_remove_class (_tmp4_, "biglabel");
	_tmp5_ = self->priv->css_data;
	desktop_weather_load_css (self, _tmp5_);
	_tmp6_ = self->priv->locationlabel;
	_tmp7_ = gtk_widget_get_style_context ((GtkWidget*) _tmp6_);
	gtk_style_context_add_class (_tmp7_, "biglabel");
	_tmp8_ = self->priv->weatherlabel;
	_tmp9_ = gtk_widget_get_style_context ((GtkWidget*) _tmp8_);
	gtk_style_context_add_class (_tmp9_, "label");
}

static gchar*
desktop_weather_find_mappedid (DesktopWeather* self,
                               const gchar* icon_id)
{
	gchar** replacements = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	gchar* _tmp26_;
	gchar* _tmp27_;
	gchar* _tmp28_;
	gchar* _tmp29_;
	gchar* _tmp30_;
	gchar* _tmp31_;
	gchar* _tmp32_;
	gchar* _tmp33_;
	gchar* _tmp34_;
	gchar* _tmp35_;
	gchar* _tmp36_;
	gchar* _tmp37_;
	gchar* _tmp38_;
	gchar* _tmp39_;
	gchar* _tmp40_;
	gchar* _tmp41_;
	gchar** _tmp42_;
	gint replacements_length1;
	gint replacements_length2;
	gint lenrep = 0;
	gchar** _tmp43_;
	gint _tmp43__length1;
	gint _tmp43__length2;
	gint _tmp44_;
	gchar* _tmp52_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup ("221");
	_tmp1_ = g_strdup ("212");
	_tmp2_ = g_strdup ("231");
	_tmp3_ = g_strdup ("230");
	_tmp4_ = g_strdup ("232");
	_tmp5_ = g_strdup ("230");
	_tmp6_ = g_strdup ("301");
	_tmp7_ = g_strdup ("300");
	_tmp8_ = g_strdup ("302");
	_tmp9_ = g_strdup ("300");
	_tmp10_ = g_strdup ("310");
	_tmp11_ = g_strdup ("300");
	_tmp12_ = g_strdup ("312");
	_tmp13_ = g_strdup ("311");
	_tmp14_ = g_strdup ("314");
	_tmp15_ = g_strdup ("313");
	_tmp16_ = g_strdup ("502");
	_tmp17_ = g_strdup ("501");
	_tmp18_ = g_strdup ("503");
	_tmp19_ = g_strdup ("501");
	_tmp20_ = g_strdup ("504");
	_tmp21_ = g_strdup ("501");
	_tmp22_ = g_strdup ("522");
	_tmp23_ = g_strdup ("521");
	_tmp24_ = g_strdup ("531");
	_tmp25_ = g_strdup ("521");
	_tmp26_ = g_strdup ("622");
	_tmp27_ = g_strdup ("621");
	_tmp28_ = g_strdup ("711");
	_tmp29_ = g_strdup ("701");
	_tmp30_ = g_strdup ("721");
	_tmp31_ = g_strdup ("701");
	_tmp32_ = g_strdup ("731");
	_tmp33_ = g_strdup ("701");
	_tmp34_ = g_strdup ("741");
	_tmp35_ = g_strdup ("701");
	_tmp36_ = g_strdup ("751");
	_tmp37_ = g_strdup ("701");
	_tmp38_ = g_strdup ("761");
	_tmp39_ = g_strdup ("701");
	_tmp40_ = g_strdup ("762");
	_tmp41_ = g_strdup ("701");
	_tmp42_ = g_new0 (gchar*, (21 * 2) + 1);
	_tmp42_[0] = _tmp0_;
	_tmp42_[1] = _tmp1_;
	_tmp42_[2] = _tmp2_;
	_tmp42_[3] = _tmp3_;
	_tmp42_[4] = _tmp4_;
	_tmp42_[5] = _tmp5_;
	_tmp42_[6] = _tmp6_;
	_tmp42_[7] = _tmp7_;
	_tmp42_[8] = _tmp8_;
	_tmp42_[9] = _tmp9_;
	_tmp42_[10] = _tmp10_;
	_tmp42_[11] = _tmp11_;
	_tmp42_[12] = _tmp12_;
	_tmp42_[13] = _tmp13_;
	_tmp42_[14] = _tmp14_;
	_tmp42_[15] = _tmp15_;
	_tmp42_[16] = _tmp16_;
	_tmp42_[17] = _tmp17_;
	_tmp42_[18] = _tmp18_;
	_tmp42_[19] = _tmp19_;
	_tmp42_[20] = _tmp20_;
	_tmp42_[21] = _tmp21_;
	_tmp42_[22] = _tmp22_;
	_tmp42_[23] = _tmp23_;
	_tmp42_[24] = _tmp24_;
	_tmp42_[25] = _tmp25_;
	_tmp42_[26] = _tmp26_;
	_tmp42_[27] = _tmp27_;
	_tmp42_[28] = _tmp28_;
	_tmp42_[29] = _tmp29_;
	_tmp42_[30] = _tmp30_;
	_tmp42_[31] = _tmp31_;
	_tmp42_[32] = _tmp32_;
	_tmp42_[33] = _tmp33_;
	_tmp42_[34] = _tmp34_;
	_tmp42_[35] = _tmp35_;
	_tmp42_[36] = _tmp36_;
	_tmp42_[37] = _tmp37_;
	_tmp42_[38] = _tmp38_;
	_tmp42_[39] = _tmp39_;
	_tmp42_[40] = _tmp40_;
	_tmp42_[41] = _tmp41_;
	replacements = _tmp42_;
	replacements_length1 = 21;
	replacements_length2 = 2;
	_tmp43_ = replacements;
	_tmp43__length1 = replacements_length1;
	_tmp43__length2 = replacements_length2;
	_tmp44_ = _tmp43__length1;
	lenrep = _tmp44_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp45_ = FALSE;
			_tmp45_ = TRUE;
			while (TRUE) {
				gchar** _tmp47_;
				gint _tmp47__length1;
				gint _tmp47__length2;
				const gchar* _tmp48_;
				if (!_tmp45_) {
					gint _tmp46_;
					_tmp46_ = i;
					i = _tmp46_ + 1;
				}
				_tmp45_ = FALSE;
				if (!(i < lenrep)) {
					break;
				}
				_tmp47_ = replacements;
				_tmp47__length1 = replacements_length1;
				_tmp47__length2 = replacements_length2;
				_tmp48_ = _tmp47_[(i * _tmp47__length2) + 0];
				if (g_strcmp0 (icon_id, _tmp48_) == 0) {
					gchar** _tmp49_;
					gint _tmp49__length1;
					gint _tmp49__length2;
					const gchar* _tmp50_;
					gchar* _tmp51_;
					_tmp49_ = replacements;
					_tmp49__length1 = replacements_length1;
					_tmp49__length2 = replacements_length2;
					_tmp50_ = _tmp49_[(i * _tmp49__length2) + 1];
					_tmp51_ = g_strdup (_tmp50_);
					result = _tmp51_;
					replacements = (_vala_array_free (replacements, replacements_length1 * replacements_length2, (GDestroyNotify) g_free), NULL);
					return result;
				}
			}
		}
	}
	_tmp52_ = g_strdup (icon_id);
	result = _tmp52_;
	replacements = (_vala_array_free (replacements, replacements_length1 * replacements_length2, (GDestroyNotify) g_free), NULL);
	return result;
}

static gchar*
string_slice (const gchar* self,
              glong start,
              glong end)
{
	glong string_length = 0L;
	gint _tmp0_;
	gint _tmp1_;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gchar* _tmp4_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	string_length = (glong) _tmp1_;
	if (start < ((glong) 0)) {
		start = string_length + start;
	}
	if (end < ((glong) 0)) {
		end = string_length + end;
	}
	if (start >= ((glong) 0)) {
		_tmp2_ = start <= string_length;
	} else {
		_tmp2_ = FALSE;
	}
	g_return_val_if_fail (_tmp2_, NULL);
	if (end >= ((glong) 0)) {
		_tmp3_ = end <= string_length;
	} else {
		_tmp3_ = FALSE;
	}
	g_return_val_if_fail (_tmp3_, NULL);
	g_return_val_if_fail (start <= end, NULL);
	_tmp4_ = g_strndup (((gchar*) self) + start, (gsize) (end - start));
	result = _tmp4_;
	return result;
}

static void
_vala_array_add2 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add3 (GdkPixbuf** * array,
                  gint* length,
                  gint* size,
                  GdkPixbuf* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GdkPixbuf*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add4 (GdkPixbuf** * array,
                  gint* length,
                  gint* size,
                  GdkPixbuf* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GdkPixbuf*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add5 (GdkPixbuf** * array,
                  gint* length,
                  gint* size,
                  GdkPixbuf* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GdkPixbuf*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
desktop_weather_get_icondata (DesktopWeather* self)
{
	gchar* icondir = NULL;
	gchar* _tmp0_;
	gchar** _tmp1_;
	GdkPixbuf** _tmp2_;
	GdkPixbuf** _tmp3_;
	GdkPixbuf** _tmp4_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_build_filename (WEATHERSHOW_DATADIR, "weather_icons", NULL);
	icondir = _tmp0_;
	_tmp1_ = g_new0 (gchar*, 0 + 1);
	self->priv->iconnames = (_vala_array_free (self->priv->iconnames, self->priv->iconnames_length1, (GDestroyNotify) g_free), NULL);
	self->priv->iconnames = _tmp1_;
	self->priv->iconnames_length1 = 0;
	self->priv->_iconnames_size_ = self->priv->iconnames_length1;
	_tmp2_ = g_new0 (GdkPixbuf*, 0 + 1);
	self->priv->iconpixbufs_1 = (_vala_array_free (self->priv->iconpixbufs_1, self->priv->iconpixbufs_1_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->iconpixbufs_1 = _tmp2_;
	self->priv->iconpixbufs_1_length1 = 0;
	self->priv->_iconpixbufs_1_size_ = self->priv->iconpixbufs_1_length1;
	_tmp3_ = g_new0 (GdkPixbuf*, 0 + 1);
	self->priv->iconpixbufs_2 = (_vala_array_free (self->priv->iconpixbufs_2, self->priv->iconpixbufs_2_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->iconpixbufs_2 = _tmp3_;
	self->priv->iconpixbufs_2_length1 = 0;
	self->priv->_iconpixbufs_2_size_ = self->priv->iconpixbufs_2_length1;
	_tmp4_ = g_new0 (GdkPixbuf*, 0 + 1);
	self->priv->iconpixbufs_3 = (_vala_array_free (self->priv->iconpixbufs_3, self->priv->iconpixbufs_3_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->iconpixbufs_3 = _tmp4_;
	self->priv->iconpixbufs_3_length1 = 0;
	self->priv->_iconpixbufs_3_size_ = self->priv->iconpixbufs_3_length1;
	{
		GDir* dr = NULL;
		const gchar* _tmp5_;
		GDir* _tmp6_;
		gchar* filename = NULL;
		_tmp5_ = icondir;
		_tmp6_ = g_dir_open (_tmp5_, (guint) 0, &_inner_error0_);
		dr = _tmp6_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_FILE_ERROR) {
				goto __catch0_g_file_error;
			}
			_g_free0 (icondir);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
		filename = NULL;
		while (TRUE) {
			GDir* _tmp7_;
			const gchar* _tmp8_;
			gchar* _tmp9_;
			const gchar* _tmp10_;
			const gchar* _tmp11_;
			gchar* _tmp12_;
			gchar* iconpath = NULL;
			const gchar* _tmp13_;
			const gchar* _tmp14_;
			gchar* _tmp15_;
			_tmp7_ = dr;
			_tmp8_ = g_dir_read_name (_tmp7_);
			_tmp9_ = g_strdup (_tmp8_);
			_g_free0 (filename);
			filename = _tmp9_;
			_tmp10_ = filename;
			if (!(_tmp10_ != NULL)) {
				break;
			}
			_tmp11_ = filename;
			_tmp12_ = string_slice (_tmp11_, (glong) 0, (glong) 4);
			_vala_array_add2 (&self->priv->iconnames, &self->priv->iconnames_length1, &self->priv->_iconnames_size_, _tmp12_);
			_tmp13_ = icondir;
			_tmp14_ = filename;
			_tmp15_ = g_build_filename (_tmp13_, _tmp14_, NULL);
			iconpath = _tmp15_;
			{
				GdkPixbuf* _tmp16_ = NULL;
				const gchar* _tmp17_;
				GdkPixbuf* _tmp18_;
				GdkPixbuf* _tmp19_;
				GdkPixbuf* _tmp20_ = NULL;
				const gchar* _tmp21_;
				GdkPixbuf* _tmp22_;
				GdkPixbuf* _tmp23_;
				GdkPixbuf* _tmp24_ = NULL;
				const gchar* _tmp25_;
				GdkPixbuf* _tmp26_;
				GdkPixbuf* _tmp27_;
				_tmp17_ = iconpath;
				_tmp18_ = gdk_pixbuf_new_from_file_at_size (_tmp17_, 150, 150, &_inner_error0_);
				_tmp16_ = _tmp18_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					goto __catch1_g_error;
				}
				_tmp19_ = _tmp16_;
				_tmp16_ = NULL;
				_vala_array_add3 (&self->priv->iconpixbufs_1, &self->priv->iconpixbufs_1_length1, &self->priv->_iconpixbufs_1_size_, _tmp19_);
				_tmp21_ = iconpath;
				_tmp22_ = gdk_pixbuf_new_from_file_at_size (_tmp21_, 220, 220, &_inner_error0_);
				_tmp20_ = _tmp22_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_g_object_unref0 (_tmp16_);
					goto __catch1_g_error;
				}
				_tmp23_ = _tmp20_;
				_tmp20_ = NULL;
				_vala_array_add4 (&self->priv->iconpixbufs_2, &self->priv->iconpixbufs_2_length1, &self->priv->_iconpixbufs_2_size_, _tmp23_);
				_tmp25_ = iconpath;
				_tmp26_ = gdk_pixbuf_new_from_file_at_size (_tmp25_, 320, 320, &_inner_error0_);
				_tmp24_ = _tmp26_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_g_object_unref0 (_tmp20_);
					_g_object_unref0 (_tmp16_);
					goto __catch1_g_error;
				}
				_tmp27_ = _tmp24_;
				_tmp24_ = NULL;
				_vala_array_add5 (&self->priv->iconpixbufs_3, &self->priv->iconpixbufs_3_length1, &self->priv->_iconpixbufs_3_size_, _tmp27_);
				_g_object_unref0 (_tmp24_);
				_g_object_unref0 (_tmp20_);
				_g_object_unref0 (_tmp16_);
			}
			goto __finally1;
			__catch1_g_error:
			{
				g_clear_error (&_inner_error0_);
				g_print ("Error loading images\n");
			}
			__finally1:
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_free0 (iconpath);
				_g_free0 (filename);
				_g_dir_close0 (dr);
				if (_inner_error0_->domain == G_FILE_ERROR) {
					goto __catch0_g_file_error;
				}
				_g_free0 (icondir);
				g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return;
			}
			_g_free0 (iconpath);
		}
		_g_free0 (filename);
		_g_dir_close0 (dr);
	}
	goto __finally0;
	__catch0_g_file_error:
	{
		g_clear_error (&_inner_error0_);
		g_print ("Something went wrong loading the icons\n");
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (icondir);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_g_free0 (icondir);
}

static void
_gtk_main_quit_gtk_widget_destroy (GtkWidget* _sender,
                                   gpointer self)
{
	gtk_main_quit ();
}

static void
desktop_weather_main (gchar** args,
                      gint args_length1)
{
	GtkWindow* win = NULL;
	const gchar* _tmp0_;
	DesktopWeather* _tmp1_;
	gtk_init ((gint*) (&args_length1), &args);
	_tmp0_ = args[1];
	_tmp1_ = desktop_weather_new (_tmp0_);
	g_object_ref_sink (_tmp1_);
	win = (GtkWindow*) _tmp1_;
	gtk_window_set_decorated (win, FALSE);
	gtk_widget_show_all ((GtkWidget*) win);
	g_signal_connect ((GtkWidget*) win, "destroy", (GCallback) _gtk_main_quit_gtk_widget_destroy, NULL);
	gtk_main ();
	_g_object_unref0 (win);
}

int
main (int argc,
      char ** argv)
{
	desktop_weather_main (argv, argc);
	return 0;
}

static void
desktop_weather_class_init (DesktopWeatherClass * klass,
                            gpointer klass_data)
{
	desktop_weather_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DesktopWeather_private_offset);
	G_OBJECT_CLASS (klass)->finalize = desktop_weather_finalize;
}

static void
desktop_weather_instance_init (DesktopWeather * self,
                               gpointer klass)
{
	gchar** _tmp0_;
	self->priv = desktop_weather_get_instance_private (self);
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	self->priv->iconnames = _tmp0_;
	self->priv->iconnames_length1 = 0;
	self->priv->_iconnames_size_ = self->priv->iconnames_length1;
}

static void
desktop_weather_finalize (GObject * obj)
{
	DesktopWeather * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_DESKTOP_WEATHER, DesktopWeather);
	_g_object_unref0 (self->priv->datasrc);
	_g_object_unref0 (self->priv->monitor);
	_g_object_unref0 (self->priv->maingrid);
	_g_object_unref0 (self->priv->locationlabel);
	_g_object_unref0 (self->priv->weatherlabel);
	_g_object_unref0 (self->priv->desktop_settings);
	_g_free0 (self->priv->css_data);
	_g_free0 (self->priv->css_template);
	_g_object_unref0 (self->priv->css_provider);
	self->priv->iconpixbufs_1 = (_vala_array_free (self->priv->iconpixbufs_1, self->priv->iconpixbufs_1_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->iconpixbufs_2 = (_vala_array_free (self->priv->iconpixbufs_2, self->priv->iconpixbufs_2_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->iconpixbufs_3 = (_vala_array_free (self->priv->iconpixbufs_3, self->priv->iconpixbufs_3_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->iconnames = (_vala_array_free (self->priv->iconnames, self->priv->iconnames_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (self->priv->weather_image);
	G_OBJECT_CLASS (desktop_weather_parent_class)->finalize (obj);
}

static GType
desktop_weather_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DesktopWeatherClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) desktop_weather_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DesktopWeather), 0, (GInstanceInitFunc) desktop_weather_instance_init, NULL };
	GType desktop_weather_type_id;
	desktop_weather_type_id = g_type_register_static (gtk_window_get_type (), "DesktopWeather", &g_define_type_info, 0);
	DesktopWeather_private_offset = g_type_add_instance_private (desktop_weather_type_id, sizeof (DesktopWeatherPrivate));
	return desktop_weather_type_id;
}

GType
desktop_weather_get_type (void)
{
	static volatile gsize desktop_weather_type_id__once = 0;
	if (g_once_init_enter (&desktop_weather_type_id__once)) {
		GType desktop_weather_type_id;
		desktop_weather_type_id = desktop_weather_get_type_once ();
		g_once_init_leave (&desktop_weather_type_id__once, desktop_weather_type_id);
	}
	return desktop_weather_type_id__once;
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

