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



