/* updates.c generated by valac 0.56.19, the Vala compiler
 * generated from updates.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 "protonplus_core.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

#define PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_BASE (proton_plus_widgets_introduction_base_get_type ())
#define PROTON_PLUS_WIDGETS_INTRODUCTION_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_BASE, ProtonPlusWidgetsIntroductionBase))
#define PROTON_PLUS_WIDGETS_INTRODUCTION_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_BASE, ProtonPlusWidgetsIntroductionBaseClass))
#define PROTON_PLUS_WIDGETS_INTRODUCTION_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_BASE))
#define PROTON_PLUS_WIDGETS_INTRODUCTION_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_BASE))
#define PROTON_PLUS_WIDGETS_INTRODUCTION_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_BASE, ProtonPlusWidgetsIntroductionBaseClass))

typedef struct _ProtonPlusWidgetsIntroductionBase ProtonPlusWidgetsIntroductionBase;
typedef struct _ProtonPlusWidgetsIntroductionBaseClass ProtonPlusWidgetsIntroductionBaseClass;
typedef struct _ProtonPlusWidgetsIntroductionBasePrivate ProtonPlusWidgetsIntroductionBasePrivate;

#define PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_UPDATES (proton_plus_widgets_introduction_updates_get_type ())
#define PROTON_PLUS_WIDGETS_INTRODUCTION_UPDATES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_UPDATES, ProtonPlusWidgetsIntroductionUpdates))
#define PROTON_PLUS_WIDGETS_INTRODUCTION_UPDATES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_UPDATES, ProtonPlusWidgetsIntroductionUpdatesClass))
#define PROTON_PLUS_WIDGETS_INTRODUCTION_IS_UPDATES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_UPDATES))
#define PROTON_PLUS_WIDGETS_INTRODUCTION_IS_UPDATES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_UPDATES))
#define PROTON_PLUS_WIDGETS_INTRODUCTION_UPDATES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_UPDATES, ProtonPlusWidgetsIntroductionUpdatesClass))

typedef struct _ProtonPlusWidgetsIntroductionUpdates ProtonPlusWidgetsIntroductionUpdates;
typedef struct _ProtonPlusWidgetsIntroductionUpdatesClass ProtonPlusWidgetsIntroductionUpdatesClass;
typedef struct _ProtonPlusWidgetsIntroductionUpdatesPrivate ProtonPlusWidgetsIntroductionUpdatesPrivate;
enum  {
	PROTON_PLUS_WIDGETS_INTRODUCTION_UPDATES_0_PROPERTY,
	PROTON_PLUS_WIDGETS_INTRODUCTION_UPDATES_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_introduction_updates_properties[PROTON_PLUS_WIDGETS_INTRODUCTION_UPDATES_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _ProtonPlusWidgetsIntroductionBase {
	GtkBox parent_instance;
	ProtonPlusWidgetsIntroductionBasePrivate * priv;
};

struct _ProtonPlusWidgetsIntroductionBaseClass {
	GtkBoxClass parent_class;
};

struct _ProtonPlusWidgetsIntroductionUpdates {
	ProtonPlusWidgetsIntroductionBase parent_instance;
	ProtonPlusWidgetsIntroductionUpdatesPrivate * priv;
};

struct _ProtonPlusWidgetsIntroductionUpdatesClass {
	ProtonPlusWidgetsIntroductionBaseClass parent_class;
};

static gpointer proton_plus_widgets_introduction_updates_parent_class = NULL;

VALA_EXTERN GType proton_plus_widgets_introduction_base_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType proton_plus_widgets_introduction_updates_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ProtonPlusWidgetsIntroductionUpdates* proton_plus_widgets_introduction_updates_new (void);
VALA_EXTERN ProtonPlusWidgetsIntroductionUpdates* proton_plus_widgets_introduction_updates_construct (GType object_type);
VALA_EXTERN ProtonPlusWidgetsIntroductionBase* proton_plus_widgets_introduction_base_new (const gchar* title_text,
                                                                              const gchar* description_text,
                                                                              const gchar* image_source);
VALA_EXTERN ProtonPlusWidgetsIntroductionBase* proton_plus_widgets_introduction_base_construct (GType object_type,
                                                                                    const gchar* title_text,
                                                                                    const gchar* description_text,
                                                                                    const gchar* image_source);
static GType proton_plus_widgets_introduction_updates_get_type_once (void);

ProtonPlusWidgetsIntroductionUpdates*
proton_plus_widgets_introduction_updates_construct (GType object_type)
{
	ProtonPlusWidgetsIntroductionUpdates * self = NULL;
	AdwPreferencesGroup* updates_group = NULL;
	AdwPreferencesGroup* _tmp0_;
	AdwSwitchRow* background_updates_row = NULL;
	gchar* _tmp1_;
	gchar* _tmp2_;
	AdwSwitchRow* _tmp3_ = NULL;
	GSettings* _tmp4_;
	ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRow* background_updates_frequency_row = NULL;
	gchar* _tmp5_;
	ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRow* _tmp6_ = NULL;
	AdwSwitchRow* check_updates_on_boot_row = NULL;
	gchar* _tmp7_;
	gchar* _tmp8_;
	AdwSwitchRow* _tmp9_ = NULL;
	GSettings* _tmp10_;
	AdwSwitchRow* check_updates_on_launch_row = NULL;
	gchar* _tmp11_;
	gchar* _tmp12_;
	AdwSwitchRow* _tmp13_ = NULL;
	GSettings* _tmp14_;
	self = (ProtonPlusWidgetsIntroductionUpdates*) proton_plus_widgets_introduction_base_construct (object_type, _ ("Keep Everything Updated"), _ ("ProtonPlus can automatically check for and install updates to keep you" \
"r gaming experience smooth."), "arrows-rotate-symbolic");
	_tmp0_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	g_object_ref_sink (_tmp0_);
	updates_group = _tmp0_;
	gtk_widget_set_margin_top ((GtkWidget*) updates_group, 12);
	_tmp1_ = g_strdup (_ ("Background updates"));
	_tmp2_ = g_strdup (_ ("Automatically update the tools in the background"));
	_tmp3_ = (AdwSwitchRow*) adw_switch_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp3_, _tmp1_);
	_g_free0 (_tmp1_);
	adw_action_row_set_subtitle ((AdwActionRow*) _tmp3_, _tmp2_);
	_g_free0 (_tmp2_);
	g_object_ref_sink (_tmp3_);
	background_updates_row = _tmp3_;
	_tmp4_ = proton_plus_globals_SETTINGS;
	g_settings_bind (_tmp4_, "background-updates", (GObject*) background_updates_row, "active", G_SETTINGS_BIND_DEFAULT);
	adw_preferences_group_add (updates_group, (GtkWidget*) background_updates_row);
	_tmp5_ = g_strdup (_ ("Set how often to check for updates in the background"));
	_tmp6_ = proton_plus_widgets_preferences_background_updates_frequency_row_new ();
	adw_action_row_set_subtitle ((AdwActionRow*) _tmp6_, _tmp5_);
	_g_free0 (_tmp5_);
	g_object_ref_sink (_tmp6_);
	background_updates_frequency_row = _tmp6_;
	g_object_bind_property_with_closures ((GObject*) background_updates_row, "active", (GObject*) background_updates_frequency_row, "sensitive", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	adw_preferences_group_add (updates_group, (GtkWidget*) background_updates_frequency_row);
	_tmp7_ = g_strdup (_ ("Update tools at system startup"));
	_tmp8_ = g_strdup (_ ("Automatically check for and install updates when the system starts"));
	_tmp9_ = (AdwSwitchRow*) adw_switch_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp9_, _tmp7_);
	_g_free0 (_tmp7_);
	adw_action_row_set_subtitle ((AdwActionRow*) _tmp9_, _tmp8_);
	_g_free0 (_tmp8_);
	g_object_ref_sink (_tmp9_);
	check_updates_on_boot_row = _tmp9_;
	_tmp10_ = proton_plus_globals_SETTINGS;
	g_settings_bind (_tmp10_, "check-updates-on-boot", (GObject*) check_updates_on_boot_row, "active", G_SETTINGS_BIND_DEFAULT);
	adw_preferences_group_add (updates_group, (GtkWidget*) check_updates_on_boot_row);
	_tmp11_ = g_strdup (_ ("Update tools when ProtonPlus starts"));
	_tmp12_ = g_strdup (_ ("Automatically check for and install updates when ProtonPlus starts"));
	_tmp13_ = (AdwSwitchRow*) adw_switch_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp13_, _tmp11_);
	_g_free0 (_tmp11_);
	adw_action_row_set_subtitle ((AdwActionRow*) _tmp13_, _tmp12_);
	_g_free0 (_tmp12_);
	g_object_ref_sink (_tmp13_);
	check_updates_on_launch_row = _tmp13_;
	_tmp14_ = proton_plus_globals_SETTINGS;
	g_settings_bind (_tmp14_, "check-updates-on-launch", (GObject*) check_updates_on_launch_row, "active", G_SETTINGS_BIND_DEFAULT);
	adw_preferences_group_add (updates_group, (GtkWidget*) check_updates_on_launch_row);
	gtk_box_append ((GtkBox*) self, (GtkWidget*) updates_group);
	_g_object_unref0 (check_updates_on_launch_row);
	_g_object_unref0 (check_updates_on_boot_row);
	_g_object_unref0 (background_updates_frequency_row);
	_g_object_unref0 (background_updates_row);
	_g_object_unref0 (updates_group);
	return self;
}

ProtonPlusWidgetsIntroductionUpdates*
proton_plus_widgets_introduction_updates_new (void)
{
	return proton_plus_widgets_introduction_updates_construct (PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_UPDATES);
}

static void
proton_plus_widgets_introduction_updates_class_init (ProtonPlusWidgetsIntroductionUpdatesClass * klass,
                                                     gpointer klass_data)
{
	proton_plus_widgets_introduction_updates_parent_class = g_type_class_peek_parent (klass);
}

static void
proton_plus_widgets_introduction_updates_instance_init (ProtonPlusWidgetsIntroductionUpdates * self,
                                                        gpointer klass)
{
}

static GType
proton_plus_widgets_introduction_updates_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsIntroductionUpdatesClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_introduction_updates_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsIntroductionUpdates), 0, (GInstanceInitFunc) proton_plus_widgets_introduction_updates_instance_init, NULL };
	GType proton_plus_widgets_introduction_updates_type_id;
	proton_plus_widgets_introduction_updates_type_id = g_type_register_static (PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_BASE, "ProtonPlusWidgetsIntroductionUpdates", &g_define_type_info, 0);
	return proton_plus_widgets_introduction_updates_type_id;
}

GType
proton_plus_widgets_introduction_updates_get_type (void)
{
	static volatile gsize proton_plus_widgets_introduction_updates_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_introduction_updates_type_id__once)) {
		GType proton_plus_widgets_introduction_updates_type_id;
		proton_plus_widgets_introduction_updates_type_id = proton_plus_widgets_introduction_updates_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_introduction_updates_type_id__once, proton_plus_widgets_introduction_updates_type_id);
	}
	return proton_plus_widgets_introduction_updates_type_id__once;
}

