/* math-preferences.c generated by valac 0.34.4, the Vala compiler
 * generated from math-preferences.vala, do not modify */

/*
 * Copyright (C) 2008-2012 Robert Ancell
 *
 * 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. See http://www.gnu.org/copyleft/gpl.html the full text of the
 * license.
 */

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include "libcalculator.h"
#include <gdk/gdk.h>
#include <glib/gi18n-lib.h>
#include <float.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>


#define TYPE_MATH_PREFERENCES_DIALOG (math_preferences_dialog_get_type ())
#define MATH_PREFERENCES_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MATH_PREFERENCES_DIALOG, MathPreferencesDialog))
#define MATH_PREFERENCES_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MATH_PREFERENCES_DIALOG, MathPreferencesDialogClass))
#define IS_MATH_PREFERENCES_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MATH_PREFERENCES_DIALOG))
#define IS_MATH_PREFERENCES_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MATH_PREFERENCES_DIALOG))
#define MATH_PREFERENCES_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MATH_PREFERENCES_DIALOG, MathPreferencesDialogClass))

typedef struct _MathPreferencesDialog MathPreferencesDialog;
typedef struct _MathPreferencesDialogClass MathPreferencesDialogClass;
typedef struct _MathPreferencesDialogPrivate MathPreferencesDialogPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _MathPreferencesDialog {
	GtkDialog parent_instance;
	MathPreferencesDialogPrivate * priv;
};

struct _MathPreferencesDialogClass {
	GtkDialogClass parent_class;
};

struct _MathPreferencesDialogPrivate {
	MathEquation* _equation;
	GtkComboBox* angle_unit_combo;
	GtkComboBox* number_format_combo;
	GtkComboBox* word_size_combo;
	GtkSpinButton* decimal_places_spin;
	GtkSwitch* thousands_separator_switch;
	GtkSwitch* trailing_zeroes_switch;
};


static gpointer math_preferences_dialog_parent_class = NULL;

GType math_preferences_dialog_get_type (void) G_GNUC_CONST;
#define MATH_PREFERENCES_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_MATH_PREFERENCES_DIALOG, MathPreferencesDialogPrivate))
enum  {
	MATH_PREFERENCES_DIALOG_DUMMY_PROPERTY,
	MATH_PREFERENCES_DIALOG_EQUATION
};
MathPreferencesDialog* math_preferences_dialog_new (MathEquation* eq);
MathPreferencesDialog* math_preferences_dialog_construct (GType object_type, MathEquation* eq);
static void math_preferences_dialog_real_response (GtkDialog* base, gint id);
static gboolean math_preferences_dialog_real_delete_event (GtkWidget* base, GdkEventAny* event);
static void math_preferences_dialog_number_format_combo_changed_cb (MathPreferencesDialog* self, GtkComboBox* combo);
static MathEquation* math_preferences_dialog_get_equation (MathPreferencesDialog* self);
static void math_preferences_dialog_angle_unit_combo_changed_cb (MathPreferencesDialog* self, GtkComboBox* combo);
static void math_preferences_dialog_word_size_combo_changed_cb (MathPreferencesDialog* self, GtkComboBox* combo);
static void math_preferences_dialog_set_combo_box_from_int (MathPreferencesDialog* self, GtkComboBox* combo, gint value);
static void math_preferences_dialog_set_equation (MathPreferencesDialog* self, MathEquation* value);
static GObject * math_preferences_dialog_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void _math_preferences_dialog_number_format_combo_changed_cb_gtk_combo_box_changed (GtkComboBox* _sender, gpointer self);
static void _math_preferences_dialog___lambda25_ (MathPreferencesDialog* self);
static void __math_preferences_dialog___lambda25__gtk_spin_button_value_changed (GtkSpinButton* _sender, gpointer self);
static gboolean _math_preferences_dialog___lambda26_ (MathPreferencesDialog* self, gboolean state);
static gboolean __math_preferences_dialog___lambda26__gtk_switch_state_set (GtkSwitch* _sender, gboolean state, gpointer self);
static gboolean _math_preferences_dialog___lambda27_ (MathPreferencesDialog* self, gboolean state);
static gboolean __math_preferences_dialog___lambda27__gtk_switch_state_set (GtkSwitch* _sender, gboolean state, gpointer self);
static void _math_preferences_dialog_angle_unit_combo_changed_cb_gtk_combo_box_changed (GtkComboBox* _sender, gpointer self);
static void _math_preferences_dialog_word_size_combo_changed_cb_gtk_combo_box_changed (GtkComboBox* _sender, gpointer self);
static void _math_preferences_dialog___lambda28_ (MathPreferencesDialog* self, GParamSpec* pspec);
static void __math_preferences_dialog___lambda28__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void _math_preferences_dialog___lambda29_ (MathPreferencesDialog* self);
static void __math_preferences_dialog___lambda29__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void _math_preferences_dialog___lambda30_ (MathPreferencesDialog* self);
static void __math_preferences_dialog___lambda30__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void _math_preferences_dialog___lambda31_ (MathPreferencesDialog* self, GParamSpec* pspec);
static void __math_preferences_dialog___lambda31__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void _math_preferences_dialog___lambda32_ (MathPreferencesDialog* self, GParamSpec* pspec);
static void __math_preferences_dialog___lambda32__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void _math_preferences_dialog___lambda33_ (MathPreferencesDialog* self, GParamSpec* pspec);
static void __math_preferences_dialog___lambda33__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void math_preferences_dialog_finalize (GObject* obj);
static void _vala_math_preferences_dialog_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_math_preferences_dialog_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


MathPreferencesDialog* math_preferences_dialog_construct (GType object_type, MathEquation* eq) {
	MathPreferencesDialog * self = NULL;
	MathEquation* _tmp0_ = NULL;
	g_return_val_if_fail (eq != NULL, NULL);
	_tmp0_ = eq;
	self = (MathPreferencesDialog*) g_object_new (object_type, "use-header-bar", 1, "equation", _tmp0_, "resizable", FALSE, NULL);
	return self;
}


MathPreferencesDialog* math_preferences_dialog_new (MathEquation* eq) {
	return math_preferences_dialog_construct (TYPE_MATH_PREFERENCES_DIALOG, eq);
}


static void math_preferences_dialog_real_response (GtkDialog* base, gint id) {
	MathPreferencesDialog * self;
	self = (MathPreferencesDialog*) base;
	gtk_widget_hide ((GtkWidget*) self);
}


static gboolean math_preferences_dialog_real_delete_event (GtkWidget* base, GdkEventAny* event) {
	MathPreferencesDialog * self;
	gboolean result = FALSE;
	self = (MathPreferencesDialog*) base;
	g_return_val_if_fail (event != NULL, FALSE);
	gtk_widget_hide ((GtkWidget*) self);
	result = TRUE;
	return result;
}


static void math_preferences_dialog_number_format_combo_changed_cb (MathPreferencesDialog* self, GtkComboBox* combo) {
	GtkTreeIter iter = {0};
	GtkComboBox* _tmp0_ = NULL;
	GtkTreeIter _tmp1_ = {0};
	DisplayFormat value = 0;
	GtkComboBox* _tmp2_ = NULL;
	GtkTreeModel* _tmp3_ = NULL;
	GtkTreeModel* _tmp4_ = NULL;
	GtkTreeIter _tmp5_ = {0};
	MathEquation* _tmp6_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (combo != NULL);
	_tmp0_ = combo;
	gtk_combo_box_get_active_iter (_tmp0_, &_tmp1_);
	iter = _tmp1_;
	_tmp2_ = combo;
	_tmp3_ = gtk_combo_box_get_model (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = iter;
	gtk_tree_model_get (_tmp4_, &_tmp5_, 1, &value, -1, -1);
	_tmp6_ = self->priv->_equation;
	math_equation_set_number_format (_tmp6_, value);
}


static void math_preferences_dialog_angle_unit_combo_changed_cb (MathPreferencesDialog* self, GtkComboBox* combo) {
	GtkTreeIter iter = {0};
	GtkComboBox* _tmp0_ = NULL;
	GtkTreeIter _tmp1_ = {0};
	AngleUnit value = 0;
	GtkComboBox* _tmp2_ = NULL;
	GtkTreeModel* _tmp3_ = NULL;
	GtkTreeModel* _tmp4_ = NULL;
	GtkTreeIter _tmp5_ = {0};
	MathEquation* _tmp6_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (combo != NULL);
	_tmp0_ = combo;
	gtk_combo_box_get_active_iter (_tmp0_, &_tmp1_);
	iter = _tmp1_;
	_tmp2_ = combo;
	_tmp3_ = gtk_combo_box_get_model (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = iter;
	gtk_tree_model_get (_tmp4_, &_tmp5_, 1, &value, -1, -1);
	_tmp6_ = self->priv->_equation;
	math_equation_set_angle_units (_tmp6_, value);
}


static void math_preferences_dialog_word_size_combo_changed_cb (MathPreferencesDialog* self, GtkComboBox* combo) {
	GtkTreeIter iter = {0};
	GtkComboBox* _tmp0_ = NULL;
	GtkTreeIter _tmp1_ = {0};
	gint value = 0;
	GtkComboBox* _tmp2_ = NULL;
	GtkTreeModel* _tmp3_ = NULL;
	GtkTreeModel* _tmp4_ = NULL;
	GtkTreeIter _tmp5_ = {0};
	MathEquation* _tmp6_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (combo != NULL);
	_tmp0_ = combo;
	gtk_combo_box_get_active_iter (_tmp0_, &_tmp1_);
	iter = _tmp1_;
	_tmp2_ = combo;
	_tmp3_ = gtk_combo_box_get_model (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = iter;
	gtk_tree_model_get (_tmp4_, &_tmp5_, 1, &value, -1, -1);
	_tmp6_ = self->priv->_equation;
	math_equation_set_word_size (_tmp6_, value);
}


static void math_preferences_dialog_set_combo_box_from_int (MathPreferencesDialog* self, GtkComboBox* combo, gint value) {
	GtkTreeIter iter = {0};
	gboolean valid = FALSE;
	GtkComboBox* _tmp0_ = NULL;
	GtkTreeModel* _tmp1_ = NULL;
	GtkTreeModel* _tmp2_ = NULL;
	GtkTreeIter _tmp3_ = {0};
	gboolean _tmp4_ = FALSE;
	gboolean _tmp16_ = FALSE;
	GtkComboBox* _tmp22_ = NULL;
	GtkTreeIter _tmp23_ = {0};
	g_return_if_fail (self != NULL);
	g_return_if_fail (combo != NULL);
	_tmp0_ = combo;
	_tmp1_ = gtk_combo_box_get_model (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp4_ = gtk_tree_model_get_iter_first (_tmp2_, &_tmp3_);
	iter = _tmp3_;
	valid = _tmp4_;
	while (TRUE) {
		gboolean _tmp5_ = FALSE;
		gint v = 0;
		GtkComboBox* _tmp6_ = NULL;
		GtkTreeModel* _tmp7_ = NULL;
		GtkTreeModel* _tmp8_ = NULL;
		GtkTreeIter _tmp9_ = {0};
		gint _tmp10_ = 0;
		gint _tmp11_ = 0;
		GtkComboBox* _tmp12_ = NULL;
		GtkTreeModel* _tmp13_ = NULL;
		GtkTreeModel* _tmp14_ = NULL;
		gboolean _tmp15_ = FALSE;
		_tmp5_ = valid;
		if (!_tmp5_) {
			break;
		}
		_tmp6_ = combo;
		_tmp7_ = gtk_combo_box_get_model (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = iter;
		gtk_tree_model_get (_tmp8_, &_tmp9_, 1, &v, -1, -1);
		_tmp10_ = v;
		_tmp11_ = value;
		if (_tmp10_ == _tmp11_) {
			break;
		}
		_tmp12_ = combo;
		_tmp13_ = gtk_combo_box_get_model (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp15_ = gtk_tree_model_iter_next (_tmp14_, &iter);
		valid = _tmp15_;
	}
	_tmp16_ = valid;
	if (!_tmp16_) {
		GtkComboBox* _tmp17_ = NULL;
		GtkTreeModel* _tmp18_ = NULL;
		GtkTreeModel* _tmp19_ = NULL;
		GtkTreeIter _tmp20_ = {0};
		gboolean _tmp21_ = FALSE;
		_tmp17_ = combo;
		_tmp18_ = gtk_combo_box_get_model (_tmp17_);
		_tmp19_ = _tmp18_;
		_tmp21_ = gtk_tree_model_get_iter_first (_tmp19_, &_tmp20_);
		iter = _tmp20_;
		valid = _tmp21_;
	}
	_tmp22_ = combo;
	_tmp23_ = iter;
	gtk_combo_box_set_active_iter (_tmp22_, &_tmp23_);
}


static MathEquation* math_preferences_dialog_get_equation (MathPreferencesDialog* self) {
	MathEquation* result;
	MathEquation* _tmp0_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_equation;
	result = _tmp0_;
	return result;
}


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


static void math_preferences_dialog_set_equation (MathPreferencesDialog* self, MathEquation* value) {
	MathEquation* _tmp0_ = NULL;
	MathEquation* _tmp1_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->_equation);
	self->priv->_equation = _tmp1_;
	g_object_notify ((GObject *) self, "equation");
}


static void _math_preferences_dialog_number_format_combo_changed_cb_gtk_combo_box_changed (GtkComboBox* _sender, gpointer self) {
	math_preferences_dialog_number_format_combo_changed_cb ((MathPreferencesDialog*) self, _sender);
}


static void _math_preferences_dialog___lambda25_ (MathPreferencesDialog* self) {
	MathEquation* _tmp0_ = NULL;
	GtkSpinButton* _tmp1_ = NULL;
	gint _tmp2_ = 0;
	_tmp0_ = self->priv->_equation;
	_tmp1_ = self->priv->decimal_places_spin;
	_tmp2_ = gtk_spin_button_get_value_as_int (_tmp1_);
	math_equation_set_accuracy (_tmp0_, _tmp2_);
}


static void __math_preferences_dialog___lambda25__gtk_spin_button_value_changed (GtkSpinButton* _sender, gpointer self) {
	_math_preferences_dialog___lambda25_ ((MathPreferencesDialog*) self);
}


static gboolean _math_preferences_dialog___lambda26_ (MathPreferencesDialog* self, gboolean state) {
	gboolean result = FALSE;
	MathEquation* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	_tmp0_ = self->priv->_equation;
	_tmp1_ = state;
	math_equation_set_show_trailing_zeroes (_tmp0_, _tmp1_);
}


static gboolean __math_preferences_dialog___lambda26__gtk_switch_state_set (GtkSwitch* _sender, gboolean state, gpointer self) {
	gboolean result;
	result = _math_preferences_dialog___lambda26_ ((MathPreferencesDialog*) self, state);
	return result;
}


static gboolean _math_preferences_dialog___lambda27_ (MathPreferencesDialog* self, gboolean state) {
	gboolean result = FALSE;
	MathEquation* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	_tmp0_ = self->priv->_equation;
	_tmp1_ = state;
	math_equation_set_show_thousands_separators (_tmp0_, _tmp1_);
}


static gboolean __math_preferences_dialog___lambda27__gtk_switch_state_set (GtkSwitch* _sender, gboolean state, gpointer self) {
	gboolean result;
	result = _math_preferences_dialog___lambda27_ ((MathPreferencesDialog*) self, state);
	return result;
}


static void _math_preferences_dialog_angle_unit_combo_changed_cb_gtk_combo_box_changed (GtkComboBox* _sender, gpointer self) {
	math_preferences_dialog_angle_unit_combo_changed_cb ((MathPreferencesDialog*) self, _sender);
}


static void _math_preferences_dialog_word_size_combo_changed_cb_gtk_combo_box_changed (GtkComboBox* _sender, gpointer self) {
	math_preferences_dialog_word_size_combo_changed_cb ((MathPreferencesDialog*) self, _sender);
}


static void _math_preferences_dialog___lambda28_ (MathPreferencesDialog* self, GParamSpec* pspec) {
	GtkSpinButton* _tmp0_ = NULL;
	MathEquation* _tmp1_ = NULL;
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
	g_return_if_fail (pspec != NULL);
	_tmp0_ = self->priv->decimal_places_spin;
	_tmp1_ = self->priv->_equation;
	_tmp2_ = math_equation_get_accuracy (_tmp1_);
	_tmp3_ = _tmp2_;
	gtk_spin_button_set_value (_tmp0_, (gdouble) _tmp3_);
}


static void __math_preferences_dialog___lambda28__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	_math_preferences_dialog___lambda28_ ((MathPreferencesDialog*) self, pspec);
}


static void _math_preferences_dialog___lambda29_ (MathPreferencesDialog* self) {
	GtkSwitch* _tmp0_ = NULL;
	MathEquation* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	_tmp0_ = self->priv->thousands_separator_switch;
	_tmp1_ = self->priv->_equation;
	_tmp2_ = math_equation_get_show_thousands_separators (_tmp1_);
	_tmp3_ = _tmp2_;
	gtk_switch_set_active (_tmp0_, _tmp3_);
}


static void __math_preferences_dialog___lambda29__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	_math_preferences_dialog___lambda29_ ((MathPreferencesDialog*) self);
}


static void _math_preferences_dialog___lambda30_ (MathPreferencesDialog* self) {
	GtkSwitch* _tmp0_ = NULL;
	MathEquation* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	_tmp0_ = self->priv->trailing_zeroes_switch;
	_tmp1_ = self->priv->_equation;
	_tmp2_ = math_equation_get_show_trailing_zeroes (_tmp1_);
	_tmp3_ = _tmp2_;
	gtk_switch_set_active (_tmp0_, _tmp3_);
}


static void __math_preferences_dialog___lambda30__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	_math_preferences_dialog___lambda30_ ((MathPreferencesDialog*) self);
}


static void _math_preferences_dialog___lambda31_ (MathPreferencesDialog* self, GParamSpec* pspec) {
	GtkComboBox* _tmp0_ = NULL;
	MathEquation* _tmp1_ = NULL;
	DisplayFormat _tmp2_ = 0;
	DisplayFormat _tmp3_ = 0;
	g_return_if_fail (pspec != NULL);
	_tmp0_ = self->priv->number_format_combo;
	_tmp1_ = self->priv->_equation;
	_tmp2_ = math_equation_get_number_format (_tmp1_);
	_tmp3_ = _tmp2_;
	math_preferences_dialog_set_combo_box_from_int (self, _tmp0_, (gint) _tmp3_);
}


static void __math_preferences_dialog___lambda31__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	_math_preferences_dialog___lambda31_ ((MathPreferencesDialog*) self, pspec);
}


static void _math_preferences_dialog___lambda32_ (MathPreferencesDialog* self, GParamSpec* pspec) {
	GtkComboBox* _tmp0_ = NULL;
	MathEquation* _tmp1_ = NULL;
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
	g_return_if_fail (pspec != NULL);
	_tmp0_ = self->priv->word_size_combo;
	_tmp1_ = self->priv->_equation;
	_tmp2_ = math_equation_get_word_size (_tmp1_);
	_tmp3_ = _tmp2_;
	math_preferences_dialog_set_combo_box_from_int (self, _tmp0_, _tmp3_);
}


static void __math_preferences_dialog___lambda32__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	_math_preferences_dialog___lambda32_ ((MathPreferencesDialog*) self, pspec);
}


static void _math_preferences_dialog___lambda33_ (MathPreferencesDialog* self, GParamSpec* pspec) {
	GtkComboBox* _tmp0_ = NULL;
	MathEquation* _tmp1_ = NULL;
	AngleUnit _tmp2_ = 0;
	AngleUnit _tmp3_ = 0;
	g_return_if_fail (pspec != NULL);
	_tmp0_ = self->priv->angle_unit_combo;
	_tmp1_ = self->priv->_equation;
	_tmp2_ = math_equation_get_angle_units (_tmp1_);
	_tmp3_ = _tmp2_;
	math_preferences_dialog_set_combo_box_from_int (self, _tmp0_, (gint) _tmp3_);
}


static void __math_preferences_dialog___lambda33__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	_math_preferences_dialog___lambda33_ ((MathPreferencesDialog*) self, pspec);
}


static GObject * math_preferences_dialog_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	MathPreferencesDialog * self;
	const gchar* _tmp0_ = NULL;
	GtkWidget* _tmp1_ = NULL;
	GtkGrid* grid = NULL;
	GtkGrid* _tmp2_ = NULL;
	GtkGrid* _tmp3_ = NULL;
	GtkGrid* _tmp4_ = NULL;
	GtkGrid* _tmp5_ = NULL;
	GtkGrid* _tmp6_ = NULL;
	GtkBox* _tmp7_ = NULL;
	GtkGrid* _tmp8_ = NULL;
	GtkLabel* label = NULL;
	const gchar* _tmp9_ = NULL;
	GtkLabel* _tmp10_ = NULL;
	GtkLabel* _tmp11_ = NULL;
	GtkLabel* _tmp12_ = NULL;
	GtkGrid* _tmp13_ = NULL;
	GtkLabel* _tmp14_ = NULL;
	GtkComboBox* _tmp15_ = NULL;
	GtkLabel* _tmp16_ = NULL;
	GtkComboBox* _tmp17_ = NULL;
	GtkComboBox* _tmp18_ = NULL;
	GtkComboBox* _tmp19_ = NULL;
	GtkGrid* _tmp20_ = NULL;
	GtkComboBox* _tmp21_ = NULL;
	GtkListStore* model = NULL;
	GtkListStore* _tmp22_ = NULL;
	GtkComboBox* _tmp23_ = NULL;
	GtkListStore* _tmp24_ = NULL;
	GtkTreeIter iter = {0};
	GtkListStore* _tmp25_ = NULL;
	GtkTreeIter _tmp26_ = {0};
	GtkListStore* _tmp27_ = NULL;
	GtkTreeIter _tmp28_ = {0};
	const gchar* _tmp29_ = NULL;
	GtkListStore* _tmp30_ = NULL;
	GtkTreeIter _tmp31_ = {0};
	GtkListStore* _tmp32_ = NULL;
	GtkTreeIter _tmp33_ = {0};
	const gchar* _tmp34_ = NULL;
	GtkListStore* _tmp35_ = NULL;
	GtkTreeIter _tmp36_ = {0};
	GtkListStore* _tmp37_ = NULL;
	GtkTreeIter _tmp38_ = {0};
	const gchar* _tmp39_ = NULL;
	GtkListStore* _tmp40_ = NULL;
	GtkTreeIter _tmp41_ = {0};
	GtkListStore* _tmp42_ = NULL;
	GtkTreeIter _tmp43_ = {0};
	const gchar* _tmp44_ = NULL;
	GtkCellRendererText* renderer = NULL;
	GtkCellRendererText* _tmp45_ = NULL;
	GtkComboBox* _tmp46_ = NULL;
	GtkCellRendererText* _tmp47_ = NULL;
	GtkComboBox* _tmp48_ = NULL;
	GtkCellRendererText* _tmp49_ = NULL;
	GtkBox* format_options_box = NULL;
	GtkBox* _tmp50_ = NULL;
	GtkBox* _tmp51_ = NULL;
	GtkBox* _tmp52_ = NULL;
	GtkBox* _tmp53_ = NULL;
	GtkBox* _tmp54_ = NULL;
	GtkBox* _tmp55_ = NULL;
	GtkGrid* _tmp56_ = NULL;
	GtkBox* _tmp57_ = NULL;
	GtkAdjustment* decimal_places_adjustment = NULL;
	GtkAdjustment* _tmp58_ = NULL;
	GtkAdjustment* _tmp59_ = NULL;
	GtkSpinButton* _tmp60_ = NULL;
	const gchar* _tmp61_ = NULL;
	GtkLabel* _tmp62_ = NULL;
	GtkLabel* _tmp63_ = NULL;
	GtkSpinButton* _tmp64_ = NULL;
	GtkLabel* _tmp65_ = NULL;
	GtkLabel* _tmp66_ = NULL;
	GtkGrid* _tmp67_ = NULL;
	GtkLabel* _tmp68_ = NULL;
	GtkSpinButton* _tmp69_ = NULL;
	GtkSpinButton* _tmp70_ = NULL;
	GtkGrid* _tmp71_ = NULL;
	GtkSpinButton* _tmp72_ = NULL;
	const gchar* _tmp73_ = NULL;
	GtkLabel* _tmp74_ = NULL;
	GtkLabel* _tmp75_ = NULL;
	GtkLabel* _tmp76_ = NULL;
	GtkGrid* _tmp77_ = NULL;
	GtkLabel* _tmp78_ = NULL;
	GtkLabel* _tmp79_ = NULL;
	GtkSwitch* _tmp80_ = NULL;
	GtkSwitch* _tmp81_ = NULL;
	GtkSwitch* _tmp82_ = NULL;
	GtkSwitch* _tmp83_ = NULL;
	GtkSwitch* _tmp84_ = NULL;
	GtkGrid* _tmp85_ = NULL;
	GtkSwitch* _tmp86_ = NULL;
	const gchar* _tmp87_ = NULL;
	GtkLabel* _tmp88_ = NULL;
	GtkLabel* _tmp89_ = NULL;
	GtkLabel* _tmp90_ = NULL;
	GtkLabel* _tmp91_ = NULL;
	GtkSwitch* _tmp92_ = NULL;
	GtkGrid* _tmp93_ = NULL;
	GtkLabel* _tmp94_ = NULL;
	GtkSwitch* _tmp95_ = NULL;
	GtkSwitch* _tmp96_ = NULL;
	GtkSwitch* _tmp97_ = NULL;
	GtkSwitch* _tmp98_ = NULL;
	GtkGrid* _tmp99_ = NULL;
	GtkSwitch* _tmp100_ = NULL;
	const gchar* _tmp101_ = NULL;
	GtkLabel* _tmp102_ = NULL;
	GtkLabel* _tmp103_ = NULL;
	GtkLabel* _tmp104_ = NULL;
	GtkGrid* _tmp105_ = NULL;
	GtkLabel* _tmp106_ = NULL;
	GtkComboBox* _tmp107_ = NULL;
	GtkLabel* _tmp108_ = NULL;
	GtkComboBox* _tmp109_ = NULL;
	GtkComboBox* _tmp110_ = NULL;
	GtkComboBox* _tmp111_ = NULL;
	GtkGrid* _tmp112_ = NULL;
	GtkComboBox* _tmp113_ = NULL;
	GtkListStore* _tmp114_ = NULL;
	GtkComboBox* _tmp115_ = NULL;
	GtkListStore* _tmp116_ = NULL;
	GtkListStore* _tmp117_ = NULL;
	GtkTreeIter _tmp118_ = {0};
	GtkListStore* _tmp119_ = NULL;
	GtkTreeIter _tmp120_ = {0};
	const gchar* _tmp121_ = NULL;
	GtkListStore* _tmp122_ = NULL;
	GtkTreeIter _tmp123_ = {0};
	GtkListStore* _tmp124_ = NULL;
	GtkTreeIter _tmp125_ = {0};
	const gchar* _tmp126_ = NULL;
	GtkListStore* _tmp127_ = NULL;
	GtkTreeIter _tmp128_ = {0};
	GtkListStore* _tmp129_ = NULL;
	GtkTreeIter _tmp130_ = {0};
	const gchar* _tmp131_ = NULL;
	GtkCellRendererText* _tmp132_ = NULL;
	GtkComboBox* _tmp133_ = NULL;
	GtkCellRendererText* _tmp134_ = NULL;
	GtkComboBox* _tmp135_ = NULL;
	GtkCellRendererText* _tmp136_ = NULL;
	const gchar* _tmp137_ = NULL;
	GtkLabel* _tmp138_ = NULL;
	GtkLabel* _tmp139_ = NULL;
	GtkLabel* _tmp140_ = NULL;
	GtkGrid* _tmp141_ = NULL;
	GtkLabel* _tmp142_ = NULL;
	GtkComboBox* _tmp143_ = NULL;
	GtkLabel* _tmp144_ = NULL;
	GtkComboBox* _tmp145_ = NULL;
	GtkComboBox* _tmp146_ = NULL;
	GtkComboBox* _tmp147_ = NULL;
	GtkGrid* _tmp148_ = NULL;
	GtkComboBox* _tmp149_ = NULL;
	GtkListStore* _tmp150_ = NULL;
	GtkComboBox* _tmp151_ = NULL;
	GtkListStore* _tmp152_ = NULL;
	GtkListStore* _tmp153_ = NULL;
	GtkTreeIter _tmp154_ = {0};
	GtkListStore* _tmp155_ = NULL;
	GtkTreeIter _tmp156_ = {0};
	const gchar* _tmp157_ = NULL;
	GtkListStore* _tmp158_ = NULL;
	GtkTreeIter _tmp159_ = {0};
	GtkListStore* _tmp160_ = NULL;
	GtkTreeIter _tmp161_ = {0};
	const gchar* _tmp162_ = NULL;
	GtkListStore* _tmp163_ = NULL;
	GtkTreeIter _tmp164_ = {0};
	GtkListStore* _tmp165_ = NULL;
	GtkTreeIter _tmp166_ = {0};
	const gchar* _tmp167_ = NULL;
	GtkListStore* _tmp168_ = NULL;
	GtkTreeIter _tmp169_ = {0};
	GtkListStore* _tmp170_ = NULL;
	GtkTreeIter _tmp171_ = {0};
	const gchar* _tmp172_ = NULL;
	GtkCellRendererText* _tmp173_ = NULL;
	GtkComboBox* _tmp174_ = NULL;
	GtkCellRendererText* _tmp175_ = NULL;
	GtkComboBox* _tmp176_ = NULL;
	GtkCellRendererText* _tmp177_ = NULL;
	GtkSpinButton* _tmp178_ = NULL;
	MathEquation* _tmp179_ = NULL;
	gint _tmp180_ = 0;
	gint _tmp181_ = 0;
	MathEquation* _tmp182_ = NULL;
	GtkSwitch* _tmp183_ = NULL;
	MathEquation* _tmp184_ = NULL;
	gboolean _tmp185_ = FALSE;
	gboolean _tmp186_ = FALSE;
	MathEquation* _tmp187_ = NULL;
	GtkSwitch* _tmp188_ = NULL;
	MathEquation* _tmp189_ = NULL;
	gboolean _tmp190_ = FALSE;
	gboolean _tmp191_ = FALSE;
	MathEquation* _tmp192_ = NULL;
	GtkComboBox* _tmp193_ = NULL;
	MathEquation* _tmp194_ = NULL;
	DisplayFormat _tmp195_ = 0;
	DisplayFormat _tmp196_ = 0;
	MathEquation* _tmp197_ = NULL;
	GtkComboBox* _tmp198_ = NULL;
	MathEquation* _tmp199_ = NULL;
	gint _tmp200_ = 0;
	gint _tmp201_ = 0;
	MathEquation* _tmp202_ = NULL;
	GtkComboBox* _tmp203_ = NULL;
	MathEquation* _tmp204_ = NULL;
	AngleUnit _tmp205_ = 0;
	AngleUnit _tmp206_ = 0;
	MathEquation* _tmp207_ = NULL;
	parent_class = G_OBJECT_CLASS (math_preferences_dialog_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_MATH_PREFERENCES_DIALOG, MathPreferencesDialog);
	_tmp0_ = _ ("Preferences");
	gtk_window_set_title ((GtkWindow*) self, _tmp0_);
	gtk_container_set_border_width ((GtkContainer*) self, (guint) 8);
	_tmp1_ = gtk_dialog_get_header_bar ((GtkDialog*) self);
	gtk_header_bar_set_show_close_button (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_header_bar_get_type (), GtkHeaderBar), TRUE);
	_tmp2_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp2_);
	grid = _tmp2_;
	_tmp3_ = grid;
	gtk_widget_show ((GtkWidget*) _tmp3_);
	_tmp4_ = grid;
	gtk_container_set_border_width ((GtkContainer*) _tmp4_, (guint) 5);
	_tmp5_ = grid;
	gtk_grid_set_column_spacing (_tmp5_, 6);
	_tmp6_ = grid;
	gtk_grid_set_row_spacing (_tmp6_, 12);
	_tmp7_ = (GtkBox*) gtk_dialog_get_content_area ((GtkDialog*) self);
	_tmp8_ = grid;
	gtk_box_pack_start (_tmp7_, (GtkWidget*) _tmp8_, TRUE, TRUE, (guint) 0);
	_tmp9_ = _ ("Number _Format:");
	_tmp10_ = (GtkLabel*) gtk_label_new_with_mnemonic (_tmp9_);
	g_object_ref_sink (_tmp10_);
	label = _tmp10_;
	_tmp11_ = label;
	gtk_widget_show ((GtkWidget*) _tmp11_);
	_tmp12_ = label;
	gtk_label_set_xalign (_tmp12_, (gfloat) 0);
	_tmp13_ = grid;
	_tmp14_ = label;
	gtk_grid_attach (_tmp13_, (GtkWidget*) _tmp14_, 0, 0, 1, 1);
	_tmp15_ = (GtkComboBox*) gtk_combo_box_new ();
	g_object_ref_sink (_tmp15_);
	_g_object_unref0 (self->priv->number_format_combo);
	self->priv->number_format_combo = _tmp15_;
	_tmp16_ = label;
	_tmp17_ = self->priv->number_format_combo;
	gtk_label_set_mnemonic_widget (_tmp16_, (GtkWidget*) _tmp17_);
	_tmp18_ = self->priv->number_format_combo;
	gtk_widget_show ((GtkWidget*) _tmp18_);
	_tmp19_ = self->priv->number_format_combo;
	g_signal_connect_object (_tmp19_, "changed", (GCallback) _math_preferences_dialog_number_format_combo_changed_cb_gtk_combo_box_changed, self, 0);
	_tmp20_ = grid;
	_tmp21_ = self->priv->number_format_combo;
	gtk_grid_attach (_tmp20_, (GtkWidget*) _tmp21_, 1, 0, 1, 1);
	_tmp22_ = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_INT, -1);
	model = _tmp22_;
	_tmp23_ = self->priv->number_format_combo;
	_tmp24_ = model;
	gtk_combo_box_set_model (_tmp23_, (GtkTreeModel*) _tmp24_);
	_tmp25_ = model;
	gtk_list_store_append (_tmp25_, &_tmp26_);
	iter = _tmp26_;
	_tmp27_ = model;
	_tmp28_ = iter;
	_tmp29_ = _ ("Automatic");
	gtk_list_store_set (_tmp27_, &_tmp28_, 0, _tmp29_, 1, DISPLAY_FORMAT_AUTOMATIC, -1, -1);
	_tmp30_ = model;
	gtk_list_store_append (_tmp30_, &_tmp31_);
	iter = _tmp31_;
	_tmp32_ = model;
	_tmp33_ = iter;
	_tmp34_ = _ ("Fixed");
	gtk_list_store_set (_tmp32_, &_tmp33_, 0, _tmp34_, 1, DISPLAY_FORMAT_FIXED, -1, -1);
	_tmp35_ = model;
	gtk_list_store_append (_tmp35_, &_tmp36_);
	iter = _tmp36_;
	_tmp37_ = model;
	_tmp38_ = iter;
	_tmp39_ = _ ("Scientific");
	gtk_list_store_set (_tmp37_, &_tmp38_, 0, _tmp39_, 1, DISPLAY_FORMAT_SCIENTIFIC, -1, -1);
	_tmp40_ = model;
	gtk_list_store_append (_tmp40_, &_tmp41_);
	iter = _tmp41_;
	_tmp42_ = model;
	_tmp43_ = iter;
	_tmp44_ = _ ("Engineering");
	gtk_list_store_set (_tmp42_, &_tmp43_, 0, _tmp44_, 1, DISPLAY_FORMAT_ENGINEERING, -1, -1);
	_tmp45_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	g_object_ref_sink (_tmp45_);
	renderer = _tmp45_;
	_tmp46_ = self->priv->number_format_combo;
	_tmp47_ = renderer;
	gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp46_, (GtkCellRenderer*) _tmp47_, TRUE);
	_tmp48_ = self->priv->number_format_combo;
	_tmp49_ = renderer;
	gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp48_, (GtkCellRenderer*) _tmp49_, "text", 0);
	_tmp50_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
	g_object_ref_sink (_tmp50_);
	format_options_box = _tmp50_;
	_tmp51_ = format_options_box;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp51_, 6);
	_tmp52_ = format_options_box;
	gtk_widget_set_margin_start ((GtkWidget*) _tmp52_, 12);
	_tmp53_ = format_options_box;
	gtk_widget_set_halign ((GtkWidget*) _tmp53_, GTK_ALIGN_CENTER);
	_tmp54_ = format_options_box;
	gtk_widget_set_valign ((GtkWidget*) _tmp54_, GTK_ALIGN_CENTER);
	_tmp55_ = format_options_box;
	gtk_widget_show ((GtkWidget*) _tmp55_);
	_tmp56_ = grid;
	_tmp57_ = format_options_box;
	gtk_grid_attach (_tmp56_, (GtkWidget*) _tmp57_, 0, 1, 2, 1);
	_tmp58_ = gtk_adjustment_new (0.0, 0.0, 100.0, 1.0, 1.0, 0.0);
	g_object_ref_sink (_tmp58_);
	decimal_places_adjustment = _tmp58_;
	_tmp59_ = decimal_places_adjustment;
	_tmp60_ = (GtkSpinButton*) gtk_spin_button_new (_tmp59_, 0.0, (guint) 0);
	g_object_ref_sink (_tmp60_);
	_g_object_unref0 (self->priv->decimal_places_spin);
	self->priv->decimal_places_spin = _tmp60_;
	_tmp61_ = _ ("Number of _decimals");
	_tmp62_ = (GtkLabel*) gtk_label_new_with_mnemonic (_tmp61_);
	g_object_ref_sink (_tmp62_);
	_g_object_unref0 (label);
	label = _tmp62_;
	_tmp63_ = label;
	_tmp64_ = self->priv->decimal_places_spin;
	gtk_label_set_mnemonic_widget (_tmp63_, (GtkWidget*) _tmp64_);
	_tmp65_ = label;
	gtk_widget_show ((GtkWidget*) _tmp65_);
	_tmp66_ = label;
	gtk_label_set_xalign (_tmp66_, (gfloat) 0);
	_tmp67_ = grid;
	_tmp68_ = label;
	gtk_grid_attach (_tmp67_, (GtkWidget*) _tmp68_, 0, 2, 1, 1);
	_tmp69_ = self->priv->decimal_places_spin;
	gtk_widget_show ((GtkWidget*) _tmp69_);
	_tmp70_ = self->priv->decimal_places_spin;
	g_signal_connect_object (_tmp70_, "value-changed", (GCallback) __math_preferences_dialog___lambda25__gtk_spin_button_value_changed, self, 0);
	_tmp71_ = grid;
	_tmp72_ = self->priv->decimal_places_spin;
	gtk_grid_attach (_tmp71_, (GtkWidget*) _tmp72_, 1, 2, 1, 1);
	_tmp73_ = _ ("Trailing _zeroes");
	_tmp74_ = (GtkLabel*) gtk_label_new_with_mnemonic (_tmp73_);
	g_object_ref_sink (_tmp74_);
	_g_object_unref0 (label);
	label = _tmp74_;
	_tmp75_ = label;
	gtk_label_set_xalign (_tmp75_, (gfloat) 0);
	_tmp76_ = label;
	gtk_widget_show ((GtkWidget*) _tmp76_);
	_tmp77_ = grid;
	_tmp78_ = label;
	gtk_grid_attach (_tmp77_, (GtkWidget*) _tmp78_, 0, 3, 1, 1);
	_tmp79_ = label;
	_tmp80_ = self->priv->trailing_zeroes_switch;
	gtk_label_set_mnemonic_widget (_tmp79_, (GtkWidget*) _tmp80_);
	_tmp81_ = (GtkSwitch*) gtk_switch_new ();
	g_object_ref_sink (_tmp81_);
	_g_object_unref0 (self->priv->trailing_zeroes_switch);
	self->priv->trailing_zeroes_switch = _tmp81_;
	_tmp82_ = self->priv->trailing_zeroes_switch;
	gtk_widget_show ((GtkWidget*) _tmp82_);
	_tmp83_ = self->priv->trailing_zeroes_switch;
	g_signal_connect_object (_tmp83_, "state-set", (GCallback) __math_preferences_dialog___lambda26__gtk_switch_state_set, self, 0);
	_tmp84_ = self->priv->trailing_zeroes_switch;
	gtk_widget_set_halign ((GtkWidget*) _tmp84_, GTK_ALIGN_END);
	_tmp85_ = grid;
	_tmp86_ = self->priv->trailing_zeroes_switch;
	gtk_grid_attach (_tmp85_, (GtkWidget*) _tmp86_, 1, 3, 1, 1);
	_tmp87_ = _ ("_Thousands separators");
	_tmp88_ = (GtkLabel*) gtk_label_new_with_mnemonic (_tmp87_);
	g_object_ref_sink (_tmp88_);
	_g_object_unref0 (label);
	label = _tmp88_;
	_tmp89_ = label;
	gtk_label_set_xalign (_tmp89_, (gfloat) 0);
	_tmp90_ = label;
	gtk_widget_show ((GtkWidget*) _tmp90_);
	_tmp91_ = label;
	_tmp92_ = self->priv->thousands_separator_switch;
	gtk_label_set_mnemonic_widget (_tmp91_, (GtkWidget*) _tmp92_);
	_tmp93_ = grid;
	_tmp94_ = label;
	gtk_grid_attach (_tmp93_, (GtkWidget*) _tmp94_, 0, 4, 1, 1);
	_tmp95_ = (GtkSwitch*) gtk_switch_new ();
	g_object_ref_sink (_tmp95_);
	_g_object_unref0 (self->priv->thousands_separator_switch);
	self->priv->thousands_separator_switch = _tmp95_;
	_tmp96_ = self->priv->thousands_separator_switch;
	gtk_widget_show ((GtkWidget*) _tmp96_);
	_tmp97_ = self->priv->thousands_separator_switch;
	g_signal_connect_object (_tmp97_, "state-set", (GCallback) __math_preferences_dialog___lambda27__gtk_switch_state_set, self, 0);
	_tmp98_ = self->priv->thousands_separator_switch;
	gtk_widget_set_halign ((GtkWidget*) _tmp98_, GTK_ALIGN_END);
	_tmp99_ = grid;
	_tmp100_ = self->priv->thousands_separator_switch;
	gtk_grid_attach (_tmp99_, (GtkWidget*) _tmp100_, 1, 4, 1, 1);
	_tmp101_ = _ ("_Angle units:");
	_tmp102_ = (GtkLabel*) gtk_label_new_with_mnemonic (_tmp101_);
	g_object_ref_sink (_tmp102_);
	_g_object_unref0 (label);
	label = _tmp102_;
	_tmp103_ = label;
	gtk_widget_show ((GtkWidget*) _tmp103_);
	_tmp104_ = label;
	gtk_label_set_xalign (_tmp104_, (gfloat) 0);
	_tmp105_ = grid;
	_tmp106_ = label;
	gtk_grid_attach (_tmp105_, (GtkWidget*) _tmp106_, 0, 5, 1, 1);
	_tmp107_ = (GtkComboBox*) gtk_combo_box_new ();
	g_object_ref_sink (_tmp107_);
	_g_object_unref0 (self->priv->angle_unit_combo);
	self->priv->angle_unit_combo = _tmp107_;
	_tmp108_ = label;
	_tmp109_ = self->priv->angle_unit_combo;
	gtk_label_set_mnemonic_widget (_tmp108_, (GtkWidget*) _tmp109_);
	_tmp110_ = self->priv->angle_unit_combo;
	gtk_widget_show ((GtkWidget*) _tmp110_);
	_tmp111_ = self->priv->angle_unit_combo;
	g_signal_connect_object (_tmp111_, "changed", (GCallback) _math_preferences_dialog_angle_unit_combo_changed_cb_gtk_combo_box_changed, self, 0);
	_tmp112_ = grid;
	_tmp113_ = self->priv->angle_unit_combo;
	gtk_grid_attach (_tmp112_, (GtkWidget*) _tmp113_, 1, 5, 1, 1);
	_tmp114_ = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_INT, -1);
	_g_object_unref0 (model);
	model = _tmp114_;
	_tmp115_ = self->priv->angle_unit_combo;
	_tmp116_ = model;
	gtk_combo_box_set_model (_tmp115_, (GtkTreeModel*) _tmp116_);
	_tmp117_ = model;
	gtk_list_store_append (_tmp117_, &_tmp118_);
	iter = _tmp118_;
	_tmp119_ = model;
	_tmp120_ = iter;
	_tmp121_ = _ ("Degrees");
	gtk_list_store_set (_tmp119_, &_tmp120_, 0, _tmp121_, 1, ANGLE_UNIT_DEGREES, -1, -1);
	_tmp122_ = model;
	gtk_list_store_append (_tmp122_, &_tmp123_);
	iter = _tmp123_;
	_tmp124_ = model;
	_tmp125_ = iter;
	_tmp126_ = _ ("Radians");
	gtk_list_store_set (_tmp124_, &_tmp125_, 0, _tmp126_, 1, ANGLE_UNIT_RADIANS, -1, -1);
	_tmp127_ = model;
	gtk_list_store_append (_tmp127_, &_tmp128_);
	iter = _tmp128_;
	_tmp129_ = model;
	_tmp130_ = iter;
	_tmp131_ = _ ("Gradians");
	gtk_list_store_set (_tmp129_, &_tmp130_, 0, _tmp131_, 1, ANGLE_UNIT_GRADIANS, -1, -1);
	_tmp132_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	g_object_ref_sink (_tmp132_);
	_g_object_unref0 (renderer);
	renderer = _tmp132_;
	_tmp133_ = self->priv->angle_unit_combo;
	_tmp134_ = renderer;
	gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp133_, (GtkCellRenderer*) _tmp134_, TRUE);
	_tmp135_ = self->priv->angle_unit_combo;
	_tmp136_ = renderer;
	gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp135_, (GtkCellRenderer*) _tmp136_, "text", 0);
	_tmp137_ = _ ("Word _size:");
	_tmp138_ = (GtkLabel*) gtk_label_new_with_mnemonic (_tmp137_);
	g_object_ref_sink (_tmp138_);
	_g_object_unref0 (label);
	label = _tmp138_;
	_tmp139_ = label;
	gtk_widget_show ((GtkWidget*) _tmp139_);
	_tmp140_ = label;
	gtk_label_set_xalign (_tmp140_, (gfloat) 0);
	_tmp141_ = grid;
	_tmp142_ = label;
	gtk_grid_attach (_tmp141_, (GtkWidget*) _tmp142_, 0, 6, 1, 1);
	_tmp143_ = (GtkComboBox*) gtk_combo_box_new ();
	g_object_ref_sink (_tmp143_);
	_g_object_unref0 (self->priv->word_size_combo);
	self->priv->word_size_combo = _tmp143_;
	_tmp144_ = label;
	_tmp145_ = self->priv->word_size_combo;
	gtk_label_set_mnemonic_widget (_tmp144_, (GtkWidget*) _tmp145_);
	_tmp146_ = self->priv->word_size_combo;
	gtk_widget_show ((GtkWidget*) _tmp146_);
	_tmp147_ = self->priv->word_size_combo;
	g_signal_connect_object (_tmp147_, "changed", (GCallback) _math_preferences_dialog_word_size_combo_changed_cb_gtk_combo_box_changed, self, 0);
	_tmp148_ = grid;
	_tmp149_ = self->priv->word_size_combo;
	gtk_grid_attach (_tmp148_, (GtkWidget*) _tmp149_, 1, 6, 1, 1);
	_tmp150_ = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_INT, -1);
	_g_object_unref0 (model);
	model = _tmp150_;
	_tmp151_ = self->priv->word_size_combo;
	_tmp152_ = model;
	gtk_combo_box_set_model (_tmp151_, (GtkTreeModel*) _tmp152_);
	_tmp153_ = model;
	gtk_list_store_append (_tmp153_, &_tmp154_);
	iter = _tmp154_;
	_tmp155_ = model;
	_tmp156_ = iter;
	_tmp157_ = _ ("8 bits");
	gtk_list_store_set (_tmp155_, &_tmp156_, 0, _tmp157_, 1, 8, -1);
	_tmp158_ = model;
	gtk_list_store_append (_tmp158_, &_tmp159_);
	iter = _tmp159_;
	_tmp160_ = model;
	_tmp161_ = iter;
	_tmp162_ = _ ("16 bits");
	gtk_list_store_set (_tmp160_, &_tmp161_, 0, _tmp162_, 1, 16, -1);
	_tmp163_ = model;
	gtk_list_store_append (_tmp163_, &_tmp164_);
	iter = _tmp164_;
	_tmp165_ = model;
	_tmp166_ = iter;
	_tmp167_ = _ ("32 bits");
	gtk_list_store_set (_tmp165_, &_tmp166_, 0, _tmp167_, 1, 32, -1);
	_tmp168_ = model;
	gtk_list_store_append (_tmp168_, &_tmp169_);
	iter = _tmp169_;
	_tmp170_ = model;
	_tmp171_ = iter;
	_tmp172_ = _ ("64 bits");
	gtk_list_store_set (_tmp170_, &_tmp171_, 0, _tmp172_, 1, 64, -1);
	_tmp173_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	g_object_ref_sink (_tmp173_);
	_g_object_unref0 (renderer);
	renderer = _tmp173_;
	_tmp174_ = self->priv->word_size_combo;
	_tmp175_ = renderer;
	gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp174_, (GtkCellRenderer*) _tmp175_, TRUE);
	_tmp176_ = self->priv->word_size_combo;
	_tmp177_ = renderer;
	gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp176_, (GtkCellRenderer*) _tmp177_, "text", 0);
	_tmp178_ = self->priv->decimal_places_spin;
	_tmp179_ = self->priv->_equation;
	_tmp180_ = math_equation_get_accuracy (_tmp179_);
	_tmp181_ = _tmp180_;
	gtk_spin_button_set_value (_tmp178_, (gdouble) _tmp181_);
	_tmp182_ = self->priv->_equation;
	g_signal_connect_object ((GObject*) _tmp182_, "notify::accuracy", (GCallback) __math_preferences_dialog___lambda28__g_object_notify, self, 0);
	_tmp183_ = self->priv->thousands_separator_switch;
	_tmp184_ = self->priv->_equation;
	_tmp185_ = math_equation_get_show_thousands_separators (_tmp184_);
	_tmp186_ = _tmp185_;
	gtk_switch_set_active (_tmp183_, _tmp186_);
	_tmp187_ = self->priv->_equation;
	g_signal_connect_object ((GObject*) _tmp187_, "notify::show-thousands-separators", (GCallback) __math_preferences_dialog___lambda29__g_object_notify, self, 0);
	_tmp188_ = self->priv->trailing_zeroes_switch;
	_tmp189_ = self->priv->_equation;
	_tmp190_ = math_equation_get_show_trailing_zeroes (_tmp189_);
	_tmp191_ = _tmp190_;
	gtk_switch_set_active (_tmp188_, _tmp191_);
	_tmp192_ = self->priv->_equation;
	g_signal_connect_object ((GObject*) _tmp192_, "notify::show-trailing_zeroes", (GCallback) __math_preferences_dialog___lambda30__g_object_notify, self, 0);
	_tmp193_ = self->priv->number_format_combo;
	_tmp194_ = self->priv->_equation;
	_tmp195_ = math_equation_get_number_format (_tmp194_);
	_tmp196_ = _tmp195_;
	math_preferences_dialog_set_combo_box_from_int (self, _tmp193_, (gint) _tmp196_);
	_tmp197_ = self->priv->_equation;
	g_signal_connect_object ((GObject*) _tmp197_, "notify::number-format", (GCallback) __math_preferences_dialog___lambda31__g_object_notify, self, 0);
	_tmp198_ = self->priv->word_size_combo;
	_tmp199_ = self->priv->_equation;
	_tmp200_ = math_equation_get_word_size (_tmp199_);
	_tmp201_ = _tmp200_;
	math_preferences_dialog_set_combo_box_from_int (self, _tmp198_, _tmp201_);
	_tmp202_ = self->priv->_equation;
	g_signal_connect_object ((GObject*) _tmp202_, "notify::word-size", (GCallback) __math_preferences_dialog___lambda32__g_object_notify, self, 0);
	_tmp203_ = self->priv->angle_unit_combo;
	_tmp204_ = self->priv->_equation;
	_tmp205_ = math_equation_get_angle_units (_tmp204_);
	_tmp206_ = _tmp205_;
	math_preferences_dialog_set_combo_box_from_int (self, _tmp203_, (gint) _tmp206_);
	_tmp207_ = self->priv->_equation;
	g_signal_connect_object ((GObject*) _tmp207_, "notify::angle-units", (GCallback) __math_preferences_dialog___lambda33__g_object_notify, self, 0);
	_g_object_unref0 (decimal_places_adjustment);
	_g_object_unref0 (format_options_box);
	_g_object_unref0 (renderer);
	_g_object_unref0 (model);
	_g_object_unref0 (label);
	_g_object_unref0 (grid);
	return obj;
}


static void math_preferences_dialog_class_init (MathPreferencesDialogClass * klass) {
	math_preferences_dialog_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (MathPreferencesDialogPrivate));
	((GtkDialogClass *) klass)->response = math_preferences_dialog_real_response;
	((GtkWidgetClass *) klass)->delete_event = math_preferences_dialog_real_delete_event;
	G_OBJECT_CLASS (klass)->get_property = _vala_math_preferences_dialog_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_math_preferences_dialog_set_property;
	G_OBJECT_CLASS (klass)->constructor = math_preferences_dialog_constructor;
	G_OBJECT_CLASS (klass)->finalize = math_preferences_dialog_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), MATH_PREFERENCES_DIALOG_EQUATION, g_param_spec_object ("equation", "equation", "equation", TYPE_MATH_EQUATION, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}


static void math_preferences_dialog_instance_init (MathPreferencesDialog * self) {
	self->priv = MATH_PREFERENCES_DIALOG_GET_PRIVATE (self);
}


static void math_preferences_dialog_finalize (GObject* obj) {
	MathPreferencesDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_MATH_PREFERENCES_DIALOG, MathPreferencesDialog);
	_g_object_unref0 (self->priv->_equation);
	_g_object_unref0 (self->priv->angle_unit_combo);
	_g_object_unref0 (self->priv->number_format_combo);
	_g_object_unref0 (self->priv->word_size_combo);
	_g_object_unref0 (self->priv->decimal_places_spin);
	_g_object_unref0 (self->priv->thousands_separator_switch);
	_g_object_unref0 (self->priv->trailing_zeroes_switch);
	G_OBJECT_CLASS (math_preferences_dialog_parent_class)->finalize (obj);
}


GType math_preferences_dialog_get_type (void) {
	static volatile gsize math_preferences_dialog_type_id__volatile = 0;
	if (g_once_init_enter (&math_preferences_dialog_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (MathPreferencesDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) math_preferences_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MathPreferencesDialog), 0, (GInstanceInitFunc) math_preferences_dialog_instance_init, NULL };
		GType math_preferences_dialog_type_id;
		math_preferences_dialog_type_id = g_type_register_static (gtk_dialog_get_type (), "MathPreferencesDialog", &g_define_type_info, 0);
		g_once_init_leave (&math_preferences_dialog_type_id__volatile, math_preferences_dialog_type_id);
	}
	return math_preferences_dialog_type_id__volatile;
}


static void _vala_math_preferences_dialog_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	MathPreferencesDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_MATH_PREFERENCES_DIALOG, MathPreferencesDialog);
	switch (property_id) {
		case MATH_PREFERENCES_DIALOG_EQUATION:
		g_value_set_object (value, math_preferences_dialog_get_equation (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_math_preferences_dialog_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	MathPreferencesDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_MATH_PREFERENCES_DIALOG, MathPreferencesDialog);
	switch (property_id) {
		case MATH_PREFERENCES_DIALOG_EQUATION:
		math_preferences_dialog_set_equation (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}



