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

/*
 * SPDX-License-Identifier: GPL-3.0-or-later
 * SPDX-FileCopyrightText: 2022 elementary, Inc. (https://elementary.io)
 */

#include <adwaita.h>
#include <glib-object.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
#include <granite-7.h>
#include <stdlib.h>
#include <string.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 ONBOARDING_TYPE_ABSTRACT_ONBOARDING_VIEW (onboarding_abstract_onboarding_view_get_type ())
#define ONBOARDING_ABSTRACT_ONBOARDING_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ONBOARDING_TYPE_ABSTRACT_ONBOARDING_VIEW, OnboardingAbstractOnboardingView))
#define ONBOARDING_ABSTRACT_ONBOARDING_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ONBOARDING_TYPE_ABSTRACT_ONBOARDING_VIEW, OnboardingAbstractOnboardingViewClass))
#define ONBOARDING_IS_ABSTRACT_ONBOARDING_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ONBOARDING_TYPE_ABSTRACT_ONBOARDING_VIEW))
#define ONBOARDING_IS_ABSTRACT_ONBOARDING_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ONBOARDING_TYPE_ABSTRACT_ONBOARDING_VIEW))
#define ONBOARDING_ABSTRACT_ONBOARDING_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ONBOARDING_TYPE_ABSTRACT_ONBOARDING_VIEW, OnboardingAbstractOnboardingViewClass))

typedef struct _OnboardingAbstractOnboardingView OnboardingAbstractOnboardingView;
typedef struct _OnboardingAbstractOnboardingViewClass OnboardingAbstractOnboardingViewClass;
typedef struct _OnboardingAbstractOnboardingViewPrivate OnboardingAbstractOnboardingViewPrivate;

#define ONBOARDING_TYPE_UPDATES_VIEW (onboarding_updates_view_get_type ())
#define ONBOARDING_UPDATES_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ONBOARDING_TYPE_UPDATES_VIEW, OnboardingUpdatesView))
#define ONBOARDING_UPDATES_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ONBOARDING_TYPE_UPDATES_VIEW, OnboardingUpdatesViewClass))
#define ONBOARDING_IS_UPDATES_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ONBOARDING_TYPE_UPDATES_VIEW))
#define ONBOARDING_IS_UPDATES_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ONBOARDING_TYPE_UPDATES_VIEW))
#define ONBOARDING_UPDATES_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ONBOARDING_TYPE_UPDATES_VIEW, OnboardingUpdatesViewClass))

typedef struct _OnboardingUpdatesView OnboardingUpdatesView;
typedef struct _OnboardingUpdatesViewClass OnboardingUpdatesViewClass;
typedef struct _OnboardingUpdatesViewPrivate OnboardingUpdatesViewPrivate;
enum  {
	ONBOARDING_UPDATES_VIEW_0_PROPERTY,
	ONBOARDING_UPDATES_VIEW_NUM_PROPERTIES
};
static GParamSpec* onboarding_updates_view_properties[ONBOARDING_UPDATES_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))

struct _OnboardingAbstractOnboardingView {
	AdwNavigationPage parent_instance;
	OnboardingAbstractOnboardingViewPrivate * priv;
};

struct _OnboardingAbstractOnboardingViewClass {
	AdwNavigationPageClass parent_class;
};

struct _OnboardingUpdatesView {
	OnboardingAbstractOnboardingView parent_instance;
	OnboardingUpdatesViewPrivate * priv;
};

struct _OnboardingUpdatesViewClass {
	OnboardingAbstractOnboardingViewClass parent_class;
};

static gpointer onboarding_updates_view_parent_class = NULL;

VALA_EXTERN GType onboarding_abstract_onboarding_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OnboardingAbstractOnboardingView, g_object_unref)
VALA_EXTERN GType onboarding_updates_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OnboardingUpdatesView, g_object_unref)
VALA_EXTERN OnboardingUpdatesView* onboarding_updates_view_new (void);
VALA_EXTERN OnboardingUpdatesView* onboarding_updates_view_construct (GType object_type);
static GObject * onboarding_updates_view_constructor (GType type,
                                               guint n_construct_properties,
                                               GObjectConstructParam * construct_properties);
VALA_EXTERN GraniteBox* onboarding_abstract_onboarding_view_get_custom_bin (OnboardingAbstractOnboardingView* self);
static GType onboarding_updates_view_get_type_once (void);

OnboardingUpdatesView*
onboarding_updates_view_construct (GType object_type)
{
	OnboardingUpdatesView * self = NULL;
	self = (OnboardingUpdatesView*) g_object_new (object_type, "view-name", "updates", "description", _ ("Updates can be automatically installed when your device is connected t" \
"o the Internet."), "icon-name", "system-software-update", "title", _ ("Automatic Updates"), NULL);
	return self;
}

OnboardingUpdatesView*
onboarding_updates_view_new (void)
{
	return onboarding_updates_view_construct (ONBOARDING_TYPE_UPDATES_VIEW);
}

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

static GObject *
onboarding_updates_view_constructor (GType type,
                                     guint n_construct_properties,
                                     GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	OnboardingUpdatesView * self;
	GtkCheckButton* appcenter_check = NULL;
	GtkCheckButton* _tmp0_;
	GraniteHeaderLabel* appcenter_label = NULL;
	GtkCheckButton* _tmp1_;
	GtkWidget* _tmp2_;
	gchar* _tmp3_;
	GraniteHeaderLabel* _tmp4_ = NULL;
	GtkBox* appcenter_box = NULL;
	GtkBox* _tmp5_;
	GtkBox* _tmp6_;
	GtkImage* _tmp7_ = NULL;
	GtkImage* _tmp8_;
	GtkBox* _tmp9_;
	GraniteHeaderLabel* _tmp10_;
	GtkBox* _tmp11_;
	GtkCheckButton* _tmp12_;
	GtkCheckButton* system_check = NULL;
	GtkCheckButton* _tmp13_;
	GraniteHeaderLabel* system_label = NULL;
	GtkCheckButton* _tmp14_;
	GtkWidget* _tmp15_;
	gchar* _tmp16_;
	GraniteHeaderLabel* _tmp17_ = NULL;
	GtkBox* system_box = NULL;
	GtkBox* _tmp18_;
	GtkBox* _tmp19_;
	GtkImage* _tmp20_ = NULL;
	GtkImage* _tmp21_;
	GtkBox* _tmp22_;
	GraniteHeaderLabel* _tmp23_;
	GtkBox* _tmp24_;
	GtkCheckButton* _tmp25_;
	GraniteBox* _tmp26_;
	GraniteBox* _tmp27_;
	GtkCheckButton* _tmp28_;
	GraniteBox* _tmp29_;
	GraniteBox* _tmp30_;
	GtkCheckButton* _tmp31_;
	GSettings* appcenter_settings = NULL;
	GSettings* _tmp32_;
	GSettings* _tmp33_;
	GtkCheckButton* _tmp34_;
	GSettings* system_settings = NULL;
	GSettings* _tmp35_;
	GSettings* _tmp36_;
	GtkCheckButton* _tmp37_;
	parent_class = G_OBJECT_CLASS (onboarding_updates_view_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ONBOARDING_TYPE_UPDATES_VIEW, OnboardingUpdatesView);
	_tmp0_ = (GtkCheckButton*) gtk_check_button_new ();
	g_object_ref_sink (_tmp0_);
	appcenter_check = _tmp0_;
	_tmp1_ = appcenter_check;
	_tmp2_ = _g_object_ref0 ((GtkWidget*) _tmp1_);
	_tmp3_ = g_strdup (_ ("Apps being tried for free will not update automatically"));
	_tmp4_ = granite_header_label_new (_ ("Free & Purchased Apps"));
	granite_header_label_set_mnemonic_widget (_tmp4_, _tmp2_);
	_g_object_unref0 (_tmp2_);
	granite_header_label_set_secondary_text (_tmp4_, _tmp3_);
	_g_free0 (_tmp3_);
	g_object_ref_sink (_tmp4_);
	appcenter_label = _tmp4_;
	_tmp5_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp5_);
	appcenter_box = _tmp5_;
	_tmp6_ = appcenter_box;
	_tmp7_ = (GtkImage*) gtk_image_new_from_icon_name ("io.elementary.appcenter");
	gtk_image_set_icon_size (_tmp7_, GTK_ICON_SIZE_LARGE);
	g_object_ref_sink (_tmp7_);
	_tmp8_ = _tmp7_;
	gtk_box_append (_tmp6_, (GtkWidget*) _tmp8_);
	_g_object_unref0 (_tmp8_);
	_tmp9_ = appcenter_box;
	_tmp10_ = appcenter_label;
	gtk_box_append (_tmp9_, (GtkWidget*) _tmp10_);
	_tmp11_ = appcenter_box;
	_tmp12_ = appcenter_check;
	gtk_widget_set_parent ((GtkWidget*) _tmp11_, (GtkWidget*) _tmp12_);
	_tmp13_ = (GtkCheckButton*) gtk_check_button_new ();
	g_object_ref_sink (_tmp13_);
	system_check = _tmp13_;
	_tmp14_ = system_check;
	_tmp15_ = _g_object_ref0 ((GtkWidget*) _tmp14_);
	_tmp16_ = g_strdup (_ ("Will be installed when you choose to restart this device"));
	_tmp17_ = granite_header_label_new (_ ("Operating System"));
	granite_header_label_set_mnemonic_widget (_tmp17_, _tmp15_);
	_g_object_unref0 (_tmp15_);
	granite_header_label_set_secondary_text (_tmp17_, _tmp16_);
	_g_free0 (_tmp16_);
	g_object_ref_sink (_tmp17_);
	system_label = _tmp17_;
	_tmp18_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp18_);
	system_box = _tmp18_;
	_tmp19_ = system_box;
	_tmp20_ = (GtkImage*) gtk_image_new_from_icon_name ("io.elementary.settings");
	gtk_image_set_icon_size (_tmp20_, GTK_ICON_SIZE_LARGE);
	g_object_ref_sink (_tmp20_);
	_tmp21_ = _tmp20_;
	gtk_box_append (_tmp19_, (GtkWidget*) _tmp21_);
	_g_object_unref0 (_tmp21_);
	_tmp22_ = system_box;
	_tmp23_ = system_label;
	gtk_box_append (_tmp22_, (GtkWidget*) _tmp23_);
	_tmp24_ = system_box;
	_tmp25_ = system_check;
	gtk_widget_set_parent ((GtkWidget*) _tmp24_, (GtkWidget*) _tmp25_);
	_tmp26_ = onboarding_abstract_onboarding_view_get_custom_bin ((OnboardingAbstractOnboardingView*) self);
	_tmp27_ = _tmp26_;
	_tmp28_ = appcenter_check;
	gtk_box_append ((GtkBox*) _tmp27_, (GtkWidget*) _tmp28_);
	_tmp29_ = onboarding_abstract_onboarding_view_get_custom_bin ((OnboardingAbstractOnboardingView*) self);
	_tmp30_ = _tmp29_;
	_tmp31_ = system_check;
	gtk_box_append ((GtkBox*) _tmp30_, (GtkWidget*) _tmp31_);
	_tmp32_ = g_settings_new ("io.elementary.appcenter.settings");
	appcenter_settings = _tmp32_;
	_tmp33_ = appcenter_settings;
	_tmp34_ = appcenter_check;
	g_settings_bind (_tmp33_, "automatic-updates", (GObject*) _tmp34_, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp35_ = g_settings_new ("io.elementary.settings-daemon.system-update");
	system_settings = _tmp35_;
	_tmp36_ = system_settings;
	_tmp37_ = system_check;
	g_settings_bind (_tmp36_, "automatic-updates", (GObject*) _tmp37_, "active", G_SETTINGS_BIND_DEFAULT);
	_g_object_unref0 (system_settings);
	_g_object_unref0 (appcenter_settings);
	_g_object_unref0 (system_box);
	_g_object_unref0 (system_label);
	_g_object_unref0 (system_check);
	_g_object_unref0 (appcenter_box);
	_g_object_unref0 (appcenter_label);
	_g_object_unref0 (appcenter_check);
	return obj;
}

static void
onboarding_updates_view_class_init (OnboardingUpdatesViewClass * klass,
                                    gpointer klass_data)
{
	onboarding_updates_view_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->constructor = onboarding_updates_view_constructor;
}

static void
onboarding_updates_view_instance_init (OnboardingUpdatesView * self,
                                       gpointer klass)
{
}

 G_GNUC_NO_INLINE static GType
onboarding_updates_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (OnboardingUpdatesViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) onboarding_updates_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (OnboardingUpdatesView), 0, (GInstanceInitFunc) onboarding_updates_view_instance_init, NULL };
	GType onboarding_updates_view_type_id;
	onboarding_updates_view_type_id = g_type_register_static (ONBOARDING_TYPE_ABSTRACT_ONBOARDING_VIEW, "OnboardingUpdatesView", &g_define_type_info, 0);
	return onboarding_updates_view_type_id;
}

GType
onboarding_updates_view_get_type (void)
{
	static volatile gsize onboarding_updates_view_type_id__once = 0;
	if (g_once_init_enter (&onboarding_updates_view_type_id__once)) {
		GType onboarding_updates_view_type_id;
		onboarding_updates_view_type_id = onboarding_updates_view_get_type_once ();
		g_once_init_leave (&onboarding_updates_view_type_id__once, onboarding_updates_view_type_id);
	}
	return onboarding_updates_view_type_id__once;
}

