/* display.c generated by valac 0.16.0.2-f2187, the Vala compiler
 * generated from display.vala, do not modify */

/* This file is part of GNOME Boxes. License: LGPLv2+*/

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


#define BOXES_TYPE_IPROPERTIES_PROVIDER (boxes_iproperties_provider_get_type ())
#define BOXES_IPROPERTIES_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_IPROPERTIES_PROVIDER, BoxesIPropertiesProvider))
#define BOXES_IS_IPROPERTIES_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_IPROPERTIES_PROVIDER))
#define BOXES_IPROPERTIES_PROVIDER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), BOXES_TYPE_IPROPERTIES_PROVIDER, BoxesIPropertiesProviderIface))

typedef struct _BoxesIPropertiesProvider BoxesIPropertiesProvider;
typedef struct _BoxesIPropertiesProviderIface BoxesIPropertiesProviderIface;

#define BOXES_TYPE_PROPERTIES_PAGE (boxes_properties_page_get_type ())

#define BOXES_TYPE_PAIR (boxes_pair_get_type ())
#define BOXES_PAIR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_PAIR, BoxesPair))
#define BOXES_PAIR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_PAIR, BoxesPairClass))
#define BOXES_IS_PAIR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_PAIR))
#define BOXES_IS_PAIR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_PAIR))
#define BOXES_PAIR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_PAIR, BoxesPairClass))

typedef struct _BoxesPair BoxesPair;
typedef struct _BoxesPairClass BoxesPairClass;

#define BOXES_TYPE_DISPLAY (boxes_display_get_type ())
#define BOXES_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_DISPLAY, BoxesDisplay))
#define BOXES_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_DISPLAY, BoxesDisplayClass))
#define BOXES_IS_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_DISPLAY))
#define BOXES_IS_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_DISPLAY))
#define BOXES_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_DISPLAY, BoxesDisplayClass))

typedef struct _BoxesDisplay BoxesDisplay;
typedef struct _BoxesDisplayClass BoxesDisplayClass;
typedef struct _BoxesDisplayPrivate BoxesDisplayPrivate;

#define BOXES_TYPE_DISPLAY_CONFIG (boxes_display_config_get_type ())
#define BOXES_DISPLAY_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_DISPLAY_CONFIG, BoxesDisplayConfig))
#define BOXES_DISPLAY_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_DISPLAY_CONFIG, BoxesDisplayConfigClass))
#define BOXES_IS_DISPLAY_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_DISPLAY_CONFIG))
#define BOXES_IS_DISPLAY_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_DISPLAY_CONFIG))
#define BOXES_DISPLAY_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_DISPLAY_CONFIG, BoxesDisplayConfigClass))

typedef struct _BoxesDisplayConfig BoxesDisplayConfig;
typedef struct _BoxesDisplayConfigClass BoxesDisplayConfigClass;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define BOXES_DISPLAY_TYPE_SAVED_PROPERTY (boxes_display_saved_property_get_type ())
typedef struct _BoxesDisplaySavedProperty BoxesDisplaySavedProperty;
typedef struct _Block9Data Block9Data;

typedef enum  {
	BOXES_PROPERTIES_PAGE_LOGIN,
	BOXES_PROPERTIES_PAGE_SYSTEM,
	BOXES_PROPERTIES_PAGE_DISPLAY,
	BOXES_PROPERTIES_PAGE_DEVICES,
	BOXES_PROPERTIES_PAGE_LAST
} BoxesPropertiesPage;

struct _BoxesIPropertiesProviderIface {
	GTypeInterface parent_iface;
	GList* (*get_properties) (BoxesIPropertiesProvider* self, BoxesPropertiesPage page);
};

typedef enum  {
	BOXES_ERROR_INVALID,
	BOXES_ERROR_COMMAND_FAILED
} BoxesError;
#define BOXES_ERROR boxes_error_quark ()
struct _BoxesDisplay {
	GObject parent_instance;
	BoxesDisplayPrivate * priv;
	GHashTable* displays;
};

struct _BoxesDisplayClass {
	GObjectClass parent_class;
	GtkWidget* (*get_display) (BoxesDisplay* self, gint n, GError** error);
	GdkPixbuf* (*get_pixbuf) (BoxesDisplay* self, gint n, GError** error);
	void (*set_enable_inputs) (BoxesDisplay* self, GtkWidget* widget, gboolean enable);
	void (*connect_it) (BoxesDisplay* self);
	void (*disconnect_it) (BoxesDisplay* self);
	GList* (*get_properties) (BoxesDisplay* self, BoxesPropertiesPage page);
	const gchar* (*get_protocol) (BoxesDisplay* self);
	gchar* (*get_uri) (BoxesDisplay* self);
};

struct _BoxesDisplayPrivate {
	gboolean _can_grab_mouse;
	gboolean _mouse_grabbed;
	gboolean _need_password;
	gboolean _need_username;
	gchar* _password;
	gchar* _username;
	BoxesDisplayConfig* _config;
};

struct _BoxesDisplaySavedProperty {
	gchar* name;
	GValue default_value;
};

struct _Block9Data {
	int _ref_count_;
	BoxesDisplay * self;
	GObject* display;
	BoxesDisplaySavedProperty* saved_properties;
	gint saved_properties_length1;
};


static gpointer boxes_display_parent_class = NULL;
static BoxesIPropertiesProviderIface* boxes_display_boxes_iproperties_provider_parent_iface = NULL;

GType boxes_properties_page_get_type (void) G_GNUC_CONST;
gpointer boxes_pair_ref (gpointer instance);
void boxes_pair_unref (gpointer instance);
GParamSpec* boxes_param_spec_pair (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void boxes_value_set_pair (GValue* value, gpointer v_object);
void boxes_value_take_pair (GValue* value, gpointer v_object);
gpointer boxes_value_get_pair (const GValue* value);
GType boxes_pair_get_type (void) G_GNUC_CONST;
GType boxes_iproperties_provider_get_type (void) G_GNUC_CONST;
GType boxes_display_get_type (void) G_GNUC_CONST;
GQuark boxes_error_quark (void);
GType boxes_display_config_get_type (void) G_GNUC_CONST;
#define BOXES_DISPLAY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_DISPLAY, BoxesDisplayPrivate))
enum  {
	BOXES_DISPLAY_DUMMY_PROPERTY,
	BOXES_DISPLAY_PROTOCOL,
	BOXES_DISPLAY_URI,
	BOXES_DISPLAY_CAN_GRAB_MOUSE,
	BOXES_DISPLAY_MOUSE_GRABBED,
	BOXES_DISPLAY_NEED_PASSWORD,
	BOXES_DISPLAY_NEED_USERNAME,
	BOXES_DISPLAY_PASSWORD,
	BOXES_DISPLAY_USERNAME,
	BOXES_DISPLAY_CONFIG
};
GtkWidget* boxes_display_get_display (BoxesDisplay* self, gint n, GError** error);
static GtkWidget* boxes_display_real_get_display (BoxesDisplay* self, gint n, GError** error);
GdkPixbuf* boxes_display_get_pixbuf (BoxesDisplay* self, gint n, GError** error);
static GdkPixbuf* boxes_display_real_get_pixbuf (BoxesDisplay* self, gint n, GError** error);
void boxes_display_set_enable_inputs (BoxesDisplay* self, GtkWidget* widget, gboolean enable);
static void boxes_display_real_set_enable_inputs (BoxesDisplay* self, GtkWidget* widget, gboolean enable);
void boxes_display_connect_it (BoxesDisplay* self);
static void boxes_display_real_connect_it (BoxesDisplay* self);
void boxes_display_disconnect_it (BoxesDisplay* self);
static void boxes_display_real_disconnect_it (BoxesDisplay* self);
GList* boxes_display_get_properties (BoxesDisplay* self, BoxesPropertiesPage page);
static GList* boxes_display_real_get_properties (BoxesDisplay* self, BoxesPropertiesPage page);
GType boxes_display_saved_property_get_type (void) G_GNUC_CONST;
BoxesDisplaySavedProperty* boxes_display_saved_property_dup (const BoxesDisplaySavedProperty* self);
void boxes_display_saved_property_free (BoxesDisplaySavedProperty* self);
void boxes_display_saved_property_copy (const BoxesDisplaySavedProperty* self, BoxesDisplaySavedProperty* dest);
void boxes_display_saved_property_destroy (BoxesDisplaySavedProperty* self);
void boxes_display_sync_config_with_display (BoxesDisplay* self, GObject* display, BoxesDisplaySavedProperty* saved_properties, int saved_properties_length1);
static Block9Data* block9_data_ref (Block9Data* _data9_);
static void block9_data_unref (void * _userdata_);
BoxesDisplayConfig* boxes_display_get_config (BoxesDisplay* self);
void boxes_display_config_load_display_property (BoxesDisplayConfig* self, GObject* display, const gchar* property_name, GValue* default_value);
static void __lambda17_ (Block9Data* _data9_, GParamSpec* pspec);
void boxes_display_config_save_display_property (BoxesDisplayConfig* self, GObject* display, const gchar* property_name);
static void ___lambda17__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
BoxesDisplay* boxes_display_construct (GType object_type);
const gchar* boxes_display_get_protocol (BoxesDisplay* self);
gchar* boxes_display_get_uri (BoxesDisplay* self);
gboolean boxes_display_get_can_grab_mouse (BoxesDisplay* self);
void boxes_display_set_can_grab_mouse (BoxesDisplay* self, gboolean value);
gboolean boxes_display_get_mouse_grabbed (BoxesDisplay* self);
void boxes_display_set_mouse_grabbed (BoxesDisplay* self, gboolean value);
gboolean boxes_display_get_need_password (BoxesDisplay* self);
void boxes_display_set_need_password (BoxesDisplay* self, gboolean value);
gboolean boxes_display_get_need_username (BoxesDisplay* self);
void boxes_display_set_need_username (BoxesDisplay* self, gboolean value);
const gchar* boxes_display_get_password (BoxesDisplay* self);
void boxes_display_set_password (BoxesDisplay* self, const gchar* value);
const gchar* boxes_display_get_username (BoxesDisplay* self);
void boxes_display_set_username (BoxesDisplay* self, const gchar* value);
void boxes_display_set_config (BoxesDisplay* self, BoxesDisplayConfig* value);
static GObject * boxes_display_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void _g_object_unref0_ (gpointer var);
static void boxes_display_finalize (GObject* obj);
static void _vala_boxes_display_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_boxes_display_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


static GtkWidget* boxes_display_real_get_display (BoxesDisplay* self, gint n, GError** error) {
	g_critical ("Type `%s' does not implement abstract method `boxes_display_get_display'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}


GtkWidget* boxes_display_get_display (BoxesDisplay* self, gint n, GError** error) {
	g_return_val_if_fail (self != NULL, NULL);
	return BOXES_DISPLAY_GET_CLASS (self)->get_display (self, n, error);
}


static GdkPixbuf* boxes_display_real_get_pixbuf (BoxesDisplay* self, gint n, GError** error) {
	g_critical ("Type `%s' does not implement abstract method `boxes_display_get_pixbuf'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}


GdkPixbuf* boxes_display_get_pixbuf (BoxesDisplay* self, gint n, GError** error) {
	g_return_val_if_fail (self != NULL, NULL);
	return BOXES_DISPLAY_GET_CLASS (self)->get_pixbuf (self, n, error);
}


static void boxes_display_real_set_enable_inputs (BoxesDisplay* self, GtkWidget* widget, gboolean enable) {
	g_critical ("Type `%s' does not implement abstract method `boxes_display_set_enable_inputs'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}


void boxes_display_set_enable_inputs (BoxesDisplay* self, GtkWidget* widget, gboolean enable) {
	g_return_if_fail (self != NULL);
	BOXES_DISPLAY_GET_CLASS (self)->set_enable_inputs (self, widget, enable);
}


static void boxes_display_real_connect_it (BoxesDisplay* self) {
	g_critical ("Type `%s' does not implement abstract method `boxes_display_connect_it'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}


void boxes_display_connect_it (BoxesDisplay* self) {
	g_return_if_fail (self != NULL);
	BOXES_DISPLAY_GET_CLASS (self)->connect_it (self);
}


static void boxes_display_real_disconnect_it (BoxesDisplay* self) {
	g_critical ("Type `%s' does not implement abstract method `boxes_display_disconnect_it'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}


void boxes_display_disconnect_it (BoxesDisplay* self) {
	g_return_if_fail (self != NULL);
	BOXES_DISPLAY_GET_CLASS (self)->disconnect_it (self);
}


static GList* boxes_display_real_get_properties (BoxesDisplay* self, BoxesPropertiesPage page) {
	g_critical ("Type `%s' does not implement abstract method `boxes_display_get_properties'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}


GList* boxes_display_get_properties (BoxesDisplay* self, BoxesPropertiesPage page) {
	g_return_val_if_fail (self != NULL, NULL);
	return BOXES_DISPLAY_GET_CLASS (self)->get_properties (self, page);
}


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


static Block9Data* block9_data_ref (Block9Data* _data9_) {
	g_atomic_int_inc (&_data9_->_ref_count_);
	return _data9_;
}


static void block9_data_unref (void * _userdata_) {
	Block9Data* _data9_;
	_data9_ = (Block9Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data9_->_ref_count_)) {
		BoxesDisplay * self;
		self = _data9_->self;
		_g_object_unref0 (_data9_->display);
		_g_object_unref0 (self);
		g_slice_free (Block9Data, _data9_);
	}
}


static void __lambda17_ (Block9Data* _data9_, GParamSpec* pspec) {
	BoxesDisplay * self;
	BoxesDisplaySavedProperty* _tmp0_;
	gint _tmp0__length1;
	self = _data9_->self;
	g_return_if_fail (pspec != NULL);
	_tmp0_ = _data9_->saved_properties;
	_tmp0__length1 = _data9_->saved_properties_length1;
	{
		BoxesDisplaySavedProperty* prop_collection = NULL;
		gint prop_collection_length1 = 0;
		gint _prop_collection_size_ = 0;
		gint prop_it = 0;
		prop_collection = _tmp0_;
		prop_collection_length1 = _tmp0__length1;
		for (prop_it = 0; prop_it < _tmp0__length1; prop_it = prop_it + 1) {
			BoxesDisplaySavedProperty _tmp1_ = {0};
			BoxesDisplaySavedProperty prop = {0};
			boxes_display_saved_property_copy (&prop_collection[prop_it], &_tmp1_);
			prop = _tmp1_;
			{
				GParamSpec* _tmp2_;
				const gchar* _tmp3_;
				BoxesDisplaySavedProperty _tmp4_;
				const gchar* _tmp5_;
				_tmp2_ = pspec;
				_tmp3_ = _tmp2_->name;
				_tmp4_ = prop;
				_tmp5_ = _tmp4_.name;
				if (g_strcmp0 (_tmp3_, _tmp5_) == 0) {
					BoxesDisplayConfig* _tmp6_;
					GObject* _tmp7_;
					GParamSpec* _tmp8_;
					const gchar* _tmp9_;
					_tmp6_ = self->priv->_config;
					_tmp7_ = _data9_->display;
					_tmp8_ = pspec;
					_tmp9_ = _tmp8_->name;
					boxes_display_config_save_display_property (_tmp6_, _tmp7_, _tmp9_);
					boxes_display_saved_property_destroy (&prop);
					break;
				}
				boxes_display_saved_property_destroy (&prop);
			}
		}
	}
}


static void ___lambda17__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda17_ (self, pspec);
}


void boxes_display_sync_config_with_display (BoxesDisplay* self, GObject* display, BoxesDisplaySavedProperty* saved_properties, int saved_properties_length1) {
	Block9Data* _data9_;
	GObject* _tmp0_;
	GObject* _tmp1_;
	BoxesDisplaySavedProperty* _tmp2_;
	gint _tmp2__length1;
	BoxesDisplayConfig* _tmp3_;
	BoxesDisplaySavedProperty* _tmp4_;
	gint _tmp4__length1;
	GObject* _tmp12_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (display != NULL);
	_data9_ = g_slice_new0 (Block9Data);
	_data9_->_ref_count_ = 1;
	_data9_->self = g_object_ref (self);
	_tmp0_ = display;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_data9_->display = _tmp1_;
	_tmp2_ = saved_properties;
	_tmp2__length1 = saved_properties_length1;
	_data9_->saved_properties = _tmp2_;
	_data9_->saved_properties_length1 = _tmp2__length1;
	_tmp3_ = self->priv->_config;
	if (_tmp3_ == NULL) {
		block9_data_unref (_data9_);
		_data9_ = NULL;
		return;
	}
	_tmp4_ = _data9_->saved_properties;
	_tmp4__length1 = _data9_->saved_properties_length1;
	{
		BoxesDisplaySavedProperty* prop_collection = NULL;
		gint prop_collection_length1 = 0;
		gint _prop_collection_size_ = 0;
		gint prop_it = 0;
		prop_collection = _tmp4_;
		prop_collection_length1 = _tmp4__length1;
		for (prop_it = 0; prop_it < _tmp4__length1; prop_it = prop_it + 1) {
			BoxesDisplaySavedProperty _tmp5_ = {0};
			BoxesDisplaySavedProperty prop = {0};
			boxes_display_saved_property_copy (&prop_collection[prop_it], &_tmp5_);
			prop = _tmp5_;
			{
				BoxesDisplayConfig* _tmp6_;
				GObject* _tmp7_;
				BoxesDisplaySavedProperty _tmp8_;
				const gchar* _tmp9_;
				BoxesDisplaySavedProperty _tmp10_;
				GValue _tmp11_;
				_tmp6_ = self->priv->_config;
				_tmp7_ = _data9_->display;
				_tmp8_ = prop;
				_tmp9_ = _tmp8_.name;
				_tmp10_ = prop;
				_tmp11_ = _tmp10_.default_value;
				boxes_display_config_load_display_property (_tmp6_, _tmp7_, _tmp9_, &_tmp11_);
				boxes_display_saved_property_destroy (&prop);
			}
		}
	}
	_tmp12_ = _data9_->display;
	g_signal_connect_data (_tmp12_, "notify", (GCallback) ___lambda17__g_object_notify, block9_data_ref (_data9_), (GClosureNotify) block9_data_unref, 0);
	block9_data_unref (_data9_);
	_data9_ = NULL;
}


BoxesDisplay* boxes_display_construct (GType object_type) {
	BoxesDisplay * self = NULL;
	self = (BoxesDisplay*) g_object_new (object_type, NULL);
	return self;
}


const gchar* boxes_display_get_protocol (BoxesDisplay* self) {
	g_return_val_if_fail (self != NULL, NULL);
	return BOXES_DISPLAY_GET_CLASS (self)->get_protocol (self);
}


gchar* boxes_display_get_uri (BoxesDisplay* self) {
	g_return_val_if_fail (self != NULL, NULL);
	return BOXES_DISPLAY_GET_CLASS (self)->get_uri (self);
}


gboolean boxes_display_get_can_grab_mouse (BoxesDisplay* self) {
	gboolean result;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_can_grab_mouse;
	result = _tmp0_;
	return result;
}


void boxes_display_set_can_grab_mouse (BoxesDisplay* self, gboolean value) {
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_can_grab_mouse = _tmp0_;
	g_object_notify ((GObject *) self, "can-grab-mouse");
}


gboolean boxes_display_get_mouse_grabbed (BoxesDisplay* self) {
	gboolean result;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_mouse_grabbed;
	result = _tmp0_;
	return result;
}


void boxes_display_set_mouse_grabbed (BoxesDisplay* self, gboolean value) {
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_mouse_grabbed = _tmp0_;
	g_object_notify ((GObject *) self, "mouse-grabbed");
}


gboolean boxes_display_get_need_password (BoxesDisplay* self) {
	gboolean result;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_need_password;
	result = _tmp0_;
	return result;
}


void boxes_display_set_need_password (BoxesDisplay* self, gboolean value) {
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_need_password = _tmp0_;
	g_object_notify ((GObject *) self, "need-password");
}


gboolean boxes_display_get_need_username (BoxesDisplay* self) {
	gboolean result;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_need_username;
	result = _tmp0_;
	return result;
}


void boxes_display_set_need_username (BoxesDisplay* self, gboolean value) {
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_need_username = _tmp0_;
	g_object_notify ((GObject *) self, "need-username");
}


const gchar* boxes_display_get_password (BoxesDisplay* self) {
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_password;
	result = _tmp0_;
	return result;
}


void boxes_display_set_password (BoxesDisplay* self, const gchar* value) {
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->priv->_password);
	self->priv->_password = _tmp1_;
	g_object_notify ((GObject *) self, "password");
}


const gchar* boxes_display_get_username (BoxesDisplay* self) {
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_username;
	result = _tmp0_;
	return result;
}


void boxes_display_set_username (BoxesDisplay* self, const gchar* value) {
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->priv->_username);
	self->priv->_username = _tmp1_;
	g_object_notify ((GObject *) self, "username");
}


BoxesDisplayConfig* boxes_display_get_config (BoxesDisplay* self) {
	BoxesDisplayConfig* result;
	BoxesDisplayConfig* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_config;
	result = _tmp0_;
	return result;
}


void boxes_display_set_config (BoxesDisplay* self, BoxesDisplayConfig* value) {
	BoxesDisplayConfig* _tmp0_;
	BoxesDisplayConfig* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->_config);
	self->priv->_config = _tmp1_;
	g_object_notify ((GObject *) self, "config");
}


static void _g_object_unref0_ (gpointer var) {
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}


static GObject * boxes_display_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	BoxesDisplay * self;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GHashTable* _tmp2_;
	parent_class = G_OBJECT_CLASS (boxes_display_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = BOXES_DISPLAY (obj);
	_tmp0_ = g_direct_hash;
	_tmp1_ = g_direct_equal;
	_tmp2_ = g_hash_table_new_full (_tmp0_, _tmp1_, NULL, _g_object_unref0_);
	_g_hash_table_unref0 (self->displays);
	self->displays = _tmp2_;
	return obj;
}


void boxes_display_saved_property_copy (const BoxesDisplaySavedProperty* self, BoxesDisplaySavedProperty* dest) {
	const gchar* _tmp0_;
	gchar* _tmp1_;
	GValue _tmp2_;
	GValue _tmp3_ = {0};
	_tmp0_ = (*self).name;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 ((*dest).name);
	(*dest).name = _tmp1_;
	_tmp2_ = (*self).default_value;
	if (G_IS_VALUE (&_tmp2_)) {
		g_value_init (&_tmp3_, G_VALUE_TYPE (&_tmp2_));
		g_value_copy (&_tmp2_, &_tmp3_);
	} else {
		_tmp3_ = _tmp2_;
	}
	G_IS_VALUE (&(*dest).default_value) ? (g_value_unset (&(*dest).default_value), NULL) : NULL;
	(*dest).default_value = _tmp3_;
}


void boxes_display_saved_property_destroy (BoxesDisplaySavedProperty* self) {
	_g_free0 ((*self).name);
	G_IS_VALUE (&(*self).default_value) ? (g_value_unset (&(*self).default_value), NULL) : NULL;
}


BoxesDisplaySavedProperty* boxes_display_saved_property_dup (const BoxesDisplaySavedProperty* self) {
	BoxesDisplaySavedProperty* dup;
	dup = g_new0 (BoxesDisplaySavedProperty, 1);
	boxes_display_saved_property_copy (self, dup);
	return dup;
}


void boxes_display_saved_property_free (BoxesDisplaySavedProperty* self) {
	boxes_display_saved_property_destroy (self);
	g_free (self);
}


GType boxes_display_saved_property_get_type (void) {
	static volatile gsize boxes_display_saved_property_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_display_saved_property_type_id__volatile)) {
		GType boxes_display_saved_property_type_id;
		boxes_display_saved_property_type_id = g_boxed_type_register_static ("BoxesDisplaySavedProperty", (GBoxedCopyFunc) boxes_display_saved_property_dup, (GBoxedFreeFunc) boxes_display_saved_property_free);
		g_once_init_leave (&boxes_display_saved_property_type_id__volatile, boxes_display_saved_property_type_id);
	}
	return boxes_display_saved_property_type_id__volatile;
}


static void boxes_display_class_init (BoxesDisplayClass * klass) {
	boxes_display_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (BoxesDisplayPrivate));
	BOXES_DISPLAY_CLASS (klass)->get_display = boxes_display_real_get_display;
	BOXES_DISPLAY_CLASS (klass)->get_pixbuf = boxes_display_real_get_pixbuf;
	BOXES_DISPLAY_CLASS (klass)->set_enable_inputs = boxes_display_real_set_enable_inputs;
	BOXES_DISPLAY_CLASS (klass)->connect_it = boxes_display_real_connect_it;
	BOXES_DISPLAY_CLASS (klass)->disconnect_it = boxes_display_real_disconnect_it;
	BOXES_DISPLAY_CLASS (klass)->get_properties = boxes_display_real_get_properties;
	G_OBJECT_CLASS (klass)->get_property = _vala_boxes_display_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_boxes_display_set_property;
	G_OBJECT_CLASS (klass)->constructor = boxes_display_constructor;
	G_OBJECT_CLASS (klass)->finalize = boxes_display_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_DISPLAY_PROTOCOL, g_param_spec_string ("protocol", "protocol", "protocol", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_DISPLAY_URI, g_param_spec_string ("uri", "uri", "uri", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_DISPLAY_CAN_GRAB_MOUSE, g_param_spec_boolean ("can-grab-mouse", "can-grab-mouse", "can-grab-mouse", 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_DISPLAY_MOUSE_GRABBED, g_param_spec_boolean ("mouse-grabbed", "mouse-grabbed", "mouse-grabbed", 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_DISPLAY_NEED_PASSWORD, g_param_spec_boolean ("need-password", "need-password", "need-password", 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_DISPLAY_NEED_USERNAME, g_param_spec_boolean ("need-username", "need-username", "need-username", 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_DISPLAY_PASSWORD, g_param_spec_string ("password", "password", "password", 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_DISPLAY_USERNAME, g_param_spec_string ("username", "username", "username", 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_DISPLAY_CONFIG, g_param_spec_object ("config", "config", "config", BOXES_TYPE_DISPLAY_CONFIG, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_signal_new ("show", BOXES_TYPE_DISPLAY, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
	g_signal_new ("hide", BOXES_TYPE_DISPLAY, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
	g_signal_new ("disconnected", BOXES_TYPE_DISPLAY, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}


static void boxes_display_boxes_iproperties_provider_interface_init (BoxesIPropertiesProviderIface * iface) {
	boxes_display_boxes_iproperties_provider_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_properties = (GList* (*)(BoxesIPropertiesProvider*, BoxesPropertiesPage)) boxes_display_get_properties;
}


static void boxes_display_instance_init (BoxesDisplay * self) {
	self->priv = BOXES_DISPLAY_GET_PRIVATE (self);
}


static void boxes_display_finalize (GObject* obj) {
	BoxesDisplay * self;
	self = BOXES_DISPLAY (obj);
	_g_free0 (self->priv->_password);
	_g_free0 (self->priv->_username);
	_g_hash_table_unref0 (self->displays);
	_g_object_unref0 (self->priv->_config);
	G_OBJECT_CLASS (boxes_display_parent_class)->finalize (obj);
}


GType boxes_display_get_type (void) {
	static volatile gsize boxes_display_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_display_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BoxesDisplayClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_display_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesDisplay), 0, (GInstanceInitFunc) boxes_display_instance_init, NULL };
		static const GInterfaceInfo boxes_iproperties_provider_info = { (GInterfaceInitFunc) boxes_display_boxes_iproperties_provider_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType boxes_display_type_id;
		boxes_display_type_id = g_type_register_static (G_TYPE_OBJECT, "BoxesDisplay", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
		g_type_add_interface_static (boxes_display_type_id, BOXES_TYPE_IPROPERTIES_PROVIDER, &boxes_iproperties_provider_info);
		g_once_init_leave (&boxes_display_type_id__volatile, boxes_display_type_id);
	}
	return boxes_display_type_id__volatile;
}


static void _vala_boxes_display_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	BoxesDisplay * self;
	self = BOXES_DISPLAY (object);
	switch (property_id) {
		case BOXES_DISPLAY_CAN_GRAB_MOUSE:
		g_value_set_boolean (value, boxes_display_get_can_grab_mouse (self));
		break;
		case BOXES_DISPLAY_MOUSE_GRABBED:
		g_value_set_boolean (value, boxes_display_get_mouse_grabbed (self));
		break;
		case BOXES_DISPLAY_NEED_PASSWORD:
		g_value_set_boolean (value, boxes_display_get_need_password (self));
		break;
		case BOXES_DISPLAY_NEED_USERNAME:
		g_value_set_boolean (value, boxes_display_get_need_username (self));
		break;
		case BOXES_DISPLAY_PASSWORD:
		g_value_set_string (value, boxes_display_get_password (self));
		break;
		case BOXES_DISPLAY_USERNAME:
		g_value_set_string (value, boxes_display_get_username (self));
		break;
		case BOXES_DISPLAY_CONFIG:
		g_value_set_object (value, boxes_display_get_config (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_boxes_display_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	BoxesDisplay * self;
	self = BOXES_DISPLAY (object);
	switch (property_id) {
		case BOXES_DISPLAY_CAN_GRAB_MOUSE:
		boxes_display_set_can_grab_mouse (self, g_value_get_boolean (value));
		break;
		case BOXES_DISPLAY_MOUSE_GRABBED:
		boxes_display_set_mouse_grabbed (self, g_value_get_boolean (value));
		break;
		case BOXES_DISPLAY_NEED_PASSWORD:
		boxes_display_set_need_password (self, g_value_get_boolean (value));
		break;
		case BOXES_DISPLAY_NEED_USERNAME:
		boxes_display_set_need_username (self, g_value_get_boolean (value));
		break;
		case BOXES_DISPLAY_PASSWORD:
		boxes_display_set_password (self, g_value_get_string (value));
		break;
		case BOXES_DISPLAY_USERNAME:
		boxes_display_set_username (self, g_value_get_string (value));
		break;
		case BOXES_DISPLAY_CONFIG:
		boxes_display_set_config (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}



