/* editable-entry.c generated by valac 0.17.1.6-d284, the Vala compiler
 * generated from editable-entry.vala, do not modify */

/* This file is part of GNOME Boxes. License: LGPLv2+*/
/* Boxes.EditableEntry is based on gnome-control-center CcEditableEntry*/

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include <pango/pango.h>
#include <float.h>
#include <math.h>
#include <gdk/gdk.h>


#define BOXES_TYPE_EDITABLE_ENTRY (boxes_editable_entry_get_type ())
#define BOXES_EDITABLE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_EDITABLE_ENTRY, BoxesEditableEntry))
#define BOXES_EDITABLE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_EDITABLE_ENTRY, BoxesEditableEntryClass))
#define BOXES_IS_EDITABLE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_EDITABLE_ENTRY))
#define BOXES_IS_EDITABLE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_EDITABLE_ENTRY))
#define BOXES_EDITABLE_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_EDITABLE_ENTRY, BoxesEditableEntryClass))

typedef struct _BoxesEditableEntry BoxesEditableEntry;
typedef struct _BoxesEditableEntryClass BoxesEditableEntryClass;
typedef struct _BoxesEditableEntryPrivate BoxesEditableEntryPrivate;

#define BOXES_EDITABLE_ENTRY_TYPE_PAGE (boxes_editable_entry_page_get_type ())
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _pango_font_description_free0(var) ((var == NULL) ? NULL : (var = (pango_font_description_free (var), NULL)))
#define _pango_attr_list_unref0(var) ((var == NULL) ? NULL : (var = (pango_attr_list_unref (var), NULL)))

struct _BoxesEditableEntry {
	GtkAlignment parent_instance;
	BoxesEditableEntryPrivate * priv;
	gboolean _editable;
};

struct _BoxesEditableEntryClass {
	GtkAlignmentClass parent_class;
};

struct _BoxesEditableEntryPrivate {
	gchar* _text;
	PangoWeight _weight;
	gboolean _weight_set;
	gdouble _scale;
	gboolean _scale_set;
	GtkNotebook* notebook;
	GtkLabel* label;
	GtkButton* button;
	GtkEntry* entry;
	gboolean in_stop_editing;
};

typedef enum  {
	BOXES_EDITABLE_ENTRY_PAGE_LABEL,
	BOXES_EDITABLE_ENTRY_PAGE_BUTTON,
	BOXES_EDITABLE_ENTRY_PAGE_ENTRY
} BoxesEditableEntryPage;


static gpointer boxes_editable_entry_parent_class = NULL;

#define EMPTY_TEXT "\xe2\x80\x94"
GType boxes_editable_entry_get_type (void) G_GNUC_CONST;
#define BOXES_EDITABLE_ENTRY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_EDITABLE_ENTRY, BoxesEditableEntryPrivate))
enum  {
	BOXES_EDITABLE_ENTRY_DUMMY_PROPERTY,
	BOXES_EDITABLE_ENTRY_TEXT,
	BOXES_EDITABLE_ENTRY_EDITABLE,
	BOXES_EDITABLE_ENTRY_SELECTABLE,
	BOXES_EDITABLE_ENTRY_WEIGHT,
	BOXES_EDITABLE_ENTRY_WEIGHT_SET,
	BOXES_EDITABLE_ENTRY_SCALE,
	BOXES_EDITABLE_ENTRY_SCALE_SET
};
static GType boxes_editable_entry_page_get_type (void) G_GNUC_UNUSED;
static void boxes_editable_entry_update_entry_font (BoxesEditableEntry* self, GtkEntry* entry);
gboolean boxes_editable_entry_get_scale_set (BoxesEditableEntry* self);
gboolean boxes_editable_entry_get_weight_set (BoxesEditableEntry* self);
PangoWeight boxes_editable_entry_get_weight (BoxesEditableEntry* self);
gdouble boxes_editable_entry_get_scale (BoxesEditableEntry* self);
static void boxes_editable_entry_update_fonts (BoxesEditableEntry* self);
static void boxes_editable_entry_start_editing (BoxesEditableEntry* self);
static void boxes_editable_entry_stop_editing (BoxesEditableEntry* self);
void boxes_editable_entry_set_text (BoxesEditableEntry* self, const gchar* value);
static void boxes_editable_entry_cancel_editing (BoxesEditableEntry* self);
const gchar* boxes_editable_entry_get_text (BoxesEditableEntry* self);
BoxesEditableEntry* boxes_editable_entry_new (void);
BoxesEditableEntry* boxes_editable_entry_construct (GType object_type);
static void __lambda8_ (BoxesEditableEntry* self);
static void ___lambda8__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void __lambda9_ (BoxesEditableEntry* self, GtkWidget* widget, GtkAllocation* allocation);
static void ___lambda9__gtk_widget_size_allocate (GtkWidget* _sender, GtkAllocation* allocation, gpointer self);
static void __lambda10_ (BoxesEditableEntry* self);
static void ___lambda10__gtk_entry_activate (GtkEntry* _sender, gpointer self);
static gboolean __lambda11_ (BoxesEditableEntry* self);
static gboolean ___lambda11__gtk_widget_focus_out_event (GtkWidget* _sender, GdkEventFocus* event, gpointer self);
static gboolean __lambda12_ (BoxesEditableEntry* self, GtkWidget* widget, GdkEventKey* event);
static gboolean ___lambda12__gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self);
static void __lambda13_ (BoxesEditableEntry* self, GtkWidget* entry);
static void ___lambda13__gtk_widget_style_updated (GtkWidget* _sender, gpointer self);
gboolean boxes_editable_entry_get_editable (BoxesEditableEntry* self);
void boxes_editable_entry_set_editable (BoxesEditableEntry* self, gboolean value);
gboolean boxes_editable_entry_get_selectable (BoxesEditableEntry* self);
void boxes_editable_entry_set_selectable (BoxesEditableEntry* self, gboolean value);
void boxes_editable_entry_set_weight (BoxesEditableEntry* self, PangoWeight value);
void boxes_editable_entry_set_weight_set (BoxesEditableEntry* self, gboolean value);
void boxes_editable_entry_set_scale (BoxesEditableEntry* self, gdouble value);
void boxes_editable_entry_set_scale_set (BoxesEditableEntry* self, gboolean value);
static void boxes_editable_entry_finalize (GObject* obj);
static void _vala_boxes_editable_entry_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_boxes_editable_entry_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


static GType boxes_editable_entry_page_get_type (void) {
	static volatile gsize boxes_editable_entry_page_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_editable_entry_page_type_id__volatile)) {
		static const GEnumValue values[] = {{BOXES_EDITABLE_ENTRY_PAGE_LABEL, "BOXES_EDITABLE_ENTRY_PAGE_LABEL", "label"}, {BOXES_EDITABLE_ENTRY_PAGE_BUTTON, "BOXES_EDITABLE_ENTRY_PAGE_BUTTON", "button"}, {BOXES_EDITABLE_ENTRY_PAGE_ENTRY, "BOXES_EDITABLE_ENTRY_PAGE_ENTRY", "entry"}, {0, NULL, NULL}};
		GType boxes_editable_entry_page_type_id;
		boxes_editable_entry_page_type_id = g_enum_register_static ("BoxesEditableEntryPage", values);
		g_once_init_leave (&boxes_editable_entry_page_type_id__volatile, boxes_editable_entry_page_type_id);
	}
	return boxes_editable_entry_page_type_id__volatile;
}


static gpointer _pango_font_description_copy0 (gpointer self) {
	return self ? pango_font_description_copy (self) : NULL;
}


static void boxes_editable_entry_update_entry_font (BoxesEditableEntry* self, GtkEntry* entry) {
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	gboolean _tmp3_;
	GtkEntry* _tmp4_;
	GtkEntry* _tmp5_;
	GtkEntry* _tmp6_;
	GtkStyleContext* _tmp7_ = NULL;
	GtkEntry* _tmp8_;
	GtkStateFlags _tmp9_ = 0;
	const PangoFontDescription* _tmp10_ = NULL;
	PangoFontDescription* _tmp11_;
	PangoFontDescription* desc;
	gboolean _tmp12_;
	gboolean _tmp16_;
	GtkEntry* _tmp22_;
	const PangoFontDescription* _tmp23_;
	GtkEntry* _tmp24_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (entry != NULL);
	_tmp1_ = self->priv->_scale_set;
	if (!_tmp1_) {
		gboolean _tmp2_;
		_tmp2_ = self->priv->_weight_set;
		_tmp0_ = !_tmp2_;
	} else {
		_tmp0_ = FALSE;
	}
	_tmp3_ = _tmp0_;
	if (_tmp3_) {
		return;
	}
	_tmp4_ = entry;
	g_signal_handlers_block_by_func (_tmp4_, (void*) boxes_editable_entry_update_entry_font, self);
	_tmp5_ = entry;
	gtk_widget_override_font ((GtkWidget*) _tmp5_, NULL);
	_tmp6_ = entry;
	_tmp7_ = gtk_widget_get_style_context ((GtkWidget*) _tmp6_);
	_tmp8_ = entry;
	_tmp9_ = gtk_widget_get_state_flags ((GtkWidget*) _tmp8_);
	_tmp10_ = gtk_style_context_get_font (_tmp7_, _tmp9_);
	_tmp11_ = _pango_font_description_copy0 (_tmp10_);
	desc = _tmp11_;
	_tmp12_ = self->priv->_weight_set;
	if (_tmp12_) {
		const PangoFontDescription* _tmp13_;
		PangoWeight _tmp14_;
		PangoWeight _tmp15_;
		_tmp13_ = desc;
		_tmp14_ = boxes_editable_entry_get_weight (self);
		_tmp15_ = _tmp14_;
		pango_font_description_set_weight (_tmp13_, _tmp15_);
	}
	_tmp16_ = self->priv->_scale_set;
	if (_tmp16_) {
		const PangoFontDescription* _tmp17_;
		gdouble _tmp18_;
		gdouble _tmp19_;
		const PangoFontDescription* _tmp20_;
		gint _tmp21_ = 0;
		_tmp17_ = desc;
		_tmp18_ = boxes_editable_entry_get_scale (self);
		_tmp19_ = _tmp18_;
		_tmp20_ = desc;
		_tmp21_ = pango_font_description_get_size (_tmp20_);
		pango_font_description_set_size (_tmp17_, (gint) (_tmp19_ * _tmp21_));
	}
	_tmp22_ = entry;
	_tmp23_ = desc;
	gtk_widget_override_font ((GtkWidget*) _tmp22_, _tmp23_);
	_tmp24_ = entry;
	g_signal_handlers_unblock_by_func (_tmp24_, (void*) boxes_editable_entry_update_entry_font, self);
	_pango_font_description_free0 (desc);
}


static void boxes_editable_entry_update_fonts (BoxesEditableEntry* self) {
	PangoAttrList* _tmp0_;
	PangoAttrList* attrs;
	gboolean _tmp1_;
	gboolean _tmp6_;
	GtkLabel* _tmp11_;
	PangoAttrList* _tmp12_;
	GtkButton* _tmp13_;
	GtkWidget* _tmp14_ = NULL;
	PangoAttrList* _tmp15_;
	GtkEntry* _tmp16_;
	g_return_if_fail (self != NULL);
	_tmp0_ = pango_attr_list_new ();
	attrs = _tmp0_;
	_tmp1_ = self->priv->_scale_set;
	if (_tmp1_) {
		PangoAttrList* _tmp2_;
		gdouble _tmp3_;
		gdouble _tmp4_;
		PangoAttribute* _tmp5_ = NULL;
		_tmp2_ = attrs;
		_tmp3_ = boxes_editable_entry_get_scale (self);
		_tmp4_ = _tmp3_;
		_tmp5_ = pango_attr_scale_new (_tmp4_);
		pango_attr_list_insert (_tmp2_, _tmp5_);
	}
	_tmp6_ = self->priv->_weight_set;
	if (_tmp6_) {
		PangoAttrList* _tmp7_;
		PangoWeight _tmp8_;
		PangoWeight _tmp9_;
		PangoAttribute* _tmp10_ = NULL;
		_tmp7_ = attrs;
		_tmp8_ = boxes_editable_entry_get_weight (self);
		_tmp9_ = _tmp8_;
		_tmp10_ = pango_attr_weight_new (_tmp9_);
		pango_attr_list_insert (_tmp7_, _tmp10_);
	}
	_tmp11_ = self->priv->label;
	_tmp12_ = attrs;
	gtk_label_set_attributes (_tmp11_, _tmp12_);
	_tmp13_ = self->priv->button;
	_tmp14_ = gtk_bin_get_child ((GtkBin*) _tmp13_);
	_tmp15_ = attrs;
	gtk_label_set_attributes (GTK_IS_LABEL (_tmp14_) ? ((GtkLabel*) _tmp14_) : NULL, _tmp15_);
	_tmp16_ = self->priv->entry;
	boxes_editable_entry_update_entry_font (self, _tmp16_);
	_pango_attr_list_unref0 (attrs);
}


static void boxes_editable_entry_start_editing (BoxesEditableEntry* self) {
	GtkNotebook* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->notebook;
	g_object_set (_tmp0_, "page", (gint) BOXES_EDITABLE_ENTRY_PAGE_ENTRY, NULL);
}


static void boxes_editable_entry_stop_editing (BoxesEditableEntry* self) {
	gboolean _tmp0_;
	GtkNotebook* _tmp1_;
	GtkEntry* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->in_stop_editing;
	if (_tmp0_) {
		return;
	}
	self->priv->in_stop_editing = TRUE;
	_tmp1_ = self->priv->notebook;
	g_object_set (_tmp1_, "page", (gint) BOXES_EDITABLE_ENTRY_PAGE_BUTTON, NULL);
	_tmp2_ = self->priv->entry;
	_tmp3_ = gtk_entry_get_text (_tmp2_);
	_tmp4_ = _tmp3_;
	boxes_editable_entry_set_text (self, _tmp4_);
	g_signal_emit_by_name (self, "editing-done");
	self->priv->in_stop_editing = FALSE;
}


static void boxes_editable_entry_cancel_editing (BoxesEditableEntry* self) {
	GtkEntry* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	GtkNotebook* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->entry;
	_tmp1_ = boxes_editable_entry_get_text (self);
	_tmp2_ = _tmp1_;
	gtk_entry_set_text (_tmp0_, _tmp2_);
	_tmp3_ = self->priv->notebook;
	g_object_set (_tmp3_, "page", (gint) BOXES_EDITABLE_ENTRY_PAGE_BUTTON, NULL);
}


static void __lambda8_ (BoxesEditableEntry* self) {
	boxes_editable_entry_start_editing (self);
}


static void ___lambda8__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda8_ (self);
}


static void __lambda9_ (BoxesEditableEntry* self, GtkWidget* widget, GtkAllocation* allocation) {
	GtkAllocation alloc = {0};
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_ = NULL;
	GtkAllocation _tmp2_ = {0};
	GtkAllocation _tmp3_;
	gint _tmp4_;
	GtkAllocation _tmp5_;
	gint _tmp6_;
	gint offset;
	gint _tmp7_;
	GtkLabel* _tmp8_;
	gint _tmp9_ = 0;
	gint _tmp10_;
	g_return_if_fail (widget != NULL);
	g_return_if_fail (allocation != NULL);
	_tmp0_ = widget;
	_tmp1_ = gtk_widget_get_parent (_tmp0_);
	gtk_widget_get_allocation (_tmp1_, &_tmp2_);
	alloc = _tmp2_;
	_tmp3_ = *allocation;
	_tmp4_ = _tmp3_.x;
	_tmp5_ = alloc;
	_tmp6_ = _tmp5_.x;
	offset = _tmp4_ - _tmp6_;
	_tmp7_ = offset;
	_tmp8_ = self->priv->label;
	g_object_get ((GtkMisc*) _tmp8_, "xpad", &_tmp9_, NULL);
	_tmp10_ = _tmp9_;
	if (_tmp7_ != _tmp10_) {
		GtkLabel* _tmp11_;
		gint _tmp12_;
		_tmp11_ = self->priv->label;
		_tmp12_ = offset;
		gtk_misc_set_padding ((GtkMisc*) _tmp11_, _tmp12_, 0);
	}
}


static void ___lambda9__gtk_widget_size_allocate (GtkWidget* _sender, GtkAllocation* allocation, gpointer self) {
	__lambda9_ (self, _sender, allocation);
}


static void __lambda10_ (BoxesEditableEntry* self) {
	boxes_editable_entry_stop_editing (self);
}


static void ___lambda10__gtk_entry_activate (GtkEntry* _sender, gpointer self) {
	__lambda10_ (self);
}


static gboolean __lambda11_ (BoxesEditableEntry* self) {
	gboolean result = FALSE;
	boxes_editable_entry_stop_editing (self);
	result = FALSE;
	return result;
}


static gboolean ___lambda11__gtk_widget_focus_out_event (GtkWidget* _sender, GdkEventFocus* event, gpointer self) {
	gboolean result;
	result = __lambda11_ (self);
	return result;
}


static gboolean __lambda12_ (BoxesEditableEntry* self, GtkWidget* widget, GdkEventKey* event) {
	gboolean result = FALSE;
	GdkEventKey _tmp0_;
	guint _tmp1_;
	g_return_val_if_fail (widget != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = *event;
	_tmp1_ = _tmp0_.keyval;
	if (_tmp1_ == ((guint) GDK_KEY_Escape)) {
		boxes_editable_entry_cancel_editing (self);
	}
	result = FALSE;
	return result;
}


static gboolean ___lambda12__gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self) {
	gboolean result;
	result = __lambda12_ (self, _sender, event);
	return result;
}


static void __lambda13_ (BoxesEditableEntry* self, GtkWidget* entry) {
	GtkWidget* _tmp0_;
	g_return_if_fail (entry != NULL);
	_tmp0_ = entry;
	boxes_editable_entry_update_entry_font (self, GTK_IS_ENTRY (_tmp0_) ? ((GtkEntry*) _tmp0_) : NULL);
}


static void ___lambda13__gtk_widget_style_updated (GtkWidget* _sender, gpointer self) {
	__lambda13_ (self, _sender);
}


BoxesEditableEntry* boxes_editable_entry_construct (GType object_type) {
	BoxesEditableEntry * self = NULL;
	GtkNotebook* _tmp0_;
	GtkNotebook* _tmp1_;
	GtkNotebook* _tmp2_;
	GtkNotebook* _tmp3_;
	GtkLabel* _tmp4_;
	GtkLabel* _tmp5_;
	GtkLabel* _tmp6_;
	GtkNotebook* _tmp7_;
	GtkLabel* _tmp8_;
	GtkButton* _tmp9_;
	GtkButton* _tmp10_;
	GtkButton* _tmp11_;
	GtkButton* _tmp12_;
	GtkButton* _tmp13_;
	GtkNotebook* _tmp14_;
	GtkButton* _tmp15_;
	GtkButton* _tmp16_;
	GtkButton* _tmp17_;
	GtkWidget* _tmp18_ = NULL;
	GtkEntry* _tmp19_;
	GtkEntry* _tmp20_;
	GtkNotebook* _tmp21_;
	GtkEntry* _tmp22_;
	GtkEntry* _tmp23_;
	GtkEntry* _tmp24_;
	GtkEntry* _tmp25_;
	GtkEntry* _tmp26_;
	GtkNotebook* _tmp27_;
	GtkNotebook* _tmp28_;
	self = (BoxesEditableEntry*) g_object_new (object_type, NULL);
	_tmp0_ = (GtkNotebook*) gtk_notebook_new ();
	_tmp1_ = g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->notebook);
	self->priv->notebook = _tmp1_;
	_tmp2_ = self->priv->notebook;
	gtk_notebook_set_show_tabs (_tmp2_, FALSE);
	_tmp3_ = self->priv->notebook;
	gtk_notebook_set_show_border (_tmp3_, FALSE);
	_tmp4_ = (GtkLabel*) gtk_label_new (EMPTY_TEXT);
	_tmp5_ = g_object_ref_sink (_tmp4_);
	_g_object_unref0 (self->priv->label);
	self->priv->label = _tmp5_;
	_tmp6_ = self->priv->label;
	gtk_misc_set_alignment ((GtkMisc*) _tmp6_, 0.0f, 0.5f);
	_tmp7_ = self->priv->notebook;
	_tmp8_ = self->priv->label;
	gtk_notebook_append_page (_tmp7_, (GtkWidget*) _tmp8_, NULL);
	_tmp9_ = (GtkButton*) gtk_button_new_with_label (EMPTY_TEXT);
	_tmp10_ = g_object_ref_sink (_tmp9_);
	_g_object_unref0 (self->priv->button);
	self->priv->button = _tmp10_;
	_tmp11_ = self->priv->button;
	gtk_widget_set_receives_default ((GtkWidget*) _tmp11_, TRUE);
	_tmp12_ = self->priv->button;
	gtk_button_set_relief (_tmp12_, GTK_RELIEF_NONE);
	_tmp13_ = self->priv->button;
	gtk_button_set_alignment (_tmp13_, 0.0f, 0.5f);
	_tmp14_ = self->priv->notebook;
	_tmp15_ = self->priv->button;
	gtk_notebook_append_page (_tmp14_, (GtkWidget*) _tmp15_, NULL);
	_tmp16_ = self->priv->button;
	g_signal_connect_object (_tmp16_, "clicked", (GCallback) ___lambda8__gtk_button_clicked, self, 0);
	_tmp17_ = self->priv->button;
	_tmp18_ = gtk_bin_get_child ((GtkBin*) _tmp17_);
	g_signal_connect_object (_tmp18_, "size-allocate", (GCallback) ___lambda9__gtk_widget_size_allocate, self, 0);
	_tmp19_ = (GtkEntry*) gtk_entry_new ();
	_tmp20_ = g_object_ref_sink (_tmp19_);
	_g_object_unref0 (self->priv->entry);
	self->priv->entry = _tmp20_;
	_tmp21_ = self->priv->notebook;
	_tmp22_ = self->priv->entry;
	gtk_notebook_append_page (_tmp21_, (GtkWidget*) _tmp22_, NULL);
	_tmp23_ = self->priv->entry;
	g_signal_connect_object (_tmp23_, "activate", (GCallback) ___lambda10__gtk_entry_activate, self, 0);
	_tmp24_ = self->priv->entry;
	g_signal_connect_object ((GtkWidget*) _tmp24_, "focus-out-event", (GCallback) ___lambda11__gtk_widget_focus_out_event, self, 0);
	_tmp25_ = self->priv->entry;
	g_signal_connect_object ((GtkWidget*) _tmp25_, "key-press-event", (GCallback) ___lambda12__gtk_widget_key_press_event, self, 0);
	_tmp26_ = self->priv->entry;
	g_signal_connect_object ((GtkWidget*) _tmp26_, "style-updated", (GCallback) ___lambda13__gtk_widget_style_updated, self, 0);
	_tmp27_ = self->priv->notebook;
	g_object_set (_tmp27_, "page", (gint) BOXES_EDITABLE_ENTRY_PAGE_LABEL, NULL);
	_tmp28_ = self->priv->notebook;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp28_);
	gtk_widget_show_all ((GtkWidget*) self);
	return self;
}


BoxesEditableEntry* boxes_editable_entry_new (void) {
	return boxes_editable_entry_construct (BOXES_TYPE_EDITABLE_ENTRY);
}


const gchar* boxes_editable_entry_get_text (BoxesEditableEntry* self) {
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_text;
	result = _tmp0_;
	return result;
}


void boxes_editable_entry_set_text (BoxesEditableEntry* self, const gchar* value) {
	const gchar* _tmp0_;
	gchar* _tmp1_;
	GtkEntry* _tmp2_;
	const gchar* _tmp3_;
	gboolean _tmp4_ = FALSE;
	const gchar* _tmp5_;
	gboolean _tmp9_;
	GtkLabel* _tmp10_;
	const gchar* _tmp11_;
	GtkButton* _tmp12_;
	GtkWidget* _tmp13_ = NULL;
	const gchar* _tmp14_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->priv->_text);
	self->priv->_text = _tmp1_;
	_tmp2_ = self->priv->entry;
	_tmp3_ = value;
	gtk_entry_set_text (_tmp2_, _tmp3_);
	_tmp5_ = value;
	if (_tmp5_ == NULL) {
		_tmp4_ = TRUE;
	} else {
		const gchar* _tmp6_;
		gint _tmp7_;
		gint _tmp8_;
		_tmp6_ = value;
		_tmp7_ = strlen (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp4_ = _tmp8_ == 0;
	}
	_tmp9_ = _tmp4_;
	if (_tmp9_) {
		value = EMPTY_TEXT;
	}
	_tmp10_ = self->priv->label;
	_tmp11_ = value;
	gtk_label_set_label (_tmp10_, _tmp11_);
	_tmp12_ = self->priv->button;
	_tmp13_ = gtk_bin_get_child ((GtkBin*) _tmp12_);
	_tmp14_ = value;
	gtk_label_set_label (GTK_IS_LABEL (_tmp13_) ? ((GtkLabel*) _tmp13_) : NULL, _tmp14_);
	g_object_notify ((GObject *) self, "text");
}


gboolean boxes_editable_entry_get_editable (BoxesEditableEntry* self) {
	gboolean result;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->_editable;
	result = _tmp0_;
	return result;
}


void boxes_editable_entry_set_editable (BoxesEditableEntry* self, gboolean value) {
	gboolean _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	BoxesEditableEntryPage _tmp3_ = 0;
	gboolean _tmp4_;
	gboolean _tmp5_;
	GtkNotebook* _tmp6_;
	BoxesEditableEntryPage _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = self->_editable;
	if (_tmp0_ == _tmp1_) {
		return;
	}
	_tmp2_ = value;
	self->_editable = _tmp2_;
	_tmp4_ = boxes_editable_entry_get_editable (self);
	_tmp5_ = _tmp4_;
	if (_tmp5_) {
		_tmp3_ = BOXES_EDITABLE_ENTRY_PAGE_BUTTON;
	} else {
		_tmp3_ = BOXES_EDITABLE_ENTRY_PAGE_LABEL;
	}
	_tmp6_ = self->priv->notebook;
	_tmp7_ = _tmp3_;
	g_object_set (_tmp6_, "page", (gint) _tmp7_, NULL);
	g_object_notify ((GObject *) self, "editable");
}


gboolean boxes_editable_entry_get_selectable (BoxesEditableEntry* self) {
	gboolean result;
	GtkLabel* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->label;
	_tmp1_ = gtk_label_get_selectable (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}


void boxes_editable_entry_set_selectable (BoxesEditableEntry* self, gboolean value) {
	gboolean _tmp0_;
	GtkLabel* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	GtkLabel* _tmp4_;
	gboolean _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = self->priv->label;
	_tmp2_ = gtk_label_get_selectable (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp0_ == _tmp3_) {
		return;
	}
	_tmp4_ = self->priv->label;
	_tmp5_ = value;
	gtk_label_set_selectable (_tmp4_, _tmp5_);
	g_object_notify ((GObject *) self, "selectable");
}


PangoWeight boxes_editable_entry_get_weight (BoxesEditableEntry* self) {
	PangoWeight result;
	PangoWeight _tmp0_;
	g_return_val_if_fail (self != NULL, PANGO_WEIGHT_NORMAL);
	_tmp0_ = self->priv->_weight;
	result = _tmp0_;
	return result;
}


void boxes_editable_entry_set_weight (BoxesEditableEntry* self, PangoWeight value) {
	gboolean _tmp0_ = FALSE;
	PangoWeight _tmp1_;
	PangoWeight _tmp2_;
	gboolean _tmp4_;
	PangoWeight _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp1_ = value;
	_tmp2_ = self->priv->_weight;
	if (_tmp1_ == _tmp2_) {
		gboolean _tmp3_;
		_tmp3_ = self->priv->_weight_set;
		_tmp0_ = _tmp3_;
	} else {
		_tmp0_ = FALSE;
	}
	_tmp4_ = _tmp0_;
	if (_tmp4_) {
		return;
	}
	_tmp5_ = value;
	self->priv->_weight = _tmp5_;
	boxes_editable_entry_set_weight_set (self, TRUE);
	boxes_editable_entry_update_fonts (self);
	g_object_notify ((GObject *) self, "weight");
}


gboolean boxes_editable_entry_get_weight_set (BoxesEditableEntry* self) {
	gboolean result;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_weight_set;
	result = _tmp0_;
	return result;
}


void boxes_editable_entry_set_weight_set (BoxesEditableEntry* self, gboolean value) {
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_weight_set = _tmp0_;
	g_object_notify ((GObject *) self, "weight-set");
}


gdouble boxes_editable_entry_get_scale (BoxesEditableEntry* self) {
	gdouble result;
	gdouble _tmp0_;
	g_return_val_if_fail (self != NULL, 0.0);
	_tmp0_ = self->priv->_scale;
	result = _tmp0_;
	return result;
}


void boxes_editable_entry_set_scale (BoxesEditableEntry* self, gdouble value) {
	gboolean _tmp0_ = FALSE;
	gdouble _tmp1_;
	gdouble _tmp2_;
	gboolean _tmp4_;
	gdouble _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp1_ = value;
	_tmp2_ = self->priv->_scale;
	if (_tmp1_ == _tmp2_) {
		gboolean _tmp3_;
		_tmp3_ = self->priv->_scale_set;
		_tmp0_ = _tmp3_;
	} else {
		_tmp0_ = FALSE;
	}
	_tmp4_ = _tmp0_;
	if (_tmp4_) {
		return;
	}
	_tmp5_ = value;
	self->priv->_scale = _tmp5_;
	boxes_editable_entry_set_scale_set (self, TRUE);
	boxes_editable_entry_update_fonts (self);
	g_object_notify ((GObject *) self, "scale");
}


gboolean boxes_editable_entry_get_scale_set (BoxesEditableEntry* self) {
	gboolean result;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_scale_set;
	result = _tmp0_;
	return result;
}


void boxes_editable_entry_set_scale_set (BoxesEditableEntry* self, gboolean value) {
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_scale_set = _tmp0_;
	g_object_notify ((GObject *) self, "scale-set");
}


static void boxes_editable_entry_class_init (BoxesEditableEntryClass * klass) {
	boxes_editable_entry_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (BoxesEditableEntryPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_boxes_editable_entry_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_boxes_editable_entry_set_property;
	G_OBJECT_CLASS (klass)->finalize = boxes_editable_entry_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_EDITABLE_ENTRY_TEXT, g_param_spec_string ("text", "text", "text", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_EDITABLE_ENTRY_EDITABLE, g_param_spec_boolean ("editable", "editable", "editable", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_EDITABLE_ENTRY_SELECTABLE, g_param_spec_boolean ("selectable", "selectable", "selectable", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_EDITABLE_ENTRY_WEIGHT, g_param_spec_enum ("weight", "weight", "weight", PANGO_TYPE_WEIGHT, PANGO_WEIGHT_NORMAL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_EDITABLE_ENTRY_WEIGHT_SET, g_param_spec_boolean ("weight-set", "weight-set", "weight-set", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_EDITABLE_ENTRY_SCALE, g_param_spec_double ("scale", "scale", "scale", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_EDITABLE_ENTRY_SCALE_SET, g_param_spec_boolean ("scale-set", "scale-set", "scale-set", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_signal_new ("editing_done", BOXES_TYPE_EDITABLE_ENTRY, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}


static void boxes_editable_entry_instance_init (BoxesEditableEntry * self) {
	self->priv = BOXES_EDITABLE_ENTRY_GET_PRIVATE (self);
	self->priv->_weight = PANGO_WEIGHT_NORMAL;
	self->priv->_scale = 1.0;
}


static void boxes_editable_entry_finalize (GObject* obj) {
	BoxesEditableEntry * self;
	self = BOXES_EDITABLE_ENTRY (obj);
	_g_free0 (self->priv->_text);
	_g_object_unref0 (self->priv->notebook);
	_g_object_unref0 (self->priv->label);
	_g_object_unref0 (self->priv->button);
	_g_object_unref0 (self->priv->entry);
	G_OBJECT_CLASS (boxes_editable_entry_parent_class)->finalize (obj);
}


GType boxes_editable_entry_get_type (void) {
	static volatile gsize boxes_editable_entry_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_editable_entry_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BoxesEditableEntryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_editable_entry_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesEditableEntry), 0, (GInstanceInitFunc) boxes_editable_entry_instance_init, NULL };
		GType boxes_editable_entry_type_id;
		boxes_editable_entry_type_id = g_type_register_static (GTK_TYPE_ALIGNMENT, "BoxesEditableEntry", &g_define_type_info, 0);
		g_once_init_leave (&boxes_editable_entry_type_id__volatile, boxes_editable_entry_type_id);
	}
	return boxes_editable_entry_type_id__volatile;
}


static void _vala_boxes_editable_entry_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	BoxesEditableEntry * self;
	self = BOXES_EDITABLE_ENTRY (object);
	switch (property_id) {
		case BOXES_EDITABLE_ENTRY_TEXT:
		g_value_set_string (value, boxes_editable_entry_get_text (self));
		break;
		case BOXES_EDITABLE_ENTRY_EDITABLE:
		g_value_set_boolean (value, boxes_editable_entry_get_editable (self));
		break;
		case BOXES_EDITABLE_ENTRY_SELECTABLE:
		g_value_set_boolean (value, boxes_editable_entry_get_selectable (self));
		break;
		case BOXES_EDITABLE_ENTRY_WEIGHT:
		g_value_set_enum (value, boxes_editable_entry_get_weight (self));
		break;
		case BOXES_EDITABLE_ENTRY_WEIGHT_SET:
		g_value_set_boolean (value, boxes_editable_entry_get_weight_set (self));
		break;
		case BOXES_EDITABLE_ENTRY_SCALE:
		g_value_set_double (value, boxes_editable_entry_get_scale (self));
		break;
		case BOXES_EDITABLE_ENTRY_SCALE_SET:
		g_value_set_boolean (value, boxes_editable_entry_get_scale_set (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_boxes_editable_entry_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	BoxesEditableEntry * self;
	self = BOXES_EDITABLE_ENTRY (object);
	switch (property_id) {
		case BOXES_EDITABLE_ENTRY_TEXT:
		boxes_editable_entry_set_text (self, g_value_get_string (value));
		break;
		case BOXES_EDITABLE_ENTRY_EDITABLE:
		boxes_editable_entry_set_editable (self, g_value_get_boolean (value));
		break;
		case BOXES_EDITABLE_ENTRY_SELECTABLE:
		boxes_editable_entry_set_selectable (self, g_value_get_boolean (value));
		break;
		case BOXES_EDITABLE_ENTRY_WEIGHT:
		boxes_editable_entry_set_weight (self, g_value_get_enum (value));
		break;
		case BOXES_EDITABLE_ENTRY_WEIGHT_SET:
		boxes_editable_entry_set_weight_set (self, g_value_get_boolean (value));
		break;
		case BOXES_EDITABLE_ENTRY_SCALE:
		boxes_editable_entry_set_scale (self, g_value_get_double (value));
		break;
		case BOXES_EDITABLE_ENTRY_SCALE_SET:
		boxes_editable_entry_set_scale_set (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}



