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

/* This file is part of Elastic. License: GPL-3.0+.*/

#include <adwaita.h>
#include <glib-object.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#include <float.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>

#define ELASTIC_PROPERTIES_VIEW_MIN_DAMPING_RATIO 0.01
#define ELASTIC_PROPERTIES_VIEW_MAX_DAMPING_RATIO 1.5
#define ELASTIC_PROPERTIES_VIEW_DEFAULT_DAMPING_RATIO 0.5
#define ELASTIC_PROPERTIES_VIEW_CRIT_DAMPING_RATIO 1.0
#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 ELASTIC_TYPE_PROPERTIES_VIEW (elastic_properties_view_get_type ())
#define ELASTIC_PROPERTIES_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ELASTIC_TYPE_PROPERTIES_VIEW, ElasticPropertiesView))
#define ELASTIC_PROPERTIES_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ELASTIC_TYPE_PROPERTIES_VIEW, ElasticPropertiesViewClass))
#define ELASTIC_IS_PROPERTIES_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ELASTIC_TYPE_PROPERTIES_VIEW))
#define ELASTIC_IS_PROPERTIES_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ELASTIC_TYPE_PROPERTIES_VIEW))
#define ELASTIC_PROPERTIES_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ELASTIC_TYPE_PROPERTIES_VIEW, ElasticPropertiesViewClass))

typedef struct _ElasticPropertiesView ElasticPropertiesView;
typedef struct _ElasticPropertiesViewClass ElasticPropertiesViewClass;
typedef struct _ElasticPropertiesViewPrivate ElasticPropertiesViewPrivate;

#define ELASTIC_TYPE_SPRING_PARAMS (elastic_spring_params_get_type ())
#define ELASTIC_SPRING_PARAMS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ELASTIC_TYPE_SPRING_PARAMS, ElasticSpringParams))
#define ELASTIC_SPRING_PARAMS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ELASTIC_TYPE_SPRING_PARAMS, ElasticSpringParamsClass))
#define ELASTIC_IS_SPRING_PARAMS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ELASTIC_TYPE_SPRING_PARAMS))
#define ELASTIC_IS_SPRING_PARAMS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ELASTIC_TYPE_SPRING_PARAMS))
#define ELASTIC_SPRING_PARAMS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ELASTIC_TYPE_SPRING_PARAMS, ElasticSpringParamsClass))

typedef struct _ElasticSpringParams ElasticSpringParams;
typedef struct _ElasticSpringParamsClass ElasticSpringParamsClass;

#define ELASTIC_TYPE_PROPERTY_ROW (elastic_property_row_get_type ())
#define ELASTIC_PROPERTY_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ELASTIC_TYPE_PROPERTY_ROW, ElasticPropertyRow))
#define ELASTIC_PROPERTY_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ELASTIC_TYPE_PROPERTY_ROW, ElasticPropertyRowClass))
#define ELASTIC_IS_PROPERTY_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ELASTIC_TYPE_PROPERTY_ROW))
#define ELASTIC_IS_PROPERTY_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ELASTIC_TYPE_PROPERTY_ROW))
#define ELASTIC_PROPERTY_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ELASTIC_TYPE_PROPERTY_ROW, ElasticPropertyRowClass))

typedef struct _ElasticPropertyRow ElasticPropertyRow;
typedef struct _ElasticPropertyRowClass ElasticPropertyRowClass;
enum  {
	ELASTIC_PROPERTIES_VIEW_0_PROPERTY,
	ELASTIC_PROPERTIES_VIEW_SPRING_PROPERTY,
	ELASTIC_PROPERTIES_VIEW_USE_DAMPING_PROPERTY,
	ELASTIC_PROPERTIES_VIEW_COMPACT_PROPERTY,
	ELASTIC_PROPERTIES_VIEW_NUM_PROPERTIES
};
static GParamSpec* elastic_properties_view_properties[ELASTIC_PROPERTIES_VIEW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _ElasticPropertiesView {
	AdwBin parent_instance;
	ElasticPropertiesViewPrivate * priv;
};

struct _ElasticPropertiesViewClass {
	AdwBinClass parent_class;
};

struct _ElasticPropertiesViewPrivate {
	ElasticSpringParams* _spring;
	gboolean _use_damping;
	gboolean _compact;
	AdwMultiLayoutView* multi_layout_view;
	GtkStack* damping_stack;
	ElasticPropertyRow* damping_row;
	ElasticPropertyRow* damping_ratio_row;
	ElasticPropertyRow* mass_row;
	ElasticPropertyRow* stiffness_row;
	ElasticPropertyRow* epsilon_row;
	GBindingGroup* spring_bindings;
	GSettings* settings;
};

static gint ElasticPropertiesView_private_offset;
static gpointer elastic_properties_view_parent_class = NULL;

VALA_EXTERN GType elastic_properties_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ElasticPropertiesView, g_object_unref)
VALA_EXTERN GType elastic_spring_params_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ElasticSpringParams, g_object_unref)
VALA_EXTERN GType elastic_property_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ElasticPropertyRow, g_object_unref)
static void elastic_properties_view_sync_damping (ElasticPropertiesView* self);
VALA_EXTERN ElasticSpringParams* elastic_properties_view_get_spring (ElasticPropertiesView* self);
VALA_EXTERN gdouble elastic_spring_params_damping_for_damping_ratio (ElasticSpringParams* self,
                                                         gdouble damping_ratio);
VALA_EXTERN void elastic_property_row_set_lower (ElasticPropertyRow* self,
                                     gdouble value);
VALA_EXTERN void elastic_property_row_set_upper (ElasticPropertyRow* self,
                                     gdouble value);
VALA_EXTERN void elastic_property_row_set_mark (ElasticPropertyRow* self,
                                    gdouble value);
VALA_EXTERN void elastic_property_row_set_secondary_mark (ElasticPropertyRow* self,
                                              gdouble value);
VALA_EXTERN gdouble elastic_property_row_get_value (ElasticPropertyRow* self);
VALA_EXTERN gdouble elastic_property_row_get_lower (ElasticPropertyRow* self);
VALA_EXTERN gdouble elastic_property_row_get_upper (ElasticPropertyRow* self);
VALA_EXTERN void elastic_property_row_set_value (ElasticPropertyRow* self,
                                     gdouble value);
VALA_EXTERN ElasticPropertiesView* elastic_properties_view_new (void);
VALA_EXTERN ElasticPropertiesView* elastic_properties_view_construct (GType object_type);
VALA_EXTERN void elastic_properties_view_set_spring (ElasticPropertiesView* self,
                                         ElasticSpringParams* value);
static void _elastic_properties_view_sync_damping_g_object_notify (GObject* _sender,
                                                            GParamSpec* pspec,
                                                            gpointer self);
VALA_EXTERN gboolean elastic_properties_view_get_use_damping (ElasticPropertiesView* self);
VALA_EXTERN void elastic_properties_view_set_use_damping (ElasticPropertiesView* self,
                                              gboolean value);
VALA_EXTERN gboolean elastic_properties_view_get_compact (ElasticPropertiesView* self);
VALA_EXTERN void elastic_properties_view_set_compact (ElasticPropertiesView* self,
                                          gboolean value);
static GObject * elastic_properties_view_constructor (GType type,
                                               guint n_construct_properties,
                                               GObjectConstructParam * construct_properties);
static void _elastic_properties_view___lambda12_ (ElasticPropertiesView* self);
static void __elastic_properties_view___lambda12__g_object_notify (GObject* _sender,
                                                            GParamSpec* pspec,
                                                            gpointer self);
static void elastic_properties_view_finalize (GObject * obj);
static GType elastic_properties_view_get_type_once (void);
static void _vala_elastic_properties_view_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec);
static void _vala_elastic_properties_view_set_property (GObject * object,
                                                 guint property_id,
                                                 const GValue * value,
                                                 GParamSpec * pspec);

static inline gpointer
elastic_properties_view_get_instance_private (ElasticPropertiesView* self)
{
	return G_STRUCT_MEMBER_P (self, ElasticPropertiesView_private_offset);
}

static void
elastic_properties_view_sync_damping (ElasticPropertiesView* self)
{
	ElasticPropertyRow* _tmp0_;
	ElasticSpringParams* _tmp1_;
	ElasticSpringParams* _tmp2_;
	ElasticPropertyRow* _tmp3_;
	ElasticSpringParams* _tmp4_;
	ElasticSpringParams* _tmp5_;
	ElasticPropertyRow* _tmp6_;
	ElasticSpringParams* _tmp7_;
	ElasticSpringParams* _tmp8_;
	ElasticPropertyRow* _tmp9_;
	ElasticSpringParams* _tmp10_;
	ElasticSpringParams* _tmp11_;
	ElasticPropertyRow* _tmp12_;
	ElasticPropertyRow* _tmp13_;
	gdouble _tmp14_;
	gdouble _tmp15_;
	ElasticPropertyRow* _tmp16_;
	gdouble _tmp17_;
	gdouble _tmp18_;
	ElasticPropertyRow* _tmp19_;
	gdouble _tmp20_;
	gdouble _tmp21_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->damping_row;
	_tmp1_ = elastic_properties_view_get_spring (self);
	_tmp2_ = _tmp1_;
	elastic_property_row_set_lower (_tmp0_, elastic_spring_params_damping_for_damping_ratio (_tmp2_, ELASTIC_PROPERTIES_VIEW_MIN_DAMPING_RATIO));
	_tmp3_ = self->priv->damping_row;
	_tmp4_ = elastic_properties_view_get_spring (self);
	_tmp5_ = _tmp4_;
	elastic_property_row_set_upper (_tmp3_, elastic_spring_params_damping_for_damping_ratio (_tmp5_, ELASTIC_PROPERTIES_VIEW_MAX_DAMPING_RATIO));
	_tmp6_ = self->priv->damping_row;
	_tmp7_ = elastic_properties_view_get_spring (self);
	_tmp8_ = _tmp7_;
	elastic_property_row_set_mark (_tmp6_, elastic_spring_params_damping_for_damping_ratio (_tmp8_, ELASTIC_PROPERTIES_VIEW_DEFAULT_DAMPING_RATIO));
	_tmp9_ = self->priv->damping_row;
	_tmp10_ = elastic_properties_view_get_spring (self);
	_tmp11_ = _tmp10_;
	elastic_property_row_set_secondary_mark (_tmp9_, elastic_spring_params_damping_for_damping_ratio (_tmp11_, ELASTIC_PROPERTIES_VIEW_CRIT_DAMPING_RATIO));
	_tmp12_ = self->priv->damping_row;
	_tmp13_ = self->priv->damping_row;
	_tmp14_ = elastic_property_row_get_value (_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = self->priv->damping_row;
	_tmp17_ = elastic_property_row_get_lower (_tmp16_);
	_tmp18_ = _tmp17_;
	_tmp19_ = self->priv->damping_row;
	_tmp20_ = elastic_property_row_get_upper (_tmp19_);
	_tmp21_ = _tmp20_;
	elastic_property_row_set_value (_tmp12_, CLAMP (_tmp15_, _tmp18_, _tmp21_));
}

ElasticPropertiesView*
elastic_properties_view_construct (GType object_type)
{
	ElasticPropertiesView * self = NULL;
	self = (ElasticPropertiesView*) g_object_new (object_type, NULL);
	return self;
}

ElasticPropertiesView*
elastic_properties_view_new (void)
{
	return elastic_properties_view_construct (ELASTIC_TYPE_PROPERTIES_VIEW);
}

ElasticSpringParams*
elastic_properties_view_get_spring (ElasticPropertiesView* self)
{
	ElasticSpringParams* result;
	ElasticSpringParams* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_spring;
	result = _tmp0_;
	return result;
}

static void
_elastic_properties_view_sync_damping_g_object_notify (GObject* _sender,
                                                       GParamSpec* pspec,
                                                       gpointer self)
{
	elastic_properties_view_sync_damping ((ElasticPropertiesView*) self);
}

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

void
elastic_properties_view_set_spring (ElasticPropertiesView* self,
                                    ElasticSpringParams* value)
{
	ElasticSpringParams* _tmp0_;
	ElasticSpringParams* _tmp1_;
	ElasticSpringParams* _tmp2_;
	ElasticSpringParams* _tmp3_;
	ElasticSpringParams* _tmp8_;
	ElasticSpringParams* _tmp9_;
	ElasticSpringParams* _tmp10_;
	g_return_if_fail (self != NULL);
	_tmp0_ = elastic_properties_view_get_spring (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == value) {
		return;
	}
	_tmp2_ = elastic_properties_view_get_spring (self);
	_tmp3_ = _tmp2_;
	if (_tmp3_ != NULL) {
		ElasticSpringParams* _tmp4_;
		ElasticSpringParams* _tmp5_;
		guint _tmp6_;
		GQuark _tmp7_;
		_tmp4_ = elastic_properties_view_get_spring (self);
		_tmp5_ = _tmp4_;
		g_signal_parse_name ("notify::damping-ratio", G_TYPE_OBJECT, &_tmp6_, &_tmp7_, TRUE);
		g_signal_handlers_disconnect_matched ((GObject*) _tmp5_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp6_, _tmp7_, NULL, (GCallback) _elastic_properties_view_sync_damping_g_object_notify, self);
	}
	_tmp8_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_spring);
	self->priv->_spring = _tmp8_;
	_tmp9_ = elastic_properties_view_get_spring (self);
	_tmp10_ = _tmp9_;
	if (_tmp10_ != NULL) {
		ElasticSpringParams* _tmp11_;
		ElasticSpringParams* _tmp12_;
		_tmp11_ = elastic_properties_view_get_spring (self);
		_tmp12_ = _tmp11_;
		g_signal_connect_object ((GObject*) _tmp12_, "notify::damping-ratio", (GCallback) _elastic_properties_view_sync_damping_g_object_notify, self, 0);
	}
	elastic_properties_view_sync_damping (self);
	g_object_notify_by_pspec ((GObject *) self, elastic_properties_view_properties[ELASTIC_PROPERTIES_VIEW_SPRING_PROPERTY]);
}

gboolean
elastic_properties_view_get_use_damping (ElasticPropertiesView* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_use_damping;
	return result;
}

void
elastic_properties_view_set_use_damping (ElasticPropertiesView* self,
                                         gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = elastic_properties_view_get_use_damping (self);
	if (old_value != value) {
		self->priv->_use_damping = value;
		g_object_notify_by_pspec ((GObject *) self, elastic_properties_view_properties[ELASTIC_PROPERTIES_VIEW_USE_DAMPING_PROPERTY]);
	}
}

gboolean
elastic_properties_view_get_compact (ElasticPropertiesView* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_compact;
	return result;
}

void
elastic_properties_view_set_compact (ElasticPropertiesView* self,
                                     gboolean value)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	const gchar* _tmp2_ = NULL;
	gboolean _tmp3_;
	gboolean _tmp4_;
	AdwMultiLayoutView* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = elastic_properties_view_get_compact (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == value) {
		return;
	}
	self->priv->_compact = value;
	_tmp3_ = elastic_properties_view_get_compact (self);
	_tmp4_ = _tmp3_;
	if (_tmp4_) {
		_tmp2_ = "narrow";
	} else {
		_tmp2_ = "wide";
	}
	_tmp5_ = self->priv->multi_layout_view;
	adw_multi_layout_view_set_layout_name (_tmp5_, _tmp2_);
	g_object_notify_by_pspec ((GObject *) self, elastic_properties_view_properties[ELASTIC_PROPERTIES_VIEW_COMPACT_PROPERTY]);
}

static void
_elastic_properties_view___lambda12_ (ElasticPropertiesView* self)
{
	ElasticPropertyRow* _tmp0_ = NULL;
	gboolean _tmp1_;
	GtkStack* _tmp4_;
	_tmp1_ = self->priv->_use_damping;
	if (_tmp1_) {
		ElasticPropertyRow* _tmp2_;
		_tmp2_ = self->priv->damping_row;
		_tmp0_ = _tmp2_;
	} else {
		ElasticPropertyRow* _tmp3_;
		_tmp3_ = self->priv->damping_ratio_row;
		_tmp0_ = _tmp3_;
	}
	_tmp4_ = self->priv->damping_stack;
	gtk_stack_set_visible_child (_tmp4_, (GtkWidget*) _tmp0_);
}

static void
__elastic_properties_view___lambda12__g_object_notify (GObject* _sender,
                                                       GParamSpec* pspec,
                                                       gpointer self)
{
	_elastic_properties_view___lambda12_ ((ElasticPropertiesView*) self);
}

static GObject *
elastic_properties_view_constructor (GType type,
                                     guint n_construct_properties,
                                     GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ElasticPropertiesView * self;
	GSettings* _tmp0_;
	GSettings* _tmp1_;
	GBindingGroup* _tmp2_;
	GBindingGroup* _tmp3_;
	ElasticPropertyRow* _tmp4_;
	GBindingGroup* _tmp5_;
	ElasticPropertyRow* _tmp6_;
	GBindingGroup* _tmp7_;
	ElasticPropertyRow* _tmp8_;
	GBindingGroup* _tmp9_;
	ElasticPropertyRow* _tmp10_;
	GBindingGroup* _tmp11_;
	ElasticPropertyRow* _tmp12_;
	GBindingGroup* _tmp13_;
	ElasticPropertyRow* _tmp14_ = NULL;
	gboolean _tmp15_;
	GtkStack* _tmp18_;
	parent_class = G_OBJECT_CLASS (elastic_properties_view_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ELASTIC_TYPE_PROPERTIES_VIEW, ElasticPropertiesView);
	_tmp0_ = g_settings_new ("app.drey.Elastic");
	_g_object_unref0 (self->priv->settings);
	self->priv->settings = _tmp0_;
	_tmp1_ = self->priv->settings;
	g_settings_bind (_tmp1_, "use-damping", (GObject*) self, "use-damping", G_SETTINGS_BIND_GET);
	_tmp2_ = g_binding_group_new ();
	_g_object_unref0 (self->priv->spring_bindings);
	self->priv->spring_bindings = _tmp2_;
	_tmp3_ = self->priv->spring_bindings;
	_tmp4_ = self->priv->damping_row;
	g_binding_group_bind (_tmp3_, "damping", (GObject*) _tmp4_, "value", G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
	_tmp5_ = self->priv->spring_bindings;
	_tmp6_ = self->priv->damping_ratio_row;
	g_binding_group_bind (_tmp5_, "damping-ratio", (GObject*) _tmp6_, "value", G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
	_tmp7_ = self->priv->spring_bindings;
	_tmp8_ = self->priv->mass_row;
	g_binding_group_bind (_tmp7_, "mass", (GObject*) _tmp8_, "value", G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
	_tmp9_ = self->priv->spring_bindings;
	_tmp10_ = self->priv->stiffness_row;
	g_binding_group_bind (_tmp9_, "stiffness", (GObject*) _tmp10_, "value", G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
	_tmp11_ = self->priv->spring_bindings;
	_tmp12_ = self->priv->epsilon_row;
	g_binding_group_bind (_tmp11_, "epsilon", (GObject*) _tmp12_, "value", G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
	_tmp13_ = self->priv->spring_bindings;
	g_object_bind_property_with_closures ((GObject*) self, "spring", (GObject*) _tmp13_, "source", G_BINDING_DEFAULT, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	g_signal_connect_object ((GObject*) self, "notify::use-damping", (GCallback) __elastic_properties_view___lambda12__g_object_notify, self, 0);
	_tmp15_ = self->priv->_use_damping;
	if (_tmp15_) {
		ElasticPropertyRow* _tmp16_;
		_tmp16_ = self->priv->damping_row;
		_tmp14_ = _tmp16_;
	} else {
		ElasticPropertyRow* _tmp17_;
		_tmp17_ = self->priv->damping_ratio_row;
		_tmp14_ = _tmp17_;
	}
	_tmp18_ = self->priv->damping_stack;
	gtk_stack_set_visible_child (_tmp18_, (GtkWidget*) _tmp14_);
	return obj;
}

static void
elastic_properties_view_class_init (ElasticPropertiesViewClass * klass,
                                    gpointer klass_data)
{
	elastic_properties_view_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ElasticPropertiesView_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_elastic_properties_view_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_elastic_properties_view_set_property;
	G_OBJECT_CLASS (klass)->constructor = elastic_properties_view_constructor;
	G_OBJECT_CLASS (klass)->finalize = elastic_properties_view_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), ELASTIC_PROPERTIES_VIEW_SPRING_PROPERTY, elastic_properties_view_properties[ELASTIC_PROPERTIES_VIEW_SPRING_PROPERTY] = g_param_spec_object ("spring", "spring", "spring", ELASTIC_TYPE_SPRING_PARAMS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), ELASTIC_PROPERTIES_VIEW_USE_DAMPING_PROPERTY, elastic_properties_view_properties[ELASTIC_PROPERTIES_VIEW_USE_DAMPING_PROPERTY] = g_param_spec_boolean ("use-damping", "use-damping", "use-damping", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), ELASTIC_PROPERTIES_VIEW_COMPACT_PROPERTY, elastic_properties_view_properties[ELASTIC_PROPERTIES_VIEW_COMPACT_PROPERTY] = g_param_spec_boolean ("compact", "compact", "compact", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/app/drey/Elastic/properties-view.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "multi_layout_view", FALSE, ElasticPropertiesView_private_offset + G_STRUCT_OFFSET (ElasticPropertiesViewPrivate, multi_layout_view));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "damping_stack", FALSE, ElasticPropertiesView_private_offset + G_STRUCT_OFFSET (ElasticPropertiesViewPrivate, damping_stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "damping_row", FALSE, ElasticPropertiesView_private_offset + G_STRUCT_OFFSET (ElasticPropertiesViewPrivate, damping_row));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "damping_ratio_row", FALSE, ElasticPropertiesView_private_offset + G_STRUCT_OFFSET (ElasticPropertiesViewPrivate, damping_ratio_row));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "mass_row", FALSE, ElasticPropertiesView_private_offset + G_STRUCT_OFFSET (ElasticPropertiesViewPrivate, mass_row));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "stiffness_row", FALSE, ElasticPropertiesView_private_offset + G_STRUCT_OFFSET (ElasticPropertiesViewPrivate, stiffness_row));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "epsilon_row", FALSE, ElasticPropertiesView_private_offset + G_STRUCT_OFFSET (ElasticPropertiesViewPrivate, epsilon_row));
	gtk_widget_class_set_css_name (GTK_WIDGET_CLASS (klass), "properties-view");
}

static void
elastic_properties_view_instance_init (ElasticPropertiesView * self,
                                       gpointer klass)
{
	self->priv = elastic_properties_view_get_instance_private (self);
	g_type_ensure (ELASTIC_TYPE_PROPERTY_ROW);
	g_type_ensure (ELASTIC_TYPE_PROPERTY_ROW);
	g_type_ensure (ELASTIC_TYPE_PROPERTY_ROW);
	g_type_ensure (ELASTIC_TYPE_PROPERTY_ROW);
	g_type_ensure (ELASTIC_TYPE_PROPERTY_ROW);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
elastic_properties_view_finalize (GObject * obj)
{
	ElasticPropertiesView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ELASTIC_TYPE_PROPERTIES_VIEW, ElasticPropertiesView);
	_g_object_unref0 (self->priv->_spring);
	_g_object_unref0 (self->priv->spring_bindings);
	_g_object_unref0 (self->priv->settings);
	G_OBJECT_CLASS (elastic_properties_view_parent_class)->finalize (obj);
}

static GType
elastic_properties_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ElasticPropertiesViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) elastic_properties_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ElasticPropertiesView), 0, (GInstanceInitFunc) elastic_properties_view_instance_init, NULL };
	GType elastic_properties_view_type_id;
	elastic_properties_view_type_id = g_type_register_static (adw_bin_get_type (), "ElasticPropertiesView", &g_define_type_info, 0);
	ElasticPropertiesView_private_offset = g_type_add_instance_private (elastic_properties_view_type_id, sizeof (ElasticPropertiesViewPrivate));
	return elastic_properties_view_type_id;
}

GType
elastic_properties_view_get_type (void)
{
	static volatile gsize elastic_properties_view_type_id__once = 0;
	if (g_once_init_enter (&elastic_properties_view_type_id__once)) {
		GType elastic_properties_view_type_id;
		elastic_properties_view_type_id = elastic_properties_view_get_type_once ();
		g_once_init_leave (&elastic_properties_view_type_id__once, elastic_properties_view_type_id);
	}
	return elastic_properties_view_type_id__once;
}

static void
_vala_elastic_properties_view_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec)
{
	ElasticPropertiesView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, ELASTIC_TYPE_PROPERTIES_VIEW, ElasticPropertiesView);
	switch (property_id) {
		case ELASTIC_PROPERTIES_VIEW_SPRING_PROPERTY:
		g_value_set_object (value, elastic_properties_view_get_spring (self));
		break;
		case ELASTIC_PROPERTIES_VIEW_USE_DAMPING_PROPERTY:
		g_value_set_boolean (value, elastic_properties_view_get_use_damping (self));
		break;
		case ELASTIC_PROPERTIES_VIEW_COMPACT_PROPERTY:
		g_value_set_boolean (value, elastic_properties_view_get_compact (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_elastic_properties_view_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec)
{
	ElasticPropertiesView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, ELASTIC_TYPE_PROPERTIES_VIEW, ElasticPropertiesView);
	switch (property_id) {
		case ELASTIC_PROPERTIES_VIEW_SPRING_PROPERTY:
		elastic_properties_view_set_spring (self, g_value_get_object (value));
		break;
		case ELASTIC_PROPERTIES_VIEW_USE_DAMPING_PROPERTY:
		elastic_properties_view_set_use_damping (self, g_value_get_boolean (value));
		break;
		case ELASTIC_PROPERTIES_VIEW_COMPACT_PROPERTY:
		elastic_properties_view_set_compact (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

