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

/*-
 * Copyright (c) 2019 elementary, Inc. (https://elementary.io)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <adwaita.h>
#include <glib-object.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#include <granite-7.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_NIGHT_LIGHT_VIEW (onboarding_night_light_view_get_type ())
#define ONBOARDING_NIGHT_LIGHT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ONBOARDING_TYPE_NIGHT_LIGHT_VIEW, OnboardingNightLightView))
#define ONBOARDING_NIGHT_LIGHT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ONBOARDING_TYPE_NIGHT_LIGHT_VIEW, OnboardingNightLightViewClass))
#define ONBOARDING_IS_NIGHT_LIGHT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ONBOARDING_TYPE_NIGHT_LIGHT_VIEW))
#define ONBOARDING_IS_NIGHT_LIGHT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ONBOARDING_TYPE_NIGHT_LIGHT_VIEW))
#define ONBOARDING_NIGHT_LIGHT_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ONBOARDING_TYPE_NIGHT_LIGHT_VIEW, OnboardingNightLightViewClass))

typedef struct _OnboardingNightLightView OnboardingNightLightView;
typedef struct _OnboardingNightLightViewClass OnboardingNightLightViewClass;
typedef struct _OnboardingNightLightViewPrivate OnboardingNightLightViewPrivate;
enum  {
	ONBOARDING_NIGHT_LIGHT_VIEW_0_PROPERTY,
	ONBOARDING_NIGHT_LIGHT_VIEW_NUM_PROPERTIES
};
static GParamSpec* onboarding_night_light_view_properties[ONBOARDING_NIGHT_LIGHT_VIEW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

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

struct _OnboardingAbstractOnboardingViewClass {
	AdwNavigationPageClass parent_class;
};

struct _OnboardingNightLightView {
	OnboardingAbstractOnboardingView parent_instance;
	OnboardingNightLightViewPrivate * priv;
};

struct _OnboardingNightLightViewClass {
	OnboardingAbstractOnboardingViewClass parent_class;
};

static gpointer onboarding_night_light_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_night_light_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OnboardingNightLightView, g_object_unref)
VALA_EXTERN OnboardingNightLightView* onboarding_night_light_view_new (void);
VALA_EXTERN OnboardingNightLightView* onboarding_night_light_view_construct (GType object_type);
static GObject * onboarding_night_light_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_night_light_view_get_type_once (void);

OnboardingNightLightView*
onboarding_night_light_view_construct (GType object_type)
{
	OnboardingNightLightView * self = NULL;
	self = (OnboardingNightLightView*) g_object_new (object_type, "view-name", "night-light", "description", _ ("Make the colors of your display warmer at night to help prevent eye st" \
"rain and sleeplessness."), "icon-name", "night-light", "title", _ ("Night Light"), NULL);
	return self;
}

OnboardingNightLightView*
onboarding_night_light_view_new (void)
{
	return onboarding_night_light_view_construct (ONBOARDING_TYPE_NIGHT_LIGHT_VIEW);
}

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

static GObject *
onboarding_night_light_view_constructor (GType type,
                                         guint n_construct_properties,
                                         GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	OnboardingNightLightView * self;
	GtkSwitch* service_switch = NULL;
	GtkSwitch* _tmp0_ = NULL;
	GtkLabel* switch_label = NULL;
	GtkSwitch* _tmp1_;
	GtkWidget* _tmp2_;
	GtkLabel* _tmp3_ = NULL;
	GtkLinkButton* settings_link = NULL;
	GtkLinkButton* _tmp4_;
	GSettings* settings = NULL;
	GSettings* _tmp5_;
	GSettings* _tmp6_;
	GtkSwitch* _tmp7_;
	GraniteBox* box = NULL;
	GraniteBox* _tmp8_;
	GraniteBox* _tmp9_;
	GtkLabel* _tmp10_;
	GraniteBox* _tmp11_;
	GtkSwitch* _tmp12_;
	GraniteBox* _tmp13_;
	GraniteBox* _tmp14_;
	GraniteBox* _tmp15_;
	GraniteBox* _tmp16_;
	GraniteBox* _tmp17_;
	GtkLinkButton* _tmp18_;
	parent_class = G_OBJECT_CLASS (onboarding_night_light_view_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ONBOARDING_TYPE_NIGHT_LIGHT_VIEW, OnboardingNightLightView);
	_tmp0_ = (GtkSwitch*) gtk_switch_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp0_, GTK_ALIGN_START);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp0_, TRUE);
	g_object_ref_sink (_tmp0_);
	service_switch = _tmp0_;
	_tmp1_ = service_switch;
	_tmp2_ = _g_object_ref0 ((GtkWidget*) _tmp1_);
	_tmp3_ = (GtkLabel*) gtk_label_new (_ ("Night Light:"));
	gtk_widget_set_halign ((GtkWidget*) _tmp3_, GTK_ALIGN_END);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp3_, TRUE);
	gtk_label_set_mnemonic_widget (_tmp3_, _tmp2_);
	_g_object_unref0 (_tmp2_);
	g_object_ref_sink (_tmp3_);
	switch_label = _tmp3_;
	_tmp4_ = (GtkLinkButton*) gtk_link_button_new_with_label ("settings://display/night-light", _ ("Adjust schedule and temperature…"));
	g_object_ref_sink (_tmp4_);
	settings_link = _tmp4_;
	_tmp5_ = g_settings_new ("org.gnome.settings-daemon.plugins.color");
	settings = _tmp5_;
	_tmp6_ = settings;
	_tmp7_ = service_switch;
	g_settings_bind (_tmp6_, "night-light-enabled", (GObject*) _tmp7_, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp8_ = granite_box_new (GTK_ORIENTATION_HORIZONTAL, GRANITE_BOX_SPACING_SINGLE);
	g_object_ref_sink (_tmp8_);
	box = _tmp8_;
	_tmp9_ = box;
	_tmp10_ = switch_label;
	gtk_box_append ((GtkBox*) _tmp9_, (GtkWidget*) _tmp10_);
	_tmp11_ = box;
	_tmp12_ = service_switch;
	gtk_box_append ((GtkBox*) _tmp11_, (GtkWidget*) _tmp12_);
	_tmp13_ = onboarding_abstract_onboarding_view_get_custom_bin ((OnboardingAbstractOnboardingView*) self);
	_tmp14_ = _tmp13_;
	_tmp15_ = box;
	gtk_box_append ((GtkBox*) _tmp14_, (GtkWidget*) _tmp15_);
	_tmp16_ = onboarding_abstract_onboarding_view_get_custom_bin ((OnboardingAbstractOnboardingView*) self);
	_tmp17_ = _tmp16_;
	_tmp18_ = settings_link;
	gtk_box_append ((GtkBox*) _tmp17_, (GtkWidget*) _tmp18_);
	_g_object_unref0 (box);
	_g_object_unref0 (settings);
	_g_object_unref0 (settings_link);
	_g_object_unref0 (switch_label);
	_g_object_unref0 (service_switch);
	return obj;
}

static void
onboarding_night_light_view_class_init (OnboardingNightLightViewClass * klass,
                                        gpointer klass_data)
{
	onboarding_night_light_view_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->constructor = onboarding_night_light_view_constructor;
}

static void
onboarding_night_light_view_instance_init (OnboardingNightLightView * self,
                                           gpointer klass)
{
}

 G_GNUC_NO_INLINE static GType
onboarding_night_light_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (OnboardingNightLightViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) onboarding_night_light_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (OnboardingNightLightView), 0, (GInstanceInitFunc) onboarding_night_light_view_instance_init, NULL };
	GType onboarding_night_light_view_type_id;
	onboarding_night_light_view_type_id = g_type_register_static (ONBOARDING_TYPE_ABSTRACT_ONBOARDING_VIEW, "OnboardingNightLightView", &g_define_type_info, 0);
	return onboarding_night_light_view_type_id;
}

GType
onboarding_night_light_view_get_type (void)
{
	static volatile gsize onboarding_night_light_view_type_id__once = 0;
	if (g_once_init_enter (&onboarding_night_light_view_type_id__once)) {
		GType onboarding_night_light_view_type_id;
		onboarding_night_light_view_type_id = onboarding_night_light_view_get_type_once ();
		g_once_init_leave (&onboarding_night_light_view_type_id__once, onboarding_night_light_view_type_id);
	}
	return onboarding_night_light_view_type_id__once;
}

