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

/*
 * Copyright © 2023 Alain M. (https://github.com/alainm23/planify)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301 USA
 *
 * Authored by: Alain M. <alainmh23@gmail.com>
 */

#include <adwaita.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <glib.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include "planify.h"
#include <gdk/gdk.h>
#include <gio/gio.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 WIDGETS_TYPE_ERROR_VIEW (widgets_error_view_get_type ())
#define WIDGETS_ERROR_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WIDGETS_TYPE_ERROR_VIEW, WidgetsErrorView))
#define WIDGETS_ERROR_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WIDGETS_TYPE_ERROR_VIEW, WidgetsErrorViewClass))
#define WIDGETS_IS_ERROR_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WIDGETS_TYPE_ERROR_VIEW))
#define WIDGETS_IS_ERROR_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WIDGETS_TYPE_ERROR_VIEW))
#define WIDGETS_ERROR_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WIDGETS_TYPE_ERROR_VIEW, WidgetsErrorViewClass))

typedef struct _WidgetsErrorView WidgetsErrorView;
typedef struct _WidgetsErrorViewClass WidgetsErrorViewClass;
typedef struct _WidgetsErrorViewPrivate WidgetsErrorViewPrivate;
enum  {
	WIDGETS_ERROR_VIEW_0_PROPERTY,
	WIDGETS_ERROR_VIEW_ERROR_CODE_PROPERTY,
	WIDGETS_ERROR_VIEW_ERROR_MESSAGE_PROPERTY,
	WIDGETS_ERROR_VIEW_VISIBLE_ISSUE_BUTTON_PROPERTY,
	WIDGETS_ERROR_VIEW_NUM_PROPERTIES
};
static GParamSpec* widgets_error_view_properties[WIDGETS_ERROR_VIEW_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))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

struct _WidgetsErrorView {
	AdwBin parent_instance;
	WidgetsErrorViewPrivate * priv;
};

struct _WidgetsErrorViewClass {
	AdwBinClass parent_class;
};

struct _WidgetsErrorViewPrivate {
	GtkLabel* error_label;
	GtkLabel* error_code_label;
	GtkTextView* error_textview;
	GtkButton* issue_button;
	GtkButton* copy_button;
};

static gint WidgetsErrorView_private_offset;
static gpointer widgets_error_view_parent_class = NULL;
static GeeHashMap* widgets_error_view_http_messages;
static GeeHashMap* widgets_error_view_http_messages = NULL;

VALA_EXTERN GType widgets_error_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WidgetsErrorView, g_object_unref)
VALA_EXTERN gchar* widgets_error_view_get_http_error (gint code);
VALA_EXTERN WidgetsErrorView* widgets_error_view_new (void);
VALA_EXTERN WidgetsErrorView* widgets_error_view_construct (GType object_type);
VALA_EXTERN void widgets_error_view_set_error_code (WidgetsErrorView* self,
                                        gint value);
VALA_EXTERN void widgets_error_view_set_error_message (WidgetsErrorView* self,
                                           const gchar* value);
VALA_EXTERN void widgets_error_view_set_visible_issue_button (WidgetsErrorView* self,
                                                  gboolean value);
static GObject * widgets_error_view_constructor (GType type,
                                          guint n_construct_properties,
                                          GObjectConstructParam * construct_properties);
static void _widgets_error_view___lambda300_ (WidgetsErrorView* self);
static gboolean __lambda301_ (WidgetsErrorView* self);
static gboolean ___lambda301__gsource_func (gpointer self);
static void __widgets_error_view___lambda300__gtk_button_clicked (GtkButton* _sender,
                                                           gpointer self);
static void _widgets_error_view___lambda302_ (WidgetsErrorView* self);
static void __widgets_error_view___lambda302__gtk_button_clicked (GtkButton* _sender,
                                                           gpointer self);
static void widgets_error_view_finalize (GObject * obj);
static GType widgets_error_view_get_type_once (void);
static void _vala_widgets_error_view_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec);
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 inline gpointer
widgets_error_view_get_instance_private (WidgetsErrorView* self)
{
	return G_STRUCT_MEMBER_P (self, WidgetsErrorView_private_offset);
}

gchar*
widgets_error_view_get_http_error (gint code)
{
	GeeHashMap* _tmp0_;
	gchar* _tmp10_ = NULL;
	GeeHashMap* _tmp11_;
	gchar* _tmp15_;
	gchar* result;
	_tmp0_ = widgets_error_view_http_messages;
	if (_tmp0_ == NULL) {
		GeeHashMap* _tmp1_;
		GeeHashMap* _tmp2_;
		GeeHashMap* _tmp3_;
		GeeHashMap* _tmp4_;
		GeeHashMap* _tmp5_;
		GeeHashMap* _tmp6_;
		GeeHashMap* _tmp7_;
		GeeHashMap* _tmp8_;
		GeeHashMap* _tmp9_;
		_tmp1_ = gee_hash_map_new (G_TYPE_INT, NULL, NULL, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
		_g_object_unref0 (widgets_error_view_http_messages);
		widgets_error_view_http_messages = _tmp1_;
		_tmp2_ = widgets_error_view_http_messages;
		gee_abstract_map_set ((GeeAbstractMap*) _tmp2_, (gpointer) ((gintptr) 400), _ ("The request was incorrect."));
		_tmp3_ = widgets_error_view_http_messages;
		gee_abstract_map_set ((GeeAbstractMap*) _tmp3_, (gpointer) ((gintptr) 401), _ ("Authentication is required, and has failed, or has not yet been provid" \
"ed."));
		_tmp4_ = widgets_error_view_http_messages;
		gee_abstract_map_set ((GeeAbstractMap*) _tmp4_, (gpointer) ((gintptr) 403), _ ("The request was valid, but for something that is forbidden."));
		_tmp5_ = widgets_error_view_http_messages;
		gee_abstract_map_set ((GeeAbstractMap*) _tmp5_, (gpointer) ((gintptr) 404), _ ("The requested resource could not be found."));
		_tmp6_ = widgets_error_view_http_messages;
		gee_abstract_map_set ((GeeAbstractMap*) _tmp6_, (gpointer) ((gintptr) 410), _ ("Account migration required."));
		_tmp7_ = widgets_error_view_http_messages;
		gee_abstract_map_set ((GeeAbstractMap*) _tmp7_, (gpointer) ((gintptr) 429), _ ("The user has sent too many requests in a given amount of time."));
		_tmp8_ = widgets_error_view_http_messages;
		gee_abstract_map_set ((GeeAbstractMap*) _tmp8_, (gpointer) ((gintptr) 500), _ ("The request failed due to a server error."));
		_tmp9_ = widgets_error_view_http_messages;
		gee_abstract_map_set ((GeeAbstractMap*) _tmp9_, (gpointer) ((gintptr) 503), _ ("The server is currently unable to handle the request."));
	}
	_tmp11_ = widgets_error_view_http_messages;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp11_, (gpointer) ((gintptr) code))) {
		GeeHashMap* _tmp12_;
		gpointer _tmp13_;
		_tmp12_ = widgets_error_view_http_messages;
		_tmp13_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp12_, (gpointer) ((gintptr) code));
		_g_free0 (_tmp10_);
		_tmp10_ = (gchar*) _tmp13_;
	} else {
		gchar* _tmp14_;
		_tmp14_ = g_strdup (_ ("Unknown error"));
		_g_free0 (_tmp10_);
		_tmp10_ = _tmp14_;
	}
	_tmp15_ = _tmp10_;
	_tmp10_ = NULL;
	result = _tmp15_;
	_g_free0 (_tmp10_);
	return result;
}

WidgetsErrorView*
widgets_error_view_construct (GType object_type)
{
	WidgetsErrorView * self = NULL;
	self = (WidgetsErrorView*) g_object_new (object_type, NULL);
	return self;
}

WidgetsErrorView*
widgets_error_view_new (void)
{
	return widgets_error_view_construct (WIDGETS_TYPE_ERROR_VIEW);
}

void
widgets_error_view_set_error_code (WidgetsErrorView* self,
                                   gint value)
{
	GtkLabel* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	GtkLabel* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->error_label;
	_tmp1_ = widgets_error_view_get_http_error (value);
	_tmp2_ = _tmp1_;
	gtk_label_set_label (_tmp0_, _tmp2_);
	_g_free0 (_tmp2_);
	_tmp3_ = self->priv->error_code_label;
	_tmp4_ = g_strdup_printf ("HTTP %d", value);
	_tmp5_ = _tmp4_;
	gtk_label_set_label (_tmp3_, _tmp5_);
	_g_free0 (_tmp5_);
	g_object_notify_by_pspec ((GObject *) self, widgets_error_view_properties[WIDGETS_ERROR_VIEW_ERROR_CODE_PROPERTY]);
}

void
widgets_error_view_set_error_message (WidgetsErrorView* self,
                                      const gchar* value)
{
	GtkTextView* _tmp0_;
	GtkTextBuffer* _tmp1_;
	GtkTextBuffer* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->error_textview;
	_tmp1_ = gtk_text_view_get_buffer (_tmp0_);
	_tmp2_ = _tmp1_;
	g_object_set (_tmp2_, "text", value, NULL);
	g_object_notify_by_pspec ((GObject *) self, widgets_error_view_properties[WIDGETS_ERROR_VIEW_ERROR_MESSAGE_PROPERTY]);
}

void
widgets_error_view_set_visible_issue_button (WidgetsErrorView* self,
                                             gboolean value)
{
	GtkButton* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->issue_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, widgets_error_view_properties[WIDGETS_ERROR_VIEW_VISIBLE_ISSUE_BUTTON_PROPERTY]);
}

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

static gboolean
__lambda301_ (WidgetsErrorView* self)
{
	GtkButton* _tmp0_;
	gboolean result;
	_tmp0_ = self->priv->copy_button;
	gtk_button_set_icon_name (_tmp0_, "edit-copy-symbolic");
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda301__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda301_ ((WidgetsErrorView*) self);
	return result;
}

static void
_widgets_error_view___lambda300_ (WidgetsErrorView* self)
{
	GdkClipboard* clipboard = NULL;
	GdkDisplay* _tmp0_;
	GdkClipboard* _tmp1_;
	GdkClipboard* _tmp2_;
	GdkClipboard* _tmp3_;
	GtkTextView* _tmp4_;
	GtkTextBuffer* _tmp5_;
	GtkTextBuffer* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	GtkButton* _tmp10_;
	_tmp0_ = gdk_display_get_default ();
	_tmp1_ = gdk_display_get_clipboard (_tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	clipboard = _tmp2_;
	_tmp3_ = clipboard;
	_tmp4_ = self->priv->error_textview;
	_tmp5_ = gtk_text_view_get_buffer (_tmp4_);
	_tmp6_ = _tmp5_;
	g_object_get (_tmp6_, "text", &_tmp7_, NULL);
	_tmp8_ = _tmp7_;
	_tmp9_ = _tmp8_;
	gdk_clipboard_set_text (_tmp3_, _tmp9_);
	_g_free0 (_tmp9_);
	_tmp10_ = self->priv->copy_button;
	gtk_button_set_icon_name (_tmp10_, "object-select-symbolic");
	g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 1500, ___lambda301__gsource_func, g_object_ref (self), g_object_unref);
	_g_object_unref0 (clipboard);
}

static void
__widgets_error_view___lambda300__gtk_button_clicked (GtkButton* _sender,
                                                      gpointer self)
{
	_widgets_error_view___lambda300_ ((WidgetsErrorView*) self);
}

static void
_widgets_error_view___lambda302_ (WidgetsErrorView* self)
{
	GError* _inner_error0_ = NULL;
	{
		g_app_info_launch_default_for_uri (CONSTANTS_NEW_ISSUE_URL, NULL, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp0_;
		const gchar* _tmp1_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp0_ = e;
		_tmp1_ = _tmp0_->message;
		g_warning ("ErrorView.vala:179: %s\n", _tmp1_);
		_g_error_free0 (e);
	}
	__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
__widgets_error_view___lambda302__gtk_button_clicked (GtkButton* _sender,
                                                      gpointer self)
{
	_widgets_error_view___lambda302_ ((WidgetsErrorView*) self);
}

static GObject *
widgets_error_view_constructor (GType type,
                                guint n_construct_properties,
                                GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	WidgetsErrorView * self;
	AdwHeaderBar* headerbar = NULL;
	AdwHeaderBar* _tmp0_;
	AdwHeaderBar* _tmp1_;
	GtkImage* error_image = NULL;
	gchar* _tmp2_;
	gchar** _tmp3_;
	GtkImage* _tmp4_ = NULL;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar** _tmp7_;
	GtkLabel* _tmp8_ = NULL;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar** _tmp11_;
	GtkLabel* _tmp12_ = NULL;
	GtkTextView* _tmp13_ = NULL;
	GtkTextView* _tmp14_;
	GtkTextView* _tmp15_;
	GtkTextView* _tmp16_;
	GtkScrolledWindow* textview_scrolled_window = NULL;
	GtkTextView* _tmp17_;
	GtkWidget* _tmp18_;
	GtkScrolledWindow* _tmp19_ = NULL;
	gchar* _tmp20_;
	gchar* _tmp21_;
	gchar** _tmp22_;
	gchar* _tmp23_;
	GtkButton* _tmp24_ = NULL;
	GtkOverlay* textview_overlay = NULL;
	GtkScrolledWindow* _tmp25_;
	GtkWidget* _tmp26_;
	GtkOverlay* _tmp27_ = NULL;
	GtkOverlay* _tmp28_;
	GtkButton* _tmp29_;
	GtkFrame* textview_frame = NULL;
	GtkOverlay* _tmp30_;
	GtkWidget* _tmp31_;
	GtkFrame* _tmp32_ = NULL;
	GtkLabel* log_label = NULL;
	ServicesLogService* _tmp33_;
	ServicesLogService* _tmp34_;
	gchar* _tmp35_;
	gchar* _tmp36_;
	gchar* _tmp37_;
	gchar* _tmp38_;
	gchar* _tmp39_;
	gchar* _tmp40_;
	gchar** _tmp41_;
	GtkLabel* _tmp42_ = NULL;
	GtkLabel* _tmp43_;
	GtkBox* buttons_box = NULL;
	GtkBox* _tmp44_ = NULL;
	gchar* _tmp45_;
	gchar* _tmp46_;
	gchar** _tmp47_;
	GtkButton* _tmp48_ = NULL;
	GtkBox* _tmp49_;
	GtkButton* _tmp50_;
	GtkBox* content_box = NULL;
	GtkBox* _tmp51_;
	GtkBox* _tmp52_;
	AdwHeaderBar* _tmp53_;
	GtkBox* _tmp54_;
	GtkImage* _tmp55_;
	GtkBox* _tmp56_;
	GtkLabel* _tmp57_;
	GtkBox* _tmp58_;
	GtkLabel* _tmp59_;
	GtkBox* _tmp60_;
	GtkFrame* _tmp61_;
	GtkBox* _tmp62_;
	GtkLabel* _tmp63_;
	GtkBox* _tmp64_;
	GtkBox* _tmp65_;
	GtkBox* _tmp66_;
	GtkButton* _tmp67_;
	GtkButton* _tmp68_;
	parent_class = G_OBJECT_CLASS (widgets_error_view_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_TYPE_ERROR_VIEW, WidgetsErrorView);
	_tmp0_ = (AdwHeaderBar*) adw_header_bar_new ();
	g_object_ref_sink (_tmp0_);
	headerbar = _tmp0_;
	_tmp1_ = headerbar;
	gtk_widget_add_css_class ((GtkWidget*) _tmp1_, "flat");
	_tmp2_ = g_strdup ("error");
	_tmp3_ = g_new0 (gchar*, 1 + 1);
	_tmp3_[0] = _tmp2_;
	_tmp4_ = (GtkImage*) gtk_image_new_from_icon_name ("cross-large-circle-outline-symbolic");
	gtk_widget_set_hexpand ((GtkWidget*) _tmp4_, TRUE);
	gtk_widget_set_halign ((GtkWidget*) _tmp4_, GTK_ALIGN_CENTER);
	gtk_image_set_pixel_size (_tmp4_, 48);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp4_, _tmp3_);
	_tmp3_ = (_vala_array_free (_tmp3_, 1, (GDestroyNotify) g_free), NULL);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp4_, 12);
	g_object_ref_sink (_tmp4_);
	error_image = _tmp4_;
	_tmp5_ = g_strdup ("font-bold");
	_tmp6_ = g_strdup ("title-2");
	_tmp7_ = g_new0 (gchar*, 2 + 1);
	_tmp7_[0] = _tmp5_;
	_tmp7_[1] = _tmp6_;
	_tmp8_ = (GtkLabel*) gtk_label_new (NULL);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp8_, TRUE);
	gtk_widget_set_halign ((GtkWidget*) _tmp8_, GTK_ALIGN_CENTER);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp8_, _tmp7_);
	_tmp7_ = (_vala_array_free (_tmp7_, 2, (GDestroyNotify) g_free), NULL);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp8_, 12);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp8_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp8_, 12);
	gtk_label_set_wrap (_tmp8_, TRUE);
	gtk_label_set_justify (_tmp8_, GTK_JUSTIFY_CENTER);
	gtk_label_set_selectable (_tmp8_, TRUE);
	g_object_ref_sink (_tmp8_);
	_g_object_unref0 (self->priv->error_label);
	self->priv->error_label = _tmp8_;
	_tmp9_ = g_strdup ("dimmed");
	_tmp10_ = g_strdup ("caption");
	_tmp11_ = g_new0 (gchar*, 2 + 1);
	_tmp11_[0] = _tmp9_;
	_tmp11_[1] = _tmp10_;
	_tmp12_ = (GtkLabel*) gtk_label_new (NULL);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp12_, TRUE);
	gtk_widget_set_halign ((GtkWidget*) _tmp12_, GTK_ALIGN_CENTER);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp12_, _tmp11_);
	_tmp11_ = (_vala_array_free (_tmp11_, 2, (GDestroyNotify) g_free), NULL);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp12_, 3);
	gtk_label_set_selectable (_tmp12_, TRUE);
	g_object_ref_sink (_tmp12_);
	_g_object_unref0 (self->priv->error_code_label);
	self->priv->error_code_label = _tmp12_;
	_tmp13_ = (GtkTextView*) gtk_text_view_new ();
	gtk_text_view_set_left_margin (_tmp13_, 12);
	gtk_text_view_set_top_margin (_tmp13_, 12);
	gtk_text_view_set_bottom_margin (_tmp13_, 12);
	gtk_text_view_set_right_margin (_tmp13_, 12);
	gtk_text_view_set_wrap_mode (_tmp13_, GTK_WRAP_WORD);
	gtk_text_view_set_editable (_tmp13_, FALSE);
	gtk_text_view_set_cursor_visible (_tmp13_, FALSE);
	g_object_ref_sink (_tmp13_);
	_g_object_unref0 (self->priv->error_textview);
	self->priv->error_textview = _tmp13_;
	_tmp14_ = self->priv->error_textview;
	gtk_widget_add_css_class ((GtkWidget*) _tmp14_, "monospace");
	_tmp15_ = self->priv->error_textview;
	gtk_widget_add_css_class ((GtkWidget*) _tmp15_, "error-message");
	_tmp16_ = self->priv->error_textview;
	gtk_widget_remove_css_class ((GtkWidget*) _tmp16_, "view");
	_tmp17_ = self->priv->error_textview;
	_tmp18_ = _g_object_ref0 ((GtkWidget*) _tmp17_);
	_tmp19_ = (GtkScrolledWindow*) gtk_scrolled_window_new ();
	g_object_set (_tmp19_, "hscrollbar-policy", GTK_POLICY_NEVER, NULL);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp19_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp19_, TRUE);
	gtk_scrolled_window_set_child (_tmp19_, _tmp18_);
	_g_object_unref0 (_tmp18_);
	g_object_set ((GtkWidget*) _tmp19_, "height-request", 150, NULL);
	g_object_ref_sink (_tmp19_);
	textview_scrolled_window = _tmp19_;
	_tmp20_ = g_strdup ("flat");
	_tmp21_ = g_strdup ("circular");
	_tmp22_ = g_new0 (gchar*, 2 + 1);
	_tmp22_[0] = _tmp20_;
	_tmp22_[1] = _tmp21_;
	_tmp23_ = g_strdup (_ ("Copy error message"));
	_tmp24_ = (GtkButton*) gtk_button_new_from_icon_name ("edit-copy-symbolic");
	gtk_widget_set_valign ((GtkWidget*) _tmp24_, GTK_ALIGN_START);
	gtk_widget_set_halign ((GtkWidget*) _tmp24_, GTK_ALIGN_END);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp24_, _tmp22_);
	_tmp22_ = (_vala_array_free (_tmp22_, 2, (GDestroyNotify) g_free), NULL);
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp24_, _tmp23_);
	_g_free0 (_tmp23_);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp24_, 6);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp24_, 6);
	g_object_ref_sink (_tmp24_);
	_g_object_unref0 (self->priv->copy_button);
	self->priv->copy_button = _tmp24_;
	_tmp25_ = textview_scrolled_window;
	_tmp26_ = _g_object_ref0 ((GtkWidget*) _tmp25_);
	_tmp27_ = (GtkOverlay*) gtk_overlay_new ();
	gtk_overlay_set_child (_tmp27_, _tmp26_);
	_g_object_unref0 (_tmp26_);
	g_object_ref_sink (_tmp27_);
	textview_overlay = _tmp27_;
	_tmp28_ = textview_overlay;
	_tmp29_ = self->priv->copy_button;
	gtk_overlay_add_overlay (_tmp28_, (GtkWidget*) _tmp29_);
	_tmp30_ = textview_overlay;
	_tmp31_ = _g_object_ref0 ((GtkWidget*) _tmp30_);
	_tmp32_ = (GtkFrame*) gtk_frame_new (NULL);
	gtk_frame_set_child (_tmp32_, _tmp31_);
	_g_object_unref0 (_tmp31_);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp32_, 18);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp32_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp32_, 12);
	g_object_ref_sink (_tmp32_);
	textview_frame = _tmp32_;
	_tmp33_ = services_log_service_get_default ();
	_tmp34_ = _tmp33_;
	_tmp35_ = services_log_service_get_log_path (_tmp34_);
	_tmp36_ = _tmp35_;
	_tmp37_ = g_strdup_printf (_ ("For more details, share your log file: %s"), _tmp36_);
	_tmp38_ = _tmp37_;
	_tmp39_ = g_strdup ("dimmed");
	_tmp40_ = g_strdup ("caption");
	_tmp41_ = g_new0 (gchar*, 2 + 1);
	_tmp41_[0] = _tmp39_;
	_tmp41_[1] = _tmp40_;
	_tmp42_ = (GtkLabel*) gtk_label_new (_tmp38_);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp42_, _tmp41_);
	_tmp41_ = (_vala_array_free (_tmp41_, 2, (GDestroyNotify) g_free), NULL);
	gtk_label_set_wrap (_tmp42_, TRUE);
	gtk_label_set_justify (_tmp42_, GTK_JUSTIFY_CENTER);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp42_, 12);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp42_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp42_, 12);
	gtk_label_set_selectable (_tmp42_, TRUE);
	g_object_ref_sink (_tmp42_);
	_tmp43_ = _tmp42_;
	_g_free0 (_tmp38_);
	_g_free0 (_tmp36_);
	_g_object_unref0 (_tmp34_);
	log_label = _tmp43_;
	_tmp44_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
	gtk_widget_set_halign ((GtkWidget*) _tmp44_, GTK_ALIGN_CENTER);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp44_, 16);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp44_, 24);
	g_object_ref_sink (_tmp44_);
	buttons_box = _tmp44_;
	_tmp45_ = g_strdup ("suggested-action");
	_tmp46_ = g_strdup ("pill");
	_tmp47_ = g_new0 (gchar*, 2 + 1);
	_tmp47_[0] = _tmp45_;
	_tmp47_[1] = _tmp46_;
	_tmp48_ = (GtkButton*) gtk_button_new_with_label (_ ("Report Issue"));
	gtk_widget_set_css_classes ((GtkWidget*) _tmp48_, _tmp47_);
	_tmp47_ = (_vala_array_free (_tmp47_, 2, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp48_);
	_g_object_unref0 (self->priv->issue_button);
	self->priv->issue_button = _tmp48_;
	_tmp49_ = buttons_box;
	_tmp50_ = self->priv->issue_button;
	gtk_box_append (_tmp49_, (GtkWidget*) _tmp50_);
	_tmp51_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp51_);
	content_box = _tmp51_;
	_tmp52_ = content_box;
	_tmp53_ = headerbar;
	gtk_box_append (_tmp52_, (GtkWidget*) _tmp53_);
	_tmp54_ = content_box;
	_tmp55_ = error_image;
	gtk_box_append (_tmp54_, (GtkWidget*) _tmp55_);
	_tmp56_ = content_box;
	_tmp57_ = self->priv->error_label;
	gtk_box_append (_tmp56_, (GtkWidget*) _tmp57_);
	_tmp58_ = content_box;
	_tmp59_ = self->priv->error_code_label;
	gtk_box_append (_tmp58_, (GtkWidget*) _tmp59_);
	_tmp60_ = content_box;
	_tmp61_ = textview_frame;
	gtk_box_append (_tmp60_, (GtkWidget*) _tmp61_);
	_tmp62_ = content_box;
	_tmp63_ = log_label;
	gtk_box_append (_tmp62_, (GtkWidget*) _tmp63_);
	_tmp64_ = content_box;
	_tmp65_ = buttons_box;
	gtk_box_append (_tmp64_, (GtkWidget*) _tmp65_);
	_tmp66_ = content_box;
	adw_bin_set_child ((AdwBin*) self, (GtkWidget*) _tmp66_);
	_tmp67_ = self->priv->copy_button;
	g_signal_connect_object (_tmp67_, "clicked", (GCallback) __widgets_error_view___lambda300__gtk_button_clicked, self, 0);
	_tmp68_ = self->priv->issue_button;
	g_signal_connect_object (_tmp68_, "clicked", (GCallback) __widgets_error_view___lambda302__gtk_button_clicked, self, 0);
	_g_object_unref0 (content_box);
	_g_object_unref0 (buttons_box);
	_g_object_unref0 (log_label);
	_g_object_unref0 (textview_frame);
	_g_object_unref0 (textview_overlay);
	_g_object_unref0 (textview_scrolled_window);
	_g_object_unref0 (error_image);
	_g_object_unref0 (headerbar);
	return obj;
}

static void
widgets_error_view_class_init (WidgetsErrorViewClass * klass,
                               gpointer klass_data)
{
	widgets_error_view_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &WidgetsErrorView_private_offset);
	G_OBJECT_CLASS (klass)->set_property = _vala_widgets_error_view_set_property;
	G_OBJECT_CLASS (klass)->constructor = widgets_error_view_constructor;
	G_OBJECT_CLASS (klass)->finalize = widgets_error_view_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_ERROR_VIEW_ERROR_CODE_PROPERTY, widgets_error_view_properties[WIDGETS_ERROR_VIEW_ERROR_CODE_PROPERTY] = g_param_spec_int ("error-code", "error-code", "error-code", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_ERROR_VIEW_ERROR_MESSAGE_PROPERTY, widgets_error_view_properties[WIDGETS_ERROR_VIEW_ERROR_MESSAGE_PROPERTY] = g_param_spec_string ("error-message", "error-message", "error-message", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_ERROR_VIEW_VISIBLE_ISSUE_BUTTON_PROPERTY, widgets_error_view_properties[WIDGETS_ERROR_VIEW_VISIBLE_ISSUE_BUTTON_PROPERTY] = g_param_spec_boolean ("visible-issue-button", "visible-issue-button", "visible-issue-button", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
}

static void
widgets_error_view_instance_init (WidgetsErrorView * self,
                                  gpointer klass)
{
	self->priv = widgets_error_view_get_instance_private (self);
}

static void
widgets_error_view_finalize (GObject * obj)
{
	WidgetsErrorView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_TYPE_ERROR_VIEW, WidgetsErrorView);
	g_debug ("ErrorView.vala:32: Destroying Widgets.ErrorView\n");
	_g_object_unref0 (self->priv->error_label);
	_g_object_unref0 (self->priv->error_code_label);
	_g_object_unref0 (self->priv->error_textview);
	_g_object_unref0 (self->priv->issue_button);
	_g_object_unref0 (self->priv->copy_button);
	G_OBJECT_CLASS (widgets_error_view_parent_class)->finalize (obj);
}

static GType
widgets_error_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (WidgetsErrorViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) widgets_error_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WidgetsErrorView), 0, (GInstanceInitFunc) widgets_error_view_instance_init, NULL };
	GType widgets_error_view_type_id;
	widgets_error_view_type_id = g_type_register_static (adw_bin_get_type (), "WidgetsErrorView", &g_define_type_info, 0);
	WidgetsErrorView_private_offset = g_type_add_instance_private (widgets_error_view_type_id, sizeof (WidgetsErrorViewPrivate));
	return widgets_error_view_type_id;
}

GType
widgets_error_view_get_type (void)
{
	static volatile gsize widgets_error_view_type_id__once = 0;
	if (g_once_init_enter (&widgets_error_view_type_id__once)) {
		GType widgets_error_view_type_id;
		widgets_error_view_type_id = widgets_error_view_get_type_once ();
		g_once_init_leave (&widgets_error_view_type_id__once, widgets_error_view_type_id);
	}
	return widgets_error_view_type_id__once;
}

static void
_vala_widgets_error_view_set_property (GObject * object,
                                       guint property_id,
                                       const GValue * value,
                                       GParamSpec * pspec)
{
	WidgetsErrorView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_TYPE_ERROR_VIEW, WidgetsErrorView);
	switch (property_id) {
		case WIDGETS_ERROR_VIEW_ERROR_CODE_PROPERTY:
		widgets_error_view_set_error_code (self, g_value_get_int (value));
		break;
		case WIDGETS_ERROR_VIEW_ERROR_MESSAGE_PROPERTY:
		widgets_error_view_set_error_message (self, g_value_get_string (value));
		break;
		case WIDGETS_ERROR_VIEW_VISIBLE_ISSUE_BUTTON_PROPERTY:
		widgets_error_view_set_visible_issue_button (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

