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

#include "pantheon-files-core.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <glib-object.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

enum  {
	FILES_PREFERENCES_0_PROPERTY,
	FILES_PREFERENCES_SHOW_HIDDEN_FILES_PROPERTY,
	FILES_PREFERENCES_SHOW_FILE_PREVIEW_PROPERTY,
	FILES_PREFERENCES_CONFIRM_TRASH_PROPERTY,
	FILES_PREFERENCES_REMEMBER_HISTORY_PROPERTY,
	FILES_PREFERENCES_DATE_FORMAT_PROPERTY,
	FILES_PREFERENCES_CLOCK_FORMAT_PROPERTY,
	FILES_PREFERENCES_NUM_PROPERTIES
};
static GParamSpec* files_preferences_properties[FILES_PREFERENCES_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 _FilesPreferencesPrivate {
	gboolean _show_hidden_files;
	gboolean _show_file_preview;
	gboolean _confirm_trash;
	gboolean _remember_history;
	FilesDateFormatMode _date_format;
	gchar* _clock_format;
};

FilesPreferences* files_preferences = NULL;
static gint FilesPreferences_private_offset;
static gpointer files_preferences_parent_class = NULL;

static void files_preferences_finalize (GObject * obj);
static GType files_preferences_get_type_once (void);
static void _vala_files_preferences_get_property (GObject * object,
                                           guint property_id,
                                           GValue * value,
                                           GParamSpec * pspec);
static void _vala_files_preferences_set_property (GObject * object,
                                           guint property_id,
                                           const GValue * value,
                                           GParamSpec * pspec);

const gchar* FILES_PREFERENCES_TAGS_COLORS[12] = {NULL, "#64baff", "#43d6b5", "#9bdb4d", "#ffe16b", "#ffc27d", "#ff8c82", "#f4679d", "#cd9ef7", "#a3907c", "#95a3ab", NULL};

static inline gpointer
files_preferences_get_instance_private (FilesPreferences* self)
{
	return G_STRUCT_MEMBER_P (self, FilesPreferences_private_offset);
}

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

FilesPreferences*
files_preferences_get_default (void)
{
	FilesPreferences* _tmp0_;
	FilesPreferences* _tmp2_;
	FilesPreferences* _tmp3_;
	FilesPreferences* result;
	_tmp0_ = files_preferences;
	if (_tmp0_ == NULL) {
		FilesPreferences* _tmp1_;
		_tmp1_ = files_preferences_new ();
		_g_object_unref0 (files_preferences);
		files_preferences = _tmp1_;
	}
	_tmp2_ = files_preferences;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	result = _tmp3_;
	return result;
}

FilesPreferences*
files_preferences_construct (GType object_type)
{
	FilesPreferences * self = NULL;
	self = (FilesPreferences*) g_object_new (object_type, NULL);
	return self;
}

FilesPreferences*
files_preferences_new (void)
{
	return files_preferences_construct (FILES_TYPE_PREFERENCES);
}

gboolean
files_preferences_get_show_hidden_files (FilesPreferences* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_show_hidden_files;
	return result;
}

void
files_preferences_set_show_hidden_files (FilesPreferences* self,
                                         gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = files_preferences_get_show_hidden_files (self);
	if (old_value != value) {
		self->priv->_show_hidden_files = value;
		g_object_notify_by_pspec ((GObject *) self, files_preferences_properties[FILES_PREFERENCES_SHOW_HIDDEN_FILES_PROPERTY]);
	}
}

gboolean
files_preferences_get_show_file_preview (FilesPreferences* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_show_file_preview;
	return result;
}

void
files_preferences_set_show_file_preview (FilesPreferences* self,
                                         gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = files_preferences_get_show_file_preview (self);
	if (old_value != value) {
		self->priv->_show_file_preview = value;
		g_object_notify_by_pspec ((GObject *) self, files_preferences_properties[FILES_PREFERENCES_SHOW_FILE_PREVIEW_PROPERTY]);
	}
}

gboolean
files_preferences_get_confirm_trash (FilesPreferences* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_confirm_trash;
	return result;
}

void
files_preferences_set_confirm_trash (FilesPreferences* self,
                                     gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = files_preferences_get_confirm_trash (self);
	if (old_value != value) {
		self->priv->_confirm_trash = value;
		g_object_notify_by_pspec ((GObject *) self, files_preferences_properties[FILES_PREFERENCES_CONFIRM_TRASH_PROPERTY]);
	}
}

gboolean
files_preferences_get_remember_history (FilesPreferences* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_remember_history;
	return result;
}

void
files_preferences_set_remember_history (FilesPreferences* self,
                                        gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = files_preferences_get_remember_history (self);
	if (old_value != value) {
		self->priv->_remember_history = value;
		g_object_notify_by_pspec ((GObject *) self, files_preferences_properties[FILES_PREFERENCES_REMEMBER_HISTORY_PROPERTY]);
	}
}

FilesDateFormatMode
files_preferences_get_date_format (FilesPreferences* self)
{
	FilesDateFormatMode result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_date_format;
	return result;
}

void
files_preferences_set_date_format (FilesPreferences* self,
                                   FilesDateFormatMode value)
{
	FilesDateFormatMode old_value;
	g_return_if_fail (self != NULL);
	old_value = files_preferences_get_date_format (self);
	if (old_value != value) {
		self->priv->_date_format = value;
		g_object_notify_by_pspec ((GObject *) self, files_preferences_properties[FILES_PREFERENCES_DATE_FORMAT_PROPERTY]);
	}
}

const gchar*
files_preferences_get_clock_format (FilesPreferences* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_clock_format;
	result = _tmp0_;
	return result;
}

void
files_preferences_set_clock_format (FilesPreferences* self,
                                    const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = files_preferences_get_clock_format (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_clock_format);
		self->priv->_clock_format = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, files_preferences_properties[FILES_PREFERENCES_CLOCK_FORMAT_PROPERTY]);
	}
}

static void
files_preferences_class_init (FilesPreferencesClass * klass,
                              gpointer klass_data)
{
	files_preferences_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FilesPreferences_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_files_preferences_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_files_preferences_set_property;
	G_OBJECT_CLASS (klass)->finalize = files_preferences_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FILES_PREFERENCES_SHOW_HIDDEN_FILES_PROPERTY, files_preferences_properties[FILES_PREFERENCES_SHOW_HIDDEN_FILES_PROPERTY] = g_param_spec_boolean ("show-hidden-files", "show-hidden-files", "show-hidden-files", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FILES_PREFERENCES_SHOW_FILE_PREVIEW_PROPERTY, files_preferences_properties[FILES_PREFERENCES_SHOW_FILE_PREVIEW_PROPERTY] = g_param_spec_boolean ("show-file-preview", "show-file-preview", "show-file-preview", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FILES_PREFERENCES_CONFIRM_TRASH_PROPERTY, files_preferences_properties[FILES_PREFERENCES_CONFIRM_TRASH_PROPERTY] = g_param_spec_boolean ("confirm-trash", "confirm-trash", "confirm-trash", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FILES_PREFERENCES_REMEMBER_HISTORY_PROPERTY, files_preferences_properties[FILES_PREFERENCES_REMEMBER_HISTORY_PROPERTY] = g_param_spec_boolean ("remember-history", "remember-history", "remember-history", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FILES_PREFERENCES_DATE_FORMAT_PROPERTY, files_preferences_properties[FILES_PREFERENCES_DATE_FORMAT_PROPERTY] = g_param_spec_enum ("date-format", "date-format", "date-format", FILES_TYPE_DATE_FORMAT_MODE, FILES_DATE_FORMAT_MODE_ISO, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FILES_PREFERENCES_CLOCK_FORMAT_PROPERTY, files_preferences_properties[FILES_PREFERENCES_CLOCK_FORMAT_PROPERTY] = g_param_spec_string ("clock-format", "clock-format", "clock-format", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
files_preferences_instance_init (FilesPreferences * self,
                                 gpointer klass)
{
	gchar* _tmp0_;
	self->priv = files_preferences_get_instance_private (self);
	self->priv->_show_hidden_files = FALSE;
	self->priv->_show_file_preview = TRUE;
	self->priv->_confirm_trash = TRUE;
	self->priv->_remember_history = TRUE;
	self->priv->_date_format = FILES_DATE_FORMAT_MODE_ISO;
	_tmp0_ = g_strdup ("24h");
	self->priv->_clock_format = _tmp0_;
}

static void
files_preferences_finalize (GObject * obj)
{
	FilesPreferences * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FILES_TYPE_PREFERENCES, FilesPreferences);
	_g_free0 (self->priv->_clock_format);
	G_OBJECT_CLASS (files_preferences_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
files_preferences_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FilesPreferencesClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) files_preferences_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FilesPreferences), 0, (GInstanceInitFunc) files_preferences_instance_init, NULL };
	GType files_preferences_type_id;
	files_preferences_type_id = g_type_register_static (G_TYPE_OBJECT, "FilesPreferences", &g_define_type_info, 0);
	FilesPreferences_private_offset = g_type_add_instance_private (files_preferences_type_id, sizeof (FilesPreferencesPrivate));
	return files_preferences_type_id;
}

GType
files_preferences_get_type (void)
{
	static volatile gsize files_preferences_type_id__once = 0;
	if (g_once_init_enter (&files_preferences_type_id__once)) {
		GType files_preferences_type_id;
		files_preferences_type_id = files_preferences_get_type_once ();
		g_once_init_leave (&files_preferences_type_id__once, files_preferences_type_id);
	}
	return files_preferences_type_id__once;
}

static void
_vala_files_preferences_get_property (GObject * object,
                                      guint property_id,
                                      GValue * value,
                                      GParamSpec * pspec)
{
	FilesPreferences * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FILES_TYPE_PREFERENCES, FilesPreferences);
	switch (property_id) {
		case FILES_PREFERENCES_SHOW_HIDDEN_FILES_PROPERTY:
		g_value_set_boolean (value, files_preferences_get_show_hidden_files (self));
		break;
		case FILES_PREFERENCES_SHOW_FILE_PREVIEW_PROPERTY:
		g_value_set_boolean (value, files_preferences_get_show_file_preview (self));
		break;
		case FILES_PREFERENCES_CONFIRM_TRASH_PROPERTY:
		g_value_set_boolean (value, files_preferences_get_confirm_trash (self));
		break;
		case FILES_PREFERENCES_REMEMBER_HISTORY_PROPERTY:
		g_value_set_boolean (value, files_preferences_get_remember_history (self));
		break;
		case FILES_PREFERENCES_DATE_FORMAT_PROPERTY:
		g_value_set_enum (value, files_preferences_get_date_format (self));
		break;
		case FILES_PREFERENCES_CLOCK_FORMAT_PROPERTY:
		g_value_set_string (value, files_preferences_get_clock_format (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_files_preferences_set_property (GObject * object,
                                      guint property_id,
                                      const GValue * value,
                                      GParamSpec * pspec)
{
	FilesPreferences * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FILES_TYPE_PREFERENCES, FilesPreferences);
	switch (property_id) {
		case FILES_PREFERENCES_SHOW_HIDDEN_FILES_PROPERTY:
		files_preferences_set_show_hidden_files (self, g_value_get_boolean (value));
		break;
		case FILES_PREFERENCES_SHOW_FILE_PREVIEW_PROPERTY:
		files_preferences_set_show_file_preview (self, g_value_get_boolean (value));
		break;
		case FILES_PREFERENCES_CONFIRM_TRASH_PROPERTY:
		files_preferences_set_confirm_trash (self, g_value_get_boolean (value));
		break;
		case FILES_PREFERENCES_REMEMBER_HISTORY_PROPERTY:
		files_preferences_set_remember_history (self, g_value_get_boolean (value));
		break;
		case FILES_PREFERENCES_DATE_FORMAT_PROPERTY:
		files_preferences_set_date_format (self, g_value_get_enum (value));
		break;
		case FILES_PREFERENCES_CLOCK_FORMAT_PROPERTY:
		files_preferences_set_clock_format (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

