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

#include "protonplus_core.h"
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <adwaita.h>
#include <gtk/gtk.h>
#include <glib/gi18n-lib.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

enum  {
	PROTON_PLUS_WIDGETS_MAIN_ERROR_DIALOG_0_PROPERTY,
	PROTON_PLUS_WIDGETS_MAIN_ERROR_DIALOG_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_main_error_dialog_properties[PROTON_PLUS_WIDGETS_MAIN_ERROR_DIALOG_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

static gpointer proton_plus_widgets_main_error_dialog_parent_class = NULL;

static void __lambda36_ (ProtonPlusWidgetsMainErrorDialog* self,
                  const gchar* response);
static void ___lambda36__adw_alert_dialog_response (AdwAlertDialog* _sender,
                                             const gchar* response,
                                             gpointer self);
static GType proton_plus_widgets_main_error_dialog_get_type_once (void);

static void
__lambda36_ (ProtonPlusWidgetsMainErrorDialog* self,
             const gchar* response)
{
	g_return_if_fail (response != NULL);
	if (g_strcmp0 (response, "report") == 0) {
		gtk_widget_activate_action ((GtkWidget*) self, "app.report", NULL, NULL);
	}
}

static void
___lambda36__adw_alert_dialog_response (AdwAlertDialog* _sender,
                                        const gchar* response,
                                        gpointer self)
{
	__lambda36_ ((ProtonPlusWidgetsMainErrorDialog*) self, response);
}

ProtonPlusWidgetsMainErrorDialog*
proton_plus_widgets_main_error_dialog_construct (GType object_type,
                                                 const gchar* heading,
                                                 const gchar* body,
                                                 const gchar* _error_)
{
	ProtonPlusWidgetsMainErrorDialog * self = NULL;
	g_return_val_if_fail (heading != NULL, NULL);
	g_return_val_if_fail (body != NULL, NULL);
	g_return_val_if_fail (_error_ != NULL, NULL);
	self = (ProtonPlusWidgetsMainErrorDialog*) g_object_new (object_type, NULL);
	adw_alert_dialog_set_heading ((AdwAlertDialog*) self, heading);
	adw_alert_dialog_set_body ((AdwAlertDialog*) self, body);
	if (g_strcmp0 (_error_, "") != 0) {
		GtkBox* box = NULL;
		GtkBox* _tmp0_;
		GtkLabel* label = NULL;
		GtkLabel* _tmp1_;
		GtkLabel* _tmp2_;
		GtkLabel* _tmp3_;
		GtkLabel* _tmp4_;
		GtkScrolledWindow* scrolled = NULL;
		GtkScrolledWindow* _tmp5_;
		GtkScrolledWindow* _tmp6_;
		GtkScrolledWindow* _tmp7_;
		GtkScrolledWindow* _tmp8_;
		GtkScrolledWindow* _tmp9_;
		GtkScrolledWindow* _tmp10_;
		GtkTextView* text_view = NULL;
		GtkTextView* _tmp11_;
		GtkTextView* _tmp12_;
		GtkTextView* _tmp13_;
		GtkTextView* _tmp14_;
		GtkTextView* _tmp15_;
		GtkTextView* _tmp16_;
		GtkTextView* _tmp17_;
		GtkTextView* _tmp18_;
		GtkTextView* _tmp19_;
		GtkTextBuffer* _tmp20_;
		GtkTextBuffer* _tmp21_;
		GtkTextView* _tmp22_;
		GtkScrolledWindow* _tmp23_;
		GtkTextView* _tmp24_;
		GtkBox* _tmp25_;
		GtkLabel* _tmp26_;
		GtkBox* _tmp27_;
		GtkScrolledWindow* _tmp28_;
		GtkBox* _tmp29_;
		_tmp0_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
		g_object_ref_sink (_tmp0_);
		box = _tmp0_;
		_tmp1_ = (GtkLabel*) gtk_label_new (_ ("Technical Details"));
		g_object_ref_sink (_tmp1_);
		label = _tmp1_;
		_tmp2_ = label;
		gtk_widget_set_halign ((GtkWidget*) _tmp2_, GTK_ALIGN_START);
		_tmp3_ = label;
		gtk_widget_add_css_class ((GtkWidget*) _tmp3_, "caption");
		_tmp4_ = label;
		gtk_widget_add_css_class ((GtkWidget*) _tmp4_, "dim-label");
		_tmp5_ = (GtkScrolledWindow*) gtk_scrolled_window_new ();
		g_object_ref_sink (_tmp5_);
		scrolled = _tmp5_;
		_tmp6_ = scrolled;
		gtk_scrolled_window_set_policy (_tmp6_, GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
		_tmp7_ = scrolled;
		gtk_scrolled_window_set_min_content_height (_tmp7_, 100);
		_tmp8_ = scrolled;
		gtk_scrolled_window_set_max_content_height (_tmp8_, 300);
		_tmp9_ = scrolled;
		gtk_widget_set_vexpand ((GtkWidget*) _tmp9_, TRUE);
		_tmp10_ = scrolled;
		gtk_widget_add_css_class ((GtkWidget*) _tmp10_, "card");
		_tmp11_ = (GtkTextView*) gtk_text_view_new ();
		g_object_ref_sink (_tmp11_);
		text_view = _tmp11_;
		_tmp12_ = text_view;
		gtk_text_view_set_editable (_tmp12_, FALSE);
		_tmp13_ = text_view;
		gtk_text_view_set_cursor_visible (_tmp13_, FALSE);
		_tmp14_ = text_view;
		gtk_text_view_set_wrap_mode (_tmp14_, GTK_WRAP_WORD_CHAR);
		_tmp15_ = text_view;
		gtk_widget_set_margin_top ((GtkWidget*) _tmp15_, 12);
		_tmp16_ = text_view;
		gtk_widget_set_margin_bottom ((GtkWidget*) _tmp16_, 12);
		_tmp17_ = text_view;
		gtk_widget_set_margin_start ((GtkWidget*) _tmp17_, 12);
		_tmp18_ = text_view;
		gtk_widget_set_margin_end ((GtkWidget*) _tmp18_, 12);
		_tmp19_ = text_view;
		_tmp20_ = gtk_text_view_get_buffer (_tmp19_);
		_tmp21_ = _tmp20_;
		g_object_set (_tmp21_, "text", _error_, NULL);
		_tmp22_ = text_view;
		gtk_widget_add_css_class ((GtkWidget*) _tmp22_, "monospace");
		_tmp23_ = scrolled;
		_tmp24_ = text_view;
		gtk_scrolled_window_set_child (_tmp23_, (GtkWidget*) _tmp24_);
		_tmp25_ = box;
		_tmp26_ = label;
		gtk_box_append (_tmp25_, (GtkWidget*) _tmp26_);
		_tmp27_ = box;
		_tmp28_ = scrolled;
		gtk_box_append (_tmp27_, (GtkWidget*) _tmp28_);
		_tmp29_ = box;
		adw_alert_dialog_set_extra_child ((AdwAlertDialog*) self, (GtkWidget*) _tmp29_);
		_g_object_unref0 (text_view);
		_g_object_unref0 (scrolled);
		_g_object_unref0 (label);
		_g_object_unref0 (box);
	}
	adw_alert_dialog_add_response ((AdwAlertDialog*) self, "report", _ ("Report"));
	adw_alert_dialog_set_response_appearance ((AdwAlertDialog*) self, "report", ADW_RESPONSE_SUGGESTED);
	adw_alert_dialog_add_response ((AdwAlertDialog*) self, "ok", _ ("OK"));
	adw_alert_dialog_set_response_appearance ((AdwAlertDialog*) self, "ok", ADW_RESPONSE_DEFAULT);
	g_signal_connect_object ((AdwAlertDialog*) self, "response", (GCallback) ___lambda36__adw_alert_dialog_response, self, 0);
	return self;
}

ProtonPlusWidgetsMainErrorDialog*
proton_plus_widgets_main_error_dialog_new (const gchar* heading,
                                           const gchar* body,
                                           const gchar* _error_)
{
	return proton_plus_widgets_main_error_dialog_construct (PROTON_PLUS_WIDGETS_MAIN_TYPE_ERROR_DIALOG, heading, body, _error_);
}

static void
proton_plus_widgets_main_error_dialog_class_init (ProtonPlusWidgetsMainErrorDialogClass * klass,
                                                  gpointer klass_data)
{
	proton_plus_widgets_main_error_dialog_parent_class = g_type_class_peek_parent (klass);
}

static void
proton_plus_widgets_main_error_dialog_instance_init (ProtonPlusWidgetsMainErrorDialog * self,
                                                     gpointer klass)
{
}

static GType
proton_plus_widgets_main_error_dialog_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsMainErrorDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_main_error_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsMainErrorDialog), 0, (GInstanceInitFunc) proton_plus_widgets_main_error_dialog_instance_init, NULL };
	GType proton_plus_widgets_main_error_dialog_type_id;
	proton_plus_widgets_main_error_dialog_type_id = g_type_register_static (adw_alert_dialog_get_type (), "ProtonPlusWidgetsMainErrorDialog", &g_define_type_info, 0);
	return proton_plus_widgets_main_error_dialog_type_id;
}

GType
proton_plus_widgets_main_error_dialog_get_type (void)
{
	static volatile gsize proton_plus_widgets_main_error_dialog_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_main_error_dialog_type_id__once)) {
		GType proton_plus_widgets_main_error_dialog_type_id;
		proton_plus_widgets_main_error_dialog_type_id = proton_plus_widgets_main_error_dialog_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_main_error_dialog_type_id__once, proton_plus_widgets_main_error_dialog_type_id);
	}
	return proton_plus_widgets_main_error_dialog_type_id__once;
}

