/* ChooseAppDialog.c generated by valac 0.56.19, the Vala compiler
 * generated from ChooseAppDialog.vala, do not modify */

/*
* Copyright (c) 2015-2018 elementary LLC. <https://elementary.io>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 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, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1335 USA.
*
* Authored by: Jeremy Wootten <jeremywootten@gmail.com>
*/

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

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define PF_TYPE_CHOOSE_APP_DIALOG (pf_choose_app_dialog_get_type ())
#define PF_CHOOSE_APP_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PF_TYPE_CHOOSE_APP_DIALOG, PFChooseAppDialog))
#define PF_CHOOSE_APP_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PF_TYPE_CHOOSE_APP_DIALOG, PFChooseAppDialogClass))
#define PF_IS_CHOOSE_APP_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PF_TYPE_CHOOSE_APP_DIALOG))
#define PF_IS_CHOOSE_APP_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PF_TYPE_CHOOSE_APP_DIALOG))
#define PF_CHOOSE_APP_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PF_TYPE_CHOOSE_APP_DIALOG, PFChooseAppDialogClass))

typedef struct _PFChooseAppDialog PFChooseAppDialog;
typedef struct _PFChooseAppDialogClass PFChooseAppDialogClass;
typedef struct _PFChooseAppDialogPrivate PFChooseAppDialogPrivate;
enum  {
	PF_CHOOSE_APP_DIALOG_0_PROPERTY,
	PF_CHOOSE_APP_DIALOG_FILE_TO_OPEN_PROPERTY,
	PF_CHOOSE_APP_DIALOG_PARENT_PROPERTY,
	PF_CHOOSE_APP_DIALOG_NUM_PROPERTIES
};
static GParamSpec* pf_choose_app_dialog_properties[PF_CHOOSE_APP_DIALOG_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block6Data Block6Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _PfChooseAppDialogGetAppInfoData PfChooseAppDialogGetAppInfoData;

struct _PFChooseAppDialog {
	GObject parent_instance;
	PFChooseAppDialogPrivate * priv;
};

struct _PFChooseAppDialogClass {
	GObjectClass parent_class;
};

struct _PFChooseAppDialogPrivate {
	GtkAppChooserDialog* dialog;
	GtkCheckButton* check_default;
	GFile* _file_to_open;
	GtkWindow* _parent;
};

struct _Block6Data {
	int _ref_count_;
	PFChooseAppDialog* self;
	GAppInfo* app;
	gpointer _async_data_;
};

struct _PfChooseAppDialogGetAppInfoData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PFChooseAppDialog* self;
	GAppInfo* result;
	Block6Data* _data6_;
	GtkAppChooserDialog* _tmp0_;
	GtkAppChooserDialog* _tmp1_;
	GAppInfo* _tmp2_;
};

static gint PFChooseAppDialog_private_offset;
static gpointer pf_choose_app_dialog_parent_class = NULL;

VALA_EXTERN GType pf_choose_app_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PFChooseAppDialog, g_object_unref)
VALA_EXTERN PFChooseAppDialog* pf_choose_app_dialog_new (GtkWindow* parent,
                                             GFile* file_to_open);
VALA_EXTERN PFChooseAppDialog* pf_choose_app_dialog_construct (GType object_type,
                                                   GtkWindow* parent,
                                                   GFile* file_to_open);
static void pf_choose_app_dialog_get_app_info_data_free (gpointer _data);
VALA_EXTERN void pf_choose_app_dialog_get_app_info (PFChooseAppDialog* self,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
VALA_EXTERN GAppInfo* pf_choose_app_dialog_get_app_info_finish (PFChooseAppDialog* self,
                                                    GAsyncResult* _res_);
static gboolean pf_choose_app_dialog_get_app_info_co (PfChooseAppDialogGetAppInfoData* _data_);
static Block6Data* block6_data_ref (Block6Data* _data6_);
static void block6_data_unref (void * _userdata_);
static void __lambda20_ (Block6Data* _data6_,
                  gint res);
VALA_EXTERN GFile* pf_choose_app_dialog_get_file_to_open (PFChooseAppDialog* self);
static void ___lambda20__gtk_dialog_response (GtkDialog* _sender,
                                       gint response_id,
                                       gpointer self);
static void pf_choose_app_dialog_set_file_to_open (PFChooseAppDialog* self,
                                            GFile* value);
VALA_EXTERN GtkWindow* pf_choose_app_dialog_get_parent (PFChooseAppDialog* self);
static void pf_choose_app_dialog_set_parent (PFChooseAppDialog* self,
                                      GtkWindow* value);
static GObject * pf_choose_app_dialog_constructor (GType type,
                                            guint n_construct_properties,
                                            GObjectConstructParam * construct_properties);
static void pf_choose_app_dialog_finalize (GObject * obj);
static GType pf_choose_app_dialog_get_type_once (void);
static void _vala_pf_choose_app_dialog_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec);
static void _vala_pf_choose_app_dialog_set_property (GObject * object,
                                              guint property_id,
                                              const GValue * value,
                                              GParamSpec * pspec);

static inline gpointer
pf_choose_app_dialog_get_instance_private (PFChooseAppDialog* self)
{
	return G_STRUCT_MEMBER_P (self, PFChooseAppDialog_private_offset);
}

PFChooseAppDialog*
pf_choose_app_dialog_construct (GType object_type,
                                GtkWindow* parent,
                                GFile* file_to_open)
{
	PFChooseAppDialog * self = NULL;
	g_return_val_if_fail (file_to_open != NULL, NULL);
	self = (PFChooseAppDialog*) g_object_new (object_type, "parent", parent, "file-to-open", file_to_open, NULL);
	return self;
}

PFChooseAppDialog*
pf_choose_app_dialog_new (GtkWindow* parent,
                          GFile* file_to_open)
{
	return pf_choose_app_dialog_construct (PF_TYPE_CHOOSE_APP_DIALOG, parent, file_to_open);
}

static void
pf_choose_app_dialog_get_app_info_data_free (gpointer _data)
{
	PfChooseAppDialogGetAppInfoData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (PfChooseAppDialogGetAppInfoData, _data_);
}

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

void
pf_choose_app_dialog_get_app_info (PFChooseAppDialog* self,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	PfChooseAppDialogGetAppInfoData* _data_;
	PFChooseAppDialog* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (PfChooseAppDialogGetAppInfoData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pf_choose_app_dialog_get_app_info_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	pf_choose_app_dialog_get_app_info_co (_data_);
}

GAppInfo*
pf_choose_app_dialog_get_app_info_finish (PFChooseAppDialog* self,
                                          GAsyncResult* _res_)
{
	GAppInfo* result;
	PfChooseAppDialogGetAppInfoData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block6Data*
block6_data_ref (Block6Data* _data6_)
{
	g_atomic_int_inc (&_data6_->_ref_count_);
	return _data6_;
}

static void
block6_data_unref (void * _userdata_)
{
	Block6Data* _data6_;
	_data6_ = (Block6Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data6_->_ref_count_)) {
		PFChooseAppDialog* self;
		self = _data6_->self;
		_g_object_unref0 (_data6_->app);
		_g_object_unref0 (self);
		g_slice_free (Block6Data, _data6_);
	}
}

static void
__lambda20_ (Block6Data* _data6_,
             gint res)
{
	PFChooseAppDialog* self;
	GtkAppChooserDialog* _tmp9_;
	GError* _inner_error0_ = NULL;
	self = _data6_->self;
	if (res == ((gint) GTK_RESPONSE_OK)) {
		GtkAppChooserDialog* _tmp0_;
		GAppInfo* _tmp1_;
		GtkCheckButton* _tmp2_;
		_tmp0_ = self->priv->dialog;
		_tmp1_ = gtk_app_chooser_get_app_info ((GtkAppChooser*) _tmp0_);
		_g_object_unref0 (_data6_->app);
		_data6_->app = _tmp1_;
		_tmp2_ = self->priv->check_default;
		if (gtk_toggle_button_get_active ((GtkToggleButton*) _tmp2_)) {
			{
				GFileInfo* info = NULL;
				GFile* _tmp3_;
				GFileInfo* _tmp4_;
				GFileInfo* _tmp5_;
				const gchar* _tmp6_;
				_tmp3_ = self->priv->_file_to_open;
				_tmp4_ = g_file_query_info (_tmp3_, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, G_FILE_QUERY_INFO_NONE, NULL, &_inner_error0_);
				info = _tmp4_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					goto __catch0_g_error;
				}
				_tmp5_ = info;
				_tmp6_ = g_file_info_get_attribute_string (_tmp5_, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE);
				g_app_info_set_as_default_for_type (_data6_->app, _tmp6_, &_inner_error0_);
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_g_object_unref0 (info);
					goto __catch0_g_error;
				}
				_g_object_unref0 (info);
			}
			goto __finally0;
			__catch0_g_error:
			{
				GError* _error_ = NULL;
				GError* _tmp7_;
				const gchar* _tmp8_;
				_error_ = _inner_error0_;
				_inner_error0_ = NULL;
				_tmp7_ = _error_;
				_tmp8_ = _tmp7_->message;
				g_critical ("ChooseAppDialog.vala:73: Could not set as default: %s", _tmp8_);
				_g_error_free0 (_error_);
			}
			__finally0:
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return;
			}
		}
	}
	_tmp9_ = self->priv->dialog;
	gtk_widget_destroy ((GtkWidget*) _tmp9_);
	pf_choose_app_dialog_get_app_info_co (_data6_->_async_data_);
}

static void
___lambda20__gtk_dialog_response (GtkDialog* _sender,
                                  gint response_id,
                                  gpointer self)
{
	__lambda20_ (self, response_id);
}

static gboolean
pf_choose_app_dialog_get_app_info_co (PfChooseAppDialogGetAppInfoData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data6_ = g_slice_new0 (Block6Data);
	_data_->_data6_->_ref_count_ = 1;
	_data_->_data6_->self = g_object_ref (_data_->self);
	_data_->_data6_->_async_data_ = _data_;
	_data_->_data6_->app = NULL;
	_data_->_tmp0_ = _data_->self->priv->dialog;
	g_signal_connect_data ((GtkDialog*) _data_->_tmp0_, "response", (GCallback) ___lambda20__gtk_dialog_response, block6_data_ref (_data_->_data6_), (GClosureNotify) block6_data_unref, 0);
	_data_->_tmp1_ = _data_->self->priv->dialog;
	gtk_window_present ((GtkWindow*) _data_->_tmp1_);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	_data_->_tmp2_ = _g_object_ref0 (_data_->_data6_->app);
	_data_->result = _data_->_tmp2_;
	block6_data_unref (_data_->_data6_);
	_data_->_data6_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

GFile*
pf_choose_app_dialog_get_file_to_open (PFChooseAppDialog* self)
{
	GFile* result;
	GFile* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_file_to_open;
	result = _tmp0_;
	return result;
}

static void
pf_choose_app_dialog_set_file_to_open (PFChooseAppDialog* self,
                                       GFile* value)
{
	GFile* old_value;
	g_return_if_fail (self != NULL);
	old_value = pf_choose_app_dialog_get_file_to_open (self);
	if (old_value != value) {
		GFile* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_file_to_open);
		self->priv->_file_to_open = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, pf_choose_app_dialog_properties[PF_CHOOSE_APP_DIALOG_FILE_TO_OPEN_PROPERTY]);
	}
}

GtkWindow*
pf_choose_app_dialog_get_parent (PFChooseAppDialog* self)
{
	GtkWindow* result;
	GtkWindow* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_parent;
	result = _tmp0_;
	return result;
}

static void
pf_choose_app_dialog_set_parent (PFChooseAppDialog* self,
                                 GtkWindow* value)
{
	GtkWindow* old_value;
	g_return_if_fail (self != NULL);
	old_value = pf_choose_app_dialog_get_parent (self);
	if (old_value != value) {
		GtkWindow* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_parent);
		self->priv->_parent = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, pf_choose_app_dialog_properties[PF_CHOOSE_APP_DIALOG_PARENT_PROPERTY]);
	}
}

static GObject *
pf_choose_app_dialog_constructor (GType type,
                                  guint n_construct_properties,
                                  GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	PFChooseAppDialog * self;
	GtkWindow* _tmp0_;
	GFile* _tmp1_;
	GtkAppChooserDialog* _tmp2_ = NULL;
	GtkAppChooserWidget* app_chooser = NULL;
	GtkAppChooserDialog* _tmp3_;
	GtkWidget* _tmp4_;
	GtkAppChooserWidget* _tmp5_;
	GtkAppChooserWidget* _tmp6_;
	GFileType file_type = 0;
	GFile* _tmp7_;
	parent_class = G_OBJECT_CLASS (pf_choose_app_dialog_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PF_TYPE_CHOOSE_APP_DIALOG, PFChooseAppDialog);
	_tmp0_ = self->priv->_parent;
	_tmp1_ = self->priv->_file_to_open;
	_tmp2_ = (GtkAppChooserDialog*) gtk_app_chooser_dialog_new (_tmp0_, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, _tmp1_);
	gtk_window_set_deletable ((GtkWindow*) _tmp2_, FALSE);
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->dialog);
	self->priv->dialog = _tmp2_;
	_tmp3_ = self->priv->dialog;
	_tmp4_ = gtk_app_chooser_dialog_get_widget (_tmp3_);
	_tmp5_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, gtk_app_chooser_widget_get_type ()) ? ((GtkAppChooserWidget*) _tmp4_) : NULL);
	app_chooser = _tmp5_;
	_tmp6_ = app_chooser;
	gtk_app_chooser_widget_set_show_recommended (_tmp6_, TRUE);
	_tmp7_ = self->priv->_file_to_open;
	file_type = g_file_query_file_type (_tmp7_, G_FILE_QUERY_INFO_NONE, NULL);
	if (file_type != G_FILE_TYPE_DIRECTORY) {
		GtkCheckButton* _tmp8_ = NULL;
		GtkCheckButton* _tmp9_;
		GtkAppChooserDialog* _tmp10_;
		GtkBox* _tmp11_;
		GtkCheckButton* _tmp12_;
		_tmp8_ = (GtkCheckButton*) gtk_check_button_new_with_label (_ ("Set as default"));
		gtk_toggle_button_set_active ((GtkToggleButton*) _tmp8_, TRUE);
		gtk_widget_set_margin_start ((GtkWidget*) _tmp8_, 12);
		gtk_widget_set_margin_bottom ((GtkWidget*) _tmp8_, 6);
		g_object_ref_sink (_tmp8_);
		_g_object_unref0 (self->priv->check_default);
		self->priv->check_default = _tmp8_;
		_tmp9_ = self->priv->check_default;
		gtk_widget_show ((GtkWidget*) _tmp9_);
		_tmp10_ = self->priv->dialog;
		_tmp11_ = gtk_dialog_get_content_area ((GtkDialog*) _tmp10_);
		_tmp12_ = self->priv->check_default;
		gtk_container_add ((GtkContainer*) _tmp11_, (GtkWidget*) _tmp12_);
	}
	_g_object_unref0 (app_chooser);
	return obj;
}

static void
pf_choose_app_dialog_class_init (PFChooseAppDialogClass * klass,
                                 gpointer klass_data)
{
	pf_choose_app_dialog_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &PFChooseAppDialog_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_pf_choose_app_dialog_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_pf_choose_app_dialog_set_property;
	G_OBJECT_CLASS (klass)->constructor = pf_choose_app_dialog_constructor;
	G_OBJECT_CLASS (klass)->finalize = pf_choose_app_dialog_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PF_CHOOSE_APP_DIALOG_FILE_TO_OPEN_PROPERTY, pf_choose_app_dialog_properties[PF_CHOOSE_APP_DIALOG_FILE_TO_OPEN_PROPERTY] = g_param_spec_object ("file-to-open", "file-to-open", "file-to-open", g_file_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PF_CHOOSE_APP_DIALOG_PARENT_PROPERTY, pf_choose_app_dialog_properties[PF_CHOOSE_APP_DIALOG_PARENT_PROPERTY] = g_param_spec_object ("parent", "parent", "parent", gtk_window_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
pf_choose_app_dialog_instance_init (PFChooseAppDialog * self,
                                    gpointer klass)
{
	self->priv = pf_choose_app_dialog_get_instance_private (self);
}

static void
pf_choose_app_dialog_finalize (GObject * obj)
{
	PFChooseAppDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PF_TYPE_CHOOSE_APP_DIALOG, PFChooseAppDialog);
	_g_object_unref0 (self->priv->dialog);
	_g_object_unref0 (self->priv->check_default);
	_g_object_unref0 (self->priv->_file_to_open);
	_g_object_unref0 (self->priv->_parent);
	G_OBJECT_CLASS (pf_choose_app_dialog_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
pf_choose_app_dialog_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PFChooseAppDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pf_choose_app_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PFChooseAppDialog), 0, (GInstanceInitFunc) pf_choose_app_dialog_instance_init, NULL };
	GType pf_choose_app_dialog_type_id;
	pf_choose_app_dialog_type_id = g_type_register_static (G_TYPE_OBJECT, "PFChooseAppDialog", &g_define_type_info, 0);
	PFChooseAppDialog_private_offset = g_type_add_instance_private (pf_choose_app_dialog_type_id, sizeof (PFChooseAppDialogPrivate));
	return pf_choose_app_dialog_type_id;
}

GType
pf_choose_app_dialog_get_type (void)
{
	static volatile gsize pf_choose_app_dialog_type_id__once = 0;
	if (g_once_init_enter (&pf_choose_app_dialog_type_id__once)) {
		GType pf_choose_app_dialog_type_id;
		pf_choose_app_dialog_type_id = pf_choose_app_dialog_get_type_once ();
		g_once_init_leave (&pf_choose_app_dialog_type_id__once, pf_choose_app_dialog_type_id);
	}
	return pf_choose_app_dialog_type_id__once;
}

static void
_vala_pf_choose_app_dialog_get_property (GObject * object,
                                         guint property_id,
                                         GValue * value,
                                         GParamSpec * pspec)
{
	PFChooseAppDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PF_TYPE_CHOOSE_APP_DIALOG, PFChooseAppDialog);
	switch (property_id) {
		case PF_CHOOSE_APP_DIALOG_FILE_TO_OPEN_PROPERTY:
		g_value_set_object (value, pf_choose_app_dialog_get_file_to_open (self));
		break;
		case PF_CHOOSE_APP_DIALOG_PARENT_PROPERTY:
		g_value_set_object (value, pf_choose_app_dialog_get_parent (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_pf_choose_app_dialog_set_property (GObject * object,
                                         guint property_id,
                                         const GValue * value,
                                         GParamSpec * pspec)
{
	PFChooseAppDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PF_TYPE_CHOOSE_APP_DIALOG, PFChooseAppDialog);
	switch (property_id) {
		case PF_CHOOSE_APP_DIALOG_FILE_TO_OPEN_PROPERTY:
		pf_choose_app_dialog_set_file_to_open (self, g_value_get_object (value));
		break;
		case PF_CHOOSE_APP_DIALOG_PARENT_PROPERTY:
		pf_choose_app_dialog_set_parent (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

