/* propertyitem-file.c generated by valac 0.24.0, the Vala compiler
 * generated from propertyitem-file.vala, do not modify */

/* 
 * SmartSim - Digital Logic Circuit Designer and Simulator
 *   
 *   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.
 *   
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *   
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *   
 *   Filename: propertyitem/propertyitem-string.vala
 *   
 *   Copyright Ashley Newson 2013
 */

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>


#define TYPE_PROPERTY_ITEM (property_item_get_type ())
#define PROPERTY_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PROPERTY_ITEM, PropertyItem))
#define PROPERTY_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PROPERTY_ITEM, PropertyItemClass))
#define IS_PROPERTY_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PROPERTY_ITEM))
#define IS_PROPERTY_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PROPERTY_ITEM))
#define PROPERTY_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PROPERTY_ITEM, PropertyItemClass))

typedef struct _PropertyItem PropertyItem;
typedef struct _PropertyItemClass PropertyItemClass;
typedef struct _PropertyItemPrivate PropertyItemPrivate;

#define TYPE_PROPERTY_ITEM_FILE (property_item_file_get_type ())
#define PROPERTY_ITEM_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PROPERTY_ITEM_FILE, PropertyItemFile))
#define PROPERTY_ITEM_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PROPERTY_ITEM_FILE, PropertyItemFileClass))
#define IS_PROPERTY_ITEM_FILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PROPERTY_ITEM_FILE))
#define IS_PROPERTY_ITEM_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PROPERTY_ITEM_FILE))
#define PROPERTY_ITEM_FILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PROPERTY_ITEM_FILE, PropertyItemFileClass))

typedef struct _PropertyItemFile PropertyItemFile;
typedef struct _PropertyItemFileClass PropertyItemFileClass;
typedef struct _PropertyItemFilePrivate PropertyItemFilePrivate;
#define _g_free0(var) (var = (g_free (var), NULL))

#define TYPE_PROPERTY_SET (property_set_get_type ())
#define PROPERTY_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PROPERTY_SET, PropertySet))
#define PROPERTY_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PROPERTY_SET, PropertySetClass))
#define IS_PROPERTY_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PROPERTY_SET))
#define IS_PROPERTY_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PROPERTY_SET))
#define PROPERTY_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PROPERTY_SET, PropertySetClass))

typedef struct _PropertySet PropertySet;
typedef struct _PropertySetClass PropertySetClass;
#define _property_item_unref0(var) ((var == NULL) ? NULL : (var = (property_item_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block4Data Block4Data;
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))

struct _PropertyItem {
	GTypeInstance parent_instance;
	volatile int ref_count;
	PropertyItemPrivate * priv;
	gchar* name;
	gchar* description;
};

struct _PropertyItemClass {
	GTypeClass parent_class;
	void (*finalize) (PropertyItem *self);
	GtkWidget* (*create_widget) (PropertyItem* self);
	void (*read_widget) (PropertyItem* self, GtkWidget* propertyWidget);
};

struct _PropertyItemFile {
	PropertyItem parent_instance;
	PropertyItemFilePrivate * priv;
	gchar* filename;
};

struct _PropertyItemFileClass {
	PropertyItemClass parent_class;
};

typedef enum  {
	PROPERTY_ITEM_ERROR_ITEM_NOT_FOUND
} PropertyItemError;
#define PROPERTY_ITEM_ERROR property_item_error_quark ()
struct _Block4Data {
	int _ref_count_;
	PropertyItemFile* self;
	GtkEntry* stringEntry;
};


static gpointer property_item_file_parent_class = NULL;

gpointer property_item_ref (gpointer instance);
void property_item_unref (gpointer instance);
GParamSpec* param_spec_property_item (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_property_item (GValue* value, gpointer v_object);
void value_take_property_item (GValue* value, gpointer v_object);
gpointer value_get_property_item (const GValue* value);
GType property_item_get_type (void) G_GNUC_CONST;
GType property_item_file_get_type (void) G_GNUC_CONST;
enum  {
	PROPERTY_ITEM_FILE_DUMMY_PROPERTY
};
GType property_set_get_type (void) G_GNUC_CONST;
GQuark property_item_error_quark (void);
gchar* property_item_file_get_filename_throw (PropertySet* propertySet, const gchar* name, GError** error);
PropertyItem* property_set_get_item (PropertySet* self, const gchar* name);
void property_item_file_set_filename_throw (PropertySet* propertySet, const gchar* name, const gchar* filename, GError** error);
gchar* property_item_file_get_filename (PropertySet* propertySet, const gchar* name);
void property_item_file_set_filename (PropertySet* propertySet, const gchar* name, const gchar* data);
void property_item_file_browse_widget (GtkEntry* stringEntry);
PropertyItemFile* property_item_file_new (const gchar* name, const gchar* description, const gchar* filename);
PropertyItemFile* property_item_file_construct (GType object_type, const gchar* name, const gchar* description, const gchar* filename);
PropertyItem* property_item_construct (GType object_type, const gchar* name, const gchar* description);
PropertyItemFile* property_item_file_new_copy (PropertyItemFile* source);
PropertyItemFile* property_item_file_construct_copy (GType object_type, PropertyItemFile* source);
static GtkWidget* property_item_file_real_create_widget (PropertyItem* base);
static Block4Data* block4_data_ref (Block4Data* _data4_);
static void block4_data_unref (void * _userdata_);
static void __lambda83_ (Block4Data* _data4_);
static void ___lambda83__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void property_item_file_real_read_widget (PropertyItem* base, GtkWidget* propertyWidget);
static void property_item_file_finalize (PropertyItem* obj);


gchar* property_item_file_get_filename_throw (PropertySet* propertySet, const gchar* name, GError** error) {
	gchar* result = NULL;
	PropertyItem* propertyItem = NULL;
	PropertySet* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	PropertyItem* _tmp2_ = NULL;
	PropertyItem* _tmp3_ = NULL;
	PropertySet* _tmp8_ = NULL;
	const gchar* _tmp9_ = NULL;
	gchar* _tmp10_ = NULL;
	gchar* _tmp11_ = NULL;
	gchar* _tmp12_ = NULL;
	gchar* _tmp13_ = NULL;
	const gchar* _tmp14_ = NULL;
	gchar* _tmp15_ = NULL;
	gchar* _tmp16_ = NULL;
	gchar* _tmp17_ = NULL;
	gchar* _tmp18_ = NULL;
	GError* _tmp19_ = NULL;
	GError* _tmp20_ = NULL;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (propertySet != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = propertySet;
	_tmp1_ = name;
	_tmp2_ = property_set_get_item (_tmp0_, _tmp1_);
	propertyItem = _tmp2_;
	_tmp3_ = propertyItem;
	if (_tmp3_ != NULL) {
		PropertyItem* _tmp4_ = NULL;
		_tmp4_ = propertyItem;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, TYPE_PROPERTY_ITEM_FILE)) {
			PropertyItem* _tmp5_ = NULL;
			const gchar* _tmp6_ = NULL;
			gchar* _tmp7_ = NULL;
			_tmp5_ = propertyItem;
			_tmp6_ = (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, TYPE_PROPERTY_ITEM_FILE) ? ((PropertyItemFile*) _tmp5_) : NULL)->filename;
			_tmp7_ = g_strdup (_tmp6_);
			result = _tmp7_;
			_property_item_unref0 (propertyItem);
			return result;
		}
	}
	_tmp8_ = propertySet;
	_tmp9_ = ((PropertyItem*) _tmp8_)->name;
	_tmp10_ = g_strconcat ("\"", _tmp9_, NULL);
	_tmp11_ = _tmp10_;
	_tmp12_ = g_strconcat (_tmp11_, "\" does not contain a file named \"", NULL);
	_tmp13_ = _tmp12_;
	_tmp14_ = name;
	_tmp15_ = g_strconcat (_tmp13_, _tmp14_, NULL);
	_tmp16_ = _tmp15_;
	_tmp17_ = g_strconcat (_tmp16_, "\"", NULL);
	_tmp18_ = _tmp17_;
	_tmp19_ = g_error_new_literal (PROPERTY_ITEM_ERROR, PROPERTY_ITEM_ERROR_ITEM_NOT_FOUND, _tmp18_);
	_tmp20_ = _tmp19_;
	_g_free0 (_tmp18_);
	_g_free0 (_tmp16_);
	_g_free0 (_tmp13_);
	_g_free0 (_tmp11_);
	_inner_error_ = _tmp20_;
	if (_inner_error_->domain == PROPERTY_ITEM_ERROR) {
		g_propagate_error (error, _inner_error_);
		_property_item_unref0 (propertyItem);
		return NULL;
	} else {
		_property_item_unref0 (propertyItem);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return NULL;
	}
	_property_item_unref0 (propertyItem);
}


void property_item_file_set_filename_throw (PropertySet* propertySet, const gchar* name, const gchar* filename, GError** error) {
	PropertyItem* propertyItem = NULL;
	PropertySet* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	PropertyItem* _tmp2_ = NULL;
	PropertyItem* _tmp3_ = NULL;
	PropertySet* _tmp8_ = NULL;
	const gchar* _tmp9_ = NULL;
	gchar* _tmp10_ = NULL;
	gchar* _tmp11_ = NULL;
	gchar* _tmp12_ = NULL;
	gchar* _tmp13_ = NULL;
	const gchar* _tmp14_ = NULL;
	gchar* _tmp15_ = NULL;
	gchar* _tmp16_ = NULL;
	gchar* _tmp17_ = NULL;
	gchar* _tmp18_ = NULL;
	GError* _tmp19_ = NULL;
	GError* _tmp20_ = NULL;
	GError * _inner_error_ = NULL;
	g_return_if_fail (propertySet != NULL);
	g_return_if_fail (name != NULL);
	g_return_if_fail (filename != NULL);
	_tmp0_ = propertySet;
	_tmp1_ = name;
	_tmp2_ = property_set_get_item (_tmp0_, _tmp1_);
	propertyItem = _tmp2_;
	_tmp3_ = propertyItem;
	if (_tmp3_ != NULL) {
		PropertyItem* _tmp4_ = NULL;
		_tmp4_ = propertyItem;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, TYPE_PROPERTY_ITEM_FILE)) {
			PropertyItem* _tmp5_ = NULL;
			const gchar* _tmp6_ = NULL;
			gchar* _tmp7_ = NULL;
			_tmp5_ = propertyItem;
			_tmp6_ = filename;
			_tmp7_ = g_strdup (_tmp6_);
			_g_free0 ((G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, TYPE_PROPERTY_ITEM_FILE) ? ((PropertyItemFile*) _tmp5_) : NULL)->filename);
			(G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, TYPE_PROPERTY_ITEM_FILE) ? ((PropertyItemFile*) _tmp5_) : NULL)->filename = _tmp7_;
			_property_item_unref0 (propertyItem);
			return;
		}
	}
	_tmp8_ = propertySet;
	_tmp9_ = ((PropertyItem*) _tmp8_)->name;
	_tmp10_ = g_strconcat ("\"", _tmp9_, NULL);
	_tmp11_ = _tmp10_;
	_tmp12_ = g_strconcat (_tmp11_, "\" does not contain a file named \"", NULL);
	_tmp13_ = _tmp12_;
	_tmp14_ = name;
	_tmp15_ = g_strconcat (_tmp13_, _tmp14_, NULL);
	_tmp16_ = _tmp15_;
	_tmp17_ = g_strconcat (_tmp16_, "\"", NULL);
	_tmp18_ = _tmp17_;
	_tmp19_ = g_error_new_literal (PROPERTY_ITEM_ERROR, PROPERTY_ITEM_ERROR_ITEM_NOT_FOUND, _tmp18_);
	_tmp20_ = _tmp19_;
	_g_free0 (_tmp18_);
	_g_free0 (_tmp16_);
	_g_free0 (_tmp13_);
	_g_free0 (_tmp11_);
	_inner_error_ = _tmp20_;
	if (_inner_error_->domain == PROPERTY_ITEM_ERROR) {
		g_propagate_error (error, _inner_error_);
		_property_item_unref0 (propertyItem);
		return;
	} else {
		_property_item_unref0 (propertyItem);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
	_property_item_unref0 (propertyItem);
}


gchar* property_item_file_get_filename (PropertySet* propertySet, const gchar* name) {
	gchar* result = NULL;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (propertySet != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	{
		gchar* _tmp0_ = NULL;
		PropertySet* _tmp1_ = NULL;
		const gchar* _tmp2_ = NULL;
		gchar* _tmp3_ = NULL;
		gchar* _tmp4_ = NULL;
		_tmp1_ = propertySet;
		_tmp2_ = name;
		_tmp3_ = property_item_file_get_filename_throw (_tmp1_, _tmp2_, &_inner_error_);
		_tmp0_ = _tmp3_;
		if (_inner_error_ != NULL) {
			goto __catch63_g_error;
		}
		_tmp4_ = _tmp0_;
		_tmp0_ = NULL;
		result = _tmp4_;
		_g_free0 (_tmp0_);
		return result;
	}
	goto __finally63;
	__catch63_g_error:
	{
		gchar* _tmp5_ = NULL;
		g_clear_error (&_inner_error_);
		_inner_error_ = NULL;
		_tmp5_ = g_strdup ("");
		result = _tmp5_;
		return result;
	}
	__finally63:
	g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
	g_clear_error (&_inner_error_);
	return NULL;
}


void property_item_file_set_filename (PropertySet* propertySet, const gchar* name, const gchar* data) {
	GError * _inner_error_ = NULL;
	g_return_if_fail (propertySet != NULL);
	g_return_if_fail (name != NULL);
	g_return_if_fail (data != NULL);
	{
		PropertySet* _tmp0_ = NULL;
		const gchar* _tmp1_ = NULL;
		const gchar* _tmp2_ = NULL;
		_tmp0_ = propertySet;
		_tmp1_ = name;
		_tmp2_ = data;
		property_item_file_set_filename_throw (_tmp0_, _tmp1_, _tmp2_, &_inner_error_);
		if (_inner_error_ != NULL) {
			goto __catch64_g_error;
		}
	}
	goto __finally64;
	__catch64_g_error:
	{
		g_clear_error (&_inner_error_);
		_inner_error_ = NULL;
	}
	__finally64:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
}


void property_item_file_browse_widget (GtkEntry* stringEntry) {
	GtkFileChooserDialog* fileChooser = NULL;
	GtkFileChooserDialog* _tmp0_ = NULL;
	GtkFileChooserDialog* _tmp1_ = NULL;
	GtkEntry* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	GtkFileChooserDialog* _tmp5_ = NULL;
	gint _tmp6_ = 0;
	GtkFileChooserDialog* _tmp11_ = NULL;
	g_return_if_fail (stringEntry != NULL);
	_tmp0_ = (GtkFileChooserDialog*) gtk_file_chooser_dialog_new ("Select File", NULL, GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL);
	g_object_ref_sink (_tmp0_);
	fileChooser = _tmp0_;
	_tmp1_ = fileChooser;
	_tmp2_ = stringEntry;
	_tmp3_ = gtk_entry_get_text (_tmp2_);
	_tmp4_ = _tmp3_;
	gtk_file_chooser_set_filename ((GtkFileChooser*) _tmp1_, _tmp4_);
	_tmp5_ = fileChooser;
	_tmp6_ = gtk_dialog_run ((GtkDialog*) _tmp5_);
	if (_tmp6_ == ((gint) GTK_RESPONSE_ACCEPT)) {
		GtkEntry* _tmp7_ = NULL;
		GtkFileChooserDialog* _tmp8_ = NULL;
		gchar* _tmp9_ = NULL;
		gchar* _tmp10_ = NULL;
		_tmp7_ = stringEntry;
		_tmp8_ = fileChooser;
		_tmp9_ = gtk_file_chooser_get_filename ((GtkFileChooser*) _tmp8_);
		_tmp10_ = _tmp9_;
		gtk_entry_set_text (_tmp7_, _tmp10_);
		_g_free0 (_tmp10_);
	}
	_tmp11_ = fileChooser;
	gtk_widget_destroy ((GtkWidget*) _tmp11_);
	_g_object_unref0 (fileChooser);
}


PropertyItemFile* property_item_file_construct (GType object_type, const gchar* name, const gchar* description, const gchar* filename) {
	PropertyItemFile* self = NULL;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	g_return_val_if_fail (name != NULL, NULL);
	g_return_val_if_fail (description != NULL, NULL);
	g_return_val_if_fail (filename != NULL, NULL);
	_tmp0_ = name;
	_tmp1_ = description;
	self = (PropertyItemFile*) property_item_construct (object_type, _tmp0_, _tmp1_);
	_tmp2_ = filename;
	_tmp3_ = g_strdup (_tmp2_);
	_g_free0 (self->filename);
	self->filename = _tmp3_;
	return self;
}


PropertyItemFile* property_item_file_new (const gchar* name, const gchar* description, const gchar* filename) {
	return property_item_file_construct (TYPE_PROPERTY_ITEM_FILE, name, description, filename);
}


PropertyItemFile* property_item_file_construct_copy (GType object_type, PropertyItemFile* source) {
	PropertyItemFile* self = NULL;
	PropertyItemFile* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	PropertyItemFile* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	PropertyItemFile* _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	g_return_val_if_fail (source != NULL, NULL);
	_tmp0_ = source;
	_tmp1_ = ((PropertyItem*) _tmp0_)->name;
	_tmp2_ = source;
	_tmp3_ = ((PropertyItem*) _tmp2_)->description;
	self = (PropertyItemFile*) property_item_construct (object_type, _tmp1_, _tmp3_);
	_tmp4_ = source;
	_tmp5_ = _tmp4_->filename;
	_tmp6_ = g_strdup (_tmp5_);
	_g_free0 (self->filename);
	self->filename = _tmp6_;
	return self;
}


PropertyItemFile* property_item_file_new_copy (PropertyItemFile* source) {
	return property_item_file_construct_copy (TYPE_PROPERTY_ITEM_FILE, source);
}


static Block4Data* block4_data_ref (Block4Data* _data4_) {
	g_atomic_int_inc (&_data4_->_ref_count_);
	return _data4_;
}


static void block4_data_unref (void * _userdata_) {
	Block4Data* _data4_;
	_data4_ = (Block4Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data4_->_ref_count_)) {
		PropertyItemFile* self;
		self = _data4_->self;
		_g_object_unref0 (_data4_->stringEntry);
		_property_item_unref0 (self);
		g_slice_free (Block4Data, _data4_);
	}
}


static void __lambda83_ (Block4Data* _data4_) {
	PropertyItemFile* self;
	self = _data4_->self;
	property_item_file_browse_widget (_data4_->stringEntry);
}


static void ___lambda83__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda83_ (self);
}


static GtkWidget* property_item_file_real_create_widget (PropertyItem* base) {
	PropertyItemFile * self;
	GtkWidget* result = NULL;
	Block4Data* _data4_;
	GtkBox* hBox = NULL;
	GtkBox* _tmp0_ = NULL;
	GtkEntry* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	GtkButton* browseButton = NULL;
	GtkButton* _tmp3_ = NULL;
	self = (PropertyItemFile*) base;
	_data4_ = g_slice_new0 (Block4Data);
	_data4_->_ref_count_ = 1;
	_data4_->self = property_item_ref (self);
	_tmp0_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 1);
	g_object_ref_sink (_tmp0_);
	hBox = _tmp0_;
	_tmp1_ = (GtkEntry*) gtk_entry_new ();
	g_object_ref_sink (_tmp1_);
	_data4_->stringEntry = _tmp1_;
	_tmp2_ = self->filename;
	gtk_entry_set_text (_data4_->stringEntry, _tmp2_);
	g_object_set (_data4_->stringEntry, "editable", TRUE, NULL);
	gtk_box_pack_start (hBox, (GtkWidget*) _data4_->stringEntry, TRUE, TRUE, (guint) 1);
	_tmp3_ = (GtkButton*) gtk_button_new_with_label ("Browse");
	g_object_ref_sink (_tmp3_);
	browseButton = _tmp3_;
	g_signal_connect_data (browseButton, "clicked", (GCallback) ___lambda83__gtk_button_clicked, block4_data_ref (_data4_), (GClosureNotify) block4_data_unref, 0);
	gtk_box_pack_start (hBox, (GtkWidget*) browseButton, FALSE, TRUE, (guint) 1);
	result = (GtkWidget*) hBox;
	_g_object_unref0 (browseButton);
	block4_data_unref (_data4_);
	_data4_ = NULL;
	return result;
}


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


static void property_item_file_real_read_widget (PropertyItem* base, GtkWidget* propertyWidget) {
	PropertyItemFile * self;
	GtkWidget* _tmp0_ = NULL;
	self = (PropertyItemFile*) base;
	g_return_if_fail (propertyWidget != NULL);
	_tmp0_ = propertyWidget;
	if (_tmp0_ != NULL) {
		GtkWidget* _tmp1_ = NULL;
		_tmp1_ = propertyWidget;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, GTK_TYPE_BOX)) {
			GtkBox* hBox = NULL;
			GtkWidget* _tmp2_ = NULL;
			GtkBox* _tmp3_ = NULL;
			GList* children = NULL;
			GtkBox* _tmp4_ = NULL;
			GList* _tmp5_ = NULL;
			GtkWidget* stringEntry = NULL;
			GList* _tmp6_ = NULL;
			gconstpointer _tmp7_ = NULL;
			GtkWidget* _tmp8_ = NULL;
			GtkWidget* _tmp9_ = NULL;
			_tmp2_ = propertyWidget;
			_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, GTK_TYPE_BOX) ? ((GtkBox*) _tmp2_) : NULL);
			hBox = _tmp3_;
			_tmp4_ = hBox;
			_tmp5_ = gtk_container_get_children ((GtkContainer*) _tmp4_);
			children = _tmp5_;
			_tmp6_ = children;
			_tmp7_ = g_list_nth_data (_tmp6_, (guint) 0);
			_tmp8_ = _g_object_ref0 ((GtkWidget*) _tmp7_);
			stringEntry = _tmp8_;
			_tmp9_ = stringEntry;
			if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp9_, GTK_TYPE_ENTRY)) {
				GtkWidget* _tmp10_ = NULL;
				const gchar* _tmp11_ = NULL;
				const gchar* _tmp12_ = NULL;
				gchar* _tmp13_ = NULL;
				_tmp10_ = stringEntry;
				_tmp11_ = gtk_entry_get_text (G_TYPE_CHECK_INSTANCE_TYPE (_tmp10_, GTK_TYPE_ENTRY) ? ((GtkEntry*) _tmp10_) : NULL);
				_tmp12_ = _tmp11_;
				_tmp13_ = g_strdup (_tmp12_);
				_g_free0 (self->filename);
				self->filename = _tmp13_;
			}
			_g_object_unref0 (stringEntry);
			_g_list_free0 (children);
			_g_object_unref0 (hBox);
		}
	}
}


static void property_item_file_class_init (PropertyItemFileClass * klass) {
	property_item_file_parent_class = g_type_class_peek_parent (klass);
	PROPERTY_ITEM_CLASS (klass)->finalize = property_item_file_finalize;
	PROPERTY_ITEM_CLASS (klass)->create_widget = property_item_file_real_create_widget;
	PROPERTY_ITEM_CLASS (klass)->read_widget = property_item_file_real_read_widget;
}


static void property_item_file_instance_init (PropertyItemFile * self) {
}


static void property_item_file_finalize (PropertyItem* obj) {
	PropertyItemFile * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PROPERTY_ITEM_FILE, PropertyItemFile);
	_g_free0 (self->filename);
	PROPERTY_ITEM_CLASS (property_item_file_parent_class)->finalize (obj);
}


GType property_item_file_get_type (void) {
	static volatile gsize property_item_file_type_id__volatile = 0;
	if (g_once_init_enter (&property_item_file_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (PropertyItemFileClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) property_item_file_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PropertyItemFile), 0, (GInstanceInitFunc) property_item_file_instance_init, NULL };
		GType property_item_file_type_id;
		property_item_file_type_id = g_type_register_static (TYPE_PROPERTY_ITEM, "PropertyItemFile", &g_define_type_info, 0);
		g_once_init_leave (&property_item_file_type_id__volatile, property_item_file_type_id);
	}
	return property_item_file_type_id__volatile;
}



