/* gcalc-equation-manager.c generated by valac 0.56.0, the Vala compiler
 * generated from gcalc-equation-manager.vala, do not modify */

/* gcalc-equation-manager.vala
 *
 * Copyright (C) 2018  Daniel Espinosa <esodan@gmail.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
 *
 * Authors:
 *      Daniel Espinosa <esodan@gmail.com>
 */

#include "gcalc/gcalc.h"
#include <glib-object.h>
#include <gee.h>
#include "gcalc.h"

enum  {
	GCALC_EQUATION_MANAGER_0_PROPERTY,
	GCALC_EQUATION_MANAGER_EQUATIONS_PROPERTY,
	GCALC_EQUATION_MANAGER_FUNCTIONS_PROPERTY,
	GCALC_EQUATION_MANAGER_NUM_PROPERTIES
};
static GParamSpec* gcalc_equation_manager_properties[GCALC_EQUATION_MANAGER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _GCalcEquationManagerPrivate {
	GCalcExpressionContainer* _equations;
	GCalcExpressionContainer* _functions;
};

static gint GCalcEquationManager_private_offset;
static gpointer gcalc_equation_manager_parent_class = NULL;
static GCalcMathEquationManagerIface * gcalc_equation_manager_gcalc_math_equation_manager_parent_iface = NULL;

static GObject * gcalc_equation_manager_constructor (GType type,
                                              guint n_construct_properties,
                                              GObjectConstructParam * construct_properties);
static void gcalc_equation_manager_finalize (GObject * obj);
static GType gcalc_equation_manager_get_type_once (void);
static void _vala_gcalc_equation_manager_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec);

static inline gpointer
gcalc_equation_manager_get_instance_private (GCalcEquationManager* self)
{
	return G_STRUCT_MEMBER_P (self, GCalcEquationManager_private_offset);
}

GCalcEquationManager*
gcalc_equation_manager_construct (GType object_type)
{
	GCalcEquationManager * self = NULL;
	self = (GCalcEquationManager*) g_object_new (object_type, NULL);
	return self;
}

GCalcEquationManager*
gcalc_equation_manager_new (void)
{
	return gcalc_equation_manager_construct (GCALC_TYPE_EQUATION_MANAGER);
}

static GCalcExpressionContainer*
gcalc_equation_manager_real_get_equations (GCalcMathEquationManager* base)
{
	GCalcExpressionContainer* result;
	GCalcEquationManager* self;
	GCalcExpressionContainer* _tmp0_;
	self = (GCalcEquationManager*) base;
	_tmp0_ = self->priv->_equations;
	result = _tmp0_;
	return result;
}

static GCalcExpressionContainer*
gcalc_equation_manager_real_get_functions (GCalcMathEquationManager* base)
{
	GCalcExpressionContainer* result;
	GCalcEquationManager* self;
	GCalcExpressionContainer* _tmp0_;
	self = (GCalcEquationManager*) base;
	_tmp0_ = self->priv->_functions;
	result = _tmp0_;
	return result;
}

static GObject *
gcalc_equation_manager_constructor (GType type,
                                    guint n_construct_properties,
                                    GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GCalcEquationManager * self;
	GCalcExpressionContainer* _tmp0_;
	GCalcExpressionContainer* _tmp1_;
	GCalcFunctionSqrt* _tmp2_;
	GCalcFunctionSqrt* _tmp3_;
	GCalcExpressionContainer* _tmp4_;
	GCalcExpressionContainer* _tmp5_;
	GCalcFunctionExp* _tmp6_;
	GCalcFunctionExp* _tmp7_;
	GCalcExpressionContainer* _tmp8_;
	GCalcExpressionContainer* _tmp9_;
	GCalcFunctionLog* _tmp10_;
	GCalcFunctionLog* _tmp11_;
	GCalcExpressionContainer* _tmp12_;
	GCalcExpressionContainer* _tmp13_;
	GCalcFunctionSin* _tmp14_;
	GCalcFunctionSin* _tmp15_;
	GCalcExpressionContainer* _tmp16_;
	GCalcExpressionContainer* _tmp17_;
	GCalcFunctionCos* _tmp18_;
	GCalcFunctionCos* _tmp19_;
	GCalcExpressionContainer* _tmp20_;
	GCalcExpressionContainer* _tmp21_;
	GCalcFunctionTan* _tmp22_;
	GCalcFunctionTan* _tmp23_;
	GCalcExpressionContainer* _tmp24_;
	GCalcExpressionContainer* _tmp25_;
	GCalcFunctionAsin* _tmp26_;
	GCalcFunctionAsin* _tmp27_;
	GCalcExpressionContainer* _tmp28_;
	GCalcExpressionContainer* _tmp29_;
	GCalcFunctionAcos* _tmp30_;
	GCalcFunctionAcos* _tmp31_;
	GCalcExpressionContainer* _tmp32_;
	GCalcExpressionContainer* _tmp33_;
	GCalcFunctionAtan* _tmp34_;
	GCalcFunctionAtan* _tmp35_;
	GCalcExpressionContainer* _tmp36_;
	GCalcExpressionContainer* _tmp37_;
	GCalcFunctionSinh* _tmp38_;
	GCalcFunctionSinh* _tmp39_;
	GCalcExpressionContainer* _tmp40_;
	GCalcExpressionContainer* _tmp41_;
	GCalcFunctionCosh* _tmp42_;
	GCalcFunctionCosh* _tmp43_;
	GCalcExpressionContainer* _tmp44_;
	GCalcExpressionContainer* _tmp45_;
	GCalcFunctionTanh* _tmp46_;
	GCalcFunctionTanh* _tmp47_;
	GCalcExpressionContainer* _tmp48_;
	GCalcExpressionContainer* _tmp49_;
	GCalcFunctionAsinh* _tmp50_;
	GCalcFunctionAsinh* _tmp51_;
	GCalcExpressionContainer* _tmp52_;
	GCalcExpressionContainer* _tmp53_;
	GCalcFunctionAcosh* _tmp54_;
	GCalcFunctionAcosh* _tmp55_;
	GCalcExpressionContainer* _tmp56_;
	GCalcExpressionContainer* _tmp57_;
	GCalcFunctionAtanh* _tmp58_;
	GCalcFunctionAtanh* _tmp59_;
	parent_class = G_OBJECT_CLASS (gcalc_equation_manager_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GCALC_TYPE_EQUATION_MANAGER, GCalcEquationManager);
	_tmp0_ = gcalc_math_equation_manager_get_functions ((GCalcMathEquationManager*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = gcalc_function_sqrt_new ();
	_tmp3_ = _tmp2_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp1_, (GCalcMathExpression*) _tmp3_);
	_g_object_unref0 (_tmp3_);
	_tmp4_ = gcalc_math_equation_manager_get_functions ((GCalcMathEquationManager*) self);
	_tmp5_ = _tmp4_;
	_tmp6_ = gcalc_function_exp_new ();
	_tmp7_ = _tmp6_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp5_, (GCalcMathExpression*) _tmp7_);
	_g_object_unref0 (_tmp7_);
	_tmp8_ = gcalc_math_equation_manager_get_functions ((GCalcMathEquationManager*) self);
	_tmp9_ = _tmp8_;
	_tmp10_ = gcalc_function_log_new ();
	_tmp11_ = _tmp10_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp9_, (GCalcMathExpression*) _tmp11_);
	_g_object_unref0 (_tmp11_);
	_tmp12_ = gcalc_math_equation_manager_get_functions ((GCalcMathEquationManager*) self);
	_tmp13_ = _tmp12_;
	_tmp14_ = gcalc_function_sin_new ();
	_tmp15_ = _tmp14_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp13_, (GCalcMathExpression*) _tmp15_);
	_g_object_unref0 (_tmp15_);
	_tmp16_ = gcalc_math_equation_manager_get_functions ((GCalcMathEquationManager*) self);
	_tmp17_ = _tmp16_;
	_tmp18_ = gcalc_function_cos_new ();
	_tmp19_ = _tmp18_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp17_, (GCalcMathExpression*) _tmp19_);
	_g_object_unref0 (_tmp19_);
	_tmp20_ = gcalc_math_equation_manager_get_functions ((GCalcMathEquationManager*) self);
	_tmp21_ = _tmp20_;
	_tmp22_ = gcalc_function_tan_new ();
	_tmp23_ = _tmp22_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp21_, (GCalcMathExpression*) _tmp23_);
	_g_object_unref0 (_tmp23_);
	_tmp24_ = gcalc_math_equation_manager_get_functions ((GCalcMathEquationManager*) self);
	_tmp25_ = _tmp24_;
	_tmp26_ = gcalc_function_asin_new ();
	_tmp27_ = _tmp26_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp25_, (GCalcMathExpression*) _tmp27_);
	_g_object_unref0 (_tmp27_);
	_tmp28_ = gcalc_math_equation_manager_get_functions ((GCalcMathEquationManager*) self);
	_tmp29_ = _tmp28_;
	_tmp30_ = gcalc_function_acos_new ();
	_tmp31_ = _tmp30_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp29_, (GCalcMathExpression*) _tmp31_);
	_g_object_unref0 (_tmp31_);
	_tmp32_ = gcalc_math_equation_manager_get_functions ((GCalcMathEquationManager*) self);
	_tmp33_ = _tmp32_;
	_tmp34_ = gcalc_function_atan_new ();
	_tmp35_ = _tmp34_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp33_, (GCalcMathExpression*) _tmp35_);
	_g_object_unref0 (_tmp35_);
	_tmp36_ = gcalc_math_equation_manager_get_functions ((GCalcMathEquationManager*) self);
	_tmp37_ = _tmp36_;
	_tmp38_ = gcalc_function_sinh_new ();
	_tmp39_ = _tmp38_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp37_, (GCalcMathExpression*) _tmp39_);
	_g_object_unref0 (_tmp39_);
	_tmp40_ = gcalc_math_equation_manager_get_functions ((GCalcMathEquationManager*) self);
	_tmp41_ = _tmp40_;
	_tmp42_ = gcalc_function_cosh_new ();
	_tmp43_ = _tmp42_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp41_, (GCalcMathExpression*) _tmp43_);
	_g_object_unref0 (_tmp43_);
	_tmp44_ = gcalc_math_equation_manager_get_functions ((GCalcMathEquationManager*) self);
	_tmp45_ = _tmp44_;
	_tmp46_ = gcalc_function_tanh_new ();
	_tmp47_ = _tmp46_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp45_, (GCalcMathExpression*) _tmp47_);
	_g_object_unref0 (_tmp47_);
	_tmp48_ = gcalc_math_equation_manager_get_functions ((GCalcMathEquationManager*) self);
	_tmp49_ = _tmp48_;
	_tmp50_ = gcalc_function_asinh_new ();
	_tmp51_ = _tmp50_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp49_, (GCalcMathExpression*) _tmp51_);
	_g_object_unref0 (_tmp51_);
	_tmp52_ = gcalc_math_equation_manager_get_functions ((GCalcMathEquationManager*) self);
	_tmp53_ = _tmp52_;
	_tmp54_ = gcalc_function_acosh_new ();
	_tmp55_ = _tmp54_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp53_, (GCalcMathExpression*) _tmp55_);
	_g_object_unref0 (_tmp55_);
	_tmp56_ = gcalc_math_equation_manager_get_functions ((GCalcMathEquationManager*) self);
	_tmp57_ = _tmp56_;
	_tmp58_ = gcalc_function_atanh_new ();
	_tmp59_ = _tmp58_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp57_, (GCalcMathExpression*) _tmp59_);
	_g_object_unref0 (_tmp59_);
	return obj;
}

static void
gcalc_equation_manager_class_init (GCalcEquationManagerClass * klass,
                                   gpointer klass_data)
{
	gcalc_equation_manager_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GCalcEquationManager_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gcalc_equation_manager_get_property;
	G_OBJECT_CLASS (klass)->constructor = gcalc_equation_manager_constructor;
	G_OBJECT_CLASS (klass)->finalize = gcalc_equation_manager_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GCALC_EQUATION_MANAGER_EQUATIONS_PROPERTY, gcalc_equation_manager_properties[GCALC_EQUATION_MANAGER_EQUATIONS_PROPERTY] = g_param_spec_object ("equations", "equations", "equations", GCALC_TYPE_EXPRESSION_CONTAINER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GCALC_EQUATION_MANAGER_FUNCTIONS_PROPERTY, gcalc_equation_manager_properties[GCALC_EQUATION_MANAGER_FUNCTIONS_PROPERTY] = g_param_spec_object ("functions", "functions", "functions", GCALC_TYPE_EXPRESSION_CONTAINER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
gcalc_equation_manager_gcalc_math_equation_manager_interface_init (GCalcMathEquationManagerIface * iface,
                                                                   gpointer iface_data)
{
	gcalc_equation_manager_gcalc_math_equation_manager_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_equations = gcalc_equation_manager_real_get_equations;
	iface->get_functions = gcalc_equation_manager_real_get_functions;
}

static void
gcalc_equation_manager_instance_init (GCalcEquationManager * self,
                                      gpointer klass)
{
	GCalcExpressionContainer* _tmp0_;
	GCalcExpressionContainer* _tmp1_;
	self->priv = gcalc_equation_manager_get_instance_private (self);
	_tmp0_ = gcalc_expression_container_new ();
	self->priv->_equations = _tmp0_;
	_tmp1_ = gcalc_expression_container_new ();
	self->priv->_functions = _tmp1_;
}

static void
gcalc_equation_manager_finalize (GObject * obj)
{
	GCalcEquationManager * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GCALC_TYPE_EQUATION_MANAGER, GCalcEquationManager);
	_g_object_unref0 (self->priv->_equations);
	_g_object_unref0 (self->priv->_functions);
	G_OBJECT_CLASS (gcalc_equation_manager_parent_class)->finalize (obj);
}

/**
 * An implementation of {@link MathEquationManager}
 */
static GType
gcalc_equation_manager_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GCalcEquationManagerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gcalc_equation_manager_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GCalcEquationManager), 0, (GInstanceInitFunc) gcalc_equation_manager_instance_init, NULL };
	static const GInterfaceInfo gcalc_math_equation_manager_info = { (GInterfaceInitFunc) gcalc_equation_manager_gcalc_math_equation_manager_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType gcalc_equation_manager_type_id;
	gcalc_equation_manager_type_id = g_type_register_static (G_TYPE_OBJECT, "GCalcEquationManager", &g_define_type_info, 0);
	g_type_add_interface_static (gcalc_equation_manager_type_id, GCALC_TYPE_MATH_EQUATION_MANAGER, &gcalc_math_equation_manager_info);
	GCalcEquationManager_private_offset = g_type_add_instance_private (gcalc_equation_manager_type_id, sizeof (GCalcEquationManagerPrivate));
	return gcalc_equation_manager_type_id;
}

GType
gcalc_equation_manager_get_type (void)
{
	static volatile gsize gcalc_equation_manager_type_id__once = 0;
	if (g_once_init_enter (&gcalc_equation_manager_type_id__once)) {
		GType gcalc_equation_manager_type_id;
		gcalc_equation_manager_type_id = gcalc_equation_manager_get_type_once ();
		g_once_init_leave (&gcalc_equation_manager_type_id__once, gcalc_equation_manager_type_id);
	}
	return gcalc_equation_manager_type_id__once;
}

static void
_vala_gcalc_equation_manager_get_property (GObject * object,
                                           guint property_id,
                                           GValue * value,
                                           GParamSpec * pspec)
{
	GCalcEquationManager * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GCALC_TYPE_EQUATION_MANAGER, GCalcEquationManager);
	switch (property_id) {
		case GCALC_EQUATION_MANAGER_EQUATIONS_PROPERTY:
		g_value_set_object (value, gcalc_math_equation_manager_get_equations ((GCalcMathEquationManager*) self));
		break;
		case GCALC_EQUATION_MANAGER_FUNCTIONS_PROPERTY:
		g_value_set_object (value, gcalc_math_equation_manager_get_functions ((GCalcMathEquationManager*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

