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

#include <glib-object.h>
#include <glib.h>
#include "libdino.h"
#include <stdlib.h>
#include <string.h>
#include "qlite.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 DINO_UI_TYPE_CONFIG (dino_ui_config_get_type ())
#define DINO_UI_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_CONFIG, DinoUiConfig))
#define DINO_UI_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_CONFIG, DinoUiConfigClass))
#define DINO_UI_IS_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_CONFIG))
#define DINO_UI_IS_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_CONFIG))
#define DINO_UI_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_CONFIG, DinoUiConfigClass))

typedef struct _DinoUiConfig DinoUiConfig;
typedef struct _DinoUiConfigClass DinoUiConfigClass;
typedef struct _DinoUiConfigPrivate DinoUiConfigPrivate;
enum  {
	DINO_UI_CONFIG_0_PROPERTY,
	DINO_UI_CONFIG_DB_PROPERTY,
	DINO_UI_CONFIG_WINDOW_MAXIMIZE_PROPERTY,
	DINO_UI_CONFIG_WINDOW_HEIGHT_PROPERTY,
	DINO_UI_CONFIG_WINDOW_WIDTH_PROPERTY,
	DINO_UI_CONFIG_NUM_PROPERTIES
};
static GParamSpec* dino_ui_config_properties[DINO_UI_CONFIG_NUM_PROPERTIES];
#define _qlite_database_unref0(var) ((var == NULL) ? NULL : (var = (qlite_database_unref (var), NULL)))
#define _qlite_statement_builder_unref0(var) ((var == NULL) ? NULL : (var = (qlite_statement_builder_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

struct _DinoUiConfig {
	GObject parent_instance;
	DinoUiConfigPrivate * priv;
	gint window_height_;
	gint window_width_;
};

struct _DinoUiConfigClass {
	GObjectClass parent_class;
};

struct _DinoUiConfigPrivate {
	DinoDatabase* _db;
	gboolean window_maximize_;
};

static gint DinoUiConfig_private_offset;
static gpointer dino_ui_config_parent_class = NULL;

VALA_EXTERN GType dino_ui_config_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiConfig, g_object_unref)
VALA_EXTERN DinoUiConfig* dino_ui_config_new (DinoDatabase* db);
VALA_EXTERN DinoUiConfig* dino_ui_config_construct (GType object_type,
                                        DinoDatabase* db);
static void dino_ui_config_set_db (DinoUiConfig* self,
                            DinoDatabase* value);
static gboolean dino_ui_config_col_to_bool_or_default (DinoUiConfig* self,
                                                const gchar* key,
                                                gboolean def);
VALA_EXTERN void dino_ui_config_set_window_maximize (DinoUiConfig* self,
                                         gboolean value);
static gint dino_ui_config_col_to_int_or_default (DinoUiConfig* self,
                                           const gchar* key,
                                           gint def);
VALA_EXTERN void dino_ui_config_set_window_width (DinoUiConfig* self,
                                      gint value);
VALA_EXTERN void dino_ui_config_set_window_height (DinoUiConfig* self,
                                       gint value);
VALA_EXTERN DinoDatabase* dino_ui_config_get_db (DinoUiConfig* self);
VALA_EXTERN gboolean dino_ui_config_get_window_maximize (DinoUiConfig* self);
VALA_EXTERN gint dino_ui_config_get_window_height (DinoUiConfig* self);
VALA_EXTERN gint dino_ui_config_get_window_width (DinoUiConfig* self);
static void dino_ui_config_finalize (GObject * obj);
static GType dino_ui_config_get_type_once (void);
static void _vala_dino_ui_config_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec);
static void _vala_dino_ui_config_set_property (GObject * object,
                                        guint property_id,
                                        const GValue * value,
                                        GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
dino_ui_config_get_instance_private (DinoUiConfig* self)
{
	return G_STRUCT_MEMBER_P (self, DinoUiConfig_private_offset);
}

DinoUiConfig*
dino_ui_config_construct (GType object_type,
                          DinoDatabase* db)
{
	DinoUiConfig * self = NULL;
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoUiConfig*) g_object_new (object_type, NULL);
	dino_ui_config_set_db (self, db);
	dino_ui_config_set_window_maximize (self, dino_ui_config_col_to_bool_or_default (self, "window_maximized", FALSE));
	dino_ui_config_set_window_width (self, dino_ui_config_col_to_int_or_default (self, "window_width", 1200));
	dino_ui_config_set_window_height (self, dino_ui_config_col_to_int_or_default (self, "window_height", 700));
	return self;
}

DinoUiConfig*
dino_ui_config_new (DinoDatabase* db)
{
	return dino_ui_config_construct (DINO_UI_TYPE_CONFIG, db);
}

static gpointer
_qlite_column_ref0 (gpointer self)
{
	return self ? qlite_column_ref (self) : NULL;
}

static gboolean
bool_parse (const gchar* str)
{
	gboolean result;
	g_return_val_if_fail (str != NULL, FALSE);
	if (g_strcmp0 (str, "true") == 0) {
		result = TRUE;
		return result;
	} else {
		result = FALSE;
		return result;
	}
}

static gboolean
dino_ui_config_col_to_bool_or_default (DinoUiConfig* self,
                                       const gchar* key,
                                       gboolean def)
{
	gchar* val = NULL;
	DinoDatabase* _tmp0_;
	DinoDatabaseSettingsTable* _tmp1_;
	DinoDatabaseSettingsTable* _tmp2_;
	DinoDatabase* _tmp3_;
	DinoDatabaseSettingsTable* _tmp4_;
	DinoDatabaseSettingsTable* _tmp5_;
	QliteColumn* _tmp6_;
	QliteColumn* _tmp7_;
	QliteColumn** _tmp8_;
	QliteColumn** _tmp9_;
	gint _tmp9__length1;
	QliteQueryBuilder* _tmp10_;
	QliteQueryBuilder* _tmp11_;
	DinoDatabase* _tmp12_;
	DinoDatabaseSettingsTable* _tmp13_;
	DinoDatabaseSettingsTable* _tmp14_;
	QliteColumn* _tmp15_;
	QliteQueryBuilder* _tmp16_;
	QliteQueryBuilder* _tmp17_;
	DinoDatabase* _tmp18_;
	DinoDatabaseSettingsTable* _tmp19_;
	DinoDatabaseSettingsTable* _tmp20_;
	QliteColumn* _tmp21_;
	gpointer _tmp22_;
	gchar* _tmp23_;
	gboolean _tmp24_ = FALSE;
	const gchar* _tmp25_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (key != NULL, FALSE);
	_tmp0_ = self->priv->_db;
	_tmp1_ = dino_database_get_settings (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->_db;
	_tmp4_ = dino_database_get_settings (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = _tmp5_->value;
	_tmp7_ = _qlite_column_ref0 (_tmp6_);
	_tmp8_ = g_new0 (QliteColumn*, 1 + 1);
	_tmp8_[0] = _tmp7_;
	_tmp9_ = _tmp8_;
	_tmp9__length1 = 1;
	_tmp10_ = qlite_table_select ((QliteTable*) _tmp2_, _tmp9_, (gint) 1);
	_tmp11_ = _tmp10_;
	_tmp12_ = self->priv->_db;
	_tmp13_ = dino_database_get_settings (_tmp12_);
	_tmp14_ = _tmp13_;
	_tmp15_ = _tmp14_->key;
	_tmp16_ = qlite_query_builder_with (_tmp11_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp15_, "=", key);
	_tmp17_ = _tmp16_;
	_tmp18_ = self->priv->_db;
	_tmp19_ = dino_database_get_settings (_tmp18_);
	_tmp20_ = _tmp19_;
	_tmp21_ = _tmp20_->value;
	_tmp22_ = qlite_query_builder_get (_tmp17_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp21_, NULL);
	_tmp23_ = (gchar*) _tmp22_;
	_qlite_statement_builder_unref0 (_tmp17_);
	_qlite_statement_builder_unref0 (_tmp11_);
	_tmp9_ = (_vala_array_free (_tmp9_, _tmp9__length1, (GDestroyNotify) qlite_column_unref), NULL);
	val = _tmp23_;
	_tmp25_ = val;
	if (_tmp25_ != NULL) {
		const gchar* _tmp26_;
		_tmp26_ = val;
		_tmp24_ = bool_parse (_tmp26_);
	} else {
		_tmp24_ = def;
	}
	result = _tmp24_;
	_g_free0 (val);
	return result;
}

static gint
dino_ui_config_col_to_int_or_default (DinoUiConfig* self,
                                      const gchar* key,
                                      gint def)
{
	gchar* val = NULL;
	DinoDatabase* _tmp0_;
	DinoDatabaseSettingsTable* _tmp1_;
	DinoDatabaseSettingsTable* _tmp2_;
	DinoDatabase* _tmp3_;
	DinoDatabaseSettingsTable* _tmp4_;
	DinoDatabaseSettingsTable* _tmp5_;
	QliteColumn* _tmp6_;
	QliteColumn* _tmp7_;
	QliteColumn** _tmp8_;
	QliteColumn** _tmp9_;
	gint _tmp9__length1;
	QliteQueryBuilder* _tmp10_;
	QliteQueryBuilder* _tmp11_;
	DinoDatabase* _tmp12_;
	DinoDatabaseSettingsTable* _tmp13_;
	DinoDatabaseSettingsTable* _tmp14_;
	QliteColumn* _tmp15_;
	QliteQueryBuilder* _tmp16_;
	QliteQueryBuilder* _tmp17_;
	DinoDatabase* _tmp18_;
	DinoDatabaseSettingsTable* _tmp19_;
	DinoDatabaseSettingsTable* _tmp20_;
	QliteColumn* _tmp21_;
	gpointer _tmp22_;
	gchar* _tmp23_;
	gint _tmp24_ = 0;
	const gchar* _tmp25_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	g_return_val_if_fail (key != NULL, -1);
	_tmp0_ = self->priv->_db;
	_tmp1_ = dino_database_get_settings (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->_db;
	_tmp4_ = dino_database_get_settings (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = _tmp5_->value;
	_tmp7_ = _qlite_column_ref0 (_tmp6_);
	_tmp8_ = g_new0 (QliteColumn*, 1 + 1);
	_tmp8_[0] = _tmp7_;
	_tmp9_ = _tmp8_;
	_tmp9__length1 = 1;
	_tmp10_ = qlite_table_select ((QliteTable*) _tmp2_, _tmp9_, (gint) 1);
	_tmp11_ = _tmp10_;
	_tmp12_ = self->priv->_db;
	_tmp13_ = dino_database_get_settings (_tmp12_);
	_tmp14_ = _tmp13_;
	_tmp15_ = _tmp14_->key;
	_tmp16_ = qlite_query_builder_with (_tmp11_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp15_, "=", key);
	_tmp17_ = _tmp16_;
	_tmp18_ = self->priv->_db;
	_tmp19_ = dino_database_get_settings (_tmp18_);
	_tmp20_ = _tmp19_;
	_tmp21_ = _tmp20_->value;
	_tmp22_ = qlite_query_builder_get (_tmp17_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp21_, NULL);
	_tmp23_ = (gchar*) _tmp22_;
	_qlite_statement_builder_unref0 (_tmp17_);
	_qlite_statement_builder_unref0 (_tmp11_);
	_tmp9_ = (_vala_array_free (_tmp9_, _tmp9__length1, (GDestroyNotify) qlite_column_unref), NULL);
	val = _tmp23_;
	_tmp25_ = val;
	if (_tmp25_ != NULL) {
		const gchar* _tmp26_;
		_tmp26_ = val;
		_tmp24_ = atoi (_tmp26_);
	} else {
		_tmp24_ = def;
	}
	result = _tmp24_;
	_g_free0 (val);
	return result;
}

DinoDatabase*
dino_ui_config_get_db (DinoUiConfig* self)
{
	DinoDatabase* result;
	DinoDatabase* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_db;
	result = _tmp0_;
	return result;
}

static gpointer
_qlite_database_ref0 (gpointer self)
{
	return self ? qlite_database_ref (self) : NULL;
}

static void
dino_ui_config_set_db (DinoUiConfig* self,
                       DinoDatabase* value)
{
	DinoDatabase* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_ui_config_get_db (self);
	if (old_value != value) {
		DinoDatabase* _tmp0_;
		_tmp0_ = _qlite_database_ref0 (value);
		_qlite_database_unref0 (self->priv->_db);
		self->priv->_db = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_ui_config_properties[DINO_UI_CONFIG_DB_PROPERTY]);
	}
}

gboolean
dino_ui_config_get_window_maximize (DinoUiConfig* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->window_maximize_;
	return result;
}

static gchar*
bool_to_string (gboolean self)
{
	gchar* result;
	if (self) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup ("true");
		result = _tmp0_;
		return result;
	} else {
		gchar* _tmp1_;
		_tmp1_ = g_strdup ("false");
		result = _tmp1_;
		return result;
	}
}

void
dino_ui_config_set_window_maximize (DinoUiConfig* self,
                                    gboolean value)
{
	DinoDatabase* _tmp0_;
	DinoDatabaseSettingsTable* _tmp1_;
	DinoDatabaseSettingsTable* _tmp2_;
	QliteUpsertBuilder* _tmp3_;
	QliteUpsertBuilder* _tmp4_;
	DinoDatabase* _tmp5_;
	DinoDatabaseSettingsTable* _tmp6_;
	DinoDatabaseSettingsTable* _tmp7_;
	QliteColumn* _tmp8_;
	QliteUpsertBuilder* _tmp9_;
	QliteUpsertBuilder* _tmp10_;
	DinoDatabase* _tmp11_;
	DinoDatabaseSettingsTable* _tmp12_;
	DinoDatabaseSettingsTable* _tmp13_;
	QliteColumn* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	QliteUpsertBuilder* _tmp17_;
	QliteUpsertBuilder* _tmp18_;
	g_return_if_fail (self != NULL);
	if (value == self->priv->window_maximize_) {
		return;
	}
	_tmp0_ = self->priv->_db;
	_tmp1_ = dino_database_get_settings (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = qlite_table_upsert ((QliteTable*) _tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = self->priv->_db;
	_tmp6_ = dino_database_get_settings (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = _tmp7_->key;
	_tmp9_ = qlite_upsert_builder_value (_tmp4_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp8_, "window_maximized", TRUE);
	_tmp10_ = _tmp9_;
	_tmp11_ = self->priv->_db;
	_tmp12_ = dino_database_get_settings (_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = _tmp13_->value;
	_tmp15_ = bool_to_string (value);
	_tmp16_ = _tmp15_;
	_tmp17_ = qlite_upsert_builder_value (_tmp10_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp14_, _tmp16_, FALSE);
	_tmp18_ = _tmp17_;
	qlite_upsert_builder_perform (_tmp18_);
	_qlite_statement_builder_unref0 (_tmp18_);
	_g_free0 (_tmp16_);
	_qlite_statement_builder_unref0 (_tmp10_);
	_qlite_statement_builder_unref0 (_tmp4_);
	self->priv->window_maximize_ = value;
	g_object_notify_by_pspec ((GObject *) self, dino_ui_config_properties[DINO_UI_CONFIG_WINDOW_MAXIMIZE_PROPERTY]);
}

gint
dino_ui_config_get_window_height (DinoUiConfig* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->window_height_;
	return result;
}

void
dino_ui_config_set_window_height (DinoUiConfig* self,
                                  gint value)
{
	DinoDatabase* _tmp0_;
	DinoDatabaseSettingsTable* _tmp1_;
	DinoDatabaseSettingsTable* _tmp2_;
	QliteUpsertBuilder* _tmp3_;
	QliteUpsertBuilder* _tmp4_;
	DinoDatabase* _tmp5_;
	DinoDatabaseSettingsTable* _tmp6_;
	DinoDatabaseSettingsTable* _tmp7_;
	QliteColumn* _tmp8_;
	QliteUpsertBuilder* _tmp9_;
	QliteUpsertBuilder* _tmp10_;
	DinoDatabase* _tmp11_;
	DinoDatabaseSettingsTable* _tmp12_;
	DinoDatabaseSettingsTable* _tmp13_;
	QliteColumn* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	QliteUpsertBuilder* _tmp17_;
	QliteUpsertBuilder* _tmp18_;
	g_return_if_fail (self != NULL);
	if (value == self->window_height_) {
		return;
	}
	_tmp0_ = self->priv->_db;
	_tmp1_ = dino_database_get_settings (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = qlite_table_upsert ((QliteTable*) _tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = self->priv->_db;
	_tmp6_ = dino_database_get_settings (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = _tmp7_->key;
	_tmp9_ = qlite_upsert_builder_value (_tmp4_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp8_, "window_height", TRUE);
	_tmp10_ = _tmp9_;
	_tmp11_ = self->priv->_db;
	_tmp12_ = dino_database_get_settings (_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = _tmp13_->value;
	_tmp15_ = g_strdup_printf ("%i", value);
	_tmp16_ = _tmp15_;
	_tmp17_ = qlite_upsert_builder_value (_tmp10_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp14_, _tmp16_, FALSE);
	_tmp18_ = _tmp17_;
	qlite_upsert_builder_perform (_tmp18_);
	_qlite_statement_builder_unref0 (_tmp18_);
	_g_free0 (_tmp16_);
	_qlite_statement_builder_unref0 (_tmp10_);
	_qlite_statement_builder_unref0 (_tmp4_);
	self->window_height_ = value;
	g_object_notify_by_pspec ((GObject *) self, dino_ui_config_properties[DINO_UI_CONFIG_WINDOW_HEIGHT_PROPERTY]);
}

gint
dino_ui_config_get_window_width (DinoUiConfig* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->window_width_;
	return result;
}

void
dino_ui_config_set_window_width (DinoUiConfig* self,
                                 gint value)
{
	DinoDatabase* _tmp0_;
	DinoDatabaseSettingsTable* _tmp1_;
	DinoDatabaseSettingsTable* _tmp2_;
	QliteUpsertBuilder* _tmp3_;
	QliteUpsertBuilder* _tmp4_;
	DinoDatabase* _tmp5_;
	DinoDatabaseSettingsTable* _tmp6_;
	DinoDatabaseSettingsTable* _tmp7_;
	QliteColumn* _tmp8_;
	QliteUpsertBuilder* _tmp9_;
	QliteUpsertBuilder* _tmp10_;
	DinoDatabase* _tmp11_;
	DinoDatabaseSettingsTable* _tmp12_;
	DinoDatabaseSettingsTable* _tmp13_;
	QliteColumn* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	QliteUpsertBuilder* _tmp17_;
	QliteUpsertBuilder* _tmp18_;
	g_return_if_fail (self != NULL);
	if (value == self->window_width_) {
		return;
	}
	_tmp0_ = self->priv->_db;
	_tmp1_ = dino_database_get_settings (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = qlite_table_upsert ((QliteTable*) _tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = self->priv->_db;
	_tmp6_ = dino_database_get_settings (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = _tmp7_->key;
	_tmp9_ = qlite_upsert_builder_value (_tmp4_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp8_, "window_width", TRUE);
	_tmp10_ = _tmp9_;
	_tmp11_ = self->priv->_db;
	_tmp12_ = dino_database_get_settings (_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = _tmp13_->value;
	_tmp15_ = g_strdup_printf ("%i", value);
	_tmp16_ = _tmp15_;
	_tmp17_ = qlite_upsert_builder_value (_tmp10_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp14_, _tmp16_, FALSE);
	_tmp18_ = _tmp17_;
	qlite_upsert_builder_perform (_tmp18_);
	_qlite_statement_builder_unref0 (_tmp18_);
	_g_free0 (_tmp16_);
	_qlite_statement_builder_unref0 (_tmp10_);
	_qlite_statement_builder_unref0 (_tmp4_);
	self->window_width_ = value;
	g_object_notify_by_pspec ((GObject *) self, dino_ui_config_properties[DINO_UI_CONFIG_WINDOW_WIDTH_PROPERTY]);
}

static void
dino_ui_config_class_init (DinoUiConfigClass * klass,
                           gpointer klass_data)
{
	dino_ui_config_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoUiConfig_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_ui_config_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dino_ui_config_set_property;
	G_OBJECT_CLASS (klass)->finalize = dino_ui_config_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_CONFIG_DB_PROPERTY, dino_ui_config_properties[DINO_UI_CONFIG_DB_PROPERTY] = qlite_param_spec_database ("db", "db", "db", DINO_TYPE_DATABASE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_CONFIG_WINDOW_MAXIMIZE_PROPERTY, dino_ui_config_properties[DINO_UI_CONFIG_WINDOW_MAXIMIZE_PROPERTY] = g_param_spec_boolean ("window-maximize", "window-maximize", "window-maximize", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_CONFIG_WINDOW_HEIGHT_PROPERTY, dino_ui_config_properties[DINO_UI_CONFIG_WINDOW_HEIGHT_PROPERTY] = g_param_spec_int ("window-height", "window-height", "window-height", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_CONFIG_WINDOW_WIDTH_PROPERTY, dino_ui_config_properties[DINO_UI_CONFIG_WINDOW_WIDTH_PROPERTY] = g_param_spec_int ("window-width", "window-width", "window-width", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
dino_ui_config_instance_init (DinoUiConfig * self,
                              gpointer klass)
{
	self->priv = dino_ui_config_get_instance_private (self);
}

static void
dino_ui_config_finalize (GObject * obj)
{
	DinoUiConfig * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_TYPE_CONFIG, DinoUiConfig);
	_qlite_database_unref0 (self->priv->_db);
	G_OBJECT_CLASS (dino_ui_config_parent_class)->finalize (obj);
}

static GType
dino_ui_config_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiConfigClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_config_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiConfig), 0, (GInstanceInitFunc) dino_ui_config_instance_init, NULL };
	GType dino_ui_config_type_id;
	dino_ui_config_type_id = g_type_register_static (G_TYPE_OBJECT, "DinoUiConfig", &g_define_type_info, 0);
	DinoUiConfig_private_offset = g_type_add_instance_private (dino_ui_config_type_id, sizeof (DinoUiConfigPrivate));
	return dino_ui_config_type_id;
}

GType
dino_ui_config_get_type (void)
{
	static volatile gsize dino_ui_config_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_config_type_id__once)) {
		GType dino_ui_config_type_id;
		dino_ui_config_type_id = dino_ui_config_get_type_once ();
		g_once_init_leave (&dino_ui_config_type_id__once, dino_ui_config_type_id);
	}
	return dino_ui_config_type_id__once;
}

static void
_vala_dino_ui_config_get_property (GObject * object,
                                   guint property_id,
                                   GValue * value,
                                   GParamSpec * pspec)
{
	DinoUiConfig * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_UI_TYPE_CONFIG, DinoUiConfig);
	switch (property_id) {
		case DINO_UI_CONFIG_DB_PROPERTY:
		qlite_value_set_database (value, dino_ui_config_get_db (self));
		break;
		case DINO_UI_CONFIG_WINDOW_MAXIMIZE_PROPERTY:
		g_value_set_boolean (value, dino_ui_config_get_window_maximize (self));
		break;
		case DINO_UI_CONFIG_WINDOW_HEIGHT_PROPERTY:
		g_value_set_int (value, dino_ui_config_get_window_height (self));
		break;
		case DINO_UI_CONFIG_WINDOW_WIDTH_PROPERTY:
		g_value_set_int (value, dino_ui_config_get_window_width (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dino_ui_config_set_property (GObject * object,
                                   guint property_id,
                                   const GValue * value,
                                   GParamSpec * pspec)
{
	DinoUiConfig * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_UI_TYPE_CONFIG, DinoUiConfig);
	switch (property_id) {
		case DINO_UI_CONFIG_DB_PROPERTY:
		dino_ui_config_set_db (self, qlite_value_get_database (value));
		break;
		case DINO_UI_CONFIG_WINDOW_MAXIMIZE_PROPERTY:
		dino_ui_config_set_window_maximize (self, g_value_get_boolean (value));
		break;
		case DINO_UI_CONFIG_WINDOW_HEIGHT_PROPERTY:
		dino_ui_config_set_window_height (self, g_value_get_int (value));
		break;
		case DINO_UI_CONFIG_WINDOW_WIDTH_PROPERTY:
		dino_ui_config_set_window_width (self, g_value_get_int (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

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;
}

