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

#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#include <libxfce4windowing/libxfce4windowing.h>
#include <glib-object.h>
#include <gdk/gdk.h>
#include <pango/pango.h>
#include <gobject/gvaluecollector.h>
#include <gtk-layer-shell/gtk-layer-shell.h>
#include <cairo-gobject.h>
#include <float.h>
#include <math.h>
#include <glib/gi18n-lib.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 SHOW_TIME_TYPE_SHOW_TIMEAPPEARANCE (show_time_show_timeappearance_get_type ())
#define SHOW_TIME_SHOW_TIMEAPPEARANCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHOW_TIME_TYPE_SHOW_TIMEAPPEARANCE, ShowTimeShowTimeappearance))
#define SHOW_TIME_SHOW_TIMEAPPEARANCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHOW_TIME_TYPE_SHOW_TIMEAPPEARANCE, ShowTimeShowTimeappearanceClass))
#define SHOW_TIME_IS_SHOW_TIMEAPPEARANCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SHOW_TIME_TYPE_SHOW_TIMEAPPEARANCE))
#define SHOW_TIME_IS_SHOW_TIMEAPPEARANCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHOW_TIME_TYPE_SHOW_TIMEAPPEARANCE))
#define SHOW_TIME_SHOW_TIMEAPPEARANCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHOW_TIME_TYPE_SHOW_TIMEAPPEARANCE, ShowTimeShowTimeappearanceClass))

typedef struct _ShowTimeShowTimeappearance ShowTimeShowTimeappearance;
typedef struct _ShowTimeShowTimeappearanceClass ShowTimeShowTimeappearanceClass;
typedef struct _ShowTimeShowTimeappearancePrivate ShowTimeShowTimeappearancePrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
#define __vala_PangoFontDescription_free0(var) ((var == NULL) ? NULL : (var = (_vala_PangoFontDescription_free (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
typedef struct _ShowTimeParamSpecShowTimeappearance ShowTimeParamSpecShowTimeappearance;

#define SHOW_TIME_TYPE_TIME_WINDOW (show_time_time_window_get_type ())
#define SHOW_TIME_TIME_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHOW_TIME_TYPE_TIME_WINDOW, ShowTimeTimeWindow))
#define SHOW_TIME_TIME_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHOW_TIME_TYPE_TIME_WINDOW, ShowTimeTimeWindowClass))
#define SHOW_TIME_IS_TIME_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SHOW_TIME_TYPE_TIME_WINDOW))
#define SHOW_TIME_IS_TIME_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHOW_TIME_TYPE_TIME_WINDOW))
#define SHOW_TIME_TIME_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHOW_TIME_TYPE_TIME_WINDOW, ShowTimeTimeWindowClass))

typedef struct _ShowTimeTimeWindow ShowTimeTimeWindow;
typedef struct _ShowTimeTimeWindowClass ShowTimeTimeWindowClass;
typedef struct _ShowTimeTimeWindowPrivate ShowTimeTimeWindowPrivate;
enum  {
	SHOW_TIME_TIME_WINDOW_0_PROPERTY,
	SHOW_TIME_TIME_WINDOW_NUM_PROPERTIES
};
static GParamSpec* show_time_time_window_properties[SHOW_TIME_TIME_WINDOW_NUM_PROPERTIES];
#define _show_time_show_timeappearance_unref0(var) ((var == NULL) ? NULL : (var = (show_time_show_timeappearance_unref (var), NULL)))
typedef struct _Block1Data Block1Data;
typedef struct _Block2Data Block2Data;
typedef struct _Block3Data Block3Data;
#define _g_thread_unref0(var) ((var == NULL) ? NULL : (var = (g_thread_unref (var), NULL)))
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))

struct _ShowTimeShowTimeappearance {
	GTypeInstance parent_instance;
	volatile int ref_count;
	ShowTimeShowTimeappearancePrivate * priv;
};

struct _ShowTimeShowTimeappearanceClass {
	GTypeClass parent_class;
	void (*finalize) (ShowTimeShowTimeappearance *self);
};

struct _ShowTimeParamSpecShowTimeappearance {
	GParamSpec parent_instance;
};

struct _ShowTimeTimeWindow {
	GtkWindow parent_instance;
	ShowTimeTimeWindowPrivate * priv;
};

struct _ShowTimeTimeWindowClass {
	GtkWindowClass parent_class;
};

struct _ShowTimeTimeWindowPrivate {
	GSettings* panel_settings;
	GSettings* raven_settings;
	GSettings* currpanelsubject_settings;
	gboolean showtime_onpanel;
	gint next_time;
	gboolean twelvehrs;
	gchar* dateformat;
	ShowTimeShowTimeappearance* appearance;
	gboolean bypass;
	GSettings* text_scaling;
	gboolean close_onnew;
};

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

struct _Block2Data {
	int _ref_count_;
	ShowTimeTimeWindow* self;
	gchar* uuid;
};

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

VALA_EXTERN gchar* show_time_timefontcolor;
gchar* show_time_timefontcolor = NULL;
VALA_EXTERN gchar* show_time_datefontcolor;
gchar* show_time_datefontcolor = NULL;
VALA_EXTERN gint show_time_linespacing;
gint show_time_linespacing = 0;
VALA_EXTERN GtkLabel* show_time_timelabel;
GtkLabel* show_time_timelabel = NULL;
VALA_EXTERN GtkLabel* show_time_datelabel;
GtkLabel* show_time_datelabel = NULL;
VALA_EXTERN GSettings* show_time_showtime_settings;
GSettings* show_time_showtime_settings = NULL;
VALA_EXTERN gboolean show_time_subwindow;
gboolean show_time_subwindow = FALSE;
VALA_EXTERN gchar* show_time_win_name;
gchar* show_time_win_name = NULL;
VALA_EXTERN gint* show_time_custom_posargs;
VALA_EXTERN gint show_time_custom_posargs_length1;
gint* show_time_custom_posargs = NULL;
gint show_time_custom_posargs_length1 = 0;
static gint _show_time_custom_posargs_size_ = 0;
VALA_EXTERN XfwScreen* show_time_xfw_screen;
XfwScreen* show_time_xfw_screen = NULL;
static gpointer show_time_show_timeappearance_parent_class = NULL;
static gint ShowTimeTimeWindow_private_offset;
static gpointer show_time_time_window_parent_class = NULL;

VALA_EXTERN gpointer show_time_show_timeappearance_ref (gpointer instance);
VALA_EXTERN void show_time_show_timeappearance_unref (gpointer instance);
VALA_EXTERN GParamSpec* show_time_param_spec_show_timeappearance (const gchar* name,
                                                      const gchar* nick,
                                                      const gchar* blurb,
                                                      GType object_type,
                                                      GParamFlags flags);
VALA_EXTERN void show_time_value_set_show_timeappearance (GValue* value,
                                              gpointer v_object);
VALA_EXTERN void show_time_value_take_show_timeappearance (GValue* value,
                                               gpointer v_object);
VALA_EXTERN gpointer show_time_value_get_show_timeappearance (const GValue* value);
VALA_EXTERN GType show_time_show_timeappearance_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ShowTimeShowTimeappearance, show_time_show_timeappearance_unref)
VALA_EXTERN void show_time_show_timeappearance_get_appearance (ShowTimeShowTimeappearance* self,
                                                   GdkScreen* screen);
static void _vala_PangoFontDescription_free (PangoFontDescription* self);
VALA_EXTERN void show_time_show_timeappearance_get_spacing (ShowTimeShowTimeappearance* self,
                                                GdkScreen* screen);
VALA_EXTERN void show_time_show_timeappearance_get_hexcolor (ShowTimeShowTimeappearance* self,
                                                 const gchar* currtime,
                                                 const gchar* currdate);
VALA_EXTERN ShowTimeShowTimeappearance* show_time_show_timeappearance_new (void);
VALA_EXTERN ShowTimeShowTimeappearance* show_time_show_timeappearance_construct (GType object_type);
static void show_time_show_timeappearance_finalize (ShowTimeShowTimeappearance * obj);
static GType show_time_show_timeappearance_get_type_once (void);
VALA_EXTERN GType show_time_time_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ShowTimeTimeWindow, g_object_unref)
static gboolean show_time_time_window_find_applet (ShowTimeTimeWindow* self,
                                            const gchar* uuid,
                                            gchar** applets,
                                            gint applets_length1);
static void show_time_time_window_watchapplet (ShowTimeTimeWindow* self,
                                        const gchar* uuid);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static void _____lambda4_ (Block1Data* _data1_);
static void ______lambda4__g_settings_changed (GSettings* _sender,
                                        const gchar* key,
                                        gpointer self);
static void show_time_time_window_watchplugin (ShowTimeTimeWindow* self,
                                        const gchar* uuid);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static void __lambda5_ (Block2Data* _data2_);
static void ___lambda5__g_settings_changed (GSettings* _sender,
                                     const gchar* key,
                                     gpointer self);
VALA_EXTERN ShowTimeTimeWindow* show_time_time_window_new (const gchar* uuid);
VALA_EXTERN ShowTimeTimeWindow* show_time_time_window_construct (GType object_type,
                                                     const gchar* uuid);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
static gboolean __lambda6_ (Block3Data* _data3_);
static gboolean ___lambda6__gsource_func (gpointer self);
static void show_time_time_window_kill_onallmonitorschange (ShowTimeTimeWindow* self);
static void _show_time_time_window_kill_onallmonitorschange_g_settings_changed (GSettings* _sender,
                                                                         const gchar* key,
                                                                         gpointer self);
static void __lambda7_ (ShowTimeTimeWindow* self);
static void show_time_time_window_consider_toleave (ShowTimeTimeWindow* self);
static void ___lambda7__gdk_screen_monitors_changed (GdkScreen* _sender,
                                              gpointer self);
static void show_time_time_window_watchwins_wayland (ShowTimeTimeWindow* self,
                                              XfwWindow* newwin);
static void _show_time_time_window_watchwins_wayland_libxfce4windowing_screen_window_opened (XfwScreen* _sender,
                                                                                      XfwWindow* window,
                                                                                      gpointer self);
static gchar* show_time_time_window_get_dateformat (ShowTimeTimeWindow* self);
static void _gtk_main_quit_gtk_widget_destroy (GtkWidget* _sender,
                                        gpointer self);
static void show_time_time_window_update_appearance (ShowTimeTimeWindow* self);
static void _show_time_time_window_update_appearance_g_settings_changed (GSettings* _sender,
                                                                  const gchar* key,
                                                                  gpointer self);
static void show_time_time_window_toggle_draggable (ShowTimeTimeWindow* self);
static void _show_time_time_window_toggle_draggable_g_settings_changed (GSettings* _sender,
                                                                 const gchar* key,
                                                                 gpointer self);
static gboolean show_time_time_window_on_draw (ShowTimeTimeWindow* self,
                                        GtkWidget* da,
                                        cairo_t* ctx);
static gboolean _show_time_time_window_on_draw_gtk_widget_draw (GtkWidget* _sender,
                                                         cairo_t* cr,
                                                         gpointer self);
VALA_EXTERN void show_time_time_window_set_windowposition (ShowTimeTimeWindow* self);
static gboolean show_time_time_window_setcondition (ShowTimeTimeWindow* self);
static gboolean _show_time_time_window_setcondition_gtk_widget_configure_event (GtkWidget* _sender,
                                                                         GdkEventConfigure* event,
                                                                         gpointer self);
static void _show_time_time_window_set_windowposition_g_settings_changed (GSettings* _sender,
                                                                   const gchar* key,
                                                                   gpointer self);
static gboolean show_time_time_window_run_time (ShowTimeTimeWindow* self);
static gpointer _show_time_time_window_run_time_gthread_func (gpointer self);
static void show_time_time_window_update_appearance_delay (ShowTimeTimeWindow* self);
static void _show_time_time_window_update_appearance_delay_g_settings_changed (GSettings* _sender,
                                                                        const gchar* key,
                                                                        gpointer self);
static gboolean show_time_time_window_get_leftalign (ShowTimeTimeWindow* self);
static gint* show_time_time_window_get_windowsize (ShowTimeTimeWindow* self,
                                            gint* result_length1);
VALA_EXTERN gint show_time_time_window_getscale (ShowTimeTimeWindow* self);
static gint* show_time_time_window_get_default_right (ShowTimeTimeWindow* self,
                                               gint* result_length1);
static gint* show_time_time_window_check_res (ShowTimeTimeWindow* self,
                                       gint* result_length1);
static gint show_time_time_window_get_containingindex (ShowTimeTimeWindow* self,
                                                gchar** arr,
                                                gint arr_length1,
                                                const gchar* lookfor);
static gchar* show_time_time_window_fix_mins (ShowTimeTimeWindow* self,
                                       gint minutes);
static gchar* show_time_time_window_get_localtime (ShowTimeTimeWindow* self,
                                            GDateTime* newtime);
static gchar* show_time_time_window_read_dateformat (ShowTimeTimeWindow* self);
static gboolean __lambda9_ (ShowTimeTimeWindow* self);
static gboolean ___lambda9__gsource_func (gpointer self);
static void show_time_time_window_update_interface (ShowTimeTimeWindow* self);
static gint show_time_time_window_convert_remainder_topositive (ShowTimeTimeWindow* self,
                                                         gdouble subj,
                                                         gdouble rem);
static gint* show_time_time_window_calibrate_time (ShowTimeTimeWindow* self,
                                            gint* result_length1);
static gboolean ____lambda8_ (ShowTimeTimeWindow* self);
static gboolean _____lambda8__gsource_func (gpointer self);
static void show_time_time_window_finalize (GObject * obj);
static GType show_time_time_window_get_type_once (void);
static void show_time_main (gchar** args,
                     gint args_length1);
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 void
_vala_PangoFontDescription_free (PangoFontDescription* self)
{
	g_boxed_free (pango_font_description_get_type (), self);
}

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

void
show_time_show_timeappearance_get_appearance (ShowTimeShowTimeappearance* self,
                                              GdkScreen* screen)
{
	GSettings* _tmp0_;
	gchar* _tmp1_;
	GSettings* _tmp2_;
	gchar* _tmp3_;
	gchar* timeprops = NULL;
	GSettings* _tmp4_;
	gchar* _tmp5_;
	gchar* dateprops = NULL;
	GSettings* _tmp6_;
	gchar* _tmp7_;
	PangoFontDescription* timefont = NULL;
	PangoFontDescription* _tmp8_;
	PangoFontDescription* _tmp9_;
	PangoFontDescription* _tmp10_;
	PangoFontDescription* _tmp11_;
	PangoFontDescription* datefont = NULL;
	PangoFontDescription* _tmp12_;
	PangoFontDescription* _tmp13_;
	PangoFontDescription* _tmp14_;
	PangoFontDescription* _tmp15_;
	PangoContext* t = NULL;
	GtkLabel* _tmp16_;
	PangoContext* _tmp17_;
	PangoContext* _tmp18_;
	PangoContext* d = NULL;
	GtkLabel* _tmp19_;
	PangoContext* _tmp20_;
	PangoContext* _tmp21_;
	GtkLabel* _tmp22_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (screen != NULL);
	_tmp0_ = show_time_showtime_settings;
	_tmp1_ = g_settings_get_string (_tmp0_, "timefontcolor");
	_g_free0 (show_time_timefontcolor);
	show_time_timefontcolor = _tmp1_;
	_tmp2_ = show_time_showtime_settings;
	_tmp3_ = g_settings_get_string (_tmp2_, "datefontcolor");
	_g_free0 (show_time_datefontcolor);
	show_time_datefontcolor = _tmp3_;
	_tmp4_ = show_time_showtime_settings;
	_tmp5_ = g_settings_get_string (_tmp4_, "timefont");
	timeprops = _tmp5_;
	_tmp6_ = show_time_showtime_settings;
	_tmp7_ = g_settings_get_string (_tmp6_, "datefont");
	dateprops = _tmp7_;
	_tmp8_ = pango_font_description_new ();
	_tmp9_ = _tmp8_;
	_tmp10_ = pango_font_description_from_string (timeprops);
	_tmp11_ = _tmp10_;
	__vala_PangoFontDescription_free0 (_tmp9_);
	timefont = _tmp11_;
	_tmp12_ = pango_font_description_new ();
	_tmp13_ = _tmp12_;
	_tmp14_ = pango_font_description_from_string (dateprops);
	_tmp15_ = _tmp14_;
	__vala_PangoFontDescription_free0 (_tmp13_);
	datefont = _tmp15_;
	_tmp16_ = show_time_timelabel;
	_tmp17_ = gtk_widget_get_pango_context ((GtkWidget*) _tmp16_);
	_tmp18_ = _g_object_ref0 (_tmp17_);
	t = _tmp18_;
	_tmp19_ = show_time_datelabel;
	_tmp20_ = gtk_widget_get_pango_context ((GtkWidget*) _tmp19_);
	_tmp21_ = _g_object_ref0 (_tmp20_);
	d = _tmp21_;
	pango_context_set_font_description (t, timefont);
	pango_context_set_font_description (d, datefont);
	_tmp22_ = show_time_timelabel;
	gtk_widget_set_margin_end ((GtkWidget*) _tmp22_, 10);
	show_time_show_timeappearance_get_spacing (self, screen);
	_g_object_unref0 (d);
	_g_object_unref0 (t);
	__vala_PangoFontDescription_free0 (datefont);
	__vala_PangoFontDescription_free0 (timefont);
	_g_free0 (dateprops);
	_g_free0 (timeprops);
}

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;
}

void
show_time_show_timeappearance_get_spacing (ShowTimeShowTimeappearance* self,
                                           GdkScreen* screen)
{
	gchar* linespacing_css = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	GtkCssProvider* css_provider = NULL;
	GtkCssProvider* _tmp4_;
	GtkLabel* _tmp5_;
	GtkStyleContext* _tmp6_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (screen != NULL);
	_tmp0_ = g_strdup_printf ("%i", show_time_linespacing);
	_tmp1_ = _tmp0_;
	_tmp2_ = string_replace ("\n" \
"            .linespacing {\n" \
"              margin-bottom: <bspac>px;\n" \
"            }\n" \
"            ", "<bspac>", _tmp1_);
	_tmp3_ = _tmp2_;
	_g_free0 (_tmp1_);
	linespacing_css = _tmp3_;
	_tmp4_ = gtk_css_provider_new ();
	css_provider = _tmp4_;
	_tmp5_ = show_time_timelabel;
	_tmp6_ = gtk_widget_get_style_context ((GtkWidget*) _tmp5_);
	gtk_style_context_remove_class (_tmp6_, "linespacing");
	{
		GtkLabel* _tmp7_;
		GtkStyleContext* _tmp8_;
		gtk_css_provider_load_from_data (css_provider, linespacing_css, (gssize) -1, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		gtk_style_context_add_provider_for_screen (screen, (GtkStyleProvider*) css_provider, (guint) GTK_STYLE_PROVIDER_PRIORITY_USER);
		_tmp7_ = show_time_timelabel;
		_tmp8_ = gtk_widget_get_style_context ((GtkWidget*) _tmp7_);
		gtk_style_context_add_class (_tmp8_, "linespacing");
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
		g_print ("Error loading css data\n");
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (css_provider);
		_g_free0 (linespacing_css);
		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_object_unref0 (css_provider);
	_g_free0 (linespacing_css);
}

void
show_time_show_timeappearance_get_hexcolor (ShowTimeShowTimeappearance* self,
                                            const gchar* currtime,
                                            const gchar* currdate)
{
	GtkLabel* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	GtkLabel* _tmp10_;
	const gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (currtime != NULL);
	g_return_if_fail (currdate != NULL);
	_tmp0_ = show_time_timelabel;
	_tmp1_ = show_time_timefontcolor;
	_tmp2_ = g_strconcat ("<span foreground=\"", _tmp1_, NULL);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_strconcat (_tmp3_, "\">", NULL);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_strconcat (_tmp5_, currtime, NULL);
	_tmp7_ = _tmp6_;
	_tmp8_ = g_strconcat (_tmp7_, "</span>", NULL);
	_tmp9_ = _tmp8_;
	gtk_label_set_markup (_tmp0_, _tmp9_);
	_g_free0 (_tmp9_);
	_g_free0 (_tmp7_);
	_g_free0 (_tmp5_);
	_g_free0 (_tmp3_);
	_tmp10_ = show_time_datelabel;
	_tmp11_ = show_time_datefontcolor;
	_tmp12_ = g_strconcat ("<span foreground=\"", _tmp11_, NULL);
	_tmp13_ = _tmp12_;
	_tmp14_ = g_strconcat (_tmp13_, "\">", NULL);
	_tmp15_ = _tmp14_;
	_tmp16_ = g_strconcat (_tmp15_, currdate, NULL);
	_tmp17_ = _tmp16_;
	_tmp18_ = g_strconcat (_tmp17_, "</span>", NULL);
	_tmp19_ = _tmp18_;
	gtk_label_set_markup (_tmp10_, _tmp19_);
	_g_free0 (_tmp19_);
	_g_free0 (_tmp17_);
	_g_free0 (_tmp15_);
	_g_free0 (_tmp13_);
}

ShowTimeShowTimeappearance*
show_time_show_timeappearance_construct (GType object_type)
{
	ShowTimeShowTimeappearance* self = NULL;
	self = (ShowTimeShowTimeappearance*) g_type_create_instance (object_type);
	return self;
}

ShowTimeShowTimeappearance*
show_time_show_timeappearance_new (void)
{
	return show_time_show_timeappearance_construct (SHOW_TIME_TYPE_SHOW_TIMEAPPEARANCE);
}

static void
show_time_value_show_timeappearance_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
show_time_value_show_timeappearance_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		show_time_show_timeappearance_unref (value->data[0].v_pointer);
	}
}

static void
show_time_value_show_timeappearance_copy_value (const GValue* src_value,
                                                GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = show_time_show_timeappearance_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
show_time_value_show_timeappearance_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
show_time_value_show_timeappearance_collect_value (GValue* value,
                                                   guint n_collect_values,
                                                   GTypeCValue* collect_values,
                                                   guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		ShowTimeShowTimeappearance * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = show_time_show_timeappearance_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
show_time_value_show_timeappearance_lcopy_value (const GValue* value,
                                                 guint n_collect_values,
                                                 GTypeCValue* collect_values,
                                                 guint collect_flags)
{
	ShowTimeShowTimeappearance ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = show_time_show_timeappearance_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
show_time_param_spec_show_timeappearance (const gchar* name,
                                          const gchar* nick,
                                          const gchar* blurb,
                                          GType object_type,
                                          GParamFlags flags)
{
	ShowTimeParamSpecShowTimeappearance* spec;
	g_return_val_if_fail (g_type_is_a (object_type, SHOW_TIME_TYPE_SHOW_TIMEAPPEARANCE), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

gpointer
show_time_value_get_show_timeappearance (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, SHOW_TIME_TYPE_SHOW_TIMEAPPEARANCE), NULL);
	return value->data[0].v_pointer;
}

void
show_time_value_set_show_timeappearance (GValue* value,
                                         gpointer v_object)
{
	ShowTimeShowTimeappearance * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, SHOW_TIME_TYPE_SHOW_TIMEAPPEARANCE));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, SHOW_TIME_TYPE_SHOW_TIMEAPPEARANCE));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		show_time_show_timeappearance_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		show_time_show_timeappearance_unref (old);
	}
}

void
show_time_value_take_show_timeappearance (GValue* value,
                                          gpointer v_object)
{
	ShowTimeShowTimeappearance * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, SHOW_TIME_TYPE_SHOW_TIMEAPPEARANCE));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, SHOW_TIME_TYPE_SHOW_TIMEAPPEARANCE));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		show_time_show_timeappearance_unref (old);
	}
}

static void
show_time_show_timeappearance_class_init (ShowTimeShowTimeappearanceClass * klass,
                                          gpointer klass_data)
{
	show_time_show_timeappearance_parent_class = g_type_class_peek_parent (klass);
	((ShowTimeShowTimeappearanceClass *) klass)->finalize = show_time_show_timeappearance_finalize;
}

static void
show_time_show_timeappearance_instance_init (ShowTimeShowTimeappearance * self,
                                             gpointer klass)
{
	self->ref_count = 1;
}

static void
show_time_show_timeappearance_finalize (ShowTimeShowTimeappearance * obj)
{
	ShowTimeShowTimeappearance * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SHOW_TIME_TYPE_SHOW_TIMEAPPEARANCE, ShowTimeShowTimeappearance);
	g_signal_handlers_destroy (self);
}

static GType
show_time_show_timeappearance_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { show_time_value_show_timeappearance_init, show_time_value_show_timeappearance_free_value, show_time_value_show_timeappearance_copy_value, show_time_value_show_timeappearance_peek_pointer, "p", show_time_value_show_timeappearance_collect_value, "p", show_time_value_show_timeappearance_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (ShowTimeShowTimeappearanceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) show_time_show_timeappearance_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ShowTimeShowTimeappearance), 0, (GInstanceInitFunc) show_time_show_timeappearance_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType show_time_show_timeappearance_type_id;
	show_time_show_timeappearance_type_id = g_type_register_fundamental (g_type_fundamental_next (), "ShowTimeShowTimeappearance", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return show_time_show_timeappearance_type_id;
}

GType
show_time_show_timeappearance_get_type (void)
{
	static volatile gsize show_time_show_timeappearance_type_id__once = 0;
	if (g_once_init_enter (&show_time_show_timeappearance_type_id__once)) {
		GType show_time_show_timeappearance_type_id;
		show_time_show_timeappearance_type_id = show_time_show_timeappearance_get_type_once ();
		g_once_init_leave (&show_time_show_timeappearance_type_id__once, show_time_show_timeappearance_type_id);
	}
	return show_time_show_timeappearance_type_id__once;
}

gpointer
show_time_show_timeappearance_ref (gpointer instance)
{
	ShowTimeShowTimeappearance * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

void
show_time_show_timeappearance_unref (gpointer instance)
{
	ShowTimeShowTimeappearance * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		SHOW_TIME_SHOW_TIMEAPPEARANCE_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static inline gpointer
show_time_time_window_get_instance_private (ShowTimeTimeWindow* self)
{
	return G_STRUCT_MEMBER_P (self, ShowTimeTimeWindow_private_offset);
}

static gboolean
show_time_time_window_find_applet (ShowTimeTimeWindow* 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_)) {
		ShowTimeTimeWindow* 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 void
_____lambda4_ (Block1Data* _data1_)
{
	ShowTimeTimeWindow* self;
	GSettings* _tmp0_;
	gchar** _tmp1_;
	gchar** _tmp2_;
	gchar** _tmp3_;
	gint _tmp3__length1;
	self = _data1_->self;
	_tmp0_ = self->priv->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 (!show_time_time_window_find_applet (self, _data1_->uuid, _tmp3_, (gint) _tmp3__length1)) {
		self->priv->showtime_onpanel = FALSE;
		gtk_widget_destroy ((GtkWidget*) self);
	}
}

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

static void
show_time_time_window_watchapplet (ShowTimeTimeWindow* self,
                                   const gchar* uuid)
{
	Block1Data* _data1_;
	gchar* _tmp0_;
	gchar* general_path = NULL;
	gchar* _tmp1_;
	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_);
	_g_object_unref0 (self->priv->panel_settings);
	self->priv->panel_settings = _tmp3_;
	_tmp4_ = self->priv->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_;
			{
				gchar* panelpath = NULL;
				const gchar* _tmp9_;
				gchar* _tmp10_;
				const gchar* _tmp11_;
				gchar* _tmp12_;
				gchar* _tmp13_;
				const gchar* _tmp14_;
				GSettings* _tmp15_;
				GSettings* _tmp16_;
				gchar** _tmp17_;
				gchar** _tmp18_;
				gchar** _tmp19_;
				gint _tmp19__length1;
				_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_);
				_g_object_unref0 (self->priv->currpanelsubject_settings);
				self->priv->currpanelsubject_settings = _tmp15_;
				_g_free0 (_tmp13_);
				_tmp16_ = self->priv->currpanelsubject_settings;
				_tmp18_ = _tmp17_ = g_settings_get_strv (_tmp16_, "applets");
				_data1_->applets = (_vala_array_free (_data1_->applets, _data1_->applets_length1, (GDestroyNotify) g_free), NULL);
				_data1_->applets = _tmp18_;
				_data1_->applets_length1 = _vala_array_length (_tmp17_);
				_data1_->_applets_size_ = _data1_->applets_length1;
				_tmp19_ = _data1_->applets;
				_tmp19__length1 = _data1_->applets_length1;
				if (show_time_time_window_find_applet (self, _data1_->uuid, _tmp19_, (gint) _tmp19__length1)) {
					GSettings* _tmp20_;
					_tmp20_ = self->priv->currpanelsubject_settings;
					g_signal_connect_data (_tmp20_, "changed::applets", (GCallback) ______lambda4__g_settings_changed, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
					_g_free0 (panelpath);
					_g_free0 (p);
					break;
				}
				_g_free0 (panelpath);
				_g_free0 (p);
			}
		}
	}
	allpanels_list = (_vala_array_free (allpanels_list, allpanels_list_length1, (GDestroyNotify) g_free), NULL);
	_g_free0 (general_path);
	block1_data_unref (_data1_);
	_data1_ = NULL;
}

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_)) {
		ShowTimeTimeWindow* self;
		self = _data2_->self;
		_g_free0 (_data2_->uuid);
		_g_object_unref0 (self);
		g_slice_free (Block2Data, _data2_);
	}
}

static void
__lambda5_ (Block2Data* _data2_)
{
	ShowTimeTimeWindow* self;
	gchar** allwidgets_list = NULL;
	GSettings* _tmp0_;
	gchar** _tmp1_;
	gchar** _tmp2_;
	gint allwidgets_list_length1;
	gint _allwidgets_list_size_;
	gchar** _tmp3_;
	gint _tmp3__length1;
	self = _data2_->self;
	_tmp0_ = self->priv->raven_settings;
	_tmp2_ = _tmp1_ = g_settings_get_strv (_tmp0_, "uuids");
	allwidgets_list = _tmp2_;
	allwidgets_list_length1 = _vala_array_length (_tmp1_);
	_allwidgets_list_size_ = allwidgets_list_length1;
	_tmp3_ = allwidgets_list;
	_tmp3__length1 = allwidgets_list_length1;
	{
		gchar** u_collection = NULL;
		gint u_collection_length1 = 0;
		gint _u_collection_size_ = 0;
		gint u_it = 0;
		u_collection = _tmp3_;
		u_collection_length1 = _tmp3__length1;
		for (u_it = 0; u_it < u_collection_length1; u_it = u_it + 1) {
			gchar* _tmp4_;
			gchar* u = NULL;
			_tmp4_ = g_strdup (u_collection[u_it]);
			u = _tmp4_;
			{
				const gchar* _tmp5_;
				_tmp5_ = u;
				if (g_strcmp0 (_tmp5_, _data2_->uuid) == 0) {
					_g_free0 (u);
					allwidgets_list = (_vala_array_free (allwidgets_list, allwidgets_list_length1, (GDestroyNotify) g_free), NULL);
					return;
				}
				_g_free0 (u);
			}
		}
	}
	self->priv->showtime_onpanel = FALSE;
	gtk_widget_destroy ((GtkWidget*) self);
	allwidgets_list = (_vala_array_free (allwidgets_list, allwidgets_list_length1, (GDestroyNotify) g_free), NULL);
}

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

static void
show_time_time_window_watchplugin (ShowTimeTimeWindow* self,
                                   const gchar* uuid)
{
	Block2Data* _data2_;
	gchar* _tmp0_;
	gchar* general_path = NULL;
	gchar* _tmp1_;
	GSettings* _tmp2_;
	GSettings* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (uuid != NULL);
	_data2_ = g_slice_new0 (Block2Data);
	_data2_->_ref_count_ = 1;
	_data2_->self = g_object_ref (self);
	_tmp0_ = g_strdup (uuid);
	_g_free0 (_data2_->uuid);
	_data2_->uuid = _tmp0_;
	_tmp1_ = g_strdup ("org.buddiesofbudgie.budgie-desktop.raven.widgets");
	general_path = _tmp1_;
	_tmp2_ = g_settings_new (general_path);
	_g_object_unref0 (self->priv->raven_settings);
	self->priv->raven_settings = _tmp2_;
	_tmp3_ = self->priv->raven_settings;
	g_signal_connect_data (_tmp3_, "changed::uuids", (GCallback) ___lambda5__g_settings_changed, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
	_g_free0 (general_path);
	block2_data_unref (_data2_);
	_data2_ = 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_)) {
		ShowTimeTimeWindow* self;
		self = _data3_->self;
		_g_free0 (_data3_->uuid);
		_g_object_unref0 (self);
		g_slice_free (Block3Data, _data3_);
	}
}

static gboolean
__lambda6_ (Block3Data* _data3_)
{
	ShowTimeTimeWindow* self;
	gboolean result;
	self = _data3_->self;
	show_time_time_window_watchplugin (self, _data3_->uuid);
	result = FALSE;
	return result;
}

static gboolean
___lambda6__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda6_ (self);
	return result;
}

static void
_show_time_time_window_kill_onallmonitorschange_g_settings_changed (GSettings* _sender,
                                                                    const gchar* key,
                                                                    gpointer self)
{
	show_time_time_window_kill_onallmonitorschange ((ShowTimeTimeWindow*) self);
}

static void
__lambda7_ (ShowTimeTimeWindow* self)
{
	show_time_time_window_consider_toleave (self);
}

static void
___lambda7__gdk_screen_monitors_changed (GdkScreen* _sender,
                                         gpointer self)
{
	__lambda7_ ((ShowTimeTimeWindow*) self);
}

static void
_show_time_time_window_watchwins_wayland_libxfce4windowing_screen_window_opened (XfwScreen* _sender,
                                                                                 XfwWindow* window,
                                                                                 gpointer self)
{
	show_time_time_window_watchwins_wayland ((ShowTimeTimeWindow*) self, window);
}

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

static void
_show_time_time_window_update_appearance_g_settings_changed (GSettings* _sender,
                                                             const gchar* key,
                                                             gpointer self)
{
	show_time_time_window_update_appearance ((ShowTimeTimeWindow*) self);
}

static void
_show_time_time_window_toggle_draggable_g_settings_changed (GSettings* _sender,
                                                            const gchar* key,
                                                            gpointer self)
{
	show_time_time_window_toggle_draggable ((ShowTimeTimeWindow*) self);
}

static gboolean
_show_time_time_window_on_draw_gtk_widget_draw (GtkWidget* _sender,
                                                cairo_t* cr,
                                                gpointer self)
{
	gboolean result;
	result = show_time_time_window_on_draw ((ShowTimeTimeWindow*) self, _sender, cr);
	return result;
}

static gboolean
_show_time_time_window_setcondition_gtk_widget_configure_event (GtkWidget* _sender,
                                                                GdkEventConfigure* event,
                                                                gpointer self)
{
	gboolean result;
	result = show_time_time_window_setcondition ((ShowTimeTimeWindow*) self);
	return result;
}

static void
_show_time_time_window_set_windowposition_g_settings_changed (GSettings* _sender,
                                                              const gchar* key,
                                                              gpointer self)
{
	show_time_time_window_set_windowposition ((ShowTimeTimeWindow*) self);
}

static gpointer
_show_time_time_window_run_time_gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) show_time_time_window_run_time ((ShowTimeTimeWindow*) self));
	g_object_unref (self);
	return result;
}

static void
_show_time_time_window_update_appearance_delay_g_settings_changed (GSettings* _sender,
                                                                   const gchar* key,
                                                                   gpointer self)
{
	show_time_time_window_update_appearance_delay ((ShowTimeTimeWindow*) self);
}

ShowTimeTimeWindow*
show_time_time_window_construct (GType object_type,
                                 const gchar* uuid)
{
	ShowTimeTimeWindow * self = NULL;
	Block3Data* _data3_;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	GSettings* _tmp5_;
	GSettings* _tmp6_;
	GdkScreen* _tmp7_;
	GdkScreen* _tmp8_;
	GdkScreen* _tmp9_;
	XfwScreen* _tmp10_;
	XfwScreen* _tmp11_;
	gchar* _tmp12_;
	ShowTimeShowTimeappearance* _tmp13_;
	const gchar* _tmp14_;
	GtkGrid* maingrid = NULL;
	GtkGrid* _tmp15_;
	GtkLabel* _tmp16_;
	GtkLabel* _tmp17_;
	GtkGrid* _tmp18_;
	GtkLabel* _tmp19_;
	GtkGrid* _tmp20_;
	GtkLabel* _tmp21_;
	GtkGrid* _tmp22_;
	gchar** bind = NULL;
	gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	gchar* _tmp26_;
	gchar* _tmp27_;
	gchar* _tmp28_;
	gchar* _tmp29_;
	gchar* _tmp30_;
	gchar** _tmp31_;
	gint bind_length1;
	gint _bind_size_;
	gchar** _tmp32_;
	gint _tmp32__length1;
	GSettings* _tmp37_;
	ShowTimeShowTimeappearance* _tmp38_;
	GdkScreen* _tmp39_;
	GdkScreen* _tmp40_;
	GdkVisual* visual = NULL;
	GdkScreen* _tmp41_;
	GdkScreen* _tmp42_;
	GdkVisual* _tmp43_;
	GdkVisual* _tmp44_;
	GdkVisual* _tmp45_;
	gchar** bindpos = NULL;
	gchar* _tmp46_;
	gchar* _tmp47_;
	gchar* _tmp48_;
	gchar** _tmp49_;
	gint bindpos_length1;
	gint _bindpos_size_;
	gchar** _tmp50_;
	gint _tmp50__length1;
	GThread* _tmp55_;
	GThread* _tmp56_;
	GSettings* _tmp57_;
	gchar** restart_keys = NULL;
	gchar* _tmp58_;
	gchar* _tmp59_;
	gchar** _tmp60_;
	gint restart_keys_length1;
	gint _restart_keys_size_;
	gchar** _tmp61_;
	gint _tmp61__length1;
	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 = (ShowTimeTimeWindow*) g_object_new (object_type, NULL);
	_data3_->self = g_object_ref (self);
	g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 1, ___lambda6__gsource_func, block3_data_ref (_data3_), block3_data_unref);
	self->priv->close_onnew = FALSE;
	self->priv->bypass = FALSE;
	_tmp1_ = g_strconcat ("/org/buddiesofbudgie/budgie-desktop/raven/widgets/instance-settings/", _data3_->uuid, NULL);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strconcat (_tmp2_, "/", NULL);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_settings_new_with_path ("org.ubuntubudgie.raven.widget.budgie-showtime", _tmp4_);
	_g_object_unref0 (show_time_showtime_settings);
	show_time_showtime_settings = _tmp5_;
	_g_free0 (_tmp4_);
	_g_free0 (_tmp2_);
	_tmp6_ = show_time_showtime_settings;
	g_signal_connect_object (_tmp6_, "changed::allmonitors", (GCallback) _show_time_time_window_kill_onallmonitorschange_g_settings_changed, self, 0);
	_tmp7_ = gtk_window_get_screen ((GtkWindow*) self);
	gtk_window_set_screen ((GtkWindow*) self, _tmp7_);
	_tmp8_ = gtk_window_get_screen ((GtkWindow*) self);
	_tmp9_ = _tmp8_;
	g_signal_connect_object (_tmp9_, "monitors-changed", (GCallback) ___lambda7__gdk_screen_monitors_changed, self, 0);
	_tmp10_ = xfw_screen_get_default ();
	_g_object_unref0 (show_time_xfw_screen);
	show_time_xfw_screen = _tmp10_;
	_tmp11_ = show_time_xfw_screen;
	g_signal_connect_object (_tmp11_, "window-opened", (GCallback) _show_time_time_window_watchwins_wayland_libxfce4windowing_screen_window_opened, self, 0);
	_tmp12_ = show_time_time_window_get_dateformat (self);
	_g_free0 (self->priv->dateformat);
	self->priv->dateformat = _tmp12_;
	_tmp13_ = show_time_show_timeappearance_new ();
	_show_time_show_timeappearance_unref0 (self->priv->appearance);
	self->priv->appearance = _tmp13_;
	_tmp14_ = show_time_win_name;
	gtk_window_set_title ((GtkWindow*) self, _tmp14_);
	gtk_window_set_type_hint ((GtkWindow*) self, GDK_WINDOW_TYPE_HINT_DESKTOP);
	gtk_window_set_resizable ((GtkWindow*) self, FALSE);
	gtk_layer_init_for_window ((GtkWindow*) self);
	gtk_layer_set_layer ((GtkWindow*) self, GTK_LAYER_SHELL_LAYER_BOTTOM);
	gtk_layer_set_keyboard_mode ((GtkWindow*) self, GTK_LAYER_SHELL_KEYBOARD_MODE_NONE);
	g_signal_connect ((GtkWidget*) self, "destroy", (GCallback) _gtk_main_quit_gtk_widget_destroy, NULL);
	gtk_window_set_decorated ((GtkWindow*) self, FALSE);
	_tmp15_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp15_);
	maingrid = _tmp15_;
	_tmp16_ = (GtkLabel*) gtk_label_new ("");
	g_object_ref_sink (_tmp16_);
	_g_object_unref0 (show_time_timelabel);
	show_time_timelabel = _tmp16_;
	_tmp17_ = (GtkLabel*) gtk_label_new ("");
	g_object_ref_sink (_tmp17_);
	_g_object_unref0 (show_time_datelabel);
	show_time_datelabel = _tmp17_;
	_tmp18_ = maingrid;
	_tmp19_ = show_time_timelabel;
	gtk_grid_attach (_tmp18_, (GtkWidget*) _tmp19_, 0, 0, 1, 1);
	_tmp20_ = maingrid;
	_tmp21_ = show_time_datelabel;
	gtk_grid_attach (_tmp20_, (GtkWidget*) _tmp21_, 0, 1, 1, 1);
	_tmp22_ = maingrid;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp22_);
	_tmp23_ = g_strdup ("leftalign");
	_tmp24_ = g_strdup ("twelvehrs");
	_tmp25_ = g_strdup ("linespacing");
	_tmp26_ = g_strdup ("timefontcolor");
	_tmp27_ = g_strdup ("linespacing");
	_tmp28_ = g_strdup ("datefontcolor");
	_tmp29_ = g_strdup ("timefont");
	_tmp30_ = g_strdup ("datefont");
	_tmp31_ = g_new0 (gchar*, 8 + 1);
	_tmp31_[0] = _tmp23_;
	_tmp31_[1] = _tmp24_;
	_tmp31_[2] = _tmp25_;
	_tmp31_[3] = _tmp26_;
	_tmp31_[4] = _tmp27_;
	_tmp31_[5] = _tmp28_;
	_tmp31_[6] = _tmp29_;
	_tmp31_[7] = _tmp30_;
	bind = _tmp31_;
	bind_length1 = 8;
	_bind_size_ = bind_length1;
	_tmp32_ = bind;
	_tmp32__length1 = bind_length1;
	{
		gchar** s_collection = NULL;
		gint s_collection_length1 = 0;
		gint _s_collection_size_ = 0;
		gint s_it = 0;
		s_collection = _tmp32_;
		s_collection_length1 = _tmp32__length1;
		for (s_it = 0; s_it < s_collection_length1; s_it = s_it + 1) {
			gchar* _tmp33_;
			gchar* s = NULL;
			_tmp33_ = g_strdup (s_collection[s_it]);
			s = _tmp33_;
			{
				GSettings* _tmp34_;
				const gchar* _tmp35_;
				gchar* _tmp36_;
				_tmp34_ = show_time_showtime_settings;
				_tmp35_ = s;
				_tmp36_ = g_strconcat ("changed::", _tmp35_, NULL);
				g_signal_connect_object (_tmp34_, _tmp36_, (GCallback) _show_time_time_window_update_appearance_g_settings_changed, self, 0);
				_g_free0 (_tmp36_);
				_g_free0 (s);
			}
		}
	}
	_tmp37_ = show_time_showtime_settings;
	g_signal_connect_object (_tmp37_, "changed::draggable", (GCallback) _show_time_time_window_toggle_draggable_g_settings_changed, self, 0);
	show_time_time_window_update_appearance (self);
	_tmp38_ = self->priv->appearance;
	_tmp39_ = gtk_window_get_screen ((GtkWindow*) self);
	_tmp40_ = _tmp39_;
	show_time_show_timeappearance_get_appearance (_tmp38_, _tmp40_);
	gtk_widget_set_app_paintable ((GtkWidget*) self, TRUE);
	_tmp41_ = gtk_window_get_screen ((GtkWindow*) self);
	_tmp42_ = _tmp41_;
	_tmp43_ = gdk_screen_get_rgba_visual (_tmp42_);
	_tmp44_ = _g_object_ref0 (_tmp43_);
	visual = _tmp44_;
	_tmp45_ = visual;
	gtk_widget_set_visual ((GtkWidget*) self, _tmp45_);
	g_signal_connect_object ((GtkWidget*) self, "draw", (GCallback) _show_time_time_window_on_draw_gtk_widget_draw, self, 0);
	gtk_widget_show_all ((GtkWidget*) self);
	show_time_time_window_set_windowposition (self);
	g_signal_connect_object ((GtkWidget*) self, "configure-event", (GCallback) _show_time_time_window_setcondition_gtk_widget_configure_event, self, 0);
	_tmp46_ = g_strdup ("xposition");
	_tmp47_ = g_strdup ("yposition");
	_tmp48_ = g_strdup ("autoposition");
	_tmp49_ = g_new0 (gchar*, 3 + 1);
	_tmp49_[0] = _tmp46_;
	_tmp49_[1] = _tmp47_;
	_tmp49_[2] = _tmp48_;
	bindpos = _tmp49_;
	bindpos_length1 = 3;
	_bindpos_size_ = bindpos_length1;
	_tmp50_ = bindpos;
	_tmp50__length1 = bindpos_length1;
	{
		gchar** s_collection = NULL;
		gint s_collection_length1 = 0;
		gint _s_collection_size_ = 0;
		gint s_it = 0;
		s_collection = _tmp50_;
		s_collection_length1 = _tmp50__length1;
		for (s_it = 0; s_it < s_collection_length1; s_it = s_it + 1) {
			gchar* _tmp51_;
			gchar* s = NULL;
			_tmp51_ = g_strdup (s_collection[s_it]);
			s = _tmp51_;
			{
				GSettings* _tmp52_;
				const gchar* _tmp53_;
				gchar* _tmp54_;
				_tmp52_ = show_time_showtime_settings;
				_tmp53_ = s;
				_tmp54_ = g_strconcat ("changed::", _tmp53_, NULL);
				g_signal_connect_object (_tmp52_, _tmp54_, (GCallback) _show_time_time_window_set_windowposition_g_settings_changed, self, 0);
				_g_free0 (_tmp54_);
				_g_free0 (s);
			}
		}
	}
	_tmp55_ = g_thread_new ("oldtimer", _show_time_time_window_run_time_gthread_func, g_object_ref (self));
	_tmp56_ = _tmp55_;
	_g_thread_unref0 (_tmp56_);
	_tmp57_ = g_settings_new ("org.gnome.desktop.interface");
	_g_object_unref0 (self->priv->text_scaling);
	self->priv->text_scaling = _tmp57_;
	_tmp58_ = g_strdup ("text-scaling-factor");
	_tmp59_ = g_strdup ("font-name");
	_tmp60_ = g_new0 (gchar*, 2 + 1);
	_tmp60_[0] = _tmp58_;
	_tmp60_[1] = _tmp59_;
	restart_keys = _tmp60_;
	restart_keys_length1 = 2;
	_restart_keys_size_ = restart_keys_length1;
	_tmp61_ = restart_keys;
	_tmp61__length1 = restart_keys_length1;
	{
		gchar** s_collection = NULL;
		gint s_collection_length1 = 0;
		gint _s_collection_size_ = 0;
		gint s_it = 0;
		s_collection = _tmp61_;
		s_collection_length1 = _tmp61__length1;
		for (s_it = 0; s_it < s_collection_length1; s_it = s_it + 1) {
			gchar* _tmp62_;
			gchar* s = NULL;
			_tmp62_ = g_strdup (s_collection[s_it]);
			s = _tmp62_;
			{
				GSettings* _tmp63_;
				const gchar* _tmp64_;
				gchar* _tmp65_;
				_tmp63_ = self->priv->text_scaling;
				_tmp64_ = s;
				_tmp65_ = g_strconcat ("changed::", _tmp64_, NULL);
				g_signal_connect_object (_tmp63_, _tmp65_, (GCallback) _show_time_time_window_update_appearance_delay_g_settings_changed, self, G_CONNECT_AFTER);
				_g_free0 (_tmp65_);
				_g_free0 (s);
			}
		}
	}
	restart_keys = (_vala_array_free (restart_keys, restart_keys_length1, (GDestroyNotify) g_free), NULL);
	bindpos = (_vala_array_free (bindpos, bindpos_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (visual);
	bind = (_vala_array_free (bind, bind_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (maingrid);
	block3_data_unref (_data3_);
	_data3_ = NULL;
	return self;
}

ShowTimeTimeWindow*
show_time_time_window_new (const gchar* uuid)
{
	return show_time_time_window_construct (SHOW_TIME_TYPE_TIME_WINDOW, uuid);
}

static void
show_time_time_window_consider_toleave (ShowTimeTimeWindow* self)
{
	g_return_if_fail (self != NULL);
	if (show_time_subwindow) {
		gtk_main_quit ();
	} else {
		show_time_time_window_set_windowposition (self);
	}
}

static void
show_time_time_window_kill_onallmonitorschange (ShowTimeTimeWindow* self)
{
	g_return_if_fail (self != NULL);
	if (show_time_subwindow) {
		show_time_time_window_consider_toleave (self);
	}
}

static void
show_time_time_window_watchwins_wayland (ShowTimeTimeWindow* self,
                                         XfwWindow* newwin)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (newwin != NULL);
	_tmp0_ = xfw_window_get_name (newwin);
	_tmp1_ = show_time_win_name;
	if (g_strcmp0 (_tmp0_, _tmp1_) == 0) {
		if (self->priv->close_onnew) {
			show_time_time_window_consider_toleave (self);
		}
		self->priv->close_onnew = TRUE;
	}
}

static gboolean
show_time_time_window_setcondition (ShowTimeTimeWindow* self)
{
	gboolean drag = FALSE;
	GSettings* _tmp0_;
	gboolean _tmp1_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	self->priv->bypass = !self->priv->bypass;
	_tmp0_ = show_time_showtime_settings;
	drag = g_settings_get_boolean (_tmp0_, "draggable");
	if (!self->priv->bypass) {
		_tmp1_ = !drag;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		show_time_time_window_set_windowposition (self);
	}
	result = FALSE;
	return result;
}

static gboolean
show_time_time_window_get_leftalign (ShowTimeTimeWindow* self)
{
	GSettings* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = show_time_showtime_settings;
	result = g_settings_get_boolean (_tmp0_, "leftalign");
	return result;
}

static gint*
show_time_time_window_get_windowsize (ShowTimeTimeWindow* self,
                                      gint* result_length1)
{
	gint width = 0;
	gint height = 0;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	gint* _tmp2_;
	gint* _tmp3_;
	gint _tmp3__length1;
	gint* result;
	g_return_val_if_fail (self != NULL, NULL);
	gtk_window_get_size ((GtkWindow*) self, &_tmp0_, &_tmp1_);
	width = _tmp0_;
	height = _tmp1_;
	_tmp2_ = g_new0 (gint, 2);
	_tmp2_[0] = width;
	_tmp2_[1] = height;
	_tmp3_ = _tmp2_;
	_tmp3__length1 = 2;
	if (result_length1) {
		*result_length1 = _tmp3__length1;
	}
	result = _tmp3_;
	return result;
}

gint
show_time_time_window_getscale (ShowTimeTimeWindow* self)
{
	GdkMonitor* prim = NULL;
	GdkDisplay* _tmp0_;
	GdkMonitor* _tmp1_;
	GdkMonitor* _tmp2_;
	gint scaling = 0;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	_tmp0_ = gdk_display_get_default ();
	_tmp1_ = gdk_display_get_primary_monitor (_tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	prim = _tmp2_;
	scaling = gdk_monitor_get_scale_factor (prim);
	result = scaling;
	_g_object_unref0 (prim);
	return result;
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

void
show_time_time_window_set_windowposition (ShowTimeTimeWindow* self)
{
	gint scale = 0;
	gint setx = 0;
	gint sety = 0;
	gchar* anchor = NULL;
	gint* winsize = NULL;
	gint _tmp17_ = 0;
	gint* _tmp18_;
	gint winsize_length1;
	gint _winsize_size_;
	gint margin_left = 0;
	gint margin_right = 0;
	gint margin_top = 0;
	gint margin_bottom = 0;
	gint* screendata = NULL;
	gint _tmp19_ = 0;
	gint* _tmp20_;
	gint screendata_length1;
	gint _screendata_size_;
	gint screen_width = 0;
	gint* _tmp21_;
	gint _tmp21__length1;
	gint _tmp22_;
	gint screen_height = 0;
	gint* _tmp23_;
	gint _tmp23__length1;
	gint _tmp24_;
	const gchar* _tmp25_;
	const gchar* _tmp26_;
	g_return_if_fail (self != NULL);
	scale = show_time_time_window_getscale (self);
	if (show_time_subwindow) {
		gint* _tmp0_;
		gint _tmp0__length1;
		gint _tmp1_;
		gint* _tmp2_;
		gint _tmp2__length1;
		gint _tmp3_;
		gchar* _tmp4_;
		_tmp0_ = show_time_custom_posargs;
		_tmp0__length1 = show_time_custom_posargs_length1;
		_tmp1_ = _tmp0_[0];
		setx = _tmp1_;
		_tmp2_ = show_time_custom_posargs;
		_tmp2__length1 = show_time_custom_posargs_length1;
		_tmp3_ = _tmp2_[1];
		sety = _tmp3_;
		_tmp4_ = g_strdup ("se");
		_g_free0 (anchor);
		anchor = _tmp4_;
	} else {
		GSettings* _tmp5_;
		_tmp5_ = show_time_showtime_settings;
		if (g_settings_get_boolean (_tmp5_, "autoposition")) {
			gint* newpos = NULL;
			gint _tmp6_ = 0;
			gint* _tmp7_;
			gint newpos_length1;
			gint _newpos_size_;
			gint* _tmp8_;
			gint _tmp8__length1;
			gint _tmp9_;
			gint* _tmp10_;
			gint _tmp10__length1;
			gint _tmp11_;
			gchar* _tmp12_;
			_tmp7_ = show_time_time_window_get_default_right (self, &_tmp6_);
			newpos = _tmp7_;
			newpos_length1 = _tmp6_;
			_newpos_size_ = newpos_length1;
			_tmp8_ = newpos;
			_tmp8__length1 = newpos_length1;
			_tmp9_ = _tmp8_[0];
			setx = _tmp9_;
			_tmp10_ = newpos;
			_tmp10__length1 = newpos_length1;
			_tmp11_ = _tmp10_[1];
			sety = _tmp11_;
			_tmp12_ = g_strdup ("se");
			_g_free0 (anchor);
			anchor = _tmp12_;
			newpos = (g_free (newpos), NULL);
		} else {
			GSettings* _tmp13_;
			gchar* _tmp14_;
			GSettings* _tmp15_;
			GSettings* _tmp16_;
			_tmp13_ = show_time_showtime_settings;
			_tmp14_ = g_settings_get_string (_tmp13_, "anchor");
			_g_free0 (anchor);
			anchor = _tmp14_;
			_tmp15_ = show_time_showtime_settings;
			setx = g_settings_get_int (_tmp15_, "xposition") / scale;
			_tmp16_ = show_time_showtime_settings;
			sety = g_settings_get_int (_tmp16_, "yposition") / scale;
		}
	}
	_tmp18_ = show_time_time_window_get_windowsize (self, &_tmp17_);
	winsize = _tmp18_;
	winsize_length1 = _tmp17_;
	_winsize_size_ = winsize_length1;
	gtk_layer_set_anchor ((GtkWindow*) self, GTK_LAYER_SHELL_EDGE_TOP, FALSE);
	gtk_layer_set_anchor ((GtkWindow*) self, GTK_LAYER_SHELL_EDGE_BOTTOM, FALSE);
	gtk_layer_set_anchor ((GtkWindow*) self, GTK_LAYER_SHELL_EDGE_LEFT, FALSE);
	gtk_layer_set_anchor ((GtkWindow*) self, GTK_LAYER_SHELL_EDGE_RIGHT, FALSE);
	margin_left = 0;
	margin_right = 0;
	margin_top = 0;
	margin_bottom = 0;
	_tmp20_ = show_time_time_window_check_res (self, &_tmp19_);
	screendata = _tmp20_;
	screendata_length1 = _tmp19_;
	_screendata_size_ = screendata_length1;
	_tmp21_ = screendata;
	_tmp21__length1 = screendata_length1;
	_tmp22_ = _tmp21_[0];
	screen_width = _tmp22_;
	_tmp23_ = screendata;
	_tmp23__length1 = screendata_length1;
	_tmp24_ = _tmp23_[1];
	screen_height = _tmp24_;
	_tmp25_ = anchor;
	if (string_contains (_tmp25_, "e")) {
		margin_right = screen_width - setx;
		gtk_layer_set_anchor ((GtkWindow*) self, GTK_LAYER_SHELL_EDGE_RIGHT, TRUE);
	} else {
		margin_left = setx;
		gtk_layer_set_anchor ((GtkWindow*) self, GTK_LAYER_SHELL_EDGE_LEFT, TRUE);
	}
	_tmp26_ = anchor;
	if (string_contains (_tmp26_, "s")) {
		margin_bottom = screen_height - sety;
		gtk_layer_set_anchor ((GtkWindow*) self, GTK_LAYER_SHELL_EDGE_BOTTOM, TRUE);
	} else {
		margin_top = sety;
		gtk_layer_set_anchor ((GtkWindow*) self, GTK_LAYER_SHELL_EDGE_TOP, TRUE);
	}
	gtk_layer_set_margin ((GtkWindow*) self, GTK_LAYER_SHELL_EDGE_LEFT, margin_left);
	gtk_layer_set_margin ((GtkWindow*) self, GTK_LAYER_SHELL_EDGE_RIGHT, margin_right);
	gtk_layer_set_margin ((GtkWindow*) self, GTK_LAYER_SHELL_EDGE_TOP, margin_top);
	gtk_layer_set_margin ((GtkWindow*) self, GTK_LAYER_SHELL_EDGE_BOTTOM, margin_bottom);
	screendata = (g_free (screendata), NULL);
	winsize = (g_free (winsize), NULL);
	_g_free0 (anchor);
}

static gint*
show_time_time_window_get_default_right (ShowTimeTimeWindow* self,
                                         gint* result_length1)
{
	gint* screendata = NULL;
	gint _tmp0_ = 0;
	gint* _tmp1_;
	gint screendata_length1;
	gint _screendata_size_;
	gint x = 0;
	gint _tmp2_;
	gint _tmp3_;
	gint y = 0;
	gint _tmp4_;
	gint _tmp5_;
	gint* _tmp6_;
	gint* _tmp7_;
	gint _tmp7__length1;
	gint* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = show_time_time_window_check_res (self, &_tmp0_);
	screendata = _tmp1_;
	screendata_length1 = _tmp0_;
	_screendata_size_ = screendata_length1;
	_tmp2_ = screendata[0];
	_tmp3_ = screendata[2];
	x = (_tmp2_ + _tmp3_) - 150;
	_tmp4_ = screendata[1];
	_tmp5_ = screendata[3];
	y = (_tmp4_ + _tmp5_) - 150;
	_tmp6_ = g_new0 (gint, 2);
	_tmp6_[0] = x;
	_tmp6_[1] = y;
	_tmp7_ = _tmp6_;
	_tmp7__length1 = 2;
	if (result_length1) {
		*result_length1 = _tmp7__length1;
	}
	result = _tmp7_;
	screendata = (g_free (screendata), NULL);
	return result;
}

static gint*
show_time_time_window_check_res (ShowTimeTimeWindow* self,
                                 gint* result_length1)
{
	XfwScreen* xfw_screen = NULL;
	XfwScreen* _tmp0_;
	XfwMonitor* mon = NULL;
	XfwScreen* _tmp1_;
	XfwMonitor* _tmp2_;
	XfwMonitor* _tmp3_;
	gint width = 0;
	gint height = 0;
	gint screen_xpos = 0;
	gint screen_ypos = 0;
	XfwMonitor* _tmp4_;
	gint* _tmp11_;
	gint* _tmp12_;
	gint _tmp12__length1;
	gint* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = xfw_screen_get_default ();
	xfw_screen = _tmp0_;
	_tmp1_ = xfw_screen;
	_tmp2_ = xfw_screen_get_primary_monitor (_tmp1_);
	_tmp3_ = _g_object_ref0 (_tmp2_);
	mon = _tmp3_;
	width = 800;
	height = 600;
	screen_xpos = 0;
	screen_ypos = 0;
	_tmp4_ = mon;
	if (_tmp4_ != NULL) {
		GdkRectangle workarea = {0};
		XfwMonitor* _tmp5_;
		GdkRectangle _tmp6_ = {0};
		GdkRectangle _tmp7_;
		GdkRectangle _tmp8_;
		GdkRectangle _tmp9_;
		GdkRectangle _tmp10_;
		_tmp5_ = mon;
		xfw_monitor_get_workarea (_tmp5_, &_tmp6_);
		workarea = _tmp6_;
		_tmp7_ = workarea;
		width = _tmp7_.width;
		_tmp8_ = workarea;
		height = _tmp8_.height;
		_tmp9_ = workarea;
		screen_xpos = _tmp9_.x;
		_tmp10_ = workarea;
		screen_ypos = _tmp10_.y;
	}
	_tmp11_ = g_new0 (gint, 4);
	_tmp11_[0] = width;
	_tmp11_[1] = height;
	_tmp11_[2] = screen_xpos;
	_tmp11_[3] = screen_ypos;
	_tmp12_ = _tmp11_;
	_tmp12__length1 = 4;
	if (result_length1) {
		*result_length1 = _tmp12__length1;
	}
	result = _tmp12_;
	_g_object_unref0 (mon);
	_g_object_unref0 (xfw_screen);
	return result;
}

static gboolean
show_time_time_window_on_draw (ShowTimeTimeWindow* 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, (gdouble) 0);
	cairo_set_operator (ctx, CAIRO_OPERATOR_SOURCE);
	cairo_paint (ctx);
	cairo_set_operator (ctx, CAIRO_OPERATOR_OVER);
	result = FALSE;
	return result;
}

static gint
show_time_time_window_get_containingindex (ShowTimeTimeWindow* self,
                                           gchar** arr,
                                           gint arr_length1,
                                           const gchar* lookfor)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	g_return_val_if_fail (lookfor != 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 (string_contains (lookfor, _tmp2_)) {
					result = i;
					return result;
				}
			}
		}
	}
	result = -1;
	return result;
}

static gchar*
show_time_time_window_fix_mins (ShowTimeTimeWindow* self,
                                gint minutes)
{
	gchar* minsdisplay = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup_printf ("%i", minutes);
	minsdisplay = _tmp0_;
	_tmp1_ = minsdisplay;
	_tmp2_ = strlen (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_ == 1) {
		const gchar* _tmp4_;
		gchar* _tmp5_;
		_tmp4_ = minsdisplay;
		_tmp5_ = g_strconcat ("0", _tmp4_, NULL);
		result = _tmp5_;
		_g_free0 (minsdisplay);
		return result;
	}
	result = minsdisplay;
	return result;
}

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

static gchar*
show_time_time_window_get_localtime (ShowTimeTimeWindow* self,
                                     GDateTime* newtime)
{
	gint mins = 0;
	gint hrs = 0;
	gint newhrs = 0;
	gchar* add = NULL;
	gchar* _tmp0_;
	gchar* showmins = NULL;
	gchar* _tmp1_;
	gchar* hrs_display = NULL;
	gchar* _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	const gchar* _tmp16_;
	const gchar* _tmp17_;
	const gchar* _tmp18_;
	const gchar* _tmp19_;
	gchar* _tmp20_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (newtime != NULL, NULL);
	mins = g_date_time_get_minute (newtime);
	hrs = g_date_time_get_hour (newtime);
	newhrs = hrs;
	_tmp0_ = g_strdup ("");
	add = _tmp0_;
	_tmp1_ = show_time_time_window_fix_mins (self, mins);
	showmins = _tmp1_;
	if (self->priv->twelvehrs) {
		gchar* _tmp2_;
		gint _tmp3_;
		gchar* _tmp5_;
		gchar* _tmp6_;
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		const gchar* _tmp9_;
		const gchar* _tmp10_;
		gchar* _tmp11_;
		gchar* _tmp12_;
		_tmp2_ = g_strconcat (" ", _ ("AM"), NULL);
		_g_free0 (add);
		add = _tmp2_;
		if (hrs > 12) {
			newhrs = hrs - 12;
		} else {
			if (hrs < 1) {
				newhrs = hrs + 12;
			}
		}
		_tmp3_ = hrs;
		if ((12 <= _tmp3_) && (_tmp3_ < 24)) {
			gchar* _tmp4_;
			_tmp4_ = g_strconcat (" ", _ ("PM"), NULL);
			_g_free0 (add);
			add = _tmp4_;
		}
		_tmp5_ = g_strdup_printf ("%i", newhrs);
		_tmp6_ = _tmp5_;
		_tmp7_ = showmins;
		_tmp8_ = string_to_string (_tmp7_);
		_tmp9_ = add;
		_tmp10_ = string_to_string (_tmp9_);
		_tmp11_ = g_strconcat (_tmp6_, ":", _tmp8_, _tmp10_, NULL);
		_tmp12_ = _tmp11_;
		_g_free0 (_tmp6_);
		result = _tmp12_;
		_g_free0 (showmins);
		_g_free0 (add);
		return result;
	}
	_tmp13_ = show_time_time_window_fix_mins (self, newhrs);
	hrs_display = _tmp13_;
	_tmp14_ = hrs_display;
	_tmp15_ = string_to_string (_tmp14_);
	_tmp16_ = showmins;
	_tmp17_ = string_to_string (_tmp16_);
	_tmp18_ = add;
	_tmp19_ = string_to_string (_tmp18_);
	_tmp20_ = g_strconcat (_tmp15_, ":", _tmp17_, _tmp19_, NULL);
	result = _tmp20_;
	_g_free0 (hrs_display);
	_g_free0 (showmins);
	_g_free0 (add);
	return result;
}

static gchar*
show_time_time_window_get_dateformat (ShowTimeTimeWindow* self)
{
	gchar* date_fmt = NULL;
	GSettings* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = show_time_showtime_settings;
	_tmp1_ = g_settings_get_string (_tmp0_, "dateformat");
	date_fmt = _tmp1_;
	_tmp2_ = date_fmt;
	if (g_strcmp0 (_tmp2_, "") == 0) {
		gchar* _tmp3_;
		_tmp3_ = show_time_time_window_read_dateformat (self);
		result = _tmp3_;
		_g_free0 (date_fmt);
		return result;
	}
	result = date_fmt;
	return result;
}

static gchar*
show_time_time_window_read_dateformat (ShowTimeTimeWindow* self)
{
	gchar** monthvars = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar** _tmp7_;
	gint monthvars_length1;
	gint _monthvars_size_;
	gchar** daynamevars = NULL;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar** _tmp14_;
	gint daynamevars_length1;
	gint _daynamevars_size_;
	gchar** monthdayvars = NULL;
	gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	gchar** _tmp21_;
	gint monthdayvars_length1;
	gint _monthdayvars_size_;
	gchar* cmd = NULL;
	gchar* _tmp22_;
	gchar* output = NULL;
	gchar* _tmp23_;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup ("%B");
	_tmp1_ = g_strdup ("%-b");
	_tmp2_ = g_strdup ("%_b");
	_tmp3_ = g_strdup ("%h");
	_tmp4_ = g_strdup ("%-h");
	_tmp5_ = g_strdup ("%_h");
	_tmp6_ = g_strdup ("%b");
	_tmp7_ = g_new0 (gchar*, 7 + 1);
	_tmp7_[0] = _tmp0_;
	_tmp7_[1] = _tmp1_;
	_tmp7_[2] = _tmp2_;
	_tmp7_[3] = _tmp3_;
	_tmp7_[4] = _tmp4_;
	_tmp7_[5] = _tmp5_;
	_tmp7_[6] = _tmp6_;
	monthvars = _tmp7_;
	monthvars_length1 = 7;
	_monthvars_size_ = monthvars_length1;
	_tmp8_ = g_strdup ("%A");
	_tmp9_ = g_strdup ("%a");
	_tmp10_ = g_strdup ("%-a");
	_tmp11_ = g_strdup ("%-A");
	_tmp12_ = g_strdup ("%_a");
	_tmp13_ = g_strdup ("%_A");
	_tmp14_ = g_new0 (gchar*, 6 + 1);
	_tmp14_[0] = _tmp8_;
	_tmp14_[1] = _tmp9_;
	_tmp14_[2] = _tmp10_;
	_tmp14_[3] = _tmp11_;
	_tmp14_[4] = _tmp12_;
	_tmp14_[5] = _tmp13_;
	daynamevars = _tmp14_;
	daynamevars_length1 = 6;
	_daynamevars_size_ = daynamevars_length1;
	_tmp15_ = g_strdup ("%e");
	_tmp16_ = g_strdup ("%-e");
	_tmp17_ = g_strdup ("%_e");
	_tmp18_ = g_strdup ("%d");
	_tmp19_ = g_strdup ("%-d");
	_tmp20_ = g_strdup ("%_d");
	_tmp21_ = g_new0 (gchar*, 6 + 1);
	_tmp21_[0] = _tmp15_;
	_tmp21_[1] = _tmp16_;
	_tmp21_[2] = _tmp17_;
	_tmp21_[3] = _tmp18_;
	_tmp21_[4] = _tmp19_;
	_tmp21_[5] = _tmp20_;
	monthdayvars = _tmp21_;
	monthdayvars_length1 = 6;
	_monthdayvars_size_ = monthdayvars_length1;
	_tmp22_ = g_strdup (PACKAGE_BINDIR "/locale date_fmt");
	cmd = _tmp22_;
	_tmp23_ = g_strdup ("");
	output = _tmp23_;
	{
		GString* builder = NULL;
		GString* _tmp24_;
		gchar* _tmp25_ = NULL;
		gchar** output_data = NULL;
		const gchar* _tmp26_;
		gchar** _tmp27_;
		gchar** _tmp28_;
		gint output_data_length1;
		gint _output_data_size_;
		gchar** _tmp29_;
		gint _tmp29__length1;
		const gchar* _tmp40_;
		gchar* _tmp41_;
		_tmp24_ = g_string_new ("");
		builder = _tmp24_;
		g_spawn_command_line_sync (cmd, &_tmp25_, NULL, NULL, &_inner_error0_);
		_g_free0 (output);
		output = _tmp25_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_string_free0 (builder);
			goto __catch0_g_error;
		}
		_tmp26_ = output;
		_tmp28_ = _tmp27_ = g_strsplit (_tmp26_, " ", 0);
		output_data = _tmp28_;
		output_data_length1 = _vala_array_length (_tmp27_);
		_output_data_size_ = output_data_length1;
		_tmp29_ = output_data;
		_tmp29__length1 = output_data_length1;
		{
			gchar** s_collection = NULL;
			gint s_collection_length1 = 0;
			gint _s_collection_size_ = 0;
			gint s_it = 0;
			s_collection = _tmp29_;
			s_collection_length1 = _tmp29__length1;
			for (s_it = 0; s_it < s_collection_length1; s_it = s_it + 1) {
				gchar* _tmp30_;
				gchar* s = NULL;
				_tmp30_ = g_strdup (s_collection[s_it]);
				s = _tmp30_;
				{
					const gchar* _tmp31_;
					_tmp31_ = s;
					if (show_time_time_window_get_containingindex (self, monthvars, (gint) monthvars_length1, _tmp31_) != -1) {
						const gchar* _tmp32_;
						GString* _tmp33_;
						_tmp32_ = monthvars[0];
						_tmp33_ = g_string_append (builder, _tmp32_);
						g_string_append (_tmp33_, " ");
					} else {
						const gchar* _tmp34_;
						_tmp34_ = s;
						if (show_time_time_window_get_containingindex (self, daynamevars, (gint) daynamevars_length1, _tmp34_) != -1) {
							const gchar* _tmp35_;
							GString* _tmp36_;
							_tmp35_ = daynamevars[0];
							_tmp36_ = g_string_append (builder, _tmp35_);
							g_string_append (_tmp36_, " ");
						} else {
							const gchar* _tmp37_;
							_tmp37_ = s;
							if (show_time_time_window_get_containingindex (self, monthdayvars, (gint) monthdayvars_length1, _tmp37_) != -1) {
								const gchar* _tmp38_;
								GString* _tmp39_;
								_tmp38_ = monthdayvars[0];
								_tmp39_ = g_string_append (builder, _tmp38_);
								g_string_append (_tmp39_, " ");
							}
						}
					}
					_g_free0 (s);
				}
			}
		}
		_tmp40_ = builder->str;
		_tmp41_ = g_strdup (_tmp40_);
		result = _tmp41_;
		output_data = (_vala_array_free (output_data, output_data_length1, (GDestroyNotify) g_free), NULL);
		_g_string_free0 (builder);
		_g_free0 (output);
		_g_free0 (cmd);
		monthdayvars = (_vala_array_free (monthdayvars, monthdayvars_length1, (GDestroyNotify) g_free), NULL);
		daynamevars = (_vala_array_free (daynamevars, daynamevars_length1, (GDestroyNotify) g_free), NULL);
		monthvars = (_vala_array_free (monthvars, monthvars_length1, (GDestroyNotify) g_free), NULL);
		return result;
	}
	goto __finally0;
	__catch0_g_error:
	{
		gchar* _tmp42_;
		g_clear_error (&_inner_error0_);
		_tmp42_ = g_strdup ("");
		result = _tmp42_;
		_g_free0 (output);
		_g_free0 (cmd);
		monthdayvars = (_vala_array_free (monthdayvars, monthdayvars_length1, (GDestroyNotify) g_free), NULL);
		daynamevars = (_vala_array_free (daynamevars, daynamevars_length1, (GDestroyNotify) g_free), NULL);
		monthvars = (_vala_array_free (monthvars, monthvars_length1, (GDestroyNotify) g_free), NULL);
		return result;
	}
	__finally0:
	_g_free0 (output);
	_g_free0 (cmd);
	monthdayvars = (_vala_array_free (monthdayvars, monthdayvars_length1, (GDestroyNotify) g_free), NULL);
	daynamevars = (_vala_array_free (daynamevars, daynamevars_length1, (GDestroyNotify) g_free), NULL);
	monthvars = (_vala_array_free (monthvars, monthvars_length1, (GDestroyNotify) g_free), 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;
}

static void
show_time_time_window_toggle_draggable (ShowTimeTimeWindow* self)
{
	gboolean draggable = FALSE;
	GSettings* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = show_time_showtime_settings;
	draggable = g_settings_get_boolean (_tmp0_, "draggable");
}

static gboolean
__lambda9_ (ShowTimeTimeWindow* self)
{
	gboolean result;
	show_time_time_window_update_appearance (self);
	result = FALSE;
	return result;
}

static gboolean
___lambda9__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda9_ ((ShowTimeTimeWindow*) self);
	return result;
}

static void
show_time_time_window_update_appearance_delay (ShowTimeTimeWindow* self)
{
	g_return_if_fail (self != NULL);
	g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 50, ___lambda9__gsource_func, g_object_ref (self), g_object_unref);
}

static void
show_time_time_window_update_appearance (ShowTimeTimeWindow* self)
{
	gint al = 0;
	GtkLabel* _tmp0_;
	GtkLabel* _tmp1_;
	GSettings* _tmp2_;
	GSettings* _tmp3_;
	ShowTimeShowTimeappearance* _tmp4_;
	GdkScreen* _tmp5_;
	GdkScreen* _tmp6_;
	g_return_if_fail (self != NULL);
	al = 1;
	if (show_time_time_window_get_leftalign (self)) {
		al = 0;
	}
	_tmp0_ = show_time_timelabel;
	gtk_label_set_xalign (_tmp0_, (gfloat) al);
	_tmp1_ = show_time_datelabel;
	gtk_label_set_xalign (_tmp1_, (gfloat) al);
	_tmp2_ = show_time_showtime_settings;
	show_time_linespacing = g_settings_get_int (_tmp2_, "linespacing");
	_tmp3_ = show_time_showtime_settings;
	self->priv->twelvehrs = g_settings_get_boolean (_tmp3_, "twelvehrs");
	_tmp4_ = self->priv->appearance;
	_tmp5_ = gtk_window_get_screen ((GtkWindow*) self);
	_tmp6_ = _tmp5_;
	show_time_show_timeappearance_get_appearance (_tmp4_, _tmp6_);
	show_time_time_window_update_interface (self);
}

static void
show_time_time_window_update_interface (ShowTimeTimeWindow* self)
{
	GDateTime* now = NULL;
	GDateTime* _tmp0_;
	gchar* datestring = NULL;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	ShowTimeShowTimeappearance* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_date_time_new_now_local ();
	now = _tmp0_;
	_tmp1_ = self->priv->dateformat;
	_tmp2_ = g_date_time_format (now, _tmp1_);
	datestring = _tmp2_;
	_tmp3_ = self->priv->appearance;
	_tmp4_ = show_time_time_window_get_localtime (self, now);
	_tmp5_ = _tmp4_;
	show_time_show_timeappearance_get_hexcolor (_tmp3_, _tmp5_, datestring);
	_g_free0 (_tmp5_);
	_g_free0 (datestring);
	_g_date_time_unref0 (now);
}

static gint
show_time_time_window_convert_remainder_topositive (ShowTimeTimeWindow* self,
                                                    gdouble subj,
                                                    gdouble rem)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	if (rem < ((gdouble) 0)) {
		result = (gint) (subj + rem);
		return result;
	}
	result = (gint) rem;
	return result;
}

static gint*
show_time_time_window_calibrate_time (ShowTimeTimeWindow* self,
                                      gint* result_length1)
{
	GDateTime* curr_time = NULL;
	GDateTime* _tmp0_;
	gint curr_sec = 0;
	gint curr_remaining = 0;
	gint remaining_cycles = 0;
	gint* _tmp1_;
	gint* _tmp2_;
	gint _tmp2__length1;
	gint* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_date_time_new_now_local ();
	curr_time = _tmp0_;
	curr_sec = g_date_time_get_second (curr_time);
	curr_remaining = show_time_time_window_convert_remainder_topositive (self, (gdouble) 6, remainder (60 - ((gdouble) curr_sec), (gdouble) 6));
	remaining_cycles = (gint) ((60 - curr_sec) / 6);
	_tmp1_ = g_new0 (gint, 2);
	_tmp1_[0] = curr_remaining;
	_tmp1_[1] = remaining_cycles;
	_tmp2_ = _tmp1_;
	_tmp2__length1 = 2;
	if (result_length1) {
		*result_length1 = _tmp2__length1;
	}
	result = _tmp2_;
	_g_date_time_unref0 (curr_time);
	return result;
}

static gboolean
____lambda8_ (ShowTimeTimeWindow* self)
{
	gboolean result;
	show_time_time_window_update_interface (self);
	result = FALSE;
	return result;
}

static gboolean
_____lambda8__gsource_func (gpointer self)
{
	gboolean result;
	result = ____lambda8_ ((ShowTimeTimeWindow*) self);
	return result;
}

static gboolean
show_time_time_window_run_time (ShowTimeTimeWindow* self)
{
	gint _tmp0_ = 0;
	gint* _tmp1_;
	gint* _tmp2_;
	gint _tmp2__length1;
	gint* calibrated_loopdata = NULL;
	gint _tmp3_ = 0;
	gint* _tmp4_;
	gint calibrated_loopdata_length1;
	gint _calibrated_loopdata_size_;
	gint loopcycle = 0;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	show_time_time_window_update_interface (self);
	_tmp1_ = show_time_time_window_calibrate_time (self, &_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp2__length1 = _tmp0_;
	_tmp2_ = (g_free (_tmp2_), NULL);
	_tmp4_ = show_time_time_window_calibrate_time (self, &_tmp3_);
	calibrated_loopdata = _tmp4_;
	calibrated_loopdata_length1 = _tmp3_;
	_calibrated_loopdata_size_ = calibrated_loopdata_length1;
	loopcycle = 0;
	while (TRUE) {
		gint* _tmp7_;
		gint _tmp7__length1;
		gint _tmp8_;
		if (!self->priv->showtime_onpanel) {
			break;
		}
		if (loopcycle == 0) {
			gint* _tmp5_;
			gint _tmp5__length1;
			gint _tmp6_;
			_tmp5_ = calibrated_loopdata;
			_tmp5__length1 = calibrated_loopdata_length1;
			_tmp6_ = _tmp5_[0];
			self->priv->next_time = _tmp6_;
		}
		_tmp7_ = calibrated_loopdata;
		_tmp7__length1 = calibrated_loopdata_length1;
		_tmp8_ = _tmp7_[1];
		if (loopcycle >= _tmp8_) {
			gint _tmp9_ = 0;
			gint* _tmp10_;
			_tmp10_ = show_time_time_window_calibrate_time (self, &_tmp9_);
			calibrated_loopdata = (g_free (calibrated_loopdata), NULL);
			calibrated_loopdata = _tmp10_;
			calibrated_loopdata_length1 = _tmp9_;
			_calibrated_loopdata_size_ = calibrated_loopdata_length1;
			loopcycle = 0;
			g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _____lambda8__gsource_func, g_object_ref (self), g_object_unref);
		}
		loopcycle += 1;
		g_usleep ((gulong) (self->priv->next_time * 1000000));
		self->priv->next_time = 6;
	}
	result = FALSE;
	calibrated_loopdata = (g_free (calibrated_loopdata), NULL);
	return result;
}

static void
show_time_time_window_class_init (ShowTimeTimeWindowClass * klass,
                                  gpointer klass_data)
{
	show_time_time_window_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ShowTimeTimeWindow_private_offset);
	G_OBJECT_CLASS (klass)->finalize = show_time_time_window_finalize;
}

static void
show_time_time_window_instance_init (ShowTimeTimeWindow * self,
                                     gpointer klass)
{
	self->priv = show_time_time_window_get_instance_private (self);
	self->priv->showtime_onpanel = TRUE;
}

static void
show_time_time_window_finalize (GObject * obj)
{
	ShowTimeTimeWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SHOW_TIME_TYPE_TIME_WINDOW, ShowTimeTimeWindow);
	_g_object_unref0 (self->priv->panel_settings);
	_g_object_unref0 (self->priv->raven_settings);
	_g_object_unref0 (self->priv->currpanelsubject_settings);
	_g_free0 (self->priv->dateformat);
	_show_time_show_timeappearance_unref0 (self->priv->appearance);
	_g_object_unref0 (self->priv->text_scaling);
	G_OBJECT_CLASS (show_time_time_window_parent_class)->finalize (obj);
}

static GType
show_time_time_window_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ShowTimeTimeWindowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) show_time_time_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ShowTimeTimeWindow), 0, (GInstanceInitFunc) show_time_time_window_instance_init, NULL };
	GType show_time_time_window_type_id;
	show_time_time_window_type_id = g_type_register_static (gtk_window_get_type (), "ShowTimeTimeWindow", &g_define_type_info, 0);
	ShowTimeTimeWindow_private_offset = g_type_add_instance_private (show_time_time_window_type_id, sizeof (ShowTimeTimeWindowPrivate));
	return show_time_time_window_type_id;
}

GType
show_time_time_window_get_type (void)
{
	static volatile gsize show_time_time_window_type_id__once = 0;
	if (g_once_init_enter (&show_time_time_window_type_id__once)) {
		GType show_time_time_window_type_id;
		show_time_time_window_type_id = show_time_time_window_get_type_once ();
		g_once_init_leave (&show_time_time_window_type_id__once, show_time_time_window_type_id);
	}
	return show_time_time_window_type_id__once;
}

static void
show_time_main (gchar** args,
                gint args_length1)
{
	gchar* uuid = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp8_;
	ShowTimeTimeWindow* _tmp9_;
	ShowTimeTimeWindow* _tmp10_;
	_tmp0_ = args[1];
	_tmp1_ = g_strdup (_tmp0_);
	uuid = _tmp1_;
	gtk_init ((gint*) (&args_length1), &args);
	_tmp2_ = g_strdup ("Showtime");
	_g_free0 (show_time_win_name);
	show_time_win_name = _tmp2_;
	if (args_length1 == 5) {
		const gchar* _tmp3_;
		gchar* _tmp4_;
		const gchar* _tmp5_;
		const gchar* _tmp6_;
		gint* _tmp7_;
		show_time_subwindow = TRUE;
		_tmp3_ = args[2];
		_tmp4_ = g_strconcat ("Showtime_", _tmp3_, NULL);
		_g_free0 (show_time_win_name);
		show_time_win_name = _tmp4_;
		_tmp5_ = args[3];
		_tmp6_ = args[4];
		_tmp7_ = g_new0 (gint, 2);
		_tmp7_[0] = atoi (_tmp5_);
		_tmp7_[1] = atoi (_tmp6_);
		show_time_custom_posargs = (g_free (show_time_custom_posargs), NULL);
		show_time_custom_posargs = _tmp7_;
		show_time_custom_posargs_length1 = 2;
		_show_time_custom_posargs_size_ = show_time_custom_posargs_length1;
	}
	_tmp8_ = uuid;
	_tmp9_ = show_time_time_window_new (_tmp8_);
	g_object_ref_sink (_tmp9_);
	_tmp10_ = _tmp9_;
	_g_object_unref0 (_tmp10_);
	gtk_main ();
	_g_free0 (uuid);
}

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

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;
}

