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

/*
 * SPDX-License-Identifier: GPL-3.0-or-later
 * SPDX-FileCopyrightText: 2024 elementary, Inc. (https://elementary.io)
 *                         2013 Tom Beckmann
 *                         2013 Rico Tzschichholz
 */

#include <meta/meta-background-group.h>
#include <glib-object.h>
#include <meta/meta-plugin.h>
#include <meta/meta-monitor-manager.h>
#include <meta/display.h>
#include <meta/meta-context.h>
#include <meta/meta-backend.h>
#include <glib.h>
#include <clutter/clutter.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 GREETER_COMPOSITOR_TYPE_BACKGROUND_CONTAINER (greeter_compositor_background_container_get_type ())
#define GREETER_COMPOSITOR_BACKGROUND_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GREETER_COMPOSITOR_TYPE_BACKGROUND_CONTAINER, GreeterCompositorBackgroundContainer))
#define GREETER_COMPOSITOR_BACKGROUND_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GREETER_COMPOSITOR_TYPE_BACKGROUND_CONTAINER, GreeterCompositorBackgroundContainerClass))
#define GREETER_COMPOSITOR_IS_BACKGROUND_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GREETER_COMPOSITOR_TYPE_BACKGROUND_CONTAINER))
#define GREETER_COMPOSITOR_IS_BACKGROUND_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GREETER_COMPOSITOR_TYPE_BACKGROUND_CONTAINER))
#define GREETER_COMPOSITOR_BACKGROUND_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GREETER_COMPOSITOR_TYPE_BACKGROUND_CONTAINER, GreeterCompositorBackgroundContainerClass))

typedef struct _GreeterCompositorBackgroundContainer GreeterCompositorBackgroundContainer;
typedef struct _GreeterCompositorBackgroundContainerClass GreeterCompositorBackgroundContainerClass;
typedef struct _GreeterCompositorBackgroundContainerPrivate GreeterCompositorBackgroundContainerPrivate;

#define GREETER_COMPOSITOR_TYPE_WINDOW_MANAGER (greeter_compositor_window_manager_get_type ())
#define GREETER_COMPOSITOR_WINDOW_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GREETER_COMPOSITOR_TYPE_WINDOW_MANAGER, GreeterCompositorWindowManager))
#define GREETER_COMPOSITOR_WINDOW_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GREETER_COMPOSITOR_TYPE_WINDOW_MANAGER, GreeterCompositorWindowManagerClass))
#define GREETER_COMPOSITOR_IS_WINDOW_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GREETER_COMPOSITOR_TYPE_WINDOW_MANAGER))
#define GREETER_COMPOSITOR_IS_WINDOW_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GREETER_COMPOSITOR_TYPE_WINDOW_MANAGER))
#define GREETER_COMPOSITOR_WINDOW_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GREETER_COMPOSITOR_TYPE_WINDOW_MANAGER, GreeterCompositorWindowManagerClass))

typedef struct _GreeterCompositorWindowManager GreeterCompositorWindowManager;
typedef struct _GreeterCompositorWindowManagerClass GreeterCompositorWindowManagerClass;
enum  {
	GREETER_COMPOSITOR_BACKGROUND_CONTAINER_0_PROPERTY,
	GREETER_COMPOSITOR_BACKGROUND_CONTAINER_WM_PROPERTY,
	GREETER_COMPOSITOR_BACKGROUND_CONTAINER_NUM_PROPERTIES
};
static GParamSpec* greeter_compositor_background_container_properties[GREETER_COMPOSITOR_BACKGROUND_CONTAINER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define __vala_ClutterColor_free0(var) ((var == NULL) ? NULL : (var = (_vala_ClutterColor_free (var), NULL)))

#define GREETER_COMPOSITOR_TYPE_BACKGROUND_MANAGER (greeter_compositor_background_manager_get_type ())
#define GREETER_COMPOSITOR_BACKGROUND_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GREETER_COMPOSITOR_TYPE_BACKGROUND_MANAGER, GreeterCompositorBackgroundManager))
#define GREETER_COMPOSITOR_BACKGROUND_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GREETER_COMPOSITOR_TYPE_BACKGROUND_MANAGER, GreeterCompositorBackgroundManagerClass))
#define GREETER_COMPOSITOR_IS_BACKGROUND_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GREETER_COMPOSITOR_TYPE_BACKGROUND_MANAGER))
#define GREETER_COMPOSITOR_IS_BACKGROUND_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GREETER_COMPOSITOR_TYPE_BACKGROUND_MANAGER))
#define GREETER_COMPOSITOR_BACKGROUND_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GREETER_COMPOSITOR_TYPE_BACKGROUND_MANAGER, GreeterCompositorBackgroundManagerClass))

typedef struct _GreeterCompositorBackgroundManager GreeterCompositorBackgroundManager;
typedef struct _GreeterCompositorBackgroundManagerClass GreeterCompositorBackgroundManagerClass;

#define GREETER_COMPOSITOR_TYPE_BLUR_EFFECT (greeter_compositor_blur_effect_get_type ())
#define GREETER_COMPOSITOR_BLUR_EFFECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GREETER_COMPOSITOR_TYPE_BLUR_EFFECT, GreeterCompositorBlurEffect))
#define GREETER_COMPOSITOR_BLUR_EFFECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GREETER_COMPOSITOR_TYPE_BLUR_EFFECT, GreeterCompositorBlurEffectClass))
#define GREETER_COMPOSITOR_IS_BLUR_EFFECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GREETER_COMPOSITOR_TYPE_BLUR_EFFECT))
#define GREETER_COMPOSITOR_IS_BLUR_EFFECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GREETER_COMPOSITOR_TYPE_BLUR_EFFECT))
#define GREETER_COMPOSITOR_BLUR_EFFECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GREETER_COMPOSITOR_TYPE_BLUR_EFFECT, GreeterCompositorBlurEffectClass))

typedef struct _GreeterCompositorBlurEffect GreeterCompositorBlurEffect;
typedef struct _GreeterCompositorBlurEffectClass GreeterCompositorBlurEffectClass;
enum  {
	GREETER_COMPOSITOR_BACKGROUND_CONTAINER_CHANGED_SIGNAL,
	GREETER_COMPOSITOR_BACKGROUND_CONTAINER_NUM_SIGNALS
};
static guint greeter_compositor_background_container_signals[GREETER_COMPOSITOR_BACKGROUND_CONTAINER_NUM_SIGNALS] = {0};

struct _GreeterCompositorBackgroundContainer {
	MetaBackgroundGroup parent_instance;
	GreeterCompositorBackgroundContainerPrivate * priv;
};

struct _GreeterCompositorBackgroundContainerClass {
	MetaBackgroundGroupClass parent_class;
};

struct _GreeterCompositorBackgroundContainerPrivate {
	GreeterCompositorWindowManager* _wm;
};

static gint GreeterCompositorBackgroundContainer_private_offset;
static gpointer greeter_compositor_background_container_parent_class = NULL;

VALA_EXTERN GType greeter_compositor_background_container_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GreeterCompositorBackgroundContainer, g_object_unref)
VALA_EXTERN GType greeter_compositor_window_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GreeterCompositorWindowManager, g_object_unref)
VALA_EXTERN GreeterCompositorWindowManager* greeter_compositor_background_container_get_wm (GreeterCompositorBackgroundContainer* self);
static void greeter_compositor_background_container_update (GreeterCompositorBackgroundContainer* self);
static void _greeter_compositor_background_container_update_meta_monitor_manager_monitors_changed (MetaMonitorManager* _sender,
                                                                                            gpointer self);
VALA_EXTERN GreeterCompositorBackgroundContainer* greeter_compositor_background_container_new (GreeterCompositorWindowManager* wm);
VALA_EXTERN GreeterCompositorBackgroundContainer* greeter_compositor_background_container_construct (GType object_type,
                                                                                         GreeterCompositorWindowManager* wm);
VALA_EXTERN void greeter_compositor_background_container_set_black_background (GreeterCompositorBackgroundContainer* self,
                                                                   gboolean black);
static void _vala_ClutterColor_free (ClutterColor* self);
VALA_EXTERN GType greeter_compositor_background_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GreeterCompositorBackgroundManager, g_object_unref)
static void greeter_compositor_background_container_background_changed (GreeterCompositorBackgroundContainer* self);
static void _greeter_compositor_background_container_background_changed_greeter_compositor_background_manager_changed (GreeterCompositorBackgroundManager* _sender,
                                                                                                                gpointer self);
VALA_EXTERN GreeterCompositorBackgroundManager* greeter_compositor_background_manager_new (GreeterCompositorWindowManager* wm,
                                                                               gint monitor_index,
                                                                               gboolean control_position);
VALA_EXTERN GreeterCompositorBackgroundManager* greeter_compositor_background_manager_construct (GType object_type,
                                                                                     GreeterCompositorWindowManager* wm,
                                                                                     gint monitor_index,
                                                                                     gboolean control_position);
VALA_EXTERN GreeterCompositorBlurEffect* greeter_compositor_blur_effect_new (ClutterActor* actor,
                                                                 gfloat radius);
VALA_EXTERN GreeterCompositorBlurEffect* greeter_compositor_blur_effect_construct (GType object_type,
                                                                       ClutterActor* actor,
                                                                       gfloat radius);
VALA_EXTERN GType greeter_compositor_blur_effect_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GreeterCompositorBlurEffect, g_object_unref)
static void greeter_compositor_background_container_set_wm (GreeterCompositorBackgroundContainer* self,
                                                     GreeterCompositorWindowManager* value);
static GObject * greeter_compositor_background_container_constructor (GType type,
                                                               guint n_construct_properties,
                                                               GObjectConstructParam * construct_properties);
static void greeter_compositor_background_container_finalize (GObject * obj);
static GType greeter_compositor_background_container_get_type_once (void);
static void _vala_greeter_compositor_background_container_get_property (GObject * object,
                                                                 guint property_id,
                                                                 GValue * value,
                                                                 GParamSpec * pspec);
static void _vala_greeter_compositor_background_container_set_property (GObject * object,
                                                                 guint property_id,
                                                                 const GValue * value,
                                                                 GParamSpec * pspec);

static inline gpointer
greeter_compositor_background_container_get_instance_private (GreeterCompositorBackgroundContainer* self)
{
	return G_STRUCT_MEMBER_P (self, GreeterCompositorBackgroundContainer_private_offset);
}

static void
_greeter_compositor_background_container_update_meta_monitor_manager_monitors_changed (MetaMonitorManager* _sender,
                                                                                       gpointer self)
{
	greeter_compositor_background_container_update ((GreeterCompositorBackgroundContainer*) self);
}

GreeterCompositorBackgroundContainer*
greeter_compositor_background_container_construct (GType object_type,
                                                   GreeterCompositorWindowManager* wm)
{
	GreeterCompositorBackgroundContainer * self = NULL;
	g_return_val_if_fail (wm != NULL, NULL);
	self = (GreeterCompositorBackgroundContainer*) g_object_new (object_type, "wm", wm, NULL);
	return self;
}

GreeterCompositorBackgroundContainer*
greeter_compositor_background_container_new (GreeterCompositorWindowManager* wm)
{
	return greeter_compositor_background_container_construct (GREETER_COMPOSITOR_TYPE_BACKGROUND_CONTAINER, wm);
}

static ClutterColor*
_vala_clutter_color_from_string (const gchar* str)
{
	ClutterColor* color = NULL;
	ClutterColor* _tmp0_;
	ClutterColor* result;
	g_return_val_if_fail (str != NULL, NULL);
	_tmp0_ = clutter_color_alloc ();
	color = _tmp0_;
	clutter_color_from_string (color, str);
	result = color;
	return result;
}

static void
_vala_ClutterColor_free (ClutterColor* self)
{
	g_boxed_free (clutter_color_get_type (), self);
}

void
greeter_compositor_background_container_set_black_background (GreeterCompositorBackgroundContainer* self,
                                                              gboolean black)
{
	ClutterColor* _tmp0_ = NULL;
	g_return_if_fail (self != NULL);
	if (black) {
		ClutterColor* _tmp1_;
		_tmp1_ = _vala_clutter_color_from_string ("Black");
		__vala_ClutterColor_free0 (_tmp0_);
		_tmp0_ = _tmp1_;
	} else {
		__vala_ClutterColor_free0 (_tmp0_);
		_tmp0_ = NULL;
	}
	clutter_actor_set_background_color ((ClutterActor*) self, _tmp0_);
	__vala_ClutterColor_free0 (_tmp0_);
}

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

static void
_greeter_compositor_background_container_background_changed_greeter_compositor_background_manager_changed (GreeterCompositorBackgroundManager* _sender,
                                                                                                           gpointer self)
{
	greeter_compositor_background_container_background_changed ((GreeterCompositorBackgroundContainer*) self);
}

static void
greeter_compositor_background_container_update (GreeterCompositorBackgroundContainer* self)
{
	GreeterCompositorBackgroundManager* reference_child = NULL;
	ClutterActor* _tmp0_;
	GreeterCompositorBackgroundManager* _tmp1_;
	GreeterCompositorBackgroundManager* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = clutter_actor_get_child_at_index ((ClutterActor*) self, 0);
	_tmp1_ = _g_object_ref0 (GREETER_COMPOSITOR_IS_BACKGROUND_MANAGER (_tmp0_) ? ((GreeterCompositorBackgroundManager*) _tmp0_) : NULL);
	reference_child = _tmp1_;
	_tmp2_ = reference_child;
	if (_tmp2_ != NULL) {
		GreeterCompositorBackgroundManager* _tmp3_;
		guint _tmp4_;
		_tmp3_ = reference_child;
		g_signal_parse_name ("changed", GREETER_COMPOSITOR_TYPE_BACKGROUND_MANAGER, &_tmp4_, NULL, FALSE);
		g_signal_handlers_disconnect_matched (_tmp3_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp4_, 0, NULL, (GCallback) _greeter_compositor_background_container_background_changed_greeter_compositor_background_manager_changed, self);
	}
	clutter_actor_destroy_all_children ((ClutterActor*) self);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp5_ = FALSE;
			_tmp5_ = TRUE;
			while (TRUE) {
				GreeterCompositorWindowManager* _tmp7_;
				MetaDisplay* _tmp8_;
				GreeterCompositorBackgroundManager* background = NULL;
				GreeterCompositorWindowManager* _tmp9_;
				GreeterCompositorBackgroundManager* _tmp10_;
				GreeterCompositorBackgroundManager* _tmp11_;
				GreeterCompositorBackgroundManager* _tmp12_;
				GreeterCompositorBlurEffect* _tmp13_;
				GreeterCompositorBlurEffect* _tmp14_;
				GreeterCompositorBackgroundManager* _tmp15_;
				if (!_tmp5_) {
					gint _tmp6_;
					_tmp6_ = i;
					i = _tmp6_ + 1;
				}
				_tmp5_ = FALSE;
				_tmp7_ = self->priv->_wm;
				_tmp8_ = meta_plugin_get_display ((MetaPlugin*) _tmp7_);
				if (!(i < meta_display_get_n_monitors (_tmp8_))) {
					break;
				}
				_tmp9_ = self->priv->_wm;
				_tmp10_ = greeter_compositor_background_manager_new (_tmp9_, i, TRUE);
				g_object_ref_sink (_tmp10_);
				background = _tmp10_;
				_tmp11_ = background;
				_tmp12_ = background;
				_tmp13_ = greeter_compositor_blur_effect_new ((ClutterActor*) _tmp12_, (gfloat) 18);
				g_object_ref_sink (_tmp13_);
				_tmp14_ = _tmp13_;
				clutter_actor_add_effect ((ClutterActor*) _tmp11_, (ClutterEffect*) _tmp14_);
				_g_object_unref0 (_tmp14_);
				_tmp15_ = background;
				clutter_actor_add_child ((ClutterActor*) self, (ClutterActor*) _tmp15_);
				if (i == 0) {
					GreeterCompositorBackgroundManager* _tmp16_;
					_tmp16_ = background;
					g_signal_connect_object (_tmp16_, "changed", (GCallback) _greeter_compositor_background_container_background_changed_greeter_compositor_background_manager_changed, self, 0);
				}
				_g_object_unref0 (background);
			}
		}
	}
	_g_object_unref0 (reference_child);
}

static void
greeter_compositor_background_container_background_changed (GreeterCompositorBackgroundContainer* self)
{
	g_return_if_fail (self != NULL);
	g_signal_emit (self, greeter_compositor_background_container_signals[GREETER_COMPOSITOR_BACKGROUND_CONTAINER_CHANGED_SIGNAL], 0);
}

GreeterCompositorWindowManager*
greeter_compositor_background_container_get_wm (GreeterCompositorBackgroundContainer* self)
{
	GreeterCompositorWindowManager* result;
	GreeterCompositorWindowManager* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_wm;
	result = _tmp0_;
	return result;
}

static void
greeter_compositor_background_container_set_wm (GreeterCompositorBackgroundContainer* self,
                                                GreeterCompositorWindowManager* value)
{
	GreeterCompositorWindowManager* old_value;
	g_return_if_fail (self != NULL);
	old_value = greeter_compositor_background_container_get_wm (self);
	if (old_value != value) {
		GreeterCompositorWindowManager* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_wm);
		self->priv->_wm = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, greeter_compositor_background_container_properties[GREETER_COMPOSITOR_BACKGROUND_CONTAINER_WM_PROPERTY]);
	}
}

static GObject *
greeter_compositor_background_container_constructor (GType type,
                                                     guint n_construct_properties,
                                                     GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GreeterCompositorBackgroundContainer * self;
	MetaMonitorManager* monitor_manager = NULL;
	GreeterCompositorWindowManager* _tmp0_;
	MetaDisplay* _tmp1_;
	MetaContext* _tmp2_;
	MetaBackend* _tmp3_;
	MetaMonitorManager* _tmp4_;
	MetaMonitorManager* _tmp5_;
	parent_class = G_OBJECT_CLASS (greeter_compositor_background_container_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GREETER_COMPOSITOR_TYPE_BACKGROUND_CONTAINER, GreeterCompositorBackgroundContainer);
	_tmp0_ = self->priv->_wm;
	_tmp1_ = meta_plugin_get_display ((MetaPlugin*) _tmp0_);
	_tmp2_ = meta_display_get_context (_tmp1_);
	_tmp3_ = meta_context_get_backend (_tmp2_);
	_tmp4_ = meta_backend_get_monitor_manager (_tmp3_);
	monitor_manager = _tmp4_;
	_tmp5_ = monitor_manager;
	g_signal_connect_object (_tmp5_, "monitors-changed", (GCallback) _greeter_compositor_background_container_update_meta_monitor_manager_monitors_changed, self, 0);
	greeter_compositor_background_container_set_black_background (self, TRUE);
	greeter_compositor_background_container_update (self);
	return obj;
}

static void
greeter_compositor_background_container_class_init (GreeterCompositorBackgroundContainerClass * klass,
                                                    gpointer klass_data)
{
	greeter_compositor_background_container_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GreeterCompositorBackgroundContainer_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_greeter_compositor_background_container_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_greeter_compositor_background_container_set_property;
	G_OBJECT_CLASS (klass)->constructor = greeter_compositor_background_container_constructor;
	G_OBJECT_CLASS (klass)->finalize = greeter_compositor_background_container_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GREETER_COMPOSITOR_BACKGROUND_CONTAINER_WM_PROPERTY, greeter_compositor_background_container_properties[GREETER_COMPOSITOR_BACKGROUND_CONTAINER_WM_PROPERTY] = g_param_spec_object ("wm", "wm", "wm", GREETER_COMPOSITOR_TYPE_WINDOW_MANAGER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	greeter_compositor_background_container_signals[GREETER_COMPOSITOR_BACKGROUND_CONTAINER_CHANGED_SIGNAL] = g_signal_new ("changed", GREETER_COMPOSITOR_TYPE_BACKGROUND_CONTAINER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
greeter_compositor_background_container_instance_init (GreeterCompositorBackgroundContainer * self,
                                                       gpointer klass)
{
	self->priv = greeter_compositor_background_container_get_instance_private (self);
}

static void
greeter_compositor_background_container_finalize (GObject * obj)
{
	GreeterCompositorBackgroundContainer * self;
	MetaMonitorManager* monitor_manager = NULL;
	GreeterCompositorWindowManager* _tmp0_;
	MetaDisplay* _tmp1_;
	MetaContext* _tmp2_;
	MetaBackend* _tmp3_;
	MetaMonitorManager* _tmp4_;
	MetaMonitorManager* _tmp5_;
	guint _tmp6_;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GREETER_COMPOSITOR_TYPE_BACKGROUND_CONTAINER, GreeterCompositorBackgroundContainer);
	_tmp0_ = self->priv->_wm;
	_tmp1_ = meta_plugin_get_display ((MetaPlugin*) _tmp0_);
	_tmp2_ = meta_display_get_context (_tmp1_);
	_tmp3_ = meta_context_get_backend (_tmp2_);
	_tmp4_ = meta_backend_get_monitor_manager (_tmp3_);
	monitor_manager = _tmp4_;
	_tmp5_ = monitor_manager;
	g_signal_parse_name ("monitors-changed", meta_monitor_manager_get_type (), &_tmp6_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp5_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp6_, 0, NULL, (GCallback) _greeter_compositor_background_container_update_meta_monitor_manager_monitors_changed, self);
	_g_object_unref0 (self->priv->_wm);
	G_OBJECT_CLASS (greeter_compositor_background_container_parent_class)->finalize (obj);
}

static GType
greeter_compositor_background_container_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GreeterCompositorBackgroundContainerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) greeter_compositor_background_container_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GreeterCompositorBackgroundContainer), 0, (GInstanceInitFunc) greeter_compositor_background_container_instance_init, NULL };
	GType greeter_compositor_background_container_type_id;
	greeter_compositor_background_container_type_id = g_type_register_static (meta_background_group_get_type (), "GreeterCompositorBackgroundContainer", &g_define_type_info, 0);
	GreeterCompositorBackgroundContainer_private_offset = g_type_add_instance_private (greeter_compositor_background_container_type_id, sizeof (GreeterCompositorBackgroundContainerPrivate));
	return greeter_compositor_background_container_type_id;
}

GType
greeter_compositor_background_container_get_type (void)
{
	static volatile gsize greeter_compositor_background_container_type_id__once = 0;
	if (g_once_init_enter (&greeter_compositor_background_container_type_id__once)) {
		GType greeter_compositor_background_container_type_id;
		greeter_compositor_background_container_type_id = greeter_compositor_background_container_get_type_once ();
		g_once_init_leave (&greeter_compositor_background_container_type_id__once, greeter_compositor_background_container_type_id);
	}
	return greeter_compositor_background_container_type_id__once;
}

static void
_vala_greeter_compositor_background_container_get_property (GObject * object,
                                                            guint property_id,
                                                            GValue * value,
                                                            GParamSpec * pspec)
{
	GreeterCompositorBackgroundContainer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GREETER_COMPOSITOR_TYPE_BACKGROUND_CONTAINER, GreeterCompositorBackgroundContainer);
	switch (property_id) {
		case GREETER_COMPOSITOR_BACKGROUND_CONTAINER_WM_PROPERTY:
		g_value_set_object (value, greeter_compositor_background_container_get_wm (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_greeter_compositor_background_container_set_property (GObject * object,
                                                            guint property_id,
                                                            const GValue * value,
                                                            GParamSpec * pspec)
{
	GreeterCompositorBackgroundContainer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GREETER_COMPOSITOR_TYPE_BACKGROUND_CONTAINER, GreeterCompositorBackgroundContainer);
	switch (property_id) {
		case GREETER_COMPOSITOR_BACKGROUND_CONTAINER_WM_PROPERTY:
		greeter_compositor_background_container_set_wm (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

