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

#include "protonplus_core.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gdk/gdk.h>
#include <math.h>
#include <gtk/gtk.h>
#include <glib-object.h>
#include <adwaita.h>
#include <gio/gio.h>
#include <float.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_MANGO_HUD_PAGE_0_PROPERTY,
	PROTON_PLUS_WIDGETS_MANGO_HUD_PAGE_CONFIG_PROPERTY,
	PROTON_PLUS_WIDGETS_MANGO_HUD_PAGE_IS_UPDATING_PROPERTY,
	PROTON_PLUS_WIDGETS_MANGO_HUD_PAGE_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_mango_hud_page_properties[PROTON_PLUS_WIDGETS_MANGO_HUD_PAGE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block31Data Block31Data;
typedef struct _Block32Data Block32Data;
typedef struct _Block33Data Block33Data;
typedef struct _Block34Data Block34Data;
typedef struct _Block35Data Block35Data;
enum  {
	PROTON_PLUS_WIDGETS_MANGO_HUD_PAGE_CHANGED_SIGNAL,
	PROTON_PLUS_WIDGETS_MANGO_HUD_PAGE_NUM_SIGNALS
};
static guint proton_plus_widgets_mango_hud_page_signals[PROTON_PLUS_WIDGETS_MANGO_HUD_PAGE_NUM_SIGNALS] = {0};

struct _ProtonPlusWidgetsMangoHudPagePrivate {
	ProtonPlusUtilsMangoHudManager* _config;
	gboolean _is_updating;
};

struct _Block31Data {
	int _ref_count_;
	ProtonPlusWidgetsMangoHudPage* self;
	GtkColorDialogButton* btn;
	ProtonPlusWidgetsMangoHudPageSetValueFuncStr set_color;
	gpointer set_color_target;
};

struct _Block32Data {
	int _ref_count_;
	ProtonPlusWidgetsMangoHudPage* self;
	AdwEntryRow* row;
	ProtonPlusWidgetsMangoHudPageSetValueFuncStr set_value;
	gpointer set_value_target;
};

struct _Block33Data {
	int _ref_count_;
	ProtonPlusWidgetsMangoHudPage* self;
	AdwComboRow* row;
	ProtonPlusWidgetsMangoHudPageSetValueFuncInt set_value;
	gpointer set_value_target;
};

struct _Block34Data {
	int _ref_count_;
	ProtonPlusWidgetsMangoHudPage* self;
	GtkScale* scale;
	ProtonPlusWidgetsMangoHudPageSetValueFuncStr set_value;
	gpointer set_value_target;
};

struct _Block35Data {
	int _ref_count_;
	ProtonPlusWidgetsMangoHudPage* self;
	AdwSwitchRow* row;
	ProtonPlusWidgetsMangoHudPageSetValueFunc set_value;
	gpointer set_value_target;
};

static gint ProtonPlusWidgetsMangoHudPage_private_offset;
static gpointer proton_plus_widgets_mango_hud_page_parent_class = NULL;

static Block31Data* block31_data_ref (Block31Data* _data31_);
static void block31_data_unref (void * _userdata_);
static void __lambda179_ (Block31Data* _data31_);
static void ___lambda179__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void proton_plus_widgets_mango_hud_page_real_refresh (ProtonPlusWidgetsMangoHudPage* self);
static Block32Data* block32_data_ref (Block32Data* _data32_);
static void block32_data_unref (void * _userdata_);
static void __lambda180_ (Block32Data* _data32_);
static void ___lambda180__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static Block33Data* block33_data_ref (Block33Data* _data33_);
static void block33_data_unref (void * _userdata_);
static void __lambda181_ (Block33Data* _data33_);
static void ___lambda181__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static Block34Data* block34_data_ref (Block34Data* _data34_);
static void block34_data_unref (void * _userdata_);
static void __lambda182_ (Block34Data* _data34_);
static void ___lambda182__gtk_range_value_changed (GtkRange* _sender,
                                            gpointer self);
static Block35Data* block35_data_ref (Block35Data* _data35_);
static void block35_data_unref (void * _userdata_);
static void __lambda183_ (Block35Data* _data35_);
static void ___lambda183__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void proton_plus_widgets_mango_hud_page_finalize (GObject * obj);
static GType proton_plus_widgets_mango_hud_page_get_type_once (void);
static void _vala_proton_plus_widgets_mango_hud_page_get_property (GObject * object,
                                                            guint property_id,
                                                            GValue * value,
                                                            GParamSpec * pspec);
static void _vala_proton_plus_widgets_mango_hud_page_set_property (GObject * object,
                                                            guint property_id,
                                                            const GValue * value,
                                                            GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
proton_plus_widgets_mango_hud_page_get_instance_private (ProtonPlusWidgetsMangoHudPage* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsMangoHudPage_private_offset);
}

void
proton_plus_widgets_mango_hud_page_hex_to_rgba (ProtonPlusWidgetsMangoHudPage* self,
                                                const gchar* hex,
                                                const gchar* default_color,
                                                GdkRGBA* result)
{
	GdkRGBA rgba = {0};
	g_return_if_fail (self != NULL);
	g_return_if_fail (hex != NULL);
	g_return_if_fail (default_color != NULL);
	memset (&rgba, 0, sizeof (GdkRGBA));
	if (g_strcmp0 (hex, "") != 0) {
		if (!g_str_has_prefix (hex, "#")) {
			gchar* _tmp0_;
			gchar* _tmp1_;
			_tmp0_ = g_strconcat ("#", hex, NULL);
			_tmp1_ = _tmp0_;
			gdk_rgba_parse (&rgba, _tmp1_);
			_g_free0 (_tmp1_);
		} else {
			gdk_rgba_parse (&rgba, hex);
		}
	} else {
		gdk_rgba_parse (&rgba, default_color);
	}
	*result = rgba;
	return;
}

gchar*
proton_plus_widgets_mango_hud_page_rgba_to_hex (ProtonPlusWidgetsMangoHudPage* self,
                                                GdkRGBA* rgba)
{
	GdkRGBA _tmp0_;
	GdkRGBA _tmp1_;
	GdkRGBA _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (rgba != NULL, NULL);
	_tmp0_ = *rgba;
	_tmp1_ = *rgba;
	_tmp2_ = *rgba;
	_tmp3_ = g_strdup_printf ("%02x%02x%02x", (guint) round (_tmp0_.red * 255.0), (guint) round (_tmp1_.green * 255.0), (guint) round (_tmp2_.blue * 255.0));
	result = _tmp3_;
	return result;
}

static Block31Data*
block31_data_ref (Block31Data* _data31_)
{
	g_atomic_int_inc (&_data31_->_ref_count_);
	return _data31_;
}

static void
block31_data_unref (void * _userdata_)
{
	Block31Data* _data31_;
	_data31_ = (Block31Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data31_->_ref_count_)) {
		ProtonPlusWidgetsMangoHudPage* self;
		self = _data31_->self;
		_g_object_unref0 (_data31_->btn);
		_g_object_unref0 (self);
		g_slice_free (Block31Data, _data31_);
	}
}

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

static void
__lambda179_ (Block31Data* _data31_)
{
	ProtonPlusWidgetsMangoHudPage* self;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	GdkRGBA rgba = {0};
	GdkRGBA _tmp3_ = {0};
	GdkRGBA _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	self = _data31_->self;
	_tmp1_ = self->priv->_is_updating;
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		ProtonPlusUtilsMangoHudManager* _tmp2_;
		_tmp2_ = self->priv->_config;
		_tmp0_ = _tmp2_ == NULL;
	}
	if (_tmp0_) {
		return;
	}
	g_object_get ((GObject*) _data31_->btn, "rgba", &_tmp3_, NULL);
	rgba = _tmp3_;
	_tmp4_ = rgba;
	_tmp5_ = proton_plus_widgets_mango_hud_page_rgba_to_hex (self, &_tmp4_);
	_tmp6_ = _tmp5_;
	_data31_->set_color (_tmp6_, _data31_->set_color_target);
	_g_free0 (_tmp6_);
	g_signal_emit (self, proton_plus_widgets_mango_hud_page_signals[PROTON_PLUS_WIDGETS_MANGO_HUD_PAGE_CHANGED_SIGNAL], 0);
}

static void
___lambda179__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda179_ (self);
}

GtkColorDialogButton*
proton_plus_widgets_mango_hud_page_create_color_button (ProtonPlusWidgetsMangoHudPage* self,
                                                        GtkColorDialog* dialog,
                                                        const gchar* initial_color,
                                                        ProtonPlusWidgetsMangoHudPageSetValueFuncStr set_color,
                                                        gpointer set_color_target)
{
	Block31Data* _data31_;
	GtkColorDialog* _tmp0_;
	GtkColorDialogButton* _tmp1_;
	GdkRGBA _tmp2_ = {0};
	GtkColorDialogButton* _tmp3_;
	GtkColorDialogButton* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (dialog != NULL, NULL);
	g_return_val_if_fail (initial_color != NULL, NULL);
	_data31_ = g_slice_new0 (Block31Data);
	_data31_->_ref_count_ = 1;
	_data31_->self = g_object_ref (self);
	_data31_->set_color = set_color;
	_data31_->set_color_target = set_color_target;
	_tmp0_ = _g_object_ref0 (dialog);
	_tmp1_ = (GtkColorDialogButton*) gtk_color_dialog_button_new (_tmp0_);
	g_object_ref_sink (_tmp1_);
	_data31_->btn = _tmp1_;
	gtk_widget_set_valign ((GtkWidget*) _data31_->btn, GTK_ALIGN_CENTER);
	proton_plus_widgets_mango_hud_page_hex_to_rgba (self, initial_color, "#ffffff", &_tmp2_);
	gtk_color_dialog_button_set_rgba (_data31_->btn, &_tmp2_);
	g_signal_connect_data ((GObject*) _data31_->btn, "notify::rgba", (GCallback) ___lambda179__g_object_notify, block31_data_ref (_data31_), (GClosureNotify) block31_data_unref, 0);
	_tmp3_ = _g_object_ref0 (_data31_->btn);
	result = _tmp3_;
	block31_data_unref (_data31_);
	_data31_ = NULL;
	return result;
}

GtkFlowBox*
proton_plus_widgets_mango_hud_page_add_flow_group (ProtonPlusWidgetsMangoHudPage* self,
                                                   GtkBox* page,
                                                   const gchar* title,
                                                   GtkWidget** widgets,
                                                   gint widgets_length1,
                                                   const gchar* title_class)
{
	GtkFlowBox* flow_box = NULL;
	GtkFlowBox* _tmp0_;
	GtkFlowBox* _tmp9_;
	GtkFlowBox* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (page != NULL, NULL);
	g_return_val_if_fail (title_class != NULL, NULL);
	_tmp0_ = proton_plus_widgets_mango_hud_page_create_flow_box (self);
	flow_box = _tmp0_;
	{
		GtkWidget** widget_collection = NULL;
		gint widget_collection_length1 = 0;
		gint _widget_collection_size_ = 0;
		gint widget_it = 0;
		widget_collection = widgets;
		widget_collection_length1 = widgets_length1;
		for (widget_it = 0; widget_it < widget_collection_length1; widget_it = widget_it + 1) {
			GtkWidget* _tmp1_;
			GtkWidget* widget = NULL;
			_tmp1_ = _g_object_ref0 (widget_collection[widget_it]);
			widget = _tmp1_;
			{
				GtkWidget* _tmp2_;
				_tmp2_ = widget;
				if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, gtk_list_box_row_get_type ())) {
					GtkFlowBox* _tmp3_;
					GtkWidget* _tmp4_;
					GtkWidget* _tmp5_;
					GtkWidget* _tmp6_;
					_tmp3_ = flow_box;
					_tmp4_ = widget;
					_tmp5_ = proton_plus_widgets_mango_hud_page_create_row_card (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_list_box_row_get_type (), GtkListBoxRow));
					_tmp6_ = _tmp5_;
					gtk_flow_box_append (_tmp3_, _tmp6_);
					_g_object_unref0 (_tmp6_);
				} else {
					GtkFlowBox* _tmp7_;
					GtkWidget* _tmp8_;
					_tmp7_ = flow_box;
					_tmp8_ = widget;
					gtk_flow_box_append (_tmp7_, _tmp8_);
				}
				_g_object_unref0 (widget);
			}
		}
	}
	_tmp9_ = flow_box;
	proton_plus_widgets_mango_hud_page_add_group_to_page (self, page, title, (GtkWidget*) _tmp9_, title_class);
	result = flow_box;
	return result;
}

ProtonPlusWidgetsMangoHudPage*
proton_plus_widgets_mango_hud_page_construct (GType object_type,
                                              ProtonPlusUtilsMangoHudManager* config)
{
	ProtonPlusWidgetsMangoHudPage * self = NULL;
	g_return_val_if_fail (config != NULL, NULL);
	self = (ProtonPlusWidgetsMangoHudPage*) g_object_new (object_type, "orientation", GTK_ORIENTATION_VERTICAL, "spacing", 12, NULL);
	proton_plus_widgets_mango_hud_page_set_config (self, config);
	gtk_widget_set_hexpand ((GtkWidget*) self, TRUE);
	return self;
}

static void
proton_plus_widgets_mango_hud_page_real_refresh (ProtonPlusWidgetsMangoHudPage* self)
{
	g_critical ("Type `%s' does not implement abstract method `proton_plus_widgets_mango_hud_page_refresh'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}

void
proton_plus_widgets_mango_hud_page_refresh (ProtonPlusWidgetsMangoHudPage* self)
{
	ProtonPlusWidgetsMangoHudPageClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = PROTON_PLUS_WIDGETS_MANGO_HUD_PAGE_GET_CLASS (self);
	if (_klass_->refresh) {
		_klass_->refresh (self);
	}
}

static Block32Data*
block32_data_ref (Block32Data* _data32_)
{
	g_atomic_int_inc (&_data32_->_ref_count_);
	return _data32_;
}

static void
block32_data_unref (void * _userdata_)
{
	Block32Data* _data32_;
	_data32_ = (Block32Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data32_->_ref_count_)) {
		ProtonPlusWidgetsMangoHudPage* self;
		self = _data32_->self;
		_g_object_unref0 (_data32_->row);
		_g_object_unref0 (self);
		g_slice_free (Block32Data, _data32_);
	}
}

static void
__lambda180_ (Block32Data* _data32_)
{
	ProtonPlusWidgetsMangoHudPage* self;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	self = _data32_->self;
	_tmp1_ = self->priv->_is_updating;
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		ProtonPlusUtilsMangoHudManager* _tmp2_;
		_tmp2_ = self->priv->_config;
		_tmp0_ = _tmp2_ == NULL;
	}
	if (_tmp0_) {
		return;
	}
	_tmp3_ = gtk_editable_get_text ((GtkEditable*) _data32_->row);
	_tmp4_ = _tmp3_;
	_data32_->set_value (_tmp4_, _data32_->set_value_target);
	g_signal_emit (self, proton_plus_widgets_mango_hud_page_signals[PROTON_PLUS_WIDGETS_MANGO_HUD_PAGE_CHANGED_SIGNAL], 0);
}

static void
___lambda180__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda180_ (self);
}

AdwEntryRow*
proton_plus_widgets_mango_hud_page_create_entry (ProtonPlusWidgetsMangoHudPage* self,
                                                 const gchar* title,
                                                 const gchar* initial_value,
                                                 ProtonPlusWidgetsMangoHudPageSetValueFuncStr set_value,
                                                 gpointer set_value_target,
                                                 ProtonPlusUtilsTextInputFieldKind field_kind)
{
	Block32Data* _data32_;
	gchar* _tmp0_;
	gchar* _tmp1_;
	AdwEntryRow* _tmp2_ = NULL;
	AdwEntryRow* _tmp3_;
	AdwEntryRow* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (title != NULL, NULL);
	g_return_val_if_fail (initial_value != NULL, NULL);
	_data32_ = g_slice_new0 (Block32Data);
	_data32_->_ref_count_ = 1;
	_data32_->self = g_object_ref (self);
	_data32_->set_value = set_value;
	_data32_->set_value_target = set_value_target;
	_tmp0_ = g_strdup (title);
	_tmp1_ = g_strdup (initial_value);
	_tmp2_ = (AdwEntryRow*) adw_entry_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp2_, _tmp0_);
	_g_free0 (_tmp0_);
	gtk_editable_set_text ((GtkEditable*) _tmp2_, _tmp1_);
	_g_free0 (_tmp1_);
	g_object_ref_sink (_tmp2_);
	_data32_->row = _tmp2_;
	proton_plus_utils_text_input_metadata_policy_apply ((GtkWidget*) _data32_->row, field_kind);
	g_signal_connect_data ((GObject*) _data32_->row, "notify::text", (GCallback) ___lambda180__g_object_notify, block32_data_ref (_data32_), (GClosureNotify) block32_data_unref, 0);
	_tmp3_ = _g_object_ref0 (_data32_->row);
	result = _tmp3_;
	block32_data_unref (_data32_);
	_data32_ = NULL;
	return result;
}

static Block33Data*
block33_data_ref (Block33Data* _data33_)
{
	g_atomic_int_inc (&_data33_->_ref_count_);
	return _data33_;
}

static void
block33_data_unref (void * _userdata_)
{
	Block33Data* _data33_;
	_data33_ = (Block33Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data33_->_ref_count_)) {
		ProtonPlusWidgetsMangoHudPage* self;
		self = _data33_->self;
		_g_object_unref0 (_data33_->row);
		_g_object_unref0 (self);
		g_slice_free (Block33Data, _data33_);
	}
}

static void
__lambda181_ (Block33Data* _data33_)
{
	ProtonPlusWidgetsMangoHudPage* self;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	AdwComboRow* _tmp3_;
	guint _tmp4_;
	guint _tmp5_;
	self = _data33_->self;
	_tmp1_ = self->priv->_is_updating;
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		ProtonPlusUtilsMangoHudManager* _tmp2_;
		_tmp2_ = self->priv->_config;
		_tmp0_ = _tmp2_ == NULL;
	}
	if (_tmp0_) {
		return;
	}
	_tmp3_ = _data33_->row;
	_tmp4_ = adw_combo_row_get_selected (_tmp3_);
	_tmp5_ = _tmp4_;
	_data33_->set_value ((gint) _tmp5_, _data33_->set_value_target);
	g_signal_emit (self, proton_plus_widgets_mango_hud_page_signals[PROTON_PLUS_WIDGETS_MANGO_HUD_PAGE_CHANGED_SIGNAL], 0);
}

static void
___lambda181__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda181_ (self);
}

AdwComboRow*
proton_plus_widgets_mango_hud_page_create_combo (ProtonPlusWidgetsMangoHudPage* self,
                                                 const gchar* title,
                                                 gchar** items,
                                                 gint items_length1,
                                                 gint initial_selected,
                                                 const gchar* icon_name,
                                                 ProtonPlusWidgetsMangoHudPageSetValueFuncInt set_value,
                                                 gpointer set_value_target)
{
	Block33Data* _data33_;
	gchar* _tmp0_;
	GtkStringList* _tmp1_;
	AdwComboRow* _tmp2_ = NULL;
	AdwComboRow* _tmp6_;
	AdwComboRow* _tmp7_;
	AdwComboRow* _tmp8_;
	AdwComboRow* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (title != NULL, NULL);
	_data33_ = g_slice_new0 (Block33Data);
	_data33_->_ref_count_ = 1;
	_data33_->self = g_object_ref (self);
	_data33_->set_value = set_value;
	_data33_->set_value_target = set_value_target;
	_tmp0_ = g_strdup (title);
	_tmp1_ = gtk_string_list_new (items);
	_tmp2_ = (AdwComboRow*) adw_combo_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp2_, _tmp0_);
	_g_free0 (_tmp0_);
	adw_combo_row_set_model (_tmp2_, (GListModel*) _tmp1_);
	_g_object_unref0 (_tmp1_);
	adw_combo_row_set_selected (_tmp2_, (guint) initial_selected);
	g_object_ref_sink (_tmp2_);
	_data33_->row = _tmp2_;
	if (icon_name != NULL) {
		AdwComboRow* _tmp3_;
		GtkImage* _tmp4_;
		GtkImage* _tmp5_;
		_tmp3_ = _data33_->row;
		_tmp4_ = (GtkImage*) gtk_image_new_from_icon_name (icon_name);
		g_object_ref_sink (_tmp4_);
		_tmp5_ = _tmp4_;
		adw_action_row_add_prefix ((AdwActionRow*) _tmp3_, (GtkWidget*) _tmp5_);
		_g_object_unref0 (_tmp5_);
	}
	_tmp6_ = _data33_->row;
	g_signal_connect_data ((GObject*) _tmp6_, "notify::selected", (GCallback) ___lambda181__g_object_notify, block33_data_ref (_data33_), (GClosureNotify) block33_data_unref, 0);
	_tmp7_ = _data33_->row;
	_tmp8_ = _g_object_ref0 (_tmp7_);
	result = _tmp8_;
	block33_data_unref (_data33_);
	_data33_ = NULL;
	return result;
}

void
proton_plus_widgets_mango_hud_page_add_group_to_page (ProtonPlusWidgetsMangoHudPage* self,
                                                      GtkBox* page,
                                                      const gchar* title,
                                                      GtkWidget* content,
                                                      const gchar* title_class)
{
	GtkBox* group_box = NULL;
	GtkBox* _tmp0_;
	GtkBox* _tmp5_;
	GtkBox* _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (page != NULL);
	g_return_if_fail (content != NULL);
	g_return_if_fail (title_class != NULL);
	_tmp0_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
	g_object_ref_sink (_tmp0_);
	group_box = _tmp0_;
	if (title != NULL) {
		GtkLabel* label = NULL;
		GtkLabel* _tmp1_ = NULL;
		GtkLabel* _tmp2_;
		GtkBox* _tmp3_;
		GtkLabel* _tmp4_;
		_tmp1_ = (GtkLabel*) gtk_label_new (title);
		gtk_widget_set_halign ((GtkWidget*) _tmp1_, GTK_ALIGN_START);
		gtk_widget_set_margin_start ((GtkWidget*) _tmp1_, 12);
		g_object_ref_sink (_tmp1_);
		label = _tmp1_;
		_tmp2_ = label;
		gtk_widget_add_css_class ((GtkWidget*) _tmp2_, title_class);
		_tmp3_ = group_box;
		_tmp4_ = label;
		gtk_box_append (_tmp3_, (GtkWidget*) _tmp4_);
		_g_object_unref0 (label);
	}
	_tmp5_ = group_box;
	gtk_box_append (_tmp5_, content);
	_tmp6_ = group_box;
	gtk_box_append (page, (GtkWidget*) _tmp6_);
	_g_object_unref0 (group_box);
}

GtkWidget*
proton_plus_widgets_mango_hud_page_create_row_card (ProtonPlusWidgetsMangoHudPage* self,
                                                    GtkListBoxRow* row)
{
	GtkListBox* list_box = NULL;
	GtkListBox* _tmp0_ = NULL;
	GtkBox* card = NULL;
	GtkBox* _tmp1_;
	GtkWidget* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (row != NULL, NULL);
	_tmp0_ = (GtkListBox*) gtk_list_box_new ();
	gtk_list_box_set_selection_mode (_tmp0_, GTK_SELECTION_NONE);
	g_object_ref_sink (_tmp0_);
	list_box = _tmp0_;
	gtk_list_box_append (list_box, (GtkWidget*) row);
	_tmp1_ = proton_plus_widgets_mango_hud_page_create_card_box (self);
	card = _tmp1_;
	gtk_box_append (card, (GtkWidget*) list_box);
	result = (GtkWidget*) card;
	_g_object_unref0 (list_box);
	return result;
}

GtkFlowBox*
proton_plus_widgets_mango_hud_page_create_flow_box (ProtonPlusWidgetsMangoHudPage* self)
{
	GtkFlowBox* _tmp0_ = NULL;
	GtkFlowBox* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = (GtkFlowBox*) gtk_flow_box_new ();
	gtk_widget_set_valign ((GtkWidget*) _tmp0_, GTK_ALIGN_START);
	gtk_flow_box_set_max_children_per_line (_tmp0_, (guint) 3);
	gtk_flow_box_set_min_children_per_line (_tmp0_, (guint) 1);
	gtk_flow_box_set_row_spacing (_tmp0_, (guint) 12);
	gtk_flow_box_set_column_spacing (_tmp0_, (guint) 12);
	gtk_flow_box_set_selection_mode (_tmp0_, GTK_SELECTION_NONE);
	g_object_ref_sink (_tmp0_);
	result = _tmp0_;
	return result;
}

GtkBox*
proton_plus_widgets_mango_hud_page_create_card_box (ProtonPlusWidgetsMangoHudPage* self)
{
	GtkBox* box = NULL;
	GtkBox* _tmp0_ = NULL;
	GtkBox* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp0_, TRUE);
	gtk_widget_set_valign ((GtkWidget*) _tmp0_, GTK_ALIGN_START);
	gtk_widget_set_overflow ((GtkWidget*) _tmp0_, GTK_OVERFLOW_HIDDEN);
	g_object_ref_sink (_tmp0_);
	box = _tmp0_;
	gtk_widget_add_css_class ((GtkWidget*) box, "card");
	result = box;
	return result;
}

GtkToggleButton*
proton_plus_widgets_mango_hud_page_create_preset_button (ProtonPlusWidgetsMangoHudPage* self,
                                                         const gchar* label,
                                                         const gchar* icon_name,
                                                         GtkToggleButton** group)
{
	GtkToggleButton* button = NULL;
	GtkToggleButton* _tmp0_;
	GtkBox* box = NULL;
	GtkBox* _tmp4_ = NULL;
	GtkImage* image = NULL;
	GtkImage* _tmp5_ = NULL;
	GtkLabel* lbl = NULL;
	GtkLabel* _tmp6_;
	GtkToggleButton* _tmp7_;
	GtkToggleButton* _tmp8_;
	GtkToggleButton* _tmp9_;
	GtkToggleButton* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (label != NULL, NULL);
	g_return_val_if_fail (icon_name != NULL, NULL);
	_tmp0_ = (GtkToggleButton*) gtk_toggle_button_new ();
	g_object_ref_sink (_tmp0_);
	button = _tmp0_;
	if ((*group) == NULL) {
		GtkToggleButton* _tmp1_;
		GtkToggleButton* _tmp2_;
		_tmp1_ = button;
		_tmp2_ = _g_object_ref0 (_tmp1_);
		_g_object_unref0 (*group);
		*group = _tmp2_;
	} else {
		GtkToggleButton* _tmp3_;
		_tmp3_ = button;
		gtk_toggle_button_set_group (_tmp3_, *group);
	}
	_tmp4_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp4_, 12);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp4_, 12);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp4_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp4_, 12);
	g_object_ref_sink (_tmp4_);
	box = _tmp4_;
	_tmp5_ = (GtkImage*) gtk_image_new_from_icon_name (icon_name);
	gtk_image_set_pixel_size (_tmp5_, 24);
	g_object_ref_sink (_tmp5_);
	image = _tmp5_;
	_tmp6_ = (GtkLabel*) gtk_label_new (label);
	g_object_ref_sink (_tmp6_);
	lbl = _tmp6_;
	gtk_box_append (box, (GtkWidget*) image);
	gtk_box_append (box, (GtkWidget*) lbl);
	_tmp7_ = button;
	gtk_button_set_child ((GtkButton*) _tmp7_, (GtkWidget*) box);
	_tmp8_ = button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp8_, "card");
	_tmp9_ = button;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp9_, TRUE);
	result = button;
	_g_object_unref0 (lbl);
	_g_object_unref0 (image);
	_g_object_unref0 (box);
	return result;
}

static Block34Data*
block34_data_ref (Block34Data* _data34_)
{
	g_atomic_int_inc (&_data34_->_ref_count_);
	return _data34_;
}

static void
block34_data_unref (void * _userdata_)
{
	Block34Data* _data34_;
	_data34_ = (Block34Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data34_->_ref_count_)) {
		ProtonPlusWidgetsMangoHudPage* self;
		self = _data34_->self;
		_g_object_unref0 (_data34_->scale);
		_g_object_unref0 (self);
		g_slice_free (Block34Data, _data34_);
	}
}

static void
__lambda182_ (Block34Data* _data34_)
{
	ProtonPlusWidgetsMangoHudPage* self;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	self = _data34_->self;
	_tmp1_ = self->priv->_is_updating;
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		ProtonPlusUtilsMangoHudManager* _tmp2_;
		_tmp2_ = self->priv->_config;
		_tmp0_ = _tmp2_ == NULL;
	}
	if (_tmp0_) {
		return;
	}
	_tmp3_ = g_strdup_printf ("%.0f", gtk_range_get_value ((GtkRange*) _data34_->scale));
	_tmp4_ = _tmp3_;
	_data34_->set_value (_tmp4_, _data34_->set_value_target);
	_g_free0 (_tmp4_);
	g_signal_emit (self, proton_plus_widgets_mango_hud_page_signals[PROTON_PLUS_WIDGETS_MANGO_HUD_PAGE_CHANGED_SIGNAL], 0);
}

static void
___lambda182__gtk_range_value_changed (GtkRange* _sender,
                                       gpointer self)
{
	__lambda182_ (self);
}

GtkListBoxRow*
proton_plus_widgets_mango_hud_page_create_scale (ProtonPlusWidgetsMangoHudPage* self,
                                                 const gchar* title,
                                                 gdouble min,
                                                 gdouble max,
                                                 gdouble step,
                                                 GtkScale** scale_out,
                                                 ProtonPlusWidgetsMangoHudPageSetValueFuncStr set_value,
                                                 gpointer set_value_target)
{
	GtkScale* _vala_scale_out = NULL;
	Block34Data* _data34_;
	GtkListBoxRow* row = NULL;
	GtkListBoxRow* _tmp0_;
	GtkBox* box = NULL;
	GtkBox* _tmp1_ = NULL;
	GtkLabel* label = NULL;
	GtkLabel* _tmp2_ = NULL;
	GtkScale* _tmp3_ = NULL;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	GtkScale* _tmp8_;
	GtkListBoxRow* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (title != NULL, NULL);
	_data34_ = g_slice_new0 (Block34Data);
	_data34_->_ref_count_ = 1;
	_data34_->self = g_object_ref (self);
	_data34_->set_value = set_value;
	_data34_->set_value_target = set_value_target;
	_tmp0_ = (GtkListBoxRow*) gtk_list_box_row_new ();
	g_object_ref_sink (_tmp0_);
	row = _tmp0_;
	gtk_list_box_row_set_selectable (row, FALSE);
	gtk_list_box_row_set_activatable (row, FALSE);
	gtk_widget_set_focusable ((GtkWidget*) row, FALSE);
	_tmp1_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp1_, 12);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp1_, 12);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp1_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp1_, 12);
	g_object_ref_sink (_tmp1_);
	box = _tmp1_;
	_tmp2_ = (GtkLabel*) gtk_label_new (title);
	gtk_widget_set_halign ((GtkWidget*) _tmp2_, GTK_ALIGN_START);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp2_, TRUE);
	g_object_ref_sink (_tmp2_);
	label = _tmp2_;
	gtk_box_append (box, (GtkWidget*) label);
	_tmp3_ = (GtkScale*) gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, min, max, step);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp3_, TRUE);
	gtk_scale_set_draw_value (_tmp3_, TRUE);
	gtk_scale_set_value_pos (_tmp3_, GTK_POS_BOTTOM);
	g_object_ref_sink (_tmp3_);
	_data34_->scale = _tmp3_;
	_tmp4_ = g_strdup_printf ("%.0f", min);
	_tmp5_ = _tmp4_;
	gtk_scale_add_mark (_data34_->scale, min, GTK_POS_TOP, _tmp5_);
	_g_free0 (_tmp5_);
	_tmp6_ = g_strdup_printf ("%.0f", max);
	_tmp7_ = _tmp6_;
	gtk_scale_add_mark (_data34_->scale, max, GTK_POS_TOP, _tmp7_);
	_g_free0 (_tmp7_);
	g_signal_connect_data ((GtkRange*) _data34_->scale, "value-changed", (GCallback) ___lambda182__gtk_range_value_changed, block34_data_ref (_data34_), (GClosureNotify) block34_data_unref, 0);
	gtk_box_append (box, (GtkWidget*) _data34_->scale);
	gtk_list_box_row_set_child (row, (GtkWidget*) box);
	_tmp8_ = _g_object_ref0 (_data34_->scale);
	_g_object_unref0 (_vala_scale_out);
	_vala_scale_out = _tmp8_;
	result = row;
	_g_object_unref0 (label);
	_g_object_unref0 (box);
	block34_data_unref (_data34_);
	_data34_ = NULL;
	if (scale_out) {
		*scale_out = _vala_scale_out;
	} else {
		_g_object_unref0 (_vala_scale_out);
	}
	return result;
}

static Block35Data*
block35_data_ref (Block35Data* _data35_)
{
	g_atomic_int_inc (&_data35_->_ref_count_);
	return _data35_;
}

static void
block35_data_unref (void * _userdata_)
{
	Block35Data* _data35_;
	_data35_ = (Block35Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data35_->_ref_count_)) {
		ProtonPlusWidgetsMangoHudPage* self;
		self = _data35_->self;
		_g_object_unref0 (_data35_->row);
		_g_object_unref0 (self);
		g_slice_free (Block35Data, _data35_);
	}
}

static void
__lambda183_ (Block35Data* _data35_)
{
	ProtonPlusWidgetsMangoHudPage* self;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	AdwSwitchRow* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	self = _data35_->self;
	_tmp1_ = self->priv->_is_updating;
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		ProtonPlusUtilsMangoHudManager* _tmp2_;
		_tmp2_ = self->priv->_config;
		_tmp0_ = _tmp2_ == NULL;
	}
	if (_tmp0_) {
		return;
	}
	_tmp3_ = _data35_->row;
	_tmp4_ = adw_switch_row_get_active (_tmp3_);
	_tmp5_ = _tmp4_;
	_data35_->set_value (_tmp5_, _data35_->set_value_target);
	g_signal_emit (self, proton_plus_widgets_mango_hud_page_signals[PROTON_PLUS_WIDGETS_MANGO_HUD_PAGE_CHANGED_SIGNAL], 0);
}

static void
___lambda183__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda183_ (self);
}

AdwSwitchRow*
proton_plus_widgets_mango_hud_page_create_switch (ProtonPlusWidgetsMangoHudPage* self,
                                                  const gchar* title,
                                                  gboolean initial_value,
                                                  ProtonPlusWidgetsMangoHudPageSetValueFunc set_value,
                                                  gpointer set_value_target,
                                                  const gchar* icon_name)
{
	Block35Data* _data35_;
	gchar* _tmp0_;
	AdwSwitchRow* _tmp1_ = NULL;
	AdwSwitchRow* _tmp2_;
	AdwSwitchRow* _tmp6_;
	AdwSwitchRow* _tmp7_;
	AdwSwitchRow* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (title != NULL, NULL);
	_data35_ = g_slice_new0 (Block35Data);
	_data35_->_ref_count_ = 1;
	_data35_->self = g_object_ref (self);
	_data35_->set_value = set_value;
	_data35_->set_value_target = set_value_target;
	_tmp0_ = g_strdup (title);
	_tmp1_ = (AdwSwitchRow*) adw_switch_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp1_, _tmp0_);
	_g_free0 (_tmp0_);
	adw_switch_row_set_active (_tmp1_, initial_value);
	g_object_ref_sink (_tmp1_);
	_data35_->row = _tmp1_;
	_tmp2_ = _data35_->row;
	g_signal_connect_data ((GObject*) _tmp2_, "notify::active", (GCallback) ___lambda183__g_object_notify, block35_data_ref (_data35_), (GClosureNotify) block35_data_unref, 0);
	if (icon_name != NULL) {
		AdwSwitchRow* _tmp3_;
		GtkImage* _tmp4_;
		GtkImage* _tmp5_;
		_tmp3_ = _data35_->row;
		_tmp4_ = (GtkImage*) gtk_image_new_from_icon_name (icon_name);
		g_object_ref_sink (_tmp4_);
		_tmp5_ = _tmp4_;
		adw_action_row_add_prefix ((AdwActionRow*) _tmp3_, (GtkWidget*) _tmp5_);
		_g_object_unref0 (_tmp5_);
	}
	_tmp6_ = _data35_->row;
	_tmp7_ = _g_object_ref0 (_tmp6_);
	result = _tmp7_;
	block35_data_unref (_data35_);
	_data35_ = NULL;
	return result;
}

ProtonPlusUtilsMangoHudManager*
proton_plus_widgets_mango_hud_page_get_config (ProtonPlusWidgetsMangoHudPage* self)
{
	ProtonPlusUtilsMangoHudManager* result;
	ProtonPlusUtilsMangoHudManager* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_config;
	result = _tmp0_;
	return result;
}

void
proton_plus_widgets_mango_hud_page_set_config (ProtonPlusWidgetsMangoHudPage* self,
                                               ProtonPlusUtilsMangoHudManager* value)
{
	ProtonPlusUtilsMangoHudManager* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_mango_hud_page_get_config (self);
	if (old_value != value) {
		ProtonPlusUtilsMangoHudManager* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_config);
		self->priv->_config = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_mango_hud_page_properties[PROTON_PLUS_WIDGETS_MANGO_HUD_PAGE_CONFIG_PROPERTY]);
	}
}

gboolean
proton_plus_widgets_mango_hud_page_get_is_updating (ProtonPlusWidgetsMangoHudPage* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_updating;
	return result;
}

void
proton_plus_widgets_mango_hud_page_set_is_updating (ProtonPlusWidgetsMangoHudPage* self,
                                                    gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_mango_hud_page_get_is_updating (self);
	if (old_value != value) {
		self->priv->_is_updating = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_mango_hud_page_properties[PROTON_PLUS_WIDGETS_MANGO_HUD_PAGE_IS_UPDATING_PROPERTY]);
	}
}

static void
proton_plus_widgets_mango_hud_page_class_init (ProtonPlusWidgetsMangoHudPageClass * klass,
                                               gpointer klass_data)
{
	proton_plus_widgets_mango_hud_page_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsMangoHudPage_private_offset);
	((ProtonPlusWidgetsMangoHudPageClass *) klass)->refresh = (void (*) (ProtonPlusWidgetsMangoHudPage*)) proton_plus_widgets_mango_hud_page_real_refresh;
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_widgets_mango_hud_page_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_widgets_mango_hud_page_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_mango_hud_page_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_MANGO_HUD_PAGE_CONFIG_PROPERTY, proton_plus_widgets_mango_hud_page_properties[PROTON_PLUS_WIDGETS_MANGO_HUD_PAGE_CONFIG_PROPERTY] = g_param_spec_object ("config", "config", "config", PROTON_PLUS_UTILS_TYPE_MANGO_HUD_MANAGER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_MANGO_HUD_PAGE_IS_UPDATING_PROPERTY, proton_plus_widgets_mango_hud_page_properties[PROTON_PLUS_WIDGETS_MANGO_HUD_PAGE_IS_UPDATING_PROPERTY] = g_param_spec_boolean ("is-updating", "is-updating", "is-updating", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	proton_plus_widgets_mango_hud_page_signals[PROTON_PLUS_WIDGETS_MANGO_HUD_PAGE_CHANGED_SIGNAL] = g_signal_new ("changed", PROTON_PLUS_WIDGETS_MANGO_HUD_TYPE_PAGE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
proton_plus_widgets_mango_hud_page_instance_init (ProtonPlusWidgetsMangoHudPage * self,
                                                  gpointer klass)
{
	self->priv = proton_plus_widgets_mango_hud_page_get_instance_private (self);
	self->priv->_is_updating = FALSE;
}

static void
proton_plus_widgets_mango_hud_page_finalize (GObject * obj)
{
	ProtonPlusWidgetsMangoHudPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_MANGO_HUD_TYPE_PAGE, ProtonPlusWidgetsMangoHudPage);
	_g_object_unref0 (self->priv->_config);
	G_OBJECT_CLASS (proton_plus_widgets_mango_hud_page_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_mango_hud_page_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsMangoHudPageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_mango_hud_page_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsMangoHudPage), 0, (GInstanceInitFunc) proton_plus_widgets_mango_hud_page_instance_init, NULL };
	GType proton_plus_widgets_mango_hud_page_type_id;
	proton_plus_widgets_mango_hud_page_type_id = g_type_register_static (gtk_box_get_type (), "ProtonPlusWidgetsMangoHudPage", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	ProtonPlusWidgetsMangoHudPage_private_offset = g_type_add_instance_private (proton_plus_widgets_mango_hud_page_type_id, sizeof (ProtonPlusWidgetsMangoHudPagePrivate));
	return proton_plus_widgets_mango_hud_page_type_id;
}

GType
proton_plus_widgets_mango_hud_page_get_type (void)
{
	static volatile gsize proton_plus_widgets_mango_hud_page_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_mango_hud_page_type_id__once)) {
		GType proton_plus_widgets_mango_hud_page_type_id;
		proton_plus_widgets_mango_hud_page_type_id = proton_plus_widgets_mango_hud_page_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_mango_hud_page_type_id__once, proton_plus_widgets_mango_hud_page_type_id);
	}
	return proton_plus_widgets_mango_hud_page_type_id__once;
}

static void
_vala_proton_plus_widgets_mango_hud_page_get_property (GObject * object,
                                                       guint property_id,
                                                       GValue * value,
                                                       GParamSpec * pspec)
{
	ProtonPlusWidgetsMangoHudPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_MANGO_HUD_TYPE_PAGE, ProtonPlusWidgetsMangoHudPage);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_MANGO_HUD_PAGE_CONFIG_PROPERTY:
		g_value_set_object (value, proton_plus_widgets_mango_hud_page_get_config (self));
		break;
		case PROTON_PLUS_WIDGETS_MANGO_HUD_PAGE_IS_UPDATING_PROPERTY:
		g_value_set_boolean (value, proton_plus_widgets_mango_hud_page_get_is_updating (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_widgets_mango_hud_page_set_property (GObject * object,
                                                       guint property_id,
                                                       const GValue * value,
                                                       GParamSpec * pspec)
{
	ProtonPlusWidgetsMangoHudPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_MANGO_HUD_TYPE_PAGE, ProtonPlusWidgetsMangoHudPage);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_MANGO_HUD_PAGE_CONFIG_PROPERTY:
		proton_plus_widgets_mango_hud_page_set_config (self, g_value_get_object (value));
		break;
		case PROTON_PLUS_WIDGETS_MANGO_HUD_PAGE_IS_UPDATING_PROPERTY:
		proton_plus_widgets_mango_hud_page_set_is_updating (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

