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

/**/
/*  Copyright (C) 2012 - 2014 Tom Beckmann, Jacob Parker*/
/**/
/*  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 3 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, see <http://www.gnu.org/licenses/>.*/
/**/

#include <glib-object.h>
#include <gio/gio.h>
#include <glib.h>
#include <float.h>
#include <math.h>
#include "gala.h"
#include <stdlib.h>
#include <string.h>
#include <meta/meta-plugin.h>
#include <meta/meta-background-group.h>
#include <clutter/clutter.h>
#include <cogl/cogl.h>
#include <gobject/gvaluecollector.h>

#define GALA_DBUS_SATURATION_WEIGHT 1.5
#define GALA_DBUS_WEIGHT_THRESHOLD 1.0
#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 GALA_TYPE_DBUS (gala_dbus_get_type ())
#define GALA_DBUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_TYPE_DBUS, GalaDBus))
#define GALA_DBUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GALA_TYPE_DBUS, GalaDBusClass))
#define GALA_IS_DBUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_TYPE_DBUS))
#define GALA_IS_DBUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GALA_TYPE_DBUS))
#define GALA_DBUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GALA_TYPE_DBUS, GalaDBusClass))

typedef struct _GalaDBus GalaDBus;
typedef struct _GalaDBusClass GalaDBusClass;
typedef struct _GalaDBusPrivate GalaDBusPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _gala_dbus_unref0(var) ((var == NULL) ? NULL : (var = (gala_dbus_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define GALA_TYPE_DESKTOP_INTEGRATION (gala_desktop_integration_get_type ())
#define GALA_DESKTOP_INTEGRATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_TYPE_DESKTOP_INTEGRATION, GalaDesktopIntegration))
#define GALA_DESKTOP_INTEGRATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GALA_TYPE_DESKTOP_INTEGRATION, GalaDesktopIntegrationClass))
#define GALA_IS_DESKTOP_INTEGRATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_TYPE_DESKTOP_INTEGRATION))
#define GALA_IS_DESKTOP_INTEGRATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GALA_TYPE_DESKTOP_INTEGRATION))
#define GALA_DESKTOP_INTEGRATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GALA_TYPE_DESKTOP_INTEGRATION, GalaDesktopIntegrationClass))

typedef struct _GalaDesktopIntegration GalaDesktopIntegration;
typedef struct _GalaDesktopIntegrationClass GalaDesktopIntegrationClass;

#define GALA_TYPE_DBUS_ACCELERATOR (gala_dbus_accelerator_get_type ())
#define GALA_DBUS_ACCELERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_TYPE_DBUS_ACCELERATOR, GalaDBusAccelerator))
#define GALA_DBUS_ACCELERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GALA_TYPE_DBUS_ACCELERATOR, GalaDBusAcceleratorClass))
#define GALA_IS_DBUS_ACCELERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_TYPE_DBUS_ACCELERATOR))
#define GALA_IS_DBUS_ACCELERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GALA_TYPE_DBUS_ACCELERATOR))
#define GALA_DBUS_ACCELERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GALA_TYPE_DBUS_ACCELERATOR, GalaDBusAcceleratorClass))

typedef struct _GalaDBusAccelerator GalaDBusAccelerator;
typedef struct _GalaDBusAcceleratorClass GalaDBusAcceleratorClass;

#define GALA_TYPE_SCREENSHOT_MANAGER (gala_screenshot_manager_get_type ())
#define GALA_SCREENSHOT_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_TYPE_SCREENSHOT_MANAGER, GalaScreenshotManager))
#define GALA_SCREENSHOT_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GALA_TYPE_SCREENSHOT_MANAGER, GalaScreenshotManagerClass))
#define GALA_IS_SCREENSHOT_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_TYPE_SCREENSHOT_MANAGER))
#define GALA_IS_SCREENSHOT_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GALA_TYPE_SCREENSHOT_MANAGER))
#define GALA_SCREENSHOT_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GALA_TYPE_SCREENSHOT_MANAGER, GalaScreenshotManagerClass))

typedef struct _GalaScreenshotManager GalaScreenshotManager;
typedef struct _GalaScreenshotManagerClass GalaScreenshotManagerClass;

#define GALA_TYPE_SESSION_MANAGER (gala_session_manager_get_type ())
#define GALA_SESSION_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_TYPE_SESSION_MANAGER, GalaSessionManager))
#define GALA_SESSION_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GALA_TYPE_SESSION_MANAGER, GalaSessionManagerClass))
#define GALA_IS_SESSION_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_TYPE_SESSION_MANAGER))
#define GALA_IS_SESSION_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GALA_TYPE_SESSION_MANAGER))
#define GALA_SESSION_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GALA_TYPE_SESSION_MANAGER, GalaSessionManagerClass))

typedef struct _GalaSessionManager GalaSessionManager;
typedef struct _GalaSessionManagerClass GalaSessionManagerClass;

#define GALA_TYPE_WINDOW_MANAGER_GALA (gala_window_manager_gala_get_type ())
#define GALA_WINDOW_MANAGER_GALA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_TYPE_WINDOW_MANAGER_GALA, GalaWindowManagerGala))
#define GALA_WINDOW_MANAGER_GALA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GALA_TYPE_WINDOW_MANAGER_GALA, GalaWindowManagerGalaClass))
#define GALA_IS_WINDOW_MANAGER_GALA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_TYPE_WINDOW_MANAGER_GALA))
#define GALA_IS_WINDOW_MANAGER_GALA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GALA_TYPE_WINDOW_MANAGER_GALA))
#define GALA_WINDOW_MANAGER_GALA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GALA_TYPE_WINDOW_MANAGER_GALA, GalaWindowManagerGalaClass))

typedef struct _GalaWindowManagerGala GalaWindowManagerGala;
typedef struct _GalaWindowManagerGalaClass GalaWindowManagerGalaClass;

#define GALA_TYPE_SCREEN_SAVER_MANAGER (gala_screen_saver_manager_get_type ())
#define GALA_SCREEN_SAVER_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_TYPE_SCREEN_SAVER_MANAGER, GalaScreenSaverManager))
#define GALA_SCREEN_SAVER_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GALA_TYPE_SCREEN_SAVER_MANAGER, GalaScreenSaverManagerClass))
#define GALA_IS_SCREEN_SAVER_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_TYPE_SCREEN_SAVER_MANAGER))
#define GALA_IS_SCREEN_SAVER_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GALA_TYPE_SCREEN_SAVER_MANAGER))
#define GALA_SCREEN_SAVER_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GALA_TYPE_SCREEN_SAVER_MANAGER, GalaScreenSaverManagerClass))

typedef struct _GalaScreenSaverManager GalaScreenSaverManager;
typedef struct _GalaScreenSaverManagerClass GalaScreenSaverManagerClass;
typedef struct _Block1Data Block1Data;

#define GALA_TYPE_BACKGROUND_CONTAINER (gala_background_container_get_type ())
#define GALA_BACKGROUND_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_TYPE_BACKGROUND_CONTAINER, GalaBackgroundContainer))
#define GALA_BACKGROUND_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GALA_TYPE_BACKGROUND_CONTAINER, GalaBackgroundContainerClass))
#define GALA_IS_BACKGROUND_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_TYPE_BACKGROUND_CONTAINER))
#define GALA_IS_BACKGROUND_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GALA_TYPE_BACKGROUND_CONTAINER))
#define GALA_BACKGROUND_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GALA_TYPE_BACKGROUND_CONTAINER, GalaBackgroundContainerClass))

typedef struct _GalaBackgroundContainer GalaBackgroundContainer;
typedef struct _GalaBackgroundContainerClass GalaBackgroundContainerClass;

#define GALA_DBUS_TYPE_COLOR_INFORMATION (gala_dbus_color_information_get_type ())
typedef struct _GalaDBusColorInformation GalaDBusColorInformation;

#define GALA_DBUS_TYPE_DUMMY_OFFSCREEN_EFFECT (gala_dbus_dummy_offscreen_effect_get_type ())
#define GALA_DBUS_DUMMY_OFFSCREEN_EFFECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_DBUS_TYPE_DUMMY_OFFSCREEN_EFFECT, GalaDBusDummyOffscreenEffect))
#define GALA_DBUS_DUMMY_OFFSCREEN_EFFECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GALA_DBUS_TYPE_DUMMY_OFFSCREEN_EFFECT, GalaDBusDummyOffscreenEffectClass))
#define GALA_DBUS_IS_DUMMY_OFFSCREEN_EFFECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_DBUS_TYPE_DUMMY_OFFSCREEN_EFFECT))
#define GALA_DBUS_IS_DUMMY_OFFSCREEN_EFFECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GALA_DBUS_TYPE_DUMMY_OFFSCREEN_EFFECT))
#define GALA_DBUS_DUMMY_OFFSCREEN_EFFECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GALA_DBUS_TYPE_DUMMY_OFFSCREEN_EFFECT, GalaDBusDummyOffscreenEffectClass))

typedef struct _GalaDBusDummyOffscreenEffect GalaDBusDummyOffscreenEffect;
typedef struct _GalaDBusDummyOffscreenEffectClass GalaDBusDummyOffscreenEffectClass;
typedef struct _Block2Data Block2Data;
#define _cogl_object_unref0(var) ((var == NULL) ? NULL : (var = (cogl_object_unref (var), NULL)))
typedef struct _GalaDbusGetBackgroundColorInformationData GalaDbusGetBackgroundColorInformationData;
typedef struct _GalaDBusDummyOffscreenEffectPrivate GalaDBusDummyOffscreenEffectPrivate;
enum  {
	GALA_DBUS_DUMMY_OFFSCREEN_EFFECT_0_PROPERTY,
	GALA_DBUS_DUMMY_OFFSCREEN_EFFECT_NUM_PROPERTIES
};
static GParamSpec* gala_dbus_dummy_offscreen_effect_properties[GALA_DBUS_DUMMY_OFFSCREEN_EFFECT_NUM_PROPERTIES];
enum  {
	GALA_DBUS_DUMMY_OFFSCREEN_EFFECT_DONE_PAINTING_SIGNAL,
	GALA_DBUS_DUMMY_OFFSCREEN_EFFECT_NUM_SIGNALS
};
static guint gala_dbus_dummy_offscreen_effect_signals[GALA_DBUS_DUMMY_OFFSCREEN_EFFECT_NUM_SIGNALS] = {0};
typedef struct _GalaParamSpecDBus GalaParamSpecDBus;
enum  {
	GALA_DBUS_BACKGROUND_CHANGED_SIGNAL,
	GALA_DBUS_NUM_SIGNALS
};
static guint gala_dbus_signals[GALA_DBUS_NUM_SIGNALS] = {0};
typedef struct _GalaDbusGetBackgroundColorInformationReadyData GalaDbusGetBackgroundColorInformationReadyData;

struct _GalaDBus {
	GTypeInstance parent_instance;
	volatile int ref_count;
	GalaDBusPrivate * priv;
};

struct _GalaDBusClass {
	GTypeClass parent_class;
	void (*finalize) (GalaDBus *self);
};

struct _Block1Data {
	int _ref_count_;
	GalaScreenSaverManager* screensaver_manager;
};

struct _GalaDBusColorInformation {
	gdouble average_red;
	gdouble average_green;
	gdouble average_blue;
	gdouble mean;
	gdouble variance;
};

struct _Block2Data {
	int _ref_count_;
	GalaDBus* self;
	ClutterActor* background;
	GalaDBusDummyOffscreenEffect* effect;
	gint x_start;
	gint y_start;
	gint width;
	gint height;
	gdouble variance;
	gdouble mean;
	gdouble r_total;
	gdouble g_total;
	gdouble b_total;
	gulong paint_signal_handler;
	gpointer _async_data_;
};

struct _GalaDbusGetBackgroundColorInformationData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GalaDBus* self;
	gint monitor;
	gint reference_x;
	gint reference_y;
	gint reference_width;
	gint reference_height;
	GalaDBusColorInformation result;
	Block2Data* _data2_;
	GalaWindowManager* _tmp0_;
	MetaBackgroundGroup* _tmp1_;
	MetaBackgroundGroup* _tmp2_;
	ClutterActor* _tmp3_;
	ClutterActor* _tmp4_;
	ClutterActor* _tmp5_;
	GError* _tmp6_;
	GalaDBusDummyOffscreenEffect* _tmp7_;
	ClutterActor* _tmp8_;
	GalaDBusDummyOffscreenEffect* _tmp9_;
	gint tex_width;
	ClutterActor* _tmp10_;
	gfloat _tmp11_;
	gfloat _tmp12_;
	gint tex_height;
	ClutterActor* _tmp13_;
	gfloat _tmp14_;
	gfloat _tmp15_;
	gboolean _tmp16_;
	gboolean _tmp17_;
	gboolean _tmp18_;
	GError* _tmp19_;
	GalaDBusDummyOffscreenEffect* _tmp20_;
	gulong _tmp21_;
	ClutterActor* _tmp22_;
	GalaDBusColorInformation _tmp23_;
	GError* _inner_error0_;
};

struct _GalaDBusDummyOffscreenEffect {
	ClutterOffscreenEffect parent_instance;
	GalaDBusDummyOffscreenEffectPrivate * priv;
};

struct _GalaDBusDummyOffscreenEffectClass {
	ClutterOffscreenEffectClass parent_class;
};

struct _GalaParamSpecDBus {
	GParamSpec parent_instance;
};

struct _GalaDbusGetBackgroundColorInformationReadyData {
	GDBusMethodInvocation* _invocation_;
	gint monitor;
	gint reference_x;
	gint reference_y;
	gint reference_width;
	gint reference_height;
};

static gpointer gala_dbus_parent_class = NULL;
static GalaDBus* gala_dbus_instance;
static GalaDBus* gala_dbus_instance = NULL;
static GalaWindowManager* gala_dbus_wm;
static GalaWindowManager* gala_dbus_wm = NULL;
static gpointer gala_dbus_dummy_offscreen_effect_parent_class = NULL;

VALA_EXTERN gpointer gala_dbus_ref (gpointer instance);
VALA_EXTERN void gala_dbus_unref (gpointer instance);
VALA_EXTERN GParamSpec* gala_param_spec_dbus (const gchar* name,
                                  const gchar* nick,
                                  const gchar* blurb,
                                  GType object_type,
                                  GParamFlags flags);
VALA_EXTERN void gala_value_set_dbus (GValue* value,
                          gpointer v_object);
VALA_EXTERN void gala_value_take_dbus (GValue* value,
                           gpointer v_object);
VALA_EXTERN gpointer gala_value_get_dbus (const GValue* value);
VALA_EXTERN GType gala_dbus_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GalaDBus, gala_dbus_unref)
VALA_EXTERN guint gala_dbus_register_object (void* object,
                                 GDBusConnection* connection,
                                 const gchar* path,
                                 GError** error);
VALA_EXTERN void gala_dbus_init (GalaWindowManager* _wm);
static void __lambda4_ (GDBusConnection* connection);
static GalaDBus* gala_dbus_new (void);
static GalaDBus* gala_dbus_construct (GType object_type);
VALA_EXTERN GalaDesktopIntegration* gala_desktop_integration_new (GalaWindowManager* wm);
VALA_EXTERN GalaDesktopIntegration* gala_desktop_integration_construct (GType object_type,
                                                            GalaWindowManager* wm);
VALA_EXTERN GType gala_desktop_integration_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GalaDesktopIntegration, g_object_unref)
VALA_EXTERN guint gala_desktop_integration_register_object (void* object,
                                                GDBusConnection* connection,
                                                const gchar* path,
                                                GError** error);
static void ___lambda4__gbus_acquired_callback (GDBusConnection* connection,
                                         const gchar* name,
                                         gpointer self);
static void __lambda170_ (void);
static void ___lambda170__gbus_name_acquired_callback (GDBusConnection* connection,
                                                const gchar* name,
                                                gpointer self);
static void __lambda171_ (void);
static void ___lambda171__gbus_name_lost_callback (GDBusConnection* connection,
                                            const gchar* name,
                                            gpointer self);
static void __lambda172_ (GDBusConnection* connection);
VALA_EXTERN gpointer gala_dbus_accelerator_ref (gpointer instance);
VALA_EXTERN void gala_dbus_accelerator_unref (gpointer instance);
VALA_EXTERN GParamSpec* gala_param_spec_dbus_accelerator (const gchar* name,
                                              const gchar* nick,
                                              const gchar* blurb,
                                              GType object_type,
                                              GParamFlags flags);
VALA_EXTERN void gala_value_set_dbus_accelerator (GValue* value,
                                      gpointer v_object);
VALA_EXTERN void gala_value_take_dbus_accelerator (GValue* value,
                                       gpointer v_object);
VALA_EXTERN gpointer gala_value_get_dbus_accelerator (const GValue* value);
VALA_EXTERN GType gala_dbus_accelerator_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GalaDBusAccelerator, gala_dbus_accelerator_unref)
VALA_EXTERN guint gala_dbus_accelerator_register_object (void* object,
                                             GDBusConnection* connection,
                                             const gchar* path,
                                             GError** error);
VALA_EXTERN GalaDBusAccelerator* gala_dbus_accelerator_init (GalaWindowManager* wm);
VALA_EXTERN GType gala_screenshot_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GalaScreenshotManager, g_object_unref)
VALA_EXTERN guint gala_screenshot_manager_register_object (void* object,
                                               GDBusConnection* connection,
                                               const gchar* path,
                                               GError** error);
VALA_EXTERN GalaScreenshotManager* gala_screenshot_manager_init (GalaWindowManager* wm);
static void ___lambda172__gbus_acquired_callback (GDBusConnection* connection,
                                           const gchar* name,
                                           gpointer self);
static void __lambda173_ (void);
static void ___lambda173__gbus_name_acquired_callback (GDBusConnection* connection,
                                                const gchar* name,
                                                gpointer self);
static void __lambda174_ (void);
static void ___lambda174__gbus_name_lost_callback (GDBusConnection* connection,
                                            const gchar* name,
                                            gpointer self);
static void __lambda175_ (void);
static void ___lambda175__gbus_acquired_callback (GDBusConnection* connection,
                                           const gchar* name,
                                           gpointer self);
static void __lambda176_ (void);
static void ___lambda176__gbus_name_acquired_callback (GDBusConnection* connection,
                                                const gchar* name,
                                                gpointer self);
static void __lambda177_ (void);
static void ___lambda177__gbus_name_lost_callback (GDBusConnection* connection,
                                            const gchar* name,
                                            gpointer self);
static void __lambda178_ (GDBusConnection* connection);
VALA_EXTERN GType gala_session_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GalaSessionManager, g_object_unref)
VALA_EXTERN guint gala_session_manager_register_object (void* object,
                                            GDBusConnection* connection,
                                            const gchar* path,
                                            GError** error);
VALA_EXTERN GalaSessionManager* gala_session_manager_init (void);
static void ___lambda178__gbus_acquired_callback (GDBusConnection* connection,
                                           const gchar* name,
                                           gpointer self);
static void __lambda184_ (void);
static void ___lambda184__gbus_name_acquired_callback (GDBusConnection* connection,
                                                const gchar* name,
                                                gpointer self);
static void __lambda185_ (void);
static void ___lambda185__gbus_name_lost_callback (GDBusConnection* connection,
                                            const gchar* name,
                                            gpointer self);
VALA_EXTERN GType gala_window_manager_gala_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GalaWindowManagerGala, g_object_unref)
VALA_EXTERN GType gala_screen_saver_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GalaScreenSaverManager, g_object_unref)
VALA_EXTERN guint gala_screen_saver_manager_register_object (void* object,
                                                 GDBusConnection* connection,
                                                 const gchar* path,
                                                 GError** error);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
VALA_EXTERN GalaScreenSaverManager* gala_window_manager_gala_get_screensaver (GalaWindowManagerGala* self);
static void ___lambda186_ (Block1Data* _data1_,
                    GDBusConnection* connection);
static void ____lambda186__gbus_acquired_callback (GDBusConnection* connection,
                                            const gchar* name,
                                            gpointer self);
static void ___lambda187_ (void);
static void ____lambda187__gbus_name_acquired_callback (GDBusConnection* connection,
                                                 const gchar* name,
                                                 gpointer self);
static void ___lambda188_ (void);
static void ____lambda188__gbus_name_lost_callback (GDBusConnection* connection,
                                             const gchar* name,
                                             gpointer self);
VALA_EXTERN GType gala_background_container_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GalaBackgroundContainer, g_object_unref)
static void ___lambda189_ (GalaDBus* self);
static void ____lambda189__gala_background_container_changed (GalaBackgroundContainer* _sender,
                                                       gpointer self);
VALA_EXTERN void gala_dbus_perform_action (GalaDBus* self,
                               GalaActionType type,
                               GError** error);
static void gala_dbus_get_background_color_information_data_free (gpointer _data);
VALA_EXTERN GType gala_dbus_color_information_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GalaDBusColorInformation* gala_dbus_color_information_dup (const GalaDBusColorInformation* self);
VALA_EXTERN void gala_dbus_color_information_free (GalaDBusColorInformation* self);
VALA_EXTERN void gala_dbus_get_background_color_information (GalaDBus* self,
                                                 gint monitor,
                                                 gint reference_x,
                                                 gint reference_y,
                                                 gint reference_width,
                                                 gint reference_height,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_);
VALA_EXTERN void gala_dbus_get_background_color_information_finish (GalaDBus* self,
                                                        GAsyncResult* _res_,
                                                        GalaDBusColorInformation* result,
                                                        GError** error);
static gboolean gala_dbus_get_background_color_information_co (GalaDbusGetBackgroundColorInformationData* _data_);
static GType gala_dbus_dummy_offscreen_effect_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GalaDBusDummyOffscreenEffect, g_object_unref)
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static GalaDBusDummyOffscreenEffect* gala_dbus_dummy_offscreen_effect_new (void);
static GalaDBusDummyOffscreenEffect* gala_dbus_dummy_offscreen_effect_construct (GType object_type);
static void __lambda190_ (Block2Data* _data2_);
static void ___lambda190__gala_dbus_dummy_offscreen_effect_done_painting (GalaDBusDummyOffscreenEffect* _sender,
                                                                   gpointer self);
static void gala_dbus_dummy_offscreen_effect_real_post_paint (ClutterEffect* base,
                                                       ClutterPaintNode* node,
                                                       ClutterPaintContext* context);
static GType gala_dbus_dummy_offscreen_effect_get_type_once (void);
static void gala_dbus_finalize (GalaDBus * obj);
static GType gala_dbus_get_type_once (void);
static void _dbus_gala_dbus_perform_action (GalaDBus* self,
                                     GVariant* _parameters_,
                                     GDBusMethodInvocation* invocation);
static void _dbus_gala_dbus_get_background_color_information (GalaDBus* self,
                                                       GVariant* _parameters_,
                                                       GDBusMethodInvocation* invocation);
static void _dbus_gala_dbus_get_background_color_information_ready (GObject * source_object,
                                                             GAsyncResult * _res_,
                                                             gpointer _user_data_);
static void gala_dbus_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* gala_dbus_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 gala_dbus_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_gala_dbus_background_changed (GObject* _sender,
                                         gpointer* _data);
static void _gala_dbus_unregister_object (gpointer user_data);

static const GDBusArgInfo _gala_dbus_dbus_arg_info_perform_action_type = {-1, "type", "i", NULL};
static const GDBusArgInfo * const _gala_dbus_dbus_arg_info_perform_action_in[] = {&_gala_dbus_dbus_arg_info_perform_action_type, NULL};
static const GDBusArgInfo * const _gala_dbus_dbus_arg_info_perform_action_out[] = {NULL};
static const GDBusMethodInfo _gala_dbus_dbus_method_info_perform_action = {-1, "PerformAction", (GDBusArgInfo **) (&_gala_dbus_dbus_arg_info_perform_action_in), (GDBusArgInfo **) (&_gala_dbus_dbus_arg_info_perform_action_out), NULL};
static const GDBusArgInfo _gala_dbus_dbus_arg_info_get_background_color_information_monitor = {-1, "monitor", "i", NULL};
static const GDBusArgInfo _gala_dbus_dbus_arg_info_get_background_color_information_reference_x = {-1, "reference_x", "i", NULL};
static const GDBusArgInfo _gala_dbus_dbus_arg_info_get_background_color_information_reference_y = {-1, "reference_y", "i", NULL};
static const GDBusArgInfo _gala_dbus_dbus_arg_info_get_background_color_information_reference_width = {-1, "reference_width", "i", NULL};
static const GDBusArgInfo _gala_dbus_dbus_arg_info_get_background_color_information_reference_height = {-1, "reference_height", "i", NULL};
static const GDBusArgInfo _gala_dbus_dbus_arg_info_get_background_color_information_result = {-1, "result", "(ddddd)", NULL};
static const GDBusArgInfo * const _gala_dbus_dbus_arg_info_get_background_color_information_in[] = {&_gala_dbus_dbus_arg_info_get_background_color_information_monitor, &_gala_dbus_dbus_arg_info_get_background_color_information_reference_x, &_gala_dbus_dbus_arg_info_get_background_color_information_reference_y, &_gala_dbus_dbus_arg_info_get_background_color_information_reference_width, &_gala_dbus_dbus_arg_info_get_background_color_information_reference_height, NULL};
static const GDBusArgInfo * const _gala_dbus_dbus_arg_info_get_background_color_information_out[] = {&_gala_dbus_dbus_arg_info_get_background_color_information_result, NULL};
static const GDBusMethodInfo _gala_dbus_dbus_method_info_get_background_color_information = {-1, "GetBackgroundColorInformation", (GDBusArgInfo **) (&_gala_dbus_dbus_arg_info_get_background_color_information_in), (GDBusArgInfo **) (&_gala_dbus_dbus_arg_info_get_background_color_information_out), NULL};
static const GDBusMethodInfo * const _gala_dbus_dbus_method_info[] = {&_gala_dbus_dbus_method_info_perform_action, &_gala_dbus_dbus_method_info_get_background_color_information, NULL};
static const GDBusArgInfo * const _gala_dbus_dbus_arg_info_background_changed[] = {NULL};
static const GDBusSignalInfo _gala_dbus_dbus_signal_info_background_changed = {-1, "BackgroundChanged", (GDBusArgInfo **) (&_gala_dbus_dbus_arg_info_background_changed), NULL};
static const GDBusSignalInfo * const _gala_dbus_dbus_signal_info[] = {&_gala_dbus_dbus_signal_info_background_changed, NULL};
static const GDBusPropertyInfo * const _gala_dbus_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _gala_dbus_dbus_interface_info = {-1, "org.pantheon.gala", (GDBusMethodInfo **) (&_gala_dbus_dbus_method_info), (GDBusSignalInfo **) (&_gala_dbus_dbus_signal_info), (GDBusPropertyInfo **) (&_gala_dbus_dbus_property_info), NULL};
static const GDBusInterfaceVTable _gala_dbus_dbus_interface_vtable = {gala_dbus_dbus_interface_method_call, gala_dbus_dbus_interface_get_property, gala_dbus_dbus_interface_set_property};

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

static void
__lambda4_ (GDBusConnection* connection)
{
	GalaDBus* _tmp0_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (connection != NULL);
	_tmp0_ = gala_dbus_instance;
	if (_tmp0_ == NULL) {
		GalaDBus* _tmp1_;
		_tmp1_ = gala_dbus_new ();
		_gala_dbus_unref0 (gala_dbus_instance);
		gala_dbus_instance = _tmp1_;
	}
	{
		GalaDBus* _tmp2_;
		_tmp2_ = gala_dbus_instance;
		gala_dbus_register_object (_tmp2_, connection, "/org/pantheon/gala", &_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 ("DBus.vala:35: %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;
	}
	{
		GalaWindowManager* _tmp5_;
		GalaDesktopIntegration* _tmp6_;
		GalaDesktopIntegration* _tmp7_;
		_tmp5_ = gala_dbus_wm;
		_tmp6_ = gala_desktop_integration_new (_tmp5_);
		_tmp7_ = _tmp6_;
		gala_desktop_integration_register_object (_tmp7_, connection, "/org/pantheon/gala/DesktopInterface", &_inner_error0_);
		_g_object_unref0 (_tmp7_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch1_g_error;
		}
	}
	goto __finally1;
	__catch1_g_error:
	{
		GError* e = NULL;
		GError* _tmp8_;
		const gchar* _tmp9_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp8_ = e;
		_tmp9_ = _tmp8_->message;
		g_warning ("DBus.vala:39: %s", _tmp9_);
		_g_error_free0 (e);
	}
	__finally1:
	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
___lambda4__gbus_acquired_callback (GDBusConnection* connection,
                                    const gchar* name,
                                    gpointer self)
{
	__lambda4_ (connection);
}

static void
__lambda170_ (void)
{
}

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

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

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

static void
__lambda172_ (GDBusConnection* connection)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (connection != NULL);
	{
		GalaWindowManager* _tmp0_;
		GalaDBusAccelerator* _tmp1_;
		GalaWindowManager* _tmp2_;
		GalaScreenshotManager* _tmp3_;
		_tmp0_ = gala_dbus_wm;
		_tmp1_ = gala_dbus_accelerator_init (_tmp0_);
		gala_dbus_accelerator_register_object (_tmp1_, connection, "/org/gnome/Shell", &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp2_ = gala_dbus_wm;
		_tmp3_ = gala_screenshot_manager_init (_tmp2_);
		gala_screenshot_manager_register_object (_tmp3_, connection, "/org/gnome/Shell/Screenshot", &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp4_;
		const gchar* _tmp5_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp4_ = e;
		_tmp5_ = _tmp4_->message;
		g_warning ("DBus.vala:49: %s", _tmp5_);
		_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
___lambda172__gbus_acquired_callback (GDBusConnection* connection,
                                      const gchar* name,
                                      gpointer self)
{
	__lambda172_ (connection);
}

static void
__lambda173_ (void)
{
}

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

static void
__lambda174_ (void)
{
	g_critical ("DBus.vala:52: Could not acquire name");
}

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

static void
__lambda175_ (void)
{
}

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

static void
__lambda176_ (void)
{
}

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

static void
__lambda177_ (void)
{
	g_critical ("DBus.vala:57: Could not acquire name");
}

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

static void
__lambda178_ (GDBusConnection* connection)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (connection != NULL);
	{
		GalaSessionManager* _tmp0_;
		_tmp0_ = gala_session_manager_init ();
		gala_session_manager_register_object (_tmp0_, connection, "/org/gnome/SessionManager/EndSessionDialog", &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp1_;
		const gchar* _tmp2_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp1_ = e;
		_tmp2_ = _tmp1_->message;
		g_warning ("DBus.vala:63: %s", _tmp2_);
		_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
___lambda178__gbus_acquired_callback (GDBusConnection* connection,
                                      const gchar* name,
                                      gpointer self)
{
	__lambda178_ (connection);
}

static void
__lambda184_ (void)
{
}

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

static void
__lambda185_ (void)
{
	g_critical ("DBus.vala:66: Could not acquire name");
}

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

static Block1Data*
block1_data_ref (Block1Data* _data1_)
{
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}

static void
block1_data_unref (void * _userdata_)
{
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		_g_object_unref0 (_data1_->screensaver_manager);
		g_slice_free (Block1Data, _data1_);
	}
}

static void
___lambda186_ (Block1Data* _data1_,
               GDBusConnection* connection)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (connection != NULL);
	{
		GalaScreenSaverManager* _tmp0_;
		_tmp0_ = _data1_->screensaver_manager;
		gala_screen_saver_manager_register_object (_tmp0_, connection, "/org/gnome/ScreenSaver", &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp1_;
		const gchar* _tmp2_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp1_ = e;
		_tmp2_ = _tmp1_->message;
		g_warning ("DBus.vala:76: %s", _tmp2_);
		_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
____lambda186__gbus_acquired_callback (GDBusConnection* connection,
                                       const gchar* name,
                                       gpointer self)
{
	___lambda186_ (self, connection);
}

static void
___lambda187_ (void)
{
}

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

static void
___lambda188_ (void)
{
	g_critical ("DBus.vala:79: Could not acquire ScreenSaver bus");
}

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

void
gala_dbus_init (GalaWindowManager* _wm)
{
	GalaWindowManager* _tmp0_;
	GalaWindowManagerGala* gala_wm = NULL;
	GalaWindowManager* _tmp1_;
	GalaWindowManagerGala* _tmp2_;
	g_return_if_fail (_wm != NULL);
	_tmp0_ = _g_object_ref0 (_wm);
	_g_object_unref0 (gala_dbus_wm);
	gala_dbus_wm = _tmp0_;
	g_bus_own_name_with_closures (G_BUS_TYPE_SESSION, "org.pantheon.gala", G_BUS_NAME_OWNER_FLAGS_NONE, (GClosure*) ((___lambda4__gbus_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda4__gbus_acquired_callback, NULL, (GClosureNotify) NULL)), (GClosure*) ((___lambda170__gbus_name_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda170__gbus_name_acquired_callback, NULL, (GClosureNotify) NULL)), (GClosure*) ((___lambda171__gbus_name_lost_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda171__gbus_name_lost_callback, NULL, (GClosureNotify) NULL)));
	g_bus_own_name_with_closures (G_BUS_TYPE_SESSION, "org.gnome.Shell", G_BUS_NAME_OWNER_FLAGS_NONE, (GClosure*) ((___lambda172__gbus_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda172__gbus_acquired_callback, NULL, (GClosureNotify) NULL)), (GClosure*) ((___lambda173__gbus_name_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda173__gbus_name_acquired_callback, NULL, (GClosureNotify) NULL)), (GClosure*) ((___lambda174__gbus_name_lost_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda174__gbus_name_lost_callback, NULL, (GClosureNotify) NULL)));
	g_bus_own_name_with_closures (G_BUS_TYPE_SESSION, "org.gnome.Shell.Screenshot", G_BUS_NAME_OWNER_FLAGS_REPLACE, (GClosure*) ((___lambda175__gbus_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda175__gbus_acquired_callback, NULL, (GClosureNotify) NULL)), (GClosure*) ((___lambda176__gbus_name_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda176__gbus_name_acquired_callback, NULL, (GClosureNotify) NULL)), (GClosure*) ((___lambda177__gbus_name_lost_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda177__gbus_name_lost_callback, NULL, (GClosureNotify) NULL)));
	g_bus_own_name_with_closures (G_BUS_TYPE_SESSION, "org.gnome.SessionManager.EndSessionDialog", G_BUS_NAME_OWNER_FLAGS_NONE, (GClosure*) ((___lambda178__gbus_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda178__gbus_acquired_callback, NULL, (GClosureNotify) NULL)), (GClosure*) ((___lambda184__gbus_name_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda184__gbus_name_acquired_callback, NULL, (GClosureNotify) NULL)), (GClosure*) ((___lambda185__gbus_name_lost_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda185__gbus_name_lost_callback, NULL, (GClosureNotify) NULL)));
	_tmp1_ = gala_dbus_wm;
	gala_wm = GALA_IS_WINDOW_MANAGER_GALA (_tmp1_) ? ((GalaWindowManagerGala*) _tmp1_) : NULL;
	_tmp2_ = gala_wm;
	if (_tmp2_ != NULL) {
		Block1Data* _data1_;
		GalaWindowManagerGala* _tmp3_;
		GalaScreenSaverManager* _tmp4_;
		GalaScreenSaverManager* _tmp5_;
		GalaScreenSaverManager* _tmp6_;
		_data1_ = g_slice_new0 (Block1Data);
		_data1_->_ref_count_ = 1;
		_tmp3_ = gala_wm;
		_tmp4_ = gala_window_manager_gala_get_screensaver (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = _g_object_ref0 (_tmp5_);
		_data1_->screensaver_manager = _tmp6_;
		g_bus_own_name_with_closures (G_BUS_TYPE_SESSION, "org.gnome.ScreenSaver", G_BUS_NAME_OWNER_FLAGS_REPLACE, (GClosure*) ((____lambda186__gbus_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ____lambda186__gbus_acquired_callback, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref)), (GClosure*) ((____lambda187__gbus_name_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ____lambda187__gbus_name_acquired_callback, NULL, (GClosureNotify) NULL)), (GClosure*) ((____lambda188__gbus_name_lost_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ____lambda188__gbus_name_lost_callback, NULL, (GClosureNotify) NULL)));
		block1_data_unref (_data1_);
		_data1_ = NULL;
	}
}

static void
___lambda189_ (GalaDBus* self)
{
	g_signal_emit (self, gala_dbus_signals[GALA_DBUS_BACKGROUND_CHANGED_SIGNAL], 0);
}

static void
____lambda189__gala_background_container_changed (GalaBackgroundContainer* _sender,
                                                  gpointer self)
{
	___lambda189_ ((GalaDBus*) self);
}

static GalaDBus*
gala_dbus_construct (GType object_type)
{
	GalaDBus* self = NULL;
	GalaWindowManager* _tmp0_;
	MetaBackgroundGroup* _tmp1_;
	MetaBackgroundGroup* _tmp2_;
	self = (GalaDBus*) g_type_create_instance (object_type);
	_tmp0_ = gala_dbus_wm;
	_tmp1_ = gala_window_manager_get_background_group (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ != NULL) {
		GalaWindowManager* _tmp3_;
		MetaBackgroundGroup* _tmp4_;
		MetaBackgroundGroup* _tmp5_;
		_tmp3_ = gala_dbus_wm;
		_tmp4_ = gala_window_manager_get_background_group (_tmp3_);
		_tmp5_ = _tmp4_;
		g_signal_connect (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, GALA_TYPE_BACKGROUND_CONTAINER, GalaBackgroundContainer), "changed", (GCallback) ____lambda189__gala_background_container_changed, self);
	} else {
		g_assert_not_reached ();
	}
	return self;
}

static GalaDBus*
gala_dbus_new (void)
{
	return gala_dbus_construct (GALA_TYPE_DBUS);
}

void
gala_dbus_perform_action (GalaDBus* self,
                          GalaActionType type,
                          GError** error)
{
	GalaWindowManager* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gala_dbus_wm;
	gala_window_manager_perform_action (_tmp0_, type);
}

static void
gala_dbus_get_background_color_information_data_free (gpointer _data)
{
	GalaDbusGetBackgroundColorInformationData* _data_;
	_data_ = _data;
	_gala_dbus_unref0 (_data_->self);
	g_slice_free (GalaDbusGetBackgroundColorInformationData, _data_);
}

static gpointer
_gala_dbus_ref0 (gpointer self)
{
	return self ? gala_dbus_ref (self) : NULL;
}

void
gala_dbus_get_background_color_information (GalaDBus* self,
                                            gint monitor,
                                            gint reference_x,
                                            gint reference_y,
                                            gint reference_width,
                                            gint reference_height,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_)
{
	GalaDbusGetBackgroundColorInformationData* _data_;
	GalaDBus* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (GalaDbusGetBackgroundColorInformationData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gala_dbus_get_background_color_information_data_free);
	_tmp0_ = _gala_dbus_ref0 (self);
	_data_->self = _tmp0_;
	_data_->monitor = monitor;
	_data_->reference_x = reference_x;
	_data_->reference_y = reference_y;
	_data_->reference_width = reference_width;
	_data_->reference_height = reference_height;
	gala_dbus_get_background_color_information_co (_data_);
}

void
gala_dbus_get_background_color_information_finish (GalaDBus* self,
                                                   GAsyncResult* _res_,
                                                   GalaDBusColorInformation* result,
                                                   GError** error)
{
	GalaDbusGetBackgroundColorInformationData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
	*result = _data_->result;
}

/**
         * Attaches a dummy offscreen effect to the background at monitor to get its
         * isolated color data. Then calculate the red, green and blue components of
         * the average color in that area and the mean color value and variance. All
         * variables are returned as a tuple in that order.
         *
         * @param monitor          The monitor where the panel will be placed
         * @param reference_x      X coordinate of the rectangle used to gather color data
         *                         relative to the monitor you picked. Values will be clamped
         *                         to its dimensions
         * @param reference_y      Y coordinate
         * @param reference_width  Width of the rectangle
         * @param reference_height Height of the rectangle
         */
static Block2Data*
block2_data_ref (Block2Data* _data2_)
{
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}

static void
block2_data_unref (void * _userdata_)
{
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		GalaDBus* self;
		self = _data2_->self;
		_g_object_unref0 (_data2_->effect);
		_g_object_unref0 (_data2_->background);
		_gala_dbus_unref0 (self);
		g_slice_free (Block2Data, _data2_);
	}
}

static gpointer
_cogl_object_ref0 (gpointer self)
{
	return self ? cogl_object_ref (self) : NULL;
}

static void
__lambda190_ (Block2Data* _data2_)
{
	GalaDBus* self;
	GalaDBusDummyOffscreenEffect* _tmp0_;
	ClutterActor* _tmp1_;
	GalaDBusDummyOffscreenEffect* _tmp2_;
	CoglTexture* texture = NULL;
	GalaDBusDummyOffscreenEffect* _tmp3_;
	CoglHandle* _tmp4_;
	CoglTexture* _tmp5_;
	guint8* pixels = NULL;
	CoglTexture* _tmp6_;
	CoglTexture* _tmp7_;
	guint8* _tmp8_;
	gint pixels_length1;
	gint _pixels_size_;
	CoglTexture* _tmp9_;
	guint8* _tmp10_;
	gint _tmp10__length1;
	gint size = 0;
	gdouble mean_squares = 0.0;
	gdouble pixel = 0.0;
	gdouble max = 0.0;
	gdouble min = 0.0;
	gdouble score = 0.0;
	gdouble delta = 0.0;
	gdouble score_total = 0.0;
	gdouble r_total2 = 0.0;
	gdouble g_total2 = 0.0;
	gdouble b_total2 = 0.0;
	gdouble max_val = 0.0;
	self = _data2_->self;
	_tmp0_ = _data2_->effect;
	g_signal_handler_disconnect (_tmp0_, _data2_->paint_signal_handler);
	_tmp1_ = _data2_->background;
	_tmp2_ = _data2_->effect;
	clutter_actor_remove_effect (_tmp1_, (ClutterEffect*) _tmp2_);
	_tmp3_ = _data2_->effect;
	_tmp4_ = clutter_offscreen_effect_get_texture ((ClutterOffscreenEffect*) _tmp3_);
	_tmp5_ = _cogl_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, cogl_texture_get_gtype (), CoglTexture));
	texture = _tmp5_;
	_tmp6_ = texture;
	_tmp7_ = texture;
	_tmp8_ = g_new0 (guint8, (cogl_texture_get_width (_tmp6_) * cogl_texture_get_height (_tmp7_)) * 4);
	pixels = _tmp8_;
	pixels_length1 = (cogl_texture_get_width (_tmp6_) * cogl_texture_get_height (_tmp7_)) * 4;
	_pixels_size_ = pixels_length1;
	_tmp9_ = texture;
	_tmp10_ = pixels;
	_tmp10__length1 = pixels_length1;
	cogl_texture_get_data (_tmp9_, COGL_PIXEL_FORMAT_BGRA_8888_PRE, (guint) 0, _tmp10_);
	size = _data2_->width * _data2_->height;
	mean_squares = (gdouble) 0;
	pixel = (gdouble) 0;
	score_total = (gdouble) 0;
	r_total2 = (gdouble) 0;
	g_total2 = (gdouble) 0;
	b_total2 = (gdouble) 0;
	{
		gint y = 0;
		y = _data2_->y_start;
		{
			gboolean _tmp11_ = FALSE;
			_tmp11_ = TRUE;
			while (TRUE) {
				if (!_tmp11_) {
					gint _tmp12_;
					_tmp12_ = y;
					y = _tmp12_ + 1;
				}
				_tmp11_ = FALSE;
				if (!(y < _data2_->height)) {
					break;
				}
				{
					gint x = 0;
					x = _data2_->x_start;
					{
						gboolean _tmp13_ = FALSE;
						_tmp13_ = TRUE;
						while (TRUE) {
							gint i = 0;
							guint8 r = 0U;
							guint8* _tmp15_;
							gint _tmp15__length1;
							guint8 _tmp16_;
							guint8 g = 0U;
							guint8* _tmp17_;
							gint _tmp17__length1;
							guint8 _tmp18_;
							guint8 b = 0U;
							guint8* _tmp19_;
							gint _tmp19__length1;
							guint8 _tmp20_;
							gdouble _tmp21_ = 0.0;
							if (!_tmp13_) {
								gint _tmp14_;
								_tmp14_ = x;
								x = _tmp14_ + 1;
							}
							_tmp13_ = FALSE;
							if (!(x < _data2_->width)) {
								break;
							}
							i = ((y * _data2_->width) * 4) + (x * 4);
							_tmp15_ = pixels;
							_tmp15__length1 = pixels_length1;
							_tmp16_ = _tmp15_[i];
							r = _tmp16_;
							_tmp17_ = pixels;
							_tmp17__length1 = pixels_length1;
							_tmp18_ = _tmp17_[i + 1];
							g = _tmp18_;
							_tmp19_ = pixels;
							_tmp19__length1 = pixels_length1;
							_tmp20_ = _tmp19_[i + 2];
							b = _tmp20_;
							pixel = (((0.3 * r) + (0.6 * g)) + (0.11 * b)) - 128.f;
							min = (gdouble) MIN (r, MIN (g, b));
							max = (gdouble) MAX (r, MAX (g, b));
							delta = max - min;
							if (delta == ((gdouble) 0)) {
								_tmp21_ = 0.0;
							} else {
								_tmp21_ = delta / max;
							}
							score = GALA_DBUS_SATURATION_WEIGHT * _tmp21_;
							_data2_->r_total += score * r;
							_data2_->g_total += score * g;
							_data2_->b_total += score * b;
							score_total += score;
							_data2_->r_total += (gdouble) r;
							_data2_->g_total += (gdouble) g;
							_data2_->b_total += (gdouble) b;
							_data2_->mean += pixel;
							mean_squares += pixel * pixel;
						}
					}
				}
			}
		}
	}
	score_total /= (gdouble) size;
	_data2_->b_total /= (gdouble) size;
	_data2_->g_total /= (gdouble) size;
	_data2_->r_total /= (gdouble) size;
	if (score_total > 0.0) {
		_data2_->b_total /= score_total;
		_data2_->g_total /= score_total;
		_data2_->r_total /= score_total;
	}
	b_total2 /= (gdouble) (size * G_MAXUINT8);
	g_total2 /= (gdouble) (size * G_MAXUINT8);
	r_total2 /= (gdouble) (size * G_MAXUINT8);
	if (score_total <= GALA_DBUS_WEIGHT_THRESHOLD) {
		gdouble f = 0.0;
		gdouble rf = 0.0;
		f = (1.0 / GALA_DBUS_WEIGHT_THRESHOLD) * score_total;
		rf = 1.0 - f;
		_data2_->b_total = (_data2_->b_total * f) + (b_total2 * rf);
		_data2_->g_total = (_data2_->g_total * f) + (g_total2 * rf);
		_data2_->r_total = (_data2_->r_total * f) + (r_total2 * rf);
	}
	max_val = MAX (_data2_->r_total, MAX (_data2_->g_total, _data2_->b_total));
	if (max_val > 1.0) {
		_data2_->b_total /= max_val;
		_data2_->g_total /= max_val;
		_data2_->r_total /= max_val;
	}
	_data2_->mean /= (gdouble) size;
	mean_squares *= mean_squares / size;
	_data2_->variance = sqrt (mean_squares - (_data2_->mean * _data2_->mean)) / ((gdouble) size);
	gala_dbus_get_background_color_information_co (_data2_->_async_data_);
	pixels = (g_free (pixels), NULL);
	_cogl_object_unref0 (texture);
}

static void
___lambda190__gala_dbus_dummy_offscreen_effect_done_painting (GalaDBusDummyOffscreenEffect* _sender,
                                                              gpointer self)
{
	__lambda190_ (self);
}

static gboolean
gala_dbus_get_background_color_information_co (GalaDbusGetBackgroundColorInformationData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data2_ = g_slice_new0 (Block2Data);
	_data_->_data2_->_ref_count_ = 1;
	_data_->_data2_->self = gala_dbus_ref (_data_->self);
	_data_->_data2_->_async_data_ = _data_;
	_data_->_tmp0_ = gala_dbus_wm;
	_data_->_tmp1_ = gala_window_manager_get_background_group (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = clutter_actor_get_child_at_index ((ClutterActor*) _data_->_tmp2_, _data_->monitor);
	_data_->_tmp4_ = _g_object_ref0 (_data_->_tmp3_);
	_data_->_data2_->background = _data_->_tmp4_;
	_data_->_tmp5_ = _data_->_data2_->background;
	if (_data_->_tmp5_ == NULL) {
		_data_->_tmp6_ = g_error_new_literal (G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "Invalid monitor requested");
		_data_->_inner_error0_ = _data_->_tmp6_;
		if ((_data_->_inner_error0_->domain == G_DBUS_ERROR) || (_data_->_inner_error0_->domain == G_IO_ERROR)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			block2_data_unref (_data_->_data2_);
			_data_->_data2_ = NULL;
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			block2_data_unref (_data_->_data2_);
			_data_->_data2_ = NULL;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->_tmp7_ = gala_dbus_dummy_offscreen_effect_new ();
	g_object_ref_sink (_data_->_tmp7_);
	_data_->_data2_->effect = _data_->_tmp7_;
	_data_->_tmp8_ = _data_->_data2_->background;
	_data_->_tmp9_ = _data_->_data2_->effect;
	clutter_actor_add_effect (_data_->_tmp8_, (ClutterEffect*) _data_->_tmp9_);
	_data_->_tmp10_ = _data_->_data2_->background;
	_data_->_tmp11_ = clutter_actor_get_width (_data_->_tmp10_);
	_data_->_tmp12_ = _data_->_tmp11_;
	_data_->tex_width = (gint) _data_->_tmp12_;
	_data_->_tmp13_ = _data_->_data2_->background;
	_data_->_tmp14_ = clutter_actor_get_height (_data_->_tmp13_);
	_data_->_tmp15_ = _data_->_tmp14_;
	_data_->tex_height = (gint) _data_->_tmp15_;
	_data_->_data2_->x_start = _data_->reference_x;
	_data_->_data2_->y_start = _data_->reference_y;
	_data_->_data2_->width = MIN (_data_->tex_width - _data_->reference_x, _data_->reference_width);
	_data_->_data2_->height = MIN (_data_->tex_height - _data_->reference_y, _data_->reference_height);
	if (_data_->_data2_->x_start > _data_->tex_width) {
		_data_->_tmp18_ = TRUE;
	} else {
		_data_->_tmp18_ = _data_->_data2_->x_start > _data_->tex_height;
	}
	if (_data_->_tmp18_) {
		_data_->_tmp17_ = TRUE;
	} else {
		_data_->_tmp17_ = _data_->_data2_->width <= 0;
	}
	if (_data_->_tmp17_) {
		_data_->_tmp16_ = TRUE;
	} else {
		_data_->_tmp16_ = _data_->_data2_->height <= 0;
	}
	if (_data_->_tmp16_) {
		_data_->_tmp19_ = g_error_new_literal (G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "Invalid rectangle specified");
		_data_->_inner_error0_ = _data_->_tmp19_;
		if ((_data_->_inner_error0_->domain == G_DBUS_ERROR) || (_data_->_inner_error0_->domain == G_IO_ERROR)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			block2_data_unref (_data_->_data2_);
			_data_->_data2_ = NULL;
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			block2_data_unref (_data_->_data2_);
			_data_->_data2_ = NULL;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->_data2_->variance = (gdouble) 0;
	_data_->_data2_->mean = (gdouble) 0;
	_data_->_data2_->r_total = (gdouble) 0;
	_data_->_data2_->g_total = (gdouble) 0;
	_data_->_data2_->b_total = (gdouble) 0;
	_data_->_data2_->paint_signal_handler = (gulong) 0;
	_data_->_tmp20_ = _data_->_data2_->effect;
	_data_->_tmp21_ = g_signal_connect_data (_data_->_tmp20_, "done-painting", (GCallback) ___lambda190__gala_dbus_dummy_offscreen_effect_done_painting, block2_data_ref (_data_->_data2_), (GClosureNotify) block2_data_unref, 0);
	_data_->_data2_->paint_signal_handler = _data_->_tmp21_;
	_data_->_tmp22_ = _data_->_data2_->background;
	clutter_actor_queue_redraw (_data_->_tmp22_);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	memset (&_data_->_tmp23_, 0, sizeof (GalaDBusColorInformation));
	_data_->_tmp23_.average_red = _data_->_data2_->r_total;
	_data_->_tmp23_.average_green = _data_->_data2_->g_total;
	_data_->_tmp23_.average_blue = _data_->_data2_->b_total;
	_data_->_tmp23_.mean = _data_->_data2_->mean;
	_data_->_tmp23_.variance = _data_->_data2_->variance;
	_data_->result = _data_->_tmp23_;
	block2_data_unref (_data_->_data2_);
	_data_->_data2_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
gala_dbus_dummy_offscreen_effect_real_post_paint (ClutterEffect* base,
                                                  ClutterPaintNode* node,
                                                  ClutterPaintContext* context)
{
	GalaDBusDummyOffscreenEffect * self;
	self = (GalaDBusDummyOffscreenEffect*) base;
	g_return_if_fail (node != NULL);
	g_return_if_fail (context != NULL);
	CLUTTER_EFFECT_CLASS (gala_dbus_dummy_offscreen_effect_parent_class)->post_paint ((ClutterEffect*) G_TYPE_CHECK_INSTANCE_CAST (self, clutter_offscreen_effect_get_type (), ClutterOffscreenEffect), node, context);
	g_signal_emit (self, gala_dbus_dummy_offscreen_effect_signals[GALA_DBUS_DUMMY_OFFSCREEN_EFFECT_DONE_PAINTING_SIGNAL], 0);
}

static GalaDBusDummyOffscreenEffect*
gala_dbus_dummy_offscreen_effect_construct (GType object_type)
{
	GalaDBusDummyOffscreenEffect * self = NULL;
	self = (GalaDBusDummyOffscreenEffect*) g_object_new (object_type, NULL);
	return self;
}

static GalaDBusDummyOffscreenEffect*
gala_dbus_dummy_offscreen_effect_new (void)
{
	return gala_dbus_dummy_offscreen_effect_construct (GALA_DBUS_TYPE_DUMMY_OFFSCREEN_EFFECT);
}

static void
gala_dbus_dummy_offscreen_effect_class_init (GalaDBusDummyOffscreenEffectClass * klass,
                                             gpointer klass_data)
{
	gala_dbus_dummy_offscreen_effect_parent_class = g_type_class_peek_parent (klass);
	((ClutterEffectClass *) klass)->post_paint = (void (*) (ClutterEffect*, ClutterPaintNode*, ClutterPaintContext*)) gala_dbus_dummy_offscreen_effect_real_post_paint;
	gala_dbus_dummy_offscreen_effect_signals[GALA_DBUS_DUMMY_OFFSCREEN_EFFECT_DONE_PAINTING_SIGNAL] = g_signal_new ("done-painting", GALA_DBUS_TYPE_DUMMY_OFFSCREEN_EFFECT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
gala_dbus_dummy_offscreen_effect_instance_init (GalaDBusDummyOffscreenEffect * self,
                                                gpointer klass)
{
}

static GType
gala_dbus_dummy_offscreen_effect_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GalaDBusDummyOffscreenEffectClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gala_dbus_dummy_offscreen_effect_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GalaDBusDummyOffscreenEffect), 0, (GInstanceInitFunc) gala_dbus_dummy_offscreen_effect_instance_init, NULL };
	GType gala_dbus_dummy_offscreen_effect_type_id;
	gala_dbus_dummy_offscreen_effect_type_id = g_type_register_static (clutter_offscreen_effect_get_type (), "GalaDBusDummyOffscreenEffect", &g_define_type_info, 0);
	return gala_dbus_dummy_offscreen_effect_type_id;
}

static GType
gala_dbus_dummy_offscreen_effect_get_type (void)
{
	static volatile gsize gala_dbus_dummy_offscreen_effect_type_id__once = 0;
	if (g_once_init_enter (&gala_dbus_dummy_offscreen_effect_type_id__once)) {
		GType gala_dbus_dummy_offscreen_effect_type_id;
		gala_dbus_dummy_offscreen_effect_type_id = gala_dbus_dummy_offscreen_effect_get_type_once ();
		g_once_init_leave (&gala_dbus_dummy_offscreen_effect_type_id__once, gala_dbus_dummy_offscreen_effect_type_id);
	}
	return gala_dbus_dummy_offscreen_effect_type_id__once;
}

GalaDBusColorInformation*
gala_dbus_color_information_dup (const GalaDBusColorInformation* self)
{
	GalaDBusColorInformation* dup;
	dup = g_new0 (GalaDBusColorInformation, 1);
	memcpy (dup, self, sizeof (GalaDBusColorInformation));
	return dup;
}

void
gala_dbus_color_information_free (GalaDBusColorInformation* self)
{
	g_free (self);
}

static GType
gala_dbus_color_information_get_type_once (void)
{
	GType gala_dbus_color_information_type_id;
	gala_dbus_color_information_type_id = g_boxed_type_register_static ("GalaDBusColorInformation", (GBoxedCopyFunc) gala_dbus_color_information_dup, (GBoxedFreeFunc) gala_dbus_color_information_free);
	return gala_dbus_color_information_type_id;
}

GType
gala_dbus_color_information_get_type (void)
{
	static volatile gsize gala_dbus_color_information_type_id__once = 0;
	if (g_once_init_enter (&gala_dbus_color_information_type_id__once)) {
		GType gala_dbus_color_information_type_id;
		gala_dbus_color_information_type_id = gala_dbus_color_information_get_type_once ();
		g_once_init_leave (&gala_dbus_color_information_type_id__once, gala_dbus_color_information_type_id);
	}
	return gala_dbus_color_information_type_id__once;
}

static void
gala_value_dbus_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
gala_value_dbus_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		gala_dbus_unref (value->data[0].v_pointer);
	}
}

static void
gala_value_dbus_copy_value (const GValue* src_value,
                            GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = gala_dbus_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
gala_value_dbus_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
gala_value_dbus_collect_value (GValue* value,
                               guint n_collect_values,
                               GTypeCValue* collect_values,
                               guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		GalaDBus * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = gala_dbus_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
gala_value_dbus_lcopy_value (const GValue* value,
                             guint n_collect_values,
                             GTypeCValue* collect_values,
                             guint collect_flags)
{
	GalaDBus ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = gala_dbus_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
gala_param_spec_dbus (const gchar* name,
                      const gchar* nick,
                      const gchar* blurb,
                      GType object_type,
                      GParamFlags flags)
{
	GalaParamSpecDBus* spec;
	g_return_val_if_fail (g_type_is_a (object_type, GALA_TYPE_DBUS), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

gpointer
gala_value_get_dbus (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GALA_TYPE_DBUS), NULL);
	return value->data[0].v_pointer;
}

void
gala_value_set_dbus (GValue* value,
                     gpointer v_object)
{
	GalaDBus * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GALA_TYPE_DBUS));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GALA_TYPE_DBUS));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		gala_dbus_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		gala_dbus_unref (old);
	}
}

void
gala_value_take_dbus (GValue* value,
                      gpointer v_object)
{
	GalaDBus * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GALA_TYPE_DBUS));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GALA_TYPE_DBUS));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		gala_dbus_unref (old);
	}
}

static void
gala_dbus_class_init (GalaDBusClass * klass,
                      gpointer klass_data)
{
	gala_dbus_parent_class = g_type_class_peek_parent (klass);
	((GalaDBusClass *) klass)->finalize = gala_dbus_finalize;
	/**
	         * Emitted when the background change occurred and the transition ended.
	         * You can safely call get_optimal_panel_alpha then. It is not guaranteed
	         * that this signal will be emitted only once per group of changes as often
	         * done by GUIs. The change may not be visible to the user.
	         */
	gala_dbus_signals[GALA_DBUS_BACKGROUND_CHANGED_SIGNAL] = g_signal_new ("background-changed", GALA_TYPE_DBUS, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
gala_dbus_instance_init (GalaDBus * self,
                         gpointer klass)
{
	self->ref_count = 1;
}

static void
gala_dbus_finalize (GalaDBus * obj)
{
	GalaDBus * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GALA_TYPE_DBUS, GalaDBus);
	g_signal_handlers_destroy (self);
}

static GType
gala_dbus_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { gala_value_dbus_init, gala_value_dbus_free_value, gala_value_dbus_copy_value, gala_value_dbus_peek_pointer, "p", gala_value_dbus_collect_value, "p", gala_value_dbus_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (GalaDBusClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gala_dbus_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GalaDBus), 0, (GInstanceInitFunc) gala_dbus_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType gala_dbus_type_id;
	gala_dbus_type_id = g_type_register_fundamental (g_type_fundamental_next (), "GalaDBus", &g_define_type_info, &g_define_type_fundamental_info, 0);
	g_type_set_qdata (gala_dbus_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) gala_dbus_register_object);
	return gala_dbus_type_id;
}

GType
gala_dbus_get_type (void)
{
	static volatile gsize gala_dbus_type_id__once = 0;
	if (g_once_init_enter (&gala_dbus_type_id__once)) {
		GType gala_dbus_type_id;
		gala_dbus_type_id = gala_dbus_get_type_once ();
		g_once_init_leave (&gala_dbus_type_id__once, gala_dbus_type_id);
	}
	return gala_dbus_type_id__once;
}

gpointer
gala_dbus_ref (gpointer instance)
{
	GalaDBus * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

void
gala_dbus_unref (gpointer instance)
{
	GalaDBus * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		GALA_DBUS_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static void
_dbus_gala_dbus_perform_action (GalaDBus* self,
                                GVariant* _parameters_,
                                GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GalaActionType type = 0;
	GVariant* _tmp0_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp0_ = g_variant_iter_next_value (&_arguments_iter);
	type = g_variant_get_int32 (_tmp0_);
	g_variant_unref (_tmp0_);
	gala_dbus_perform_action (self, type, &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_gala_dbus_get_background_color_information (GalaDBus* self,
                                                  GVariant* _parameters_,
                                                  GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	GalaDbusGetBackgroundColorInformationReadyData* _ready_data;
	GVariant* _tmp1_;
	GVariant* _tmp2_;
	GVariant* _tmp3_;
	GVariant* _tmp4_;
	GVariant* _tmp5_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (GalaDbusGetBackgroundColorInformationReadyData);
	_ready_data->_invocation_ = invocation;
	_tmp1_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->monitor = g_variant_get_int32 (_tmp1_);
	g_variant_unref (_tmp1_);
	_tmp2_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->reference_x = g_variant_get_int32 (_tmp2_);
	g_variant_unref (_tmp2_);
	_tmp3_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->reference_y = g_variant_get_int32 (_tmp3_);
	g_variant_unref (_tmp3_);
	_tmp4_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->reference_width = g_variant_get_int32 (_tmp4_);
	g_variant_unref (_tmp4_);
	_tmp5_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->reference_height = g_variant_get_int32 (_tmp5_);
	g_variant_unref (_tmp5_);
	gala_dbus_get_background_color_information (self, _ready_data->monitor, _ready_data->reference_x, _ready_data->reference_y, _ready_data->reference_width, _ready_data->reference_height, (GAsyncReadyCallback) _dbus_gala_dbus_get_background_color_information_ready, _ready_data);
}

static void
_dbus_gala_dbus_get_background_color_information_ready (GObject * source_object,
                                                        GAsyncResult * _res_,
                                                        gpointer _user_data_)
{
	GalaDbusGetBackgroundColorInformationReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	GalaDBusColorInformation result = {0};
	GVariantBuilder _tmp6_;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	gala_dbus_get_background_color_information_finish ((GalaDBus*) source_object, _res_, &result, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_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_init (&_tmp6_, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_tmp6_, g_variant_new_double (result.average_red));
	g_variant_builder_add_value (&_tmp6_, g_variant_new_double (result.average_green));
	g_variant_builder_add_value (&_tmp6_, g_variant_new_double (result.average_blue));
	g_variant_builder_add_value (&_tmp6_, g_variant_new_double (result.mean));
	g_variant_builder_add_value (&_tmp6_, g_variant_new_double (result.variance));
	g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp6_));
	_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);
	_error:
	g_slice_free (GalaDbusGetBackgroundColorInformationReadyData, _ready_data);
}

static void
gala_dbus_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, "PerformAction") == 0) {
		_dbus_gala_dbus_perform_action (object, parameters, invocation);
	} else if (strcmp (method_name, "GetBackgroundColorInformation") == 0) {
		_dbus_gala_dbus_get_background_color_information (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
gala_dbus_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
gala_dbus_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_gala_dbus_background_changed (GObject* _sender,
                                    gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.pantheon.gala", "BackgroundChanged", _arguments, NULL);
}

guint
gala_dbus_register_object (gpointer object,
                           GDBusConnection* connection,
                           const gchar* path,
                           GError** error)
{
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = gala_dbus_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_gala_dbus_dbus_interface_info), &_gala_dbus_dbus_interface_vtable, data, _gala_dbus_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "background-changed", (GCallback) _dbus_gala_dbus_background_changed, data);
	return result;
}

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

