/* DisplayConfig.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from DisplayConfig.vala, do not modify */

/*
 * Copyright 2024 elementary, Inc. (https://elementary.io)
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

#include <glib-object.h>
#include <gio/gio.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <math.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 WINGPANEL_SERVICES_TYPE_DISPLAY_CONFIG (wingpanel_services_display_config_get_type ())
#define WINGPANEL_SERVICES_DISPLAY_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WINGPANEL_SERVICES_TYPE_DISPLAY_CONFIG, WingpanelServicesDisplayConfig))
#define WINGPANEL_SERVICES_IS_DISPLAY_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WINGPANEL_SERVICES_TYPE_DISPLAY_CONFIG))
#define WINGPANEL_SERVICES_DISPLAY_CONFIG_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), WINGPANEL_SERVICES_TYPE_DISPLAY_CONFIG, WingpanelServicesDisplayConfigIface))

typedef struct _WingpanelServicesDisplayConfig WingpanelServicesDisplayConfig;
typedef struct _WingpanelServicesDisplayConfigIface WingpanelServicesDisplayConfigIface;

#define WINGPANEL_SERVICES_TYPE_DISPLAY_CONFIG_PROXY (wingpanel_services_display_config_proxy_get_type ())

#define TYPE_MUTTER_READ_MONITOR (mutter_read_monitor_get_type ())
typedef struct _MutterReadMonitor MutterReadMonitor;

#define TYPE_MUTTER_READ_MONITOR_INFO (mutter_read_monitor_info_get_type ())
typedef struct _MutterReadMonitorInfo MutterReadMonitorInfo;

#define TYPE_MUTTER_READ_MONITOR_MODE (mutter_read_monitor_mode_get_type ())
typedef struct _MutterReadMonitorMode MutterReadMonitorMode;

#define TYPE_MUTTER_READ_LOGICAL_MONITOR (mutter_read_logical_monitor_get_type ())
typedef struct _MutterReadLogicalMonitor MutterReadLogicalMonitor;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) ((var == NULL) ? NULL : (var = (g_free (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
enum  {
	WINGPANEL_SERVICES_DISPLAY_CONFIG_MONITORS_CHANGED_SIGNAL,
	WINGPANEL_SERVICES_DISPLAY_CONFIG_NUM_SIGNALS
};
static guint wingpanel_services_display_config_signals[WINGPANEL_SERVICES_DISPLAY_CONFIG_NUM_SIGNALS] = {0};
typedef GDBusProxy WingpanelServicesDisplayConfigProxy;
typedef GDBusProxyClass WingpanelServicesDisplayConfigProxyClass;

struct _MutterReadMonitorInfo {
	gchar* connector;
	gchar* vendor;
	gchar* product;
	gchar* serial;
};

struct _MutterReadMonitorMode {
	gchar* id;
	gint width;
	gint height;
	gdouble frequency;
	gdouble preferred_scale;
	gdouble* supported_scales;
	gint supported_scales_length1;
	GHashTable* properties;
};

struct _MutterReadMonitor {
	MutterReadMonitorInfo monitor;
	MutterReadMonitorMode* modes;
	gint modes_length1;
	GHashTable* properties;
};

struct _MutterReadLogicalMonitor {
	gint x;
	gint y;
	gdouble scale;
	guint transform;
	gboolean primary;
	MutterReadMonitorInfo* monitors;
	gint monitors_length1;
	GHashTable* properties;
};

struct _WingpanelServicesDisplayConfigIface {
	GTypeInterface parent_iface;
	void (*get_current_state) (WingpanelServicesDisplayConfig* self, guint* serial, MutterReadMonitor** monitors, gint* monitors_length1, MutterReadLogicalMonitor** logical_monitors, gint* logical_monitors_length1, GHashTable** properties, GError** error);
};

static gboolean* wingpanel_services_display_config__is_logical_layout;
static gboolean* wingpanel_services_display_config__is_logical_layout = NULL;
static WingpanelServicesDisplayConfig* wingpanel_services_display_config_proxy;
static WingpanelServicesDisplayConfig* wingpanel_services_display_config_proxy = NULL;

VALA_EXTERN GType wingpanel_services_display_config_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint wingpanel_services_display_config_register_object (void* object,
                                                         GDBusConnection* connection,
                                                         const gchar* path,
                                                         GError** error);
VALA_EXTERN GType mutter_read_monitor_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType mutter_read_monitor_info_get_type (void) G_GNUC_CONST ;
VALA_EXTERN MutterReadMonitorInfo* mutter_read_monitor_info_dup (const MutterReadMonitorInfo* self);
VALA_EXTERN void mutter_read_monitor_info_free (MutterReadMonitorInfo* self);
VALA_EXTERN void mutter_read_monitor_info_copy (const MutterReadMonitorInfo* self,
                                    MutterReadMonitorInfo* dest);
VALA_EXTERN void mutter_read_monitor_info_destroy (MutterReadMonitorInfo* self);
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (MutterReadMonitorInfo, mutter_read_monitor_info_destroy)
VALA_EXTERN GType mutter_read_monitor_mode_get_type (void) G_GNUC_CONST ;
VALA_EXTERN MutterReadMonitorMode* mutter_read_monitor_mode_dup (const MutterReadMonitorMode* self);
VALA_EXTERN void mutter_read_monitor_mode_free (MutterReadMonitorMode* self);
VALA_EXTERN void mutter_read_monitor_mode_copy (const MutterReadMonitorMode* self,
                                    MutterReadMonitorMode* dest);
VALA_EXTERN void mutter_read_monitor_mode_destroy (MutterReadMonitorMode* self);
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (MutterReadMonitorMode, mutter_read_monitor_mode_destroy)
VALA_EXTERN MutterReadMonitor* mutter_read_monitor_dup (const MutterReadMonitor* self);
VALA_EXTERN void mutter_read_monitor_free (MutterReadMonitor* self);
VALA_EXTERN void mutter_read_monitor_copy (const MutterReadMonitor* self,
                               MutterReadMonitor* dest);
VALA_EXTERN void mutter_read_monitor_destroy (MutterReadMonitor* self);
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (MutterReadMonitor, mutter_read_monitor_destroy)
VALA_EXTERN GType mutter_read_logical_monitor_get_type (void) G_GNUC_CONST ;
VALA_EXTERN MutterReadLogicalMonitor* mutter_read_logical_monitor_dup (const MutterReadLogicalMonitor* self);
VALA_EXTERN void mutter_read_logical_monitor_free (MutterReadLogicalMonitor* self);
VALA_EXTERN void mutter_read_logical_monitor_copy (const MutterReadLogicalMonitor* self,
                                       MutterReadLogicalMonitor* dest);
VALA_EXTERN void mutter_read_logical_monitor_destroy (MutterReadLogicalMonitor* self);
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (MutterReadLogicalMonitor, mutter_read_logical_monitor_destroy)
VALA_EXTERN GType wingpanel_services_display_config_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WingpanelServicesDisplayConfig, g_object_unref)
VALA_EXTERN gboolean wingpanel_services_display_config_is_logical_layout (void);
static void wingpanel_services_display_config_init (void);
static void wingpanel_services_display_config_update (void);
static void _wingpanel_services_display_config_update_wingpanel_services_display_config_monitors_changed (WingpanelServicesDisplayConfig* _sender,
                                                                                                   gpointer self);
static gboolean* _bool_dup (gboolean* self);
VALA_EXTERN void wingpanel_services_display_config_get_current_state (WingpanelServicesDisplayConfig* self,
                                                          guint* serial,
                                                          MutterReadMonitor** monitors,
                                                          gint* monitors_length1,
                                                          MutterReadLogicalMonitor** logical_monitors,
                                                          gint* logical_monitors_length1,
                                                          GHashTable** properties,
                                                          GError** error);
static void _vala_MutterReadMonitor_array_free (MutterReadMonitor * array,
                                         gssize array_length);
static void _vala_MutterReadLogicalMonitor_array_free (MutterReadLogicalMonitor * array,
                                                gssize array_length);
static GType wingpanel_services_display_config_get_type_once (void);
static void wingpanel_services_display_config_proxy_g_signal (GDBusProxy* proxy,
                                                       const gchar* sender_name,
                                                       const gchar* signal_name,
                                                       GVariant* parameters);
static void _dbus_handle_wingpanel_services_display_config_monitors_changed (WingpanelServicesDisplayConfig* self,
                                                                      GVariant* parameters);
static void wingpanel_services_display_config_proxy_get_current_state (WingpanelServicesDisplayConfig* self,
                                                                guint* serial,
                                                                MutterReadMonitor** monitors,
                                                                gint* monitors_length1,
                                                                MutterReadLogicalMonitor** logical_monitors,
                                                                gint* logical_monitors_length1,
                                                                GHashTable** properties,
                                                                GError** error);
static void wingpanel_services_display_config_proxy_wingpanel_services_display_config_interface_init (WingpanelServicesDisplayConfigIface* iface);
static void _dbus_wingpanel_services_display_config_get_current_state (WingpanelServicesDisplayConfig* self,
                                                                GVariant* _parameters_,
                                                                GDBusMethodInvocation* invocation);
static void wingpanel_services_display_config_dbus_interface_method_call (GDBusConnection* connection,
                                                                   const gchar* sender,
                                                                   const gchar* object_path,
                                                                   const gchar* interface_name,
                                                                   const gchar* method_name,
                                                                   GVariant* parameters,
                                                                   GDBusMethodInvocation* invocation,
                                                                   gpointer user_data);
static GVariant* wingpanel_services_display_config_dbus_interface_get_property (GDBusConnection* connection,
                                                                         const gchar* sender,
                                                                         const gchar* object_path,
                                                                         const gchar* interface_name,
                                                                         const gchar* property_name,
                                                                         GError** error,
                                                                         gpointer user_data);
static gboolean wingpanel_services_display_config_dbus_interface_set_property (GDBusConnection* connection,
                                                                        const gchar* sender,
                                                                        const gchar* object_path,
                                                                        const gchar* interface_name,
                                                                        const gchar* property_name,
                                                                        GVariant* value,
                                                                        GError** error,
                                                                        gpointer user_data);
static void _dbus_wingpanel_services_display_config_monitors_changed (GObject* _sender,
                                                               gpointer* _data);
static void _wingpanel_services_display_config_unregister_object (gpointer user_data);
VALA_EXTERN guint mutter_read_monitor_info_get_hash (MutterReadMonitorInfo* self);
static gdouble* _vala_array_dup1 (gdouble* self,
                           gssize length);
static void _vala_MutterReadMonitorMode_array_free (MutterReadMonitorMode * array,
                                             gssize array_length);
static MutterReadMonitorMode* _vala_array_dup2 (MutterReadMonitorMode* self,
                                         gssize length);
static void _vala_MutterReadMonitorInfo_array_free (MutterReadMonitorInfo * array,
                                             gssize array_length);
static MutterReadMonitorInfo* _vala_array_dup3 (MutterReadMonitorInfo* self,
                                         gssize length);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static const GDBusArgInfo _wingpanel_services_display_config_dbus_arg_info_get_current_state_serial = {-1, "serial", "u", NULL};
static const GDBusArgInfo _wingpanel_services_display_config_dbus_arg_info_get_current_state_monitors = {-1, "monitors", "a((ssss)a(siiddada{sv})a{sv})", NULL};
static const GDBusArgInfo _wingpanel_services_display_config_dbus_arg_info_get_current_state_logical_monitors = {-1, "logical_monitors", "a(iiduba(ssss)a{sv})", NULL};
static const GDBusArgInfo _wingpanel_services_display_config_dbus_arg_info_get_current_state_properties = {-1, "properties", "a{sv}", NULL};
static const GDBusArgInfo * const _wingpanel_services_display_config_dbus_arg_info_get_current_state_in[] = {NULL};
static const GDBusArgInfo * const _wingpanel_services_display_config_dbus_arg_info_get_current_state_out[] = {&_wingpanel_services_display_config_dbus_arg_info_get_current_state_serial, &_wingpanel_services_display_config_dbus_arg_info_get_current_state_monitors, &_wingpanel_services_display_config_dbus_arg_info_get_current_state_logical_monitors, &_wingpanel_services_display_config_dbus_arg_info_get_current_state_properties, NULL};
static const GDBusMethodInfo _wingpanel_services_display_config_dbus_method_info_get_current_state = {-1, "GetCurrentState", (GDBusArgInfo **) (&_wingpanel_services_display_config_dbus_arg_info_get_current_state_in), (GDBusArgInfo **) (&_wingpanel_services_display_config_dbus_arg_info_get_current_state_out), NULL};
static const GDBusMethodInfo * const _wingpanel_services_display_config_dbus_method_info[] = {&_wingpanel_services_display_config_dbus_method_info_get_current_state, NULL};
static const GDBusArgInfo * const _wingpanel_services_display_config_dbus_arg_info_monitors_changed[] = {NULL};
static const GDBusSignalInfo _wingpanel_services_display_config_dbus_signal_info_monitors_changed = {-1, "MonitorsChanged", (GDBusArgInfo **) (&_wingpanel_services_display_config_dbus_arg_info_monitors_changed), NULL};
static const GDBusSignalInfo * const _wingpanel_services_display_config_dbus_signal_info[] = {&_wingpanel_services_display_config_dbus_signal_info_monitors_changed, NULL};
static const GDBusPropertyInfo * const _wingpanel_services_display_config_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _wingpanel_services_display_config_dbus_interface_info = {-1, "org.gnome.Mutter.DisplayConfig", (GDBusMethodInfo **) (&_wingpanel_services_display_config_dbus_method_info), (GDBusSignalInfo **) (&_wingpanel_services_display_config_dbus_signal_info), (GDBusPropertyInfo **) (&_wingpanel_services_display_config_dbus_property_info), NULL};
static const GDBusInterfaceVTable _wingpanel_services_display_config_dbus_interface_vtable = {wingpanel_services_display_config_dbus_interface_method_call, wingpanel_services_display_config_dbus_interface_get_property, wingpanel_services_display_config_dbus_interface_set_property};

gboolean
wingpanel_services_display_config_is_logical_layout (void)
{
	gboolean* _tmp0_;
	gboolean* _tmp1_;
	gboolean result;
	_tmp0_ = wingpanel_services_display_config__is_logical_layout;
	if (_tmp0_ == NULL) {
		wingpanel_services_display_config_init ();
	}
	_tmp1_ = wingpanel_services_display_config__is_logical_layout;
	result = *_tmp1_;
	return result;
}

static void
_wingpanel_services_display_config_update_wingpanel_services_display_config_monitors_changed (WingpanelServicesDisplayConfig* _sender,
                                                                                              gpointer self)
{
	wingpanel_services_display_config_update ();
}

static gboolean*
_bool_dup (gboolean* self)
{
	gboolean* dup;
	dup = g_new0 (gboolean, 1);
	memcpy (dup, self, sizeof (gboolean));
	return dup;
}

static gpointer
__bool_dup0 (gpointer self)
{
	return self ? _bool_dup (self) : NULL;
}

static void
wingpanel_services_display_config_init (void)
{
	GError* _inner_error0_ = NULL;
	{
		WingpanelServicesDisplayConfig* _tmp0_ = NULL;
		WingpanelServicesDisplayConfig* _tmp1_;
		WingpanelServicesDisplayConfig* _tmp2_;
		WingpanelServicesDisplayConfig* _tmp3_;
		_tmp1_ = (WingpanelServicesDisplayConfig*) g_initable_new (WINGPANEL_SERVICES_TYPE_DISPLAY_CONFIG_PROXY, NULL, &_inner_error0_, "g-flags", 0, "g-name", "org.gnome.Mutter.DisplayConfig", "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/org/gnome/Mutter/DisplayConfig", "g-interface-name", "org.gnome.Mutter.DisplayConfig", NULL);
		_tmp0_ = (WingpanelServicesDisplayConfig*) _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp2_ = _tmp0_;
		_tmp0_ = NULL;
		_g_object_unref0 (wingpanel_services_display_config_proxy);
		wingpanel_services_display_config_proxy = _tmp2_;
		_tmp3_ = wingpanel_services_display_config_proxy;
		g_signal_connect (_tmp3_, "monitors-changed", (GCallback) _wingpanel_services_display_config_update_wingpanel_services_display_config_monitors_changed, NULL);
		_g_object_unref0 (_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp4_;
		const gchar* _tmp5_;
		gboolean _tmp6_;
		gboolean* _tmp7_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp4_ = e;
		_tmp5_ = _tmp4_->message;
		g_critical ("DisplayConfig.vala:24: %s", _tmp5_);
		_tmp6_ = TRUE;
		_tmp7_ = __bool_dup0 (&_tmp6_);
		_g_free0 (wingpanel_services_display_config__is_logical_layout);
		wingpanel_services_display_config__is_logical_layout = _tmp7_;
		_g_error_free0 (e);
		return;
	}
	__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;
	}
	wingpanel_services_display_config_update ();
}

static void
_vala_MutterReadMonitor_array_free (MutterReadMonitor * array,
                                    gssize array_length)
{
	if (array != NULL) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			mutter_read_monitor_destroy (&array[i]);
		}
	}
	g_free (array);
}

static void
_vala_MutterReadLogicalMonitor_array_free (MutterReadLogicalMonitor * array,
                                           gssize array_length)
{
	if (array != NULL) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			mutter_read_logical_monitor_destroy (&array[i]);
		}
	}
	g_free (array);
}

static gpointer
_g_variant_ref0 (gpointer self)
{
	return self ? g_variant_ref (self) : NULL;
}

static void
wingpanel_services_display_config_update (void)
{
	guint current_serial = 0U;
	MutterReadMonitor* mutter_monitors = NULL;
	gint mutter_monitors_length1 = 0;
	gint _mutter_monitors_size_ = 0;
	MutterReadLogicalMonitor* mutter_logical_monitors = NULL;
	gint mutter_logical_monitors_length1 = 0;
	gint _mutter_logical_monitors_size_ = 0;
	GHashTable* properties = NULL;
	guint layout_mode = 0U;
	GVariant* layout_mode_variant = NULL;
	GHashTable* _tmp11_;
	gconstpointer _tmp12_;
	GVariant* _tmp13_;
	GVariant* _tmp14_;
	gboolean _tmp16_;
	gboolean* _tmp17_;
	GError* _inner_error0_ = NULL;
	{
		WingpanelServicesDisplayConfig* _tmp0_;
		guint _tmp1_ = 0U;
		MutterReadMonitor* _tmp2_ = NULL;
		gint _tmp3_ = 0;
		MutterReadLogicalMonitor* _tmp4_ = NULL;
		gint _tmp5_ = 0;
		GHashTable* _tmp6_ = NULL;
		_tmp0_ = wingpanel_services_display_config_proxy;
		wingpanel_services_display_config_get_current_state (_tmp0_, &_tmp1_, &_tmp2_, &_tmp3_, &_tmp4_, &_tmp5_, &_tmp6_, &_inner_error0_);
		current_serial = _tmp1_;
		mutter_monitors = (_vala_MutterReadMonitor_array_free (mutter_monitors, mutter_monitors_length1), NULL);
		mutter_monitors = _tmp2_;
		mutter_monitors_length1 = _tmp3_;
		_mutter_monitors_size_ = mutter_monitors_length1;
		mutter_logical_monitors = (_vala_MutterReadLogicalMonitor_array_free (mutter_logical_monitors, mutter_logical_monitors_length1), NULL);
		mutter_logical_monitors = _tmp4_;
		mutter_logical_monitors_length1 = _tmp5_;
		_mutter_logical_monitors_size_ = mutter_logical_monitors_length1;
		_g_hash_table_unref0 (properties);
		properties = _tmp6_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp7_;
		const gchar* _tmp8_;
		gboolean _tmp9_;
		gboolean* _tmp10_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp7_ = e;
		_tmp8_ = _tmp7_->message;
		g_critical ("DisplayConfig.vala:40: %s", _tmp8_);
		_tmp9_ = TRUE;
		_tmp10_ = __bool_dup0 (&_tmp9_);
		_g_free0 (wingpanel_services_display_config__is_logical_layout);
		wingpanel_services_display_config__is_logical_layout = _tmp10_;
		_g_error_free0 (e);
		_g_hash_table_unref0 (properties);
		mutter_logical_monitors = (_vala_MutterReadLogicalMonitor_array_free (mutter_logical_monitors, mutter_logical_monitors_length1), NULL);
		mutter_monitors = (_vala_MutterReadMonitor_array_free (mutter_monitors, mutter_monitors_length1), NULL);
		return;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_hash_table_unref0 (properties);
		mutter_logical_monitors = (_vala_MutterReadLogicalMonitor_array_free (mutter_logical_monitors, mutter_logical_monitors_length1), NULL);
		mutter_monitors = (_vala_MutterReadMonitor_array_free (mutter_monitors, mutter_monitors_length1), 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;
	}
	layout_mode = (guint) 1;
	_tmp11_ = properties;
	_tmp12_ = g_hash_table_lookup (_tmp11_, "layout-mode");
	_tmp13_ = _g_variant_ref0 ((GVariant*) _tmp12_);
	layout_mode_variant = _tmp13_;
	_tmp14_ = layout_mode_variant;
	if (_tmp14_ != NULL) {
		GVariant* _tmp15_;
		_tmp15_ = layout_mode_variant;
		layout_mode = (guint) g_variant_get_uint32 (_tmp15_);
	}
	_tmp16_ = layout_mode == ((guint) 1);
	_tmp17_ = __bool_dup0 (&_tmp16_);
	_g_free0 (wingpanel_services_display_config__is_logical_layout);
	wingpanel_services_display_config__is_logical_layout = _tmp17_;
	_g_variant_unref0 (layout_mode_variant);
	_g_hash_table_unref0 (properties);
	mutter_logical_monitors = (_vala_MutterReadLogicalMonitor_array_free (mutter_logical_monitors, mutter_logical_monitors_length1), NULL);
	mutter_monitors = (_vala_MutterReadMonitor_array_free (mutter_monitors, mutter_monitors_length1), NULL);
}

void
wingpanel_services_display_config_get_current_state (WingpanelServicesDisplayConfig* self,
                                                     guint* serial,
                                                     MutterReadMonitor** monitors,
                                                     gint* monitors_length1,
                                                     MutterReadLogicalMonitor** logical_monitors,
                                                     gint* logical_monitors_length1,
                                                     GHashTable** properties,
                                                     GError** error)
{
	WingpanelServicesDisplayConfigIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = WINGPANEL_SERVICES_DISPLAY_CONFIG_GET_INTERFACE (self);
	if (_iface_->get_current_state) {
		_iface_->get_current_state (self, serial, monitors, monitors_length1, logical_monitors, logical_monitors_length1, properties, error);
	}
}

static void
wingpanel_services_display_config_default_init (WingpanelServicesDisplayConfigIface * iface,
                                                gpointer iface_data)
{
	wingpanel_services_display_config_signals[WINGPANEL_SERVICES_DISPLAY_CONFIG_MONITORS_CHANGED_SIGNAL] = g_signal_new ("monitors-changed", WINGPANEL_SERVICES_TYPE_DISPLAY_CONFIG, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static GType
wingpanel_services_display_config_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (WingpanelServicesDisplayConfigIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) wingpanel_services_display_config_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType wingpanel_services_display_config_type_id;
	wingpanel_services_display_config_type_id = g_type_register_static (G_TYPE_INTERFACE, "WingpanelServicesDisplayConfig", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (wingpanel_services_display_config_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (wingpanel_services_display_config_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) wingpanel_services_display_config_proxy_get_type);
	g_type_set_qdata (wingpanel_services_display_config_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.gnome.Mutter.DisplayConfig");
	g_type_set_qdata (wingpanel_services_display_config_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_wingpanel_services_display_config_dbus_interface_info));
	g_type_set_qdata (wingpanel_services_display_config_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) wingpanel_services_display_config_register_object);
	return wingpanel_services_display_config_type_id;
}

GType
wingpanel_services_display_config_get_type (void)
{
	static volatile gsize wingpanel_services_display_config_type_id__once = 0;
	if (g_once_init_enter (&wingpanel_services_display_config_type_id__once)) {
		GType wingpanel_services_display_config_type_id;
		wingpanel_services_display_config_type_id = wingpanel_services_display_config_get_type_once ();
		g_once_init_leave (&wingpanel_services_display_config_type_id__once, wingpanel_services_display_config_type_id);
	}
	return wingpanel_services_display_config_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (WingpanelServicesDisplayConfigProxy, wingpanel_services_display_config_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (WINGPANEL_SERVICES_TYPE_DISPLAY_CONFIG, wingpanel_services_display_config_proxy_wingpanel_services_display_config_interface_init) )
static void
wingpanel_services_display_config_proxy_class_init (WingpanelServicesDisplayConfigProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = wingpanel_services_display_config_proxy_g_signal;
}

static void
_dbus_handle_wingpanel_services_display_config_monitors_changed (WingpanelServicesDisplayConfig* self,
                                                                 GVariant* parameters)
{
	GVariantIter _arguments_iter;
	g_variant_iter_init (&_arguments_iter, parameters);
	g_signal_emit_by_name (self, "monitors-changed");
}

static void
wingpanel_services_display_config_proxy_g_signal (GDBusProxy* proxy,
                                                  const gchar* sender_name,
                                                  const gchar* signal_name,
                                                  GVariant* parameters)
{
	if (strcmp (signal_name, "MonitorsChanged") == 0) {
		_dbus_handle_wingpanel_services_display_config_monitors_changed ((WingpanelServicesDisplayConfig*) proxy, parameters);
	}
}

static void
wingpanel_services_display_config_proxy_init (WingpanelServicesDisplayConfigProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_wingpanel_services_display_config_dbus_interface_info));
}

static void
wingpanel_services_display_config_proxy_get_current_state (WingpanelServicesDisplayConfig* self,
                                                           guint* serial,
                                                           MutterReadMonitor** monitors,
                                                           gint* monitors_length1,
                                                           MutterReadLogicalMonitor** logical_monitors,
                                                           gint* logical_monitors_length1,
                                                           GHashTable** properties,
                                                           GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	guint _vala_serial = 0U;
	GVariant* _tmp15_;
	MutterReadMonitor* _vala_monitors = NULL;
	gint _vala_monitors_length1;
	GVariant* _tmp16_;
	MutterReadMonitor* _tmp17_;
	gint _tmp17__length;
	gint _tmp17__size;
	gint _tmp17__length1;
	GVariantIter _tmp18_;
	GVariant* _tmp19_;
	MutterReadLogicalMonitor* _vala_logical_monitors = NULL;
	gint _vala_logical_monitors_length1;
	GVariant* _tmp54_;
	MutterReadLogicalMonitor* _tmp55_;
	gint _tmp55__length;
	gint _tmp55__size;
	gint _tmp55__length1;
	GVariantIter _tmp56_;
	GVariant* _tmp57_;
	GHashTable* _vala_properties = NULL;
	GVariant* _tmp80_;
	GHashTable* _tmp81_;
	GVariantIter _tmp82_;
	GVariant* _tmp83_;
	GVariant* _tmp84_;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.gnome.Mutter.DisplayConfig", "GetCurrentState");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	_reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
	g_object_unref (_message);
	if (!_reply_message) {
		return;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp15_ = g_variant_iter_next_value (&_reply_iter);
	_vala_serial = g_variant_get_uint32 (_tmp15_);
	g_variant_unref (_tmp15_);
	*serial = _vala_serial;
	_vala_monitors_length1 = 0;
	_tmp16_ = g_variant_iter_next_value (&_reply_iter);
	_tmp17_ = g_new (MutterReadMonitor, 5);
	_tmp17__length = 0;
	_tmp17__size = 4;
	_tmp17__length1 = 0;
	g_variant_iter_init (&_tmp18_, _tmp16_);
	for (; (_tmp19_ = g_variant_iter_next_value (&_tmp18_)) != NULL; _tmp17__length1++) {
		MutterReadMonitor _tmp20_;
		GVariantIter _tmp21_;
		GVariant* _tmp22_;
		MutterReadMonitorInfo _tmp23_;
		GVariantIter _tmp24_;
		GVariant* _tmp25_;
		GVariant* _tmp26_;
		GVariant* _tmp27_;
		GVariant* _tmp28_;
		GVariant* _tmp29_;
		MutterReadMonitorMode* _tmp30_;
		gint _tmp30__length;
		gint _tmp30__size;
		gint _tmp30__length1;
		GVariantIter _tmp31_;
		GVariant* _tmp32_;
		GVariant* _tmp49_;
		GHashTable* _tmp50_;
		GVariantIter _tmp51_;
		GVariant* _tmp52_;
		GVariant* _tmp53_;
		if (_tmp17__size == _tmp17__length) {
			_tmp17__size = 2 * _tmp17__size;
			_tmp17_ = g_renew (MutterReadMonitor, _tmp17_, _tmp17__size + 1);
		}
		g_variant_iter_init (&_tmp21_, _tmp19_);
		_tmp22_ = g_variant_iter_next_value (&_tmp21_);
		g_variant_iter_init (&_tmp24_, _tmp22_);
		_tmp25_ = g_variant_iter_next_value (&_tmp24_);
		_tmp23_.connector = g_variant_dup_string (_tmp25_, NULL);
		g_variant_unref (_tmp25_);
		_tmp26_ = g_variant_iter_next_value (&_tmp24_);
		_tmp23_.vendor = g_variant_dup_string (_tmp26_, NULL);
		g_variant_unref (_tmp26_);
		_tmp27_ = g_variant_iter_next_value (&_tmp24_);
		_tmp23_.product = g_variant_dup_string (_tmp27_, NULL);
		g_variant_unref (_tmp27_);
		_tmp28_ = g_variant_iter_next_value (&_tmp24_);
		_tmp23_.serial = g_variant_dup_string (_tmp28_, NULL);
		g_variant_unref (_tmp28_);
		_tmp20_.monitor = _tmp23_;
		g_variant_unref (_tmp22_);
		_tmp29_ = g_variant_iter_next_value (&_tmp21_);
		_tmp30_ = g_new (MutterReadMonitorMode, 5);
		_tmp30__length = 0;
		_tmp30__size = 4;
		_tmp30__length1 = 0;
		g_variant_iter_init (&_tmp31_, _tmp29_);
		for (; (_tmp32_ = g_variant_iter_next_value (&_tmp31_)) != NULL; _tmp30__length1++) {
			MutterReadMonitorMode _tmp33_;
			GVariantIter _tmp34_;
			GVariant* _tmp35_;
			GVariant* _tmp36_;
			GVariant* _tmp37_;
			GVariant* _tmp38_;
			GVariant* _tmp39_;
			GVariant* _tmp40_;
			gdouble* _tmp41_;
			gint _tmp41__length;
			gint _tmp41__size;
			gint _tmp41__length1;
			GVariantIter _tmp42_;
			GVariant* _tmp43_;
			GVariant* _tmp44_;
			GHashTable* _tmp45_;
			GVariantIter _tmp46_;
			GVariant* _tmp47_;
			GVariant* _tmp48_;
			if (_tmp30__size == _tmp30__length) {
				_tmp30__size = 2 * _tmp30__size;
				_tmp30_ = g_renew (MutterReadMonitorMode, _tmp30_, _tmp30__size + 1);
			}
			g_variant_iter_init (&_tmp34_, _tmp32_);
			_tmp35_ = g_variant_iter_next_value (&_tmp34_);
			_tmp33_.id = g_variant_dup_string (_tmp35_, NULL);
			g_variant_unref (_tmp35_);
			_tmp36_ = g_variant_iter_next_value (&_tmp34_);
			_tmp33_.width = g_variant_get_int32 (_tmp36_);
			g_variant_unref (_tmp36_);
			_tmp37_ = g_variant_iter_next_value (&_tmp34_);
			_tmp33_.height = g_variant_get_int32 (_tmp37_);
			g_variant_unref (_tmp37_);
			_tmp38_ = g_variant_iter_next_value (&_tmp34_);
			_tmp33_.frequency = g_variant_get_double (_tmp38_);
			g_variant_unref (_tmp38_);
			_tmp39_ = g_variant_iter_next_value (&_tmp34_);
			_tmp33_.preferred_scale = g_variant_get_double (_tmp39_);
			g_variant_unref (_tmp39_);
			_tmp40_ = g_variant_iter_next_value (&_tmp34_);
			_tmp41_ = g_new (gdouble, 5);
			_tmp41__length = 0;
			_tmp41__size = 4;
			_tmp41__length1 = 0;
			g_variant_iter_init (&_tmp42_, _tmp40_);
			for (; (_tmp43_ = g_variant_iter_next_value (&_tmp42_)) != NULL; _tmp41__length1++) {
				if (_tmp41__size == _tmp41__length) {
					_tmp41__size = 2 * _tmp41__size;
					_tmp41_ = g_renew (gdouble, _tmp41_, _tmp41__size + 1);
				}
				_tmp41_[_tmp41__length++] = g_variant_get_double (_tmp43_);
				g_variant_unref (_tmp43_);
			}
			_tmp33_.supported_scales_length1 = _tmp41__length1;
			_tmp33_.supported_scales = _tmp41_;
			g_variant_unref (_tmp40_);
			_tmp44_ = g_variant_iter_next_value (&_tmp34_);
			_tmp45_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_variant_unref);
			g_variant_iter_init (&_tmp46_, _tmp44_);
			while (g_variant_iter_loop (&_tmp46_, "{?*}", &_tmp47_, &_tmp48_)) {
				g_hash_table_insert (_tmp45_, g_variant_dup_string (_tmp47_, NULL), g_variant_get_variant (_tmp48_));
			}
			_tmp33_.properties = _tmp45_;
			g_variant_unref (_tmp44_);
			_tmp30_[_tmp30__length++] = _tmp33_;
			g_variant_unref (_tmp32_);
		}
		_tmp20_.modes_length1 = _tmp30__length1;
		_tmp20_.modes = _tmp30_;
		g_variant_unref (_tmp29_);
		_tmp49_ = g_variant_iter_next_value (&_tmp21_);
		_tmp50_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_variant_unref);
		g_variant_iter_init (&_tmp51_, _tmp49_);
		while (g_variant_iter_loop (&_tmp51_, "{?*}", &_tmp52_, &_tmp53_)) {
			g_hash_table_insert (_tmp50_, g_variant_dup_string (_tmp52_, NULL), g_variant_get_variant (_tmp53_));
		}
		_tmp20_.properties = _tmp50_;
		g_variant_unref (_tmp49_);
		_tmp17_[_tmp17__length++] = _tmp20_;
		g_variant_unref (_tmp19_);
	}
	_vala_monitors_length1 = _tmp17__length1;
	_vala_monitors = _tmp17_;
	g_variant_unref (_tmp16_);
	*monitors = _vala_monitors;
	*monitors_length1 = _vala_monitors_length1;
	_vala_logical_monitors_length1 = 0;
	_tmp54_ = g_variant_iter_next_value (&_reply_iter);
	_tmp55_ = g_new (MutterReadLogicalMonitor, 5);
	_tmp55__length = 0;
	_tmp55__size = 4;
	_tmp55__length1 = 0;
	g_variant_iter_init (&_tmp56_, _tmp54_);
	for (; (_tmp57_ = g_variant_iter_next_value (&_tmp56_)) != NULL; _tmp55__length1++) {
		MutterReadLogicalMonitor _tmp58_;
		GVariantIter _tmp59_;
		GVariant* _tmp60_;
		GVariant* _tmp61_;
		GVariant* _tmp62_;
		GVariant* _tmp63_;
		GVariant* _tmp64_;
		GVariant* _tmp65_;
		MutterReadMonitorInfo* _tmp66_;
		gint _tmp66__length;
		gint _tmp66__size;
		gint _tmp66__length1;
		GVariantIter _tmp67_;
		GVariant* _tmp68_;
		GVariant* _tmp75_;
		GHashTable* _tmp76_;
		GVariantIter _tmp77_;
		GVariant* _tmp78_;
		GVariant* _tmp79_;
		if (_tmp55__size == _tmp55__length) {
			_tmp55__size = 2 * _tmp55__size;
			_tmp55_ = g_renew (MutterReadLogicalMonitor, _tmp55_, _tmp55__size + 1);
		}
		g_variant_iter_init (&_tmp59_, _tmp57_);
		_tmp60_ = g_variant_iter_next_value (&_tmp59_);
		_tmp58_.x = g_variant_get_int32 (_tmp60_);
		g_variant_unref (_tmp60_);
		_tmp61_ = g_variant_iter_next_value (&_tmp59_);
		_tmp58_.y = g_variant_get_int32 (_tmp61_);
		g_variant_unref (_tmp61_);
		_tmp62_ = g_variant_iter_next_value (&_tmp59_);
		_tmp58_.scale = g_variant_get_double (_tmp62_);
		g_variant_unref (_tmp62_);
		_tmp63_ = g_variant_iter_next_value (&_tmp59_);
		_tmp58_.transform = g_variant_get_uint32 (_tmp63_);
		g_variant_unref (_tmp63_);
		_tmp64_ = g_variant_iter_next_value (&_tmp59_);
		_tmp58_.primary = g_variant_get_boolean (_tmp64_);
		g_variant_unref (_tmp64_);
		_tmp65_ = g_variant_iter_next_value (&_tmp59_);
		_tmp66_ = g_new (MutterReadMonitorInfo, 5);
		_tmp66__length = 0;
		_tmp66__size = 4;
		_tmp66__length1 = 0;
		g_variant_iter_init (&_tmp67_, _tmp65_);
		for (; (_tmp68_ = g_variant_iter_next_value (&_tmp67_)) != NULL; _tmp66__length1++) {
			MutterReadMonitorInfo _tmp69_;
			GVariantIter _tmp70_;
			GVariant* _tmp71_;
			GVariant* _tmp72_;
			GVariant* _tmp73_;
			GVariant* _tmp74_;
			if (_tmp66__size == _tmp66__length) {
				_tmp66__size = 2 * _tmp66__size;
				_tmp66_ = g_renew (MutterReadMonitorInfo, _tmp66_, _tmp66__size + 1);
			}
			g_variant_iter_init (&_tmp70_, _tmp68_);
			_tmp71_ = g_variant_iter_next_value (&_tmp70_);
			_tmp69_.connector = g_variant_dup_string (_tmp71_, NULL);
			g_variant_unref (_tmp71_);
			_tmp72_ = g_variant_iter_next_value (&_tmp70_);
			_tmp69_.vendor = g_variant_dup_string (_tmp72_, NULL);
			g_variant_unref (_tmp72_);
			_tmp73_ = g_variant_iter_next_value (&_tmp70_);
			_tmp69_.product = g_variant_dup_string (_tmp73_, NULL);
			g_variant_unref (_tmp73_);
			_tmp74_ = g_variant_iter_next_value (&_tmp70_);
			_tmp69_.serial = g_variant_dup_string (_tmp74_, NULL);
			g_variant_unref (_tmp74_);
			_tmp66_[_tmp66__length++] = _tmp69_;
			g_variant_unref (_tmp68_);
		}
		_tmp58_.monitors_length1 = _tmp66__length1;
		_tmp58_.monitors = _tmp66_;
		g_variant_unref (_tmp65_);
		_tmp75_ = g_variant_iter_next_value (&_tmp59_);
		_tmp76_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_variant_unref);
		g_variant_iter_init (&_tmp77_, _tmp75_);
		while (g_variant_iter_loop (&_tmp77_, "{?*}", &_tmp78_, &_tmp79_)) {
			g_hash_table_insert (_tmp76_, g_variant_dup_string (_tmp78_, NULL), g_variant_get_variant (_tmp79_));
		}
		_tmp58_.properties = _tmp76_;
		g_variant_unref (_tmp75_);
		_tmp55_[_tmp55__length++] = _tmp58_;
		g_variant_unref (_tmp57_);
	}
	_vala_logical_monitors_length1 = _tmp55__length1;
	_vala_logical_monitors = _tmp55_;
	g_variant_unref (_tmp54_);
	*logical_monitors = _vala_logical_monitors;
	*logical_monitors_length1 = _vala_logical_monitors_length1;
	_tmp80_ = g_variant_iter_next_value (&_reply_iter);
	_tmp81_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_variant_unref);
	g_variant_iter_init (&_tmp82_, _tmp80_);
	while (g_variant_iter_loop (&_tmp82_, "{?*}", &_tmp83_, &_tmp84_)) {
		g_hash_table_insert (_tmp81_, g_variant_dup_string (_tmp83_, NULL), g_variant_get_variant (_tmp84_));
	}
	_vala_properties = _tmp81_;
	g_variant_unref (_tmp80_);
	*properties = _vala_properties;
	g_object_unref (_reply_message);
}

static void
wingpanel_services_display_config_proxy_wingpanel_services_display_config_interface_init (WingpanelServicesDisplayConfigIface* iface)
{
	iface->get_current_state = wingpanel_services_display_config_proxy_get_current_state;
}

static void
_dbus_wingpanel_services_display_config_get_current_state (WingpanelServicesDisplayConfig* self,
                                                           GVariant* _parameters_,
                                                           GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	guint serial = 0U;
	MutterReadMonitor* monitors = NULL;
	gint monitors_length1 = 0;
	MutterReadMonitor* _tmp85_;
	GVariantBuilder _tmp86_;
	gint _tmp87_;
	MutterReadLogicalMonitor* logical_monitors = NULL;
	gint logical_monitors_length1 = 0;
	MutterReadLogicalMonitor* _tmp105_;
	GVariantBuilder _tmp106_;
	gint _tmp107_;
	GHashTable* properties = NULL;
	GVariantBuilder _tmp117_;
	GHashTableIter _tmp118_;
	gpointer _tmp119_;
	gpointer _tmp120_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	wingpanel_services_display_config_get_current_state (self, &serial, &monitors, &monitors_length1, &logical_monitors, &logical_monitors_length1, &properties, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_uint32 (serial));
	_tmp85_ = monitors;
	g_variant_builder_init (&_tmp86_, G_VARIANT_TYPE ("a((ssss)a(siiddada{sv})a{sv})"));
	for (_tmp87_ = 0; _tmp87_ < monitors_length1; _tmp87_++) {
		GVariantBuilder _tmp88_;
		GVariantBuilder _tmp89_;
		MutterReadMonitorMode* _tmp90_;
		GVariantBuilder _tmp91_;
		gint _tmp92_;
		GVariantBuilder _tmp101_;
		GHashTableIter _tmp102_;
		gpointer _tmp103_;
		gpointer _tmp104_;
		g_variant_builder_init (&_tmp88_, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_init (&_tmp89_, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_tmp89_, g_variant_new_string ((*_tmp85_).monitor.connector));
		g_variant_builder_add_value (&_tmp89_, g_variant_new_string ((*_tmp85_).monitor.vendor));
		g_variant_builder_add_value (&_tmp89_, g_variant_new_string ((*_tmp85_).monitor.product));
		g_variant_builder_add_value (&_tmp89_, g_variant_new_string ((*_tmp85_).monitor.serial));
		g_variant_builder_add_value (&_tmp88_, g_variant_builder_end (&_tmp89_));
		_tmp90_ = (*_tmp85_).modes;
		g_variant_builder_init (&_tmp91_, G_VARIANT_TYPE ("a(siiddada{sv})"));
		for (_tmp92_ = 0; _tmp92_ < (*_tmp85_).modes_length1; _tmp92_++) {
			GVariantBuilder _tmp93_;
			gdouble* _tmp94_;
			GVariantBuilder _tmp95_;
			gint _tmp96_;
			GVariantBuilder _tmp97_;
			GHashTableIter _tmp98_;
			gpointer _tmp99_;
			gpointer _tmp100_;
			g_variant_builder_init (&_tmp93_, G_VARIANT_TYPE_TUPLE);
			g_variant_builder_add_value (&_tmp93_, g_variant_new_string ((*_tmp90_).id));
			g_variant_builder_add_value (&_tmp93_, g_variant_new_int32 ((*_tmp90_).width));
			g_variant_builder_add_value (&_tmp93_, g_variant_new_int32 ((*_tmp90_).height));
			g_variant_builder_add_value (&_tmp93_, g_variant_new_double ((*_tmp90_).frequency));
			g_variant_builder_add_value (&_tmp93_, g_variant_new_double ((*_tmp90_).preferred_scale));
			_tmp94_ = (*_tmp90_).supported_scales;
			g_variant_builder_init (&_tmp95_, G_VARIANT_TYPE ("ad"));
			for (_tmp96_ = 0; _tmp96_ < (*_tmp90_).supported_scales_length1; _tmp96_++) {
				g_variant_builder_add_value (&_tmp95_, g_variant_new_double (*_tmp94_));
				_tmp94_++;
			}
			g_variant_builder_add_value (&_tmp93_, g_variant_builder_end (&_tmp95_));
			g_hash_table_iter_init (&_tmp98_, (*_tmp90_).properties);
			g_variant_builder_init (&_tmp97_, G_VARIANT_TYPE ("a{sv}"));
			while (g_hash_table_iter_next (&_tmp98_, &_tmp99_, &_tmp100_)) {
				gchar* _key;
				GVariant* _value;
				_key = (gchar*) _tmp99_;
				_value = (GVariant*) _tmp100_;
				g_variant_builder_add (&_tmp97_, "{?*}", g_variant_new_string (_key), g_variant_new_variant (_value));
			}
			g_variant_builder_add_value (&_tmp93_, g_variant_builder_end (&_tmp97_));
			g_variant_builder_add_value (&_tmp91_, g_variant_builder_end (&_tmp93_));
			_tmp90_++;
		}
		g_variant_builder_add_value (&_tmp88_, g_variant_builder_end (&_tmp91_));
		g_hash_table_iter_init (&_tmp102_, (*_tmp85_).properties);
		g_variant_builder_init (&_tmp101_, G_VARIANT_TYPE ("a{sv}"));
		while (g_hash_table_iter_next (&_tmp102_, &_tmp103_, &_tmp104_)) {
			gchar* _key;
			GVariant* _value;
			_key = (gchar*) _tmp103_;
			_value = (GVariant*) _tmp104_;
			g_variant_builder_add (&_tmp101_, "{?*}", g_variant_new_string (_key), g_variant_new_variant (_value));
		}
		g_variant_builder_add_value (&_tmp88_, g_variant_builder_end (&_tmp101_));
		g_variant_builder_add_value (&_tmp86_, g_variant_builder_end (&_tmp88_));
		_tmp85_++;
	}
	g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp86_));
	_tmp105_ = logical_monitors;
	g_variant_builder_init (&_tmp106_, G_VARIANT_TYPE ("a(iiduba(ssss)a{sv})"));
	for (_tmp107_ = 0; _tmp107_ < logical_monitors_length1; _tmp107_++) {
		GVariantBuilder _tmp108_;
		MutterReadMonitorInfo* _tmp109_;
		GVariantBuilder _tmp110_;
		gint _tmp111_;
		GVariantBuilder _tmp113_;
		GHashTableIter _tmp114_;
		gpointer _tmp115_;
		gpointer _tmp116_;
		g_variant_builder_init (&_tmp108_, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_tmp108_, g_variant_new_int32 ((*_tmp105_).x));
		g_variant_builder_add_value (&_tmp108_, g_variant_new_int32 ((*_tmp105_).y));
		g_variant_builder_add_value (&_tmp108_, g_variant_new_double ((*_tmp105_).scale));
		g_variant_builder_add_value (&_tmp108_, g_variant_new_uint32 ((*_tmp105_).transform));
		g_variant_builder_add_value (&_tmp108_, g_variant_new_boolean ((*_tmp105_).primary));
		_tmp109_ = (*_tmp105_).monitors;
		g_variant_builder_init (&_tmp110_, G_VARIANT_TYPE ("a(ssss)"));
		for (_tmp111_ = 0; _tmp111_ < (*_tmp105_).monitors_length1; _tmp111_++) {
			GVariantBuilder _tmp112_;
			g_variant_builder_init (&_tmp112_, G_VARIANT_TYPE_TUPLE);
			g_variant_builder_add_value (&_tmp112_, g_variant_new_string ((*_tmp109_).connector));
			g_variant_builder_add_value (&_tmp112_, g_variant_new_string ((*_tmp109_).vendor));
			g_variant_builder_add_value (&_tmp112_, g_variant_new_string ((*_tmp109_).product));
			g_variant_builder_add_value (&_tmp112_, g_variant_new_string ((*_tmp109_).serial));
			g_variant_builder_add_value (&_tmp110_, g_variant_builder_end (&_tmp112_));
			_tmp109_++;
		}
		g_variant_builder_add_value (&_tmp108_, g_variant_builder_end (&_tmp110_));
		g_hash_table_iter_init (&_tmp114_, (*_tmp105_).properties);
		g_variant_builder_init (&_tmp113_, G_VARIANT_TYPE ("a{sv}"));
		while (g_hash_table_iter_next (&_tmp114_, &_tmp115_, &_tmp116_)) {
			gchar* _key;
			GVariant* _value;
			_key = (gchar*) _tmp115_;
			_value = (GVariant*) _tmp116_;
			g_variant_builder_add (&_tmp113_, "{?*}", g_variant_new_string (_key), g_variant_new_variant (_value));
		}
		g_variant_builder_add_value (&_tmp108_, g_variant_builder_end (&_tmp113_));
		g_variant_builder_add_value (&_tmp106_, g_variant_builder_end (&_tmp108_));
		_tmp105_++;
	}
	g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp106_));
	g_hash_table_iter_init (&_tmp118_, properties);
	g_variant_builder_init (&_tmp117_, G_VARIANT_TYPE ("a{sv}"));
	while (g_hash_table_iter_next (&_tmp118_, &_tmp119_, &_tmp120_)) {
		gchar* _key;
		GVariant* _value;
		_key = (gchar*) _tmp119_;
		_value = (GVariant*) _tmp120_;
		g_variant_builder_add (&_tmp117_, "{?*}", g_variant_new_string (_key), g_variant_new_variant (_value));
	}
	g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp117_));
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	monitors = (_vala_MutterReadMonitor_array_free (monitors, monitors_length1), NULL);
	logical_monitors = (_vala_MutterReadLogicalMonitor_array_free (logical_monitors, logical_monitors_length1), NULL);
	_g_hash_table_unref0 (properties);
}

static void
wingpanel_services_display_config_dbus_interface_method_call (GDBusConnection* connection,
                                                              const gchar* sender,
                                                              const gchar* object_path,
                                                              const gchar* interface_name,
                                                              const gchar* method_name,
                                                              GVariant* parameters,
                                                              GDBusMethodInvocation* invocation,
                                                              gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (method_name, "GetCurrentState") == 0) {
		_dbus_wingpanel_services_display_config_get_current_state (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
wingpanel_services_display_config_dbus_interface_get_property (GDBusConnection* connection,
                                                               const gchar* sender,
                                                               const gchar* object_path,
                                                               const gchar* interface_name,
                                                               const gchar* property_name,
                                                               GError** error,
                                                               gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	return NULL;
}

static gboolean
wingpanel_services_display_config_dbus_interface_set_property (GDBusConnection* connection,
                                                               const gchar* sender,
                                                               const gchar* object_path,
                                                               const gchar* interface_name,
                                                               const gchar* property_name,
                                                               GVariant* value,
                                                               GError** error,
                                                               gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	return FALSE;
}

static void
_dbus_wingpanel_services_display_config_monitors_changed (GObject* _sender,
                                                          gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.gnome.Mutter.DisplayConfig", "MonitorsChanged", _arguments, NULL);
}

guint
wingpanel_services_display_config_register_object (gpointer object,
                                                   GDBusConnection* connection,
                                                   const gchar* path,
                                                   GError** error)
{
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = g_object_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_wingpanel_services_display_config_dbus_interface_info), &_wingpanel_services_display_config_dbus_interface_vtable, data, _wingpanel_services_display_config_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "monitors-changed", (GCallback) _dbus_wingpanel_services_display_config_monitors_changed, data);
	return result;
}

static void
_wingpanel_services_display_config_unregister_object (gpointer user_data)
{
	gpointer* data;
	data = user_data;
	g_signal_handlers_disconnect_by_func (data[0], _dbus_wingpanel_services_display_config_monitors_changed, data);
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}

guint
mutter_read_monitor_info_get_hash (MutterReadMonitorInfo* self)
{
	guint result;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	guint _tmp10_;
	g_return_val_if_fail (self != NULL, 0U);
	_tmp0_ = (*self).connector;
	_tmp1_ = (*self).vendor;
	_tmp2_ = g_strconcat (_tmp0_, _tmp1_, NULL);
	_tmp3_ = _tmp2_;
	_tmp4_ = (*self).product;
	_tmp5_ = g_strconcat (_tmp3_, _tmp4_, NULL);
	_tmp6_ = _tmp5_;
	_tmp7_ = (*self).serial;
	_tmp8_ = g_strconcat (_tmp6_, _tmp7_, NULL);
	_tmp9_ = _tmp8_;
	_tmp10_ = g_str_hash (_tmp9_);
	_g_free0 (_tmp9_);
	_g_free0 (_tmp6_);
	_g_free0 (_tmp3_);
	result = _tmp10_;
	return result;
}

void
mutter_read_monitor_info_copy (const MutterReadMonitorInfo* self,
                               MutterReadMonitorInfo* dest)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	_tmp0_ = (*self).connector;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 ((*dest).connector);
	(*dest).connector = _tmp1_;
	_tmp2_ = (*self).vendor;
	_tmp3_ = g_strdup (_tmp2_);
	_g_free0 ((*dest).vendor);
	(*dest).vendor = _tmp3_;
	_tmp4_ = (*self).product;
	_tmp5_ = g_strdup (_tmp4_);
	_g_free0 ((*dest).product);
	(*dest).product = _tmp5_;
	_tmp6_ = (*self).serial;
	_tmp7_ = g_strdup (_tmp6_);
	_g_free0 ((*dest).serial);
	(*dest).serial = _tmp7_;
}

void
mutter_read_monitor_info_destroy (MutterReadMonitorInfo* self)
{
	_g_free0 ((*self).connector);
	_g_free0 ((*self).vendor);
	_g_free0 ((*self).product);
	_g_free0 ((*self).serial);
}

MutterReadMonitorInfo*
mutter_read_monitor_info_dup (const MutterReadMonitorInfo* self)
{
	MutterReadMonitorInfo* dup;
	dup = g_new0 (MutterReadMonitorInfo, 1);
	mutter_read_monitor_info_copy (self, dup);
	return dup;
}

void
mutter_read_monitor_info_free (MutterReadMonitorInfo* self)
{
	mutter_read_monitor_info_destroy (self);
	g_free (self);
}

static GType
mutter_read_monitor_info_get_type_once (void)
{
	GType mutter_read_monitor_info_type_id;
	mutter_read_monitor_info_type_id = g_boxed_type_register_static ("MutterReadMonitorInfo", (GBoxedCopyFunc) mutter_read_monitor_info_dup, (GBoxedFreeFunc) mutter_read_monitor_info_free);
	return mutter_read_monitor_info_type_id;
}

GType
mutter_read_monitor_info_get_type (void)
{
	static volatile gsize mutter_read_monitor_info_type_id__once = 0;
	if (g_once_init_enter (&mutter_read_monitor_info_type_id__once)) {
		GType mutter_read_monitor_info_type_id;
		mutter_read_monitor_info_type_id = mutter_read_monitor_info_get_type_once ();
		g_once_init_leave (&mutter_read_monitor_info_type_id__once, mutter_read_monitor_info_type_id);
	}
	return mutter_read_monitor_info_type_id__once;
}

static gdouble*
_vala_array_dup1 (gdouble* self,
                  gssize length)
{
	if (length > 0) {
		return _vala_memdup2 (self, length * sizeof (gdouble));
	}
	return NULL;
}

static gpointer
_g_hash_table_ref0 (gpointer self)
{
	return self ? g_hash_table_ref (self) : NULL;
}

void
mutter_read_monitor_mode_copy (const MutterReadMonitorMode* self,
                               MutterReadMonitorMode* dest)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gdouble* _tmp2_;
	gint _tmp2__length1;
	gdouble* _tmp3_;
	gint _tmp3__length1;
	GHashTable* _tmp4_;
	GHashTable* _tmp5_;
	_tmp0_ = (*self).id;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 ((*dest).id);
	(*dest).id = _tmp1_;
	(*dest).width = (*self).width;
	(*dest).height = (*self).height;
	(*dest).frequency = (*self).frequency;
	(*dest).preferred_scale = (*self).preferred_scale;
	_tmp2_ = (*self).supported_scales;
	_tmp2__length1 = (*self).supported_scales_length1;
	_tmp3_ = (_tmp2_ != NULL) ? _vala_array_dup1 (_tmp2_, _tmp2__length1) : _tmp2_;
	_tmp3__length1 = _tmp2__length1;
	(*dest).supported_scales = (g_free ((*dest).supported_scales), NULL);
	(*dest).supported_scales = _tmp3_;
	(*dest).supported_scales_length1 = _tmp3__length1;
	_tmp4_ = (*self).properties;
	_tmp5_ = _g_hash_table_ref0 (_tmp4_);
	_g_hash_table_unref0 ((*dest).properties);
	(*dest).properties = _tmp5_;
}

void
mutter_read_monitor_mode_destroy (MutterReadMonitorMode* self)
{
	_g_free0 ((*self).id);
	(*self).supported_scales = (g_free ((*self).supported_scales), NULL);
	_g_hash_table_unref0 ((*self).properties);
}

MutterReadMonitorMode*
mutter_read_monitor_mode_dup (const MutterReadMonitorMode* self)
{
	MutterReadMonitorMode* dup;
	dup = g_new0 (MutterReadMonitorMode, 1);
	mutter_read_monitor_mode_copy (self, dup);
	return dup;
}

void
mutter_read_monitor_mode_free (MutterReadMonitorMode* self)
{
	mutter_read_monitor_mode_destroy (self);
	g_free (self);
}

static GType
mutter_read_monitor_mode_get_type_once (void)
{
	GType mutter_read_monitor_mode_type_id;
	mutter_read_monitor_mode_type_id = g_boxed_type_register_static ("MutterReadMonitorMode", (GBoxedCopyFunc) mutter_read_monitor_mode_dup, (GBoxedFreeFunc) mutter_read_monitor_mode_free);
	return mutter_read_monitor_mode_type_id;
}

GType
mutter_read_monitor_mode_get_type (void)
{
	static volatile gsize mutter_read_monitor_mode_type_id__once = 0;
	if (g_once_init_enter (&mutter_read_monitor_mode_type_id__once)) {
		GType mutter_read_monitor_mode_type_id;
		mutter_read_monitor_mode_type_id = mutter_read_monitor_mode_get_type_once ();
		g_once_init_leave (&mutter_read_monitor_mode_type_id__once, mutter_read_monitor_mode_type_id);
	}
	return mutter_read_monitor_mode_type_id__once;
}

static void
_vala_MutterReadMonitorMode_array_free (MutterReadMonitorMode * array,
                                        gssize array_length)
{
	if (array != NULL) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			mutter_read_monitor_mode_destroy (&array[i]);
		}
	}
	g_free (array);
}

static MutterReadMonitorMode*
_vala_array_dup2 (MutterReadMonitorMode* self,
                  gssize length)
{
	if (length > 0) {
		MutterReadMonitorMode* result;
		gssize i;
		result = g_new0 (MutterReadMonitorMode, length);
		for (i = 0; i < length; i++) {
			MutterReadMonitorMode _tmp0_;
			MutterReadMonitorMode _tmp1_ = {0};
			_tmp0_ = self[i];
			mutter_read_monitor_mode_copy (&_tmp0_, &_tmp1_);
			result[i] = _tmp1_;
		}
		return result;
	}
	return NULL;
}

void
mutter_read_monitor_copy (const MutterReadMonitor* self,
                          MutterReadMonitor* dest)
{
	MutterReadMonitorInfo _tmp0_;
	MutterReadMonitorInfo _tmp1_;
	MutterReadMonitorInfo _tmp2_ = {0};
	MutterReadMonitorMode* _tmp3_;
	gint _tmp3__length1;
	MutterReadMonitorMode* _tmp4_;
	gint _tmp4__length1;
	GHashTable* _tmp5_;
	GHashTable* _tmp6_;
	_tmp0_ = (*self).monitor;
	_tmp1_ = _tmp0_;
	mutter_read_monitor_info_copy (&_tmp1_, &_tmp2_);
	mutter_read_monitor_info_destroy (&(*dest).monitor);
	(*dest).monitor = _tmp2_;
	_tmp3_ = (*self).modes;
	_tmp3__length1 = (*self).modes_length1;
	_tmp4_ = (_tmp3_ != NULL) ? _vala_array_dup2 (_tmp3_, _tmp3__length1) : _tmp3_;
	_tmp4__length1 = _tmp3__length1;
	(*dest).modes = (_vala_MutterReadMonitorMode_array_free ((*dest).modes, (*dest).modes_length1), NULL);
	(*dest).modes = _tmp4_;
	(*dest).modes_length1 = _tmp4__length1;
	_tmp5_ = (*self).properties;
	_tmp6_ = _g_hash_table_ref0 (_tmp5_);
	_g_hash_table_unref0 ((*dest).properties);
	(*dest).properties = _tmp6_;
}

void
mutter_read_monitor_destroy (MutterReadMonitor* self)
{
	mutter_read_monitor_info_destroy (&(*self).monitor);
	(*self).modes = (_vala_MutterReadMonitorMode_array_free ((*self).modes, (*self).modes_length1), NULL);
	_g_hash_table_unref0 ((*self).properties);
}

MutterReadMonitor*
mutter_read_monitor_dup (const MutterReadMonitor* self)
{
	MutterReadMonitor* dup;
	dup = g_new0 (MutterReadMonitor, 1);
	mutter_read_monitor_copy (self, dup);
	return dup;
}

void
mutter_read_monitor_free (MutterReadMonitor* self)
{
	mutter_read_monitor_destroy (self);
	g_free (self);
}

static GType
mutter_read_monitor_get_type_once (void)
{
	GType mutter_read_monitor_type_id;
	mutter_read_monitor_type_id = g_boxed_type_register_static ("MutterReadMonitor", (GBoxedCopyFunc) mutter_read_monitor_dup, (GBoxedFreeFunc) mutter_read_monitor_free);
	return mutter_read_monitor_type_id;
}

GType
mutter_read_monitor_get_type (void)
{
	static volatile gsize mutter_read_monitor_type_id__once = 0;
	if (g_once_init_enter (&mutter_read_monitor_type_id__once)) {
		GType mutter_read_monitor_type_id;
		mutter_read_monitor_type_id = mutter_read_monitor_get_type_once ();
		g_once_init_leave (&mutter_read_monitor_type_id__once, mutter_read_monitor_type_id);
	}
	return mutter_read_monitor_type_id__once;
}

static void
_vala_MutterReadMonitorInfo_array_free (MutterReadMonitorInfo * array,
                                        gssize array_length)
{
	if (array != NULL) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			mutter_read_monitor_info_destroy (&array[i]);
		}
	}
	g_free (array);
}

static MutterReadMonitorInfo*
_vala_array_dup3 (MutterReadMonitorInfo* self,
                  gssize length)
{
	if (length > 0) {
		MutterReadMonitorInfo* result;
		gssize i;
		result = g_new0 (MutterReadMonitorInfo, length);
		for (i = 0; i < length; i++) {
			MutterReadMonitorInfo _tmp0_;
			MutterReadMonitorInfo _tmp1_ = {0};
			_tmp0_ = self[i];
			mutter_read_monitor_info_copy (&_tmp0_, &_tmp1_);
			result[i] = _tmp1_;
		}
		return result;
	}
	return NULL;
}

void
mutter_read_logical_monitor_copy (const MutterReadLogicalMonitor* self,
                                  MutterReadLogicalMonitor* dest)
{
	MutterReadMonitorInfo* _tmp0_;
	gint _tmp0__length1;
	MutterReadMonitorInfo* _tmp1_;
	gint _tmp1__length1;
	GHashTable* _tmp2_;
	GHashTable* _tmp3_;
	(*dest).x = (*self).x;
	(*dest).y = (*self).y;
	(*dest).scale = (*self).scale;
	(*dest).transform = (*self).transform;
	(*dest).primary = (*self).primary;
	_tmp0_ = (*self).monitors;
	_tmp0__length1 = (*self).monitors_length1;
	_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup3 (_tmp0_, _tmp0__length1) : _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	(*dest).monitors = (_vala_MutterReadMonitorInfo_array_free ((*dest).monitors, (*dest).monitors_length1), NULL);
	(*dest).monitors = _tmp1_;
	(*dest).monitors_length1 = _tmp1__length1;
	_tmp2_ = (*self).properties;
	_tmp3_ = _g_hash_table_ref0 (_tmp2_);
	_g_hash_table_unref0 ((*dest).properties);
	(*dest).properties = _tmp3_;
}

void
mutter_read_logical_monitor_destroy (MutterReadLogicalMonitor* self)
{
	(*self).monitors = (_vala_MutterReadMonitorInfo_array_free ((*self).monitors, (*self).monitors_length1), NULL);
	_g_hash_table_unref0 ((*self).properties);
}

MutterReadLogicalMonitor*
mutter_read_logical_monitor_dup (const MutterReadLogicalMonitor* self)
{
	MutterReadLogicalMonitor* dup;
	dup = g_new0 (MutterReadLogicalMonitor, 1);
	mutter_read_logical_monitor_copy (self, dup);
	return dup;
}

void
mutter_read_logical_monitor_free (MutterReadLogicalMonitor* self)
{
	mutter_read_logical_monitor_destroy (self);
	g_free (self);
}

static GType
mutter_read_logical_monitor_get_type_once (void)
{
	GType mutter_read_logical_monitor_type_id;
	mutter_read_logical_monitor_type_id = g_boxed_type_register_static ("MutterReadLogicalMonitor", (GBoxedCopyFunc) mutter_read_logical_monitor_dup, (GBoxedFreeFunc) mutter_read_logical_monitor_free);
	return mutter_read_logical_monitor_type_id;
}

GType
mutter_read_logical_monitor_get_type (void)
{
	static volatile gsize mutter_read_logical_monitor_type_id__once = 0;
	if (g_once_init_enter (&mutter_read_logical_monitor_type_id__once)) {
		GType mutter_read_logical_monitor_type_id;
		mutter_read_logical_monitor_type_id = mutter_read_logical_monitor_get_type_once ();
		g_once_init_leave (&mutter_read_logical_monitor_type_id__once, mutter_read_logical_monitor_type_id);
	}
	return mutter_read_logical_monitor_type_id__once;
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

