/* UserInterface.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from UserInterface.vala, do not modify */

/* UserInterface.vala
 *
 * Copyright (C) 2009-2025 Jerry Casiano
 *
 * 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/gpl-3.0.txt>.
*/

#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#include "vala-common.h"
#include "font-manager.h"
#include <glib/gi18n-lib.h>
#include <float.h>
#include <math.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

typedef enum  {
	FONT_MANAGER_BUTTON_STYLE_NORMAL,
	FONT_MANAGER_BUTTON_STYLE_FLAT
} FontManagerButtonStyle;

#define FONT_MANAGER_TYPE_BUTTON_STYLE (font_manager_button_style_get_type ())

#define FONT_MANAGER_TYPE_PREFERENCE_LIST (font_manager_preference_list_get_type ())
#define FONT_MANAGER_PREFERENCE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_PREFERENCE_LIST, FontManagerPreferenceList))
#define FONT_MANAGER_PREFERENCE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_PREFERENCE_LIST, FontManagerPreferenceListClass))
#define FONT_MANAGER_IS_PREFERENCE_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_PREFERENCE_LIST))
#define FONT_MANAGER_IS_PREFERENCE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_PREFERENCE_LIST))
#define FONT_MANAGER_PREFERENCE_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_PREFERENCE_LIST, FontManagerPreferenceListClass))

typedef struct _FontManagerPreferenceList FontManagerPreferenceList;
typedef struct _FontManagerPreferenceListClass FontManagerPreferenceListClass;
typedef struct _FontManagerPreferenceListPrivate FontManagerPreferenceListPrivate;

#define FONT_MANAGER_TYPE_BASE_CONTROLS (font_manager_base_controls_get_type ())
#define FONT_MANAGER_BASE_CONTROLS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_BASE_CONTROLS, FontManagerBaseControls))
#define FONT_MANAGER_BASE_CONTROLS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_BASE_CONTROLS, FontManagerBaseControlsClass))
#define FONT_MANAGER_IS_BASE_CONTROLS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_BASE_CONTROLS))
#define FONT_MANAGER_IS_BASE_CONTROLS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_BASE_CONTROLS))
#define FONT_MANAGER_BASE_CONTROLS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_BASE_CONTROLS, FontManagerBaseControlsClass))

typedef struct _FontManagerBaseControls FontManagerBaseControls;
typedef struct _FontManagerBaseControlsClass FontManagerBaseControlsClass;

#define FONT_MANAGER_TYPE_USER_INTERFACE_PREFERENCES (font_manager_user_interface_preferences_get_type ())
#define FONT_MANAGER_USER_INTERFACE_PREFERENCES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_USER_INTERFACE_PREFERENCES, FontManagerUserInterfacePreferences))
#define FONT_MANAGER_USER_INTERFACE_PREFERENCES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_USER_INTERFACE_PREFERENCES, FontManagerUserInterfacePreferencesClass))
#define FONT_MANAGER_IS_USER_INTERFACE_PREFERENCES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_USER_INTERFACE_PREFERENCES))
#define FONT_MANAGER_IS_USER_INTERFACE_PREFERENCES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_USER_INTERFACE_PREFERENCES))
#define FONT_MANAGER_USER_INTERFACE_PREFERENCES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_USER_INTERFACE_PREFERENCES, FontManagerUserInterfacePreferencesClass))

typedef struct _FontManagerUserInterfacePreferences FontManagerUserInterfacePreferences;
typedef struct _FontManagerUserInterfacePreferencesClass FontManagerUserInterfacePreferencesClass;
typedef struct _FontManagerUserInterfacePreferencesPrivate FontManagerUserInterfacePreferencesPrivate;
enum  {
	FONT_MANAGER_USER_INTERFACE_PREFERENCES_0_PROPERTY,
	FONT_MANAGER_USER_INTERFACE_PREFERENCES_SETTINGS_PROPERTY,
	FONT_MANAGER_USER_INTERFACE_PREFERENCES_WATERFALL_SETTINGS_PROPERTY,
	FONT_MANAGER_USER_INTERFACE_PREFERENCES_NUM_PROPERTIES
};
static GParamSpec* font_manager_user_interface_preferences_properties[FONT_MANAGER_USER_INTERFACE_PREFERENCES_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block30Data Block30Data;

struct _FontManagerPreferenceList {
	GtkBox parent_instance;
	FontManagerPreferenceListPrivate * priv;
	GtkListBox* list;
	FontManagerBaseControls* controls;
	GtkSeparator* separator;
};

struct _FontManagerPreferenceListClass {
	GtkBoxClass parent_class;
	void (*on_add_selected) (FontManagerPreferenceList* self);
	void (*on_list_row_selected) (FontManagerPreferenceList* self, GtkListBox* box, GtkListBoxRow* row);
	void (*on_map) (FontManagerPreferenceList* self);
	void (*on_remove_selected) (FontManagerPreferenceList* self);
	void (*on_unmap) (FontManagerPreferenceList* self);
};

struct _FontManagerUserInterfacePreferences {
	FontManagerPreferenceList parent_instance;
	FontManagerUserInterfacePreferencesPrivate * priv;
};

struct _FontManagerUserInterfacePreferencesClass {
	FontManagerPreferenceListClass parent_class;
};

struct _FontManagerUserInterfacePreferencesPrivate {
	GSettings* _settings;
	FontManagerWaterfallSettings* _waterfall_settings;
	gboolean initialized;
	GtkSwitch* wide_layout;
	GtkSwitch* enable_animations;
	GtkSwitch* prefer_dark_theme;
	GtkSwitch* show_line_size;
	GtkCheckButton* on_maximize;
	GtkDropDown* button_style;
};

struct _Block30Data {
	int _ref_count_;
	FontManagerUserInterfacePreferences* self;
	GtkSpinButton* spacing;
};

static gint FontManagerUserInterfacePreferences_private_offset;
static gpointer font_manager_user_interface_preferences_parent_class = NULL;

VALA_EXTERN GType font_manager_button_style_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GVariant* font_manager_button_style_to_setting (GValue* val,
                                                const GVariantType* type);
VALA_EXTERN gboolean font_manager_button_style_from_setting (GValue* val,
                                                 GVariant* variant);
VALA_EXTERN GType font_manager_preference_list_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerPreferenceList, g_object_unref)
VALA_EXTERN GType font_manager_base_controls_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerBaseControls, g_object_unref)
VALA_EXTERN GType font_manager_user_interface_preferences_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerUserInterfacePreferences, g_object_unref)
VALA_EXTERN void font_manager_preference_list_on_map (FontManagerPreferenceList* self);
VALA_EXTERN FontManagerUserInterfacePreferences* font_manager_user_interface_preferences_new (GSettings* settings);
VALA_EXTERN FontManagerUserInterfacePreferences* font_manager_user_interface_preferences_construct (GType object_type,
                                                                                        GSettings* settings);
VALA_EXTERN FontManagerPreferenceList* font_manager_preference_list_new (void);
VALA_EXTERN FontManagerPreferenceList* font_manager_preference_list_construct (GType object_type);
VALA_EXTERN void font_manager_user_interface_preferences_set_settings (FontManagerUserInterfacePreferences* self,
                                                           GSettings* value);
static void font_manager_user_interface_preferences_generate_options_list (FontManagerUserInterfacePreferences* self);
static Block30Data* block30_data_ref (Block30Data* _data30_);
static void block30_data_unref (void * _userdata_);
VALA_EXTERN GtkSwitch* font_manager_preference_list_add_preference_switch (FontManagerPreferenceList* self,
                                                               const gchar* name,
                                                               const gchar* tooltip);
VALA_EXTERN void font_manager_preference_list_append_row (FontManagerPreferenceList* self,
                                              GtkWidget* widget);
VALA_EXTERN FontManagerWaterfallSettings* font_manager_user_interface_preferences_get_waterfall_settings (FontManagerUserInterfacePreferences* self);
VALA_EXTERN GSettings* font_manager_user_interface_preferences_get_settings (FontManagerUserInterfacePreferences* self);
VALA_EXTERN void font_manager_user_interface_preferences_set_waterfall_settings (FontManagerUserInterfacePreferences* self,
                                                                     FontManagerWaterfallSettings* value);
static void __lambda149_ (Block30Data* _data30_);
static void ___lambda149__gtk_spin_button_value_changed (GtkSpinButton* _sender,
                                                  gpointer self);
static void font_manager_user_interface_preferences_bind_settings (FontManagerUserInterfacePreferences* self);
static void font_manager_user_interface_preferences_real_on_map (FontManagerPreferenceList* base);
static void font_manager_user_interface_preferences_finalize (GObject * obj);
static GType font_manager_user_interface_preferences_get_type_once (void);
static void _vala_font_manager_user_interface_preferences_get_property (GObject * object,
                                                                 guint property_id,
                                                                 GValue * value,
                                                                 GParamSpec * pspec);
static void _vala_font_manager_user_interface_preferences_set_property (GObject * object,
                                                                 guint property_id,
                                                                 const GValue * value,
                                                                 GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

GVariant*
font_manager_button_style_to_setting (GValue* val,
                                      const GVariantType* type)
{
	GVariant* result;
	g_return_val_if_fail (val != NULL, NULL);
	g_return_val_if_fail (type != NULL, NULL);
	switch ((FontManagerButtonStyle) g_value_get_uint (val)) {
		case FONT_MANAGER_BUTTON_STYLE_FLAT:
		{
			GVariant* _tmp0_;
			_tmp0_ = g_variant_new_string ("Flat");
			g_variant_ref_sink (_tmp0_);
			result = _tmp0_;
			return result;
		}
		default:
		{
			GVariant* _tmp1_;
			_tmp1_ = g_variant_new_string ("Normal");
			g_variant_ref_sink (_tmp1_);
			result = _tmp1_;
			return result;
		}
	}
}

gboolean
font_manager_button_style_from_setting (GValue* val,
                                        GVariant* variant)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GQuark _tmp3_ = 0U;
	static GQuark _tmp2_label0 = 0;
	gboolean result;
	g_return_val_if_fail (val != NULL, FALSE);
	g_return_val_if_fail (variant != NULL, FALSE);
	_tmp0_ = g_variant_get_string (variant, NULL);
	_tmp1_ = _tmp0_;
	_tmp3_ = (NULL == _tmp1_) ? 0 : g_quark_from_string (_tmp1_);
	if (_tmp3_ == ((0 != _tmp2_label0) ? _tmp2_label0 : (_tmp2_label0 = g_quark_from_static_string ("Flat")))) {
		switch (0) {
			default:
			{
				g_value_set_uint (val, (guint) FONT_MANAGER_BUTTON_STYLE_FLAT);
				break;
			}
		}
	} else {
		switch (0) {
			default:
			{
				g_value_set_uint (val, (guint) FONT_MANAGER_BUTTON_STYLE_NORMAL);
				break;
			}
		}
	}
	result = TRUE;
	return result;
}

 G_GNUC_NO_INLINE static GType
font_manager_button_style_get_type_once (void)
{
	static const GEnumValue values[] = {{FONT_MANAGER_BUTTON_STYLE_NORMAL, "FONT_MANAGER_BUTTON_STYLE_NORMAL", "normal"}, {FONT_MANAGER_BUTTON_STYLE_FLAT, "FONT_MANAGER_BUTTON_STYLE_FLAT", "flat"}, {0, NULL, NULL}};
	GType font_manager_button_style_type_id;
	font_manager_button_style_type_id = g_enum_register_static ("FontManagerButtonStyle", values);
	return font_manager_button_style_type_id;
}

GType
font_manager_button_style_get_type (void)
{
	static volatile gsize font_manager_button_style_type_id__once = 0;
	if (g_once_init_enter (&font_manager_button_style_type_id__once)) {
		GType font_manager_button_style_type_id;
		font_manager_button_style_type_id = font_manager_button_style_get_type_once ();
		g_once_init_leave (&font_manager_button_style_type_id__once, font_manager_button_style_type_id);
	}
	return font_manager_button_style_type_id__once;
}

static inline gpointer
font_manager_user_interface_preferences_get_instance_private (FontManagerUserInterfacePreferences* self)
{
	return G_STRUCT_MEMBER_P (self, FontManagerUserInterfacePreferences_private_offset);
}

FontManagerUserInterfacePreferences*
font_manager_user_interface_preferences_construct (GType object_type,
                                                   GSettings* settings)
{
	FontManagerUserInterfacePreferences * self = NULL;
	GtkListBox* _tmp0_;
	self = (FontManagerUserInterfacePreferences*) font_manager_preference_list_construct (object_type);
	font_manager_user_interface_preferences_set_settings (self, settings);
	font_manager_widget_set_name ((GtkWidget*) self, "FontManagerUserInterfacePreferences");
	_tmp0_ = ((FontManagerPreferenceList*) self)->list;
	gtk_list_box_set_selection_mode (_tmp0_, GTK_SELECTION_NONE);
	return self;
}

FontManagerUserInterfacePreferences*
font_manager_user_interface_preferences_new (GSettings* settings)
{
	return font_manager_user_interface_preferences_construct (FONT_MANAGER_TYPE_USER_INTERFACE_PREFERENCES, settings);
}

static Block30Data*
block30_data_ref (Block30Data* _data30_)
{
	g_atomic_int_inc (&_data30_->_ref_count_);
	return _data30_;
}

static void
block30_data_unref (void * _userdata_)
{
	Block30Data* _data30_;
	_data30_ = (Block30Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data30_->_ref_count_)) {
		FontManagerUserInterfacePreferences* self;
		self = _data30_->self;
		_g_object_unref0 (_data30_->spacing);
		_g_object_unref0 (self);
		g_slice_free (Block30Data, _data30_);
	}
}

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

static void
__lambda149_ (Block30Data* _data30_)
{
	FontManagerUserInterfacePreferences* self;
	FontManagerWaterfallSettings* _tmp0_;
	GtkSpinButton* _tmp1_;
	gdouble _tmp2_;
	gdouble _tmp3_;
	self = _data30_->self;
	_tmp0_ = self->priv->_waterfall_settings;
	_tmp1_ = _data30_->spacing;
	_tmp2_ = gtk_spin_button_get_value (_tmp1_);
	_tmp3_ = _tmp2_;
	font_manager_waterfall_settings_set_line_spacing (_tmp0_, (gint) _tmp3_);
}

static void
___lambda149__gtk_spin_button_value_changed (GtkSpinButton* _sender,
                                             gpointer self)
{
	__lambda149_ (self);
}

static void
font_manager_user_interface_preferences_generate_options_list (FontManagerUserInterfacePreferences* self)
{
	Block30Data* _data30_;
	GtkSwitch* _tmp0_;
	FontManagerPreferenceRow* widget = NULL;
	GtkSwitch* _tmp1_;
	GtkWidget* _tmp2_;
	FontManagerPreferenceRow* _tmp3_;
	GtkCheckButton* _tmp4_;
	FontManagerPreferenceRow* child = NULL;
	GtkCheckButton* _tmp5_;
	FontManagerPreferenceRow* _tmp6_;
	FontManagerPreferenceRow* _tmp7_;
	FontManagerPreferenceRow* _tmp8_;
	GtkSwitch* _tmp9_;
	GtkSwitch* _tmp10_;
	GtkStringList* style_list = NULL;
	GtkStringList* _tmp11_;
	GtkStringList* _tmp12_;
	GtkStringList* _tmp13_;
	GtkStringList* _tmp14_;
	GListModel* _tmp15_;
	GtkDropDown* _tmp16_;
	GtkDropDown* _tmp17_;
	FontManagerPreferenceRow* _tmp18_;
	FontManagerPreferenceRow* _tmp19_;
	GtkSwitch* _tmp20_;
	FontManagerWaterfallSettings* _tmp21_;
	GtkAdjustment* adjustment = NULL;
	GtkAdjustment* _tmp25_;
	GtkAdjustment* _tmp26_;
	GtkSpinButton* _tmp27_;
	FontManagerPreferenceRow* spacing_row = NULL;
	GtkSpinButton* _tmp28_;
	FontManagerPreferenceRow* _tmp29_;
	FontManagerPreferenceRow* _tmp30_;
	FontManagerPreferenceRow* _tmp31_;
	GtkSpinButton* _tmp32_;
	FontManagerWaterfallSettings* _tmp33_;
	gint _tmp34_;
	gint _tmp35_;
	GtkSpinButton* _tmp36_;
	FontManagerWaterfallSettings* _tmp37_;
	FontManagerPreferenceRow* _tmp38_;
	FontManagerPreferenceRow* _tmp39_;
	GBindingFlags bind_flags = 0U;
	FontManagerWaterfallSettings* _tmp40_;
	GtkSwitch* _tmp41_;
	g_return_if_fail (self != NULL);
	_data30_ = g_slice_new0 (Block30Data);
	_data30_->_ref_count_ = 1;
	_data30_->self = g_object_ref (self);
	if (self->priv->initialized) {
		block30_data_unref (_data30_);
		_data30_ = NULL;
		return;
	}
	_tmp0_ = font_manager_preference_list_add_preference_switch ((FontManagerPreferenceList*) self, _ ("Wide Layout"), _ ("Use three column layout"));
	_g_object_unref0 (self->priv->wide_layout);
	self->priv->wide_layout = _tmp0_;
	_tmp1_ = self->priv->wide_layout;
	_tmp2_ = gtk_widget_get_ancestor ((GtkWidget*) _tmp1_, font_manager_preference_row_get_type ());
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, font_manager_preference_row_get_type ()) ? ((FontManagerPreferenceRow*) _tmp2_) : NULL);
	widget = _tmp3_;
	_tmp4_ = (GtkCheckButton*) gtk_check_button_new ();
	g_object_ref_sink (_tmp4_);
	_g_object_unref0 (self->priv->on_maximize);
	self->priv->on_maximize = _tmp4_;
	_tmp5_ = self->priv->on_maximize;
	_tmp6_ = (FontManagerPreferenceRow*) font_manager_preference_row_new (_ ("Only When Maximized"), NULL, NULL, (GtkWidget*) _tmp5_);
	g_object_ref_sink (_tmp6_);
	child = _tmp6_;
	_tmp7_ = widget;
	_tmp8_ = child;
	font_manager_preference_row_append_child (_tmp7_, _tmp8_);
	_tmp9_ = font_manager_preference_list_add_preference_switch ((FontManagerPreferenceList*) self, _ ("Enable Animations"), NULL);
	_g_object_unref0 (self->priv->enable_animations);
	self->priv->enable_animations = _tmp9_;
	_tmp10_ = font_manager_preference_list_add_preference_switch ((FontManagerPreferenceList*) self, _ ("Prefer Dark Theme"), NULL);
	_g_object_unref0 (self->priv->prefer_dark_theme);
	self->priv->prefer_dark_theme = _tmp10_;
	_tmp11_ = gtk_string_list_new (NULL);
	style_list = _tmp11_;
	_tmp12_ = style_list;
	gtk_string_list_append (_tmp12_, _ ("Raised"));
	_tmp13_ = style_list;
	gtk_string_list_append (_tmp13_, _ ("Flat"));
	_tmp14_ = style_list;
	_tmp15_ = _g_object_ref0 ((GListModel*) _tmp14_);
	_tmp16_ = (GtkDropDown*) gtk_drop_down_new (_tmp15_, NULL);
	g_object_ref_sink (_tmp16_);
	_g_object_unref0 (self->priv->button_style);
	self->priv->button_style = _tmp16_;
	_tmp17_ = self->priv->button_style;
	_tmp18_ = (FontManagerPreferenceRow*) font_manager_preference_row_new (_ ("Titlebar Button Style"), NULL, NULL, (GtkWidget*) _tmp17_);
	g_object_ref_sink (_tmp18_);
	_tmp19_ = _tmp18_;
	font_manager_preference_list_append_row ((FontManagerPreferenceList*) self, (GtkWidget*) _tmp19_);
	_g_object_unref0 (_tmp19_);
	_tmp20_ = font_manager_preference_list_add_preference_switch ((FontManagerPreferenceList*) self, _ ("Display line size in Waterfall Preview"), NULL);
	_g_object_unref0 (self->priv->show_line_size);
	self->priv->show_line_size = _tmp20_;
	_tmp21_ = self->priv->_waterfall_settings;
	if (_tmp21_ == NULL) {
		GSettings* _tmp22_;
		FontManagerWaterfallSettings* _tmp23_;
		FontManagerWaterfallSettings* _tmp24_;
		_tmp22_ = self->priv->_settings;
		_tmp23_ = font_manager_waterfall_settings_new (_tmp22_);
		_tmp24_ = _tmp23_;
		font_manager_user_interface_preferences_set_waterfall_settings (self, _tmp24_);
		_g_object_unref0 (_tmp24_);
	}
	_tmp25_ = gtk_adjustment_new (0.0, 0.0, DBL_MAX, 1.0, 1.0, 1.0);
	g_object_ref_sink (_tmp25_);
	adjustment = _tmp25_;
	_tmp26_ = adjustment;
	_tmp27_ = (GtkSpinButton*) gtk_spin_button_new (_tmp26_, 1.0, (guint) 0);
	g_object_ref_sink (_tmp27_);
	_data30_->spacing = _tmp27_;
	_tmp28_ = _data30_->spacing;
	_tmp29_ = (FontManagerPreferenceRow*) font_manager_preference_row_new (_ ("Waterfall Line Spacing"), NULL, NULL, (GtkWidget*) _tmp28_);
	g_object_ref_sink (_tmp29_);
	spacing_row = _tmp29_;
	_tmp30_ = spacing_row;
	font_manager_preference_list_append_row ((FontManagerPreferenceList*) self, (GtkWidget*) _tmp30_);
	_tmp31_ = spacing_row;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp31_, _ ("Padding in pixels to insert above and below rows"));
	_tmp32_ = _data30_->spacing;
	_tmp33_ = self->priv->_waterfall_settings;
	_tmp34_ = font_manager_waterfall_settings_get_line_spacing (_tmp33_);
	_tmp35_ = _tmp34_;
	gtk_spin_button_set_value (_tmp32_, (gdouble) _tmp35_);
	_tmp36_ = _data30_->spacing;
	g_signal_connect_data (_tmp36_, "value-changed", (GCallback) ___lambda149__gtk_spin_button_value_changed, block30_data_ref (_data30_), (GClosureNotify) block30_data_unref, 0);
	_tmp37_ = self->priv->_waterfall_settings;
	_tmp38_ = font_manager_waterfall_settings_get_preference_row (_tmp37_);
	_tmp39_ = _tmp38_;
	font_manager_preference_list_append_row ((FontManagerPreferenceList*) self, (GtkWidget*) _tmp39_);
	bind_flags = G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE;
	_tmp40_ = self->priv->_waterfall_settings;
	_tmp41_ = self->priv->show_line_size;
	g_object_bind_property_with_closures ((GObject*) _tmp40_, "show-line-size", (GObject*) _tmp41_, "active", bind_flags, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	font_manager_user_interface_preferences_bind_settings (self);
	self->priv->initialized = TRUE;
	_g_object_unref0 (spacing_row);
	_g_object_unref0 (adjustment);
	_g_object_unref0 (style_list);
	_g_object_unref0 (child);
	_g_object_unref0 (widget);
	block30_data_unref (_data30_);
	_data30_ = NULL;
	return;
}

static void
font_manager_user_interface_preferences_real_on_map (FontManagerPreferenceList* base)
{
	FontManagerUserInterfacePreferences * self;
	self = (FontManagerUserInterfacePreferences*) base;
	font_manager_user_interface_preferences_generate_options_list (self);
	return;
}

static void
font_manager_user_interface_preferences_bind_settings (FontManagerUserInterfacePreferences* self)
{
	GSettings* _tmp0_;
	GSettings* _tmp3_;
	GSettingsBindFlags flags = 0U;
	GSettings* _tmp4_;
	GtkSwitch* _tmp5_;
	GSettings* _tmp6_;
	GtkCheckButton* _tmp7_;
	GSettings* _tmp8_;
	GtkSwitch* _tmp9_;
	GtkSettings* gtk_settings = NULL;
	GtkSettings* _tmp10_;
	GtkSettings* _tmp11_;
	static const char gtk_prefer_dark[] = "gtk-application-prefer-dark-theme";
	GtkSettings* _tmp12_;
	GtkSettings* _tmp17_;
	GSettings* _tmp18_;
	GtkSwitch* _tmp19_;
	GSettings* _tmp20_;
	GtkDropDown* _tmp21_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_settings;
	if (_tmp0_ == NULL) {
		GSettings* _tmp1_;
		GSettings* _tmp2_;
		_tmp1_ = font_manager_get_gsettings (FONT_MANAGER_BUS_ID);
		_tmp2_ = _tmp1_;
		font_manager_user_interface_preferences_set_settings (self, _tmp2_);
		_g_object_unref0 (_tmp2_);
	}
	_tmp3_ = self->priv->_settings;
	g_return_if_fail (_tmp3_ != NULL);
	flags = G_SETTINGS_BIND_DEFAULT;
	_tmp4_ = self->priv->_settings;
	_tmp5_ = self->priv->wide_layout;
	g_settings_bind (_tmp4_, "wide-layout", (GObject*) _tmp5_, "active", flags);
	_tmp6_ = self->priv->_settings;
	_tmp7_ = self->priv->on_maximize;
	g_settings_bind (_tmp6_, "wide-layout-on-maximize", (GObject*) _tmp7_, "active", flags);
	_tmp8_ = self->priv->_settings;
	_tmp9_ = self->priv->enable_animations;
	g_settings_bind (_tmp8_, "enable-animations", (GObject*) _tmp9_, "active", flags);
	_tmp10_ = gtk_settings_get_default ();
	_tmp11_ = _g_object_ref0 (_tmp10_);
	gtk_settings = _tmp11_;
	_tmp12_ = gtk_settings;
	if (_tmp12_ != NULL) {
		GSettings* _tmp13_;
		GtkSettings* _tmp14_;
		GSettings* _tmp15_;
		GtkSettings* _tmp16_;
		_tmp13_ = self->priv->_settings;
		_tmp14_ = gtk_settings;
		g_settings_bind (_tmp13_, "prefer-dark-theme", (GObject*) _tmp14_, gtk_prefer_dark, flags);
		_tmp15_ = self->priv->_settings;
		_tmp16_ = gtk_settings;
		g_settings_bind (_tmp15_, "enable-animations", (GObject*) _tmp16_, "gtk-enable-animations", flags);
	}
	_tmp17_ = gtk_settings;
	g_warn_if_fail (_tmp17_ != NULL);
	_tmp18_ = self->priv->_settings;
	_tmp19_ = self->priv->prefer_dark_theme;
	g_settings_bind (_tmp18_, "prefer-dark-theme", (GObject*) _tmp19_, "active", flags);
	_tmp20_ = self->priv->_settings;
	_tmp21_ = self->priv->button_style;
	g_settings_bind_with_mapping (_tmp20_, "headerbar-button-style", (GObject*) _tmp21_, "selected", flags, (GSettingsBindGetMapping) font_manager_button_style_from_setting, (GSettingsBindSetMapping) font_manager_button_style_to_setting, NULL, NULL);
	_g_object_unref0 (gtk_settings);
	return;
}

GSettings*
font_manager_user_interface_preferences_get_settings (FontManagerUserInterfacePreferences* self)
{
	GSettings* result;
	GSettings* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_settings;
	result = _tmp0_;
	return result;
}

void
font_manager_user_interface_preferences_set_settings (FontManagerUserInterfacePreferences* self,
                                                      GSettings* value)
{
	GSettings* old_value;
	g_return_if_fail (self != NULL);
	old_value = font_manager_user_interface_preferences_get_settings (self);
	if (old_value != value) {
		GSettings* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_settings);
		self->priv->_settings = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, font_manager_user_interface_preferences_properties[FONT_MANAGER_USER_INTERFACE_PREFERENCES_SETTINGS_PROPERTY]);
	}
}

FontManagerWaterfallSettings*
font_manager_user_interface_preferences_get_waterfall_settings (FontManagerUserInterfacePreferences* self)
{
	FontManagerWaterfallSettings* result;
	FontManagerWaterfallSettings* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_waterfall_settings;
	result = _tmp0_;
	return result;
}

void
font_manager_user_interface_preferences_set_waterfall_settings (FontManagerUserInterfacePreferences* self,
                                                                FontManagerWaterfallSettings* value)
{
	FontManagerWaterfallSettings* old_value;
	g_return_if_fail (self != NULL);
	old_value = font_manager_user_interface_preferences_get_waterfall_settings (self);
	if (old_value != value) {
		FontManagerWaterfallSettings* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_waterfall_settings);
		self->priv->_waterfall_settings = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, font_manager_user_interface_preferences_properties[FONT_MANAGER_USER_INTERFACE_PREFERENCES_WATERFALL_SETTINGS_PROPERTY]);
	}
}

static void
font_manager_user_interface_preferences_class_init (FontManagerUserInterfacePreferencesClass * klass,
                                                    gpointer klass_data)
{
	font_manager_user_interface_preferences_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FontManagerUserInterfacePreferences_private_offset);
	((FontManagerPreferenceListClass *) klass)->on_map = (void (*) (FontManagerPreferenceList*)) font_manager_user_interface_preferences_real_on_map;
	G_OBJECT_CLASS (klass)->get_property = _vala_font_manager_user_interface_preferences_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_font_manager_user_interface_preferences_set_property;
	G_OBJECT_CLASS (klass)->finalize = font_manager_user_interface_preferences_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_USER_INTERFACE_PREFERENCES_SETTINGS_PROPERTY, font_manager_user_interface_preferences_properties[FONT_MANAGER_USER_INTERFACE_PREFERENCES_SETTINGS_PROPERTY] = g_param_spec_object ("settings", "settings", "settings", g_settings_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_USER_INTERFACE_PREFERENCES_WATERFALL_SETTINGS_PROPERTY, font_manager_user_interface_preferences_properties[FONT_MANAGER_USER_INTERFACE_PREFERENCES_WATERFALL_SETTINGS_PROPERTY] = g_param_spec_object ("waterfall-settings", "waterfall-settings", "waterfall-settings", FONT_MANAGER_TYPE_WATERFALL_SETTINGS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
font_manager_user_interface_preferences_instance_init (FontManagerUserInterfacePreferences * self,
                                                       gpointer klass)
{
	self->priv = font_manager_user_interface_preferences_get_instance_private (self);
	self->priv->_settings = NULL;
	self->priv->_waterfall_settings = NULL;
	self->priv->initialized = FALSE;
}

static void
font_manager_user_interface_preferences_finalize (GObject * obj)
{
	FontManagerUserInterfacePreferences * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FONT_MANAGER_TYPE_USER_INTERFACE_PREFERENCES, FontManagerUserInterfacePreferences);
	_g_object_unref0 (self->priv->_settings);
	_g_object_unref0 (self->priv->_waterfall_settings);
	_g_object_unref0 (self->priv->wide_layout);
	_g_object_unref0 (self->priv->enable_animations);
	_g_object_unref0 (self->priv->prefer_dark_theme);
	_g_object_unref0 (self->priv->show_line_size);
	_g_object_unref0 (self->priv->on_maximize);
	_g_object_unref0 (self->priv->button_style);
	G_OBJECT_CLASS (font_manager_user_interface_preferences_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
font_manager_user_interface_preferences_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FontManagerUserInterfacePreferencesClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) font_manager_user_interface_preferences_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FontManagerUserInterfacePreferences), 0, (GInstanceInitFunc) font_manager_user_interface_preferences_instance_init, NULL };
	GType font_manager_user_interface_preferences_type_id;
	font_manager_user_interface_preferences_type_id = g_type_register_static (FONT_MANAGER_TYPE_PREFERENCE_LIST, "FontManagerUserInterfacePreferences", &g_define_type_info, 0);
	FontManagerUserInterfacePreferences_private_offset = g_type_add_instance_private (font_manager_user_interface_preferences_type_id, sizeof (FontManagerUserInterfacePreferencesPrivate));
	return font_manager_user_interface_preferences_type_id;
}

GType
font_manager_user_interface_preferences_get_type (void)
{
	static volatile gsize font_manager_user_interface_preferences_type_id__once = 0;
	if (g_once_init_enter (&font_manager_user_interface_preferences_type_id__once)) {
		GType font_manager_user_interface_preferences_type_id;
		font_manager_user_interface_preferences_type_id = font_manager_user_interface_preferences_get_type_once ();
		g_once_init_leave (&font_manager_user_interface_preferences_type_id__once, font_manager_user_interface_preferences_type_id);
	}
	return font_manager_user_interface_preferences_type_id__once;
}

static void
_vala_font_manager_user_interface_preferences_get_property (GObject * object,
                                                            guint property_id,
                                                            GValue * value,
                                                            GParamSpec * pspec)
{
	FontManagerUserInterfacePreferences * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FONT_MANAGER_TYPE_USER_INTERFACE_PREFERENCES, FontManagerUserInterfacePreferences);
	switch (property_id) {
		case FONT_MANAGER_USER_INTERFACE_PREFERENCES_SETTINGS_PROPERTY:
		g_value_set_object (value, font_manager_user_interface_preferences_get_settings (self));
		break;
		case FONT_MANAGER_USER_INTERFACE_PREFERENCES_WATERFALL_SETTINGS_PROPERTY:
		g_value_set_object (value, font_manager_user_interface_preferences_get_waterfall_settings (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_font_manager_user_interface_preferences_set_property (GObject * object,
                                                            guint property_id,
                                                            const GValue * value,
                                                            GParamSpec * pspec)
{
	FontManagerUserInterfacePreferences * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FONT_MANAGER_TYPE_USER_INTERFACE_PREFERENCES, FontManagerUserInterfacePreferences);
	switch (property_id) {
		case FONT_MANAGER_USER_INTERFACE_PREFERENCES_SETTINGS_PROPERTY:
		font_manager_user_interface_preferences_set_settings (self, g_value_get_object (value));
		break;
		case FONT_MANAGER_USER_INTERFACE_PREFERENCES_WATERFALL_SETTINGS_PROPERTY:
		font_manager_user_interface_preferences_set_waterfall_settings (self, g_value_get_object (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;
}

