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

/*
 * Copyright 2024 elementary, Inc. (https://elementary.io)
 * SPDX-License-Identifier: GPL-3.0-or-later
 *
 * Authored by: Leonhard Kargl <leo.kargl@proton.me>
 */

#include <glib-object.h>
#include <meta/meta-plugin.h>
#include "pantheon-desktop-shell-server-protocol.h"
#include <glib.h>
#include <meta/window.h>
#include <meta/boxes.h>
#include <mtk/mtk.h>
#include <meta/display.h>
#include <meta/common.h>
#include <string.h>
#include <meta/meta-workspace-manager.h>
#include <meta/workspace.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_POSITIONED_WINDOW (greeter_compositor_positioned_window_get_type ())
#define GREETER_COMPOSITOR_POSITIONED_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GREETER_COMPOSITOR_TYPE_POSITIONED_WINDOW, GreeterCompositorPositionedWindow))
#define GREETER_COMPOSITOR_POSITIONED_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GREETER_COMPOSITOR_TYPE_POSITIONED_WINDOW, GreeterCompositorPositionedWindowClass))
#define GREETER_COMPOSITOR_IS_POSITIONED_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GREETER_COMPOSITOR_TYPE_POSITIONED_WINDOW))
#define GREETER_COMPOSITOR_IS_POSITIONED_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GREETER_COMPOSITOR_TYPE_POSITIONED_WINDOW))
#define GREETER_COMPOSITOR_POSITIONED_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GREETER_COMPOSITOR_TYPE_POSITIONED_WINDOW, GreeterCompositorPositionedWindowClass))

typedef struct _GreeterCompositorPositionedWindow GreeterCompositorPositionedWindow;
typedef struct _GreeterCompositorPositionedWindowClass GreeterCompositorPositionedWindowClass;
typedef struct _GreeterCompositorPositionedWindowPrivate GreeterCompositorPositionedWindowPrivate;

#define GREETER_COMPOSITOR_TYPE_SHELL_WINDOW (greeter_compositor_shell_window_get_type ())
#define GREETER_COMPOSITOR_SHELL_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GREETER_COMPOSITOR_TYPE_SHELL_WINDOW, GreeterCompositorShellWindow))
#define GREETER_COMPOSITOR_SHELL_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GREETER_COMPOSITOR_TYPE_SHELL_WINDOW, GreeterCompositorShellWindowClass))
#define GREETER_COMPOSITOR_IS_SHELL_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GREETER_COMPOSITOR_TYPE_SHELL_WINDOW))
#define GREETER_COMPOSITOR_IS_SHELL_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GREETER_COMPOSITOR_TYPE_SHELL_WINDOW))
#define GREETER_COMPOSITOR_SHELL_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GREETER_COMPOSITOR_TYPE_SHELL_WINDOW, GreeterCompositorShellWindowClass))

typedef struct _GreeterCompositorShellWindow GreeterCompositorShellWindow;
typedef struct _GreeterCompositorShellWindowClass GreeterCompositorShellWindowClass;
typedef struct _GreeterCompositorShellWindowPrivate GreeterCompositorShellWindowPrivate;

#define GREETER_COMPOSITOR_TYPE_PANEL_WINDOW (greeter_compositor_panel_window_get_type ())
#define GREETER_COMPOSITOR_PANEL_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GREETER_COMPOSITOR_TYPE_PANEL_WINDOW, GreeterCompositorPanelWindow))
#define GREETER_COMPOSITOR_PANEL_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GREETER_COMPOSITOR_TYPE_PANEL_WINDOW, GreeterCompositorPanelWindowClass))
#define GREETER_COMPOSITOR_IS_PANEL_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GREETER_COMPOSITOR_TYPE_PANEL_WINDOW))
#define GREETER_COMPOSITOR_IS_PANEL_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GREETER_COMPOSITOR_TYPE_PANEL_WINDOW))
#define GREETER_COMPOSITOR_PANEL_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GREETER_COMPOSITOR_TYPE_PANEL_WINDOW, GreeterCompositorPanelWindowClass))

typedef struct _GreeterCompositorPanelWindow GreeterCompositorPanelWindow;
typedef struct _GreeterCompositorPanelWindowClass GreeterCompositorPanelWindowClass;
typedef struct _GreeterCompositorPanelWindowPrivate GreeterCompositorPanelWindowPrivate;

#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_PANEL_WINDOW_0_PROPERTY,
	GREETER_COMPOSITOR_PANEL_WINDOW_WM_PROPERTY,
	GREETER_COMPOSITOR_PANEL_WINDOW_ANCHOR_PROPERTY,
	GREETER_COMPOSITOR_PANEL_WINDOW_NUM_PROPERTIES
};
static GParamSpec* greeter_compositor_panel_window_properties[GREETER_COMPOSITOR_PANEL_WINDOW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef enum  {
	GREETER_COMPOSITOR_POSITIONED_WINDOW_POSITION_TOP,
	GREETER_COMPOSITOR_POSITIONED_WINDOW_POSITION_BOTTOM,
	GREETER_COMPOSITOR_POSITIONED_WINDOW_POSITION_CENTER,
	GREETER_COMPOSITOR_POSITIONED_WINDOW_POSITION_FULLSCREEN
} GreeterCompositorPositionedWindowPosition;

#define GREETER_COMPOSITOR_POSITIONED_WINDOW_TYPE_POSITION (greeter_compositor_positioned_window_position_get_type ())

struct _GreeterCompositorPositionedWindow {
	GObject parent_instance;
	GreeterCompositorPositionedWindowPrivate * priv;
};

struct _GreeterCompositorPositionedWindowClass {
	GObjectClass parent_class;
};

struct _GreeterCompositorShellWindow {
	GreeterCompositorPositionedWindow parent_instance;
	GreeterCompositorShellWindowPrivate * priv;
};

struct _GreeterCompositorShellWindowClass {
	GreeterCompositorPositionedWindowClass parent_class;
};

struct _GreeterCompositorPanelWindow {
	GreeterCompositorShellWindow parent_instance;
	GreeterCompositorPanelWindowPrivate * priv;
};

struct _GreeterCompositorPanelWindowClass {
	GreeterCompositorShellWindowClass parent_class;
};

struct _GreeterCompositorPanelWindowPrivate {
	GreeterCompositorWindowManager* _wm;
	enum io_elementary_pantheon_panel_v1_anchor _anchor;
	gint width;
	gint height;
};

static gint GreeterCompositorPanelWindow_private_offset;
static gpointer greeter_compositor_panel_window_parent_class = NULL;
static GHashTable* greeter_compositor_panel_window_window_struts;
static GHashTable* greeter_compositor_panel_window_window_struts = NULL;

VALA_EXTERN GType greeter_compositor_positioned_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GreeterCompositorPositionedWindow, g_object_unref)
VALA_EXTERN GType greeter_compositor_shell_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GreeterCompositorShellWindow, g_object_unref)
VALA_EXTERN GType greeter_compositor_panel_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GreeterCompositorPanelWindow, 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)
static void _g_object_unref0_ (gpointer var);
static void _g_free0_ (gpointer var);
VALA_EXTERN GreeterCompositorPanelWindow* greeter_compositor_panel_window_new (GreeterCompositorWindowManager* wm,
                                                                   MetaWindow* window,
                                                                   enum io_elementary_pantheon_panel_v1_anchor anchor);
VALA_EXTERN GreeterCompositorPanelWindow* greeter_compositor_panel_window_construct (GType object_type,
                                                                         GreeterCompositorWindowManager* wm,
                                                                         MetaWindow* window,
                                                                         enum io_elementary_pantheon_panel_v1_anchor anchor);
VALA_EXTERN GType greeter_compositor_positioned_window_position_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GreeterCompositorPositionedWindowPosition greeter_compositor_positioned_window_position_from_anchor (enum io_elementary_pantheon_panel_v1_anchor anchor);
VALA_EXTERN void greeter_compositor_panel_window_get_custom_window_rect (GreeterCompositorPanelWindow* self,
                                                             MtkRectangle* result);
VALA_EXTERN MetaWindow* greeter_compositor_positioned_window_get_window (GreeterCompositorPositionedWindow* self);
VALA_EXTERN enum io_elementary_pantheon_panel_v1_anchor greeter_compositor_panel_window_get_anchor (GreeterCompositorPanelWindow* self);
VALA_EXTERN GreeterCompositorWindowManager* greeter_compositor_panel_window_get_wm (GreeterCompositorPanelWindow* self);
VALA_EXTERN void greeter_compositor_panel_window_set_size (GreeterCompositorPanelWindow* self,
                                               gint width,
                                               gint height);
static void greeter_compositor_panel_window_update_strut (GreeterCompositorPanelWindow* self);
static MetaSide greeter_compositor_panel_window_side_from_anchor (GreeterCompositorPanelWindow* self,
                                                           enum io_elementary_pantheon_panel_v1_anchor anchor);
static MetaStrut* _meta_strut_dup (MetaStrut* self);
static void greeter_compositor_panel_window_update_struts (GreeterCompositorPanelWindow* self);
static inline void _g_slist_free__g_free0_ (GSList* self);
static void greeter_compositor_panel_window_set_wm (GreeterCompositorPanelWindow* self,
                                             GreeterCompositorWindowManager* value);
VALA_EXTERN void greeter_compositor_panel_window_set_anchor (GreeterCompositorPanelWindow* self,
                                                 enum io_elementary_pantheon_panel_v1_anchor value);
static GObject * greeter_compositor_panel_window_constructor (GType type,
                                                       guint n_construct_properties,
                                                       GObjectConstructParam * construct_properties);
static void _greeter_compositor_panel_window___lambda86_ (GreeterCompositorPanelWindow* self);
static void __greeter_compositor_panel_window___lambda86__meta_window_unmanaging (MetaWindow* _sender,
                                                                           gpointer self);
static void _greeter_compositor_panel_window___lambda87_ (GreeterCompositorPanelWindow* self);
VALA_EXTERN void greeter_compositor_positioned_window_set_position (GreeterCompositorPositionedWindow* self,
                                                        GreeterCompositorPositionedWindowPosition value);
static void __greeter_compositor_panel_window___lambda87__g_object_notify (GObject* _sender,
                                                                    GParamSpec* pspec,
                                                                    gpointer self);
static void _greeter_compositor_panel_window_update_strut_meta_workspace_manager_workspace_added (MetaWorkspaceManager* _sender,
                                                                                           gint object,
                                                                                           gpointer self);
static void _greeter_compositor_panel_window_update_strut_meta_workspace_manager_workspace_removed (MetaWorkspaceManager* _sender,
                                                                                             gint object,
                                                                                             gpointer self);
static void _greeter_compositor_panel_window_update_strut_meta_window_size_changed (MetaWindow* _sender,
                                                                             gpointer self);
static void _greeter_compositor_panel_window_update_strut_meta_window_position_changed (MetaWindow* _sender,
                                                                                 gpointer self);
static void greeter_compositor_panel_window_finalize (GObject * obj);
static GType greeter_compositor_panel_window_get_type_once (void);
static void _vala_greeter_compositor_panel_window_get_property (GObject * object,
                                                         guint property_id,
                                                         GValue * value,
                                                         GParamSpec * pspec);
static void _vala_greeter_compositor_panel_window_set_property (GObject * object,
                                                         guint property_id,
                                                         const GValue * value,
                                                         GParamSpec * pspec);

static inline gpointer
greeter_compositor_panel_window_get_instance_private (GreeterCompositorPanelWindow* self)
{
	return G_STRUCT_MEMBER_P (self, GreeterCompositorPanelWindow_private_offset);
}

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

static void
_g_free0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_free (var), NULL));
}

GreeterCompositorPanelWindow*
greeter_compositor_panel_window_construct (GType object_type,
                                           GreeterCompositorWindowManager* wm,
                                           MetaWindow* window,
                                           enum io_elementary_pantheon_panel_v1_anchor anchor)
{
	GreeterCompositorPanelWindow * self = NULL;
	g_return_val_if_fail (wm != NULL, NULL);
	g_return_val_if_fail (window != NULL, NULL);
	self = (GreeterCompositorPanelWindow*) g_object_new (object_type, "wm", wm, "anchor", anchor, "window", window, "position", greeter_compositor_positioned_window_position_from_anchor (anchor), NULL);
	return self;
}

GreeterCompositorPanelWindow*
greeter_compositor_panel_window_new (GreeterCompositorWindowManager* wm,
                                     MetaWindow* window,
                                     enum io_elementary_pantheon_panel_v1_anchor anchor)
{
	return greeter_compositor_panel_window_construct (GREETER_COMPOSITOR_TYPE_PANEL_WINDOW, wm, window, anchor);
}

void
greeter_compositor_panel_window_get_custom_window_rect (GreeterCompositorPanelWindow* self,
                                                        MtkRectangle* result)
{
	MtkRectangle window_rect = {0};
	MetaWindow* _tmp0_;
	MetaWindow* _tmp1_;
	MtkRectangle _tmp2_ = {0};
	g_return_if_fail (self != NULL);
	_tmp0_ = greeter_compositor_positioned_window_get_window ((GreeterCompositorPositionedWindow*) self);
	_tmp1_ = _tmp0_;
	meta_window_get_frame_rect (_tmp1_, &_tmp2_);
	window_rect = _tmp2_;
	if (self->priv->width > 0) {
		window_rect.width = self->priv->width;
	}
	if (self->priv->height > 0) {
		enum io_elementary_pantheon_panel_v1_anchor _tmp3_;
		window_rect.height = self->priv->height;
		_tmp3_ = self->priv->_anchor;
		if (_tmp3_ == IO_ELEMENTARY_PANTHEON_PANEL_V1_ANCHOR_BOTTOM) {
			MtkRectangle geom = {0};
			GreeterCompositorWindowManager* _tmp4_;
			MetaDisplay* _tmp5_;
			MetaWindow* _tmp6_;
			MetaWindow* _tmp7_;
			MtkRectangle _tmp8_ = {0};
			MtkRectangle _tmp9_;
			MtkRectangle _tmp10_;
			_tmp4_ = self->priv->_wm;
			_tmp5_ = meta_plugin_get_display ((MetaPlugin*) _tmp4_);
			_tmp6_ = greeter_compositor_positioned_window_get_window ((GreeterCompositorPositionedWindow*) self);
			_tmp7_ = _tmp6_;
			meta_display_get_monitor_geometry (_tmp5_, meta_window_get_monitor (_tmp7_), &_tmp8_);
			geom = _tmp8_;
			_tmp9_ = geom;
			_tmp10_ = geom;
			window_rect.y = (_tmp9_.y + _tmp10_.height) - self->priv->height;
		}
	}
	*result = window_rect;
	return;
}

void
greeter_compositor_panel_window_set_size (GreeterCompositorPanelWindow* self,
                                          gint width,
                                          gint height)
{
	g_return_if_fail (self != NULL);
	self->priv->width = width;
	self->priv->height = height;
	greeter_compositor_panel_window_update_strut (self);
}

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

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

static gpointer
__meta_strut_dup0 (gpointer self)
{
	return self ? _meta_strut_dup (self) : NULL;
}

static void
greeter_compositor_panel_window_update_strut (GreeterCompositorPanelWindow* self)
{
	MtkRectangle rect = {0};
	MtkRectangle _tmp0_ = {0};
	MetaStrut strut = {0};
	MtkRectangle _tmp1_;
	enum io_elementary_pantheon_panel_v1_anchor _tmp2_;
	MetaStrut _tmp3_ = {0};
	GHashTable* _tmp4_;
	MetaWindow* _tmp5_;
	MetaWindow* _tmp6_;
	MetaWindow* _tmp7_;
	MetaStrut _tmp8_;
	MetaStrut* _tmp9_;
	g_return_if_fail (self != NULL);
	greeter_compositor_panel_window_get_custom_window_rect (self, &_tmp0_);
	rect = _tmp0_;
	_tmp1_ = rect;
	_tmp2_ = self->priv->_anchor;
	_tmp3_.rect = _tmp1_;
	_tmp3_.side = greeter_compositor_panel_window_side_from_anchor (self, _tmp2_);
	strut = _tmp3_;
	_tmp4_ = greeter_compositor_panel_window_window_struts;
	_tmp5_ = greeter_compositor_positioned_window_get_window ((GreeterCompositorPositionedWindow*) self);
	_tmp6_ = _tmp5_;
	_tmp7_ = _g_object_ref0 (_tmp6_);
	_tmp8_ = strut;
	_tmp9_ = __meta_strut_dup0 (&_tmp8_);
	g_hash_table_insert (_tmp4_, _tmp7_, _tmp9_);
	greeter_compositor_panel_window_update_struts (self);
}

static inline void
_g_slist_free__g_free0_ (GSList* self)
{
	g_slist_free_full (self, (GDestroyNotify) _g_free0_);
}

static void
greeter_compositor_panel_window_update_struts (GreeterCompositorPanelWindow* self)
{
	GSList* list = NULL;
	GHashTable* _tmp0_;
	GList* _tmp1_;
	GreeterCompositorWindowManager* _tmp4_;
	MetaDisplay* _tmp5_;
	MetaWorkspaceManager* _tmp6_;
	GList* _tmp7_;
	g_return_if_fail (self != NULL);
	list = NULL;
	_tmp0_ = greeter_compositor_panel_window_window_struts;
	_tmp1_ = g_hash_table_get_values (_tmp0_);
	{
		GList* window_strut_collection = NULL;
		GList* window_strut_it = NULL;
		window_strut_collection = _tmp1_;
		for (window_strut_it = window_strut_collection; window_strut_it != NULL; window_strut_it = window_strut_it->next) {
			MetaStrut* window_strut = NULL;
			window_strut = (MetaStrut*) window_strut_it->data;
			{
				MetaStrut* _tmp2_;
				MetaStrut* _tmp3_;
				_tmp2_ = window_strut;
				_tmp3_ = __meta_strut_dup0 (_tmp2_);
				list = g_slist_append (list, _tmp3_);
			}
		}
		(window_strut_collection == NULL) ? NULL : (window_strut_collection = (g_list_free (window_strut_collection), NULL));
	}
	_tmp4_ = self->priv->_wm;
	_tmp5_ = meta_plugin_get_display ((MetaPlugin*) _tmp4_);
	_tmp6_ = meta_display_get_workspace_manager (_tmp5_);
	_tmp7_ = meta_workspace_manager_get_workspaces (_tmp6_);
	{
		GList* workspace_collection = NULL;
		GList* workspace_it = NULL;
		workspace_collection = _tmp7_;
		for (workspace_it = workspace_collection; workspace_it != NULL; workspace_it = workspace_it->next) {
			MetaWorkspace* _tmp8_;
			MetaWorkspace* workspace = NULL;
			_tmp8_ = _g_object_ref0 ((MetaWorkspace*) workspace_it->data);
			workspace = _tmp8_;
			{
				MetaWorkspace* _tmp9_;
				GSList* _tmp10_;
				_tmp9_ = workspace;
				_tmp10_ = list;
				meta_workspace_set_builtin_struts (_tmp9_, _tmp10_);
				_g_object_unref0 (workspace);
			}
		}
	}
	(list == NULL) ? NULL : (list = (_g_slist_free__g_free0_ (list), NULL));
}

static MetaSide
greeter_compositor_panel_window_side_from_anchor (GreeterCompositorPanelWindow* self,
                                                  enum io_elementary_pantheon_panel_v1_anchor anchor)
{
	MetaSide result;
	g_return_val_if_fail (self != NULL, 0);
	switch (anchor) {
		case IO_ELEMENTARY_PANTHEON_PANEL_V1_ANCHOR_BOTTOM:
		{
			result = META_SIDE_BOTTOM;
			return result;
		}
		case IO_ELEMENTARY_PANTHEON_PANEL_V1_ANCHOR_LEFT:
		{
			result = META_SIDE_LEFT;
			return result;
		}
		case IO_ELEMENTARY_PANTHEON_PANEL_V1_ANCHOR_RIGHT:
		{
			result = META_SIDE_RIGHT;
			return result;
		}
		default:
		{
			result = META_SIDE_TOP;
			return result;
		}
	}
}

GreeterCompositorWindowManager*
greeter_compositor_panel_window_get_wm (GreeterCompositorPanelWindow* 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_panel_window_set_wm (GreeterCompositorPanelWindow* self,
                                        GreeterCompositorWindowManager* value)
{
	GreeterCompositorWindowManager* old_value;
	g_return_if_fail (self != NULL);
	old_value = greeter_compositor_panel_window_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_panel_window_properties[GREETER_COMPOSITOR_PANEL_WINDOW_WM_PROPERTY]);
	}
}

enum io_elementary_pantheon_panel_v1_anchor
greeter_compositor_panel_window_get_anchor (GreeterCompositorPanelWindow* self)
{
	enum io_elementary_pantheon_panel_v1_anchor result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_anchor;
	return result;
}

void
greeter_compositor_panel_window_set_anchor (GreeterCompositorPanelWindow* self,
                                            enum io_elementary_pantheon_panel_v1_anchor value)
{
	enum io_elementary_pantheon_panel_v1_anchor old_value;
	g_return_if_fail (self != NULL);
	old_value = greeter_compositor_panel_window_get_anchor (self);
	if (old_value != value) {
		self->priv->_anchor = value;
		g_object_notify_by_pspec ((GObject *) self, greeter_compositor_panel_window_properties[GREETER_COMPOSITOR_PANEL_WINDOW_ANCHOR_PROPERTY]);
	}
}

static void
_greeter_compositor_panel_window___lambda86_ (GreeterCompositorPanelWindow* self)
{
	GHashTable* _tmp0_;
	MetaWindow* _tmp1_;
	MetaWindow* _tmp2_;
	_tmp0_ = greeter_compositor_panel_window_window_struts;
	_tmp1_ = greeter_compositor_positioned_window_get_window ((GreeterCompositorPositionedWindow*) self);
	_tmp2_ = _tmp1_;
	if (g_hash_table_remove (_tmp0_, _tmp2_)) {
		greeter_compositor_panel_window_update_struts (self);
	}
}

static void
__greeter_compositor_panel_window___lambda86__meta_window_unmanaging (MetaWindow* _sender,
                                                                      gpointer self)
{
	_greeter_compositor_panel_window___lambda86_ ((GreeterCompositorPanelWindow*) self);
}

static void
_greeter_compositor_panel_window___lambda87_ (GreeterCompositorPanelWindow* self)
{
	enum io_elementary_pantheon_panel_v1_anchor _tmp0_;
	_tmp0_ = self->priv->_anchor;
	greeter_compositor_positioned_window_set_position ((GreeterCompositorPositionedWindow*) self, greeter_compositor_positioned_window_position_from_anchor (_tmp0_));
}

static void
__greeter_compositor_panel_window___lambda87__g_object_notify (GObject* _sender,
                                                               GParamSpec* pspec,
                                                               gpointer self)
{
	_greeter_compositor_panel_window___lambda87_ ((GreeterCompositorPanelWindow*) self);
}

static void
_greeter_compositor_panel_window_update_strut_meta_workspace_manager_workspace_added (MetaWorkspaceManager* _sender,
                                                                                      gint object,
                                                                                      gpointer self)
{
	greeter_compositor_panel_window_update_strut ((GreeterCompositorPanelWindow*) self);
}

static void
_greeter_compositor_panel_window_update_strut_meta_workspace_manager_workspace_removed (MetaWorkspaceManager* _sender,
                                                                                        gint object,
                                                                                        gpointer self)
{
	greeter_compositor_panel_window_update_strut ((GreeterCompositorPanelWindow*) self);
}

static void
_greeter_compositor_panel_window_update_strut_meta_window_size_changed (MetaWindow* _sender,
                                                                        gpointer self)
{
	greeter_compositor_panel_window_update_strut ((GreeterCompositorPanelWindow*) self);
}

static void
_greeter_compositor_panel_window_update_strut_meta_window_position_changed (MetaWindow* _sender,
                                                                            gpointer self)
{
	greeter_compositor_panel_window_update_strut ((GreeterCompositorPanelWindow*) self);
}

static GObject *
greeter_compositor_panel_window_constructor (GType type,
                                             guint n_construct_properties,
                                             GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GreeterCompositorPanelWindow * self;
	MetaWindow* _tmp0_;
	MetaWindow* _tmp1_;
	MetaWorkspaceManager* workspace_manager = NULL;
	MetaWindow* _tmp2_;
	MetaWindow* _tmp3_;
	MetaDisplay* _tmp4_;
	MetaDisplay* _tmp5_;
	MetaWorkspaceManager* _tmp6_;
	MetaWorkspaceManager* _tmp7_;
	MetaWorkspaceManager* _tmp8_;
	MetaWindow* _tmp9_;
	MetaWindow* _tmp10_;
	MetaWindow* _tmp11_;
	MetaWindow* _tmp12_;
	parent_class = G_OBJECT_CLASS (greeter_compositor_panel_window_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GREETER_COMPOSITOR_TYPE_PANEL_WINDOW, GreeterCompositorPanelWindow);
	greeter_compositor_panel_window_update_strut (self);
	_tmp0_ = greeter_compositor_positioned_window_get_window ((GreeterCompositorPositionedWindow*) self);
	_tmp1_ = _tmp0_;
	g_signal_connect_object (_tmp1_, "unmanaging", (GCallback) __greeter_compositor_panel_window___lambda86__meta_window_unmanaging, self, 0);
	g_signal_connect_object ((GObject*) self, "notify::anchor", (GCallback) __greeter_compositor_panel_window___lambda87__g_object_notify, self, 0);
	_tmp2_ = greeter_compositor_positioned_window_get_window ((GreeterCompositorPositionedWindow*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = meta_window_get_display (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = meta_display_get_workspace_manager (_tmp5_);
	workspace_manager = _tmp6_;
	_tmp7_ = workspace_manager;
	g_signal_connect_object (_tmp7_, "workspace-added", (GCallback) _greeter_compositor_panel_window_update_strut_meta_workspace_manager_workspace_added, self, 0);
	_tmp8_ = workspace_manager;
	g_signal_connect_object (_tmp8_, "workspace-removed", (GCallback) _greeter_compositor_panel_window_update_strut_meta_workspace_manager_workspace_removed, self, 0);
	_tmp9_ = greeter_compositor_positioned_window_get_window ((GreeterCompositorPositionedWindow*) self);
	_tmp10_ = _tmp9_;
	g_signal_connect_object (_tmp10_, "size-changed", (GCallback) _greeter_compositor_panel_window_update_strut_meta_window_size_changed, self, 0);
	_tmp11_ = greeter_compositor_positioned_window_get_window ((GreeterCompositorPositionedWindow*) self);
	_tmp12_ = _tmp11_;
	g_signal_connect_object (_tmp12_, "position-changed", (GCallback) _greeter_compositor_panel_window_update_strut_meta_window_position_changed, self, 0);
	return obj;
}

static void
greeter_compositor_panel_window_class_init (GreeterCompositorPanelWindowClass * klass,
                                            gpointer klass_data)
{
	GHashTable* _tmp0_;
	greeter_compositor_panel_window_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GreeterCompositorPanelWindow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_greeter_compositor_panel_window_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_greeter_compositor_panel_window_set_property;
	G_OBJECT_CLASS (klass)->constructor = greeter_compositor_panel_window_constructor;
	G_OBJECT_CLASS (klass)->finalize = greeter_compositor_panel_window_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GREETER_COMPOSITOR_PANEL_WINDOW_WM_PROPERTY, greeter_compositor_panel_window_properties[GREETER_COMPOSITOR_PANEL_WINDOW_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));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GREETER_COMPOSITOR_PANEL_WINDOW_ANCHOR_PROPERTY, greeter_compositor_panel_window_properties[GREETER_COMPOSITOR_PANEL_WINDOW_ANCHOR_PROPERTY] = g_param_spec_int ("anchor", "anchor", "anchor", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	_tmp0_ = g_hash_table_new_full (NULL, NULL, _g_object_unref0_, _g_free0_);
	greeter_compositor_panel_window_window_struts = _tmp0_;
}

static void
greeter_compositor_panel_window_instance_init (GreeterCompositorPanelWindow * self,
                                               gpointer klass)
{
	self->priv = greeter_compositor_panel_window_get_instance_private (self);
	self->priv->width = -1;
	self->priv->height = -1;
}

static void
greeter_compositor_panel_window_finalize (GObject * obj)
{
	GreeterCompositorPanelWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GREETER_COMPOSITOR_TYPE_PANEL_WINDOW, GreeterCompositorPanelWindow);
	_g_object_unref0 (self->priv->_wm);
	G_OBJECT_CLASS (greeter_compositor_panel_window_parent_class)->finalize (obj);
}

static GType
greeter_compositor_panel_window_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GreeterCompositorPanelWindowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) greeter_compositor_panel_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GreeterCompositorPanelWindow), 0, (GInstanceInitFunc) greeter_compositor_panel_window_instance_init, NULL };
	GType greeter_compositor_panel_window_type_id;
	greeter_compositor_panel_window_type_id = g_type_register_static (GREETER_COMPOSITOR_TYPE_SHELL_WINDOW, "GreeterCompositorPanelWindow", &g_define_type_info, 0);
	GreeterCompositorPanelWindow_private_offset = g_type_add_instance_private (greeter_compositor_panel_window_type_id, sizeof (GreeterCompositorPanelWindowPrivate));
	return greeter_compositor_panel_window_type_id;
}

GType
greeter_compositor_panel_window_get_type (void)
{
	static volatile gsize greeter_compositor_panel_window_type_id__once = 0;
	if (g_once_init_enter (&greeter_compositor_panel_window_type_id__once)) {
		GType greeter_compositor_panel_window_type_id;
		greeter_compositor_panel_window_type_id = greeter_compositor_panel_window_get_type_once ();
		g_once_init_leave (&greeter_compositor_panel_window_type_id__once, greeter_compositor_panel_window_type_id);
	}
	return greeter_compositor_panel_window_type_id__once;
}

static void
_vala_greeter_compositor_panel_window_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec)
{
	GreeterCompositorPanelWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GREETER_COMPOSITOR_TYPE_PANEL_WINDOW, GreeterCompositorPanelWindow);
	switch (property_id) {
		case GREETER_COMPOSITOR_PANEL_WINDOW_WM_PROPERTY:
		g_value_set_object (value, greeter_compositor_panel_window_get_wm (self));
		break;
		case GREETER_COMPOSITOR_PANEL_WINDOW_ANCHOR_PROPERTY:
		g_value_set_int (value, greeter_compositor_panel_window_get_anchor (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_greeter_compositor_panel_window_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec)
{
	GreeterCompositorPanelWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GREETER_COMPOSITOR_TYPE_PANEL_WINDOW, GreeterCompositorPanelWindow);
	switch (property_id) {
		case GREETER_COMPOSITOR_PANEL_WINDOW_WM_PROPERTY:
		greeter_compositor_panel_window_set_wm (self, g_value_get_object (value));
		break;
		case GREETER_COMPOSITOR_PANEL_WINDOW_ANCHOR_PROPERTY:
		greeter_compositor_panel_window_set_anchor (self, g_value_get_int (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

