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

/**/
/*  Copyright (C) 2016 Rico Tzschichholz, Santiago León O.*/
/**/
/*  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 <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib-object.h>
#include <gio/gio.h>
#include "gala.h"
#include <float.h>
#include <math.h>
#include <clutter/clutter.h>
#include <meta/meta-plugin.h>
#include <meta/display.h>
#include <cairo-gobject.h>
#include <meta/window.h>
#include <meta/meta-window-actor.h>
#include <meta/meta-shaped-texture.h>
#include <meta/boxes.h>
#include <glib/gstdio.h>
#include <glib/gi18n-lib.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gdk/gdk.h>
#include <gtk/gtk.h>
#include <canberra.h>
#include <cogl/cogl.h>
#include <meta/meta-cursor-tracker.h>
#include <graphene-gobject.h>

#define GALA_EXTENSION ".png"
#define GALA_UNCONCEAL_TEXT_TIMEOUT 2000
#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_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;
typedef struct _GalaScreenshotManagerPrivate GalaScreenshotManagerPrivate;
enum  {
	GALA_SCREENSHOT_MANAGER_0_PROPERTY,
	GALA_SCREENSHOT_MANAGER_NUM_PROPERTIES
};
static GParamSpec* gala_screenshot_manager_properties[GALA_SCREENSHOT_MANAGER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _cairo_surface_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_surface_destroy (var), NULL)))
typedef struct _GalaScreenshotManagerScreenshotData GalaScreenshotManagerScreenshotData;
typedef struct _GalaScreenshotManagerScreenshotAreaData GalaScreenshotManagerScreenshotAreaData;
typedef struct _GalaScreenshotManagerScreenshotAreaWithCursorData GalaScreenshotManagerScreenshotAreaWithCursorData;
typedef struct _GalaScreenshotManagerScreenshotWindowData GalaScreenshotManagerScreenshotWindowData;
typedef struct _Block6Data Block6Data;

#define GALA_TYPE_SELECTION_AREA (gala_selection_area_get_type ())
#define GALA_SELECTION_AREA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_TYPE_SELECTION_AREA, GalaSelectionArea))
#define GALA_SELECTION_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GALA_TYPE_SELECTION_AREA, GalaSelectionAreaClass))
#define GALA_IS_SELECTION_AREA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_TYPE_SELECTION_AREA))
#define GALA_IS_SELECTION_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GALA_TYPE_SELECTION_AREA))
#define GALA_SELECTION_AREA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GALA_TYPE_SELECTION_AREA, GalaSelectionAreaClass))

typedef struct _GalaSelectionArea GalaSelectionArea;
typedef struct _GalaSelectionAreaClass GalaSelectionAreaClass;
typedef struct _GalaScreenshotManagerSelectAreaData GalaScreenshotManagerSelectAreaData;
typedef struct _GalaScreenshotManagerConcealTextData GalaScreenshotManagerConcealTextData;
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
typedef struct _Block7Data Block7Data;

#define GALA_TYPE_PIXEL_PICKER (gala_pixel_picker_get_type ())
#define GALA_PIXEL_PICKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_TYPE_PIXEL_PICKER, GalaPixelPicker))
#define GALA_PIXEL_PICKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GALA_TYPE_PIXEL_PICKER, GalaPixelPickerClass))
#define GALA_IS_PIXEL_PICKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_TYPE_PIXEL_PICKER))
#define GALA_IS_PIXEL_PICKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GALA_TYPE_PIXEL_PICKER))
#define GALA_PIXEL_PICKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GALA_TYPE_PIXEL_PICKER, GalaPixelPickerClass))

typedef struct _GalaPixelPicker GalaPixelPicker;
typedef struct _GalaPixelPickerClass GalaPixelPickerClass;
typedef struct _GalaScreenshotManagerPickColorData GalaScreenshotManagerPickColorData;
typedef struct _GalaScreenshotManagerSaveImageData GalaScreenshotManagerSaveImageData;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _GalaScreenshotManagerSaveImageToFileData GalaScreenshotManagerSaveImageToFileData;
#define _ca_context_destroy0(var) ((var == NULL) ? NULL : (var = (ca_context_destroy (var), NULL)))
#define _ca_proplist_destroy0(var) ((var == NULL) ? NULL : (var = (ca_proplist_destroy (var), NULL)))
#define _cairo_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_destroy (var), NULL)))
#define _cairo_region_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_region_destroy (var), NULL)))
typedef struct _Block8Data Block8Data;
typedef struct _GalaScreenshotManagerWaitStageRepaintData GalaScreenshotManagerWaitStageRepaintData;
typedef struct _GalaScreenshotManagerScreenshotReadyData GalaScreenshotManagerScreenshotReadyData;
typedef struct _GalaScreenshotManagerScreenshotAreaReadyData GalaScreenshotManagerScreenshotAreaReadyData;
typedef struct _GalaScreenshotManagerScreenshotAreaWithCursorReadyData GalaScreenshotManagerScreenshotAreaWithCursorReadyData;
typedef struct _GalaScreenshotManagerScreenshotWindowReadyData GalaScreenshotManagerScreenshotWindowReadyData;
typedef struct _GalaScreenshotManagerSelectAreaReadyData GalaScreenshotManagerSelectAreaReadyData;
typedef struct _GalaScreenshotManagerConcealTextReadyData GalaScreenshotManagerConcealTextReadyData;
typedef struct _GalaScreenshotManagerPickColorReadyData GalaScreenshotManagerPickColorReadyData;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _GalaScreenshotManager {
	GObject parent_instance;
	GalaScreenshotManagerPrivate * priv;
};

struct _GalaScreenshotManagerClass {
	GObjectClass parent_class;
};

struct _GalaScreenshotManagerPrivate {
	GalaWindowManager* wm;
	GSettings* desktop_settings;
	gchar* prev_font_regular;
	gchar* prev_font_document;
	gchar* prev_font_mono;
	guint conceal_timeout;
};

struct _GalaScreenshotManagerScreenshotData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GalaScreenshotManager* self;
	gboolean include_cursor;
	gboolean flash;
	gchar* filename;
	gboolean success;
	gchar* filename_used;
	gint width;
	gint height;
	GalaWindowManager* _tmp0_;
	MetaDisplay* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	cairo_surface_t* image;
	cairo_surface_t* _tmp4_;
	cairo_surface_t* _tmp5_;
	gchar* _tmp6_;
	gboolean _tmp7_;
	GError* _inner_error0_;
};

struct _GalaScreenshotManagerScreenshotAreaData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GalaScreenshotManager* self;
	gint x;
	gint y;
	gint width;
	gint height;
	gboolean flash;
	gchar* filename;
	gboolean success;
	gchar* filename_used;
	gboolean _tmp0_;
	gchar* _tmp1_;
	GError* _inner_error0_;
};

struct _GalaScreenshotManagerScreenshotAreaWithCursorData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GalaScreenshotManager* self;
	gint x;
	gint y;
	gint width;
	gint height;
	gboolean include_cursor;
	gboolean flash;
	gchar* filename;
	gboolean success;
	gchar* filename_used;
	cairo_surface_t* image;
	cairo_surface_t* _tmp0_;
	cairo_surface_t* _tmp1_;
	gchar* _tmp2_;
	gboolean _tmp3_;
	GError* _tmp4_;
	GError* _inner_error0_;
};

struct _GalaScreenshotManagerScreenshotWindowData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GalaScreenshotManager* self;
	gboolean include_frame;
	gboolean include_cursor;
	gboolean flash;
	gchar* filename;
	gboolean success;
	gchar* filename_used;
	MetaWindow* window;
	GalaWindowManager* _tmp0_;
	MetaDisplay* _tmp1_;
	MetaWindow* _tmp2_;
	MetaWindow* _tmp3_;
	GError* _tmp4_;
	MetaWindowActor* window_actor;
	GObject* _tmp5_;
	MetaWindowActor* _tmp6_;
	MetaShapedTexture* window_texture;
	MetaWindowActor* _tmp7_;
	MetaShapedTexture* _tmp8_;
	gfloat actor_x;
	gfloat actor_y;
	MetaWindowActor* _tmp9_;
	gfloat _tmp10_;
	gfloat _tmp11_;
	MetaRectangle rect;
	MetaRectangle _tmp12_;
	gboolean _tmp13_;
	gboolean _tmp14_;
	gboolean _tmp15_;
	MetaRectangle _tmp16_;
	MetaRectangle _tmp17_;
	cairo_rectangle_int_t clip;
	MetaRectangle _tmp18_;
	MetaRectangle _tmp19_;
	MetaRectangle _tmp20_;
	MetaRectangle _tmp21_;
	cairo_rectangle_int_t _tmp22_;
	cairo_surface_t* image;
	MetaShapedTexture* _tmp23_;
	cairo_rectangle_int_t _tmp24_;
	cairo_surface_t* _tmp25_;
	cairo_surface_t* _tmp26_;
	MetaRectangle _tmp27_;
	MetaRectangle _tmp28_;
	MetaRectangle _tmp29_;
	MetaRectangle _tmp30_;
	cairo_rectangle_int_t _tmp31_;
	cairo_surface_t* _tmp32_;
	MetaRectangle _tmp33_;
	MetaRectangle _tmp34_;
	MetaRectangle _tmp35_;
	MetaRectangle _tmp36_;
	cairo_surface_t* _tmp37_;
	gchar* _tmp38_;
	gboolean _tmp39_;
	GError* _inner_error0_;
};

struct _Block6Data {
	int _ref_count_;
	GalaScreenshotManager* self;
	gpointer _async_data_;
};

struct _GalaScreenshotManagerSelectAreaData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GalaScreenshotManager* self;
	gint x;
	gint y;
	gint width;
	gint height;
	Block6Data* _data6_;
	GalaSelectionArea* selection_area;
	GalaWindowManager* _tmp0_;
	GalaSelectionArea* _tmp1_;
	GalaSelectionArea* _tmp2_;
	GalaWindowManager* _tmp3_;
	ClutterActor* _tmp4_;
	ClutterActor* _tmp5_;
	GalaSelectionArea* _tmp6_;
	GalaSelectionArea* _tmp7_;
	GalaSelectionArea* _tmp8_;
	GalaSelectionArea* _tmp9_;
	gboolean _tmp10_;
	gboolean _tmp11_;
	GError* _tmp12_;
	GalaSelectionArea* _tmp13_;
	gint _tmp14_;
	gint _tmp15_;
	gint _tmp16_;
	gint _tmp17_;
	GError* _inner_error0_;
};

struct _GalaScreenshotManagerConcealTextData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GalaScreenshotManager* self;
	GSettings* _tmp0_;
	gchar* _tmp1_;
	GSettings* _tmp2_;
	gchar* _tmp3_;
	GSettings* _tmp4_;
	gchar* _tmp5_;
	GSettings* _tmp6_;
	GSettings* _tmp7_;
	GSettings* _tmp8_;
};

struct _Block7Data {
	int _ref_count_;
	GalaScreenshotManager* self;
	gpointer _async_data_;
};

struct _GalaScreenshotManagerPickColorData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GalaScreenshotManager* self;
	GHashTable* result;
	Block7Data* _data7_;
	GalaPixelPicker* pixel_picker;
	GalaWindowManager* _tmp0_;
	GalaPixelPicker* _tmp1_;
	GalaPixelPicker* _tmp2_;
	GalaWindowManager* _tmp3_;
	ClutterActor* _tmp4_;
	ClutterActor* _tmp5_;
	GalaPixelPicker* _tmp6_;
	GalaPixelPicker* _tmp7_;
	GalaPixelPicker* _tmp8_;
	GalaPixelPicker* _tmp9_;
	gboolean _tmp10_;
	gboolean _tmp11_;
	GError* _tmp12_;
	gint x;
	gint y;
	GalaPixelPicker* _tmp13_;
	gint _tmp14_;
	gint _tmp15_;
	cairo_surface_t* image;
	cairo_surface_t* _tmp16_;
	cairo_surface_t* _tmp17_;
	guchar* data;
	cairo_surface_t* _tmp18_;
	guchar* _tmp19_;
	gint data_length1;
	gint _data_size_;
	gdouble r;
	gdouble g;
	gdouble b;
	guchar* _tmp20_;
	gint _tmp20__length1;
	guchar _tmp21_;
	guchar* _tmp22_;
	gint _tmp22__length1;
	guchar _tmp23_;
	guchar* _tmp24_;
	gint _tmp24__length1;
	guchar _tmp25_;
	guchar* _tmp26_;
	gint _tmp26__length1;
	guchar _tmp27_;
	guchar* _tmp28_;
	gint _tmp28__length1;
	guchar _tmp29_;
	guchar* _tmp30_;
	gint _tmp30__length1;
	guchar _tmp31_;
	GHashTable* _result_;
	GHashFunc _tmp32_;
	GEqualFunc _tmp33_;
	GHashTable* _tmp34_;
	gchar* _tmp35_;
	GVariant* _tmp36_;
	GError* _inner_error0_;
};

struct _GalaScreenshotManagerSaveImageData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	cairo_surface_t* image;
	gchar* filename;
	gchar* used_filename;
	gboolean result;
	gboolean _tmp0_;
	gchar* _tmp1_;
	gboolean _tmp2_;
	gchar* _tmp3_;
	gboolean _tmp4_;
};

struct _GalaScreenshotManagerSaveImageToFileData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	cairo_surface_t* image;
	gchar* filename;
	gchar* used_filename;
	gboolean result;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gint scale_factor;
	gint scale_pos;
	gint _tmp5_;
	gint _tmp6_;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* path;
	gchar* _tmp11_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	gchar* _tmp14_;
	GdkPixbuf* screenshot;
	GdkPixbuf* _tmp15_;
	GFile* file;
	const gchar* _tmp16_;
	GFile* _tmp17_;
	GFileIOStream* stream;
	GFile* _tmp18_;
	GFileIOStream* _tmp19_;
	GFile* _tmp20_;
	GFileIOStream* _tmp21_;
	GFileIOStream* _tmp22_;
	GFileIOStream* _tmp23_;
	GFile* _tmp24_;
	GFileIOStream* _tmp25_;
	GFileIOStream* _tmp26_;
	GdkPixbuf* _tmp27_;
	GFileIOStream* _tmp28_;
	GOutputStream* _tmp29_;
	GOutputStream* _tmp30_;
	GError* e;
	GError* _tmp31_;
	const gchar* _tmp32_;
	GError* _inner_error0_;
};

struct _Block8Data {
	int _ref_count_;
	GalaScreenshotManager* self;
	gulong signal_id;
	gpointer _async_data_;
};

struct _GalaScreenshotManagerWaitStageRepaintData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GalaScreenshotManager* self;
	Block8Data* _data8_;
	GalaWindowManager* _tmp0_;
	ClutterStage* _tmp1_;
	ClutterStage* _tmp2_;
	gulong _tmp3_;
	GalaWindowManager* _tmp4_;
	ClutterStage* _tmp5_;
	ClutterStage* _tmp6_;
};

struct _GalaScreenshotManagerScreenshotReadyData {
	GDBusMethodInvocation* _invocation_;
	gboolean include_cursor;
	gboolean flash;
	gchar* filename;
};

struct _GalaScreenshotManagerScreenshotAreaReadyData {
	GDBusMethodInvocation* _invocation_;
	gint x;
	gint y;
	gint width;
	gint height;
	gboolean flash;
	gchar* filename;
};

struct _GalaScreenshotManagerScreenshotAreaWithCursorReadyData {
	GDBusMethodInvocation* _invocation_;
	gint x;
	gint y;
	gint width;
	gint height;
	gboolean include_cursor;
	gboolean flash;
	gchar* filename;
};

struct _GalaScreenshotManagerScreenshotWindowReadyData {
	GDBusMethodInvocation* _invocation_;
	gboolean include_frame;
	gboolean include_cursor;
	gboolean flash;
	gchar* filename;
};

struct _GalaScreenshotManagerSelectAreaReadyData {
	GDBusMethodInvocation* _invocation_;
};

struct _GalaScreenshotManagerConcealTextReadyData {
	GDBusMethodInvocation* _invocation_;
};

struct _GalaScreenshotManagerPickColorReadyData {
	GDBusMethodInvocation* _invocation_;
};

static gint GalaScreenshotManager_private_offset;
static gpointer gala_screenshot_manager_parent_class = NULL;
static GalaScreenshotManager* gala_screenshot_manager_instance;
static GalaScreenshotManager* gala_screenshot_manager_instance = NULL;

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 GalaScreenshotManager* gala_screenshot_manager_new (GalaWindowManager* _wm);
static GalaScreenshotManager* gala_screenshot_manager_construct (GType object_type,
                                                          GalaWindowManager* _wm);
VALA_EXTERN void gala_screenshot_manager_flash_area (GalaScreenshotManager* self,
                                         gint x,
                                         gint y,
                                         gint width,
                                         gint height,
                                         GError** error);
static void __lambda69_ (GalaScreenshotManager* self,
                  ClutterActor* actor);
static void ___lambda69__clutter_actor_transitions_completed (ClutterActor* _sender,
                                                       gpointer self);
static void _vala_GValue_array_free (GValue * array,
                              gssize array_length);
static void gala_screenshot_manager_screenshot_data_free (gpointer _data);
VALA_EXTERN void gala_screenshot_manager_screenshot (GalaScreenshotManager* self,
                                         gboolean include_cursor,
                                         gboolean flash,
                                         const gchar* filename,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_);
VALA_EXTERN void gala_screenshot_manager_screenshot_finish (GalaScreenshotManager* self,
                                                GAsyncResult* _res_,
                                                gboolean* success,
                                                gchar** filename_used,
                                                GError** error);
static gboolean gala_screenshot_manager_screenshot_co (GalaScreenshotManagerScreenshotData* _data_);
static cairo_surface_t* gala_screenshot_manager_take_screenshot (GalaScreenshotManager* self,
                                                          gint x,
                                                          gint y,
                                                          gint width,
                                                          gint height,
                                                          gboolean include_cursor);
static void gala_screenshot_manager_unconceal_text (GalaScreenshotManager* self);
static void gala_screenshot_manager_save_image (cairo_surface_t* image,
                                         const gchar* filename,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_);
static gboolean gala_screenshot_manager_save_image_finish (GAsyncResult* _res_,
                                                    gchar** used_filename);
static void gala_screenshot_manager_screenshot_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_);
static void gala_screenshot_manager_play_shutter_sound (GalaScreenshotManager* self);
static void gala_screenshot_manager_screenshot_area_data_free (gpointer _data);
VALA_EXTERN void gala_screenshot_manager_screenshot_area (GalaScreenshotManager* self,
                                              gint x,
                                              gint y,
                                              gint width,
                                              gint height,
                                              gboolean flash,
                                              const gchar* filename,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_);
VALA_EXTERN void gala_screenshot_manager_screenshot_area_finish (GalaScreenshotManager* self,
                                                     GAsyncResult* _res_,
                                                     gboolean* success,
                                                     gchar** filename_used,
                                                     GError** error);
static gboolean gala_screenshot_manager_screenshot_area_co (GalaScreenshotManagerScreenshotAreaData* _data_);
VALA_EXTERN void gala_screenshot_manager_screenshot_area_with_cursor (GalaScreenshotManager* self,
                                                          gint x,
                                                          gint y,
                                                          gint width,
                                                          gint height,
                                                          gboolean include_cursor,
                                                          gboolean flash,
                                                          const gchar* filename,
                                                          GAsyncReadyCallback _callback_,
                                                          gpointer _user_data_);
VALA_EXTERN void gala_screenshot_manager_screenshot_area_with_cursor_finish (GalaScreenshotManager* self,
                                                                 GAsyncResult* _res_,
                                                                 gboolean* success,
                                                                 gchar** filename_used,
                                                                 GError** error);
static void gala_screenshot_manager_screenshot_area_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_);
static void gala_screenshot_manager_screenshot_area_with_cursor_data_free (gpointer _data);
static gboolean gala_screenshot_manager_screenshot_area_with_cursor_co (GalaScreenshotManagerScreenshotAreaWithCursorData* _data_);
static void gala_screenshot_manager_wait_stage_repaint (GalaScreenshotManager* self,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_);
static void gala_screenshot_manager_wait_stage_repaint_finish (GalaScreenshotManager* self,
                                                        GAsyncResult* _res_);
static void gala_screenshot_manager_screenshot_area_with_cursor_ready (GObject* source_object,
                                                                GAsyncResult* _res_,
                                                                gpointer _user_data_);
static void gala_screenshot_manager_screenshot_window_data_free (gpointer _data);
VALA_EXTERN void gala_screenshot_manager_screenshot_window (GalaScreenshotManager* self,
                                                gboolean include_frame,
                                                gboolean include_cursor,
                                                gboolean flash,
                                                const gchar* filename,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_);
VALA_EXTERN void gala_screenshot_manager_screenshot_window_finish (GalaScreenshotManager* self,
                                                       GAsyncResult* _res_,
                                                       gboolean* success,
                                                       gchar** filename_used,
                                                       GError** error);
static gboolean gala_screenshot_manager_screenshot_window_co (GalaScreenshotManagerScreenshotWindowData* _data_);
static cairo_surface_t* gala_screenshot_manager_composite_stage_cursor (GalaScreenshotManager* self,
                                                                 cairo_surface_t* image,
                                                                 cairo_rectangle_int_t* image_rect);
static void gala_screenshot_manager_screenshot_window_ready (GObject* source_object,
                                                      GAsyncResult* _res_,
                                                      gpointer _user_data_);
static void gala_screenshot_manager_select_area_data_free (gpointer _data);
VALA_EXTERN void gala_screenshot_manager_select_area (GalaScreenshotManager* self,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_);
VALA_EXTERN void gala_screenshot_manager_select_area_finish (GalaScreenshotManager* self,
                                                 GAsyncResult* _res_,
                                                 gint* x,
                                                 gint* y,
                                                 gint* width,
                                                 gint* height,
                                                 GError** error);
static gboolean gala_screenshot_manager_select_area_co (GalaScreenshotManagerSelectAreaData* _data_);
static Block6Data* block6_data_ref (Block6Data* _data6_);
static void block6_data_unref (void * _userdata_);
VALA_EXTERN GType gala_selection_area_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GalaSelectionArea, g_object_unref)
VALA_EXTERN GalaSelectionArea* gala_selection_area_new (GalaWindowManager* wm);
VALA_EXTERN GalaSelectionArea* gala_selection_area_construct (GType object_type,
                                                  GalaWindowManager* wm);
static void __lambda71_ (Block6Data* _data6_);
static gboolean _gala_screenshot_manager_select_area_co_gsource_func (gpointer self);
static void ___lambda71__gala_selection_area_closed (GalaSelectionArea* _sender,
                                              gpointer self);
VALA_EXTERN void gala_selection_area_start_selection (GalaSelectionArea* self);
VALA_EXTERN gboolean gala_selection_area_get_cancelled (GalaSelectionArea* self);
static void gala_screenshot_manager_select_area_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_);
VALA_EXTERN void gala_selection_area_get_selection_rectangle (GalaSelectionArea* self,
                                                  gint* x,
                                                  gint* y,
                                                  gint* width,
                                                  gint* height);
static void gala_screenshot_manager_conceal_text_data_free (gpointer _data);
VALA_EXTERN void gala_screenshot_manager_conceal_text (GalaScreenshotManager* self,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_);
VALA_EXTERN void gala_screenshot_manager_conceal_text_finish (GalaScreenshotManager* self,
                                                  GAsyncResult* _res_,
                                                  GError** error);
static gboolean gala_screenshot_manager_conceal_text_co (GalaScreenshotManagerConcealTextData* _data_);
static gboolean __lambda72_ (GalaScreenshotManager* self);
static gboolean ___lambda72__gsource_func (gpointer self);
static void gala_screenshot_manager_pick_color_data_free (gpointer _data);
VALA_EXTERN void gala_screenshot_manager_pick_color (GalaScreenshotManager* self,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_);
VALA_EXTERN GHashTable* gala_screenshot_manager_pick_color_finish (GalaScreenshotManager* self,
                                                       GAsyncResult* _res_,
                                                       GError** error);
static gboolean gala_screenshot_manager_pick_color_co (GalaScreenshotManagerPickColorData* _data_);
static Block7Data* block7_data_ref (Block7Data* _data7_);
static void block7_data_unref (void * _userdata_);
VALA_EXTERN GType gala_pixel_picker_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GalaPixelPicker, g_object_unref)
VALA_EXTERN GalaPixelPicker* gala_pixel_picker_new (GalaWindowManager* wm);
VALA_EXTERN GalaPixelPicker* gala_pixel_picker_construct (GType object_type,
                                              GalaWindowManager* wm);
static void __lambda73_ (Block7Data* _data7_);
static gboolean _gala_screenshot_manager_pick_color_co_gsource_func (gpointer self);
static void ___lambda73__gala_pixel_picker_closed (GalaPixelPicker* _sender,
                                            gpointer self);
VALA_EXTERN void gala_pixel_picker_start_selection (GalaPixelPicker* self);
VALA_EXTERN gboolean gala_pixel_picker_get_cancelled (GalaPixelPicker* self);
VALA_EXTERN void gala_pixel_picker_get_point (GalaPixelPicker* self,
                                  gint* x,
                                  gint* y);
static void _g_free0_ (gpointer var);
static void _g_variant_unref0_ (gpointer var);
static gchar* gala_screenshot_manager_find_target_path (void);
static void gala_screenshot_manager_save_image_data_free (gpointer _data);
static gboolean gala_screenshot_manager_save_image_co (GalaScreenshotManagerSaveImageData* _data_);
static void gala_screenshot_manager_save_image_to_file (cairo_surface_t* image,
                                                 const gchar* filename,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_);
static gboolean gala_screenshot_manager_save_image_to_file_finish (GAsyncResult* _res_,
                                                            gchar** used_filename);
static void gala_screenshot_manager_save_image_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_);
static gboolean gala_screenshot_manager_save_image_to_clipboard (cairo_surface_t* image,
                                                          const gchar* filename,
                                                          gchar** used_filename);
static void gala_screenshot_manager_save_image_to_file_data_free (gpointer _data);
static gboolean gala_screenshot_manager_save_image_to_file_co (GalaScreenshotManagerSaveImageToFileData* _data_);
VALA_EXTERN gint gala_internal_utils_get_ui_scaling_factor (void);
static void gala_screenshot_manager_save_image_to_file_ready (GObject* source_object,
                                                       GAsyncResult* _res_,
                                                       gpointer _user_data_);
static cairo_surface_t* gala_screenshot_manager_composite_capture_images (GalaScreenshotManager* self,
                                                                   ClutterCapture* captures,
                                                                   gint captures_length1,
                                                                   gint x,
                                                                   gint y,
                                                                   gint width,
                                                                   gint height);
static void gala_screenshot_manager_wait_stage_repaint_data_free (gpointer _data);
static gboolean gala_screenshot_manager_wait_stage_repaint_co (GalaScreenshotManagerWaitStageRepaintData* _data_);
static Block8Data* block8_data_ref (Block8Data* _data8_);
static void block8_data_unref (void * _userdata_);
static void __lambda70_ (Block8Data* _data8_);
static gboolean _gala_screenshot_manager_wait_stage_repaint_co_gsource_func (gpointer self);
static void ___lambda70__clutter_stage_after_paint (ClutterStage* _sender,
                                             ClutterStageView* view,
                                             gpointer self);
static GObject * gala_screenshot_manager_constructor (GType type,
                                               guint n_construct_properties,
                                               GObjectConstructParam * construct_properties);
static void gala_screenshot_manager_finalize (GObject * obj);
static GType gala_screenshot_manager_get_type_once (void);
static void _dbus_gala_screenshot_manager_flash_area (GalaScreenshotManager* self,
                                               GVariant* _parameters_,
                                               GDBusMethodInvocation* invocation);
static void _dbus_gala_screenshot_manager_screenshot (GalaScreenshotManager* self,
                                               GVariant* _parameters_,
                                               GDBusMethodInvocation* invocation);
static void _dbus_gala_screenshot_manager_screenshot_ready (GObject * source_object,
                                                     GAsyncResult * _res_,
                                                     gpointer _user_data_);
static void _dbus_gala_screenshot_manager_screenshot_area (GalaScreenshotManager* self,
                                                    GVariant* _parameters_,
                                                    GDBusMethodInvocation* invocation);
static void _dbus_gala_screenshot_manager_screenshot_area_ready (GObject * source_object,
                                                          GAsyncResult * _res_,
                                                          gpointer _user_data_);
static void _dbus_gala_screenshot_manager_screenshot_area_with_cursor (GalaScreenshotManager* self,
                                                                GVariant* _parameters_,
                                                                GDBusMethodInvocation* invocation);
static void _dbus_gala_screenshot_manager_screenshot_area_with_cursor_ready (GObject * source_object,
                                                                      GAsyncResult * _res_,
                                                                      gpointer _user_data_);
static void _dbus_gala_screenshot_manager_screenshot_window (GalaScreenshotManager* self,
                                                      GVariant* _parameters_,
                                                      GDBusMethodInvocation* invocation);
static void _dbus_gala_screenshot_manager_screenshot_window_ready (GObject * source_object,
                                                            GAsyncResult * _res_,
                                                            gpointer _user_data_);
static void _dbus_gala_screenshot_manager_select_area (GalaScreenshotManager* self,
                                                GVariant* _parameters_,
                                                GDBusMethodInvocation* invocation);
static void _dbus_gala_screenshot_manager_select_area_ready (GObject * source_object,
                                                      GAsyncResult * _res_,
                                                      gpointer _user_data_);
static void _dbus_gala_screenshot_manager_conceal_text (GalaScreenshotManager* self,
                                                 GVariant* _parameters_,
                                                 GDBusMethodInvocation* invocation);
static void _dbus_gala_screenshot_manager_conceal_text_ready (GObject * source_object,
                                                       GAsyncResult * _res_,
                                                       gpointer _user_data_);
static void _dbus_gala_screenshot_manager_pick_color (GalaScreenshotManager* self,
                                               GVariant* _parameters_,
                                               GDBusMethodInvocation* invocation);
static void _dbus_gala_screenshot_manager_pick_color_ready (GObject * source_object,
                                                     GAsyncResult * _res_,
                                                     gpointer _user_data_);
static void gala_screenshot_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* gala_screenshot_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 gala_screenshot_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 _gala_screenshot_manager_unregister_object (gpointer user_data);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_flash_area_x = {-1, "x", "i", NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_flash_area_y = {-1, "y", "i", NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_flash_area_width = {-1, "width", "i", NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_flash_area_height = {-1, "height", "i", NULL};
static const GDBusArgInfo * const _gala_screenshot_manager_dbus_arg_info_flash_area_in[] = {&_gala_screenshot_manager_dbus_arg_info_flash_area_x, &_gala_screenshot_manager_dbus_arg_info_flash_area_y, &_gala_screenshot_manager_dbus_arg_info_flash_area_width, &_gala_screenshot_manager_dbus_arg_info_flash_area_height, NULL};
static const GDBusArgInfo * const _gala_screenshot_manager_dbus_arg_info_flash_area_out[] = {NULL};
static const GDBusMethodInfo _gala_screenshot_manager_dbus_method_info_flash_area = {-1, "FlashArea", (GDBusArgInfo **) (&_gala_screenshot_manager_dbus_arg_info_flash_area_in), (GDBusArgInfo **) (&_gala_screenshot_manager_dbus_arg_info_flash_area_out), NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_screenshot_include_cursor = {-1, "include_cursor", "b", NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_screenshot_flash = {-1, "flash", "b", NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_screenshot_filename = {-1, "filename", "s", NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_screenshot_success = {-1, "success", "b", NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_screenshot_filename_used = {-1, "filename_used", "s", NULL};
static const GDBusArgInfo * const _gala_screenshot_manager_dbus_arg_info_screenshot_in[] = {&_gala_screenshot_manager_dbus_arg_info_screenshot_include_cursor, &_gala_screenshot_manager_dbus_arg_info_screenshot_flash, &_gala_screenshot_manager_dbus_arg_info_screenshot_filename, NULL};
static const GDBusArgInfo * const _gala_screenshot_manager_dbus_arg_info_screenshot_out[] = {&_gala_screenshot_manager_dbus_arg_info_screenshot_success, &_gala_screenshot_manager_dbus_arg_info_screenshot_filename_used, NULL};
static const GDBusMethodInfo _gala_screenshot_manager_dbus_method_info_screenshot = {-1, "Screenshot", (GDBusArgInfo **) (&_gala_screenshot_manager_dbus_arg_info_screenshot_in), (GDBusArgInfo **) (&_gala_screenshot_manager_dbus_arg_info_screenshot_out), NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_screenshot_area_x = {-1, "x", "i", NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_screenshot_area_y = {-1, "y", "i", NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_screenshot_area_width = {-1, "width", "i", NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_screenshot_area_height = {-1, "height", "i", NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_screenshot_area_flash = {-1, "flash", "b", NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_screenshot_area_filename = {-1, "filename", "s", NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_screenshot_area_success = {-1, "success", "b", NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_screenshot_area_filename_used = {-1, "filename_used", "s", NULL};
static const GDBusArgInfo * const _gala_screenshot_manager_dbus_arg_info_screenshot_area_in[] = {&_gala_screenshot_manager_dbus_arg_info_screenshot_area_x, &_gala_screenshot_manager_dbus_arg_info_screenshot_area_y, &_gala_screenshot_manager_dbus_arg_info_screenshot_area_width, &_gala_screenshot_manager_dbus_arg_info_screenshot_area_height, &_gala_screenshot_manager_dbus_arg_info_screenshot_area_flash, &_gala_screenshot_manager_dbus_arg_info_screenshot_area_filename, NULL};
static const GDBusArgInfo * const _gala_screenshot_manager_dbus_arg_info_screenshot_area_out[] = {&_gala_screenshot_manager_dbus_arg_info_screenshot_area_success, &_gala_screenshot_manager_dbus_arg_info_screenshot_area_filename_used, NULL};
static const GDBusMethodInfo _gala_screenshot_manager_dbus_method_info_screenshot_area = {-1, "ScreenshotArea", (GDBusArgInfo **) (&_gala_screenshot_manager_dbus_arg_info_screenshot_area_in), (GDBusArgInfo **) (&_gala_screenshot_manager_dbus_arg_info_screenshot_area_out), NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_screenshot_area_with_cursor_x = {-1, "x", "i", NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_screenshot_area_with_cursor_y = {-1, "y", "i", NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_screenshot_area_with_cursor_width = {-1, "width", "i", NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_screenshot_area_with_cursor_height = {-1, "height", "i", NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_screenshot_area_with_cursor_include_cursor = {-1, "include_cursor", "b", NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_screenshot_area_with_cursor_flash = {-1, "flash", "b", NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_screenshot_area_with_cursor_filename = {-1, "filename", "s", NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_screenshot_area_with_cursor_success = {-1, "success", "b", NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_screenshot_area_with_cursor_filename_used = {-1, "filename_used", "s", NULL};
static const GDBusArgInfo * const _gala_screenshot_manager_dbus_arg_info_screenshot_area_with_cursor_in[] = {&_gala_screenshot_manager_dbus_arg_info_screenshot_area_with_cursor_x, &_gala_screenshot_manager_dbus_arg_info_screenshot_area_with_cursor_y, &_gala_screenshot_manager_dbus_arg_info_screenshot_area_with_cursor_width, &_gala_screenshot_manager_dbus_arg_info_screenshot_area_with_cursor_height, &_gala_screenshot_manager_dbus_arg_info_screenshot_area_with_cursor_include_cursor, &_gala_screenshot_manager_dbus_arg_info_screenshot_area_with_cursor_flash, &_gala_screenshot_manager_dbus_arg_info_screenshot_area_with_cursor_filename, NULL};
static const GDBusArgInfo * const _gala_screenshot_manager_dbus_arg_info_screenshot_area_with_cursor_out[] = {&_gala_screenshot_manager_dbus_arg_info_screenshot_area_with_cursor_success, &_gala_screenshot_manager_dbus_arg_info_screenshot_area_with_cursor_filename_used, NULL};
static const GDBusMethodInfo _gala_screenshot_manager_dbus_method_info_screenshot_area_with_cursor = {-1, "ScreenshotAreaWithCursor", (GDBusArgInfo **) (&_gala_screenshot_manager_dbus_arg_info_screenshot_area_with_cursor_in), (GDBusArgInfo **) (&_gala_screenshot_manager_dbus_arg_info_screenshot_area_with_cursor_out), NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_screenshot_window_include_frame = {-1, "include_frame", "b", NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_screenshot_window_include_cursor = {-1, "include_cursor", "b", NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_screenshot_window_flash = {-1, "flash", "b", NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_screenshot_window_filename = {-1, "filename", "s", NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_screenshot_window_success = {-1, "success", "b", NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_screenshot_window_filename_used = {-1, "filename_used", "s", NULL};
static const GDBusArgInfo * const _gala_screenshot_manager_dbus_arg_info_screenshot_window_in[] = {&_gala_screenshot_manager_dbus_arg_info_screenshot_window_include_frame, &_gala_screenshot_manager_dbus_arg_info_screenshot_window_include_cursor, &_gala_screenshot_manager_dbus_arg_info_screenshot_window_flash, &_gala_screenshot_manager_dbus_arg_info_screenshot_window_filename, NULL};
static const GDBusArgInfo * const _gala_screenshot_manager_dbus_arg_info_screenshot_window_out[] = {&_gala_screenshot_manager_dbus_arg_info_screenshot_window_success, &_gala_screenshot_manager_dbus_arg_info_screenshot_window_filename_used, NULL};
static const GDBusMethodInfo _gala_screenshot_manager_dbus_method_info_screenshot_window = {-1, "ScreenshotWindow", (GDBusArgInfo **) (&_gala_screenshot_manager_dbus_arg_info_screenshot_window_in), (GDBusArgInfo **) (&_gala_screenshot_manager_dbus_arg_info_screenshot_window_out), NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_select_area_x = {-1, "x", "i", NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_select_area_y = {-1, "y", "i", NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_select_area_width = {-1, "width", "i", NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_select_area_height = {-1, "height", "i", NULL};
static const GDBusArgInfo * const _gala_screenshot_manager_dbus_arg_info_select_area_in[] = {NULL};
static const GDBusArgInfo * const _gala_screenshot_manager_dbus_arg_info_select_area_out[] = {&_gala_screenshot_manager_dbus_arg_info_select_area_x, &_gala_screenshot_manager_dbus_arg_info_select_area_y, &_gala_screenshot_manager_dbus_arg_info_select_area_width, &_gala_screenshot_manager_dbus_arg_info_select_area_height, NULL};
static const GDBusMethodInfo _gala_screenshot_manager_dbus_method_info_select_area = {-1, "SelectArea", (GDBusArgInfo **) (&_gala_screenshot_manager_dbus_arg_info_select_area_in), (GDBusArgInfo **) (&_gala_screenshot_manager_dbus_arg_info_select_area_out), NULL};
static const GDBusArgInfo * const _gala_screenshot_manager_dbus_arg_info_conceal_text_in[] = {NULL};
static const GDBusArgInfo * const _gala_screenshot_manager_dbus_arg_info_conceal_text_out[] = {NULL};
static const GDBusMethodInfo _gala_screenshot_manager_dbus_method_info_conceal_text = {-1, "ConcealText", (GDBusArgInfo **) (&_gala_screenshot_manager_dbus_arg_info_conceal_text_in), (GDBusArgInfo **) (&_gala_screenshot_manager_dbus_arg_info_conceal_text_out), NULL};
static const GDBusArgInfo _gala_screenshot_manager_dbus_arg_info_pick_color_result = {-1, "result", "a{sv}", NULL};
static const GDBusArgInfo * const _gala_screenshot_manager_dbus_arg_info_pick_color_in[] = {NULL};
static const GDBusArgInfo * const _gala_screenshot_manager_dbus_arg_info_pick_color_out[] = {&_gala_screenshot_manager_dbus_arg_info_pick_color_result, NULL};
static const GDBusMethodInfo _gala_screenshot_manager_dbus_method_info_pick_color = {-1, "PickColor", (GDBusArgInfo **) (&_gala_screenshot_manager_dbus_arg_info_pick_color_in), (GDBusArgInfo **) (&_gala_screenshot_manager_dbus_arg_info_pick_color_out), NULL};
static const GDBusMethodInfo * const _gala_screenshot_manager_dbus_method_info[] = {&_gala_screenshot_manager_dbus_method_info_flash_area, &_gala_screenshot_manager_dbus_method_info_screenshot, &_gala_screenshot_manager_dbus_method_info_screenshot_area, &_gala_screenshot_manager_dbus_method_info_screenshot_area_with_cursor, &_gala_screenshot_manager_dbus_method_info_screenshot_window, &_gala_screenshot_manager_dbus_method_info_select_area, &_gala_screenshot_manager_dbus_method_info_conceal_text, &_gala_screenshot_manager_dbus_method_info_pick_color, NULL};
static const GDBusSignalInfo * const _gala_screenshot_manager_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo * const _gala_screenshot_manager_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _gala_screenshot_manager_dbus_interface_info = {-1, "org.gnome.Shell.Screenshot", (GDBusMethodInfo **) (&_gala_screenshot_manager_dbus_method_info), (GDBusSignalInfo **) (&_gala_screenshot_manager_dbus_signal_info), (GDBusPropertyInfo **) (&_gala_screenshot_manager_dbus_property_info), NULL};
static const GDBusInterfaceVTable _gala_screenshot_manager_dbus_interface_vtable = {gala_screenshot_manager_dbus_interface_method_call, gala_screenshot_manager_dbus_interface_get_property, gala_screenshot_manager_dbus_interface_set_property};

static inline gpointer
gala_screenshot_manager_get_instance_private (GalaScreenshotManager* self)
{
	return G_STRUCT_MEMBER_P (self, GalaScreenshotManager_private_offset);
}

GalaScreenshotManager*
gala_screenshot_manager_init (GalaWindowManager* wm)
{
	GalaScreenshotManager* _tmp0_;
	GalaScreenshotManager* _tmp2_;
	GalaScreenshotManager* result;
	g_return_val_if_fail (wm != NULL, NULL);
	_tmp0_ = gala_screenshot_manager_instance;
	if (_tmp0_ == NULL) {
		GalaScreenshotManager* _tmp1_;
		_tmp1_ = gala_screenshot_manager_new (wm);
		_g_object_unref0 (gala_screenshot_manager_instance);
		gala_screenshot_manager_instance = _tmp1_;
	}
	_tmp2_ = gala_screenshot_manager_instance;
	result = _tmp2_;
	return result;
}

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

static GalaScreenshotManager*
gala_screenshot_manager_construct (GType object_type,
                                   GalaWindowManager* _wm)
{
	GalaScreenshotManager * self = NULL;
	GalaWindowManager* _tmp0_;
	g_return_val_if_fail (_wm != NULL, NULL);
	self = (GalaScreenshotManager*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (_wm);
	_g_object_unref0 (self->priv->wm);
	self->priv->wm = _tmp0_;
	return self;
}

static GalaScreenshotManager*
gala_screenshot_manager_new (GalaWindowManager* _wm)
{
	return gala_screenshot_manager_construct (GALA_TYPE_SCREENSHOT_MANAGER, _wm);
}

static void
__lambda69_ (GalaScreenshotManager* self,
             ClutterActor* actor)
{
	GalaWindowManager* _tmp0_;
	ClutterActor* _tmp1_;
	ClutterActor* _tmp2_;
	g_return_if_fail (actor != NULL);
	_tmp0_ = self->priv->wm;
	_tmp1_ = gala_window_manager_get_top_window_group (_tmp0_);
	_tmp2_ = _tmp1_;
	clutter_actor_remove_child (_tmp2_, actor);
	clutter_actor_destroy (actor);
}

static void
___lambda69__clutter_actor_transitions_completed (ClutterActor* _sender,
                                                  gpointer self)
{
	__lambda69_ ((GalaScreenshotManager*) self, _sender);
}

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

void
gala_screenshot_manager_flash_area (GalaScreenshotManager* self,
                                    gint x,
                                    gint y,
                                    gint width,
                                    gint height,
                                    GError** error)
{
	gdouble* keyframes = NULL;
	gdouble* _tmp0_;
	gint keyframes_length1;
	gint _keyframes_size_;
	GValue* values = NULL;
	GValue _tmp1_ = {0};
	GValue _tmp2_ = {0};
	GValue* _tmp3_;
	gint values_length1;
	gint _values_size_;
	ClutterKeyframeTransition* transition = NULL;
	ClutterKeyframeTransition* _tmp4_ = NULL;
	GValue _tmp5_ = {0};
	ClutterActor* flash_actor = NULL;
	ClutterActor* _tmp6_;
	GalaWindowManager* _tmp7_;
	ClutterActor* _tmp8_;
	ClutterActor* _tmp9_;
	g_return_if_fail (self != NULL);
	g_debug ("ScreenshotManager.vala:51: Flashing area");
	_tmp0_ = g_new0 (gdouble, 2);
	_tmp0_[0] = (gdouble) 0.3f;
	_tmp0_[1] = (gdouble) 0.8f;
	keyframes = _tmp0_;
	keyframes_length1 = 2;
	_keyframes_size_ = keyframes_length1;
	g_value_init (&_tmp1_, G_TYPE_UINT);
	g_value_set_uint (&_tmp1_, 180U);
	g_value_init (&_tmp2_, G_TYPE_UINT);
	g_value_set_uint (&_tmp2_, 0U);
	_tmp3_ = g_new0 (GValue, 2);
	_tmp3_[0] = _tmp1_;
	_tmp3_[1] = _tmp2_;
	values = _tmp3_;
	values_length1 = 2;
	_values_size_ = values_length1;
	_tmp4_ = (ClutterKeyframeTransition*) clutter_keyframe_transition_new ("opacity");
	clutter_timeline_set_duration ((ClutterTimeline*) _tmp4_, (guint) 200);
	clutter_transition_set_remove_on_complete ((ClutterTransition*) _tmp4_, TRUE);
	clutter_timeline_set_progress_mode ((ClutterTimeline*) _tmp4_, CLUTTER_LINEAR);
	transition = _tmp4_;
	clutter_keyframe_transition_set_key_frames (transition, (guint) keyframes_length1, keyframes);
	clutter_keyframe_transition_set_values (transition, (guint) values_length1, values);
	g_value_init (&_tmp5_, G_TYPE_FLOAT);
	g_value_set_float (&_tmp5_, 0.0f);
	clutter_transition_set_to_value ((ClutterTransition*) transition, &_tmp5_);
	G_IS_VALUE (&_tmp5_) ? (g_value_unset (&_tmp5_), NULL) : NULL;
	_tmp6_ = clutter_actor_new ();
	g_object_ref_sink (_tmp6_);
	flash_actor = _tmp6_;
	clutter_actor_set_size (flash_actor, (gfloat) width, (gfloat) height);
	clutter_actor_set_position (flash_actor, (gfloat) x, (gfloat) y);
	clutter_actor_set_background_color (flash_actor, clutter_color_get_static (CLUTTER_COLOR_WHITE));
	clutter_actor_set_opacity (flash_actor, (guint8) 0);
	g_signal_connect_object (flash_actor, "transitions-completed", (GCallback) ___lambda69__clutter_actor_transitions_completed, self, 0);
	_tmp7_ = self->priv->wm;
	_tmp8_ = gala_window_manager_get_top_window_group (_tmp7_);
	_tmp9_ = _tmp8_;
	clutter_actor_add_child (_tmp9_, flash_actor);
	clutter_actor_add_transition (flash_actor, "flash", (ClutterTransition*) transition);
	_g_object_unref0 (flash_actor);
	_g_object_unref0 (transition);
	values = (_vala_GValue_array_free (values, values_length1), NULL);
	keyframes = (g_free (keyframes), NULL);
}

static void
gala_screenshot_manager_screenshot_data_free (gpointer _data)
{
	GalaScreenshotManagerScreenshotData* _data_;
	_data_ = _data;
	_g_free0 (_data_->filename);
	_g_object_unref0 (_data_->self);
	g_slice_free (GalaScreenshotManagerScreenshotData, _data_);
}

void
gala_screenshot_manager_screenshot (GalaScreenshotManager* self,
                                    gboolean include_cursor,
                                    gboolean flash,
                                    const gchar* filename,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_)
{
	GalaScreenshotManagerScreenshotData* _data_;
	GalaScreenshotManager* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (filename != NULL);
	_data_ = g_slice_new0 (GalaScreenshotManagerScreenshotData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gala_screenshot_manager_screenshot_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->include_cursor = include_cursor;
	_data_->flash = flash;
	_tmp1_ = g_strdup (filename);
	_g_free0 (_data_->filename);
	_data_->filename = _tmp1_;
	gala_screenshot_manager_screenshot_co (_data_);
}

void
gala_screenshot_manager_screenshot_finish (GalaScreenshotManager* self,
                                           GAsyncResult* _res_,
                                           gboolean* success,
                                           gchar** filename_used,
                                           GError** error)
{
	GalaScreenshotManagerScreenshotData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
	if (success) {
		*success = _data_->success;
	}
	if (filename_used) {
		*filename_used = _data_->filename_used;
	} else {
		_g_free0 (_data_->filename_used);
	}
	_data_->filename_used = NULL;
}

static void
gala_screenshot_manager_screenshot_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_)
{
	GalaScreenshotManagerScreenshotData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	gala_screenshot_manager_screenshot_co (_data_);
}

static gboolean
gala_screenshot_manager_screenshot_co (GalaScreenshotManagerScreenshotData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	g_debug ("ScreenshotManager.vala:80: Taking screenshot");
	_data_->_tmp0_ = _data_->self->priv->wm;
	_data_->_tmp1_ = meta_plugin_get_display ((MetaPlugin*) _data_->_tmp0_);
	_data_->_tmp2_ = 0;
	_data_->_tmp3_ = 0;
	meta_display_get_size (_data_->_tmp1_, &_data_->_tmp2_, &_data_->_tmp3_);
	_data_->width = _data_->_tmp2_;
	_data_->height = _data_->_tmp3_;
	_data_->_tmp4_ = gala_screenshot_manager_take_screenshot (_data_->self, 0, 0, _data_->width, _data_->height, _data_->include_cursor);
	_data_->image = _data_->_tmp4_;
	gala_screenshot_manager_unconceal_text (_data_->self);
	if (_data_->flash) {
		gala_screenshot_manager_flash_area (_data_->self, 0, 0, _data_->width, _data_->height, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			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_);
				_cairo_surface_destroy0 (_data_->image);
				_g_free0 (_data_->filename_used);
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				_cairo_surface_destroy0 (_data_->image);
				_g_free0 (_data_->filename_used);
				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_->_tmp5_ = _data_->image;
	_data_->_tmp6_ = NULL;
	_data_->_state_ = 1;
	gala_screenshot_manager_save_image (_data_->_tmp5_, _data_->filename, gala_screenshot_manager_screenshot_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp7_ = gala_screenshot_manager_save_image_finish (_data_->_res_, &_data_->_tmp6_);
	_g_free0 (_data_->filename_used);
	_data_->filename_used = _data_->_tmp6_;
	_data_->success = _data_->_tmp7_;
	if (_data_->success) {
		gala_screenshot_manager_play_shutter_sound (_data_->self);
	}
	_cairo_surface_destroy0 (_data_->image);
	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_screenshot_manager_screenshot_area_data_free (gpointer _data)
{
	GalaScreenshotManagerScreenshotAreaData* _data_;
	_data_ = _data;
	_g_free0 (_data_->filename);
	_g_object_unref0 (_data_->self);
	g_slice_free (GalaScreenshotManagerScreenshotAreaData, _data_);
}

void
gala_screenshot_manager_screenshot_area (GalaScreenshotManager* self,
                                         gint x,
                                         gint y,
                                         gint width,
                                         gint height,
                                         gboolean flash,
                                         const gchar* filename,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_)
{
	GalaScreenshotManagerScreenshotAreaData* _data_;
	GalaScreenshotManager* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (filename != NULL);
	_data_ = g_slice_new0 (GalaScreenshotManagerScreenshotAreaData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gala_screenshot_manager_screenshot_area_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->x = x;
	_data_->y = y;
	_data_->width = width;
	_data_->height = height;
	_data_->flash = flash;
	_tmp1_ = g_strdup (filename);
	_g_free0 (_data_->filename);
	_data_->filename = _tmp1_;
	gala_screenshot_manager_screenshot_area_co (_data_);
}

void
gala_screenshot_manager_screenshot_area_finish (GalaScreenshotManager* self,
                                                GAsyncResult* _res_,
                                                gboolean* success,
                                                gchar** filename_used,
                                                GError** error)
{
	GalaScreenshotManagerScreenshotAreaData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
	if (success) {
		*success = _data_->success;
	}
	if (filename_used) {
		*filename_used = _data_->filename_used;
	} else {
		_g_free0 (_data_->filename_used);
	}
	_data_->filename_used = NULL;
}

static void
gala_screenshot_manager_screenshot_area_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_)
{
	GalaScreenshotManagerScreenshotAreaData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	gala_screenshot_manager_screenshot_area_co (_data_);
}

static gboolean
gala_screenshot_manager_screenshot_area_co (GalaScreenshotManagerScreenshotAreaData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = FALSE;
	_data_->_tmp1_ = NULL;
	_data_->_state_ = 1;
	gala_screenshot_manager_screenshot_area_with_cursor (_data_->self, _data_->x, _data_->y, _data_->width, _data_->height, FALSE, _data_->flash, _data_->filename, gala_screenshot_manager_screenshot_area_ready, _data_);
	return FALSE;
	_state_1:
	gala_screenshot_manager_screenshot_area_with_cursor_finish (_data_->self, _data_->_res_, &_data_->_tmp0_, &_data_->_tmp1_, &_data_->_inner_error0_);
	_data_->success = _data_->_tmp0_;
	_g_free0 (_data_->filename_used);
	_data_->filename_used = _data_->_tmp1_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		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_);
			_g_free0 (_data_->filename_used);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_free0 (_data_->filename_used);
			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;
		}
	}
	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_screenshot_manager_screenshot_area_with_cursor_data_free (gpointer _data)
{
	GalaScreenshotManagerScreenshotAreaWithCursorData* _data_;
	_data_ = _data;
	_g_free0 (_data_->filename);
	_g_object_unref0 (_data_->self);
	g_slice_free (GalaScreenshotManagerScreenshotAreaWithCursorData, _data_);
}

void
gala_screenshot_manager_screenshot_area_with_cursor (GalaScreenshotManager* self,
                                                     gint x,
                                                     gint y,
                                                     gint width,
                                                     gint height,
                                                     gboolean include_cursor,
                                                     gboolean flash,
                                                     const gchar* filename,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_)
{
	GalaScreenshotManagerScreenshotAreaWithCursorData* _data_;
	GalaScreenshotManager* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (filename != NULL);
	_data_ = g_slice_new0 (GalaScreenshotManagerScreenshotAreaWithCursorData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gala_screenshot_manager_screenshot_area_with_cursor_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->x = x;
	_data_->y = y;
	_data_->width = width;
	_data_->height = height;
	_data_->include_cursor = include_cursor;
	_data_->flash = flash;
	_tmp1_ = g_strdup (filename);
	_g_free0 (_data_->filename);
	_data_->filename = _tmp1_;
	gala_screenshot_manager_screenshot_area_with_cursor_co (_data_);
}

void
gala_screenshot_manager_screenshot_area_with_cursor_finish (GalaScreenshotManager* self,
                                                            GAsyncResult* _res_,
                                                            gboolean* success,
                                                            gchar** filename_used,
                                                            GError** error)
{
	GalaScreenshotManagerScreenshotAreaWithCursorData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
	if (success) {
		*success = _data_->success;
	}
	if (filename_used) {
		*filename_used = _data_->filename_used;
	} else {
		_g_free0 (_data_->filename_used);
	}
	_data_->filename_used = NULL;
}

static void
gala_screenshot_manager_screenshot_area_with_cursor_ready (GObject* source_object,
                                                           GAsyncResult* _res_,
                                                           gpointer _user_data_)
{
	GalaScreenshotManagerScreenshotAreaWithCursorData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	gala_screenshot_manager_screenshot_area_with_cursor_co (_data_);
}

static gboolean
gala_screenshot_manager_screenshot_area_with_cursor_co (GalaScreenshotManagerScreenshotAreaWithCursorData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	g_debug ("ScreenshotManager.vala:104: Taking area screenshot");
	_data_->_state_ = 1;
	gala_screenshot_manager_wait_stage_repaint (_data_->self, gala_screenshot_manager_screenshot_area_with_cursor_ready, _data_);
	return FALSE;
	_state_1:
	gala_screenshot_manager_wait_stage_repaint_finish (_data_->self, _data_->_res_);
	_data_->_tmp0_ = gala_screenshot_manager_take_screenshot (_data_->self, _data_->x, _data_->y, _data_->width, _data_->height, _data_->include_cursor);
	_data_->image = _data_->_tmp0_;
	gala_screenshot_manager_unconceal_text (_data_->self);
	if (_data_->flash) {
		gala_screenshot_manager_flash_area (_data_->self, _data_->x, _data_->y, _data_->width, _data_->height, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			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_);
				_cairo_surface_destroy0 (_data_->image);
				_g_free0 (_data_->filename_used);
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				_cairo_surface_destroy0 (_data_->image);
				_g_free0 (_data_->filename_used);
				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_->_tmp1_ = _data_->image;
	_data_->_tmp2_ = NULL;
	_data_->_state_ = 2;
	gala_screenshot_manager_save_image (_data_->_tmp1_, _data_->filename, gala_screenshot_manager_screenshot_area_with_cursor_ready, _data_);
	return FALSE;
	_state_2:
	_data_->_tmp3_ = gala_screenshot_manager_save_image_finish (_data_->_res_, &_data_->_tmp2_);
	_g_free0 (_data_->filename_used);
	_data_->filename_used = _data_->_tmp2_;
	_data_->success = _data_->_tmp3_;
	if (_data_->success) {
		gala_screenshot_manager_play_shutter_sound (_data_->self);
	} else {
		_data_->_tmp4_ = g_error_new_literal (G_DBUS_ERROR, G_DBUS_ERROR_FAILED, "Failed to save image");
		_data_->_inner_error0_ = _data_->_tmp4_;
		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_);
			_cairo_surface_destroy0 (_data_->image);
			_g_free0 (_data_->filename_used);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_cairo_surface_destroy0 (_data_->image);
			_g_free0 (_data_->filename_used);
			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;
		}
	}
	_cairo_surface_destroy0 (_data_->image);
	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_screenshot_manager_screenshot_window_data_free (gpointer _data)
{
	GalaScreenshotManagerScreenshotWindowData* _data_;
	_data_ = _data;
	_g_free0 (_data_->filename);
	_g_object_unref0 (_data_->self);
	g_slice_free (GalaScreenshotManagerScreenshotWindowData, _data_);
}

void
gala_screenshot_manager_screenshot_window (GalaScreenshotManager* self,
                                           gboolean include_frame,
                                           gboolean include_cursor,
                                           gboolean flash,
                                           const gchar* filename,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_)
{
	GalaScreenshotManagerScreenshotWindowData* _data_;
	GalaScreenshotManager* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (filename != NULL);
	_data_ = g_slice_new0 (GalaScreenshotManagerScreenshotWindowData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gala_screenshot_manager_screenshot_window_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->include_frame = include_frame;
	_data_->include_cursor = include_cursor;
	_data_->flash = flash;
	_tmp1_ = g_strdup (filename);
	_g_free0 (_data_->filename);
	_data_->filename = _tmp1_;
	gala_screenshot_manager_screenshot_window_co (_data_);
}

void
gala_screenshot_manager_screenshot_window_finish (GalaScreenshotManager* self,
                                                  GAsyncResult* _res_,
                                                  gboolean* success,
                                                  gchar** filename_used,
                                                  GError** error)
{
	GalaScreenshotManagerScreenshotWindowData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
	if (success) {
		*success = _data_->success;
	}
	if (filename_used) {
		*filename_used = _data_->filename_used;
	} else {
		_g_free0 (_data_->filename_used);
	}
	_data_->filename_used = NULL;
}

static void
gala_screenshot_manager_screenshot_window_ready (GObject* source_object,
                                                 GAsyncResult* _res_,
                                                 gpointer _user_data_)
{
	GalaScreenshotManagerScreenshotWindowData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	gala_screenshot_manager_screenshot_window_co (_data_);
}

static gboolean
gala_screenshot_manager_screenshot_window_co (GalaScreenshotManagerScreenshotWindowData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	g_debug ("ScreenshotManager.vala:125: Taking window screenshot");
	_data_->_tmp0_ = _data_->self->priv->wm;
	_data_->_tmp1_ = meta_plugin_get_display ((MetaPlugin*) _data_->_tmp0_);
	_data_->_tmp2_ = meta_display_get_focus_window (_data_->_tmp1_);
	_data_->_tmp3_ = _g_object_ref0 (_data_->_tmp2_);
	_data_->window = _data_->_tmp3_;
	if (_data_->window == NULL) {
		gala_screenshot_manager_unconceal_text (_data_->self);
		_data_->_tmp4_ = g_error_new_literal (G_DBUS_ERROR, G_DBUS_ERROR_FAILED, "Cannot find active window");
		_data_->_inner_error0_ = _data_->_tmp4_;
		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_);
			_g_object_unref0 (_data_->window);
			_g_free0 (_data_->filename_used);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->window);
			_g_free0 (_data_->filename_used);
			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_->_tmp5_ = meta_window_get_compositor_private (_data_->window);
	_data_->_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp5_, meta_window_actor_get_type (), MetaWindowActor));
	_data_->window_actor = _data_->_tmp6_;
	_data_->_tmp7_ = _data_->window_actor;
	_data_->_tmp8_ = meta_window_actor_get_texture (_data_->_tmp7_);
	_data_->window_texture = G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp8_, meta_shaped_texture_get_type (), MetaShapedTexture);
	_data_->_tmp9_ = _data_->window_actor;
	_data_->_tmp10_ = 0.0F;
	_data_->_tmp11_ = 0.0F;
	clutter_actor_get_position ((ClutterActor*) _data_->_tmp9_, &_data_->_tmp10_, &_data_->_tmp11_);
	_data_->actor_x = _data_->_tmp10_;
	_data_->actor_y = _data_->_tmp11_;
	memset (&_data_->_tmp12_, 0, sizeof (MetaRectangle));
	meta_window_get_frame_rect (_data_->window, &_data_->_tmp12_);
	_data_->rect = _data_->_tmp12_;
	if (_data_->include_frame) {
		_data_->_tmp14_ = meta_window_is_client_decorated (_data_->window);
	} else {
		_data_->_tmp14_ = FALSE;
	}
	if (_data_->_tmp14_) {
		_data_->_tmp13_ = TRUE;
	} else {
		if (!_data_->include_frame) {
			_data_->_tmp15_ = !meta_window_is_client_decorated (_data_->window);
		} else {
			_data_->_tmp15_ = FALSE;
		}
		_data_->_tmp13_ = _data_->_tmp15_;
	}
	if (_data_->_tmp13_) {
		_data_->_tmp16_ = _data_->rect;
		memset (&_data_->_tmp17_, 0, sizeof (MetaRectangle));
		meta_window_frame_rect_to_client_rect (_data_->window, &_data_->_tmp16_, &_data_->_tmp17_);
		_data_->rect = _data_->_tmp17_;
	}
	_data_->_tmp18_ = _data_->rect;
	_data_->_tmp19_ = _data_->rect;
	_data_->_tmp20_ = _data_->rect;
	_data_->_tmp21_ = _data_->rect;
	memset (&_data_->_tmp22_, 0, sizeof (cairo_rectangle_int_t));
	_data_->_tmp22_.x = _data_->_tmp18_.x - ((gint) _data_->actor_x);
	_data_->_tmp22_.y = _data_->_tmp19_.y - ((gint) _data_->actor_y);
	_data_->_tmp22_.width = _data_->_tmp20_.width;
	_data_->_tmp22_.height = _data_->_tmp21_.height;
	_data_->clip = _data_->_tmp22_;
	_data_->_tmp23_ = _data_->window_texture;
	_data_->_tmp24_ = _data_->clip;
	_data_->_tmp25_ = meta_shaped_texture_get_image (_data_->_tmp23_, &_data_->_tmp24_);
	_data_->image = (cairo_surface_t*) _data_->_tmp25_;
	if (_data_->include_cursor) {
		_data_->_tmp26_ = _data_->image;
		_data_->_tmp27_ = _data_->rect;
		_data_->_tmp28_ = _data_->rect;
		_data_->_tmp29_ = _data_->rect;
		_data_->_tmp30_ = _data_->rect;
		memset (&_data_->_tmp31_, 0, sizeof (cairo_rectangle_int_t));
		_data_->_tmp31_.x = _data_->_tmp27_.x;
		_data_->_tmp31_.y = _data_->_tmp28_.y;
		_data_->_tmp31_.width = _data_->_tmp29_.width;
		_data_->_tmp31_.height = _data_->_tmp30_.height;
		_data_->_tmp32_ = gala_screenshot_manager_composite_stage_cursor (_data_->self, _data_->_tmp26_, &_data_->_tmp31_);
		_cairo_surface_destroy0 (_data_->image);
		_data_->image = _data_->_tmp32_;
	}
	gala_screenshot_manager_unconceal_text (_data_->self);
	if (_data_->flash) {
		_data_->_tmp33_ = _data_->rect;
		_data_->_tmp34_ = _data_->rect;
		_data_->_tmp35_ = _data_->rect;
		_data_->_tmp36_ = _data_->rect;
		gala_screenshot_manager_flash_area (_data_->self, _data_->_tmp33_.x, _data_->_tmp34_.y, _data_->_tmp35_.width, _data_->_tmp36_.height, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			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_);
				_cairo_surface_destroy0 (_data_->image);
				_g_object_unref0 (_data_->window_actor);
				_g_object_unref0 (_data_->window);
				_g_free0 (_data_->filename_used);
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				_cairo_surface_destroy0 (_data_->image);
				_g_object_unref0 (_data_->window_actor);
				_g_object_unref0 (_data_->window);
				_g_free0 (_data_->filename_used);
				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_->_tmp37_ = _data_->image;
	_data_->_tmp38_ = NULL;
	_data_->_state_ = 1;
	gala_screenshot_manager_save_image (_data_->_tmp37_, _data_->filename, gala_screenshot_manager_screenshot_window_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp39_ = gala_screenshot_manager_save_image_finish (_data_->_res_, &_data_->_tmp38_);
	_g_free0 (_data_->filename_used);
	_data_->filename_used = _data_->_tmp38_;
	_data_->success = _data_->_tmp39_;
	if (_data_->success) {
		gala_screenshot_manager_play_shutter_sound (_data_->self);
	}
	_cairo_surface_destroy0 (_data_->image);
	_g_object_unref0 (_data_->window_actor);
	_g_object_unref0 (_data_->window);
	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_screenshot_manager_select_area_data_free (gpointer _data)
{
	GalaScreenshotManagerSelectAreaData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (GalaScreenshotManagerSelectAreaData, _data_);
}

void
gala_screenshot_manager_select_area (GalaScreenshotManager* self,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	GalaScreenshotManagerSelectAreaData* _data_;
	GalaScreenshotManager* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (GalaScreenshotManagerSelectAreaData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gala_screenshot_manager_select_area_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	gala_screenshot_manager_select_area_co (_data_);
}

void
gala_screenshot_manager_select_area_finish (GalaScreenshotManager* self,
                                            GAsyncResult* _res_,
                                            gint* x,
                                            gint* y,
                                            gint* width,
                                            gint* height,
                                            GError** error)
{
	GalaScreenshotManagerSelectAreaData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
	if (x) {
		*x = _data_->x;
	}
	if (y) {
		*y = _data_->y;
	}
	if (width) {
		*width = _data_->width;
	}
	if (height) {
		*height = _data_->height;
	}
}

static Block6Data*
block6_data_ref (Block6Data* _data6_)
{
	g_atomic_int_inc (&_data6_->_ref_count_);
	return _data6_;
}

static void
block6_data_unref (void * _userdata_)
{
	Block6Data* _data6_;
	_data6_ = (Block6Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data6_->_ref_count_)) {
		GalaScreenshotManager* self;
		self = _data6_->self;
		_g_object_unref0 (self);
		g_slice_free (Block6Data, _data6_);
	}
}

static gboolean
_gala_screenshot_manager_select_area_co_gsource_func (gpointer self)
{
	gboolean result;
	result = gala_screenshot_manager_select_area_co (self);
	return result;
}

static void
__lambda71_ (Block6Data* _data6_)
{
	GalaScreenshotManager* self;
	self = _data6_->self;
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _gala_screenshot_manager_select_area_co_gsource_func, _data6_->_async_data_, NULL);
}

static void
___lambda71__gala_selection_area_closed (GalaSelectionArea* _sender,
                                         gpointer self)
{
	__lambda71_ (self);
}

static void
gala_screenshot_manager_select_area_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_)
{
	GalaScreenshotManagerSelectAreaData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	gala_screenshot_manager_select_area_co (_data_);
}

static gboolean
gala_screenshot_manager_select_area_co (GalaScreenshotManagerSelectAreaData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data6_ = g_slice_new0 (Block6Data);
	_data_->_data6_->_ref_count_ = 1;
	_data_->_data6_->self = g_object_ref (_data_->self);
	_data_->_data6_->_async_data_ = _data_;
	_data_->_tmp0_ = _data_->self->priv->wm;
	_data_->_tmp1_ = gala_selection_area_new (_data_->_tmp0_);
	g_object_ref_sink (_data_->_tmp1_);
	_data_->selection_area = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->selection_area;
	g_signal_connect_data (_data_->_tmp2_, "closed", (GCallback) ___lambda71__gala_selection_area_closed, block6_data_ref (_data_->_data6_), (GClosureNotify) block6_data_unref, 0);
	_data_->_tmp3_ = _data_->self->priv->wm;
	_data_->_tmp4_ = gala_window_manager_get_ui_group (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = _data_->selection_area;
	clutter_container_add ((ClutterContainer*) _data_->_tmp5_, (ClutterActor*) _data_->_tmp6_, NULL);
	_data_->_tmp7_ = _data_->selection_area;
	gala_selection_area_start_selection (_data_->_tmp7_);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	_data_->_tmp8_ = _data_->selection_area;
	clutter_actor_destroy ((ClutterActor*) _data_->_tmp8_);
	_data_->_tmp9_ = _data_->selection_area;
	_data_->_tmp10_ = gala_selection_area_get_cancelled (_data_->_tmp9_);
	_data_->_tmp11_ = _data_->_tmp10_;
	if (_data_->_tmp11_) {
		_data_->_tmp12_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_CANCELLED, "Operation was cancelled");
		_data_->_inner_error0_ = _data_->_tmp12_;
		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_);
			_g_object_unref0 (_data_->selection_area);
			block6_data_unref (_data_->_data6_);
			_data_->_data6_ = NULL;
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->selection_area);
			block6_data_unref (_data_->_data6_);
			_data_->_data6_ = 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_->_state_ = 2;
	gala_screenshot_manager_wait_stage_repaint (_data_->self, gala_screenshot_manager_select_area_ready, _data_);
	return FALSE;
	_state_2:
	gala_screenshot_manager_wait_stage_repaint_finish (_data_->self, _data_->_res_);
	_data_->_tmp13_ = _data_->selection_area;
	_data_->_tmp14_ = 0;
	_data_->_tmp15_ = 0;
	_data_->_tmp16_ = 0;
	_data_->_tmp17_ = 0;
	gala_selection_area_get_selection_rectangle (_data_->_tmp13_, &_data_->_tmp14_, &_data_->_tmp15_, &_data_->_tmp16_, &_data_->_tmp17_);
	_data_->x = _data_->_tmp14_;
	_data_->y = _data_->_tmp15_;
	_data_->width = _data_->_tmp16_;
	_data_->height = _data_->_tmp17_;
	_g_object_unref0 (_data_->selection_area);
	block6_data_unref (_data_->_data6_);
	_data_->_data6_ = 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_screenshot_manager_unconceal_text (GalaScreenshotManager* self)
{
	GSettings* _tmp0_;
	const gchar* _tmp1_;
	GSettings* _tmp2_;
	const gchar* _tmp3_;
	GSettings* _tmp4_;
	const gchar* _tmp5_;
	g_return_if_fail (self != NULL);
	if (self->priv->conceal_timeout == ((guint) 0)) {
		return;
	}
	_tmp0_ = self->priv->desktop_settings;
	_tmp1_ = self->priv->prev_font_regular;
	g_settings_set_string (_tmp0_, "font-name", _tmp1_);
	_tmp2_ = self->priv->desktop_settings;
	_tmp3_ = self->priv->prev_font_mono;
	g_settings_set_string (_tmp2_, "monospace-font-name", _tmp3_);
	_tmp4_ = self->priv->desktop_settings;
	_tmp5_ = self->priv->prev_font_document;
	g_settings_set_string (_tmp4_, "document-font-name", _tmp5_);
	g_source_remove (self->priv->conceal_timeout);
	self->priv->conceal_timeout = (guint) 0;
}

static void
gala_screenshot_manager_conceal_text_data_free (gpointer _data)
{
	GalaScreenshotManagerConcealTextData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (GalaScreenshotManagerConcealTextData, _data_);
}

void
gala_screenshot_manager_conceal_text (GalaScreenshotManager* self,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_)
{
	GalaScreenshotManagerConcealTextData* _data_;
	GalaScreenshotManager* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (GalaScreenshotManagerConcealTextData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gala_screenshot_manager_conceal_text_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	gala_screenshot_manager_conceal_text_co (_data_);
}

void
gala_screenshot_manager_conceal_text_finish (GalaScreenshotManager* self,
                                             GAsyncResult* _res_,
                                             GError** error)
{
	GalaScreenshotManagerConcealTextData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static gboolean
__lambda72_ (GalaScreenshotManager* self)
{
	gboolean result;
	gala_screenshot_manager_unconceal_text (self);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda72__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda72_ ((GalaScreenshotManager*) self);
	return result;
}

static gboolean
gala_screenshot_manager_conceal_text_co (GalaScreenshotManagerConcealTextData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->self->priv->conceal_timeout > ((guint) 0)) {
		g_source_remove (_data_->self->priv->conceal_timeout);
	} else {
		_data_->_tmp0_ = _data_->self->priv->desktop_settings;
		_data_->_tmp1_ = g_settings_get_string (_data_->_tmp0_, "font-name");
		_g_free0 (_data_->self->priv->prev_font_regular);
		_data_->self->priv->prev_font_regular = _data_->_tmp1_;
		_data_->_tmp2_ = _data_->self->priv->desktop_settings;
		_data_->_tmp3_ = g_settings_get_string (_data_->_tmp2_, "monospace-font-name");
		_g_free0 (_data_->self->priv->prev_font_mono);
		_data_->self->priv->prev_font_mono = _data_->_tmp3_;
		_data_->_tmp4_ = _data_->self->priv->desktop_settings;
		_data_->_tmp5_ = g_settings_get_string (_data_->_tmp4_, "document-font-name");
		_g_free0 (_data_->self->priv->prev_font_document);
		_data_->self->priv->prev_font_document = _data_->_tmp5_;
		_data_->_tmp6_ = _data_->self->priv->desktop_settings;
		g_settings_set_string (_data_->_tmp6_, "font-name", "Redacted Script Regular 9");
		_data_->_tmp7_ = _data_->self->priv->desktop_settings;
		g_settings_set_string (_data_->_tmp7_, "monospace-font-name", "Redacted Script Light 10");
		_data_->_tmp8_ = _data_->self->priv->desktop_settings;
		g_settings_set_string (_data_->_tmp8_, "document-font-name", "Redacted Script Regular 10");
	}
	_data_->self->priv->conceal_timeout = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) GALA_UNCONCEAL_TEXT_TIMEOUT, ___lambda72__gsource_func, g_object_ref (_data_->self), g_object_unref);
	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_screenshot_manager_pick_color_data_free (gpointer _data)
{
	GalaScreenshotManagerPickColorData* _data_;
	_data_ = _data;
	_g_hash_table_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (GalaScreenshotManagerPickColorData, _data_);
}

void
gala_screenshot_manager_pick_color (GalaScreenshotManager* self,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_)
{
	GalaScreenshotManagerPickColorData* _data_;
	GalaScreenshotManager* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (GalaScreenshotManagerPickColorData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gala_screenshot_manager_pick_color_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	gala_screenshot_manager_pick_color_co (_data_);
}

GHashTable*
gala_screenshot_manager_pick_color_finish (GalaScreenshotManager* self,
                                           GAsyncResult* _res_,
                                           GError** error)
{
	GHashTable* result;
	GalaScreenshotManagerPickColorData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block7Data*
block7_data_ref (Block7Data* _data7_)
{
	g_atomic_int_inc (&_data7_->_ref_count_);
	return _data7_;
}

static void
block7_data_unref (void * _userdata_)
{
	Block7Data* _data7_;
	_data7_ = (Block7Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) {
		GalaScreenshotManager* self;
		self = _data7_->self;
		_g_object_unref0 (self);
		g_slice_free (Block7Data, _data7_);
	}
}

static gboolean
_gala_screenshot_manager_pick_color_co_gsource_func (gpointer self)
{
	gboolean result;
	result = gala_screenshot_manager_pick_color_co (self);
	return result;
}

static void
__lambda73_ (Block7Data* _data7_)
{
	GalaScreenshotManager* self;
	self = _data7_->self;
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _gala_screenshot_manager_pick_color_co_gsource_func, _data7_->_async_data_, NULL);
}

static void
___lambda73__gala_pixel_picker_closed (GalaPixelPicker* _sender,
                                       gpointer self)
{
	__lambda73_ (self);
}

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

static void
_g_variant_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_variant_unref (var), NULL));
}

static gboolean
gala_screenshot_manager_pick_color_co (GalaScreenshotManagerPickColorData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data7_ = g_slice_new0 (Block7Data);
	_data_->_data7_->_ref_count_ = 1;
	_data_->_data7_->self = g_object_ref (_data_->self);
	_data_->_data7_->_async_data_ = _data_;
	_data_->_tmp0_ = _data_->self->priv->wm;
	_data_->_tmp1_ = gala_pixel_picker_new (_data_->_tmp0_);
	g_object_ref_sink (_data_->_tmp1_);
	_data_->pixel_picker = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->pixel_picker;
	g_signal_connect_data (_data_->_tmp2_, "closed", (GCallback) ___lambda73__gala_pixel_picker_closed, block7_data_ref (_data_->_data7_), (GClosureNotify) block7_data_unref, 0);
	_data_->_tmp3_ = _data_->self->priv->wm;
	_data_->_tmp4_ = gala_window_manager_get_ui_group (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = _data_->pixel_picker;
	clutter_container_add ((ClutterContainer*) _data_->_tmp5_, (ClutterActor*) _data_->_tmp6_, NULL);
	_data_->_tmp7_ = _data_->pixel_picker;
	gala_pixel_picker_start_selection (_data_->_tmp7_);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	_data_->_tmp8_ = _data_->pixel_picker;
	clutter_actor_destroy ((ClutterActor*) _data_->_tmp8_);
	_data_->_tmp9_ = _data_->pixel_picker;
	_data_->_tmp10_ = gala_pixel_picker_get_cancelled (_data_->_tmp9_);
	_data_->_tmp11_ = _data_->_tmp10_;
	if (_data_->_tmp11_) {
		_data_->_tmp12_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_CANCELLED, "Operation was cancelled");
		_data_->_inner_error0_ = _data_->_tmp12_;
		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_);
			_g_object_unref0 (_data_->pixel_picker);
			block7_data_unref (_data_->_data7_);
			_data_->_data7_ = NULL;
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->pixel_picker);
			block7_data_unref (_data_->_data7_);
			_data_->_data7_ = 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_->x = 0;
	_data_->y = 0;
	_data_->_tmp13_ = _data_->pixel_picker;
	_data_->_tmp14_ = 0;
	_data_->_tmp15_ = 0;
	gala_pixel_picker_get_point (_data_->_tmp13_, &_data_->_tmp14_, &_data_->_tmp15_);
	_data_->x = _data_->_tmp14_;
	_data_->y = _data_->_tmp15_;
	_data_->_tmp16_ = gala_screenshot_manager_take_screenshot (_data_->self, _data_->x, _data_->y, 1, 1, FALSE);
	_data_->image = _data_->_tmp16_;
	_data_->_tmp17_ = _data_->image;
	_vala_assert (cairo_image_surface_get_format (_data_->_tmp17_) == CAIRO_FORMAT_ARGB32, "image.get_format () == Cairo.Format.ARGB32");
	_data_->_tmp18_ = _data_->image;
	_data_->_tmp19_ = cairo_image_surface_get_data (_data_->_tmp18_);
	_data_->data = _data_->_tmp19_;
	_data_->data_length1 = -1;
	_data_->_data_size_ = _data_->data_length1;
	if (G_BYTE_ORDER == G_LITTLE_ENDIAN) {
		_data_->_tmp20_ = _data_->data;
		_data_->_tmp20__length1 = _data_->data_length1;
		_data_->_tmp21_ = _data_->_tmp20_[2];
		_data_->r = (gdouble) (_data_->_tmp21_ / 255.0f);
		_data_->_tmp22_ = _data_->data;
		_data_->_tmp22__length1 = _data_->data_length1;
		_data_->_tmp23_ = _data_->_tmp22_[1];
		_data_->g = (gdouble) (_data_->_tmp23_ / 255.0f);
		_data_->_tmp24_ = _data_->data;
		_data_->_tmp24__length1 = _data_->data_length1;
		_data_->_tmp25_ = _data_->_tmp24_[0];
		_data_->b = (gdouble) (_data_->_tmp25_ / 255.0f);
	} else {
		_data_->_tmp26_ = _data_->data;
		_data_->_tmp26__length1 = _data_->data_length1;
		_data_->_tmp27_ = _data_->_tmp26_[1];
		_data_->r = (gdouble) (_data_->_tmp27_ / 255.0f);
		_data_->_tmp28_ = _data_->data;
		_data_->_tmp28__length1 = _data_->data_length1;
		_data_->_tmp29_ = _data_->_tmp28_[2];
		_data_->g = (gdouble) (_data_->_tmp29_ / 255.0f);
		_data_->_tmp30_ = _data_->data;
		_data_->_tmp30__length1 = _data_->data_length1;
		_data_->_tmp31_ = _data_->_tmp30_[3];
		_data_->b = (gdouble) (_data_->_tmp31_ / 255.0f);
	}
	_data_->_tmp32_ = g_str_hash;
	_data_->_tmp33_ = g_str_equal;
	_data_->_tmp34_ = g_hash_table_new_full (_data_->_tmp32_, _data_->_tmp33_, _g_free0_, _g_variant_unref0_);
	_data_->_result_ = _data_->_tmp34_;
	_data_->_tmp35_ = g_strdup ("color");
	_data_->_tmp36_ = g_variant_new ("(ddd)", _data_->r, _data_->g, _data_->b, NULL);
	g_variant_ref_sink (_data_->_tmp36_);
	g_hash_table_insert (_data_->_result_, _data_->_tmp35_, _data_->_tmp36_);
	_data_->result = _data_->_result_;
	_cairo_surface_destroy0 (_data_->image);
	_g_object_unref0 (_data_->pixel_picker);
	block7_data_unref (_data_->_data7_);
	_data_->_data7_ = 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 gchar*
gala_screenshot_manager_find_target_path (void)
{
	const gchar* base_path = NULL;
	const gchar* _tmp0_;
	gboolean _tmp1_ = FALSE;
	const gchar* _tmp2_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* result;
	_tmp0_ = g_get_user_special_dir (G_USER_DIRECTORY_PICTURES);
	base_path = _tmp0_;
	_tmp2_ = base_path;
	if (_tmp2_ != NULL) {
		const gchar* _tmp3_;
		_tmp3_ = base_path;
		_tmp1_ = g_file_test (_tmp3_, G_FILE_TEST_EXISTS);
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		gchar* path = NULL;
		const gchar* _tmp4_;
		gchar* _tmp5_;
		const gchar* _tmp6_;
		_tmp4_ = base_path;
		_tmp5_ = g_build_path (G_DIR_SEPARATOR_S, _tmp4_, _ ("Screenshots"), NULL);
		path = _tmp5_;
		_tmp6_ = path;
		if (g_file_test (_tmp6_, G_FILE_TEST_EXISTS)) {
			result = path;
			return result;
		} else {
			const gchar* _tmp7_;
			_tmp7_ = path;
			if (g_mkdir (_tmp7_, 0755) == 0) {
				result = path;
				return result;
			} else {
				const gchar* _tmp8_;
				gchar* _tmp9_;
				_tmp8_ = base_path;
				_tmp9_ = g_strdup (_tmp8_);
				result = _tmp9_;
				_g_free0 (path);
				return result;
			}
		}
		_g_free0 (path);
	}
	_tmp10_ = g_get_home_dir ();
	_tmp11_ = g_strdup (_tmp10_);
	result = _tmp11_;
	return result;
}

static void
gala_screenshot_manager_save_image_data_free (gpointer _data)
{
	GalaScreenshotManagerSaveImageData* _data_;
	_data_ = _data;
	_cairo_surface_destroy0 (_data_->image);
	_g_free0 (_data_->filename);
	g_slice_free (GalaScreenshotManagerSaveImageData, _data_);
}

static gpointer
_cairo_surface_reference0 (gpointer self)
{
	return self ? cairo_surface_reference (self) : NULL;
}

static void
gala_screenshot_manager_save_image (cairo_surface_t* image,
                                    const gchar* filename,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_)
{
	GalaScreenshotManagerSaveImageData* _data_;
	cairo_surface_t* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (image != NULL);
	g_return_if_fail (filename != NULL);
	_data_ = g_slice_new0 (GalaScreenshotManagerSaveImageData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gala_screenshot_manager_save_image_data_free);
	_tmp0_ = _cairo_surface_reference0 (image);
	_cairo_surface_destroy0 (_data_->image);
	_data_->image = _tmp0_;
	_tmp1_ = g_strdup (filename);
	_g_free0 (_data_->filename);
	_data_->filename = _tmp1_;
	gala_screenshot_manager_save_image_co (_data_);
}

static gboolean
gala_screenshot_manager_save_image_finish (GAsyncResult* _res_,
                                           gchar** used_filename)
{
	gboolean result;
	GalaScreenshotManagerSaveImageData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	if (used_filename) {
		*used_filename = _data_->used_filename;
	} else {
		_g_free0 (_data_->used_filename);
	}
	_data_->used_filename = NULL;
	result = _data_->result;
	return result;
}

static void
gala_screenshot_manager_save_image_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_)
{
	GalaScreenshotManagerSaveImageData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	gala_screenshot_manager_save_image_co (_data_);
}

static gboolean
gala_screenshot_manager_save_image_co (GalaScreenshotManagerSaveImageData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (g_strcmp0 (_data_->filename, "") != 0) {
		_data_->_tmp1_ = NULL;
		_data_->_state_ = 1;
		gala_screenshot_manager_save_image_to_file (_data_->image, _data_->filename, gala_screenshot_manager_save_image_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp2_ = gala_screenshot_manager_save_image_to_file_finish (_data_->_res_, &_data_->_tmp1_);
		_g_free0 (_data_->used_filename);
		_data_->used_filename = _data_->_tmp1_;
		_data_->_tmp0_ = _data_->_tmp2_;
	} else {
		_data_->_tmp3_ = NULL;
		_data_->_tmp4_ = gala_screenshot_manager_save_image_to_clipboard (_data_->image, _data_->filename, &_data_->_tmp3_);
		_g_free0 (_data_->used_filename);
		_data_->used_filename = _data_->_tmp3_;
		_data_->_tmp0_ = _data_->_tmp4_;
	}
	_data_->result = _data_->_tmp0_;
	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_screenshot_manager_save_image_to_file_data_free (gpointer _data)
{
	GalaScreenshotManagerSaveImageToFileData* _data_;
	_data_ = _data;
	_cairo_surface_destroy0 (_data_->image);
	_g_free0 (_data_->filename);
	g_slice_free (GalaScreenshotManagerSaveImageToFileData, _data_);
}

static void
gala_screenshot_manager_save_image_to_file (cairo_surface_t* image,
                                            const gchar* filename,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_)
{
	GalaScreenshotManagerSaveImageToFileData* _data_;
	cairo_surface_t* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (image != NULL);
	g_return_if_fail (filename != NULL);
	_data_ = g_slice_new0 (GalaScreenshotManagerSaveImageToFileData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gala_screenshot_manager_save_image_to_file_data_free);
	_tmp0_ = _cairo_surface_reference0 (image);
	_cairo_surface_destroy0 (_data_->image);
	_data_->image = _tmp0_;
	_tmp1_ = g_strdup (filename);
	_g_free0 (_data_->filename);
	_data_->filename = _tmp1_;
	gala_screenshot_manager_save_image_to_file_co (_data_);
}

static gboolean
gala_screenshot_manager_save_image_to_file_finish (GAsyncResult* _res_,
                                                   gchar** used_filename)
{
	gboolean result;
	GalaScreenshotManagerSaveImageToFileData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	if (used_filename) {
		*used_filename = _data_->used_filename;
	} else {
		_g_free0 (_data_->used_filename);
	}
	_data_->used_filename = NULL;
	result = _data_->result;
	return result;
}

static gchar*
string_splice (const gchar* self,
               glong start,
               glong end,
               const gchar* str)
{
	glong string_length = 0L;
	gint _tmp0_;
	gint _tmp1_;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gsize str_size = 0UL;
	const gchar* _result_ = NULL;
	void* _tmp6_;
	gchar* dest = NULL;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp12_;
	const gchar* _tmp13_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	string_length = (glong) _tmp1_;
	if (start < ((glong) 0)) {
		start = string_length + start;
	}
	if (end < ((glong) 0)) {
		end = string_length + end;
	}
	if (start >= ((glong) 0)) {
		_tmp2_ = start <= string_length;
	} else {
		_tmp2_ = FALSE;
	}
	g_return_val_if_fail (_tmp2_, NULL);
	if (end >= ((glong) 0)) {
		_tmp3_ = end <= string_length;
	} else {
		_tmp3_ = FALSE;
	}
	g_return_val_if_fail (_tmp3_, NULL);
	g_return_val_if_fail (start <= end, NULL);
	if (str == NULL) {
		str_size = (gsize) 0;
	} else {
		gint _tmp4_;
		gint _tmp5_;
		_tmp4_ = strlen ((const gchar*) str);
		_tmp5_ = _tmp4_;
		str_size = (gsize) _tmp5_;
	}
	_tmp6_ = g_malloc0 (((string_length - (end - start)) + str_size) + 1);
	_result_ = _tmp6_;
	_tmp7_ = _result_;
	dest = (gchar*) _tmp7_;
	_tmp8_ = dest;
	memcpy (_tmp8_, self, (gsize) start);
	_tmp9_ = dest;
	dest = _tmp9_ + start;
	if (str != NULL) {
		gchar* _tmp10_;
		gchar* _tmp11_;
		_tmp10_ = dest;
		memcpy (_tmp10_, str, str_size);
		_tmp11_ = dest;
		dest = _tmp11_ + str_size;
	}
	_tmp12_ = dest;
	memcpy (_tmp12_, ((gchar*) self) + end, (gsize) (string_length - end));
	_tmp13_ = _result_;
	_result_ = NULL;
	result = (gchar*) _tmp13_;
	return result;
}

static void
gala_screenshot_manager_save_image_to_file_ready (GObject* source_object,
                                                  GAsyncResult* _res_,
                                                  gpointer _user_data_)
{
	GalaScreenshotManagerSaveImageToFileData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	gala_screenshot_manager_save_image_to_file_co (_data_);
}

static gboolean
gala_screenshot_manager_save_image_to_file_co (GalaScreenshotManagerSaveImageToFileData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_strdup (_data_->filename);
	_g_free0 (_data_->used_filename);
	_data_->used_filename = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->used_filename;
	if (!g_path_is_absolute (_data_->_tmp1_)) {
		_data_->_tmp2_ = _data_->used_filename;
		if (!g_str_has_suffix (_data_->_tmp2_, GALA_EXTENSION)) {
			_data_->_tmp3_ = _data_->used_filename;
			_data_->_tmp4_ = g_strconcat (_data_->_tmp3_, GALA_EXTENSION, NULL);
			_g_free0 (_data_->used_filename);
			_data_->used_filename = _data_->_tmp4_;
		}
		_data_->scale_factor = gala_internal_utils_get_ui_scaling_factor ();
		if (_data_->scale_factor > 1) {
			_data_->_tmp5_ = strlen (GALA_EXTENSION);
			_data_->_tmp6_ = _data_->_tmp5_;
			_data_->scale_pos = -_data_->_tmp6_;
			_data_->_tmp7_ = _data_->used_filename;
			_data_->_tmp8_ = g_strdup_printf ("@%ix", _data_->scale_factor);
			_data_->_tmp9_ = _data_->_tmp8_;
			_data_->_tmp10_ = string_splice (_data_->_tmp7_, (glong) _data_->scale_pos, (glong) _data_->scale_pos, _data_->_tmp9_);
			_g_free0 (_data_->used_filename);
			_data_->used_filename = _data_->_tmp10_;
			_g_free0 (_data_->_tmp9_);
		}
		_data_->_tmp11_ = gala_screenshot_manager_find_target_path ();
		_data_->path = _data_->_tmp11_;
		_data_->_tmp12_ = _data_->path;
		_data_->_tmp13_ = _data_->used_filename;
		_data_->_tmp14_ = g_build_filename (_data_->_tmp12_, _data_->_tmp13_, NULL, NULL);
		_g_free0 (_data_->used_filename);
		_data_->used_filename = _data_->_tmp14_;
		_g_free0 (_data_->path);
	}
	{
		_data_->_tmp15_ = gdk_pixbuf_get_from_surface (_data_->image, 0, 0, cairo_image_surface_get_width (_data_->image), cairo_image_surface_get_height (_data_->image));
		_data_->screenshot = _data_->_tmp15_;
		_data_->_tmp16_ = _data_->used_filename;
		_data_->_tmp17_ = g_file_new_for_path (_data_->_tmp16_);
		_data_->file = _data_->_tmp17_;
		_data_->_tmp18_ = _data_->file;
		if (g_file_query_exists (_data_->_tmp18_, NULL)) {
			_data_->_tmp20_ = _data_->file;
			_data_->_state_ = 1;
			g_file_open_readwrite_async (_data_->_tmp20_, (gint) G_FILE_CREATE_NONE, NULL, gala_screenshot_manager_save_image_to_file_ready, _data_);
			return FALSE;
			_state_1:
			_data_->_tmp21_ = g_file_open_readwrite_finish (_data_->_tmp20_, _data_->_res_, &_data_->_inner_error0_);
			_data_->_tmp19_ = _data_->_tmp21_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_object_unref0 (_data_->stream);
				_g_object_unref0 (_data_->file);
				_g_object_unref0 (_data_->screenshot);
				goto __catch0_g_error;
			}
			_data_->_tmp22_ = _data_->_tmp19_;
			_data_->_tmp19_ = NULL;
			_g_object_unref0 (_data_->stream);
			_data_->stream = _data_->_tmp22_;
			_g_object_unref0 (_data_->_tmp19_);
		} else {
			_data_->_tmp24_ = _data_->file;
			_data_->_state_ = 2;
			g_file_create_readwrite_async (_data_->_tmp24_, G_FILE_CREATE_NONE, G_PRIORITY_DEFAULT, NULL, gala_screenshot_manager_save_image_to_file_ready, _data_);
			return FALSE;
			_state_2:
			_data_->_tmp25_ = g_file_create_readwrite_finish (_data_->_tmp24_, _data_->_res_, &_data_->_inner_error0_);
			_data_->_tmp23_ = _data_->_tmp25_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_object_unref0 (_data_->stream);
				_g_object_unref0 (_data_->file);
				_g_object_unref0 (_data_->screenshot);
				goto __catch0_g_error;
			}
			_data_->_tmp26_ = _data_->_tmp23_;
			_data_->_tmp23_ = NULL;
			_g_object_unref0 (_data_->stream);
			_data_->stream = _data_->_tmp26_;
			_g_object_unref0 (_data_->_tmp23_);
		}
		_data_->_tmp27_ = _data_->screenshot;
		_data_->_tmp28_ = _data_->stream;
		_data_->_tmp29_ = g_io_stream_get_output_stream ((GIOStream*) _data_->_tmp28_);
		_data_->_tmp30_ = _data_->_tmp29_;
		_data_->_state_ = 3;
		gdk_pixbuf_save_to_stream_async (_data_->_tmp27_, _data_->_tmp30_, "png", NULL, gala_screenshot_manager_save_image_to_file_ready, _data_, NULL);
		return FALSE;
		_state_3:
		gdk_pixbuf_save_to_stream_finish (_data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->stream);
			_g_object_unref0 (_data_->file);
			_g_object_unref0 (_data_->screenshot);
			goto __catch0_g_error;
		}
		_data_->result = TRUE;
		_g_object_unref0 (_data_->stream);
		_g_object_unref0 (_data_->file);
		_g_object_unref0 (_data_->screenshot);
		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;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp31_ = _data_->e;
		_data_->_tmp32_ = _data_->_tmp31_->message;
		g_warning ("ScreenshotManager.vala:307: could not save file: %s", _data_->_tmp32_);
		_data_->result = FALSE;
		_g_error_free0 (_data_->e);
		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;
	}
	__finally0:
	_g_free0 (_data_->used_filename);
	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;
}

static gboolean
gala_screenshot_manager_save_image_to_clipboard (cairo_surface_t* image,
                                                 const gchar* filename,
                                                 gchar** used_filename)
{
	gchar* _vala_used_filename = NULL;
	gchar* _tmp0_;
	GdkDisplay* display = NULL;
	GdkDisplay* _tmp1_;
	GtkClipboard* clipboard = NULL;
	GdkDisplay* _tmp2_;
	GtkClipboard* _tmp3_;
	GdkPixbuf* screenshot = NULL;
	GdkPixbuf* _tmp4_;
	GdkPixbuf* _tmp5_;
	GtkClipboard* _tmp6_;
	GdkPixbuf* _tmp7_;
	gboolean result;
	g_return_val_if_fail (image != NULL, FALSE);
	g_return_val_if_fail (filename != NULL, FALSE);
	_tmp0_ = g_strdup (filename);
	_g_free0 (_vala_used_filename);
	_vala_used_filename = _tmp0_;
	_tmp1_ = gdk_display_get_default ();
	display = _tmp1_;
	_tmp2_ = display;
	_tmp3_ = gtk_clipboard_get_default (_tmp2_);
	clipboard = _tmp3_;
	_tmp4_ = gdk_pixbuf_get_from_surface (image, 0, 0, cairo_image_surface_get_width (image), cairo_image_surface_get_height (image));
	screenshot = _tmp4_;
	_tmp5_ = screenshot;
	if (_tmp5_ == NULL) {
		g_warning ("ScreenshotManager.vala:320: could not save screenshot to clipboard: nu" \
"ll pixbuf");
		result = FALSE;
		_g_object_unref0 (screenshot);
		if (used_filename) {
			*used_filename = _vala_used_filename;
		} else {
			_g_free0 (_vala_used_filename);
		}
		return result;
	}
	_tmp6_ = clipboard;
	_tmp7_ = screenshot;
	gtk_clipboard_set_image (_tmp6_, _tmp7_);
	result = TRUE;
	_g_object_unref0 (screenshot);
	if (used_filename) {
		*used_filename = _vala_used_filename;
	} else {
		_g_free0 (_vala_used_filename);
	}
	return result;
}

static void
gala_screenshot_manager_play_shutter_sound (GalaScreenshotManager* self)
{
	ca_context* context = NULL;
	ca_proplist* props = NULL;
	ca_context* _tmp0_ = NULL;
	ca_proplist* _tmp1_ = NULL;
	g_return_if_fail (self != NULL);
	ca_context_create (&_tmp0_);
	_ca_context_destroy0 (context);
	context = _tmp0_;
	ca_proplist_create (&_tmp1_);
	_ca_proplist_destroy0 (props);
	props = _tmp1_;
	ca_proplist_sets (props, CA_PROP_EVENT_ID, "screen-capture");
	ca_proplist_sets (props, CA_PROP_EVENT_DESCRIPTION, _ ("Screenshot taken"));
	ca_proplist_sets (props, CA_PROP_CANBERRA_CACHE_CONTROL, "permanent");
	ca_context_play_full (context, (guint32) 0, props, NULL, NULL);
	_ca_proplist_destroy0 (props);
	_ca_context_destroy0 (context);
}

static cairo_surface_t*
gala_screenshot_manager_take_screenshot (GalaScreenshotManager* self,
                                         gint x,
                                         gint y,
                                         gint width,
                                         gint height,
                                         gboolean include_cursor)
{
	cairo_surface_t* image = NULL;
	gint image_width = 0;
	gint image_height = 0;
	gfloat scale = 0.0F;
	GalaWindowManager* _tmp0_;
	ClutterStage* _tmp1_;
	ClutterStage* _tmp2_;
	cairo_rectangle_int_t _tmp3_ = {0};
	gint _tmp4_ = 0;
	gint _tmp5_ = 0;
	gfloat _tmp6_ = 0.0F;
	cairo_surface_t* _tmp7_;
	ClutterPaintFlag paint_flags = 0U;
	GError* _inner_error0_ = NULL;
	cairo_surface_t* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->wm;
	_tmp1_ = gala_window_manager_get_stage (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_.x = x;
	_tmp3_.y = y;
	_tmp3_.width = width;
	_tmp3_.height = height;
	clutter_stage_get_capture_final_size (_tmp2_, &_tmp3_, &_tmp4_, &_tmp5_, &_tmp6_);
	image_width = _tmp4_;
	image_height = _tmp5_;
	scale = _tmp6_;
	_tmp7_ = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, image_width, image_height);
	_cairo_surface_destroy0 (image);
	image = _tmp7_;
	paint_flags = CLUTTER_PAINT_FLAG_NO_CURSORS;
	if (include_cursor) {
		paint_flags |= CLUTTER_PAINT_FLAG_FORCE_CURSORS;
	}
	if (G_BYTE_ORDER == G_LITTLE_ENDIAN) {
		GalaWindowManager* _tmp8_;
		ClutterStage* _tmp9_;
		ClutterStage* _tmp10_;
		cairo_rectangle_int_t _tmp11_ = {0};
		cairo_surface_t* _tmp12_;
		guchar* _tmp13_;
		cairo_surface_t* _tmp14_;
		_tmp8_ = self->priv->wm;
		_tmp9_ = gala_window_manager_get_stage (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_.x = x;
		_tmp11_.y = y;
		_tmp11_.width = width;
		_tmp11_.height = height;
		_tmp12_ = image;
		_tmp13_ = cairo_image_surface_get_data (_tmp12_);
		_tmp14_ = image;
		clutter_stage_paint_to_buffer (_tmp10_, &_tmp11_, scale, _tmp13_, cairo_image_surface_get_stride (_tmp14_), COGL_PIXEL_FORMAT_BGRA_8888_PRE, paint_flags, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_cairo_surface_destroy0 (image);
			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 NULL;
		}
	} else {
		GalaWindowManager* _tmp15_;
		ClutterStage* _tmp16_;
		ClutterStage* _tmp17_;
		cairo_rectangle_int_t _tmp18_ = {0};
		cairo_surface_t* _tmp19_;
		guchar* _tmp20_;
		cairo_surface_t* _tmp21_;
		_tmp15_ = self->priv->wm;
		_tmp16_ = gala_window_manager_get_stage (_tmp15_);
		_tmp17_ = _tmp16_;
		_tmp18_.x = x;
		_tmp18_.y = y;
		_tmp18_.width = width;
		_tmp18_.height = height;
		_tmp19_ = image;
		_tmp20_ = cairo_image_surface_get_data (_tmp19_);
		_tmp21_ = image;
		clutter_stage_paint_to_buffer (_tmp17_, &_tmp18_, scale, _tmp20_, cairo_image_surface_get_stride (_tmp21_), COGL_PIXEL_FORMAT_ARGB_8888_PRE, paint_flags, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_cairo_surface_destroy0 (image);
			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 NULL;
		}
	}
	result = image;
	return result;
}

static cairo_surface_t*
gala_screenshot_manager_composite_capture_images (GalaScreenshotManager* self,
                                                  ClutterCapture* captures,
                                                  gint captures_length1,
                                                  gint x,
                                                  gint y,
                                                  gint width,
                                                  gint height)
{
	cairo_surface_t* image = NULL;
	ClutterCapture _tmp0_;
	cairo_surface_t* _tmp1_;
	cairo_surface_t* _tmp2_;
	cairo_t* cr = NULL;
	cairo_surface_t* _tmp3_;
	cairo_t* _tmp4_;
	cairo_surface_t* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = captures[0];
	_tmp1_ = _tmp0_.image;
	_tmp2_ = cairo_image_surface_create (cairo_image_surface_get_format (_tmp1_), width, height);
	image = _tmp2_;
	_tmp3_ = image;
	_tmp4_ = cairo_create (_tmp3_);
	cr = _tmp4_;
	{
		ClutterCapture* capture_collection = NULL;
		gint capture_collection_length1 = 0;
		gint _capture_collection_size_ = 0;
		gint capture_it = 0;
		capture_collection = captures;
		capture_collection_length1 = captures_length1;
		for (capture_it = 0; capture_it < capture_collection_length1; capture_it = capture_it + 1) {
			ClutterCapture capture = {0};
			capture = capture_collection[capture_it];
			{
				gdouble capture_scale = 0.0;
				ClutterCapture _tmp5_;
				cairo_surface_t* _tmp6_;
				gdouble _tmp7_ = 0.0;
				cairo_t* _tmp8_;
				cairo_t* _tmp9_;
				ClutterCapture _tmp10_;
				cairo_rectangle_int_t _tmp11_;
				ClutterCapture _tmp12_;
				cairo_rectangle_int_t _tmp13_;
				cairo_t* _tmp14_;
				ClutterCapture _tmp15_;
				cairo_surface_t* _tmp16_;
				cairo_t* _tmp17_;
				capture_scale = 1.0;
				_tmp5_ = capture;
				_tmp6_ = _tmp5_.image;
				cairo_surface_get_device_scale (_tmp6_, &_tmp7_, NULL);
				capture_scale = _tmp7_;
				if (capture_scale != 1.0) {
					continue;
				}
				_tmp8_ = cr;
				cairo_save (_tmp8_);
				_tmp9_ = cr;
				_tmp10_ = capture;
				_tmp11_ = _tmp10_.rect;
				_tmp12_ = capture;
				_tmp13_ = _tmp12_.rect;
				cairo_translate (_tmp9_, (gdouble) (_tmp11_.x - x), (gdouble) (_tmp13_.y - y));
				_tmp14_ = cr;
				_tmp15_ = capture;
				_tmp16_ = _tmp15_.image;
				cairo_set_source_surface (_tmp14_, _tmp16_, (gdouble) 0, (gdouble) 0);
				_tmp17_ = cr;
				cairo_restore (_tmp17_);
			}
		}
	}
	result = image;
	_cairo_destroy0 (cr);
	return result;
}

static cairo_surface_t*
gala_screenshot_manager_composite_stage_cursor (GalaScreenshotManager* self,
                                                cairo_surface_t* image,
                                                cairo_rectangle_int_t* image_rect)
{
	MetaCursorTracker* cursor_tracker = NULL;
	GalaWindowManager* _tmp0_;
	MetaDisplay* _tmp1_;
	MetaCursorTracker* _tmp2_;
	graphene_point_t coords = {0};
	graphene_point_t _tmp3_ = {0};
	MetaCursorTracker* _tmp4_;
	graphene_point_t _tmp5_ = {0};
	cairo_region_t* region = NULL;
	cairo_rectangle_int_t _tmp6_;
	cairo_region_t* _tmp7_;
	cairo_region_t* _tmp8_;
	graphene_point_t _tmp9_;
	graphene_point_t _tmp10_;
	CoglTexture* texture = NULL;
	MetaCursorTracker* _tmp12_;
	CoglTexture* _tmp13_;
	CoglTexture* _tmp14_;
	gint width = 0;
	CoglTexture* _tmp16_;
	gint height = 0;
	CoglTexture* _tmp17_;
	guint8* data = NULL;
	guint8* _tmp18_;
	gint data_length1;
	gint _data_size_;
	CoglTexture* _tmp19_;
	guint8* _tmp20_;
	gint _tmp20__length1;
	cairo_surface_t* cursor_image = NULL;
	guint8* _tmp21_;
	gint _tmp21__length1;
	cairo_surface_t* _tmp22_;
	cairo_surface_t* target = NULL;
	cairo_rectangle_int_t _tmp23_;
	cairo_rectangle_int_t _tmp24_;
	cairo_surface_t* _tmp25_;
	cairo_t* cr = NULL;
	cairo_surface_t* _tmp26_;
	cairo_t* _tmp27_;
	cairo_t* _tmp28_;
	cairo_t* _tmp29_;
	cairo_t* _tmp30_;
	cairo_t* _tmp31_;
	cairo_t* _tmp32_;
	cairo_surface_t* _tmp33_;
	graphene_point_t _tmp34_;
	cairo_rectangle_int_t _tmp35_;
	graphene_point_t _tmp36_;
	cairo_rectangle_int_t _tmp37_;
	cairo_t* _tmp38_;
	cairo_t* _tmp39_;
	cairo_surface_t* _tmp40_;
	cairo_surface_t* _tmp41_;
	cairo_surface_t* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (image != NULL, NULL);
	g_return_val_if_fail (image_rect != NULL, NULL);
	_tmp0_ = self->priv->wm;
	_tmp1_ = meta_plugin_get_display ((MetaPlugin*) _tmp0_);
	_tmp2_ = meta_cursor_tracker_get_for_display (_tmp1_);
	cursor_tracker = _tmp2_;
	coords = _tmp3_;
	_tmp4_ = cursor_tracker;
	meta_cursor_tracker_get_pointer (_tmp4_, &_tmp5_, NULL);
	coords = _tmp5_;
	_tmp6_ = *image_rect;
	_tmp7_ = cairo_region_create_rectangle (&_tmp6_);
	region = _tmp7_;
	_tmp8_ = region;
	_tmp9_ = coords;
	_tmp10_ = coords;
	if (!cairo_region_contains_point (_tmp8_, (gint) _tmp9_.x, (gint) _tmp10_.y)) {
		cairo_surface_t* _tmp11_;
		_tmp11_ = _cairo_surface_reference0 (image);
		result = _tmp11_;
		_cairo_region_destroy0 (region);
		return result;
	}
	_tmp12_ = cursor_tracker;
	_tmp13_ = meta_cursor_tracker_get_sprite (_tmp12_);
	texture = _tmp13_;
	_tmp14_ = texture;
	if (_tmp14_ == NULL) {
		cairo_surface_t* _tmp15_;
		_tmp15_ = _cairo_surface_reference0 (image);
		result = _tmp15_;
		_cairo_region_destroy0 (region);
		return result;
	}
	_tmp16_ = texture;
	width = (gint) cogl_texture_get_width (_tmp16_);
	_tmp17_ = texture;
	height = (gint) cogl_texture_get_height (_tmp17_);
	_tmp18_ = g_new0 (guint8, (width * height) * 4);
	data = _tmp18_;
	data_length1 = (width * height) * 4;
	_data_size_ = data_length1;
	_tmp19_ = texture;
	_tmp20_ = data;
	_tmp20__length1 = data_length1;
	cogl_texture_get_data (_tmp19_, COGL_PIXEL_FORMAT_RGBA_8888, (guint) 0, _tmp20_);
	_tmp21_ = data;
	_tmp21__length1 = data_length1;
	_tmp22_ = cairo_image_surface_create_for_data (_tmp21_, CAIRO_FORMAT_ARGB32, width, height, width * 4);
	cursor_image = _tmp22_;
	_tmp23_ = *image_rect;
	_tmp24_ = *image_rect;
	_tmp25_ = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, _tmp23_.width, _tmp24_.height);
	target = _tmp25_;
	_tmp26_ = target;
	_tmp27_ = cairo_create (_tmp26_);
	cr = _tmp27_;
	_tmp28_ = cr;
	cairo_set_operator (_tmp28_, CAIRO_OPERATOR_OVER);
	_tmp29_ = cr;
	cairo_set_source_surface (_tmp29_, image, (gdouble) 0, (gdouble) 0);
	_tmp30_ = cr;
	cairo_paint (_tmp30_);
	_tmp31_ = cr;
	cairo_set_operator (_tmp31_, CAIRO_OPERATOR_OVER);
	_tmp32_ = cr;
	_tmp33_ = cursor_image;
	_tmp34_ = coords;
	_tmp35_ = *image_rect;
	_tmp36_ = coords;
	_tmp37_ = *image_rect;
	cairo_set_source_surface (_tmp32_, _tmp33_, (gdouble) (_tmp34_.x - _tmp35_.x), (gdouble) (_tmp36_.y - _tmp37_.y));
	_tmp38_ = cr;
	cairo_paint (_tmp38_);
	_tmp39_ = cr;
	_tmp40_ = cairo_get_target (_tmp39_);
	_tmp41_ = _cairo_surface_reference0 ((cairo_surface_t*) _tmp40_);
	result = _tmp41_;
	_cairo_destroy0 (cr);
	_cairo_surface_destroy0 (target);
	_cairo_surface_destroy0 (cursor_image);
	data = (g_free (data), NULL);
	_cairo_region_destroy0 (region);
	return result;
}

static void
gala_screenshot_manager_wait_stage_repaint_data_free (gpointer _data)
{
	GalaScreenshotManagerWaitStageRepaintData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (GalaScreenshotManagerWaitStageRepaintData, _data_);
}

static void
gala_screenshot_manager_wait_stage_repaint (GalaScreenshotManager* self,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_)
{
	GalaScreenshotManagerWaitStageRepaintData* _data_;
	GalaScreenshotManager* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (GalaScreenshotManagerWaitStageRepaintData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gala_screenshot_manager_wait_stage_repaint_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	gala_screenshot_manager_wait_stage_repaint_co (_data_);
}

static void
gala_screenshot_manager_wait_stage_repaint_finish (GalaScreenshotManager* self,
                                                   GAsyncResult* _res_)
{
	GalaScreenshotManagerWaitStageRepaintData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block8Data*
block8_data_ref (Block8Data* _data8_)
{
	g_atomic_int_inc (&_data8_->_ref_count_);
	return _data8_;
}

static void
block8_data_unref (void * _userdata_)
{
	Block8Data* _data8_;
	_data8_ = (Block8Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data8_->_ref_count_)) {
		GalaScreenshotManager* self;
		self = _data8_->self;
		_g_object_unref0 (self);
		g_slice_free (Block8Data, _data8_);
	}
}

static gboolean
_gala_screenshot_manager_wait_stage_repaint_co_gsource_func (gpointer self)
{
	gboolean result;
	result = gala_screenshot_manager_wait_stage_repaint_co (self);
	return result;
}

static void
__lambda70_ (Block8Data* _data8_)
{
	GalaScreenshotManager* self;
	GalaWindowManager* _tmp0_;
	ClutterStage* _tmp1_;
	ClutterStage* _tmp2_;
	self = _data8_->self;
	_tmp0_ = self->priv->wm;
	_tmp1_ = gala_window_manager_get_stage (_tmp0_);
	_tmp2_ = _tmp1_;
	g_signal_handler_disconnect ((GObject*) _tmp2_, _data8_->signal_id);
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _gala_screenshot_manager_wait_stage_repaint_co_gsource_func, _data8_->_async_data_, NULL);
}

static void
___lambda70__clutter_stage_after_paint (ClutterStage* _sender,
                                        ClutterStageView* view,
                                        gpointer self)
{
	__lambda70_ (self);
}

static gboolean
gala_screenshot_manager_wait_stage_repaint_co (GalaScreenshotManagerWaitStageRepaintData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data8_ = g_slice_new0 (Block8Data);
	_data_->_data8_->_ref_count_ = 1;
	_data_->_data8_->self = g_object_ref (_data_->self);
	_data_->_data8_->_async_data_ = _data_;
	_data_->_data8_->signal_id = 0UL;
	_data_->_tmp0_ = _data_->self->priv->wm;
	_data_->_tmp1_ = gala_window_manager_get_stage (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = g_signal_connect_data (_data_->_tmp2_, "after-paint", (GCallback) ___lambda70__clutter_stage_after_paint, block8_data_ref (_data_->_data8_), (GClosureNotify) block8_data_unref, 0);
	_data_->_data8_->signal_id = _data_->_tmp3_;
	_data_->_tmp4_ = _data_->self->priv->wm;
	_data_->_tmp5_ = gala_window_manager_get_stage (_data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	clutter_actor_queue_redraw ((ClutterActor*) _data_->_tmp6_);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	block8_data_unref (_data_->_data8_);
	_data_->_data8_ = 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 GObject *
gala_screenshot_manager_constructor (GType type,
                                     guint n_construct_properties,
                                     GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GalaScreenshotManager * self;
	GSettings* _tmp0_;
	parent_class = G_OBJECT_CLASS (gala_screenshot_manager_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GALA_TYPE_SCREENSHOT_MANAGER, GalaScreenshotManager);
	_tmp0_ = g_settings_new ("org.gnome.desktop.interface");
	_g_object_unref0 (self->priv->desktop_settings);
	self->priv->desktop_settings = _tmp0_;
	return obj;
}

static void
gala_screenshot_manager_class_init (GalaScreenshotManagerClass * klass,
                                    gpointer klass_data)
{
	gala_screenshot_manager_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GalaScreenshotManager_private_offset);
	G_OBJECT_CLASS (klass)->constructor = gala_screenshot_manager_constructor;
	G_OBJECT_CLASS (klass)->finalize = gala_screenshot_manager_finalize;
}

static void
gala_screenshot_manager_instance_init (GalaScreenshotManager * self,
                                       gpointer klass)
{
	self->priv = gala_screenshot_manager_get_instance_private (self);
}

static void
gala_screenshot_manager_finalize (GObject * obj)
{
	GalaScreenshotManager * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GALA_TYPE_SCREENSHOT_MANAGER, GalaScreenshotManager);
	_g_object_unref0 (self->priv->wm);
	_g_object_unref0 (self->priv->desktop_settings);
	_g_free0 (self->priv->prev_font_regular);
	_g_free0 (self->priv->prev_font_document);
	_g_free0 (self->priv->prev_font_mono);
	G_OBJECT_CLASS (gala_screenshot_manager_parent_class)->finalize (obj);
}

static GType
gala_screenshot_manager_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GalaScreenshotManagerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gala_screenshot_manager_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GalaScreenshotManager), 0, (GInstanceInitFunc) gala_screenshot_manager_instance_init, NULL };
	GType gala_screenshot_manager_type_id;
	gala_screenshot_manager_type_id = g_type_register_static (G_TYPE_OBJECT, "GalaScreenshotManager", &g_define_type_info, 0);
	g_type_set_qdata (gala_screenshot_manager_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) gala_screenshot_manager_register_object);
	GalaScreenshotManager_private_offset = g_type_add_instance_private (gala_screenshot_manager_type_id, sizeof (GalaScreenshotManagerPrivate));
	return gala_screenshot_manager_type_id;
}

GType
gala_screenshot_manager_get_type (void)
{
	static volatile gsize gala_screenshot_manager_type_id__once = 0;
	if (g_once_init_enter (&gala_screenshot_manager_type_id__once)) {
		GType gala_screenshot_manager_type_id;
		gala_screenshot_manager_type_id = gala_screenshot_manager_get_type_once ();
		g_once_init_leave (&gala_screenshot_manager_type_id__once, gala_screenshot_manager_type_id);
	}
	return gala_screenshot_manager_type_id__once;
}

static void
_dbus_gala_screenshot_manager_flash_area (GalaScreenshotManager* self,
                                          GVariant* _parameters_,
                                          GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gint x = 0;
	GVariant* _tmp97_;
	gint y = 0;
	GVariant* _tmp98_;
	gint width = 0;
	GVariant* _tmp99_;
	gint height = 0;
	GVariant* _tmp100_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp97_ = g_variant_iter_next_value (&_arguments_iter);
	x = g_variant_get_int32 (_tmp97_);
	g_variant_unref (_tmp97_);
	_tmp98_ = g_variant_iter_next_value (&_arguments_iter);
	y = g_variant_get_int32 (_tmp98_);
	g_variant_unref (_tmp98_);
	_tmp99_ = g_variant_iter_next_value (&_arguments_iter);
	width = g_variant_get_int32 (_tmp99_);
	g_variant_unref (_tmp99_);
	_tmp100_ = g_variant_iter_next_value (&_arguments_iter);
	height = g_variant_get_int32 (_tmp100_);
	g_variant_unref (_tmp100_);
	gala_screenshot_manager_flash_area (self, x, y, width, 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_gala_screenshot_manager_screenshot (GalaScreenshotManager* self,
                                          GVariant* _parameters_,
                                          GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	GalaScreenshotManagerScreenshotReadyData* _ready_data;
	GVariant* _tmp101_;
	GVariant* _tmp102_;
	GVariant* _tmp103_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (GalaScreenshotManagerScreenshotReadyData);
	_ready_data->_invocation_ = invocation;
	_tmp101_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->include_cursor = g_variant_get_boolean (_tmp101_);
	g_variant_unref (_tmp101_);
	_tmp102_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->flash = g_variant_get_boolean (_tmp102_);
	g_variant_unref (_tmp102_);
	_tmp103_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->filename = g_variant_dup_string (_tmp103_, NULL);
	g_variant_unref (_tmp103_);
	gala_screenshot_manager_screenshot (self, _ready_data->include_cursor, _ready_data->flash, _ready_data->filename, (GAsyncReadyCallback) _dbus_gala_screenshot_manager_screenshot_ready, _ready_data);
	_error:
	;
}

static void
_dbus_gala_screenshot_manager_screenshot_ready (GObject * source_object,
                                                GAsyncResult * _res_,
                                                gpointer _user_data_)
{
	GalaScreenshotManagerScreenshotReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gboolean success = FALSE;
	gchar* filename_used = NULL;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	gala_screenshot_manager_screenshot_finish ((GalaScreenshotManager*) source_object, _res_, &success, &filename_used, &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_add_value (&_reply_builder, g_variant_new_boolean (success));
	g_variant_builder_add_value (&_reply_builder, g_variant_new_string (filename_used));
	_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_free0 (_ready_data->filename);
	_g_free0 (filename_used);
	g_slice_free (GalaScreenshotManagerScreenshotReadyData, _ready_data);
}

static void
_dbus_gala_screenshot_manager_screenshot_area (GalaScreenshotManager* self,
                                               GVariant* _parameters_,
                                               GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	GalaScreenshotManagerScreenshotAreaReadyData* _ready_data;
	GVariant* _tmp104_;
	GVariant* _tmp105_;
	GVariant* _tmp106_;
	GVariant* _tmp107_;
	GVariant* _tmp108_;
	GVariant* _tmp109_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (GalaScreenshotManagerScreenshotAreaReadyData);
	_ready_data->_invocation_ = invocation;
	_tmp104_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->x = g_variant_get_int32 (_tmp104_);
	g_variant_unref (_tmp104_);
	_tmp105_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->y = g_variant_get_int32 (_tmp105_);
	g_variant_unref (_tmp105_);
	_tmp106_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->width = g_variant_get_int32 (_tmp106_);
	g_variant_unref (_tmp106_);
	_tmp107_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->height = g_variant_get_int32 (_tmp107_);
	g_variant_unref (_tmp107_);
	_tmp108_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->flash = g_variant_get_boolean (_tmp108_);
	g_variant_unref (_tmp108_);
	_tmp109_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->filename = g_variant_dup_string (_tmp109_, NULL);
	g_variant_unref (_tmp109_);
	gala_screenshot_manager_screenshot_area (self, _ready_data->x, _ready_data->y, _ready_data->width, _ready_data->height, _ready_data->flash, _ready_data->filename, (GAsyncReadyCallback) _dbus_gala_screenshot_manager_screenshot_area_ready, _ready_data);
	_error:
	;
}

static void
_dbus_gala_screenshot_manager_screenshot_area_ready (GObject * source_object,
                                                     GAsyncResult * _res_,
                                                     gpointer _user_data_)
{
	GalaScreenshotManagerScreenshotAreaReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gboolean success = FALSE;
	gchar* filename_used = NULL;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	gala_screenshot_manager_screenshot_area_finish ((GalaScreenshotManager*) source_object, _res_, &success, &filename_used, &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_add_value (&_reply_builder, g_variant_new_boolean (success));
	g_variant_builder_add_value (&_reply_builder, g_variant_new_string (filename_used));
	_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_free0 (_ready_data->filename);
	_g_free0 (filename_used);
	g_slice_free (GalaScreenshotManagerScreenshotAreaReadyData, _ready_data);
}

static void
_dbus_gala_screenshot_manager_screenshot_area_with_cursor (GalaScreenshotManager* self,
                                                           GVariant* _parameters_,
                                                           GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	GalaScreenshotManagerScreenshotAreaWithCursorReadyData* _ready_data;
	GVariant* _tmp110_;
	GVariant* _tmp111_;
	GVariant* _tmp112_;
	GVariant* _tmp113_;
	GVariant* _tmp114_;
	GVariant* _tmp115_;
	GVariant* _tmp116_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (GalaScreenshotManagerScreenshotAreaWithCursorReadyData);
	_ready_data->_invocation_ = invocation;
	_tmp110_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->x = g_variant_get_int32 (_tmp110_);
	g_variant_unref (_tmp110_);
	_tmp111_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->y = g_variant_get_int32 (_tmp111_);
	g_variant_unref (_tmp111_);
	_tmp112_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->width = g_variant_get_int32 (_tmp112_);
	g_variant_unref (_tmp112_);
	_tmp113_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->height = g_variant_get_int32 (_tmp113_);
	g_variant_unref (_tmp113_);
	_tmp114_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->include_cursor = g_variant_get_boolean (_tmp114_);
	g_variant_unref (_tmp114_);
	_tmp115_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->flash = g_variant_get_boolean (_tmp115_);
	g_variant_unref (_tmp115_);
	_tmp116_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->filename = g_variant_dup_string (_tmp116_, NULL);
	g_variant_unref (_tmp116_);
	gala_screenshot_manager_screenshot_area_with_cursor (self, _ready_data->x, _ready_data->y, _ready_data->width, _ready_data->height, _ready_data->include_cursor, _ready_data->flash, _ready_data->filename, (GAsyncReadyCallback) _dbus_gala_screenshot_manager_screenshot_area_with_cursor_ready, _ready_data);
	_error:
	;
}

static void
_dbus_gala_screenshot_manager_screenshot_area_with_cursor_ready (GObject * source_object,
                                                                 GAsyncResult * _res_,
                                                                 gpointer _user_data_)
{
	GalaScreenshotManagerScreenshotAreaWithCursorReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gboolean success = FALSE;
	gchar* filename_used = NULL;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	gala_screenshot_manager_screenshot_area_with_cursor_finish ((GalaScreenshotManager*) source_object, _res_, &success, &filename_used, &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_add_value (&_reply_builder, g_variant_new_boolean (success));
	g_variant_builder_add_value (&_reply_builder, g_variant_new_string (filename_used));
	_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_free0 (_ready_data->filename);
	_g_free0 (filename_used);
	g_slice_free (GalaScreenshotManagerScreenshotAreaWithCursorReadyData, _ready_data);
}

static void
_dbus_gala_screenshot_manager_screenshot_window (GalaScreenshotManager* self,
                                                 GVariant* _parameters_,
                                                 GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	GalaScreenshotManagerScreenshotWindowReadyData* _ready_data;
	GVariant* _tmp117_;
	GVariant* _tmp118_;
	GVariant* _tmp119_;
	GVariant* _tmp120_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (GalaScreenshotManagerScreenshotWindowReadyData);
	_ready_data->_invocation_ = invocation;
	_tmp117_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->include_frame = g_variant_get_boolean (_tmp117_);
	g_variant_unref (_tmp117_);
	_tmp118_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->include_cursor = g_variant_get_boolean (_tmp118_);
	g_variant_unref (_tmp118_);
	_tmp119_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->flash = g_variant_get_boolean (_tmp119_);
	g_variant_unref (_tmp119_);
	_tmp120_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->filename = g_variant_dup_string (_tmp120_, NULL);
	g_variant_unref (_tmp120_);
	gala_screenshot_manager_screenshot_window (self, _ready_data->include_frame, _ready_data->include_cursor, _ready_data->flash, _ready_data->filename, (GAsyncReadyCallback) _dbus_gala_screenshot_manager_screenshot_window_ready, _ready_data);
	_error:
	;
}

static void
_dbus_gala_screenshot_manager_screenshot_window_ready (GObject * source_object,
                                                       GAsyncResult * _res_,
                                                       gpointer _user_data_)
{
	GalaScreenshotManagerScreenshotWindowReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gboolean success = FALSE;
	gchar* filename_used = NULL;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	gala_screenshot_manager_screenshot_window_finish ((GalaScreenshotManager*) source_object, _res_, &success, &filename_used, &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_add_value (&_reply_builder, g_variant_new_boolean (success));
	g_variant_builder_add_value (&_reply_builder, g_variant_new_string (filename_used));
	_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_free0 (_ready_data->filename);
	_g_free0 (filename_used);
	g_slice_free (GalaScreenshotManagerScreenshotWindowReadyData, _ready_data);
}

static void
_dbus_gala_screenshot_manager_select_area (GalaScreenshotManager* self,
                                           GVariant* _parameters_,
                                           GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	GalaScreenshotManagerSelectAreaReadyData* _ready_data;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (GalaScreenshotManagerSelectAreaReadyData);
	_ready_data->_invocation_ = invocation;
	gala_screenshot_manager_select_area (self, (GAsyncReadyCallback) _dbus_gala_screenshot_manager_select_area_ready, _ready_data);
}

static void
_dbus_gala_screenshot_manager_select_area_ready (GObject * source_object,
                                                 GAsyncResult * _res_,
                                                 gpointer _user_data_)
{
	GalaScreenshotManagerSelectAreaReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gint x = 0;
	gint y = 0;
	gint width = 0;
	gint height = 0;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	gala_screenshot_manager_select_area_finish ((GalaScreenshotManager*) source_object, _res_, &x, &y, &width, &height, &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_add_value (&_reply_builder, g_variant_new_int32 (x));
	g_variant_builder_add_value (&_reply_builder, g_variant_new_int32 (y));
	g_variant_builder_add_value (&_reply_builder, g_variant_new_int32 (width));
	g_variant_builder_add_value (&_reply_builder, g_variant_new_int32 (height));
	_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 (GalaScreenshotManagerSelectAreaReadyData, _ready_data);
}

static void
_dbus_gala_screenshot_manager_conceal_text (GalaScreenshotManager* self,
                                            GVariant* _parameters_,
                                            GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	GalaScreenshotManagerConcealTextReadyData* _ready_data;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (GalaScreenshotManagerConcealTextReadyData);
	_ready_data->_invocation_ = invocation;
	gala_screenshot_manager_conceal_text (self, (GAsyncReadyCallback) _dbus_gala_screenshot_manager_conceal_text_ready, _ready_data);
}

static void
_dbus_gala_screenshot_manager_conceal_text_ready (GObject * source_object,
                                                  GAsyncResult * _res_,
                                                  gpointer _user_data_)
{
	GalaScreenshotManagerConcealTextReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	gala_screenshot_manager_conceal_text_finish ((GalaScreenshotManager*) source_object, _res_, &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);
	_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 (GalaScreenshotManagerConcealTextReadyData, _ready_data);
}

static void
_dbus_gala_screenshot_manager_pick_color (GalaScreenshotManager* self,
                                          GVariant* _parameters_,
                                          GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	GalaScreenshotManagerPickColorReadyData* _ready_data;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (GalaScreenshotManagerPickColorReadyData);
	_ready_data->_invocation_ = invocation;
	gala_screenshot_manager_pick_color (self, (GAsyncReadyCallback) _dbus_gala_screenshot_manager_pick_color_ready, _ready_data);
}

static void
_dbus_gala_screenshot_manager_pick_color_ready (GObject * source_object,
                                                GAsyncResult * _res_,
                                                gpointer _user_data_)
{
	GalaScreenshotManagerPickColorReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	GHashTable* result;
	GVariantBuilder _tmp121_;
	GHashTableIter _tmp122_;
	gpointer _tmp123_;
	gpointer _tmp124_;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	result = gala_screenshot_manager_pick_color_finish ((GalaScreenshotManager*) source_object, _res_, &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_hash_table_iter_init (&_tmp122_, result);
	g_variant_builder_init (&_tmp121_, G_VARIANT_TYPE ("a{sv}"));
	while (g_hash_table_iter_next (&_tmp122_, &_tmp123_, &_tmp124_)) {
		gchar* _key;
		GVariant* _value;
		_key = (gchar*) _tmp123_;
		_value = (GVariant*) _tmp124_;
		g_variant_builder_add (&_tmp121_, "{?*}", g_variant_new_string (_key), g_variant_new_variant (_value));
	}
	g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp121_));
	_g_hash_table_unref0 (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);
	_error:
	g_slice_free (GalaScreenshotManagerPickColorReadyData, _ready_data);
}

static void
gala_screenshot_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, "FlashArea") == 0) {
		_dbus_gala_screenshot_manager_flash_area (object, parameters, invocation);
	} else if (strcmp (method_name, "Screenshot") == 0) {
		_dbus_gala_screenshot_manager_screenshot (object, parameters, invocation);
	} else if (strcmp (method_name, "ScreenshotArea") == 0) {
		_dbus_gala_screenshot_manager_screenshot_area (object, parameters, invocation);
	} else if (strcmp (method_name, "ScreenshotAreaWithCursor") == 0) {
		_dbus_gala_screenshot_manager_screenshot_area_with_cursor (object, parameters, invocation);
	} else if (strcmp (method_name, "ScreenshotWindow") == 0) {
		_dbus_gala_screenshot_manager_screenshot_window (object, parameters, invocation);
	} else if (strcmp (method_name, "SelectArea") == 0) {
		_dbus_gala_screenshot_manager_select_area (object, parameters, invocation);
	} else if (strcmp (method_name, "ConcealText") == 0) {
		_dbus_gala_screenshot_manager_conceal_text (object, parameters, invocation);
	} else if (strcmp (method_name, "PickColor") == 0) {
		_dbus_gala_screenshot_manager_pick_color (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
gala_screenshot_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
gala_screenshot_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;
}

guint
gala_screenshot_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 *) (&_gala_screenshot_manager_dbus_interface_info), &_gala_screenshot_manager_dbus_interface_vtable, data, _gala_screenshot_manager_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}

static void
_gala_screenshot_manager_unregister_object (gpointer user_data)
{
	gpointer* data;
	data = user_data;
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}

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

