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

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

#define PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_CONTROLLER (proton_plus_widgets_introduction_controller_get_type ())
#define PROTON_PLUS_WIDGETS_INTRODUCTION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_CONTROLLER, ProtonPlusWidgetsIntroductionController))
#define PROTON_PLUS_WIDGETS_INTRODUCTION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_CONTROLLER, ProtonPlusWidgetsIntroductionControllerClass))
#define PROTON_PLUS_WIDGETS_INTRODUCTION_IS_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_CONTROLLER))
#define PROTON_PLUS_WIDGETS_INTRODUCTION_IS_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_CONTROLLER))
#define PROTON_PLUS_WIDGETS_INTRODUCTION_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_CONTROLLER, ProtonPlusWidgetsIntroductionControllerClass))

typedef struct _ProtonPlusWidgetsIntroductionController ProtonPlusWidgetsIntroductionController;
typedef struct _ProtonPlusWidgetsIntroductionControllerClass ProtonPlusWidgetsIntroductionControllerClass;
typedef struct _ProtonPlusWidgetsIntroductionControllerPrivate ProtonPlusWidgetsIntroductionControllerPrivate;
enum  {
	PROTON_PLUS_WIDGETS_INTRODUCTION_CONTROLLER_0_PROPERTY,
	PROTON_PLUS_WIDGETS_INTRODUCTION_CONTROLLER_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_introduction_controller_properties[PROTON_PLUS_WIDGETS_INTRODUCTION_CONTROLLER_NUM_PROPERTIES];
typedef struct _Block10Data Block10Data;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _ProtonPlusWidgetsIntroductionController {
	GtkBox parent_instance;
	ProtonPlusWidgetsIntroductionControllerPrivate * priv;
};

struct _ProtonPlusWidgetsIntroductionControllerClass {
	GtkBoxClass parent_class;
};

struct _Block10Data {
	int _ref_count_;
	ProtonPlusWidgetsIntroductionController* self;
	GtkBox* row0;
	GtkBox* row1;
};

static gpointer proton_plus_widgets_introduction_controller_parent_class = NULL;

VALA_EXTERN GType proton_plus_widgets_introduction_controller_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ProtonPlusWidgetsIntroductionController* proton_plus_widgets_introduction_controller_new (void);
VALA_EXTERN ProtonPlusWidgetsIntroductionController* proton_plus_widgets_introduction_controller_construct (GType object_type);
static Block10Data* block10_data_ref (Block10Data* _data10_);
static void block10_data_unref (void * _userdata_);
static GtkWidget* proton_plus_widgets_introduction_controller_create_feature (ProtonPlusWidgetsIntroductionController* self,
                                                                       const gchar* title,
                                                                       const gchar* description);
static void __lambda402_ (Block10Data* _data10_);
static void ___lambda402__adw_breakpoint_apply (AdwBreakpoint* _sender,
                                         gpointer self);
static void __lambda403_ (Block10Data* _data10_);
static void ___lambda403__adw_breakpoint_unapply (AdwBreakpoint* _sender,
                                           gpointer self);
static GType proton_plus_widgets_introduction_controller_get_type_once (void);

static Block10Data*
block10_data_ref (Block10Data* _data10_)
{
	g_atomic_int_inc (&_data10_->_ref_count_);
	return _data10_;
}

static void
block10_data_unref (void * _userdata_)
{
	Block10Data* _data10_;
	_data10_ = (Block10Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data10_->_ref_count_)) {
		ProtonPlusWidgetsIntroductionController* self;
		self = _data10_->self;
		_g_object_unref0 (_data10_->row1);
		_g_object_unref0 (_data10_->row0);
		_g_object_unref0 (self);
		g_slice_free (Block10Data, _data10_);
	}
}

static void
__lambda402_ (Block10Data* _data10_)
{
	ProtonPlusWidgetsIntroductionController* self;
	self = _data10_->self;
	gtk_orientable_set_orientation ((GtkOrientable*) _data10_->row0, GTK_ORIENTATION_VERTICAL);
	gtk_box_set_homogeneous (_data10_->row0, FALSE);
	gtk_orientable_set_orientation ((GtkOrientable*) _data10_->row1, GTK_ORIENTATION_VERTICAL);
	gtk_box_set_homogeneous (_data10_->row1, FALSE);
}

static void
___lambda402__adw_breakpoint_apply (AdwBreakpoint* _sender,
                                    gpointer self)
{
	__lambda402_ (self);
}

static void
__lambda403_ (Block10Data* _data10_)
{
	ProtonPlusWidgetsIntroductionController* self;
	self = _data10_->self;
	gtk_orientable_set_orientation ((GtkOrientable*) _data10_->row0, GTK_ORIENTATION_HORIZONTAL);
	gtk_box_set_homogeneous (_data10_->row0, TRUE);
	gtk_orientable_set_orientation ((GtkOrientable*) _data10_->row1, GTK_ORIENTATION_HORIZONTAL);
	gtk_box_set_homogeneous (_data10_->row1, TRUE);
}

static void
___lambda403__adw_breakpoint_unapply (AdwBreakpoint* _sender,
                                      gpointer self)
{
	__lambda403_ (self);
}

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

ProtonPlusWidgetsIntroductionController*
proton_plus_widgets_introduction_controller_construct (GType object_type)
{
	ProtonPlusWidgetsIntroductionController * self = NULL;
	Block10Data* _data10_;
	GtkScrolledWindow* scrolled = NULL;
	GtkScrolledWindow* _tmp0_ = NULL;
	GtkBox* content = NULL;
	GtkBox* _tmp1_;
	GtkImage* image = NULL;
	GtkImage* _tmp2_;
	GtkLabel* title_label = NULL;
	GtkLabel* _tmp3_;
	GtkBox* feature_rows = NULL;
	GtkBox* _tmp4_;
	GtkBox* _tmp5_;
	GtkWidget* _tmp6_;
	GtkWidget* _tmp7_;
	GtkWidget* _tmp8_;
	GtkWidget* _tmp9_;
	GtkBox* _tmp10_;
	GtkWidget* _tmp11_;
	GtkWidget* _tmp12_;
	GtkWidget* _tmp13_;
	GtkWidget* _tmp14_;
	AdwBreakpointBin* responsive = NULL;
	AdwBreakpointBin* _tmp15_;
	AdwBreakpoint* narrow = NULL;
	AdwBreakpointCondition* _tmp16_;
	AdwBreakpoint* _tmp17_;
	AdwBreakpoint* _tmp18_;
	_data10_ = g_slice_new0 (Block10Data);
	_data10_->_ref_count_ = 1;
	self = (ProtonPlusWidgetsIntroductionController*) g_object_new (object_type, "orientation", GTK_ORIENTATION_VERTICAL, NULL);
	_data10_->self = g_object_ref (self);
	gtk_widget_set_hexpand ((GtkWidget*) self, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) self, TRUE);
	_tmp0_ = (GtkScrolledWindow*) gtk_scrolled_window_new ();
	g_object_set (_tmp0_, "hscrollbar-policy", GTK_POLICY_NEVER, NULL);
	g_object_set (_tmp0_, "vscrollbar-policy", GTK_POLICY_AUTOMATIC, NULL);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp0_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp0_, TRUE);
	g_object_ref_sink (_tmp0_);
	scrolled = _tmp0_;
	_tmp1_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
	g_object_ref_sink (_tmp1_);
	content = _tmp1_;
	gtk_widget_set_hexpand ((GtkWidget*) content, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) content, TRUE);
	gtk_widget_set_valign ((GtkWidget*) content, GTK_ALIGN_CENTER);
	gtk_widget_set_margin_top ((GtkWidget*) content, 16);
	gtk_widget_set_margin_bottom ((GtkWidget*) content, 16);
	gtk_widget_set_margin_start ((GtkWidget*) content, 16);
	gtk_widget_set_margin_end ((GtkWidget*) content, 16);
	_tmp2_ = (GtkImage*) gtk_image_new_from_icon_name ("gamepad-symbolic");
	g_object_ref_sink (_tmp2_);
	image = _tmp2_;
	gtk_image_set_pixel_size (image, 56);
	gtk_box_append (content, (GtkWidget*) image);
	_tmp3_ = (GtkLabel*) gtk_label_new (_ ("Controller support"));
	g_object_ref_sink (_tmp3_);
	title_label = _tmp3_;
	gtk_widget_add_css_class ((GtkWidget*) title_label, "title-1");
	gtk_label_set_wrap (title_label, TRUE);
	gtk_label_set_justify (title_label, GTK_JUSTIFY_CENTER);
	gtk_label_set_max_width_chars (title_label, 25);
	gtk_box_append (content, (GtkWidget*) title_label);
	_tmp4_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
	g_object_ref_sink (_tmp4_);
	feature_rows = _tmp4_;
	gtk_widget_set_hexpand ((GtkWidget*) feature_rows, TRUE);
	_tmp5_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 24);
	g_object_ref_sink (_tmp5_);
	_data10_->row0 = _tmp5_;
	gtk_widget_set_hexpand ((GtkWidget*) _data10_->row0, TRUE);
	gtk_box_set_homogeneous (_data10_->row0, TRUE);
	_tmp6_ = proton_plus_widgets_introduction_controller_create_feature (self, _ ("Navigation"), _ ("Use the D-pad or sticks to move through pages, dialogs, and menus. Swi" \
"tch sections with the shoulder buttons."));
	_tmp7_ = _tmp6_;
	gtk_box_append (_data10_->row0, _tmp7_);
	_g_object_unref0 (_tmp7_);
	_tmp8_ = proton_plus_widgets_introduction_controller_create_feature (self, _ ("Actions"), _ ("Use the face buttons for Confirm, Back, Search, and Filter. Hints matc" \
"h your controller's button labels."));
	_tmp9_ = _tmp8_;
	gtk_box_append (_data10_->row0, _tmp9_);
	_g_object_unref0 (_tmp9_);
	_tmp10_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 24);
	g_object_ref_sink (_tmp10_);
	_data10_->row1 = _tmp10_;
	gtk_widget_set_hexpand ((GtkWidget*) _data10_->row1, TRUE);
	gtk_box_set_homogeneous (_data10_->row1, TRUE);
	_tmp11_ = proton_plus_widgets_introduction_controller_create_feature (self, _ ("Preferences"), _ ("Choose the Confirm button and enable controller vibration in Preferenc" \
"es."));
	_tmp12_ = _tmp11_;
	gtk_box_append (_data10_->row1, _tmp12_);
	_g_object_unref0 (_tmp12_);
	_tmp13_ = proton_plus_widgets_introduction_controller_create_feature (self, _ ("Text input"), _ ("On Steam Deck, focus a text field and press Steam + X. Other systems m" \
"ay require a physical or system keyboard."));
	_tmp14_ = _tmp13_;
	gtk_box_append (_data10_->row1, _tmp14_);
	_g_object_unref0 (_tmp14_);
	gtk_box_append (feature_rows, (GtkWidget*) _data10_->row0);
	gtk_box_append (feature_rows, (GtkWidget*) _data10_->row1);
	_tmp15_ = (AdwBreakpointBin*) adw_breakpoint_bin_new ();
	g_object_ref_sink (_tmp15_);
	responsive = _tmp15_;
	gtk_widget_set_size_request ((GtkWidget*) responsive, 360, 1);
	adw_breakpoint_bin_set_child (responsive, (GtkWidget*) feature_rows);
	_tmp16_ = adw_breakpoint_condition_new_length (ADW_BREAKPOINT_CONDITION_MAX_WIDTH, (gdouble) 420, ADW_LENGTH_UNIT_PX);
	_tmp17_ = adw_breakpoint_new (_tmp16_);
	narrow = _tmp17_;
	g_signal_connect_data (narrow, "apply", (GCallback) ___lambda402__adw_breakpoint_apply, block10_data_ref (_data10_), (GClosureNotify) block10_data_unref, 0);
	g_signal_connect_data (narrow, "unapply", (GCallback) ___lambda403__adw_breakpoint_unapply, block10_data_ref (_data10_), (GClosureNotify) block10_data_unref, 0);
	_tmp18_ = _g_object_ref0 (narrow);
	adw_breakpoint_bin_add_breakpoint (responsive, _tmp18_);
	gtk_box_append (content, (GtkWidget*) responsive);
	gtk_scrolled_window_set_child (scrolled, (GtkWidget*) content);
	gtk_box_append ((GtkBox*) self, (GtkWidget*) scrolled);
	_g_object_unref0 (narrow);
	_g_object_unref0 (responsive);
	_g_object_unref0 (feature_rows);
	_g_object_unref0 (title_label);
	_g_object_unref0 (image);
	_g_object_unref0 (content);
	_g_object_unref0 (scrolled);
	block10_data_unref (_data10_);
	_data10_ = NULL;
	return self;
}

ProtonPlusWidgetsIntroductionController*
proton_plus_widgets_introduction_controller_new (void)
{
	return proton_plus_widgets_introduction_controller_construct (PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_CONTROLLER);
}

static GtkWidget*
proton_plus_widgets_introduction_controller_create_feature (ProtonPlusWidgetsIntroductionController* self,
                                                            const gchar* title,
                                                            const gchar* description)
{
	GtkBox* feature = NULL;
	GtkBox* _tmp0_;
	GtkLabel* title_label = NULL;
	GtkLabel* _tmp1_;
	GtkLabel* description_label = NULL;
	GtkLabel* _tmp2_;
	GtkWidget* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (title != NULL, NULL);
	g_return_val_if_fail (description != NULL, NULL);
	_tmp0_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
	g_object_ref_sink (_tmp0_);
	feature = _tmp0_;
	gtk_widget_set_valign ((GtkWidget*) feature, GTK_ALIGN_START);
	gtk_widget_set_hexpand ((GtkWidget*) feature, TRUE);
	_tmp1_ = (GtkLabel*) gtk_label_new (title);
	g_object_ref_sink (_tmp1_);
	title_label = _tmp1_;
	gtk_widget_add_css_class ((GtkWidget*) title_label, "heading");
	gtk_label_set_xalign (title_label, (gfloat) 0);
	gtk_label_set_wrap (title_label, TRUE);
	gtk_label_set_max_width_chars (title_label, 15);
	gtk_box_append (feature, (GtkWidget*) title_label);
	_tmp2_ = (GtkLabel*) gtk_label_new (description);
	g_object_ref_sink (_tmp2_);
	description_label = _tmp2_;
	gtk_widget_add_css_class ((GtkWidget*) description_label, "caption");
	gtk_widget_add_css_class ((GtkWidget*) description_label, "dim-label");
	gtk_label_set_xalign (description_label, (gfloat) 0);
	gtk_label_set_wrap (description_label, TRUE);
	gtk_label_set_max_width_chars (description_label, 28);
	gtk_box_append (feature, (GtkWidget*) description_label);
	result = (GtkWidget*) feature;
	_g_object_unref0 (description_label);
	_g_object_unref0 (title_label);
	return result;
}

static void
proton_plus_widgets_introduction_controller_class_init (ProtonPlusWidgetsIntroductionControllerClass * klass,
                                                        gpointer klass_data)
{
	proton_plus_widgets_introduction_controller_parent_class = g_type_class_peek_parent (klass);
}

static void
proton_plus_widgets_introduction_controller_instance_init (ProtonPlusWidgetsIntroductionController * self,
                                                           gpointer klass)
{
}

static GType
proton_plus_widgets_introduction_controller_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsIntroductionControllerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_introduction_controller_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsIntroductionController), 0, (GInstanceInitFunc) proton_plus_widgets_introduction_controller_instance_init, NULL };
	GType proton_plus_widgets_introduction_controller_type_id;
	proton_plus_widgets_introduction_controller_type_id = g_type_register_static (gtk_box_get_type (), "ProtonPlusWidgetsIntroductionController", &g_define_type_info, 0);
	return proton_plus_widgets_introduction_controller_type_id;
}

GType
proton_plus_widgets_introduction_controller_get_type (void)
{
	static volatile gsize proton_plus_widgets_introduction_controller_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_introduction_controller_type_id__once)) {
		GType proton_plus_widgets_introduction_controller_type_id;
		proton_plus_widgets_introduction_controller_type_id = proton_plus_widgets_introduction_controller_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_introduction_controller_type_id__once, proton_plus_widgets_introduction_controller_type_id);
	}
	return proton_plus_widgets_introduction_controller_type_id__once;
}

