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

/*
 * SPDX-License-Identifier: GPL-3.0-or-later
 * SPDX-FileCopyrightText: 2016 Rico Tzschichholz
 *                         2016 Santiago León O.
 *                         2025 elementary, Inc. (https://elementary.io)
 */

#include <glib-object.h>
#include <gio/gio.h>
#include "gala.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <meta/display.h>
#include <meta/window.h>
#include <clutter/clutter.h>
#include <meta/keybindings.h>
#include <glib/gi18n-lib.h>
#include <float.h>
#include <math.h>
#include <meta/meta-plugin.h>
#include <cairo-gobject.h>
#include <mtk/mtk.h>
#include <meta/meta-window-actor.h>
#include <graphene-gobject.h>
#include <glib/gstdio.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <meta/meta-selection.h>
#include <meta/meta-selection-source-memory.h>
#include <meta/meta-selection-source.h>
#include <meta/meta-sound-player.h>
#include <cogl/cogl.h>
#include <meta/meta-cursor-tracker.h>
#include <pango/pango.h>
#include <pango/pangocairo.h>
#include <meta/prefs.h>

#define GALA_SCREENSHOT_MANAGER_EXTENSION ".png"
#define GALA_SCREENSHOT_MANAGER_UNCONCEAL_TEXT_TIMEOUT 2000
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define 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;

#define GALA_TYPE_NOTIFICATIONS_MANAGER (gala_notifications_manager_get_type ())
#define GALA_NOTIFICATIONS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_TYPE_NOTIFICATIONS_MANAGER, GalaNotificationsManager))
#define GALA_NOTIFICATIONS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GALA_TYPE_NOTIFICATIONS_MANAGER, GalaNotificationsManagerClass))
#define GALA_IS_NOTIFICATIONS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_TYPE_NOTIFICATIONS_MANAGER))
#define GALA_IS_NOTIFICATIONS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GALA_TYPE_NOTIFICATIONS_MANAGER))
#define GALA_NOTIFICATIONS_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GALA_TYPE_NOTIFICATIONS_MANAGER, GalaNotificationsManagerClass))

typedef struct _GalaNotificationsManager GalaNotificationsManager;
typedef struct _GalaNotificationsManagerClass GalaNotificationsManagerClass;

#define GALA_TYPE_FILTER_MANAGER (gala_filter_manager_get_type ())
#define GALA_FILTER_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_TYPE_FILTER_MANAGER, GalaFilterManager))
#define GALA_FILTER_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GALA_TYPE_FILTER_MANAGER, GalaFilterManagerClass))
#define GALA_IS_FILTER_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_TYPE_FILTER_MANAGER))
#define GALA_IS_FILTER_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GALA_TYPE_FILTER_MANAGER))
#define GALA_FILTER_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GALA_TYPE_FILTER_MANAGER, GalaFilterManagerClass))

typedef struct _GalaFilterManager GalaFilterManager;
typedef struct _GalaFilterManagerClass GalaFilterManagerClass;
enum  {
	GALA_SCREENSHOT_MANAGER_0_PROPERTY,
	GALA_SCREENSHOT_MANAGER_WM_PROPERTY,
	GALA_SCREENSHOT_MANAGER_NOTIFICATIONS_MANAGER_PROPERTY,
	GALA_SCREENSHOT_MANAGER_FILTER_MANAGER_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 == NULL) ? NULL : (var = (g_free (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _GalaScreenshotManagerHandleScreenshotScreenShortcutData GalaScreenshotManagerHandleScreenshotScreenShortcutData;
typedef struct _GalaScreenshotManagerHandleScreenshotAreaShortcutData GalaScreenshotManagerHandleScreenshotAreaShortcutData;
typedef struct _GalaScreenshotManagerHandleScreenshotCurrentWindowShortcutData GalaScreenshotManagerHandleScreenshotCurrentWindowShortcutData;
typedef struct _GalaScreenshotManagerSendScreenshotNotificationData GalaScreenshotManagerSendScreenshotNotificationData;
#define __vala_ClutterColor_free0(var) ((var == NULL) ? NULL : (var = (_vala_ClutterColor_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 _Block9Data Block9Data;

#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;
typedef struct _Block10Data Block10Data;

#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;
typedef struct _GalaScreenshotManagerSaveImageToFileData GalaScreenshotManagerSaveImageToFileData;
#define _g_bytes_unref0(var) ((var == NULL) ? NULL : (var = (g_bytes_unref (var), NULL)))
#define _cairo_region_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_region_destroy (var), NULL)))
#define _cairo_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_destroy (var), NULL)))
typedef struct _Block11Data Block11Data;
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;
	GalaNotificationsManager* _notifications_manager;
	GalaFilterManager* _filter_manager;
	gboolean* _is_redacted_font_available;
	GSettings* desktop_settings;
	GHashTable* notifications_id_to_path;
	gchar* prev_font_regular;
	gchar* prev_font_document;
	gchar* prev_font_mono;
	guint conceal_timeout;
};

struct _GalaScreenshotManagerHandleScreenshotScreenShortcutData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GalaScreenshotManager* self;
	gboolean clipboard;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* filename;
	gchar* _tmp3_;
	gboolean success;
	gchar* filename_used;
	gchar* _tmp4_;
	gboolean _tmp5_;
	gchar* _tmp6_;
	const gchar* _tmp7_;
	GError* e;
	GError* _tmp8_;
	const gchar* _tmp9_;
	GError* _inner_error0_;
};

struct _GalaScreenshotManagerHandleScreenshotAreaShortcutData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GalaScreenshotManager* self;
	gboolean clipboard;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* filename;
	gchar* _tmp3_;
	gboolean success;
	gchar* filename_used;
	gchar* _tmp4_;
	gint x;
	gint y;
	gint w;
	gint h;
	gint _tmp5_;
	gint _tmp6_;
	gint _tmp7_;
	gint _tmp8_;
	const gchar* _tmp9_;
	gboolean _tmp10_;
	gchar* _tmp11_;
	const gchar* _tmp12_;
	GError* e;
	GError* _tmp13_;
	const gchar* _tmp14_;
	GError* _inner_error0_;
};

struct _GalaScreenshotManagerHandleScreenshotCurrentWindowShortcutData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GalaScreenshotManager* self;
	gboolean clipboard;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* filename;
	gchar* _tmp3_;
	gboolean success;
	gchar* filename_used;
	gchar* _tmp4_;
	gboolean _tmp5_;
	gchar* _tmp6_;
	const gchar* _tmp7_;
	GError* e;
	GError* _tmp8_;
	const gchar* _tmp9_;
	GError* _inner_error0_;
};

struct _GalaScreenshotManagerSendScreenshotNotificationData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GalaScreenshotManager* self;
	gchar* filename_used;
	gboolean clipboard;
	gchar** actions;
	gchar** _tmp0_;
	gint actions_length1;
	gint _actions_size_;
	GAppInfo* files_appinfo;
	GAppInfo* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	GAppInfo* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gchar** _tmp8_;
	const gchar* _tmp9_;
	guint32* notification_id;
	GalaNotificationsManager* _tmp10_;
	gchar** _tmp11_;
	gint _tmp11__length1;
	GHashTable* _tmp12_;
	GHashTable* _tmp13_;
	guint32* _tmp14_;
	guint32* _tmp15_;
	gboolean _tmp16_;
	guint32* _tmp17_;
	GHashTable* _tmp18_;
	guint32* _tmp19_;
	gchar* _tmp20_;
};

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;
	MetaDisplay* display;
	GalaWindowManager* _tmp0_;
	MetaDisplay* _tmp1_;
	gint width;
	gint height;
	MetaDisplay* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	GalaFilterManager* _tmp5_;
	cairo_surface_t* image;
	cairo_surface_t* _tmp6_;
	GalaFilterManager* _tmp7_;
	gfloat scale;
	MetaDisplay* _tmp8_;
	MetaDisplay* _tmp9_;
	cairo_surface_t* _tmp10_;
	gchar* _tmp11_;
	gboolean _tmp12_;
	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;
	GalaFilterManager* _tmp0_;
	cairo_surface_t* image;
	cairo_surface_t* _tmp1_;
	GalaFilterManager* _tmp2_;
	MtkRectangle rect;
	MtkRectangle _tmp3_;
	MetaDisplay* display;
	GalaWindowManager* _tmp4_;
	MetaDisplay* _tmp5_;
	gfloat scale;
	MetaDisplay* _tmp6_;
	MetaDisplay* _tmp7_;
	MtkRectangle _tmp8_;
	cairo_surface_t* _tmp9_;
	gchar* _tmp10_;
	gboolean _tmp11_;
	GError* _tmp12_;
	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_;
	MtkRectangle rect;
	MtkRectangle _tmp7_;
	MtkRectangle _tmp8_;
	MtkRectangle clip;
	MtkRectangle _tmp9_;
	MetaWindowActor* _tmp10_;
	gfloat _tmp11_;
	gfloat _tmp12_;
	MtkRectangle _tmp13_;
	MetaWindowActor* _tmp14_;
	gfloat _tmp15_;
	gfloat _tmp16_;
	MtkRectangle _tmp17_;
	MtkRectangle _tmp18_;
	MtkRectangle _tmp19_;
	cairo_surface_t* image;
	MetaWindowActor* _tmp20_;
	MtkRectangle _tmp21_;
	cairo_surface_t* _tmp22_;
	gfloat resource_scale;
	MetaWindowActor* _tmp23_;
	cairo_surface_t* _tmp24_;
	cairo_surface_t* _tmp25_;
	MtkRectangle _tmp26_;
	MtkRectangle _tmp27_;
	MtkRectangle _tmp28_;
	MtkRectangle _tmp29_;
	cairo_rectangle_int_t _tmp30_;
	MtkRectangle _tmp31_;
	MtkRectangle _tmp32_;
	MtkRectangle _tmp33_;
	MtkRectangle _tmp34_;
	MetaDisplay* display;
	GalaWindowManager* _tmp35_;
	MetaDisplay* _tmp36_;
	gfloat scale;
	MetaDisplay* _tmp37_;
	MetaDisplay* _tmp38_;
	MtkRectangle _tmp39_;
	cairo_surface_t* _tmp40_;
	gchar* _tmp41_;
	gboolean _tmp42_;
	GError* _inner_error0_;
};

struct _Block9Data {
	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;
	Block9Data* _data9_;
	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_;
	graphene_rect_t rect;
	GalaSelectionArea* _tmp13_;
	graphene_rect_t _tmp14_;
	graphene_rect_t _tmp15_;
	graphene_point_t _tmp16_;
	graphene_rect_t _tmp17_;
	graphene_point_t _tmp18_;
	graphene_rect_t _tmp19_;
	graphene_size_t _tmp20_;
	graphene_rect_t _tmp21_;
	graphene_size_t _tmp22_;
	GError* _inner_error0_;
};

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

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

struct _GalaScreenshotManagerPickColorData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GalaScreenshotManager* self;
	GHashTable* result;
	Block10Data* _data10_;
	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_;
	graphene_point_t picker_point;
	GalaPixelPicker* _tmp13_;
	graphene_point_t _tmp14_;
	graphene_point_t _tmp15_;
	cairo_surface_t* image;
	graphene_point_t _tmp16_;
	graphene_point_t _tmp17_;
	cairo_surface_t* _tmp18_;
	cairo_surface_t* _tmp19_;
	guchar* data;
	cairo_surface_t* _tmp20_;
	guchar* _tmp21_;
	gint data_length1;
	gint _data_size_;
	gdouble r;
	gdouble g;
	gdouble b;
	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_;
	guchar* _tmp32_;
	gint _tmp32__length1;
	guchar _tmp33_;
	GHashTable* _result_;
	GHashFunc _tmp34_;
	GEqualFunc _tmp35_;
	GHashTable* _tmp36_;
	gchar* _tmp37_;
	GVariant* _tmp38_;
	GError* _inner_error0_;
};

struct _GalaScreenshotManagerSaveImageData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GalaScreenshotManager* self;
	cairo_surface_t* image;
	gchar* filename;
	gfloat scale;
	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;
	gfloat scale;
	gchar* used_filename;
	gboolean result;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	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 _Block11Data {
	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;
	Block11Data* _data11_;
	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;

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 GType gala_notifications_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GalaNotificationsManager, g_object_unref)
VALA_EXTERN GType gala_filter_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GalaFilterManager, g_object_unref)
VALA_EXTERN GalaScreenshotManager* gala_screenshot_manager_new (GalaWindowManager* wm,
                                                    GalaNotificationsManager* notifications_manager,
                                                    GalaFilterManager* filter_manager);
VALA_EXTERN GalaScreenshotManager* gala_screenshot_manager_construct (GType object_type,
                                                          GalaWindowManager* wm,
                                                          GalaNotificationsManager* notifications_manager,
                                                          GalaFilterManager* filter_manager);
static void gala_screenshot_manager_handle_screenshot (GalaScreenshotManager* self,
                                                MetaDisplay* display,
                                                MetaWindow* window,
                                                ClutterKeyEvent* event,
                                                MetaKeyBinding* binding);
static void gala_screenshot_manager_handle_screenshot_screen_shortcut (GalaScreenshotManager* self,
                                                                gboolean clipboard,
                                                                GAsyncReadyCallback _callback_,
                                                                gpointer _user_data_);
static void gala_screenshot_manager_handle_screenshot_screen_shortcut_finish (GalaScreenshotManager* self,
                                                                       GAsyncResult* _res_);
VALA_EXTERN GalaWindowManager* gala_screenshot_manager_get_wm (GalaScreenshotManager* self);
static void gala_screenshot_manager_handle_screenshot_area_shortcut (GalaScreenshotManager* self,
                                                              gboolean clipboard,
                                                              GAsyncReadyCallback _callback_,
                                                              gpointer _user_data_);
static void gala_screenshot_manager_handle_screenshot_area_shortcut_finish (GalaScreenshotManager* self,
                                                                     GAsyncResult* _res_);
VALA_EXTERN void gala_screenshot_manager_handle_screenshot_current_window_shortcut (GalaScreenshotManager* self,
                                                                        gboolean clipboard,
                                                                        GAsyncReadyCallback _callback_,
                                                                        gpointer _user_data_);
VALA_EXTERN void gala_screenshot_manager_handle_screenshot_current_window_shortcut_finish (GalaScreenshotManager* self,
                                                                               GAsyncResult* _res_);
static gchar* gala_screenshot_manager_generate_screenshot_filename (GalaScreenshotManager* self);
static void gala_screenshot_manager_handle_screenshot_screen_shortcut_data_free (gpointer _data);
static gboolean gala_screenshot_manager_handle_screenshot_screen_shortcut_co (GalaScreenshotManagerHandleScreenshotScreenShortcutData* _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 void gala_screenshot_manager_handle_screenshot_screen_shortcut_ready (GObject* source_object,
                                                                      GAsyncResult* _res_,
                                                                      gpointer _user_data_);
static void gala_screenshot_manager_send_screenshot_notification (GalaScreenshotManager* self,
                                                           const gchar* filename_used,
                                                           GAsyncReadyCallback _callback_,
                                                           gpointer _user_data_);
static void gala_screenshot_manager_send_screenshot_notification_finish (GalaScreenshotManager* self,
                                                                  GAsyncResult* _res_);
static void gala_screenshot_manager_handle_screenshot_area_shortcut_data_free (gpointer _data);
static gboolean gala_screenshot_manager_handle_screenshot_area_shortcut_co (GalaScreenshotManagerHandleScreenshotAreaShortcutData* _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 void gala_screenshot_manager_handle_screenshot_area_shortcut_ready (GObject* source_object,
                                                                    GAsyncResult* _res_,
                                                                    gpointer _user_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 void gala_screenshot_manager_handle_screenshot_current_window_shortcut_data_free (gpointer _data);
static gboolean gala_screenshot_manager_handle_screenshot_current_window_shortcut_co (GalaScreenshotManagerHandleScreenshotCurrentWindowShortcutData* _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 void gala_screenshot_manager_handle_screenshot_current_window_shortcut_ready (GObject* source_object,
                                                                              GAsyncResult* _res_,
                                                                              gpointer _user_data_);
static void gala_screenshot_manager_send_screenshot_notification_data_free (gpointer _data);
static gboolean gala_screenshot_manager_send_screenshot_notification_co (GalaScreenshotManagerSendScreenshotNotificationData* _data_);
VALA_EXTERN GalaNotificationsManager* gala_screenshot_manager_get_notifications_manager (GalaScreenshotManager* self);
VALA_EXTERN void gala_notifications_manager_send (GalaNotificationsManager* self,
                                      const gchar* component_name,
                                      const gchar* icon,
                                      const gchar* summary,
                                      const gchar* body,
                                      gchar** actions,
                                      gint actions_length1,
                                      GHashTable* hints,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_);
VALA_EXTERN guint32* gala_notifications_manager_send_finish (GalaNotificationsManager* self,
                                                 GAsyncResult* _res_);
static void _g_free0_ (gpointer var);
static void _g_variant_unref0_ (gpointer var);
static void gala_screenshot_manager_send_screenshot_notification_ready (GObject* source_object,
                                                                 GAsyncResult* _res_,
                                                                 gpointer _user_data_);
static void gala_screenshot_manager_handle_action_invoked (GalaScreenshotManager* self,
                                                    guint32 id,
                                                    const gchar* name,
                                                    GVariant* target_value);
static void gala_screenshot_manager_open_in_photo_viewer (GalaScreenshotManager* self,
                                                   const gchar* path);
static void gala_screenshot_manager_show_in_files (GalaScreenshotManager* self,
                                            const gchar* path);
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
VALA_EXTERN void gala_screenshot_manager_flash_area (GalaScreenshotManager* self,
                                         gint x,
                                         gint y,
                                         gint width,
                                         gint height,
                                         GError** error);
static void _vala_ClutterColor_free (ClutterColor* self);
static void __lambda104_ (GalaScreenshotManager* self,
                   ClutterActor* actor);
static void ___lambda104__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);
static gboolean gala_screenshot_manager_screenshot_co (GalaScreenshotManagerScreenshotData* _data_);
VALA_EXTERN GalaFilterManager* gala_screenshot_manager_get_filter_manager (GalaScreenshotManager* self);
VALA_EXTERN void gala_filter_manager_set_pause_for_screenshot (GalaFilterManager* self,
                                                   gboolean value);
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_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_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 (GalaScreenshotManager* self,
                                         cairo_surface_t* image,
                                         const gchar* filename,
                                         gfloat scale,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_);
static gboolean gala_screenshot_manager_save_image_finish (GalaScreenshotManager* self,
                                                    GAsyncResult* _res_,
                                                    gchar** used_filename);
static void gala_screenshot_manager_play_shutter_sound (GalaScreenshotManager* self);
static void gala_screenshot_manager_screenshot_area_data_free (gpointer _data);
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_screenshot_area_with_cursor_ready (GObject* source_object,
                                                                GAsyncResult* _res_,
                                                                gpointer _user_data_);
static void gala_screenshot_manager_screenshot_window_data_free (gpointer _data);
static gboolean gala_screenshot_manager_screenshot_window_co (GalaScreenshotManagerScreenshotWindowData* _data_);
static void 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);
static gboolean gala_screenshot_manager_select_area_co (GalaScreenshotManagerSelectAreaData* _data_);
static Block9Data* block9_data_ref (Block9Data* _data9_);
static void block9_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 __lambda105_ (Block9Data* _data9_);
static gboolean _gala_screenshot_manager_select_area_co_gsource_func (gpointer self);
static void ___lambda105__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,
                                                  graphene_rect_t* result);
static gboolean gala_screenshot_manager_get_is_redacted_font_available (GalaScreenshotManager* self);
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 __lambda106_ (GalaScreenshotManager* self);
static gboolean ___lambda106__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 Block10Data* block10_data_ref (Block10Data* _data10_);
static void block10_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 __lambda107_ (Block10Data* _data10_);
static gboolean _gala_screenshot_manager_pick_color_co_gsource_func (gpointer self);
static void ___lambda107__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,
                                  graphene_point_t * result);
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,
                                                 gfloat scale,
                                                 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 (GalaScreenshotManager* self,
                                                          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_);
static GdkPixbuf* gala_screenshot_manager_pixbuf_from_surface (cairo_surface_t* image);
static void gala_screenshot_manager_save_image_to_file_ready (GObject* source_object,
                                                       GAsyncResult* _res_,
                                                       gpointer _user_data_);
static guint8* _vala_array_dup2 (guint8* self,
                          gssize length);
static void gala_screenshot_manager_wait_stage_repaint_data_free (gpointer _data);
static gboolean gala_screenshot_manager_wait_stage_repaint_co (GalaScreenshotManagerWaitStageRepaintData* _data_);
static Block11Data* block11_data_ref (Block11Data* _data11_);
static void block11_data_unref (void * _userdata_);
static void __lambda103_ (Block11Data* _data11_);
static gboolean _gala_screenshot_manager_wait_stage_repaint_co_gsource_func (gpointer self);
static void ___lambda103__clutter_stage_after_paint (ClutterStage* _sender,
                                              ClutterStageView* view,
                                              ClutterFrame* frame,
                                              gpointer self);
static void gala_screenshot_manager_set_wm (GalaScreenshotManager* self,
                                     GalaWindowManager* value);
static void gala_screenshot_manager_set_notifications_manager (GalaScreenshotManager* self,
                                                        GalaNotificationsManager* value);
static void gala_screenshot_manager_set_filter_manager (GalaScreenshotManager* self,
                                                 GalaFilterManager* value);
static gboolean* _bool_dup (gboolean* self);
static GObject * gala_screenshot_manager_constructor (GType type,
                                               guint n_construct_properties,
                                               GObjectConstructParam * construct_properties);
static void _gala_screenshot_manager_handle_screenshot_meta_key_handler_func (MetaDisplay* display,
                                                                       MetaWindow* window,
                                                                       const ClutterKeyEvent* event,
                                                                       MetaKeyBinding* binding,
                                                                       gpointer self);
static void _gala_screenshot_manager_handle_action_invoked_gala_notifications_manager_action_invoked (GalaNotificationsManager* _sender,
                                                                                               guint32 id,
                                                                                               const gchar* name,
                                                                                               GVariant* target_value,
                                                                                               gpointer self);
static void _gala_screenshot_manager___lambda108_ (GalaScreenshotManager* self,
                                            guint32 id);
static void __gala_screenshot_manager___lambda108__gala_notifications_manager_notification_closed (GalaNotificationsManager* _sender,
                                                                                            guint32 id,
                                                                                            gpointer self);
static void gala_screenshot_manager_finalize (GObject * obj);
static GType gala_screenshot_manager_get_type_once (void);
static void _vala_gala_screenshot_manager_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec);
static void _vala_gala_screenshot_manager_set_property (GObject * object,
                                                 guint property_id,
                                                 const GValue * value,
                                                 GParamSpec * pspec);
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 void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

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_construct (GType object_type,
                                   GalaWindowManager* wm,
                                   GalaNotificationsManager* notifications_manager,
                                   GalaFilterManager* filter_manager)
{
	GalaScreenshotManager * self = NULL;
	g_return_val_if_fail (wm != NULL, NULL);
	g_return_val_if_fail (notifications_manager != NULL, NULL);
	g_return_val_if_fail (filter_manager != NULL, NULL);
	self = (GalaScreenshotManager*) g_object_new (object_type, "wm", wm, "notifications-manager", notifications_manager, "filter-manager", filter_manager, NULL);
	return self;
}

GalaScreenshotManager*
gala_screenshot_manager_new (GalaWindowManager* wm,
                             GalaNotificationsManager* notifications_manager,
                             GalaFilterManager* filter_manager)
{
	return gala_screenshot_manager_construct (GALA_TYPE_SCREENSHOT_MANAGER, wm, notifications_manager, filter_manager);
}

static void
gala_screenshot_manager_handle_screenshot (GalaScreenshotManager* self,
                                           MetaDisplay* display,
                                           MetaWindow* window,
                                           ClutterKeyEvent* event,
                                           MetaKeyBinding* binding)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GQuark _tmp3_ = 0U;
	static GQuark _tmp2_label0 = 0;
	static GQuark _tmp2_label1 = 0;
	static GQuark _tmp2_label2 = 0;
	static GQuark _tmp2_label3 = 0;
	static GQuark _tmp2_label4 = 0;
	static GQuark _tmp2_label5 = 0;
	static GQuark _tmp2_label6 = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (display != NULL);
	g_return_if_fail (binding != NULL);
	_tmp0_ = meta_key_binding_get_name (binding);
	_tmp1_ = _tmp0_;
	_tmp3_ = (NULL == _tmp1_) ? 0 : g_quark_from_string (_tmp1_);
	if (_tmp3_ == ((0 != _tmp2_label0) ? _tmp2_label0 : (_tmp2_label0 = g_quark_from_static_string ("screenshot")))) {
		switch (0) {
			default:
			{
				gala_screenshot_manager_handle_screenshot_screen_shortcut (self, FALSE, NULL, NULL);
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label1) ? _tmp2_label1 : (_tmp2_label1 = g_quark_from_static_string ("interactive-screenshot")))) {
		switch (0) {
			default:
			{
				GalaWindowManager* _tmp4_;
				_tmp4_ = self->priv->_wm;
				gala_window_manager_launch_action (_tmp4_, GALA_ACTION_KEYS_INTERACTIVE_SCREENSHOT_ACTION);
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label2) ? _tmp2_label2 : (_tmp2_label2 = g_quark_from_static_string ("area-screenshot")))) {
		switch (0) {
			default:
			{
				gala_screenshot_manager_handle_screenshot_area_shortcut (self, FALSE, NULL, NULL);
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label3) ? _tmp2_label3 : (_tmp2_label3 = g_quark_from_static_string ("window-screenshot")))) {
		switch (0) {
			default:
			{
				gala_screenshot_manager_handle_screenshot_current_window_shortcut (self, FALSE, NULL, NULL);
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label4) ? _tmp2_label4 : (_tmp2_label4 = g_quark_from_static_string ("screenshot-clip")))) {
		switch (0) {
			default:
			{
				gala_screenshot_manager_handle_screenshot_screen_shortcut (self, TRUE, NULL, NULL);
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label5) ? _tmp2_label5 : (_tmp2_label5 = g_quark_from_static_string ("area-screenshot-clip")))) {
		switch (0) {
			default:
			{
				gala_screenshot_manager_handle_screenshot_area_shortcut (self, TRUE, NULL, NULL);
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label6) ? _tmp2_label6 : (_tmp2_label6 = g_quark_from_static_string ("window-screenshot-clip")))) {
		switch (0) {
			default:
			{
				gala_screenshot_manager_handle_screenshot_current_window_shortcut (self, TRUE, NULL, NULL);
				break;
			}
		}
	}
}

static gchar*
gala_screenshot_manager_generate_screenshot_filename (GalaScreenshotManager* self)
{
	gchar* date_time = NULL;
	GDateTime* _tmp0_;
	GDateTime* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_date_time_new_now_local ();
	_tmp1_ = _tmp0_;
	_tmp2_ = g_date_time_format (_tmp1_, "%Y-%m-%d %H.%M.%S");
	_tmp3_ = _tmp2_;
	_g_date_time_unref0 (_tmp1_);
	date_time = _tmp3_;
	_tmp4_ = g_strdup_printf (_ ("Screenshot from %s"), date_time);
	result = _tmp4_;
	_g_free0 (date_time);
	return result;
}

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

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

static void
gala_screenshot_manager_handle_screenshot_screen_shortcut (GalaScreenshotManager* self,
                                                           gboolean clipboard,
                                                           GAsyncReadyCallback _callback_,
                                                           gpointer _user_data_)
{
	GalaScreenshotManagerHandleScreenshotScreenShortcutData* _data_;
	GalaScreenshotManager* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (GalaScreenshotManagerHandleScreenshotScreenShortcutData);
	_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_handle_screenshot_screen_shortcut_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->clipboard = clipboard;
	gala_screenshot_manager_handle_screenshot_screen_shortcut_co (_data_);
}

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

static void
gala_screenshot_manager_handle_screenshot_screen_shortcut_ready (GObject* source_object,
                                                                 GAsyncResult* _res_,
                                                                 gpointer _user_data_)
{
	GalaScreenshotManagerHandleScreenshotScreenShortcutData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	gala_screenshot_manager_handle_screenshot_screen_shortcut_co (_data_);
}

static gboolean
gala_screenshot_manager_handle_screenshot_screen_shortcut_co (GalaScreenshotManagerHandleScreenshotScreenShortcutData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		if (_data_->clipboard) {
			_data_->_tmp1_ = g_strdup ("");
			_g_free0 (_data_->_tmp0_);
			_data_->_tmp0_ = _data_->_tmp1_;
		} else {
			_data_->_tmp2_ = gala_screenshot_manager_generate_screenshot_filename (_data_->self);
			_g_free0 (_data_->_tmp0_);
			_data_->_tmp0_ = _data_->_tmp2_;
		}
		_data_->_tmp3_ = g_strdup (_data_->_tmp0_);
		_data_->filename = _data_->_tmp3_;
		_data_->success = FALSE;
		_data_->_tmp4_ = g_strdup ("");
		_data_->filename_used = _data_->_tmp4_;
		_data_->_tmp5_ = FALSE;
		_data_->_tmp6_ = NULL;
		_data_->_state_ = 1;
		gala_screenshot_manager_screenshot (_data_->self, FALSE, TRUE, _data_->filename, gala_screenshot_manager_handle_screenshot_screen_shortcut_ready, _data_);
		return FALSE;
		_state_1:
		gala_screenshot_manager_screenshot_finish (_data_->self, _data_->_res_, &_data_->_tmp5_, &_data_->_tmp6_, &_data_->_inner_error0_);
		_data_->success = _data_->_tmp5_;
		_g_free0 (_data_->filename_used);
		_data_->filename_used = _data_->_tmp6_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_free0 (_data_->filename_used);
			_g_free0 (_data_->filename);
			_g_free0 (_data_->_tmp0_);
			goto __catch0_g_error;
		}
		if (_data_->success) {
			_data_->_tmp7_ = _data_->filename_used;
			gala_screenshot_manager_send_screenshot_notification (_data_->self, _data_->_tmp7_, NULL, NULL);
		}
		_g_free0 (_data_->filename_used);
		_g_free0 (_data_->filename);
		_g_free0 (_data_->_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp8_ = _data_->e;
		_data_->_tmp9_ = _data_->_tmp8_->message;
		g_warning ("ScreenshotManager.vala:117: %s", _data_->_tmp9_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != 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;
	}
	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_handle_screenshot_area_shortcut_data_free (gpointer _data)
{
	GalaScreenshotManagerHandleScreenshotAreaShortcutData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (GalaScreenshotManagerHandleScreenshotAreaShortcutData, _data_);
}

static void
gala_screenshot_manager_handle_screenshot_area_shortcut (GalaScreenshotManager* self,
                                                         gboolean clipboard,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_)
{
	GalaScreenshotManagerHandleScreenshotAreaShortcutData* _data_;
	GalaScreenshotManager* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (GalaScreenshotManagerHandleScreenshotAreaShortcutData);
	_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_handle_screenshot_area_shortcut_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->clipboard = clipboard;
	gala_screenshot_manager_handle_screenshot_area_shortcut_co (_data_);
}

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

static void
gala_screenshot_manager_handle_screenshot_area_shortcut_ready (GObject* source_object,
                                                               GAsyncResult* _res_,
                                                               gpointer _user_data_)
{
	GalaScreenshotManagerHandleScreenshotAreaShortcutData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	gala_screenshot_manager_handle_screenshot_area_shortcut_co (_data_);
}

static gboolean
gala_screenshot_manager_handle_screenshot_area_shortcut_co (GalaScreenshotManagerHandleScreenshotAreaShortcutData* _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:
	{
		if (_data_->clipboard) {
			_data_->_tmp1_ = g_strdup ("");
			_g_free0 (_data_->_tmp0_);
			_data_->_tmp0_ = _data_->_tmp1_;
		} else {
			_data_->_tmp2_ = gala_screenshot_manager_generate_screenshot_filename (_data_->self);
			_g_free0 (_data_->_tmp0_);
			_data_->_tmp0_ = _data_->_tmp2_;
		}
		_data_->_tmp3_ = g_strdup (_data_->_tmp0_);
		_data_->filename = _data_->_tmp3_;
		_data_->success = FALSE;
		_data_->_tmp4_ = g_strdup ("");
		_data_->filename_used = _data_->_tmp4_;
		_data_->_tmp5_ = 0;
		_data_->_tmp6_ = 0;
		_data_->_tmp7_ = 0;
		_data_->_tmp8_ = 0;
		_data_->_state_ = 1;
		gala_screenshot_manager_select_area (_data_->self, gala_screenshot_manager_handle_screenshot_area_shortcut_ready, _data_);
		return FALSE;
		_state_1:
		gala_screenshot_manager_select_area_finish (_data_->self, _data_->_res_, &_data_->_tmp5_, &_data_->_tmp6_, &_data_->_tmp7_, &_data_->_tmp8_, &_data_->_inner_error0_);
		_data_->x = _data_->_tmp5_;
		_data_->y = _data_->_tmp6_;
		_data_->w = _data_->_tmp7_;
		_data_->h = _data_->_tmp8_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_free0 (_data_->filename_used);
			_g_free0 (_data_->filename);
			_g_free0 (_data_->_tmp0_);
			goto __catch0_g_error;
		}
		_data_->_tmp9_ = _data_->filename;
		_data_->_tmp10_ = FALSE;
		_data_->_tmp11_ = NULL;
		_data_->_state_ = 2;
		gala_screenshot_manager_screenshot_area (_data_->self, _data_->x, _data_->y, _data_->w, _data_->h, TRUE, _data_->_tmp9_, gala_screenshot_manager_handle_screenshot_area_shortcut_ready, _data_);
		return FALSE;
		_state_2:
		gala_screenshot_manager_screenshot_area_finish (_data_->self, _data_->_res_, &_data_->_tmp10_, &_data_->_tmp11_, &_data_->_inner_error0_);
		_data_->success = _data_->_tmp10_;
		_g_free0 (_data_->filename_used);
		_data_->filename_used = _data_->_tmp11_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_free0 (_data_->filename_used);
			_g_free0 (_data_->filename);
			_g_free0 (_data_->_tmp0_);
			goto __catch0_g_error;
		}
		if (_data_->success) {
			_data_->_tmp12_ = _data_->filename_used;
			gala_screenshot_manager_send_screenshot_notification (_data_->self, _data_->_tmp12_, NULL, NULL);
		}
		_g_free0 (_data_->filename_used);
		_g_free0 (_data_->filename);
		_g_free0 (_data_->_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp13_ = _data_->e;
		_data_->_tmp14_ = _data_->_tmp13_->message;
		g_warning ("ScreenshotManager.vala:135: %s", _data_->_tmp14_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != 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;
	}
	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_handle_screenshot_current_window_shortcut_data_free (gpointer _data)
{
	GalaScreenshotManagerHandleScreenshotCurrentWindowShortcutData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (GalaScreenshotManagerHandleScreenshotCurrentWindowShortcutData, _data_);
}

void
gala_screenshot_manager_handle_screenshot_current_window_shortcut (GalaScreenshotManager* self,
                                                                   gboolean clipboard,
                                                                   GAsyncReadyCallback _callback_,
                                                                   gpointer _user_data_)
{
	GalaScreenshotManagerHandleScreenshotCurrentWindowShortcutData* _data_;
	GalaScreenshotManager* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (GalaScreenshotManagerHandleScreenshotCurrentWindowShortcutData);
	_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_handle_screenshot_current_window_shortcut_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->clipboard = clipboard;
	gala_screenshot_manager_handle_screenshot_current_window_shortcut_co (_data_);
}

void
gala_screenshot_manager_handle_screenshot_current_window_shortcut_finish (GalaScreenshotManager* self,
                                                                          GAsyncResult* _res_)
{
	GalaScreenshotManagerHandleScreenshotCurrentWindowShortcutData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
gala_screenshot_manager_handle_screenshot_current_window_shortcut_ready (GObject* source_object,
                                                                         GAsyncResult* _res_,
                                                                         gpointer _user_data_)
{
	GalaScreenshotManagerHandleScreenshotCurrentWindowShortcutData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	gala_screenshot_manager_handle_screenshot_current_window_shortcut_co (_data_);
}

static gboolean
gala_screenshot_manager_handle_screenshot_current_window_shortcut_co (GalaScreenshotManagerHandleScreenshotCurrentWindowShortcutData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		if (_data_->clipboard) {
			_data_->_tmp1_ = g_strdup ("");
			_g_free0 (_data_->_tmp0_);
			_data_->_tmp0_ = _data_->_tmp1_;
		} else {
			_data_->_tmp2_ = gala_screenshot_manager_generate_screenshot_filename (_data_->self);
			_g_free0 (_data_->_tmp0_);
			_data_->_tmp0_ = _data_->_tmp2_;
		}
		_data_->_tmp3_ = g_strdup (_data_->_tmp0_);
		_data_->filename = _data_->_tmp3_;
		_data_->success = FALSE;
		_data_->_tmp4_ = g_strdup ("");
		_data_->filename_used = _data_->_tmp4_;
		_data_->_tmp5_ = FALSE;
		_data_->_tmp6_ = NULL;
		_data_->_state_ = 1;
		gala_screenshot_manager_screenshot_window (_data_->self, TRUE, FALSE, TRUE, _data_->filename, gala_screenshot_manager_handle_screenshot_current_window_shortcut_ready, _data_);
		return FALSE;
		_state_1:
		gala_screenshot_manager_screenshot_window_finish (_data_->self, _data_->_res_, &_data_->_tmp5_, &_data_->_tmp6_, &_data_->_inner_error0_);
		_data_->success = _data_->_tmp5_;
		_g_free0 (_data_->filename_used);
		_data_->filename_used = _data_->_tmp6_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_free0 (_data_->filename_used);
			_g_free0 (_data_->filename);
			_g_free0 (_data_->_tmp0_);
			goto __catch0_g_error;
		}
		if (_data_->success) {
			_data_->_tmp7_ = _data_->filename_used;
			gala_screenshot_manager_send_screenshot_notification (_data_->self, _data_->_tmp7_, NULL, NULL);
		}
		_g_free0 (_data_->filename_used);
		_g_free0 (_data_->filename);
		_g_free0 (_data_->_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp8_ = _data_->e;
		_data_->_tmp9_ = _data_->_tmp8_->message;
		g_warning ("ScreenshotManager.vala:151: %s", _data_->_tmp9_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != 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;
	}
	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_send_screenshot_notification_data_free (gpointer _data)
{
	GalaScreenshotManagerSendScreenshotNotificationData* _data_;
	_data_ = _data;
	_g_free0 (_data_->filename_used);
	_g_object_unref0 (_data_->self);
	g_slice_free (GalaScreenshotManagerSendScreenshotNotificationData, _data_);
}

static void
gala_screenshot_manager_send_screenshot_notification (GalaScreenshotManager* self,
                                                      const gchar* filename_used,
                                                      GAsyncReadyCallback _callback_,
                                                      gpointer _user_data_)
{
	GalaScreenshotManagerSendScreenshotNotificationData* _data_;
	GalaScreenshotManager* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (filename_used != NULL);
	_data_ = g_slice_new0 (GalaScreenshotManagerSendScreenshotNotificationData);
	_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_send_screenshot_notification_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (filename_used);
	_g_free0 (_data_->filename_used);
	_data_->filename_used = _tmp1_;
	gala_screenshot_manager_send_screenshot_notification_co (_data_);
}

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

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 void
gala_screenshot_manager_send_screenshot_notification_ready (GObject* source_object,
                                                            GAsyncResult* _res_,
                                                            gpointer _user_data_)
{
	GalaScreenshotManagerSendScreenshotNotificationData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	gala_screenshot_manager_send_screenshot_notification_co (_data_);
}

static gboolean
gala_screenshot_manager_send_screenshot_notification_co (GalaScreenshotManagerSendScreenshotNotificationData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->clipboard = g_strcmp0 (_data_->filename_used, "") == 0;
	_data_->_tmp0_ = g_new0 (gchar*, 0 + 1);
	_data_->actions = _data_->_tmp0_;
	_data_->actions_length1 = 0;
	_data_->_actions_size_ = _data_->actions_length1;
	if (!_data_->clipboard) {
		_data_->_tmp1_ = g_app_info_get_default_for_type ("inode/directory", TRUE);
		_data_->files_appinfo = _data_->_tmp1_;
		_data_->_tmp2_ = g_strdup ("default");
		_data_->_tmp3_ = g_strdup ("");
		_data_->_tmp4_ = g_strdup ("show-in-files");
		_data_->_tmp5_ = _data_->files_appinfo;
		_data_->_tmp6_ = g_app_info_get_display_name (_data_->_tmp5_);
		_data_->_tmp7_ = g_strdup_printf (_ ("Show in %s"), _data_->_tmp6_);
		_data_->_tmp8_ = g_new0 (gchar*, 4 + 1);
		_data_->_tmp8_[0] = _data_->_tmp2_;
		_data_->_tmp8_[1] = _data_->_tmp3_;
		_data_->_tmp8_[2] = _data_->_tmp4_;
		_data_->_tmp8_[3] = _data_->_tmp7_;
		_data_->actions = (_vala_array_free (_data_->actions, _data_->actions_length1, (GDestroyNotify) g_free), NULL);
		_data_->actions = _data_->_tmp8_;
		_data_->actions_length1 = 4;
		_data_->_actions_size_ = _data_->actions_length1;
		_g_object_unref0 (_data_->files_appinfo);
	}
	if (_data_->clipboard) {
		_data_->_tmp9_ = _ ("Screenshot is saved to clipboard");
	} else {
		_data_->_tmp9_ = _ ("Screenshot saved to screenshots folder");
	}
	_data_->_tmp10_ = _data_->self->priv->_notifications_manager;
	_data_->_tmp11_ = _data_->actions;
	_data_->_tmp11__length1 = _data_->actions_length1;
	_data_->_tmp12_ = g_hash_table_new_full (NULL, NULL, _g_free0_, _g_variant_unref0_);
	_data_->_tmp13_ = _data_->_tmp12_;
	_data_->_state_ = 1;
	gala_notifications_manager_send (_data_->_tmp10_, "ScreenshotManager", "image-x-generic", _ ("Screenshot taken"), _data_->_tmp9_, _data_->_tmp11_, (gint) _data_->_tmp11__length1, _data_->_tmp13_, gala_screenshot_manager_send_screenshot_notification_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp14_ = gala_notifications_manager_send_finish (_data_->_tmp10_, _data_->_res_);
	_data_->_tmp15_ = _data_->_tmp14_;
	_g_hash_table_unref0 (_data_->_tmp13_);
	_data_->notification_id = _data_->_tmp15_;
	_data_->_tmp17_ = _data_->notification_id;
	if (_data_->_tmp17_ != NULL) {
		_data_->_tmp16_ = !_data_->clipboard;
	} else {
		_data_->_tmp16_ = FALSE;
	}
	if (_data_->_tmp16_) {
		_data_->_tmp18_ = _data_->self->priv->notifications_id_to_path;
		_data_->_tmp19_ = _data_->notification_id;
		_data_->_tmp20_ = g_strdup (_data_->filename_used);
		g_hash_table_insert (_data_->_tmp18_, (gpointer) ((guintptr) (*_data_->_tmp19_)), _data_->_tmp20_);
	}
	_g_free0 (_data_->notification_id);
	_data_->actions = (_vala_array_free (_data_->actions, _data_->actions_length1, (GDestroyNotify) g_free), 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_handle_action_invoked (GalaScreenshotManager* self,
                                               guint32 id,
                                               const gchar* name,
                                               GVariant* target_value)
{
	gchar* path = NULL;
	GHashTable* _tmp0_;
	gconstpointer _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	GQuark _tmp6_ = 0U;
	static GQuark _tmp5_label0 = 0;
	static GQuark _tmp5_label1 = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	_tmp0_ = self->priv->notifications_id_to_path;
	_tmp1_ = g_hash_table_lookup (_tmp0_, (gpointer) ((guintptr) id));
	_tmp2_ = g_strdup ((const gchar*) _tmp1_);
	path = _tmp2_;
	_tmp3_ = path;
	if (_tmp3_ == NULL) {
		_g_free0 (path);
		return;
	}
	_tmp4_ = name;
	_tmp6_ = (NULL == _tmp4_) ? 0 : g_quark_from_string (_tmp4_);
	if (_tmp6_ == ((0 != _tmp5_label0) ? _tmp5_label0 : (_tmp5_label0 = g_quark_from_static_string ("default")))) {
		switch (0) {
			default:
			{
				const gchar* _tmp7_;
				_tmp7_ = path;
				gala_screenshot_manager_open_in_photo_viewer (self, _tmp7_);
				break;
			}
		}
	} else if (_tmp6_ == ((0 != _tmp5_label1) ? _tmp5_label1 : (_tmp5_label1 = g_quark_from_static_string ("show-in-files")))) {
		switch (0) {
			default:
			{
				const gchar* _tmp8_;
				_tmp8_ = path;
				gala_screenshot_manager_show_in_files (self, _tmp8_);
				break;
			}
		}
	}
	_g_free0 (path);
}

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

static inline void
_g_list_free__g_object_unref0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) _g_object_unref0_);
}

static void
gala_screenshot_manager_open_in_photo_viewer (GalaScreenshotManager* self,
                                              const gchar* path)
{
	GList* files_list = NULL;
	GFile* _tmp0_;
	GAppInfo* photos_appinfo = NULL;
	GAppInfo* _tmp1_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (path != NULL);
	files_list = NULL;
	_tmp0_ = g_file_new_for_path (path);
	files_list = g_list_append (files_list, _tmp0_);
	_tmp1_ = g_app_info_get_default_for_type ("image/png", TRUE);
	photos_appinfo = _tmp1_;
	{
		g_app_info_launch (photos_appinfo, files_list, NULL, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp2_;
		const gchar* _tmp3_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp2_ = e;
		_tmp3_ = _tmp2_->message;
		g_warning ("ScreenshotManager.vala:211: %s", _tmp3_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (photos_appinfo);
		(files_list == NULL) ? NULL : (files_list = (_g_list_free__g_object_unref0_ (files_list), NULL));
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_g_object_unref0 (photos_appinfo);
	(files_list == NULL) ? NULL : (files_list = (_g_list_free__g_object_unref0_ (files_list), NULL));
}

static void
gala_screenshot_manager_show_in_files (GalaScreenshotManager* self,
                                       const gchar* path)
{
	GList* files_list = NULL;
	GFile* _tmp0_;
	GAppInfo* files_appinfo = NULL;
	GAppInfo* _tmp1_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (path != NULL);
	files_list = NULL;
	_tmp0_ = g_file_new_for_path (path);
	files_list = g_list_append (files_list, _tmp0_);
	_tmp1_ = g_app_info_get_default_for_type ("inode/directory", TRUE);
	files_appinfo = _tmp1_;
	{
		g_app_info_launch (files_appinfo, files_list, NULL, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp2_;
		const gchar* _tmp3_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp2_ = e;
		_tmp3_ = _tmp2_->message;
		g_warning ("ScreenshotManager.vala:224: %s", _tmp3_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (files_appinfo);
		(files_list == NULL) ? NULL : (files_list = (_g_list_free__g_object_unref0_ (files_list), NULL));
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_g_object_unref0 (files_appinfo);
	(files_list == NULL) ? NULL : (files_list = (_g_list_free__g_object_unref0_ (files_list), NULL));
}

static ClutterColor*
_vala_clutter_color_from_pixel (guint32 pixel)
{
	ClutterColor* color = NULL;
	ClutterColor* _tmp0_;
	ClutterColor* result;
	_tmp0_ = clutter_color_alloc ();
	color = _tmp0_;
	clutter_color_from_pixel (color, pixel);
	result = color;
	return result;
}

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

static void
__lambda104_ (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_ui_group (_tmp0_);
	_tmp2_ = _tmp1_;
	clutter_actor_remove_child (_tmp2_, actor);
	clutter_actor_destroy (actor);
}

static void
___lambda104__clutter_actor_transitions_completed (ClutterActor* _sender,
                                                   gpointer self)
{
	__lambda104_ ((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_;
	ClutterColor* _tmp7_;
	ClutterColor* _tmp8_;
	GalaWindowManager* _tmp9_;
	ClutterActor* _tmp10_;
	ClutterActor* _tmp11_;
	g_return_if_fail (self != NULL);
	g_debug ("ScreenshotManager.vala:229: 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);
	_tmp7_ = _vala_clutter_color_from_pixel ((guint32) 0xffffffffU);
	_tmp8_ = _tmp7_;
	clutter_actor_set_background_color (flash_actor, _tmp8_);
	__vala_ClutterColor_free0 (_tmp8_);
	clutter_actor_set_opacity (flash_actor, (guint8) 0);
	g_signal_connect_object (flash_actor, "transitions-completed", (GCallback) ___lambda104__clutter_actor_transitions_completed, self, 0);
	_tmp9_ = self->priv->_wm;
	_tmp10_ = gala_window_manager_get_ui_group (_tmp9_);
	_tmp11_ = _tmp10_;
	clutter_actor_add_child (_tmp11_, 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;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	g_debug ("ScreenshotManager.vala:264: Taking screenshot");
	_data_->_tmp0_ = _data_->self->priv->_wm;
	_data_->_tmp1_ = meta_plugin_get_display ((MetaPlugin*) _data_->_tmp0_);
	_data_->display = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->display;
	_data_->_tmp3_ = 0;
	_data_->_tmp4_ = 0;
	meta_display_get_size (_data_->_tmp2_, &_data_->_tmp3_, &_data_->_tmp4_);
	_data_->width = _data_->_tmp3_;
	_data_->height = _data_->_tmp4_;
	_data_->_tmp5_ = _data_->self->priv->_filter_manager;
	gala_filter_manager_set_pause_for_screenshot (_data_->_tmp5_, TRUE);
	_data_->_state_ = 1;
	gala_screenshot_manager_wait_stage_repaint (_data_->self, gala_screenshot_manager_screenshot_ready, _data_);
	return FALSE;
	_state_1:
	gala_screenshot_manager_wait_stage_repaint_finish (_data_->self, _data_->_res_);
	_data_->_tmp6_ = gala_screenshot_manager_take_screenshot (_data_->self, 0, 0, _data_->width, _data_->height, _data_->include_cursor);
	_data_->image = _data_->_tmp6_;
	gala_screenshot_manager_unconceal_text (_data_->self);
	_data_->_tmp7_ = _data_->self->priv->_filter_manager;
	gala_filter_manager_set_pause_for_screenshot (_data_->_tmp7_, FALSE);
	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_->_tmp8_ = _data_->display;
	_data_->_tmp9_ = _data_->display;
	_data_->scale = meta_display_get_monitor_scale (_data_->_tmp8_, meta_display_get_primary_monitor (_data_->_tmp9_));
	_data_->_tmp10_ = _data_->image;
	_data_->_tmp11_ = NULL;
	_data_->_state_ = 2;
	gala_screenshot_manager_save_image (_data_->self, _data_->_tmp10_, _data_->filename, _data_->scale, gala_screenshot_manager_screenshot_ready, _data_);
	return FALSE;
	_state_2:
	_data_->_tmp12_ = gala_screenshot_manager_save_image_finish (_data_->self, _data_->_res_, &_data_->_tmp11_);
	_g_free0 (_data_->filename_used);
	_data_->filename_used = _data_->_tmp11_;
	_data_->success = _data_->_tmp12_;
	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:296: Taking area screenshot");
	_data_->_tmp0_ = _data_->self->priv->_filter_manager;
	gala_filter_manager_set_pause_for_screenshot (_data_->_tmp0_, TRUE);
	_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_->_tmp1_ = gala_screenshot_manager_take_screenshot (_data_->self, _data_->x, _data_->y, _data_->width, _data_->height, _data_->include_cursor);
	_data_->image = _data_->_tmp1_;
	gala_screenshot_manager_unconceal_text (_data_->self);
	_data_->_tmp2_ = _data_->self->priv->_filter_manager;
	gala_filter_manager_set_pause_for_screenshot (_data_->_tmp2_, FALSE);
	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;
			}
		}
	}
	memset (&_data_->_tmp3_, 0, sizeof (MtkRectangle));
	_data_->_tmp3_.x = _data_->x;
	_data_->_tmp3_.y = _data_->y;
	_data_->_tmp3_.width = _data_->width;
	_data_->_tmp3_.height = _data_->height;
	_data_->rect = _data_->_tmp3_;
	_data_->_tmp4_ = _data_->self->priv->_wm;
	_data_->_tmp5_ = meta_plugin_get_display ((MetaPlugin*) _data_->_tmp4_);
	_data_->display = _data_->_tmp5_;
	_data_->_tmp6_ = _data_->display;
	_data_->_tmp7_ = _data_->display;
	_data_->_tmp8_ = _data_->rect;
	_data_->scale = meta_display_get_monitor_scale (_data_->_tmp6_, meta_display_get_monitor_index_for_rect (_data_->_tmp7_, &_data_->_tmp8_));
	_data_->_tmp9_ = _data_->image;
	_data_->_tmp10_ = NULL;
	_data_->_state_ = 2;
	gala_screenshot_manager_save_image (_data_->self, _data_->_tmp9_, _data_->filename, _data_->scale, gala_screenshot_manager_screenshot_area_with_cursor_ready, _data_);
	return FALSE;
	_state_2:
	_data_->_tmp11_ = gala_screenshot_manager_save_image_finish (_data_->self, _data_->_res_, &_data_->_tmp10_);
	_g_free0 (_data_->filename_used);
	_data_->filename_used = _data_->_tmp10_;
	_data_->success = _data_->_tmp11_;
	if (_data_->success) {
		gala_screenshot_manager_play_shutter_sound (_data_->self);
	} else {
		_data_->_tmp12_ = g_error_new_literal (G_DBUS_ERROR, G_DBUS_ERROR_FAILED, "Failed to save image");
		_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_);
			_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:324: 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_;
	memset (&_data_->_tmp7_, 0, sizeof (MtkRectangle));
	meta_window_get_buffer_rect (_data_->window, &_data_->_tmp7_);
	_data_->rect = _data_->_tmp7_;
	if (!_data_->include_frame) {
		memset (&_data_->_tmp8_, 0, sizeof (MtkRectangle));
		meta_window_get_frame_rect (_data_->window, &_data_->_tmp8_);
		_data_->rect = _data_->_tmp8_;
	}
	_data_->_tmp9_ = _data_->rect;
	_data_->_tmp10_ = _data_->window_actor;
	_data_->_tmp11_ = clutter_actor_get_x ((ClutterActor*) _data_->_tmp10_);
	_data_->_tmp12_ = _data_->_tmp11_;
	_data_->_tmp13_ = _data_->rect;
	_data_->_tmp14_ = _data_->window_actor;
	_data_->_tmp15_ = clutter_actor_get_y ((ClutterActor*) _data_->_tmp14_);
	_data_->_tmp16_ = _data_->_tmp15_;
	_data_->_tmp17_ = _data_->rect;
	_data_->_tmp18_ = _data_->rect;
	memset (&_data_->_tmp19_, 0, sizeof (MtkRectangle));
	_data_->_tmp19_.x = _data_->_tmp9_.x - ((gint) _data_->_tmp12_);
	_data_->_tmp19_.y = _data_->_tmp13_.y - ((gint) _data_->_tmp16_);
	_data_->_tmp19_.width = _data_->_tmp17_.width;
	_data_->_tmp19_.height = _data_->_tmp18_.height;
	_data_->clip = _data_->_tmp19_;
	_data_->_tmp20_ = _data_->window_actor;
	_data_->_tmp21_ = _data_->clip;
	_data_->_tmp22_ = meta_window_actor_get_image (_data_->_tmp20_, &_data_->_tmp21_);
	_data_->image = (cairo_surface_t*) _data_->_tmp22_;
	if (_data_->include_cursor) {
		if (meta_window_get_client_type (_data_->window) == META_WINDOW_CLIENT_TYPE_WAYLAND) {
			_data_->_tmp23_ = _data_->window_actor;
			_data_->resource_scale = clutter_actor_get_resource_scale ((ClutterActor*) _data_->_tmp23_);
			_data_->_tmp24_ = _data_->image;
			cairo_surface_set_device_scale (_data_->_tmp24_, (gdouble) _data_->resource_scale, (gdouble) _data_->resource_scale);
		}
		_data_->_tmp25_ = _data_->image;
		_data_->_tmp26_ = _data_->rect;
		_data_->_tmp27_ = _data_->rect;
		_data_->_tmp28_ = _data_->rect;
		_data_->_tmp29_ = _data_->rect;
		memset (&_data_->_tmp30_, 0, sizeof (cairo_rectangle_int_t));
		_data_->_tmp30_.x = _data_->_tmp26_.x;
		_data_->_tmp30_.y = _data_->_tmp27_.y;
		_data_->_tmp30_.width = _data_->_tmp28_.width;
		_data_->_tmp30_.height = _data_->_tmp29_.height;
		gala_screenshot_manager_composite_stage_cursor (_data_->self, _data_->_tmp25_, &_data_->_tmp30_);
	}
	gala_screenshot_manager_unconceal_text (_data_->self);
	if (_data_->flash) {
		_data_->_tmp31_ = _data_->rect;
		_data_->_tmp32_ = _data_->rect;
		_data_->_tmp33_ = _data_->rect;
		_data_->_tmp34_ = _data_->rect;
		gala_screenshot_manager_flash_area (_data_->self, _data_->_tmp31_.x, _data_->_tmp32_.y, _data_->_tmp33_.width, _data_->_tmp34_.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_->_tmp35_ = _data_->self->priv->_wm;
	_data_->_tmp36_ = meta_plugin_get_display ((MetaPlugin*) _data_->_tmp35_);
	_data_->display = _data_->_tmp36_;
	_data_->_tmp37_ = _data_->display;
	_data_->_tmp38_ = _data_->display;
	_data_->_tmp39_ = _data_->rect;
	_data_->scale = meta_display_get_monitor_scale (_data_->_tmp37_, meta_display_get_monitor_index_for_rect (_data_->_tmp38_, &_data_->_tmp39_));
	_data_->_tmp40_ = _data_->image;
	_data_->_tmp41_ = NULL;
	_data_->_state_ = 1;
	gala_screenshot_manager_save_image (_data_->self, _data_->_tmp40_, _data_->filename, _data_->scale, gala_screenshot_manager_screenshot_window_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp42_ = gala_screenshot_manager_save_image_finish (_data_->self, _data_->_res_, &_data_->_tmp41_);
	_g_free0 (_data_->filename_used);
	_data_->filename_used = _data_->_tmp41_;
	_data_->success = _data_->_tmp42_;
	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 Block9Data*
block9_data_ref (Block9Data* _data9_)
{
	g_atomic_int_inc (&_data9_->_ref_count_);
	return _data9_;
}

static void
block9_data_unref (void * _userdata_)
{
	Block9Data* _data9_;
	_data9_ = (Block9Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data9_->_ref_count_)) {
		GalaScreenshotManager* self;
		self = _data9_->self;
		_g_object_unref0 (self);
		g_slice_free (Block9Data, _data9_);
	}
}

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
__lambda105_ (Block9Data* _data9_)
{
	GalaScreenshotManager* self;
	self = _data9_->self;
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _gala_screenshot_manager_select_area_co_gsource_func, _data9_->_async_data_, NULL);
}

static void
___lambda105__gala_selection_area_closed (GalaSelectionArea* _sender,
                                          gpointer self)
{
	__lambda105_ (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_->_data9_ = g_slice_new0 (Block9Data);
	_data_->_data9_->_ref_count_ = 1;
	_data_->_data9_->self = g_object_ref (_data_->self);
	_data_->_data9_->_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) ___lambda105__gala_selection_area_closed, block9_data_ref (_data_->_data9_), (GClosureNotify) block9_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_actor_add_child (_data_->_tmp5_, (ClutterActor*) _data_->_tmp6_);
	_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);
			block9_data_unref (_data_->_data9_);
			_data_->_data9_ = NULL;
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->selection_area);
			block9_data_unref (_data_->_data9_);
			_data_->_data9_ = 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;
	memset (&_data_->_tmp14_, 0, sizeof (graphene_rect_t));
	gala_selection_area_get_selection_rectangle (_data_->_tmp13_, &_data_->_tmp14_);
	_data_->rect = _data_->_tmp14_;
	_data_->_tmp15_ = _data_->rect;
	_data_->_tmp16_ = _data_->_tmp15_.origin;
	_data_->x = (gint) roundf (_data_->_tmp16_.x);
	_data_->_tmp17_ = _data_->rect;
	_data_->_tmp18_ = _data_->_tmp17_.origin;
	_data_->y = (gint) roundf (_data_->_tmp18_.y);
	_data_->_tmp19_ = _data_->rect;
	_data_->_tmp20_ = _data_->_tmp19_.size;
	_data_->width = (gint) roundf (_data_->_tmp20_.width);
	_data_->_tmp21_ = _data_->rect;
	_data_->_tmp22_ = _data_->_tmp21_.size;
	_data_->height = (gint) roundf (_data_->_tmp22_.height);
	_g_object_unref0 (_data_->selection_area);
	block9_data_unref (_data_->_data9_);
	_data_->_data9_ = 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)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	gboolean _tmp2_;
	GSettings* _tmp3_;
	const gchar* _tmp4_;
	GSettings* _tmp5_;
	const gchar* _tmp6_;
	GSettings* _tmp7_;
	const gchar* _tmp8_;
	g_return_if_fail (self != NULL);
	_tmp1_ = gala_screenshot_manager_get_is_redacted_font_available (self);
	_tmp2_ = _tmp1_;
	if (!_tmp2_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = self->priv->conceal_timeout == ((guint) 0);
	}
	if (_tmp0_) {
		return;
	}
	_tmp3_ = self->priv->desktop_settings;
	_tmp4_ = self->priv->prev_font_regular;
	g_settings_set_string (_tmp3_, "font-name", _tmp4_);
	_tmp5_ = self->priv->desktop_settings;
	_tmp6_ = self->priv->prev_font_mono;
	g_settings_set_string (_tmp5_, "monospace-font-name", _tmp6_);
	_tmp7_ = self->priv->desktop_settings;
	_tmp8_ = self->priv->prev_font_document;
	g_settings_set_string (_tmp7_, "document-font-name", _tmp8_);
	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
__lambda106_ (GalaScreenshotManager* self)
{
	gboolean result;
	gala_screenshot_manager_unconceal_text (self);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda106__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda106_ ((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:
	_data_->_tmp0_ = gala_screenshot_manager_get_is_redacted_font_available (_data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	if (!_data_->_tmp1_) {
		_data_->_tmp2_ = g_error_new_literal (G_DBUS_ERROR, G_DBUS_ERROR_FAILED, "Redacted font is not installed.");
		_data_->_inner_error0_ = _data_->_tmp2_;
		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_unref (_data_->_async_result);
			return FALSE;
		} else {
			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;
		}
	}
	if (_data_->self->priv->conceal_timeout > ((guint) 0)) {
		g_source_remove (_data_->self->priv->conceal_timeout);
	} else {
		_data_->_tmp3_ = _data_->self->priv->desktop_settings;
		_data_->_tmp4_ = g_settings_get_string (_data_->_tmp3_, "font-name");
		_g_free0 (_data_->self->priv->prev_font_regular);
		_data_->self->priv->prev_font_regular = _data_->_tmp4_;
		_data_->_tmp5_ = _data_->self->priv->desktop_settings;
		_data_->_tmp6_ = g_settings_get_string (_data_->_tmp5_, "monospace-font-name");
		_g_free0 (_data_->self->priv->prev_font_mono);
		_data_->self->priv->prev_font_mono = _data_->_tmp6_;
		_data_->_tmp7_ = _data_->self->priv->desktop_settings;
		_data_->_tmp8_ = g_settings_get_string (_data_->_tmp7_, "document-font-name");
		_g_free0 (_data_->self->priv->prev_font_document);
		_data_->self->priv->prev_font_document = _data_->_tmp8_;
		_data_->_tmp9_ = _data_->self->priv->desktop_settings;
		g_settings_set_string (_data_->_tmp9_, "font-name", "Redacted Script Regular 9");
		_data_->_tmp10_ = _data_->self->priv->desktop_settings;
		g_settings_set_string (_data_->_tmp10_, "monospace-font-name", "Redacted Script Light 10");
		_data_->_tmp11_ = _data_->self->priv->desktop_settings;
		g_settings_set_string (_data_->_tmp11_, "document-font-name", "Redacted Script Regular 10");
	}
	_data_->self->priv->conceal_timeout = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) GALA_SCREENSHOT_MANAGER_UNCONCEAL_TEXT_TIMEOUT, ___lambda106__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 Block10Data*
block10_data_ref (Block10Data* _data10_)
{
	g_atomic_int_inc (&_data10_->_ref_count_);
	return _data10_;
}

static void
block10_data_unref (void * _userdata_)
{
	Block10Data* _data10_;
	_data10_ = (Block10Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data10_->_ref_count_)) {
		GalaScreenshotManager* self;
		self = _data10_->self;
		_g_object_unref0 (self);
		g_slice_free (Block10Data, _data10_);
	}
}

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
__lambda107_ (Block10Data* _data10_)
{
	GalaScreenshotManager* self;
	self = _data10_->self;
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _gala_screenshot_manager_pick_color_co_gsource_func, _data10_->_async_data_, NULL);
}

static void
___lambda107__gala_pixel_picker_closed (GalaPixelPicker* _sender,
                                        gpointer self)
{
	__lambda107_ (self);
}

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_->_data10_ = g_slice_new0 (Block10Data);
	_data_->_data10_->_ref_count_ = 1;
	_data_->_data10_->self = g_object_ref (_data_->self);
	_data_->_data10_->_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) ___lambda107__gala_pixel_picker_closed, block10_data_ref (_data_->_data10_), (GClosureNotify) block10_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_actor_add_child (_data_->_tmp5_, (ClutterActor*) _data_->_tmp6_);
	_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);
			block10_data_unref (_data_->_data10_);
			_data_->_data10_ = NULL;
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->pixel_picker);
			block10_data_unref (_data_->_data10_);
			_data_->_data10_ = 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_->_tmp13_ = _data_->pixel_picker;
	memset (&_data_->_tmp14_, 0, sizeof (graphene_point_t));
	gala_pixel_picker_get_point (_data_->_tmp13_, &_data_->_tmp14_);
	_data_->_tmp15_ = _data_->_tmp14_;
	_data_->picker_point = _data_->_tmp15_;
	_data_->_tmp16_ = _data_->picker_point;
	_data_->_tmp17_ = _data_->picker_point;
	_data_->_tmp18_ = gala_screenshot_manager_take_screenshot (_data_->self, (gint) roundf (_data_->_tmp16_.x), (gint) roundf (_data_->_tmp17_.y), 1, 1, FALSE);
	_data_->image = _data_->_tmp18_;
	_data_->_tmp19_ = _data_->image;
	_vala_assert (cairo_image_surface_get_format (_data_->_tmp19_) == CAIRO_FORMAT_ARGB32, "image.get_format () == Cairo.Format.ARGB32");
	_data_->_tmp20_ = _data_->image;
	_data_->_tmp21_ = cairo_image_surface_get_data (_data_->_tmp20_);
	_data_->data = _data_->_tmp21_;
	_data_->data_length1 = -1;
	_data_->_data_size_ = _data_->data_length1;
	if (G_BYTE_ORDER == G_LITTLE_ENDIAN) {
		_data_->_tmp22_ = _data_->data;
		_data_->_tmp22__length1 = _data_->data_length1;
		_data_->_tmp23_ = _data_->_tmp22_[2];
		_data_->r = (gdouble) (_data_->_tmp23_ / 255.0f);
		_data_->_tmp24_ = _data_->data;
		_data_->_tmp24__length1 = _data_->data_length1;
		_data_->_tmp25_ = _data_->_tmp24_[1];
		_data_->g = (gdouble) (_data_->_tmp25_ / 255.0f);
		_data_->_tmp26_ = _data_->data;
		_data_->_tmp26__length1 = _data_->data_length1;
		_data_->_tmp27_ = _data_->_tmp26_[0];
		_data_->b = (gdouble) (_data_->_tmp27_ / 255.0f);
	} else {
		_data_->_tmp28_ = _data_->data;
		_data_->_tmp28__length1 = _data_->data_length1;
		_data_->_tmp29_ = _data_->_tmp28_[1];
		_data_->r = (gdouble) (_data_->_tmp29_ / 255.0f);
		_data_->_tmp30_ = _data_->data;
		_data_->_tmp30__length1 = _data_->data_length1;
		_data_->_tmp31_ = _data_->_tmp30_[2];
		_data_->g = (gdouble) (_data_->_tmp31_ / 255.0f);
		_data_->_tmp32_ = _data_->data;
		_data_->_tmp32__length1 = _data_->data_length1;
		_data_->_tmp33_ = _data_->_tmp32_[3];
		_data_->b = (gdouble) (_data_->_tmp33_ / 255.0f);
	}
	_data_->_tmp34_ = g_str_hash;
	_data_->_tmp35_ = g_str_equal;
	_data_->_tmp36_ = g_hash_table_new_full (_data_->_tmp34_, _data_->_tmp35_, _g_free0_, _g_variant_unref0_);
	_data_->_result_ = _data_->_tmp36_;
	_data_->_tmp37_ = g_strdup ("color");
	_data_->_tmp38_ = g_variant_new ("(ddd)", _data_->r, _data_->g, _data_->b, NULL);
	g_variant_ref_sink (_data_->_tmp38_);
	g_hash_table_insert (_data_->_result_, _data_->_tmp37_, _data_->_tmp38_);
	_data_->result = _data_->_result_;
	_cairo_surface_destroy0 (_data_->image);
	_g_object_unref0 (_data_->pixel_picker);
	block10_data_unref (_data_->_data10_);
	_data_->_data10_ = 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_object_unref0 (_data_->self);
	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 (GalaScreenshotManager* self,
                                    cairo_surface_t* image,
                                    const gchar* filename,
                                    gfloat scale,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_)
{
	GalaScreenshotManagerSaveImageData* _data_;
	GalaScreenshotManager* _tmp0_;
	cairo_surface_t* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (image != NULL);
	g_return_if_fail (filename != NULL);
	_data_ = g_slice_new0 (GalaScreenshotManagerSaveImageData);
	_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_save_image_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _cairo_surface_reference0 (image);
	_cairo_surface_destroy0 (_data_->image);
	_data_->image = _tmp1_;
	_tmp2_ = g_strdup (filename);
	_g_free0 (_data_->filename);
	_data_->filename = _tmp2_;
	_data_->scale = scale;
	gala_screenshot_manager_save_image_co (_data_);
}

static gboolean
gala_screenshot_manager_save_image_finish (GalaScreenshotManager* self,
                                           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, _data_->scale, 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_->self, _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,
                                            gfloat scale,
                                            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_;
	_data_->scale = scale;
	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_SCREENSHOT_MANAGER_EXTENSION)) {
			_data_->_tmp3_ = _data_->used_filename;
			_data_->_tmp4_ = g_strconcat (_data_->_tmp3_, GALA_SCREENSHOT_MANAGER_EXTENSION, NULL);
			_g_free0 (_data_->used_filename);
			_data_->used_filename = _data_->_tmp4_;
		}
		if (_data_->scale > ((gfloat) 1)) {
			_data_->_tmp5_ = strlen (GALA_SCREENSHOT_MANAGER_EXTENSION);
			_data_->_tmp6_ = _data_->_tmp5_;
			_data_->scale_pos = -_data_->_tmp6_;
			_data_->_tmp7_ = _data_->used_filename;
			_data_->_tmp8_ = g_strdup_printf ("@%.1gx", (gdouble) _data_->scale);
			_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_ = gala_screenshot_manager_pixbuf_from_surface (_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:520: 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 guint8*
_vala_array_dup2 (guint8* self,
                  gssize length)
{
	if (length > 0) {
		return g_memdup2 (self, length * sizeof (guint8));
	}
	return NULL;
}

static gboolean
gala_screenshot_manager_save_image_to_clipboard (GalaScreenshotManager* self,
                                                 cairo_surface_t* image,
                                                 const gchar* filename,
                                                 gchar** used_filename)
{
	gchar* _vala_used_filename = NULL;
	gchar* _tmp0_;
	GdkPixbuf* screenshot = NULL;
	GdkPixbuf* _tmp1_;
	GdkPixbuf* _tmp2_;
	guint8* buffer = NULL;
	gint buffer_length1 = 0;
	gint _buffer_size_ = 0;
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	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_ = gala_screenshot_manager_pixbuf_from_surface (image);
	screenshot = _tmp1_;
	_tmp2_ = screenshot;
	if (_tmp2_ == NULL) {
		g_warning ("ScreenshotManager.vala:530: 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;
	}
	{
		GdkPixbuf* _tmp3_;
		guint8* _tmp4_ = NULL;
		gsize _tmp5_ = 0;
		_tmp3_ = screenshot;
		gdk_pixbuf_save_to_buffer (_tmp3_, &_tmp4_, &_tmp5_, "png", &_inner_error0_, NULL);
		buffer = (g_free (buffer), NULL);
		buffer = _tmp4_;
		buffer_length1 = _tmp5_;
		_buffer_size_ = buffer_length1;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp6_;
		const gchar* _tmp7_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp6_ = e;
		_tmp7_ = _tmp6_->message;
		g_warning ("ScreenshotManager.vala:538: Could not save screenshot to clipboard: fa" \
"iled to save image to buffer: %s", _tmp7_);
		result = FALSE;
		_g_error_free0 (e);
		buffer = (g_free (buffer), NULL);
		_g_object_unref0 (screenshot);
		if (used_filename) {
			*used_filename = _vala_used_filename;
		} else {
			_g_free0 (_vala_used_filename);
		}
		return result;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp8_ = FALSE;
		buffer = (g_free (buffer), NULL);
		_g_object_unref0 (screenshot);
		_g_free0 (_vala_used_filename);
		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 _tmp8_;
	}
	{
		MetaSelection* selection = NULL;
		GalaWindowManager* _tmp9_;
		MetaDisplay* _tmp10_;
		MetaSelection* _tmp11_;
		MetaSelectionSourceMemory* source = NULL;
		guint8* _tmp12_;
		gint _tmp12__length1;
		guint8* _tmp13_;
		gint _tmp13__length1;
		GBytes* _tmp14_;
		GBytes* _tmp15_;
		MetaSelectionSourceMemory* _tmp16_;
		MetaSelectionSourceMemory* _tmp17_;
		MetaSelection* _tmp18_;
		MetaSelectionSourceMemory* _tmp19_;
		_tmp9_ = self->priv->_wm;
		_tmp10_ = meta_plugin_get_display ((MetaPlugin*) _tmp9_);
		_tmp11_ = meta_display_get_selection (_tmp10_);
		selection = _tmp11_;
		_tmp12_ = buffer;
		_tmp12__length1 = buffer_length1;
		_tmp13_ = (_tmp12_ != NULL) ? _vala_array_dup2 (_tmp12_, _tmp12__length1) : _tmp12_;
		_tmp13__length1 = _tmp12__length1;
		_tmp14_ = g_bytes_new_take (_tmp13_, _tmp13__length1);
		_tmp15_ = _tmp14_;
		_tmp16_ = (MetaSelectionSourceMemory*) meta_selection_source_memory_new ("image/png", _tmp15_, &_inner_error0_);
		_tmp17_ = _tmp16_;
		_g_bytes_unref0 (_tmp15_);
		source = _tmp17_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch1_g_error;
		}
		_tmp18_ = selection;
		_tmp19_ = source;
		meta_selection_set_owner (_tmp18_, META_SELECTION_CLIPBOARD, (MetaSelectionSource*) _tmp19_);
		_g_object_unref0 (source);
	}
	goto __finally1;
	__catch1_g_error:
	{
		GError* e = NULL;
		GError* _tmp20_;
		const gchar* _tmp21_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp20_ = e;
		_tmp21_ = _tmp20_->message;
		g_warning ("ScreenshotManager.vala:547: Could not save screenshot to clipboard: fa" \
"iled to create new Meta.SelectionSourceMemory: %s", _tmp21_);
		result = FALSE;
		_g_error_free0 (e);
		buffer = (g_free (buffer), NULL);
		_g_object_unref0 (screenshot);
		if (used_filename) {
			*used_filename = _vala_used_filename;
		} else {
			_g_free0 (_vala_used_filename);
		}
		return result;
	}
	__finally1:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp22_ = FALSE;
		buffer = (g_free (buffer), NULL);
		_g_object_unref0 (screenshot);
		_g_free0 (_vala_used_filename);
		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 _tmp22_;
	}
	result = TRUE;
	buffer = (g_free (buffer), NULL);
	_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)
{
	GalaWindowManager* _tmp0_;
	MetaDisplay* _tmp1_;
	MetaSoundPlayer* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_wm;
	_tmp1_ = meta_plugin_get_display ((MetaPlugin*) _tmp0_);
	_tmp2_ = meta_display_get_sound_player (_tmp1_);
	meta_sound_player_play_from_theme (_tmp2_, "screen-capture", _ ("Screenshot taken"), NULL);
}

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_;
	MtkRectangle _tmp3_ = {0};
	gint _tmp4_ = 0;
	gint _tmp5_ = 0;
	gfloat _tmp6_ = 0.0F;
	cairo_surface_t* _tmp7_;
	ClutterPaintFlag _tmp8_ = 0U;
	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_;
	if (include_cursor) {
		_tmp8_ = CLUTTER_PAINT_FLAG_FORCE_CURSORS;
	} else {
		_tmp8_ = CLUTTER_PAINT_FLAG_NO_CURSORS;
	}
	paint_flags = _tmp8_;
	{
		if (G_BYTE_ORDER == G_LITTLE_ENDIAN) {
			GalaWindowManager* _tmp9_;
			ClutterStage* _tmp10_;
			ClutterStage* _tmp11_;
			MtkRectangle _tmp12_ = {0};
			cairo_surface_t* _tmp13_;
			guchar* _tmp14_;
			cairo_surface_t* _tmp15_;
			_tmp9_ = self->priv->_wm;
			_tmp10_ = gala_window_manager_get_stage (_tmp9_);
			_tmp11_ = _tmp10_;
			_tmp12_.x = x;
			_tmp12_.y = y;
			_tmp12_.width = width;
			_tmp12_.height = height;
			_tmp13_ = image;
			_tmp14_ = cairo_image_surface_get_data (_tmp13_);
			_tmp15_ = image;
			clutter_stage_paint_to_buffer (_tmp11_, &_tmp12_, scale, _tmp14_, cairo_image_surface_get_stride (_tmp15_), COGL_PIXEL_FORMAT_BGRA_8888_PRE, paint_flags, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		} else {
			GalaWindowManager* _tmp16_;
			ClutterStage* _tmp17_;
			ClutterStage* _tmp18_;
			MtkRectangle _tmp19_ = {0};
			cairo_surface_t* _tmp20_;
			guchar* _tmp21_;
			cairo_surface_t* _tmp22_;
			_tmp16_ = self->priv->_wm;
			_tmp17_ = gala_window_manager_get_stage (_tmp16_);
			_tmp18_ = _tmp17_;
			_tmp19_.x = x;
			_tmp19_.y = y;
			_tmp19_.width = width;
			_tmp19_.height = height;
			_tmp20_ = image;
			_tmp21_ = cairo_image_surface_get_data (_tmp20_);
			_tmp22_ = image;
			clutter_stage_paint_to_buffer (_tmp18_, &_tmp19_, scale, _tmp21_, cairo_image_surface_get_stride (_tmp22_), COGL_PIXEL_FORMAT_ARGB_8888_PRE, paint_flags, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp23_;
		const gchar* _tmp24_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp23_ = e;
		_tmp24_ = _tmp23_->message;
		g_warning ("ScreenshotManager.vala:590: %s", _tmp24_);
		_g_error_free0 (e);
	}
	__finally0:
	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 void
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* _tmp11_;
	CoglTexture* _tmp12_;
	CoglTexture* _tmp13_;
	gint width = 0;
	CoglTexture* _tmp14_;
	gint height = 0;
	CoglTexture* _tmp15_;
	guint8* data = NULL;
	guint8* _tmp16_;
	gint data_length1;
	gint _data_size_;
	CoglTexture* _tmp17_;
	guint8* _tmp18_;
	gint _tmp18__length1;
	cairo_surface_t* cursor_image = NULL;
	guint8* _tmp19_;
	gint _tmp19__length1;
	cairo_surface_t* _tmp20_;
	cairo_t* cr = NULL;
	cairo_t* _tmp21_;
	cairo_t* _tmp22_;
	cairo_t* _tmp23_;
	cairo_surface_t* _tmp24_;
	graphene_point_t _tmp25_;
	cairo_rectangle_int_t _tmp26_;
	graphene_point_t _tmp27_;
	cairo_rectangle_int_t _tmp28_;
	cairo_t* _tmp29_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (image != NULL);
	g_return_if_fail (image_rect != 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_region_destroy0 (region);
		return;
	}
	_tmp11_ = cursor_tracker;
	_tmp12_ = meta_cursor_tracker_get_sprite (_tmp11_);
	texture = _tmp12_;
	_tmp13_ = texture;
	if (_tmp13_ == NULL) {
		_cairo_region_destroy0 (region);
		return;
	}
	_tmp14_ = texture;
	width = (gint) cogl_texture_get_width (_tmp14_);
	_tmp15_ = texture;
	height = (gint) cogl_texture_get_height (_tmp15_);
	_tmp16_ = g_new0 (guint8, (width * height) * 4);
	data = _tmp16_;
	data_length1 = (width * height) * 4;
	_data_size_ = data_length1;
	_tmp17_ = texture;
	_tmp18_ = data;
	_tmp18__length1 = data_length1;
	cogl_texture_get_data (_tmp17_, COGL_PIXEL_FORMAT_RGBA_8888, (guint) 0, _tmp18_);
	_tmp19_ = data;
	_tmp19__length1 = data_length1;
	_tmp20_ = cairo_image_surface_create_for_data (_tmp19_, CAIRO_FORMAT_ARGB32, width, height, width * 4);
	cursor_image = _tmp20_;
	_tmp21_ = cairo_create (image);
	cr = _tmp21_;
	_tmp22_ = cr;
	cairo_set_operator (_tmp22_, CAIRO_OPERATOR_OVER);
	_tmp23_ = cr;
	_tmp24_ = cursor_image;
	_tmp25_ = coords;
	_tmp26_ = *image_rect;
	_tmp27_ = coords;
	_tmp28_ = *image_rect;
	cairo_set_source_surface (_tmp23_, _tmp24_, (gdouble) (_tmp25_.x - _tmp26_.x), (gdouble) (_tmp27_.y - _tmp28_.y));
	_tmp29_ = cr;
	cairo_paint (_tmp29_);
	_cairo_destroy0 (cr);
	_cairo_surface_destroy0 (cursor_image);
	data = (g_free (data), NULL);
	_cairo_region_destroy0 (region);
}

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 Block11Data*
block11_data_ref (Block11Data* _data11_)
{
	g_atomic_int_inc (&_data11_->_ref_count_);
	return _data11_;
}

static void
block11_data_unref (void * _userdata_)
{
	Block11Data* _data11_;
	_data11_ = (Block11Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data11_->_ref_count_)) {
		GalaScreenshotManager* self;
		self = _data11_->self;
		_g_object_unref0 (self);
		g_slice_free (Block11Data, _data11_);
	}
}

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
__lambda103_ (Block11Data* _data11_)
{
	GalaScreenshotManager* self;
	GalaWindowManager* _tmp0_;
	ClutterStage* _tmp1_;
	ClutterStage* _tmp2_;
	self = _data11_->self;
	_tmp0_ = self->priv->_wm;
	_tmp1_ = gala_window_manager_get_stage (_tmp0_);
	_tmp2_ = _tmp1_;
	g_signal_handler_disconnect ((GObject*) _tmp2_, _data11_->signal_id);
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _gala_screenshot_manager_wait_stage_repaint_co_gsource_func, _data11_->_async_data_, NULL);
}

static void
___lambda103__clutter_stage_after_paint (ClutterStage* _sender,
                                         ClutterStageView* view,
                                         ClutterFrame* frame,
                                         gpointer self)
{
	__lambda103_ (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_->_data11_ = g_slice_new0 (Block11Data);
	_data_->_data11_->_ref_count_ = 1;
	_data_->_data11_->self = g_object_ref (_data_->self);
	_data_->_data11_->_async_data_ = _data_;
	_data_->_data11_->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) ___lambda103__clutter_stage_after_paint, block11_data_ref (_data_->_data11_), (GClosureNotify) block11_data_unref, 0);
	_data_->_data11_->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:
	;
	block11_data_unref (_data_->_data11_);
	_data_->_data11_ = 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 GdkPixbuf*
gala_screenshot_manager_pixbuf_from_surface (cairo_surface_t* image)
{
	gint width = 0;
	gint height = 0;
	GdkPixbuf* pixbuf = NULL;
	GdkPixbuf* _tmp0_;
	guchar* src_data = NULL;
	guchar* _tmp1_;
	gint src_data_length1;
	gint _src_data_size_;
	guint8* dest_data = NULL;
	GdkPixbuf* _tmp2_;
	guint8* _tmp3_;
	gint dest_data_length1;
	gint _dest_data_size_;
	GdkPixbuf* result;
	g_return_val_if_fail (image != NULL, NULL);
	width = cairo_image_surface_get_width (image);
	height = cairo_image_surface_get_height (image);
	_tmp0_ = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, width, height);
	pixbuf = _tmp0_;
	_tmp1_ = cairo_image_surface_get_data (image);
	src_data = _tmp1_;
	src_data_length1 = -1;
	_src_data_size_ = src_data_length1;
	_tmp2_ = pixbuf;
	_tmp3_ = gdk_pixbuf_get_pixels (_tmp2_);
	dest_data = _tmp3_;
	dest_data_length1 = -1;
	_dest_data_size_ = dest_data_length1;
	{
		gint y = 0;
		y = 0;
		{
			gboolean _tmp4_ = FALSE;
			_tmp4_ = TRUE;
			while (TRUE) {
				gint row_start = 0;
				if (!_tmp4_) {
					gint _tmp5_;
					_tmp5_ = y;
					y = _tmp5_ + 1;
				}
				_tmp4_ = FALSE;
				if (!(y < height)) {
					break;
				}
				row_start = (y * width) * 4;
				{
					gint x = 0;
					x = 0;
					{
						gboolean _tmp6_ = FALSE;
						_tmp6_ = TRUE;
						while (TRUE) {
							gint pixel_start = 0;
							guchar alpha = '\0';
							guchar* _tmp8_;
							gint _tmp8__length1;
							guchar _tmp9_;
							guint8* _tmp22_;
							gint _tmp22__length1;
							if (!_tmp6_) {
								gint _tmp7_;
								_tmp7_ = x;
								x = _tmp7_ + 1;
							}
							_tmp6_ = FALSE;
							if (!(x < width)) {
								break;
							}
							pixel_start = row_start + (x * 4);
							_tmp8_ = src_data;
							_tmp8__length1 = src_data_length1;
							_tmp9_ = _tmp8_[pixel_start + 3];
							alpha = _tmp9_;
							if (((gint) alpha) == 0) {
								guint8* _tmp10_;
								gint _tmp10__length1;
								guint8* _tmp11_;
								gint _tmp11__length1;
								guint8* _tmp12_;
								gint _tmp12__length1;
								_tmp10_ = dest_data;
								_tmp10__length1 = dest_data_length1;
								_tmp10_[pixel_start + 0] = (guint8) 0;
								_tmp11_ = dest_data;
								_tmp11__length1 = dest_data_length1;
								_tmp11_[pixel_start + 1] = (guint8) 0;
								_tmp12_ = dest_data;
								_tmp12__length1 = dest_data_length1;
								_tmp12_[pixel_start + 2] = (guint8) 0;
							} else {
								guint8* _tmp13_;
								gint _tmp13__length1;
								guchar* _tmp14_;
								gint _tmp14__length1;
								guchar _tmp15_;
								guint8* _tmp16_;
								gint _tmp16__length1;
								guchar* _tmp17_;
								gint _tmp17__length1;
								guchar _tmp18_;
								guint8* _tmp19_;
								gint _tmp19__length1;
								guchar* _tmp20_;
								gint _tmp20__length1;
								guchar _tmp21_;
								_tmp13_ = dest_data;
								_tmp13__length1 = dest_data_length1;
								_tmp14_ = src_data;
								_tmp14__length1 = src_data_length1;
								_tmp15_ = _tmp14_[pixel_start + 2];
								_tmp13_[pixel_start + 0] = (guint8) (((_tmp15_ * 255) + (alpha / 2)) / alpha);
								_tmp16_ = dest_data;
								_tmp16__length1 = dest_data_length1;
								_tmp17_ = src_data;
								_tmp17__length1 = src_data_length1;
								_tmp18_ = _tmp17_[pixel_start + 1];
								_tmp16_[pixel_start + 1] = (guint8) (((_tmp18_ * 255) + (alpha / 2)) / alpha);
								_tmp19_ = dest_data;
								_tmp19__length1 = dest_data_length1;
								_tmp20_ = src_data;
								_tmp20__length1 = src_data_length1;
								_tmp21_ = _tmp20_[pixel_start + 0];
								_tmp19_[pixel_start + 2] = (guint8) (((_tmp21_ * 255) + (alpha / 2)) / alpha);
							}
							_tmp22_ = dest_data;
							_tmp22__length1 = dest_data_length1;
							_tmp22_[pixel_start + 3] = (guint8) alpha;
						}
					}
				}
			}
		}
	}
	result = pixbuf;
	return result;
}

GalaWindowManager*
gala_screenshot_manager_get_wm (GalaScreenshotManager* self)
{
	GalaWindowManager* result;
	GalaWindowManager* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_wm;
	result = _tmp0_;
	return result;
}

static void
gala_screenshot_manager_set_wm (GalaScreenshotManager* self,
                                GalaWindowManager* value)
{
	GalaWindowManager* old_value;
	g_return_if_fail (self != NULL);
	old_value = gala_screenshot_manager_get_wm (self);
	if (old_value != value) {
		GalaWindowManager* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_wm);
		self->priv->_wm = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gala_screenshot_manager_properties[GALA_SCREENSHOT_MANAGER_WM_PROPERTY]);
	}
}

GalaNotificationsManager*
gala_screenshot_manager_get_notifications_manager (GalaScreenshotManager* self)
{
	GalaNotificationsManager* result;
	GalaNotificationsManager* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_notifications_manager;
	result = _tmp0_;
	return result;
}

static void
gala_screenshot_manager_set_notifications_manager (GalaScreenshotManager* self,
                                                   GalaNotificationsManager* value)
{
	GalaNotificationsManager* old_value;
	g_return_if_fail (self != NULL);
	old_value = gala_screenshot_manager_get_notifications_manager (self);
	if (old_value != value) {
		GalaNotificationsManager* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_notifications_manager);
		self->priv->_notifications_manager = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gala_screenshot_manager_properties[GALA_SCREENSHOT_MANAGER_NOTIFICATIONS_MANAGER_PROPERTY]);
	}
}

GalaFilterManager*
gala_screenshot_manager_get_filter_manager (GalaScreenshotManager* self)
{
	GalaFilterManager* result;
	GalaFilterManager* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_filter_manager;
	result = _tmp0_;
	return result;
}

static void
gala_screenshot_manager_set_filter_manager (GalaScreenshotManager* self,
                                            GalaFilterManager* value)
{
	GalaFilterManager* old_value;
	g_return_if_fail (self != NULL);
	old_value = gala_screenshot_manager_get_filter_manager (self);
	if (old_value != value) {
		GalaFilterManager* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_filter_manager);
		self->priv->_filter_manager = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gala_screenshot_manager_properties[GALA_SCREENSHOT_MANAGER_FILTER_MANAGER_PROPERTY]);
	}
}

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

static gpointer
__bool_dup0 (gpointer self)
{
	return self ? _bool_dup (self) : NULL;
}

static gboolean
gala_screenshot_manager_get_is_redacted_font_available (GalaScreenshotManager* self)
{
	gboolean result;
	gboolean* _tmp0_;
	PangoFontFamily** families = NULL;
	gint families_length1 = 0;
	gint _families_size_ = 0;
	PangoFontMap* _tmp2_;
	PangoFontFamily** _tmp3_ = NULL;
	gint _tmp4_ = 0;
	gboolean _tmp5_;
	gboolean* _tmp6_;
	PangoFontFamily** _tmp7_;
	gint _tmp7__length1;
	gboolean* _tmp12_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_is_redacted_font_available;
	if (_tmp0_ != NULL) {
		gboolean* _tmp1_;
		_tmp1_ = self->priv->_is_redacted_font_available;
		result = *_tmp1_;
		return result;
	}
	_tmp2_ = pango_cairo_font_map_get_default ();
	pango_font_map_list_families (_tmp2_, &_tmp3_, &_tmp4_);
	families = (g_free (families), NULL);
	families = _tmp3_;
	families_length1 = _tmp4_;
	_families_size_ = families_length1;
	_tmp5_ = FALSE;
	_tmp6_ = __bool_dup0 (&_tmp5_);
	_g_free0 (self->priv->_is_redacted_font_available);
	self->priv->_is_redacted_font_available = _tmp6_;
	_tmp7_ = families;
	_tmp7__length1 = families_length1;
	{
		PangoFontFamily** family_collection = NULL;
		gint family_collection_length1 = 0;
		gint _family_collection_size_ = 0;
		gint family_it = 0;
		family_collection = _tmp7_;
		family_collection_length1 = _tmp7__length1;
		for (family_it = 0; family_it < family_collection_length1; family_it = family_it + 1) {
			PangoFontFamily* family = NULL;
			family = family_collection[family_it];
			{
				PangoFontFamily* _tmp8_;
				const gchar* _tmp9_;
				_tmp8_ = family;
				_tmp9_ = pango_font_family_get_name (_tmp8_);
				if (g_strcmp0 (_tmp9_, "Redacted Script") == 0) {
					gboolean _tmp10_;
					gboolean* _tmp11_;
					_tmp10_ = TRUE;
					_tmp11_ = __bool_dup0 (&_tmp10_);
					_g_free0 (self->priv->_is_redacted_font_available);
					self->priv->_is_redacted_font_available = _tmp11_;
					break;
				}
			}
		}
	}
	_tmp12_ = self->priv->_is_redacted_font_available;
	result = *_tmp12_;
	families = (g_free (families), NULL);
	return result;
}

static void
_gala_screenshot_manager_handle_screenshot_meta_key_handler_func (MetaDisplay* display,
                                                                  MetaWindow* window,
                                                                  const ClutterKeyEvent* event,
                                                                  MetaKeyBinding* binding,
                                                                  gpointer self)
{
	gala_screenshot_manager_handle_screenshot ((GalaScreenshotManager*) self, display, window, event, binding);
}

static void
_gala_screenshot_manager_handle_action_invoked_gala_notifications_manager_action_invoked (GalaNotificationsManager* _sender,
                                                                                          guint32 id,
                                                                                          const gchar* name,
                                                                                          GVariant* target_value,
                                                                                          gpointer self)
{
	gala_screenshot_manager_handle_action_invoked ((GalaScreenshotManager*) self, id, name, target_value);
}

static void
_gala_screenshot_manager___lambda108_ (GalaScreenshotManager* self,
                                       guint32 id)
{
	GHashTable* _tmp0_;
	_tmp0_ = self->priv->notifications_id_to_path;
	g_hash_table_remove (_tmp0_, (gpointer) ((guintptr) id));
}

static void
__gala_screenshot_manager___lambda108__gala_notifications_manager_notification_closed (GalaNotificationsManager* _sender,
                                                                                       guint32 id,
                                                                                       gpointer self)
{
	_gala_screenshot_manager___lambda108_ ((GalaScreenshotManager*) self, id);
}

static GObject *
gala_screenshot_manager_constructor (GType type,
                                     guint n_construct_properties,
                                     GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GalaScreenshotManager * self;
	GSettings* _tmp0_;
	GHashFunc _tmp1_;
	GEqualFunc _tmp2_;
	GHashTable* _tmp3_;
	GSettings* keybinding_settings = NULL;
	GSettings* _tmp4_;
	MetaDisplay* display = NULL;
	GalaWindowManager* _tmp5_;
	MetaDisplay* _tmp6_;
	MetaDisplay* _tmp7_;
	GSettings* _tmp8_;
	MetaDisplay* _tmp9_;
	GSettings* _tmp10_;
	MetaDisplay* _tmp11_;
	GSettings* _tmp12_;
	MetaDisplay* _tmp13_;
	GSettings* _tmp14_;
	MetaDisplay* _tmp15_;
	GSettings* _tmp16_;
	MetaDisplay* _tmp17_;
	GSettings* _tmp18_;
	MetaDisplay* _tmp19_;
	GSettings* _tmp20_;
	GalaNotificationsManager* _tmp21_;
	GalaNotificationsManager* _tmp22_;
	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_;
	_tmp1_ = g_direct_hash;
	_tmp2_ = g_direct_equal;
	_tmp3_ = g_hash_table_new_full (_tmp1_, _tmp2_, NULL, _g_free0_);
	_g_hash_table_unref0 (self->priv->notifications_id_to_path);
	self->priv->notifications_id_to_path = _tmp3_;
	_tmp4_ = g_settings_new ("io.elementary.desktop.wm.keybindings");
	keybinding_settings = _tmp4_;
	_tmp5_ = self->priv->_wm;
	_tmp6_ = meta_plugin_get_display ((MetaPlugin*) _tmp5_);
	display = _tmp6_;
	_tmp7_ = display;
	_tmp8_ = keybinding_settings;
	meta_display_add_keybinding (_tmp7_, "screenshot", _tmp8_, META_KEY_BINDING_IGNORE_AUTOREPEAT, _gala_screenshot_manager_handle_screenshot_meta_key_handler_func, g_object_ref (self), g_object_unref);
	_tmp9_ = display;
	_tmp10_ = keybinding_settings;
	meta_display_add_keybinding (_tmp9_, "interactive-screenshot", _tmp10_, META_KEY_BINDING_IGNORE_AUTOREPEAT, _gala_screenshot_manager_handle_screenshot_meta_key_handler_func, g_object_ref (self), g_object_unref);
	_tmp11_ = display;
	_tmp12_ = keybinding_settings;
	meta_display_add_keybinding (_tmp11_, "window-screenshot", _tmp12_, META_KEY_BINDING_IGNORE_AUTOREPEAT, _gala_screenshot_manager_handle_screenshot_meta_key_handler_func, g_object_ref (self), g_object_unref);
	_tmp13_ = display;
	_tmp14_ = keybinding_settings;
	meta_display_add_keybinding (_tmp13_, "area-screenshot", _tmp14_, META_KEY_BINDING_IGNORE_AUTOREPEAT, _gala_screenshot_manager_handle_screenshot_meta_key_handler_func, g_object_ref (self), g_object_unref);
	_tmp15_ = display;
	_tmp16_ = keybinding_settings;
	meta_display_add_keybinding (_tmp15_, "screenshot-clip", _tmp16_, META_KEY_BINDING_IGNORE_AUTOREPEAT, _gala_screenshot_manager_handle_screenshot_meta_key_handler_func, g_object_ref (self), g_object_unref);
	_tmp17_ = display;
	_tmp18_ = keybinding_settings;
	meta_display_add_keybinding (_tmp17_, "window-screenshot-clip", _tmp18_, META_KEY_BINDING_IGNORE_AUTOREPEAT, _gala_screenshot_manager_handle_screenshot_meta_key_handler_func, g_object_ref (self), g_object_unref);
	_tmp19_ = display;
	_tmp20_ = keybinding_settings;
	meta_display_add_keybinding (_tmp19_, "area-screenshot-clip", _tmp20_, META_KEY_BINDING_IGNORE_AUTOREPEAT, _gala_screenshot_manager_handle_screenshot_meta_key_handler_func, g_object_ref (self), g_object_unref);
	_tmp21_ = self->priv->_notifications_manager;
	g_signal_connect_object (_tmp21_, "action-invoked", (GCallback) _gala_screenshot_manager_handle_action_invoked_gala_notifications_manager_action_invoked, self, 0);
	_tmp22_ = self->priv->_notifications_manager;
	g_signal_connect_object (_tmp22_, "notification-closed", (GCallback) __gala_screenshot_manager___lambda108__gala_notifications_manager_notification_closed, self, 0);
	_g_object_unref0 (keybinding_settings);
	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)->get_property = _vala_gala_screenshot_manager_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gala_screenshot_manager_set_property;
	G_OBJECT_CLASS (klass)->constructor = gala_screenshot_manager_constructor;
	G_OBJECT_CLASS (klass)->finalize = gala_screenshot_manager_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GALA_SCREENSHOT_MANAGER_WM_PROPERTY, gala_screenshot_manager_properties[GALA_SCREENSHOT_MANAGER_WM_PROPERTY] = g_param_spec_object ("wm", "wm", "wm", GALA_TYPE_WINDOW_MANAGER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GALA_SCREENSHOT_MANAGER_NOTIFICATIONS_MANAGER_PROPERTY, gala_screenshot_manager_properties[GALA_SCREENSHOT_MANAGER_NOTIFICATIONS_MANAGER_PROPERTY] = g_param_spec_object ("notifications-manager", "notifications-manager", "notifications-manager", GALA_TYPE_NOTIFICATIONS_MANAGER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GALA_SCREENSHOT_MANAGER_FILTER_MANAGER_PROPERTY, gala_screenshot_manager_properties[GALA_SCREENSHOT_MANAGER_FILTER_MANAGER_PROPERTY] = g_param_spec_object ("filter-manager", "filter-manager", "filter-manager", GALA_TYPE_FILTER_MANAGER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

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

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->_notifications_manager);
	_g_object_unref0 (self->priv->_filter_manager);
	_g_free0 (self->priv->_is_redacted_font_available);
	_g_object_unref0 (self->priv->desktop_settings);
	_g_hash_table_unref0 (self->priv->notifications_id_to_path);
	_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);
}

 G_GNUC_NO_INLINE 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 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
_vala_gala_screenshot_manager_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec)
{
	GalaScreenshotManager * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GALA_TYPE_SCREENSHOT_MANAGER, GalaScreenshotManager);
	switch (property_id) {
		case GALA_SCREENSHOT_MANAGER_WM_PROPERTY:
		g_value_set_object (value, gala_screenshot_manager_get_wm (self));
		break;
		case GALA_SCREENSHOT_MANAGER_NOTIFICATIONS_MANAGER_PROPERTY:
		g_value_set_object (value, gala_screenshot_manager_get_notifications_manager (self));
		break;
		case GALA_SCREENSHOT_MANAGER_FILTER_MANAGER_PROPERTY:
		g_value_set_object (value, gala_screenshot_manager_get_filter_manager (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gala_screenshot_manager_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec)
{
	GalaScreenshotManager * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GALA_TYPE_SCREENSHOT_MANAGER, GalaScreenshotManager);
	switch (property_id) {
		case GALA_SCREENSHOT_MANAGER_WM_PROPERTY:
		gala_screenshot_manager_set_wm (self, g_value_get_object (value));
		break;
		case GALA_SCREENSHOT_MANAGER_NOTIFICATIONS_MANAGER_PROPERTY:
		gala_screenshot_manager_set_notifications_manager (self, g_value_get_object (value));
		break;
		case GALA_SCREENSHOT_MANAGER_FILTER_MANAGER_PROPERTY:
		gala_screenshot_manager_set_filter_manager (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_dbus_gala_screenshot_manager_flash_area (GalaScreenshotManager* self,
                                          GVariant* _parameters_,
                                          GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gint x = 0;
	GVariant* _tmp54_;
	gint y = 0;
	GVariant* _tmp55_;
	gint width = 0;
	GVariant* _tmp56_;
	gint height = 0;
	GVariant* _tmp57_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp54_ = g_variant_iter_next_value (&_arguments_iter);
	x = g_variant_get_int32 (_tmp54_);
	g_variant_unref (_tmp54_);
	_tmp55_ = g_variant_iter_next_value (&_arguments_iter);
	y = g_variant_get_int32 (_tmp55_);
	g_variant_unref (_tmp55_);
	_tmp56_ = g_variant_iter_next_value (&_arguments_iter);
	width = g_variant_get_int32 (_tmp56_);
	g_variant_unref (_tmp56_);
	_tmp57_ = g_variant_iter_next_value (&_arguments_iter);
	height = g_variant_get_int32 (_tmp57_);
	g_variant_unref (_tmp57_);
	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* _tmp58_;
	GVariant* _tmp59_;
	GVariant* _tmp60_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (GalaScreenshotManagerScreenshotReadyData);
	_ready_data->_invocation_ = invocation;
	_tmp58_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->include_cursor = g_variant_get_boolean (_tmp58_);
	g_variant_unref (_tmp58_);
	_tmp59_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->flash = g_variant_get_boolean (_tmp59_);
	g_variant_unref (_tmp59_);
	_tmp60_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->filename = g_variant_dup_string (_tmp60_, NULL);
	g_variant_unref (_tmp60_);
	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* _tmp61_;
	GVariant* _tmp62_;
	GVariant* _tmp63_;
	GVariant* _tmp64_;
	GVariant* _tmp65_;
	GVariant* _tmp66_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (GalaScreenshotManagerScreenshotAreaReadyData);
	_ready_data->_invocation_ = invocation;
	_tmp61_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->x = g_variant_get_int32 (_tmp61_);
	g_variant_unref (_tmp61_);
	_tmp62_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->y = g_variant_get_int32 (_tmp62_);
	g_variant_unref (_tmp62_);
	_tmp63_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->width = g_variant_get_int32 (_tmp63_);
	g_variant_unref (_tmp63_);
	_tmp64_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->height = g_variant_get_int32 (_tmp64_);
	g_variant_unref (_tmp64_);
	_tmp65_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->flash = g_variant_get_boolean (_tmp65_);
	g_variant_unref (_tmp65_);
	_tmp66_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->filename = g_variant_dup_string (_tmp66_, NULL);
	g_variant_unref (_tmp66_);
	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* _tmp67_;
	GVariant* _tmp68_;
	GVariant* _tmp69_;
	GVariant* _tmp70_;
	GVariant* _tmp71_;
	GVariant* _tmp72_;
	GVariant* _tmp73_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (GalaScreenshotManagerScreenshotAreaWithCursorReadyData);
	_ready_data->_invocation_ = invocation;
	_tmp67_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->x = g_variant_get_int32 (_tmp67_);
	g_variant_unref (_tmp67_);
	_tmp68_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->y = g_variant_get_int32 (_tmp68_);
	g_variant_unref (_tmp68_);
	_tmp69_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->width = g_variant_get_int32 (_tmp69_);
	g_variant_unref (_tmp69_);
	_tmp70_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->height = g_variant_get_int32 (_tmp70_);
	g_variant_unref (_tmp70_);
	_tmp71_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->include_cursor = g_variant_get_boolean (_tmp71_);
	g_variant_unref (_tmp71_);
	_tmp72_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->flash = g_variant_get_boolean (_tmp72_);
	g_variant_unref (_tmp72_);
	_tmp73_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->filename = g_variant_dup_string (_tmp73_, NULL);
	g_variant_unref (_tmp73_);
	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* _tmp74_;
	GVariant* _tmp75_;
	GVariant* _tmp76_;
	GVariant* _tmp77_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (GalaScreenshotManagerScreenshotWindowReadyData);
	_ready_data->_invocation_ = invocation;
	_tmp74_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->include_frame = g_variant_get_boolean (_tmp74_);
	g_variant_unref (_tmp74_);
	_tmp75_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->include_cursor = g_variant_get_boolean (_tmp75_);
	g_variant_unref (_tmp75_);
	_tmp76_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->flash = g_variant_get_boolean (_tmp76_);
	g_variant_unref (_tmp76_);
	_tmp77_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->filename = g_variant_dup_string (_tmp77_, NULL);
	g_variant_unref (_tmp77_);
	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 _tmp78_;
	GHashTableIter _tmp79_;
	gpointer _tmp80_;
	gpointer _tmp81_;
	_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 (&_tmp79_, result);
	g_variant_builder_init (&_tmp78_, G_VARIANT_TYPE ("a{sv}"));
	while (g_hash_table_iter_next (&_tmp79_, &_tmp80_, &_tmp81_)) {
		gchar* _key;
		GVariant* _value;
		_key = (gchar*) _tmp80_;
		_value = (GVariant*) _tmp81_;
		g_variant_builder_add (&_tmp78_, "{?*}", g_variant_new_string (_key), g_variant_new_variant (_value));
	}
	g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp78_));
	_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 void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

