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

/* Rendering.vala
 *
 * Copyright (C) 2009-2024 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 "font-manager.h"
#include <string.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <glib/gi18n-lib.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 FONT_MANAGER_TYPE_PREVIOUS_RENDERING_SETTINGS (font_manager_previous_rendering_settings_get_type ())
typedef struct _FontManagerPreviousRenderingSettings FontManagerPreviousRenderingSettings;

#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_RENDERING_PREFERENCES (font_manager_rendering_preferences_get_type ())
#define FONT_MANAGER_RENDERING_PREFERENCES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_RENDERING_PREFERENCES, FontManagerRenderingPreferences))
#define FONT_MANAGER_RENDERING_PREFERENCES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_RENDERING_PREFERENCES, FontManagerRenderingPreferencesClass))
#define FONT_MANAGER_IS_RENDERING_PREFERENCES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_RENDERING_PREFERENCES))
#define FONT_MANAGER_IS_RENDERING_PREFERENCES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_RENDERING_PREFERENCES))
#define FONT_MANAGER_RENDERING_PREFERENCES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_RENDERING_PREFERENCES, FontManagerRenderingPreferencesClass))

typedef struct _FontManagerRenderingPreferences FontManagerRenderingPreferences;
typedef struct _FontManagerRenderingPreferencesClass FontManagerRenderingPreferencesClass;
typedef struct _FontManagerRenderingPreferencesPrivate FontManagerRenderingPreferencesPrivate;
enum  {
	FONT_MANAGER_RENDERING_PREFERENCES_0_PROPERTY,
	FONT_MANAGER_RENDERING_PREFERENCES_PROPERTIES_PROPERTY,
	FONT_MANAGER_RENDERING_PREFERENCES_NUM_PROPERTIES
};
static GParamSpec* font_manager_rendering_preferences_properties[FONT_MANAGER_RENDERING_PREFERENCES_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))

#define FONT_MANAGER_TYPE_FONTCONFIG_FOOTER (font_manager_fontconfig_footer_get_type ())
#define FONT_MANAGER_FONTCONFIG_FOOTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_FONTCONFIG_FOOTER, FontManagerFontconfigFooter))
#define FONT_MANAGER_FONTCONFIG_FOOTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_FONTCONFIG_FOOTER, FontManagerFontconfigFooterClass))
#define FONT_MANAGER_IS_FONTCONFIG_FOOTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_FONTCONFIG_FOOTER))
#define FONT_MANAGER_IS_FONTCONFIG_FOOTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_FONTCONFIG_FOOTER))
#define FONT_MANAGER_FONTCONFIG_FOOTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_FONTCONFIG_FOOTER, FontManagerFontconfigFooterClass))

typedef struct _FontManagerFontconfigFooter FontManagerFontconfigFooter;
typedef struct _FontManagerFontconfigFooterClass FontManagerFontconfigFooterClass;
#define _g_array_unref0(var) ((var == NULL) ? NULL : (var = (g_array_unref (var), NULL)))

struct _FontManagerPreviousRenderingSettings {
	gint hintstyle;
	gboolean antialias;
	gboolean hinting;
	gboolean autohint;
	gboolean bitmaps;
};

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 _FontManagerRenderingPreferences {
	FontManagerPreferenceList parent_instance;
	FontManagerRenderingPreferencesPrivate * priv;
};

struct _FontManagerRenderingPreferencesClass {
	FontManagerPreferenceListClass parent_class;
};

struct _FontManagerRenderingPreferencesPrivate {
	FontManagerFontProperties* _properties;
	gboolean initialized;
	GtkCheckButton* hinter;
	GtkDropDown* hintstyle;
	GtkSwitch* antialias;
	GtkSwitch* hinting;
	GtkSwitch* bitmaps;
	FontManagerPreviousRenderingSettings settings;
};

static gint FontManagerRenderingPreferences_private_offset;
static gpointer font_manager_rendering_preferences_parent_class = NULL;

VALA_EXTERN GType font_manager_previous_rendering_settings_get_type (void) G_GNUC_CONST ;
VALA_EXTERN FontManagerPreviousRenderingSettings* font_manager_previous_rendering_settings_dup (const FontManagerPreviousRenderingSettings* self);
VALA_EXTERN void font_manager_previous_rendering_settings_free (FontManagerPreviousRenderingSettings* self);
VALA_EXTERN void font_manager_previous_rendering_settings_init (FontManagerPreviousRenderingSettings *self,
                                                    FontManagerFontProperties* properties);
VALA_EXTERN gboolean font_manager_previous_rendering_settings_changed (FontManagerPreviousRenderingSettings *self,
                                                           FontManagerFontProperties* properties);
VALA_EXTERN void font_manager_previous_rendering_settings_load (FontManagerPreviousRenderingSettings *self,
                                                    FontManagerFontProperties* properties);
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_rendering_preferences_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerRenderingPreferences, g_object_unref)
VALA_EXTERN void font_manager_preference_list_on_map (FontManagerPreferenceList* self);
VALA_EXTERN void font_manager_preference_list_on_unmap (FontManagerPreferenceList* self);
VALA_EXTERN FontManagerRenderingPreferences* font_manager_rendering_preferences_new (void);
VALA_EXTERN FontManagerRenderingPreferences* font_manager_rendering_preferences_construct (GType object_type);
VALA_EXTERN FontManagerPreferenceList* font_manager_preference_list_new (void);
VALA_EXTERN FontManagerPreferenceList* font_manager_preference_list_construct (GType object_type);
static void font_manager_rendering_preferences_set_properties (FontManagerRenderingPreferences* self,
                                                        FontManagerFontProperties* value);
static void font_manager_rendering_preferences_generate_options_list (FontManagerRenderingPreferences* self);
VALA_EXTERN GtkSwitch* font_manager_preference_list_add_preference_switch (FontManagerPreferenceList* self,
                                                               const gchar* name,
                                                               const gchar* tooltip);
static void _g_free0_ (gpointer var);
static void _vala_gchar_free_function_content_of (gpointer data);
static void font_manager_rendering_preferences_bind_properties (FontManagerRenderingPreferences* self);
VALA_EXTERN FontManagerFontProperties* font_manager_rendering_preferences_get_properties (FontManagerRenderingPreferences* self);
VALA_EXTERN GType font_manager_fontconfig_footer_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerFontconfigFooter, g_object_unref)
VALA_EXTERN FontManagerFontconfigFooter* font_manager_fontconfig_footer_new (void);
VALA_EXTERN FontManagerFontconfigFooter* font_manager_fontconfig_footer_construct (GType object_type);
static void font_manager_rendering_preferences_on_reset (FontManagerRenderingPreferences* self);
static void _font_manager_rendering_preferences_on_reset_font_manager_fontconfig_footer_reset_requested (FontManagerFontconfigFooter* _sender,
                                                                                                  gpointer self);
static void font_manager_rendering_preferences_real_on_map (FontManagerPreferenceList* base);
static void font_manager_rendering_preferences_real_on_unmap (FontManagerPreferenceList* base);
static void font_manager_rendering_preferences_finalize (GObject * obj);
static GType font_manager_rendering_preferences_get_type_once (void);
static void _vala_font_manager_rendering_preferences_get_property (GObject * object,
                                                            guint property_id,
                                                            GValue * value,
                                                            GParamSpec * pspec);
static void _vala_font_manager_rendering_preferences_set_property (GObject * object,
                                                            guint property_id,
                                                            const GValue * value,
                                                            GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

void
font_manager_previous_rendering_settings_init (FontManagerPreviousRenderingSettings *self,
                                               FontManagerFontProperties* properties)
{
	gint _tmp0_;
	gint _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	gboolean _tmp8_;
	gboolean _tmp9_;
	g_return_if_fail (properties != NULL);
	memset (self, 0, sizeof (FontManagerPreviousRenderingSettings));
	g_object_get (properties, "hintstyle", &_tmp0_, NULL);
	_tmp1_ = _tmp0_;
	(*self).hintstyle = _tmp1_;
	g_object_get (properties, "antialias", &_tmp2_, NULL);
	_tmp3_ = _tmp2_;
	(*self).antialias = _tmp3_;
	g_object_get (properties, "hinting", &_tmp4_, NULL);
	_tmp5_ = _tmp4_;
	(*self).hinting = _tmp5_;
	g_object_get (properties, "autohint", &_tmp6_, NULL);
	_tmp7_ = _tmp6_;
	(*self).autohint = _tmp7_;
	g_object_get (properties, "embeddedbitmap", &_tmp8_, NULL);
	_tmp9_ = _tmp8_;
	(*self).bitmaps = _tmp9_;
}

gboolean
font_manager_previous_rendering_settings_changed (FontManagerPreviousRenderingSettings *self,
                                                  FontManagerFontProperties* properties)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gint _tmp4_;
	gint _tmp5_;
	gboolean result;
	g_return_val_if_fail (properties != NULL, FALSE);
	g_object_get (properties, "hintstyle", &_tmp4_, NULL);
	_tmp5_ = _tmp4_;
	if (_tmp5_ != (*self).hintstyle) {
		_tmp3_ = TRUE;
	} else {
		gboolean _tmp6_;
		gboolean _tmp7_;
		g_object_get (properties, "antialias", &_tmp6_, NULL);
		_tmp7_ = _tmp6_;
		_tmp3_ = _tmp7_ != (*self).antialias;
	}
	if (_tmp3_) {
		_tmp2_ = TRUE;
	} else {
		gboolean _tmp8_;
		gboolean _tmp9_;
		g_object_get (properties, "hinting", &_tmp8_, NULL);
		_tmp9_ = _tmp8_;
		_tmp2_ = _tmp9_ != (*self).hinting;
	}
	if (_tmp2_) {
		_tmp1_ = TRUE;
	} else {
		gboolean _tmp10_;
		gboolean _tmp11_;
		g_object_get (properties, "autohint", &_tmp10_, NULL);
		_tmp11_ = _tmp10_;
		_tmp1_ = _tmp11_ != (*self).autohint;
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		gboolean _tmp12_;
		gboolean _tmp13_;
		g_object_get (properties, "embeddedbitmap", &_tmp12_, NULL);
		_tmp13_ = _tmp12_;
		_tmp0_ = _tmp13_ != (*self).bitmaps;
	}
	result = _tmp0_;
	return result;
}

void
font_manager_previous_rendering_settings_load (FontManagerPreviousRenderingSettings *self,
                                               FontManagerFontProperties* properties)
{
	g_return_if_fail (properties != NULL);
	g_object_set ((GObject*) properties, "hintstyle", (*self).hintstyle, "antialias", (*self).antialias, "hinting", (*self).hinting, "autohint", (*self).autohint, "embeddedbitmap", (*self).bitmaps, NULL);
	return;
}

FontManagerPreviousRenderingSettings*
font_manager_previous_rendering_settings_dup (const FontManagerPreviousRenderingSettings* self)
{
	FontManagerPreviousRenderingSettings* dup;
	dup = g_new0 (FontManagerPreviousRenderingSettings, 1);
	memcpy (dup, self, sizeof (FontManagerPreviousRenderingSettings));
	return dup;
}

void
font_manager_previous_rendering_settings_free (FontManagerPreviousRenderingSettings* self)
{
	g_free (self);
}

 G_GNUC_NO_INLINE static GType
font_manager_previous_rendering_settings_get_type_once (void)
{
	GType font_manager_previous_rendering_settings_type_id;
	font_manager_previous_rendering_settings_type_id = g_boxed_type_register_static ("FontManagerPreviousRenderingSettings", (GBoxedCopyFunc) font_manager_previous_rendering_settings_dup, (GBoxedFreeFunc) font_manager_previous_rendering_settings_free);
	return font_manager_previous_rendering_settings_type_id;
}

GType
font_manager_previous_rendering_settings_get_type (void)
{
	static volatile gsize font_manager_previous_rendering_settings_type_id__once = 0;
	if (g_once_init_enter (&font_manager_previous_rendering_settings_type_id__once)) {
		GType font_manager_previous_rendering_settings_type_id;
		font_manager_previous_rendering_settings_type_id = font_manager_previous_rendering_settings_get_type_once ();
		g_once_init_leave (&font_manager_previous_rendering_settings_type_id__once, font_manager_previous_rendering_settings_type_id);
	}
	return font_manager_previous_rendering_settings_type_id__once;
}

static inline gpointer
font_manager_rendering_preferences_get_instance_private (FontManagerRenderingPreferences* self)
{
	return G_STRUCT_MEMBER_P (self, FontManagerRenderingPreferences_private_offset);
}

FontManagerRenderingPreferences*
font_manager_rendering_preferences_construct (GType object_type)
{
	FontManagerRenderingPreferences * self = NULL;
	GtkListBox* _tmp0_;
	gchar* _tmp1_;
	FontManagerFontProperties* _tmp2_ = NULL;
	FontManagerFontProperties* _tmp3_;
	self = (FontManagerRenderingPreferences*) font_manager_preference_list_construct (object_type);
	font_manager_widget_set_name ((GtkWidget*) self, "FontManagerRenderingPreferences");
	_tmp0_ = ((FontManagerPreferenceList*) self)->list;
	gtk_list_box_set_selection_mode (_tmp0_, GTK_SELECTION_NONE);
	_tmp1_ = g_strdup ("19-DefaultProperties.conf");
	_tmp2_ = font_manager_font_properties_new ();
	g_object_set (_tmp2_, "target-file", _tmp1_, NULL);
	_g_free0 (_tmp1_);
	_tmp3_ = _tmp2_;
	font_manager_rendering_preferences_set_properties (self, _tmp3_);
	_g_object_unref0 (_tmp3_);
	return self;
}

FontManagerRenderingPreferences*
font_manager_rendering_preferences_new (void)
{
	return font_manager_rendering_preferences_construct (FONT_MANAGER_TYPE_RENDERING_PREFERENCES);
}

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

static void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

static void
_vala_gchar_free_function_content_of (gpointer data)
{
	gchar* self;
	self = *((gchar**) data);
	_g_free0_ (self);
}

static void
_font_manager_rendering_preferences_on_reset_font_manager_fontconfig_footer_reset_requested (FontManagerFontconfigFooter* _sender,
                                                                                             gpointer self)
{
	font_manager_rendering_preferences_on_reset ((FontManagerRenderingPreferences*) self);
}

static void
font_manager_rendering_preferences_generate_options_list (FontManagerRenderingPreferences* self)
{
	GtkSwitch* _tmp0_;
	GtkSwitch* _tmp1_;
	FontManagerPreferenceRow* widget = NULL;
	GtkSwitch* _tmp2_;
	GtkWidget* _tmp3_;
	FontManagerPreferenceRow* _tmp4_;
	GtkCheckButton* _tmp5_;
	FontManagerPreferenceRow* child = NULL;
	GtkCheckButton* _tmp6_;
	FontManagerPreferenceRow* _tmp7_;
	FontManagerPreferenceRow* _tmp8_;
	FontManagerPreferenceRow* _tmp9_;
	GArray* hintstyles = NULL;
	GArray* _tmp10_;
	GtkStringList* hintstyle_list = NULL;
	GArray* _tmp16_;
	gpointer* _tmp17_;
	gint _tmp17__length1;
	GtkStringList* _tmp18_;
	GtkStringList* _tmp19_;
	GListModel* _tmp20_;
	GtkDropDown* _tmp21_;
	GtkDropDown* _tmp22_;
	FontManagerPreferenceRow* _tmp23_;
	FontManagerPreferenceRow* _tmp24_;
	FontManagerPreferenceRow* _tmp25_;
	GtkSwitch* _tmp26_;
	FontManagerFontProperties* _tmp27_;
	FontManagerFontconfigFooter* footer = NULL;
	FontManagerFontconfigFooter* _tmp28_;
	FontManagerFontconfigFooter* _tmp29_;
	FontManagerFontconfigFooter* _tmp30_;
	g_return_if_fail (self != NULL);
	if (self->priv->initialized) {
		return;
	}
	_tmp0_ = font_manager_preference_list_add_preference_switch ((FontManagerPreferenceList*) self, _ ("Antialias"), NULL);
	_g_object_unref0 (self->priv->antialias);
	self->priv->antialias = _tmp0_;
	_tmp1_ = font_manager_preference_list_add_preference_switch ((FontManagerPreferenceList*) self, _ ("Hinting"), NULL);
	_g_object_unref0 (self->priv->hinting);
	self->priv->hinting = _tmp1_;
	_tmp2_ = self->priv->hinting;
	_tmp3_ = gtk_widget_get_ancestor ((GtkWidget*) _tmp2_, font_manager_preference_row_get_type ());
	_tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, font_manager_preference_row_get_type ()) ? ((FontManagerPreferenceRow*) _tmp3_) : NULL);
	widget = _tmp4_;
	_tmp5_ = (GtkCheckButton*) gtk_check_button_new ();
	g_object_ref_sink (_tmp5_);
	_g_object_unref0 (self->priv->hinter);
	self->priv->hinter = _tmp5_;
	_tmp6_ = self->priv->hinter;
	_tmp7_ = (FontManagerPreferenceRow*) font_manager_preference_row_new (_ ("Enable Autohinter"), NULL, NULL, (GtkWidget*) _tmp6_);
	g_object_ref_sink (_tmp7_);
	child = _tmp7_;
	_tmp8_ = widget;
	_tmp9_ = child;
	font_manager_preference_row_append_child (_tmp8_, _tmp9_);
	_tmp10_ = g_array_new (TRUE, TRUE, sizeof (gchar*));
	g_array_set_clear_func (_tmp10_, (GDestroyNotify) _vala_gchar_free_function_content_of);
	hintstyles = _tmp10_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp11_ = FALSE;
			_tmp11_ = TRUE;
			while (TRUE) {
				GArray* _tmp13_;
				const gchar* _tmp14_;
				gchar* _tmp15_;
				if (!_tmp11_) {
					gint _tmp12_;
					_tmp12_ = i;
					i = _tmp12_ + 1;
				}
				_tmp11_ = FALSE;
				if (!(i <= ((gint) FONT_MANAGER_HINT_STYLE_FULL))) {
					break;
				}
				_tmp13_ = hintstyles;
				_tmp14_ = font_manager_hint_style_to_string ((FontManagerHintStyle) i);
				_tmp15_ = g_strdup (_tmp14_);
				g_array_append_val (_tmp13_, _tmp15_);
			}
		}
	}
	_tmp16_ = hintstyles;
	_tmp17_ = _tmp16_->data;
	_tmp17__length1 = _tmp16_->len;
	_tmp18_ = gtk_string_list_new (_tmp17_);
	hintstyle_list = _tmp18_;
	_tmp19_ = hintstyle_list;
	_tmp20_ = _g_object_ref0 ((GListModel*) _tmp19_);
	_tmp21_ = (GtkDropDown*) gtk_drop_down_new (_tmp20_, NULL);
	g_object_ref_sink (_tmp21_);
	_g_object_unref0 (self->priv->hintstyle);
	self->priv->hintstyle = _tmp21_;
	_tmp22_ = self->priv->hintstyle;
	_tmp23_ = (FontManagerPreferenceRow*) font_manager_preference_row_new (_ ("Hinting Style"), NULL, NULL, (GtkWidget*) _tmp22_);
	g_object_ref_sink (_tmp23_);
	_g_object_unref0 (child);
	child = _tmp23_;
	_tmp24_ = widget;
	_tmp25_ = child;
	font_manager_preference_row_append_child (_tmp24_, _tmp25_);
	_tmp26_ = font_manager_preference_list_add_preference_switch ((FontManagerPreferenceList*) self, _ ("Use Embedded Bitmaps"), NULL);
	_g_object_unref0 (self->priv->bitmaps);
	self->priv->bitmaps = _tmp26_;
	font_manager_rendering_preferences_bind_properties (self);
	_tmp27_ = self->priv->_properties;
	font_manager_previous_rendering_settings_init (&self->priv->settings, _tmp27_);
	_tmp28_ = font_manager_fontconfig_footer_new ();
	g_object_ref_sink (_tmp28_);
	footer = _tmp28_;
	_tmp29_ = footer;
	g_signal_connect_object (_tmp29_, "reset-requested", (GCallback) _font_manager_rendering_preferences_on_reset_font_manager_fontconfig_footer_reset_requested, self, 0);
	_tmp30_ = footer;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp30_);
	self->priv->initialized = TRUE;
	_g_object_unref0 (footer);
	_g_object_unref0 (hintstyle_list);
	_g_array_unref0 (hintstyles);
	_g_object_unref0 (child);
	_g_object_unref0 (widget);
	return;
}

static void
font_manager_rendering_preferences_bind_properties (FontManagerRenderingPreferences* self)
{
	GBindingFlags flags = 0U;
	FontManagerFontProperties* _tmp0_;
	GtkSwitch* _tmp1_;
	FontManagerFontProperties* _tmp2_;
	GtkSwitch* _tmp3_;
	FontManagerFontProperties* _tmp4_;
	GtkCheckButton* _tmp5_;
	FontManagerFontProperties* _tmp6_;
	GtkSwitch* _tmp7_;
	FontManagerFontProperties* _tmp8_;
	GtkDropDown* _tmp9_;
	g_return_if_fail (self != NULL);
	flags = G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE;
	_tmp0_ = self->priv->_properties;
	_tmp1_ = self->priv->antialias;
	g_object_bind_property_with_closures ((GObject*) _tmp0_, "antialias", (GObject*) _tmp1_, "active", 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)));
	_tmp2_ = self->priv->_properties;
	_tmp3_ = self->priv->hinting;
	g_object_bind_property_with_closures ((GObject*) _tmp2_, "hinting", (GObject*) _tmp3_, "active", 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)));
	_tmp4_ = self->priv->_properties;
	_tmp5_ = self->priv->hinter;
	g_object_bind_property_with_closures ((GObject*) _tmp4_, "autohint", (GObject*) _tmp5_, "active", 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)));
	_tmp6_ = self->priv->_properties;
	_tmp7_ = self->priv->bitmaps;
	g_object_bind_property_with_closures ((GObject*) _tmp6_, "embeddedbitmap", (GObject*) _tmp7_, "active", 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)));
	_tmp8_ = self->priv->_properties;
	_tmp9_ = self->priv->hintstyle;
	g_object_bind_property_with_closures ((GObject*) _tmp8_, "hintstyle", (GObject*) _tmp9_, "selected", 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)));
	return;
}

static void
font_manager_rendering_preferences_on_reset (FontManagerRenderingPreferences* self)
{
	FontManagerFontProperties* _tmp0_;
	FontManagerFontProperties* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_properties;
	font_manager_font_properties_discard (_tmp0_);
	_tmp1_ = self->priv->_properties;
	font_manager_previous_rendering_settings_load (&self->priv->settings, _tmp1_);
	return;
}

static void
font_manager_rendering_preferences_real_on_map (FontManagerPreferenceList* base)
{
	FontManagerRenderingPreferences * self;
	FontManagerFontProperties* _tmp0_;
	self = (FontManagerRenderingPreferences*) base;
	font_manager_rendering_preferences_generate_options_list (self);
	_tmp0_ = self->priv->_properties;
	font_manager_font_properties_load (_tmp0_);
	return;
}

static void
font_manager_rendering_preferences_real_on_unmap (FontManagerPreferenceList* base)
{
	FontManagerRenderingPreferences * self;
	FontManagerFontProperties* _tmp0_;
	self = (FontManagerRenderingPreferences*) base;
	_tmp0_ = self->priv->_properties;
	if (font_manager_previous_rendering_settings_changed (&self->priv->settings, _tmp0_)) {
		FontManagerFontProperties* _tmp1_;
		_tmp1_ = self->priv->_properties;
		font_manager_font_properties_save (_tmp1_);
	}
	return;
}

FontManagerFontProperties*
font_manager_rendering_preferences_get_properties (FontManagerRenderingPreferences* self)
{
	FontManagerFontProperties* result;
	FontManagerFontProperties* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_properties;
	result = _tmp0_;
	return result;
}

static void
font_manager_rendering_preferences_set_properties (FontManagerRenderingPreferences* self,
                                                   FontManagerFontProperties* value)
{
	FontManagerFontProperties* old_value;
	g_return_if_fail (self != NULL);
	old_value = font_manager_rendering_preferences_get_properties (self);
	if (old_value != value) {
		FontManagerFontProperties* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_properties);
		self->priv->_properties = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, font_manager_rendering_preferences_properties[FONT_MANAGER_RENDERING_PREFERENCES_PROPERTIES_PROPERTY]);
	}
}

static void
font_manager_rendering_preferences_class_init (FontManagerRenderingPreferencesClass * klass,
                                               gpointer klass_data)
{
	font_manager_rendering_preferences_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FontManagerRenderingPreferences_private_offset);
	((FontManagerPreferenceListClass *) klass)->on_map = (void (*) (FontManagerPreferenceList*)) font_manager_rendering_preferences_real_on_map;
	((FontManagerPreferenceListClass *) klass)->on_unmap = (void (*) (FontManagerPreferenceList*)) font_manager_rendering_preferences_real_on_unmap;
	G_OBJECT_CLASS (klass)->get_property = _vala_font_manager_rendering_preferences_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_font_manager_rendering_preferences_set_property;
	G_OBJECT_CLASS (klass)->finalize = font_manager_rendering_preferences_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_RENDERING_PREFERENCES_PROPERTIES_PROPERTY, font_manager_rendering_preferences_properties[FONT_MANAGER_RENDERING_PREFERENCES_PROPERTIES_PROPERTY] = g_param_spec_object ("properties", "properties", "properties", font_manager_font_properties_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
font_manager_rendering_preferences_instance_init (FontManagerRenderingPreferences * self,
                                                  gpointer klass)
{
	self->priv = font_manager_rendering_preferences_get_instance_private (self);
	self->priv->initialized = FALSE;
}

static void
font_manager_rendering_preferences_finalize (GObject * obj)
{
	FontManagerRenderingPreferences * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FONT_MANAGER_TYPE_RENDERING_PREFERENCES, FontManagerRenderingPreferences);
	_g_object_unref0 (self->priv->_properties);
	_g_object_unref0 (self->priv->hinter);
	_g_object_unref0 (self->priv->hintstyle);
	_g_object_unref0 (self->priv->antialias);
	_g_object_unref0 (self->priv->hinting);
	_g_object_unref0 (self->priv->bitmaps);
	G_OBJECT_CLASS (font_manager_rendering_preferences_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
font_manager_rendering_preferences_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FontManagerRenderingPreferencesClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) font_manager_rendering_preferences_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FontManagerRenderingPreferences), 0, (GInstanceInitFunc) font_manager_rendering_preferences_instance_init, NULL };
	GType font_manager_rendering_preferences_type_id;
	font_manager_rendering_preferences_type_id = g_type_register_static (FONT_MANAGER_TYPE_PREFERENCE_LIST, "FontManagerRenderingPreferences", &g_define_type_info, 0);
	FontManagerRenderingPreferences_private_offset = g_type_add_instance_private (font_manager_rendering_preferences_type_id, sizeof (FontManagerRenderingPreferencesPrivate));
	return font_manager_rendering_preferences_type_id;
}

GType
font_manager_rendering_preferences_get_type (void)
{
	static volatile gsize font_manager_rendering_preferences_type_id__once = 0;
	if (g_once_init_enter (&font_manager_rendering_preferences_type_id__once)) {
		GType font_manager_rendering_preferences_type_id;
		font_manager_rendering_preferences_type_id = font_manager_rendering_preferences_get_type_once ();
		g_once_init_leave (&font_manager_rendering_preferences_type_id__once, font_manager_rendering_preferences_type_id);
	}
	return font_manager_rendering_preferences_type_id__once;
}

static void
_vala_font_manager_rendering_preferences_get_property (GObject * object,
                                                       guint property_id,
                                                       GValue * value,
                                                       GParamSpec * pspec)
{
	FontManagerRenderingPreferences * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FONT_MANAGER_TYPE_RENDERING_PREFERENCES, FontManagerRenderingPreferences);
	switch (property_id) {
		case FONT_MANAGER_RENDERING_PREFERENCES_PROPERTIES_PROPERTY:
		g_value_set_object (value, font_manager_rendering_preferences_get_properties (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_font_manager_rendering_preferences_set_property (GObject * object,
                                                       guint property_id,
                                                       const GValue * value,
                                                       GParamSpec * pspec)
{
	FontManagerRenderingPreferences * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FONT_MANAGER_TYPE_RENDERING_PREFERENCES, FontManagerRenderingPreferences);
	switch (property_id) {
		case FONT_MANAGER_RENDERING_PREFERENCES_PROPERTIES_PROPERTY:
		font_manager_rendering_preferences_set_properties (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;
}

