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

/*
 * Copyright (c) 2011-2015 Wingpanel Developers (http://launchpad.net/wingpanel)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301 USA.
 */

#include <glib-object.h>
#include <gio/gio.h>
#include <meta/meta-plugin.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>

#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_DBUS_BACKGROUND_MANAGER (greeter_compositor_dbus_background_manager_get_type ())
#define GREETER_COMPOSITOR_DBUS_BACKGROUND_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GREETER_COMPOSITOR_TYPE_DBUS_BACKGROUND_MANAGER, GreeterCompositorDBusBackgroundManager))
#define GREETER_COMPOSITOR_DBUS_BACKGROUND_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GREETER_COMPOSITOR_TYPE_DBUS_BACKGROUND_MANAGER, GreeterCompositorDBusBackgroundManagerClass))
#define GREETER_COMPOSITOR_IS_DBUS_BACKGROUND_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GREETER_COMPOSITOR_TYPE_DBUS_BACKGROUND_MANAGER))
#define GREETER_COMPOSITOR_IS_DBUS_BACKGROUND_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GREETER_COMPOSITOR_TYPE_DBUS_BACKGROUND_MANAGER))
#define GREETER_COMPOSITOR_DBUS_BACKGROUND_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GREETER_COMPOSITOR_TYPE_DBUS_BACKGROUND_MANAGER, GreeterCompositorDBusBackgroundManagerClass))

typedef struct _GreeterCompositorDBusBackgroundManager GreeterCompositorDBusBackgroundManager;
typedef struct _GreeterCompositorDBusBackgroundManagerClass GreeterCompositorDBusBackgroundManagerClass;
typedef struct _GreeterCompositorDBusBackgroundManagerPrivate GreeterCompositorDBusBackgroundManagerPrivate;

#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;
enum  {
	GREETER_COMPOSITOR_DBUS_BACKGROUND_MANAGER_0_PROPERTY,
	GREETER_COMPOSITOR_DBUS_BACKGROUND_MANAGER_NUM_PROPERTIES
};
static GParamSpec* greeter_compositor_dbus_background_manager_properties[GREETER_COMPOSITOR_DBUS_BACKGROUND_MANAGER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#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;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef enum  {
	BACKGROUND_STATE_LIGHT,
	BACKGROUND_STATE_DARK,
	BACKGROUND_STATE_MAXIMIZED,
	BACKGROUND_STATE_TRANSLUCENT_DARK,
	BACKGROUND_STATE_TRANSLUCENT_LIGHT
} BackgroundState;

#define TYPE_BACKGROUND_STATE (background_state_get_type ())
enum  {
	GREETER_COMPOSITOR_DBUS_BACKGROUND_MANAGER_STATE_CHANGED_SIGNAL,
	GREETER_COMPOSITOR_DBUS_BACKGROUND_MANAGER_NUM_SIGNALS
};
static guint greeter_compositor_dbus_background_manager_signals[GREETER_COMPOSITOR_DBUS_BACKGROUND_MANAGER_NUM_SIGNALS] = {0};

struct _GreeterCompositorDBusBackgroundManager {
	GObject parent_instance;
	GreeterCompositorDBusBackgroundManagerPrivate * priv;
};

struct _GreeterCompositorDBusBackgroundManagerClass {
	GObjectClass parent_class;
};

struct _GreeterCompositorDBusBackgroundManagerPrivate {
	GreeterCompositorBackgroundManager* background_manager;
};

static gint GreeterCompositorDBusBackgroundManager_private_offset;
static gpointer greeter_compositor_dbus_background_manager_parent_class = NULL;
static GreeterCompositorDBusBackgroundManager* greeter_compositor_dbus_background_manager_instance;
static GreeterCompositorDBusBackgroundManager* greeter_compositor_dbus_background_manager_instance = NULL;
static GreeterCompositorWindowManager* greeter_compositor_dbus_background_manager_wm;
static GreeterCompositorWindowManager* greeter_compositor_dbus_background_manager_wm = NULL;

VALA_EXTERN GType greeter_compositor_dbus_background_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GreeterCompositorDBusBackgroundManager, g_object_unref)
VALA_EXTERN guint greeter_compositor_dbus_background_manager_register_object (void* object,
                                                                  GDBusConnection* connection,
                                                                  const gchar* path,
                                                                  GError** error);
VALA_EXTERN GType greeter_compositor_background_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GreeterCompositorBackgroundManager, 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 void greeter_compositor_dbus_background_manager_init (GreeterCompositorWindowManager* _wm);
static void __lambda11_ (GDBusConnection* connection);
VALA_EXTERN GreeterCompositorDBusBackgroundManager* greeter_compositor_dbus_background_manager_new (void);
VALA_EXTERN GreeterCompositorDBusBackgroundManager* greeter_compositor_dbus_background_manager_construct (GType object_type);
static void ___lambda11__gbus_acquired_callback (GDBusConnection* connection,
                                          const gchar* name,
                                          gpointer self);
static void __lambda12_ (void);
static void ___lambda12__gbus_name_acquired_callback (GDBusConnection* connection,
                                               const gchar* name,
                                               gpointer self);
static void __lambda13_ (void);
static void ___lambda13__gbus_name_lost_callback (GDBusConnection* connection,
                                           const gchar* name,
                                           gpointer self);
VALA_EXTERN void greeter_compositor_dbus_background_manager_initialize (GreeterCompositorDBusBackgroundManager* self,
                                                            gint monitor,
                                                            gint panel_height,
                                                            GError** error);
VALA_EXTERN GreeterCompositorBackgroundManager* greeter_compositor_background_manager_new (GreeterCompositorWindowManager* _wm,
                                                                               gint panel_height);
VALA_EXTERN GreeterCompositorBackgroundManager* greeter_compositor_background_manager_construct (GType object_type,
                                                                                     GreeterCompositorWindowManager* _wm,
                                                                                     gint panel_height);
VALA_EXTERN GType background_state_get_type (void) G_GNUC_CONST ;
static void __lambda14_ (GreeterCompositorDBusBackgroundManager* self,
                  BackgroundState state,
                  guint animation_duration);
static void ___lambda14__greeter_compositor_background_manager_state_changed (GreeterCompositorBackgroundManager* _sender,
                                                                       BackgroundState state,
                                                                       guint animation_duration,
                                                                       gpointer self);
VALA_EXTERN gboolean greeter_compositor_dbus_background_manager_begin_grab_focused_window (GreeterCompositorDBusBackgroundManager* self,
                                                                               gint x,
                                                                               gint y,
                                                                               gint button,
                                                                               guint time,
                                                                               guint state,
                                                                               GError** error);
VALA_EXTERN void greeter_compositor_dbus_background_manager_remember_focused_window (GreeterCompositorDBusBackgroundManager* self,
                                                                         GError** error);
VALA_EXTERN void greeter_compositor_dbus_background_manager_restore_focused_window (GreeterCompositorDBusBackgroundManager* self,
                                                                        GError** error);
static void g_cclosure_user_marshal_VOID__ENUM_UINT (GClosure * closure,
                                              GValue * return_value,
                                              guint n_param_values,
                                              const GValue * param_values,
                                              gpointer invocation_hint,
                                              gpointer marshal_data);
static void greeter_compositor_dbus_background_manager_finalize (GObject * obj);
static GType greeter_compositor_dbus_background_manager_get_type_once (void);
static void _dbus_greeter_compositor_dbus_background_manager_initialize (GreeterCompositorDBusBackgroundManager* self,
                                                                  GVariant* _parameters_,
                                                                  GDBusMethodInvocation* invocation);
static void _dbus_greeter_compositor_dbus_background_manager_begin_grab_focused_window (GreeterCompositorDBusBackgroundManager* self,
                                                                                 GVariant* _parameters_,
                                                                                 GDBusMethodInvocation* invocation);
static void _dbus_greeter_compositor_dbus_background_manager_remember_focused_window (GreeterCompositorDBusBackgroundManager* self,
                                                                               GVariant* _parameters_,
                                                                               GDBusMethodInvocation* invocation);
static void _dbus_greeter_compositor_dbus_background_manager_restore_focused_window (GreeterCompositorDBusBackgroundManager* self,
                                                                              GVariant* _parameters_,
                                                                              GDBusMethodInvocation* invocation);
static void greeter_compositor_dbus_background_manager_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* greeter_compositor_dbus_background_manager_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 greeter_compositor_dbus_background_manager_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_greeter_compositor_dbus_background_manager_state_changed (GObject* _sender,
                                                                     BackgroundState state,
                                                                     guint animation_duration,
                                                                     gpointer* _data);
static void _greeter_compositor_dbus_background_manager_unregister_object (gpointer user_data);

static const GDBusArgInfo _greeter_compositor_dbus_background_manager_dbus_arg_info_initialize_monitor = {-1, "monitor", "i", NULL};
static const GDBusArgInfo _greeter_compositor_dbus_background_manager_dbus_arg_info_initialize_panel_height = {-1, "panel_height", "i", NULL};
static const GDBusArgInfo * const _greeter_compositor_dbus_background_manager_dbus_arg_info_initialize_in[] = {&_greeter_compositor_dbus_background_manager_dbus_arg_info_initialize_monitor, &_greeter_compositor_dbus_background_manager_dbus_arg_info_initialize_panel_height, NULL};
static const GDBusArgInfo * const _greeter_compositor_dbus_background_manager_dbus_arg_info_initialize_out[] = {NULL};
static const GDBusMethodInfo _greeter_compositor_dbus_background_manager_dbus_method_info_initialize = {-1, "Initialize", (GDBusArgInfo **) (&_greeter_compositor_dbus_background_manager_dbus_arg_info_initialize_in), (GDBusArgInfo **) (&_greeter_compositor_dbus_background_manager_dbus_arg_info_initialize_out), NULL};
static const GDBusArgInfo _greeter_compositor_dbus_background_manager_dbus_arg_info_begin_grab_focused_window_x = {-1, "x", "i", NULL};
static const GDBusArgInfo _greeter_compositor_dbus_background_manager_dbus_arg_info_begin_grab_focused_window_y = {-1, "y", "i", NULL};
static const GDBusArgInfo _greeter_compositor_dbus_background_manager_dbus_arg_info_begin_grab_focused_window_button = {-1, "button", "i", NULL};
static const GDBusArgInfo _greeter_compositor_dbus_background_manager_dbus_arg_info_begin_grab_focused_window_time = {-1, "time", "u", NULL};
static const GDBusArgInfo _greeter_compositor_dbus_background_manager_dbus_arg_info_begin_grab_focused_window_state = {-1, "state", "u", NULL};
static const GDBusArgInfo _greeter_compositor_dbus_background_manager_dbus_arg_info_begin_grab_focused_window_result = {-1, "result", "b", NULL};
static const GDBusArgInfo * const _greeter_compositor_dbus_background_manager_dbus_arg_info_begin_grab_focused_window_in[] = {&_greeter_compositor_dbus_background_manager_dbus_arg_info_begin_grab_focused_window_x, &_greeter_compositor_dbus_background_manager_dbus_arg_info_begin_grab_focused_window_y, &_greeter_compositor_dbus_background_manager_dbus_arg_info_begin_grab_focused_window_button, &_greeter_compositor_dbus_background_manager_dbus_arg_info_begin_grab_focused_window_time, &_greeter_compositor_dbus_background_manager_dbus_arg_info_begin_grab_focused_window_state, NULL};
static const GDBusArgInfo * const _greeter_compositor_dbus_background_manager_dbus_arg_info_begin_grab_focused_window_out[] = {&_greeter_compositor_dbus_background_manager_dbus_arg_info_begin_grab_focused_window_result, NULL};
static const GDBusMethodInfo _greeter_compositor_dbus_background_manager_dbus_method_info_begin_grab_focused_window = {-1, "BeginGrabFocusedWindow", (GDBusArgInfo **) (&_greeter_compositor_dbus_background_manager_dbus_arg_info_begin_grab_focused_window_in), (GDBusArgInfo **) (&_greeter_compositor_dbus_background_manager_dbus_arg_info_begin_grab_focused_window_out), NULL};
static const GDBusArgInfo * const _greeter_compositor_dbus_background_manager_dbus_arg_info_remember_focused_window_in[] = {NULL};
static const GDBusArgInfo * const _greeter_compositor_dbus_background_manager_dbus_arg_info_remember_focused_window_out[] = {NULL};
static const GDBusMethodInfo _greeter_compositor_dbus_background_manager_dbus_method_info_remember_focused_window = {-1, "RememberFocusedWindow", (GDBusArgInfo **) (&_greeter_compositor_dbus_background_manager_dbus_arg_info_remember_focused_window_in), (GDBusArgInfo **) (&_greeter_compositor_dbus_background_manager_dbus_arg_info_remember_focused_window_out), NULL};
static const GDBusArgInfo * const _greeter_compositor_dbus_background_manager_dbus_arg_info_restore_focused_window_in[] = {NULL};
static const GDBusArgInfo * const _greeter_compositor_dbus_background_manager_dbus_arg_info_restore_focused_window_out[] = {NULL};
static const GDBusMethodInfo _greeter_compositor_dbus_background_manager_dbus_method_info_restore_focused_window = {-1, "RestoreFocusedWindow", (GDBusArgInfo **) (&_greeter_compositor_dbus_background_manager_dbus_arg_info_restore_focused_window_in), (GDBusArgInfo **) (&_greeter_compositor_dbus_background_manager_dbus_arg_info_restore_focused_window_out), NULL};
static const GDBusMethodInfo * const _greeter_compositor_dbus_background_manager_dbus_method_info[] = {&_greeter_compositor_dbus_background_manager_dbus_method_info_initialize, &_greeter_compositor_dbus_background_manager_dbus_method_info_begin_grab_focused_window, &_greeter_compositor_dbus_background_manager_dbus_method_info_remember_focused_window, &_greeter_compositor_dbus_background_manager_dbus_method_info_restore_focused_window, NULL};
static const GDBusArgInfo _greeter_compositor_dbus_background_manager_dbus_arg_info_state_changed_state = {-1, "state", "i", NULL};
static const GDBusArgInfo _greeter_compositor_dbus_background_manager_dbus_arg_info_state_changed_animation_duration = {-1, "animation_duration", "u", NULL};
static const GDBusArgInfo * const _greeter_compositor_dbus_background_manager_dbus_arg_info_state_changed[] = {&_greeter_compositor_dbus_background_manager_dbus_arg_info_state_changed_state, &_greeter_compositor_dbus_background_manager_dbus_arg_info_state_changed_animation_duration, NULL};
static const GDBusSignalInfo _greeter_compositor_dbus_background_manager_dbus_signal_info_state_changed = {-1, "StateChanged", (GDBusArgInfo **) (&_greeter_compositor_dbus_background_manager_dbus_arg_info_state_changed), NULL};
static const GDBusSignalInfo * const _greeter_compositor_dbus_background_manager_dbus_signal_info[] = {&_greeter_compositor_dbus_background_manager_dbus_signal_info_state_changed, NULL};
static const GDBusPropertyInfo * const _greeter_compositor_dbus_background_manager_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _greeter_compositor_dbus_background_manager_dbus_interface_info = {-1, "org.pantheon.gala.WingpanelInterface", (GDBusMethodInfo **) (&_greeter_compositor_dbus_background_manager_dbus_method_info), (GDBusSignalInfo **) (&_greeter_compositor_dbus_background_manager_dbus_signal_info), (GDBusPropertyInfo **) (&_greeter_compositor_dbus_background_manager_dbus_property_info), NULL};
static const GDBusInterfaceVTable _greeter_compositor_dbus_background_manager_dbus_interface_vtable = {greeter_compositor_dbus_background_manager_dbus_interface_method_call, greeter_compositor_dbus_background_manager_dbus_interface_get_property, greeter_compositor_dbus_background_manager_dbus_interface_set_property};

static inline gpointer
greeter_compositor_dbus_background_manager_get_instance_private (GreeterCompositorDBusBackgroundManager* self)
{
	return G_STRUCT_MEMBER_P (self, GreeterCompositorDBusBackgroundManager_private_offset);
}

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

static void
__lambda11_ (GDBusConnection* connection)
{
	GreeterCompositorDBusBackgroundManager* _tmp0_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (connection != NULL);
	_tmp0_ = greeter_compositor_dbus_background_manager_instance;
	if (_tmp0_ == NULL) {
		GreeterCompositorDBusBackgroundManager* _tmp1_;
		_tmp1_ = greeter_compositor_dbus_background_manager_new ();
		_g_object_unref0 (greeter_compositor_dbus_background_manager_instance);
		greeter_compositor_dbus_background_manager_instance = _tmp1_;
	}
	{
		GreeterCompositorDBusBackgroundManager* _tmp2_;
		_tmp2_ = greeter_compositor_dbus_background_manager_instance;
		greeter_compositor_dbus_background_manager_register_object (_tmp2_, connection, "/org/pantheon/gala/WingpanelInterface", &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp3_;
		const gchar* _tmp4_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp3_ = e;
		_tmp4_ = _tmp3_->message;
		g_warning ("DBusBackgroundManager.vala:38: %s", _tmp4_);
		_g_error_free0 (e);
	}
	__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;
	}
}

static void
___lambda11__gbus_acquired_callback (GDBusConnection* connection,
                                     const gchar* name,
                                     gpointer self)
{
	__lambda11_ (connection);
}

static void
__lambda12_ (void)
{
}

static void
___lambda12__gbus_name_acquired_callback (GDBusConnection* connection,
                                          const gchar* name,
                                          gpointer self)
{
	__lambda12_ ();
}

static void
__lambda13_ (void)
{
	g_warning ("DBusBackgroundManager.vala:42: Could not acquire name\n");
}

static void
___lambda13__gbus_name_lost_callback (GDBusConnection* connection,
                                      const gchar* name,
                                      gpointer self)
{
	__lambda13_ ();
}

void
greeter_compositor_dbus_background_manager_init (GreeterCompositorWindowManager* _wm)
{
	GreeterCompositorWindowManager* _tmp0_;
	g_return_if_fail (_wm != NULL);
	_tmp0_ = _g_object_ref0 (_wm);
	_g_object_unref0 (greeter_compositor_dbus_background_manager_wm);
	greeter_compositor_dbus_background_manager_wm = _tmp0_;
	g_bus_own_name_with_closures (G_BUS_TYPE_SESSION, "org.pantheon.gala.WingpanelInterface", G_BUS_NAME_OWNER_FLAGS_NONE, (GClosure*) ((___lambda11__gbus_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda11__gbus_acquired_callback, NULL, (GClosureNotify) NULL)), (GClosure*) ((___lambda12__gbus_name_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda12__gbus_name_acquired_callback, NULL, (GClosureNotify) NULL)), (GClosure*) ((___lambda13__gbus_name_lost_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda13__gbus_name_lost_callback, NULL, (GClosureNotify) NULL)));
}

static void
__lambda14_ (GreeterCompositorDBusBackgroundManager* self,
             BackgroundState state,
             guint animation_duration)
{
	g_signal_emit (self, greeter_compositor_dbus_background_manager_signals[GREETER_COMPOSITOR_DBUS_BACKGROUND_MANAGER_STATE_CHANGED_SIGNAL], 0, state, animation_duration);
}

static void
___lambda14__greeter_compositor_background_manager_state_changed (GreeterCompositorBackgroundManager* _sender,
                                                                  BackgroundState state,
                                                                  guint animation_duration,
                                                                  gpointer self)
{
	__lambda14_ ((GreeterCompositorDBusBackgroundManager*) self, state, animation_duration);
}

void
greeter_compositor_dbus_background_manager_initialize (GreeterCompositorDBusBackgroundManager* self,
                                                       gint monitor,
                                                       gint panel_height,
                                                       GError** error)
{
	GreeterCompositorWindowManager* _tmp0_;
	GreeterCompositorBackgroundManager* _tmp1_;
	GreeterCompositorBackgroundManager* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = greeter_compositor_dbus_background_manager_wm;
	_tmp1_ = greeter_compositor_background_manager_new (_tmp0_, panel_height);
	_g_object_unref0 (self->priv->background_manager);
	self->priv->background_manager = _tmp1_;
	_tmp2_ = self->priv->background_manager;
	g_signal_connect_object (_tmp2_, "state-changed", (GCallback) ___lambda14__greeter_compositor_background_manager_state_changed, self, 0);
}

gboolean
greeter_compositor_dbus_background_manager_begin_grab_focused_window (GreeterCompositorDBusBackgroundManager* self,
                                                                      gint x,
                                                                      gint y,
                                                                      gint button,
                                                                      guint time,
                                                                      guint state,
                                                                      GError** error)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = FALSE;
	return result;
}

void
greeter_compositor_dbus_background_manager_remember_focused_window (GreeterCompositorDBusBackgroundManager* self,
                                                                    GError** error)
{
	g_return_if_fail (self != NULL);
}

void
greeter_compositor_dbus_background_manager_restore_focused_window (GreeterCompositorDBusBackgroundManager* self,
                                                                   GError** error)
{
	g_return_if_fail (self != NULL);
}

GreeterCompositorDBusBackgroundManager*
greeter_compositor_dbus_background_manager_construct (GType object_type)
{
	GreeterCompositorDBusBackgroundManager * self = NULL;
	self = (GreeterCompositorDBusBackgroundManager*) g_object_new (object_type, NULL);
	return self;
}

GreeterCompositorDBusBackgroundManager*
greeter_compositor_dbus_background_manager_new (void)
{
	return greeter_compositor_dbus_background_manager_construct (GREETER_COMPOSITOR_TYPE_DBUS_BACKGROUND_MANAGER);
}

static void
g_cclosure_user_marshal_VOID__ENUM_UINT (GClosure * closure,
                                         GValue * return_value,
                                         guint n_param_values,
                                         const GValue * param_values,
                                         gpointer invocation_hint,
                                         gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__ENUM_UINT) (gpointer data1, gint arg_1, guint arg_2, gpointer data2);
	register GMarshalFunc_VOID__ENUM_UINT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 3);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__ENUM_UINT) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_enum (param_values + 1), g_value_get_uint (param_values + 2), data2);
}

static void
greeter_compositor_dbus_background_manager_class_init (GreeterCompositorDBusBackgroundManagerClass * klass,
                                                       gpointer klass_data)
{
	greeter_compositor_dbus_background_manager_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GreeterCompositorDBusBackgroundManager_private_offset);
	G_OBJECT_CLASS (klass)->finalize = greeter_compositor_dbus_background_manager_finalize;
	greeter_compositor_dbus_background_manager_signals[GREETER_COMPOSITOR_DBUS_BACKGROUND_MANAGER_STATE_CHANGED_SIGNAL] = g_signal_new ("state-changed", GREETER_COMPOSITOR_TYPE_DBUS_BACKGROUND_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__ENUM_UINT, G_TYPE_NONE, 2, TYPE_BACKGROUND_STATE, G_TYPE_UINT);
}

static void
greeter_compositor_dbus_background_manager_instance_init (GreeterCompositorDBusBackgroundManager * self,
                                                          gpointer klass)
{
	self->priv = greeter_compositor_dbus_background_manager_get_instance_private (self);
}

static void
greeter_compositor_dbus_background_manager_finalize (GObject * obj)
{
	GreeterCompositorDBusBackgroundManager * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GREETER_COMPOSITOR_TYPE_DBUS_BACKGROUND_MANAGER, GreeterCompositorDBusBackgroundManager);
	_g_object_unref0 (self->priv->background_manager);
	G_OBJECT_CLASS (greeter_compositor_dbus_background_manager_parent_class)->finalize (obj);
}

static GType
greeter_compositor_dbus_background_manager_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GreeterCompositorDBusBackgroundManagerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) greeter_compositor_dbus_background_manager_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GreeterCompositorDBusBackgroundManager), 0, (GInstanceInitFunc) greeter_compositor_dbus_background_manager_instance_init, NULL };
	GType greeter_compositor_dbus_background_manager_type_id;
	greeter_compositor_dbus_background_manager_type_id = g_type_register_static (G_TYPE_OBJECT, "GreeterCompositorDBusBackgroundManager", &g_define_type_info, 0);
	g_type_set_qdata (greeter_compositor_dbus_background_manager_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) greeter_compositor_dbus_background_manager_register_object);
	GreeterCompositorDBusBackgroundManager_private_offset = g_type_add_instance_private (greeter_compositor_dbus_background_manager_type_id, sizeof (GreeterCompositorDBusBackgroundManagerPrivate));
	return greeter_compositor_dbus_background_manager_type_id;
}

GType
greeter_compositor_dbus_background_manager_get_type (void)
{
	static volatile gsize greeter_compositor_dbus_background_manager_type_id__once = 0;
	if (g_once_init_enter (&greeter_compositor_dbus_background_manager_type_id__once)) {
		GType greeter_compositor_dbus_background_manager_type_id;
		greeter_compositor_dbus_background_manager_type_id = greeter_compositor_dbus_background_manager_get_type_once ();
		g_once_init_leave (&greeter_compositor_dbus_background_manager_type_id__once, greeter_compositor_dbus_background_manager_type_id);
	}
	return greeter_compositor_dbus_background_manager_type_id__once;
}

static void
_dbus_greeter_compositor_dbus_background_manager_initialize (GreeterCompositorDBusBackgroundManager* self,
                                                             GVariant* _parameters_,
                                                             GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gint monitor = 0;
	GVariant* _tmp27_;
	gint panel_height = 0;
	GVariant* _tmp28_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp27_ = g_variant_iter_next_value (&_arguments_iter);
	monitor = g_variant_get_int32 (_tmp27_);
	g_variant_unref (_tmp27_);
	_tmp28_ = g_variant_iter_next_value (&_arguments_iter);
	panel_height = g_variant_get_int32 (_tmp28_);
	g_variant_unref (_tmp28_);
	greeter_compositor_dbus_background_manager_initialize (self, monitor, panel_height, &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);
	_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);
}

static void
_dbus_greeter_compositor_dbus_background_manager_begin_grab_focused_window (GreeterCompositorDBusBackgroundManager* self,
                                                                            GVariant* _parameters_,
                                                                            GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gint x = 0;
	GVariant* _tmp29_;
	gint y = 0;
	GVariant* _tmp30_;
	gint button = 0;
	GVariant* _tmp31_;
	guint time = 0U;
	GVariant* _tmp32_;
	guint state = 0U;
	GVariant* _tmp33_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gboolean result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp29_ = g_variant_iter_next_value (&_arguments_iter);
	x = g_variant_get_int32 (_tmp29_);
	g_variant_unref (_tmp29_);
	_tmp30_ = g_variant_iter_next_value (&_arguments_iter);
	y = g_variant_get_int32 (_tmp30_);
	g_variant_unref (_tmp30_);
	_tmp31_ = g_variant_iter_next_value (&_arguments_iter);
	button = g_variant_get_int32 (_tmp31_);
	g_variant_unref (_tmp31_);
	_tmp32_ = g_variant_iter_next_value (&_arguments_iter);
	time = g_variant_get_uint32 (_tmp32_);
	g_variant_unref (_tmp32_);
	_tmp33_ = g_variant_iter_next_value (&_arguments_iter);
	state = g_variant_get_uint32 (_tmp33_);
	g_variant_unref (_tmp33_);
	result = greeter_compositor_dbus_background_manager_begin_grab_focused_window (self, x, y, button, time, state, &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_boolean (result));
	_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);
}

static void
_dbus_greeter_compositor_dbus_background_manager_remember_focused_window (GreeterCompositorDBusBackgroundManager* self,
                                                                          GVariant* _parameters_,
                                                                          GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	greeter_compositor_dbus_background_manager_remember_focused_window (self, &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);
	_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);
}

static void
_dbus_greeter_compositor_dbus_background_manager_restore_focused_window (GreeterCompositorDBusBackgroundManager* self,
                                                                         GVariant* _parameters_,
                                                                         GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	greeter_compositor_dbus_background_manager_restore_focused_window (self, &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);
	_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);
}

static void
greeter_compositor_dbus_background_manager_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, "Initialize") == 0) {
		_dbus_greeter_compositor_dbus_background_manager_initialize (object, parameters, invocation);
	} else if (strcmp (method_name, "BeginGrabFocusedWindow") == 0) {
		_dbus_greeter_compositor_dbus_background_manager_begin_grab_focused_window (object, parameters, invocation);
	} else if (strcmp (method_name, "RememberFocusedWindow") == 0) {
		_dbus_greeter_compositor_dbus_background_manager_remember_focused_window (object, parameters, invocation);
	} else if (strcmp (method_name, "RestoreFocusedWindow") == 0) {
		_dbus_greeter_compositor_dbus_background_manager_restore_focused_window (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
greeter_compositor_dbus_background_manager_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
greeter_compositor_dbus_background_manager_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_greeter_compositor_dbus_background_manager_state_changed (GObject* _sender,
                                                                BackgroundState state,
                                                                guint animation_duration,
                                                                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);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_int32 (state));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (animation_duration));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.pantheon.gala.WingpanelInterface", "StateChanged", _arguments, NULL);
}

guint
greeter_compositor_dbus_background_manager_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 *) (&_greeter_compositor_dbus_background_manager_dbus_interface_info), &_greeter_compositor_dbus_background_manager_dbus_interface_vtable, data, _greeter_compositor_dbus_background_manager_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "state-changed", (GCallback) _dbus_greeter_compositor_dbus_background_manager_state_changed, data);
	return result;
}

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

