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

/*
* Copyright (c) 2014–2016 Fabio Zaramella <ffabio.96.x@gmail.com>
*               2017–2018 elementary LLC. (https://elementary.io)
*               2019 Alexander Mikhaylenko <exalm7659@gmail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 3 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/

#include <glib-object.h>
#include <gio/gio.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gdk/gdk.h>
#include <pango/pango.h>
#include <pango/pangocairo.h>

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

#define SCREENSHOT_TYPE_SCREENSHOT_BACKEND (screenshot_screenshot_backend_get_type ())
#define SCREENSHOT_SCREENSHOT_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SCREENSHOT_TYPE_SCREENSHOT_BACKEND, ScreenshotScreenshotBackend))
#define SCREENSHOT_SCREENSHOT_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SCREENSHOT_TYPE_SCREENSHOT_BACKEND, ScreenshotScreenshotBackendClass))
#define SCREENSHOT_IS_SCREENSHOT_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SCREENSHOT_TYPE_SCREENSHOT_BACKEND))
#define SCREENSHOT_IS_SCREENSHOT_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SCREENSHOT_TYPE_SCREENSHOT_BACKEND))
#define SCREENSHOT_SCREENSHOT_BACKEND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SCREENSHOT_TYPE_SCREENSHOT_BACKEND, ScreenshotScreenshotBackendClass))

typedef struct _ScreenshotScreenshotBackend ScreenshotScreenshotBackend;
typedef struct _ScreenshotScreenshotBackendClass ScreenshotScreenshotBackendClass;
typedef struct _ScreenshotScreenshotBackendPrivate ScreenshotScreenshotBackendPrivate;

#define SCREENSHOT_TYPE_SCREENSHOT_PROXY (screenshot_screenshot_proxy_get_type ())
#define SCREENSHOT_SCREENSHOT_PROXY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SCREENSHOT_TYPE_SCREENSHOT_PROXY, ScreenshotScreenshotProxy))
#define SCREENSHOT_IS_SCREENSHOT_PROXY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SCREENSHOT_TYPE_SCREENSHOT_PROXY))
#define SCREENSHOT_SCREENSHOT_PROXY_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), SCREENSHOT_TYPE_SCREENSHOT_PROXY, ScreenshotScreenshotProxyIface))

typedef struct _ScreenshotScreenshotProxy ScreenshotScreenshotProxy;
typedef struct _ScreenshotScreenshotProxyIface ScreenshotScreenshotProxyIface;

#define SCREENSHOT_TYPE_SCREENSHOT_PROXY_PROXY (screenshot_screenshot_proxy_proxy_get_type ())
enum  {
	SCREENSHOT_SCREENSHOT_BACKEND_0_PROPERTY,
	SCREENSHOT_SCREENSHOT_BACKEND_NUM_PROPERTIES
};
static GParamSpec* screenshot_screenshot_backend_properties[SCREENSHOT_SCREENSHOT_BACKEND_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 SCREENSHOT_TYPE_INTROSPECTABLE_PROXY (screenshot_introspectable_proxy_get_type ())
#define SCREENSHOT_INTROSPECTABLE_PROXY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SCREENSHOT_TYPE_INTROSPECTABLE_PROXY, ScreenshotIntrospectableProxy))
#define SCREENSHOT_IS_INTROSPECTABLE_PROXY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SCREENSHOT_TYPE_INTROSPECTABLE_PROXY))
#define SCREENSHOT_INTROSPECTABLE_PROXY_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), SCREENSHOT_TYPE_INTROSPECTABLE_PROXY, ScreenshotIntrospectableProxyIface))

typedef struct _ScreenshotIntrospectableProxy ScreenshotIntrospectableProxy;
typedef struct _ScreenshotIntrospectableProxyIface ScreenshotIntrospectableProxyIface;

#define SCREENSHOT_TYPE_INTROSPECTABLE_PROXY_PROXY (screenshot_introspectable_proxy_proxy_get_type ())
#define _g_dbus_interface_info_unref0(var) ((var == NULL) ? NULL : (var = (g_dbus_interface_info_unref (var), NULL)))
#define _g_dbus_node_info_unref0(var) ((var == NULL) ? NULL : (var = (g_dbus_node_info_unref (var), NULL)))
typedef enum  {
	SCREENSHOT_CAPTURE_TYPE_SCREEN,
	SCREENSHOT_CAPTURE_TYPE_CURRENT_WINDOW,
	SCREENSHOT_CAPTURE_TYPE_AREA
} ScreenshotCaptureType;

#define SCREENSHOT_TYPE_CAPTURE_TYPE (screenshot_capture_type_get_type ())
#define __vala_GdkRectangle_free0(var) ((var == NULL) ? NULL : (var = (_vala_GdkRectangle_free (var), NULL)))
typedef struct _ScreenshotScreenshotBackendCaptureData ScreenshotScreenshotBackendCaptureData;
typedef struct _Block5Data Block5Data;
typedef struct _ScreenshotScreenshotBackendSleepData ScreenshotScreenshotBackendSleepData;
typedef struct _ScreenshotScreenshotBackendScreenshotAreaData ScreenshotScreenshotBackendScreenshotAreaData;
typedef struct _ScreenshotScreenshotBackendGetPixbufData ScreenshotScreenshotBackendGetPixbufData;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

struct _ScreenshotScreenshotBackend {
	GObject parent_instance;
	ScreenshotScreenshotBackendPrivate * priv;
};

struct _ScreenshotScreenshotBackendClass {
	GObjectClass parent_class;
};

struct _ScreenshotScreenshotProxyIface {
	GTypeInterface parent_iface;
	void (*conceal_text) (ScreenshotScreenshotProxy* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*conceal_text_finish) (ScreenshotScreenshotProxy* self, GAsyncResult* _res_, GError** error);
	void (*screenshot) (ScreenshotScreenshotProxy* self, gboolean include_cursor, gboolean flash, const gchar* filename, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*screenshot_finish) (ScreenshotScreenshotProxy* self, GAsyncResult* _res_, gboolean* success, gchar** filename_used, GError** error);
	void (*screenshot_window) (ScreenshotScreenshotProxy* self, gboolean include_frame, gboolean include_cursor, gboolean flash, const gchar* filename, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*screenshot_window_finish) (ScreenshotScreenshotProxy* self, GAsyncResult* _res_, gboolean* success, gchar** filename_used, GError** error);
	void (*screenshot_area) (ScreenshotScreenshotProxy* self, gint x, gint y, gint width, gint height, gboolean flash, const gchar* filename, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*screenshot_area_finish) (ScreenshotScreenshotProxy* self, GAsyncResult* _res_, gboolean* success, gchar** filename_used, GError** error);
	void (*screenshot_area_with_cursor) (ScreenshotScreenshotProxy* self, gint x, gint y, gint width, gint height, gboolean include_cursor, gboolean flash, const gchar* filename, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*screenshot_area_with_cursor_finish) (ScreenshotScreenshotProxy* self, GAsyncResult* _res_, gboolean* success, gchar** filename_used, GError** error);
	void (*select_area) (ScreenshotScreenshotProxy* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*select_area_finish) (ScreenshotScreenshotProxy* self, GAsyncResult* _res_, gint* x, gint* y, gint* width, gint* height, GError** error);
};

struct _ScreenshotScreenshotBackendPrivate {
	ScreenshotScreenshotProxy* proxy;
	gboolean can_conceal_text;
	gboolean can_screenshot_area_with_cursor;
	gboolean* _is_redacted_font_available;
};

struct _ScreenshotIntrospectableProxyIface {
	GTypeInterface parent_iface;
	gchar* (*introspect) (ScreenshotIntrospectableProxy* self, GError** error);
};

struct _ScreenshotScreenshotBackendCaptureData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ScreenshotScreenshotBackend* self;
	ScreenshotCaptureType type;
	gint delay;
	gboolean include_pointer;
	gboolean redact;
	GdkPixbuf* result;
	GdkRectangle* rect;
	GdkRectangle _tmp0_;
	GdkRectangle* _tmp1_;
	ScreenshotScreenshotProxy* _tmp2_;
	GdkRectangle* _tmp3_;
	GdkRectangle* _tmp4_;
	GdkRectangle* _tmp5_;
	GdkRectangle* _tmp6_;
	gint _tmp7_;
	gint _tmp8_;
	gint _tmp9_;
	gint _tmp10_;
	ScreenshotScreenshotProxy* _tmp11_;
	GdkPixbuf* pixbuf;
	GdkRectangle* _tmp12_;
	GdkPixbuf* _tmp13_;
	GError* _inner_error0_;
};

struct _Block5Data {
	int _ref_count_;
	ScreenshotScreenshotBackend* self;
	gpointer _async_data_;
};

struct _ScreenshotScreenshotBackendSleepData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ScreenshotScreenshotBackend* self;
	gint delay;
	Block5Data* _data5_;
};

struct _ScreenshotScreenshotBackendScreenshotAreaData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ScreenshotScreenshotBackend* self;
	gint x;
	gint y;
	gint width;
	gint height;
	gboolean include_cursor;
	gboolean flash;
	gchar* filename;
	gboolean success;
	gchar* filename_used;
	gboolean _tmp0_;
	ScreenshotScreenshotProxy* _tmp1_;
	gboolean _tmp2_;
	gchar* _tmp3_;
	ScreenshotScreenshotProxy* _tmp4_;
	gboolean _tmp5_;
	gchar* _tmp6_;
	GError* _inner_error0_;
};

struct _ScreenshotScreenshotBackendGetPixbufData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ScreenshotScreenshotBackend* self;
	GdkRectangle* rect;
	ScreenshotCaptureType type;
	gboolean include_pointer;
	GdkPixbuf* result;
	gboolean success;
	gchar* filename_used;
	gchar* _tmp0_;
	gchar* tmp_filename;
	gchar* _tmp1_;
	ScreenshotScreenshotProxy* _tmp2_;
	const gchar* _tmp3_;
	gboolean _tmp4_;
	gchar* _tmp5_;
	ScreenshotScreenshotProxy* _tmp6_;
	const gchar* _tmp7_;
	gboolean _tmp8_;
	gchar* _tmp9_;
	const gchar* _tmp10_;
	gboolean _tmp11_;
	gchar* _tmp12_;
	GFile* file;
	const gchar* _tmp13_;
	GFile* _tmp14_;
	GFileInputStream* stream;
	GFile* _tmp15_;
	GFileInputStream* _tmp16_;
	GdkPixbuf* pixbuf;
	GFileInputStream* _tmp17_;
	GdkPixbuf* _tmp18_;
	GFileInputStream* _tmp19_;
	GFile* _tmp20_;
	GError* _inner_error0_;
};

static gint ScreenshotScreenshotBackend_private_offset;
static gpointer screenshot_screenshot_backend_parent_class = NULL;

VALA_EXTERN GType screenshot_screenshot_backend_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ScreenshotScreenshotBackend, g_object_unref)
VALA_EXTERN GType screenshot_screenshot_proxy_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint screenshot_screenshot_proxy_register_object (void* object,
                                                   GDBusConnection* connection,
                                                   const gchar* path,
                                                   GError** error);
VALA_EXTERN GType screenshot_screenshot_proxy_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ScreenshotScreenshotProxy, g_object_unref)
static void screenshot_screenshot_backend_get_capabilities (ScreenshotScreenshotBackend* self,
                                                     GError** error);
VALA_EXTERN GType screenshot_introspectable_proxy_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint screenshot_introspectable_proxy_register_object (void* object,
                                                       GDBusConnection* connection,
                                                       const gchar* path,
                                                       GError** error);
VALA_EXTERN GType screenshot_introspectable_proxy_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ScreenshotIntrospectableProxy, g_object_unref)
VALA_EXTERN gchar* screenshot_introspectable_proxy_introspect (ScreenshotIntrospectableProxy* self,
                                                   GError** error);
static gboolean screenshot_screenshot_backend_get_is_redacted_font_available (ScreenshotScreenshotBackend* self);
static void screenshot_screenshot_backend_capture_data_free (gpointer _data);
VALA_EXTERN GType screenshot_capture_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void screenshot_screenshot_backend_capture (ScreenshotScreenshotBackend* self,
                                            ScreenshotCaptureType type,
                                            gint delay,
                                            gboolean include_pointer,
                                            gboolean redact,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_);
VALA_EXTERN GdkPixbuf* screenshot_screenshot_backend_capture_finish (ScreenshotScreenshotBackend* self,
                                                         GAsyncResult* _res_,
                                                         GError** error);
static gboolean screenshot_screenshot_backend_capture_co (ScreenshotScreenshotBackendCaptureData* _data_);
static GdkRectangle* _vala_GdkRectangle_copy (GdkRectangle* self);
static void _vala_GdkRectangle_free (GdkRectangle* self);
VALA_EXTERN void screenshot_screenshot_proxy_select_area (ScreenshotScreenshotProxy* self,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_);
VALA_EXTERN void screenshot_screenshot_proxy_select_area_finish (ScreenshotScreenshotProxy* self,
                                                     GAsyncResult* _res_,
                                                     gint* x,
                                                     gint* y,
                                                     gint* width,
                                                     gint* height,
                                                     GError** error);
static void screenshot_screenshot_backend_capture_ready (GObject* source_object,
                                                  GAsyncResult* _res_,
                                                  gpointer _user_data_);
static void screenshot_screenshot_backend_sleep (ScreenshotScreenshotBackend* self,
                                          gint delay,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_);
static void screenshot_screenshot_backend_sleep_finish (ScreenshotScreenshotBackend* self,
                                                 GAsyncResult* _res_);
static gint screenshot_screenshot_backend_get_timeout (ScreenshotScreenshotBackend* self,
                                                gint delay,
                                                gboolean redact);
VALA_EXTERN void screenshot_screenshot_proxy_conceal_text (ScreenshotScreenshotProxy* self,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_);
VALA_EXTERN void screenshot_screenshot_proxy_conceal_text_finish (ScreenshotScreenshotProxy* self,
                                                      GAsyncResult* _res_,
                                                      GError** error);
static void screenshot_screenshot_backend_get_pixbuf (ScreenshotScreenshotBackend* self,
                                               GdkRectangle* rect,
                                               ScreenshotCaptureType type,
                                               gboolean include_pointer,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_);
static GdkPixbuf* screenshot_screenshot_backend_get_pixbuf_finish (ScreenshotScreenshotBackend* self,
                                                            GAsyncResult* _res_,
                                                            GError** error);
static void screenshot_screenshot_backend_sleep_data_free (gpointer _data);
static gboolean screenshot_screenshot_backend_sleep_co (ScreenshotScreenshotBackendSleepData* _data_);
static Block5Data* block5_data_ref (Block5Data* _data5_);
static void block5_data_unref (void * _userdata_);
static gboolean __lambda16_ (Block5Data* _data5_);
static gboolean ___lambda16__gsource_func (gpointer self);
static void screenshot_screenshot_backend_screenshot_area_data_free (gpointer _data);
static void screenshot_screenshot_backend_screenshot_area (ScreenshotScreenshotBackend* self,
                                                    gint x,
                                                    gint y,
                                                    gint width,
                                                    gint height,
                                                    gboolean include_cursor,
                                                    gboolean flash,
                                                    const gchar* filename,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_);
static void screenshot_screenshot_backend_screenshot_area_finish (ScreenshotScreenshotBackend* self,
                                                           GAsyncResult* _res_,
                                                           gboolean* success,
                                                           gchar** filename_used,
                                                           GError** error);
static gboolean screenshot_screenshot_backend_screenshot_area_co (ScreenshotScreenshotBackendScreenshotAreaData* _data_);
VALA_EXTERN void screenshot_screenshot_proxy_screenshot_area_with_cursor (ScreenshotScreenshotProxy* 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 screenshot_screenshot_proxy_screenshot_area_with_cursor_finish (ScreenshotScreenshotProxy* self,
                                                                     GAsyncResult* _res_,
                                                                     gboolean* success,
                                                                     gchar** filename_used,
                                                                     GError** error);
static void screenshot_screenshot_backend_screenshot_area_ready (GObject* source_object,
                                                          GAsyncResult* _res_,
                                                          gpointer _user_data_);
VALA_EXTERN void screenshot_screenshot_proxy_screenshot_area (ScreenshotScreenshotProxy* self,
                                                  gint x,
                                                  gint y,
                                                  gint width,
                                                  gint height,
                                                  gboolean flash,
                                                  const gchar* filename,
                                                  GAsyncReadyCallback _callback_,
                                                  gpointer _user_data_);
VALA_EXTERN void screenshot_screenshot_proxy_screenshot_area_finish (ScreenshotScreenshotProxy* self,
                                                         GAsyncResult* _res_,
                                                         gboolean* success,
                                                         gchar** filename_used,
                                                         GError** error);
static void screenshot_screenshot_backend_get_pixbuf_data_free (gpointer _data);
static gboolean screenshot_screenshot_backend_get_pixbuf_co (ScreenshotScreenshotBackendGetPixbufData* _data_);
static gchar* screenshot_screenshot_backend_get_tmp_filename (ScreenshotScreenshotBackend* self);
VALA_EXTERN void screenshot_screenshot_proxy_screenshot (ScreenshotScreenshotProxy* self,
                                             gboolean include_cursor,
                                             gboolean flash,
                                             const gchar* filename,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
VALA_EXTERN void screenshot_screenshot_proxy_screenshot_finish (ScreenshotScreenshotProxy* self,
                                                    GAsyncResult* _res_,
                                                    gboolean* success,
                                                    gchar** filename_used,
                                                    GError** error);
static void screenshot_screenshot_backend_get_pixbuf_ready (GObject* source_object,
                                                     GAsyncResult* _res_,
                                                     gpointer _user_data_);
VALA_EXTERN void screenshot_screenshot_proxy_screenshot_window (ScreenshotScreenshotProxy* self,
                                                    gboolean include_frame,
                                                    gboolean include_cursor,
                                                    gboolean flash,
                                                    const gchar* filename,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_);
VALA_EXTERN void screenshot_screenshot_proxy_screenshot_window_finish (ScreenshotScreenshotProxy* self,
                                                           GAsyncResult* _res_,
                                                           gboolean* success,
                                                           gchar** filename_used,
                                                           GError** error);
VALA_EXTERN ScreenshotScreenshotBackend* screenshot_screenshot_backend_new (void);
VALA_EXTERN ScreenshotScreenshotBackend* screenshot_screenshot_backend_construct (GType object_type);
static gboolean* _bool_dup (gboolean* self);
static GObject * screenshot_screenshot_backend_constructor (GType type,
                                                     guint n_construct_properties,
                                                     GObjectConstructParam * construct_properties);
static void screenshot_screenshot_backend_finalize (GObject * obj);
static GType screenshot_screenshot_backend_get_type_once (void);
static void _vala_screenshot_screenshot_backend_get_property (GObject * object,
                                                       guint property_id,
                                                       GValue * value,
                                                       GParamSpec * pspec);

static inline gpointer
screenshot_screenshot_backend_get_instance_private (ScreenshotScreenshotBackend* self)
{
	return G_STRUCT_MEMBER_P (self, ScreenshotScreenshotBackend_private_offset);
}

static gpointer
_g_dbus_interface_info_ref0 (gpointer self)
{
	return self ? g_dbus_interface_info_ref (self) : NULL;
}

static void
screenshot_screenshot_backend_get_capabilities (ScreenshotScreenshotBackend* self,
                                                GError** error)
{
	ScreenshotIntrospectableProxy* introspectable = NULL;
	ScreenshotIntrospectableProxy* _tmp0_;
	gchar* xml = NULL;
	ScreenshotIntrospectableProxy* _tmp1_;
	gchar* _tmp2_;
	GDBusNodeInfo* node = NULL;
	const gchar* _tmp3_;
	GDBusNodeInfo* _tmp4_;
	GDBusInterfaceInfo* iface = NULL;
	GDBusNodeInfo* _tmp5_;
	GDBusInterfaceInfo* _tmp6_;
	GDBusInterfaceInfo* _tmp7_;
	gboolean _tmp8_ = FALSE;
	GDBusInterfaceInfo* _tmp9_;
	GDBusMethodInfo* _tmp10_;
	GDBusInterfaceInfo* _tmp13_;
	GDBusMethodInfo* _tmp14_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = (ScreenshotIntrospectableProxy*) g_initable_new (SCREENSHOT_TYPE_INTROSPECTABLE_PROXY_PROXY, NULL, &_inner_error0_, "g-flags", 0, "g-name", "org.gnome.Shell.Screenshot", "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/org/gnome/Shell/Screenshot", "g-interface-name", "org.freedesktop.DBus.Introspectable", NULL);
	introspectable = (ScreenshotIntrospectableProxy*) _tmp0_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp1_ = introspectable;
	_tmp2_ = screenshot_introspectable_proxy_introspect (_tmp1_, &_inner_error0_);
	xml = _tmp2_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		_g_object_unref0 (introspectable);
		return;
	}
	_tmp3_ = xml;
	_tmp4_ = g_dbus_node_info_new_for_xml (_tmp3_, &_inner_error0_);
	node = _tmp4_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		_g_free0 (xml);
		_g_object_unref0 (introspectable);
		return;
	}
	_tmp5_ = node;
	_tmp6_ = g_dbus_node_info_lookup_interface (_tmp5_, "org.gnome.Shell.Screenshot");
	_tmp7_ = _g_dbus_interface_info_ref0 (_tmp6_);
	iface = _tmp7_;
	_tmp9_ = iface;
	_tmp10_ = g_dbus_interface_info_lookup_method (_tmp9_, "ConcealText");
	if (_tmp10_ != NULL) {
		gboolean _tmp11_;
		gboolean _tmp12_;
		_tmp11_ = screenshot_screenshot_backend_get_is_redacted_font_available (self);
		_tmp12_ = _tmp11_;
		_tmp8_ = _tmp12_;
	} else {
		_tmp8_ = FALSE;
	}
	self->priv->can_conceal_text = _tmp8_;
	_tmp13_ = iface;
	_tmp14_ = g_dbus_interface_info_lookup_method (_tmp13_, "ScreenshotAreaWithCursor");
	if (_tmp14_ != NULL) {
		self->priv->can_screenshot_area_with_cursor = TRUE;
	}
	_g_dbus_interface_info_unref0 (iface);
	_g_dbus_node_info_unref0 (node);
	_g_free0 (xml);
	_g_object_unref0 (introspectable);
}

static void
screenshot_screenshot_backend_capture_data_free (gpointer _data)
{
	ScreenshotScreenshotBackendCaptureData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (ScreenshotScreenshotBackendCaptureData, _data_);
}

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

void
screenshot_screenshot_backend_capture (ScreenshotScreenshotBackend* self,
                                       ScreenshotCaptureType type,
                                       gint delay,
                                       gboolean include_pointer,
                                       gboolean redact,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_)
{
	ScreenshotScreenshotBackendCaptureData* _data_;
	ScreenshotScreenshotBackend* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (ScreenshotScreenshotBackendCaptureData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, screenshot_screenshot_backend_capture_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->type = type;
	_data_->delay = delay;
	_data_->include_pointer = include_pointer;
	_data_->redact = redact;
	screenshot_screenshot_backend_capture_co (_data_);
}

GdkPixbuf*
screenshot_screenshot_backend_capture_finish (ScreenshotScreenshotBackend* self,
                                              GAsyncResult* _res_,
                                              GError** error)
{
	GdkPixbuf* result;
	ScreenshotScreenshotBackendCaptureData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static GdkRectangle*
_vala_GdkRectangle_copy (GdkRectangle* self)
{
	return g_boxed_copy (gdk_rectangle_get_type (), self);
}

static gpointer
__vala_GdkRectangle_copy0 (gpointer self)
{
	return self ? _vala_GdkRectangle_copy (self) : NULL;
}

static void
_vala_GdkRectangle_free (GdkRectangle* self)
{
	g_boxed_free (gdk_rectangle_get_type (), self);
}

static void
screenshot_screenshot_backend_capture_ready (GObject* source_object,
                                             GAsyncResult* _res_,
                                             gpointer _user_data_)
{
	ScreenshotScreenshotBackendCaptureData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	screenshot_screenshot_backend_capture_co (_data_);
}

static gboolean
screenshot_screenshot_backend_capture_co (ScreenshotScreenshotBackendCaptureData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		case 5:
		goto _state_5;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->rect = NULL;
	_data_->redact = _data_->redact & _data_->self->priv->can_conceal_text;
	if (_data_->type == SCREENSHOT_CAPTURE_TYPE_AREA) {
		memset (&_data_->_tmp0_, 0, sizeof (GdkRectangle));
		_data_->_tmp1_ = __vala_GdkRectangle_copy0 (&_data_->_tmp0_);
		__vala_GdkRectangle_free0 (_data_->rect);
		_data_->rect = _data_->_tmp1_;
		_data_->_tmp2_ = _data_->self->priv->proxy;
		_data_->_tmp3_ = _data_->rect;
		_data_->_tmp4_ = _data_->rect;
		_data_->_tmp5_ = _data_->rect;
		_data_->_tmp6_ = _data_->rect;
		_data_->_tmp7_ = 0;
		_data_->_tmp8_ = 0;
		_data_->_tmp9_ = 0;
		_data_->_tmp10_ = 0;
		_data_->_state_ = 1;
		screenshot_screenshot_proxy_select_area (_data_->_tmp2_, screenshot_screenshot_backend_capture_ready, _data_);
		return FALSE;
		_state_1:
		screenshot_screenshot_proxy_select_area_finish (_data_->_tmp2_, _data_->_res_, &_data_->_tmp7_, &_data_->_tmp8_, &_data_->_tmp9_, &_data_->_tmp10_, &_data_->_inner_error0_);
		(*_data_->_tmp3_).x = _data_->_tmp7_;
		(*_data_->_tmp4_).y = _data_->_tmp8_;
		(*_data_->_tmp5_).width = _data_->_tmp9_;
		(*_data_->_tmp6_).height = _data_->_tmp10_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			__vala_GdkRectangle_free0 (_data_->rect);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->_state_ = 2;
	screenshot_screenshot_backend_sleep (_data_->self, screenshot_screenshot_backend_get_timeout (_data_->self, _data_->delay, _data_->redact), screenshot_screenshot_backend_capture_ready, _data_);
	return FALSE;
	_state_2:
	screenshot_screenshot_backend_sleep_finish (_data_->self, _data_->_res_);
	if (_data_->redact) {
		_data_->_tmp11_ = _data_->self->priv->proxy;
		_data_->_state_ = 3;
		screenshot_screenshot_proxy_conceal_text (_data_->_tmp11_, screenshot_screenshot_backend_capture_ready, _data_);
		return FALSE;
		_state_3:
		screenshot_screenshot_proxy_conceal_text_finish (_data_->_tmp11_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			__vala_GdkRectangle_free0 (_data_->rect);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_state_ = 4;
		screenshot_screenshot_backend_sleep (_data_->self, 1000, screenshot_screenshot_backend_capture_ready, _data_);
		return FALSE;
		_state_4:
		screenshot_screenshot_backend_sleep_finish (_data_->self, _data_->_res_);
	}
	_data_->_tmp12_ = _data_->rect;
	_data_->_state_ = 5;
	screenshot_screenshot_backend_get_pixbuf (_data_->self, _data_->_tmp12_, _data_->type, _data_->include_pointer, screenshot_screenshot_backend_capture_ready, _data_);
	return FALSE;
	_state_5:
	_data_->_tmp13_ = screenshot_screenshot_backend_get_pixbuf_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->pixbuf = _data_->_tmp13_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		__vala_GdkRectangle_free0 (_data_->rect);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->result = _data_->pixbuf;
	__vala_GdkRectangle_free0 (_data_->rect);
	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
screenshot_screenshot_backend_sleep_data_free (gpointer _data)
{
	ScreenshotScreenshotBackendSleepData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (ScreenshotScreenshotBackendSleepData, _data_);
}

static void
screenshot_screenshot_backend_sleep (ScreenshotScreenshotBackend* self,
                                     gint delay,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	ScreenshotScreenshotBackendSleepData* _data_;
	ScreenshotScreenshotBackend* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (ScreenshotScreenshotBackendSleepData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, screenshot_screenshot_backend_sleep_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->delay = delay;
	screenshot_screenshot_backend_sleep_co (_data_);
}

static void
screenshot_screenshot_backend_sleep_finish (ScreenshotScreenshotBackend* self,
                                            GAsyncResult* _res_)
{
	ScreenshotScreenshotBackendSleepData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block5Data*
block5_data_ref (Block5Data* _data5_)
{
	g_atomic_int_inc (&_data5_->_ref_count_);
	return _data5_;
}

static void
block5_data_unref (void * _userdata_)
{
	Block5Data* _data5_;
	_data5_ = (Block5Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data5_->_ref_count_)) {
		ScreenshotScreenshotBackend* self;
		self = _data5_->self;
		_g_object_unref0 (self);
		g_slice_free (Block5Data, _data5_);
	}
}

static gboolean
__lambda16_ (Block5Data* _data5_)
{
	ScreenshotScreenshotBackend* self;
	gboolean result;
	self = _data5_->self;
	screenshot_screenshot_backend_sleep_co (_data5_->_async_data_);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda16__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda16_ (self);
	return result;
}

static gboolean
screenshot_screenshot_backend_sleep_co (ScreenshotScreenshotBackendSleepData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data5_ = g_slice_new0 (Block5Data);
	_data_->_data5_->_ref_count_ = 1;
	_data_->_data5_->self = g_object_ref (_data_->self);
	_data_->_data5_->_async_data_ = _data_;
	g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) _data_->delay, ___lambda16__gsource_func, block5_data_ref (_data_->_data5_), block5_data_unref);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	block5_data_unref (_data_->_data5_);
	_data_->_data5_ = 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 gint
screenshot_screenshot_backend_get_timeout (ScreenshotScreenshotBackend* self,
                                           gint delay,
                                           gboolean redact)
{
	gint timeout = 0;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	timeout = delay * 1000;
	if (redact) {
		timeout -= 1000;
	}
	if (timeout < 300) {
		timeout = 300;
	}
	result = timeout;
	return result;
}

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

static void
screenshot_screenshot_backend_screenshot_area (ScreenshotScreenshotBackend* self,
                                               gint x,
                                               gint y,
                                               gint width,
                                               gint height,
                                               gboolean include_cursor,
                                               gboolean flash,
                                               const gchar* filename,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_)
{
	ScreenshotScreenshotBackendScreenshotAreaData* _data_;
	ScreenshotScreenshotBackend* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (filename != NULL);
	_data_ = g_slice_new0 (ScreenshotScreenshotBackendScreenshotAreaData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, screenshot_screenshot_backend_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_->include_cursor = include_cursor;
	_data_->flash = flash;
	_tmp1_ = g_strdup (filename);
	_g_free0 (_data_->filename);
	_data_->filename = _tmp1_;
	screenshot_screenshot_backend_screenshot_area_co (_data_);
}

static void
screenshot_screenshot_backend_screenshot_area_finish (ScreenshotScreenshotBackend* self,
                                                      GAsyncResult* _res_,
                                                      gboolean* success,
                                                      gchar** filename_used,
                                                      GError** error)
{
	ScreenshotScreenshotBackendScreenshotAreaData* _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
screenshot_screenshot_backend_screenshot_area_ready (GObject* source_object,
                                                     GAsyncResult* _res_,
                                                     gpointer _user_data_)
{
	ScreenshotScreenshotBackendScreenshotAreaData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	screenshot_screenshot_backend_screenshot_area_co (_data_);
}

static gboolean
screenshot_screenshot_backend_screenshot_area_co (ScreenshotScreenshotBackendScreenshotAreaData* _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_->include_cursor) {
		_data_->_tmp0_ = _data_->self->priv->can_screenshot_area_with_cursor;
	} else {
		_data_->_tmp0_ = FALSE;
	}
	if (_data_->_tmp0_) {
		_data_->_tmp1_ = _data_->self->priv->proxy;
		_data_->_tmp2_ = FALSE;
		_data_->_tmp3_ = NULL;
		_data_->_state_ = 1;
		screenshot_screenshot_proxy_screenshot_area_with_cursor (_data_->_tmp1_, _data_->x, _data_->y, _data_->width, _data_->height, TRUE, _data_->flash, _data_->filename, screenshot_screenshot_backend_screenshot_area_ready, _data_);
		return FALSE;
		_state_1:
		screenshot_screenshot_proxy_screenshot_area_with_cursor_finish (_data_->_tmp1_, _data_->_res_, &_data_->_tmp2_, &_data_->_tmp3_, &_data_->_inner_error0_);
		_data_->success = _data_->_tmp2_;
		_g_free0 (_data_->filename_used);
		_data_->filename_used = _data_->_tmp3_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_free0 (_data_->filename_used);
			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;
	}
	_data_->_tmp4_ = _data_->self->priv->proxy;
	_data_->_tmp5_ = FALSE;
	_data_->_tmp6_ = NULL;
	_data_->_state_ = 2;
	screenshot_screenshot_proxy_screenshot_area (_data_->_tmp4_, _data_->x, _data_->y, _data_->width, _data_->height, _data_->flash, _data_->filename, screenshot_screenshot_backend_screenshot_area_ready, _data_);
	return FALSE;
	_state_2:
	screenshot_screenshot_proxy_screenshot_area_finish (_data_->_tmp4_, _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_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_free0 (_data_->filename_used);
		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
screenshot_screenshot_backend_get_pixbuf_data_free (gpointer _data)
{
	ScreenshotScreenshotBackendGetPixbufData* _data_;
	_data_ = _data;
	__vala_GdkRectangle_free0 (_data_->rect);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (ScreenshotScreenshotBackendGetPixbufData, _data_);
}

static void
screenshot_screenshot_backend_get_pixbuf (ScreenshotScreenshotBackend* self,
                                          GdkRectangle* rect,
                                          ScreenshotCaptureType type,
                                          gboolean include_pointer,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_)
{
	ScreenshotScreenshotBackendGetPixbufData* _data_;
	ScreenshotScreenshotBackend* _tmp0_;
	GdkRectangle* _tmp1_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (ScreenshotScreenshotBackendGetPixbufData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, screenshot_screenshot_backend_get_pixbuf_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = __vala_GdkRectangle_copy0 (rect);
	__vala_GdkRectangle_free0 (_data_->rect);
	_data_->rect = _tmp1_;
	_data_->type = type;
	_data_->include_pointer = include_pointer;
	screenshot_screenshot_backend_get_pixbuf_co (_data_);
}

static GdkPixbuf*
screenshot_screenshot_backend_get_pixbuf_finish (ScreenshotScreenshotBackend* self,
                                                 GAsyncResult* _res_,
                                                 GError** error)
{
	GdkPixbuf* result;
	ScreenshotScreenshotBackendGetPixbufData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
screenshot_screenshot_backend_get_pixbuf_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_)
{
	ScreenshotScreenshotBackendGetPixbufData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	screenshot_screenshot_backend_get_pixbuf_co (_data_);
}

static gboolean
screenshot_screenshot_backend_get_pixbuf_co (ScreenshotScreenshotBackendGetPixbufData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		case 5:
		goto _state_5;
		case 6:
		goto _state_6;
		case 7:
		goto _state_7;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->success = FALSE;
	_data_->_tmp0_ = g_strdup ("");
	_data_->filename_used = _data_->_tmp0_;
	_data_->_tmp1_ = screenshot_screenshot_backend_get_tmp_filename (_data_->self);
	_data_->tmp_filename = _data_->_tmp1_;
	switch (_data_->type) {
		case SCREENSHOT_CAPTURE_TYPE_SCREEN:
		{
			_data_->_tmp2_ = _data_->self->priv->proxy;
			_data_->_tmp3_ = _data_->tmp_filename;
			_data_->_tmp4_ = FALSE;
			_data_->_tmp5_ = NULL;
			_data_->_state_ = 1;
			screenshot_screenshot_proxy_screenshot (_data_->_tmp2_, _data_->include_pointer, FALSE, _data_->_tmp3_, screenshot_screenshot_backend_get_pixbuf_ready, _data_);
			return FALSE;
			_state_1:
			screenshot_screenshot_proxy_screenshot_finish (_data_->_tmp2_, _data_->_res_, &_data_->_tmp4_, &_data_->_tmp5_, &_data_->_inner_error0_);
			_data_->success = _data_->_tmp4_;
			_g_free0 (_data_->filename_used);
			_data_->filename_used = _data_->_tmp5_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				_g_free0 (_data_->tmp_filename);
				_g_free0 (_data_->filename_used);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			break;
		}
		case SCREENSHOT_CAPTURE_TYPE_CURRENT_WINDOW:
		{
			_data_->_tmp6_ = _data_->self->priv->proxy;
			_data_->_tmp7_ = _data_->tmp_filename;
			_data_->_tmp8_ = FALSE;
			_data_->_tmp9_ = NULL;
			_data_->_state_ = 2;
			screenshot_screenshot_proxy_screenshot_window (_data_->_tmp6_, TRUE, _data_->include_pointer, FALSE, _data_->_tmp7_, screenshot_screenshot_backend_get_pixbuf_ready, _data_);
			return FALSE;
			_state_2:
			screenshot_screenshot_proxy_screenshot_window_finish (_data_->_tmp6_, _data_->_res_, &_data_->_tmp8_, &_data_->_tmp9_, &_data_->_inner_error0_);
			_data_->success = _data_->_tmp8_;
			_g_free0 (_data_->filename_used);
			_data_->filename_used = _data_->_tmp9_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				_g_free0 (_data_->tmp_filename);
				_g_free0 (_data_->filename_used);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			break;
		}
		case SCREENSHOT_CAPTURE_TYPE_AREA:
		{
			if (_data_->rect == NULL) {
				_data_->result = NULL;
				_g_free0 (_data_->tmp_filename);
				_g_free0 (_data_->filename_used);
				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;
			}
			_data_->_tmp10_ = _data_->tmp_filename;
			_data_->_tmp11_ = FALSE;
			_data_->_tmp12_ = NULL;
			_data_->_state_ = 3;
			screenshot_screenshot_backend_screenshot_area (_data_->self, (*_data_->rect).x, (*_data_->rect).y, (*_data_->rect).width, (*_data_->rect).height, _data_->include_pointer, FALSE, _data_->_tmp10_, screenshot_screenshot_backend_get_pixbuf_ready, _data_);
			return FALSE;
			_state_3:
			screenshot_screenshot_backend_screenshot_area_finish (_data_->self, _data_->_res_, &_data_->_tmp11_, &_data_->_tmp12_, &_data_->_inner_error0_);
			_data_->success = _data_->_tmp11_;
			_g_free0 (_data_->filename_used);
			_data_->filename_used = _data_->_tmp12_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				_g_free0 (_data_->tmp_filename);
				_g_free0 (_data_->filename_used);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			break;
		}
		default:
		break;
	}
	if (!_data_->success) {
		_data_->result = NULL;
		_g_free0 (_data_->tmp_filename);
		_g_free0 (_data_->filename_used);
		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;
	}
	_data_->_tmp13_ = _data_->filename_used;
	_data_->_tmp14_ = g_file_new_for_path (_data_->_tmp13_);
	_data_->file = _data_->_tmp14_;
	_data_->_tmp15_ = _data_->file;
	_data_->_state_ = 4;
	g_file_read_async (_data_->_tmp15_, G_PRIORITY_DEFAULT, NULL, screenshot_screenshot_backend_get_pixbuf_ready, _data_);
	return FALSE;
	_state_4:
	_data_->_tmp16_ = g_file_read_finish (_data_->_tmp15_, _data_->_res_, &_data_->_inner_error0_);
	_data_->stream = _data_->_tmp16_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->file);
		_g_free0 (_data_->tmp_filename);
		_g_free0 (_data_->filename_used);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp17_ = _data_->stream;
	_data_->_state_ = 5;
	gdk_pixbuf_new_from_stream_async ((GInputStream*) _data_->_tmp17_, NULL, screenshot_screenshot_backend_get_pixbuf_ready, _data_);
	return FALSE;
	_state_5:
	_data_->_tmp18_ = (GdkPixbuf*) gdk_pixbuf_new_from_stream_finish (_data_->_res_, &_data_->_inner_error0_);
	_data_->pixbuf = _data_->_tmp18_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->stream);
		_g_object_unref0 (_data_->file);
		_g_free0 (_data_->tmp_filename);
		_g_free0 (_data_->filename_used);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp19_ = _data_->stream;
	_data_->_state_ = 6;
	g_input_stream_close_async ((GInputStream*) _data_->_tmp19_, G_PRIORITY_DEFAULT, NULL, screenshot_screenshot_backend_get_pixbuf_ready, _data_);
	return FALSE;
	_state_6:
	g_input_stream_close_finish ((GInputStream*) _data_->_tmp19_, _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->pixbuf);
		_g_object_unref0 (_data_->stream);
		_g_object_unref0 (_data_->file);
		_g_free0 (_data_->tmp_filename);
		_g_free0 (_data_->filename_used);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp20_ = _data_->file;
	_data_->_state_ = 7;
	g_file_delete_async (_data_->_tmp20_, G_PRIORITY_DEFAULT, NULL, screenshot_screenshot_backend_get_pixbuf_ready, _data_);
	return FALSE;
	_state_7:
	g_file_delete_finish (_data_->_tmp20_, _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->pixbuf);
		_g_object_unref0 (_data_->stream);
		_g_object_unref0 (_data_->file);
		_g_free0 (_data_->tmp_filename);
		_g_free0 (_data_->filename_used);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->result = _data_->pixbuf;
	_g_object_unref0 (_data_->stream);
	_g_object_unref0 (_data_->file);
	_g_free0 (_data_->tmp_filename);
	_g_free0 (_data_->filename_used);
	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*
screenshot_screenshot_backend_get_tmp_filename (ScreenshotScreenshotBackend* self)
{
	gchar* dir = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* name = NULL;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_get_user_cache_dir ();
	_tmp1_ = g_strdup (_tmp0_);
	dir = _tmp1_;
	_tmp2_ = g_strdup_printf ("io.elementary.screenshot-%lu.png", (gulong) g_random_int ());
	name = _tmp2_;
	_tmp3_ = g_build_filename (dir, name, NULL);
	result = _tmp3_;
	_g_free0 (name);
	_g_free0 (dir);
	return result;
}

ScreenshotScreenshotBackend*
screenshot_screenshot_backend_construct (GType object_type)
{
	ScreenshotScreenshotBackend * self = NULL;
	self = (ScreenshotScreenshotBackend*) g_object_new (object_type, NULL);
	return self;
}

ScreenshotScreenshotBackend*
screenshot_screenshot_backend_new (void)
{
	return screenshot_screenshot_backend_construct (SCREENSHOT_TYPE_SCREENSHOT_BACKEND);
}

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
screenshot_screenshot_backend_get_is_redacted_font_available (ScreenshotScreenshotBackend* 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 GObject *
screenshot_screenshot_backend_constructor (GType type,
                                           guint n_construct_properties,
                                           GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ScreenshotScreenshotBackend * self;
	GError* _inner_error0_ = NULL;
	parent_class = G_OBJECT_CLASS (screenshot_screenshot_backend_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SCREENSHOT_TYPE_SCREENSHOT_BACKEND, ScreenshotScreenshotBackend);
	{
		ScreenshotScreenshotProxy* _tmp0_ = NULL;
		ScreenshotScreenshotProxy* _tmp1_;
		ScreenshotScreenshotProxy* _tmp2_;
		_tmp1_ = (ScreenshotScreenshotProxy*) g_initable_new (SCREENSHOT_TYPE_SCREENSHOT_PROXY_PROXY, NULL, &_inner_error0_, "g-flags", 0, "g-name", "org.gnome.Shell.Screenshot", "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/org/gnome/Shell/Screenshot", "g-interface-name", "org.gnome.Shell.Screenshot", NULL);
		_tmp0_ = (ScreenshotScreenshotProxy*) _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp2_ = _tmp0_;
		_tmp0_ = NULL;
		_g_object_unref0 (self->priv->proxy);
		self->priv->proxy = _tmp2_;
		screenshot_screenshot_backend_get_capabilities (self, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (_tmp0_);
			goto __catch0_g_error;
		}
		_g_object_unref0 (_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp3_;
		const gchar* _tmp4_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp3_ = e;
		_tmp4_ = _tmp3_->message;
		g_error ("ScreenshotBackend.vala:57: Couldn't get dbus proxy: %s\n", _tmp4_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
	}
	return obj;
}

static void
screenshot_screenshot_backend_class_init (ScreenshotScreenshotBackendClass * klass,
                                          gpointer klass_data)
{
	screenshot_screenshot_backend_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ScreenshotScreenshotBackend_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_screenshot_screenshot_backend_get_property;
	G_OBJECT_CLASS (klass)->constructor = screenshot_screenshot_backend_constructor;
	G_OBJECT_CLASS (klass)->finalize = screenshot_screenshot_backend_finalize;
}

static void
screenshot_screenshot_backend_instance_init (ScreenshotScreenshotBackend * self,
                                             gpointer klass)
{
	self->priv = screenshot_screenshot_backend_get_instance_private (self);
	self->priv->can_conceal_text = FALSE;
	self->priv->can_screenshot_area_with_cursor = FALSE;
	self->priv->_is_redacted_font_available = NULL;
}

static void
screenshot_screenshot_backend_finalize (GObject * obj)
{
	ScreenshotScreenshotBackend * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SCREENSHOT_TYPE_SCREENSHOT_BACKEND, ScreenshotScreenshotBackend);
	_g_object_unref0 (self->priv->proxy);
	_g_free0 (self->priv->_is_redacted_font_available);
	G_OBJECT_CLASS (screenshot_screenshot_backend_parent_class)->finalize (obj);
}

static GType
screenshot_screenshot_backend_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ScreenshotScreenshotBackendClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) screenshot_screenshot_backend_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ScreenshotScreenshotBackend), 0, (GInstanceInitFunc) screenshot_screenshot_backend_instance_init, NULL };
	GType screenshot_screenshot_backend_type_id;
	screenshot_screenshot_backend_type_id = g_type_register_static (G_TYPE_OBJECT, "ScreenshotScreenshotBackend", &g_define_type_info, 0);
	ScreenshotScreenshotBackend_private_offset = g_type_add_instance_private (screenshot_screenshot_backend_type_id, sizeof (ScreenshotScreenshotBackendPrivate));
	return screenshot_screenshot_backend_type_id;
}

GType
screenshot_screenshot_backend_get_type (void)
{
	static volatile gsize screenshot_screenshot_backend_type_id__once = 0;
	if (g_once_init_enter (&screenshot_screenshot_backend_type_id__once)) {
		GType screenshot_screenshot_backend_type_id;
		screenshot_screenshot_backend_type_id = screenshot_screenshot_backend_get_type_once ();
		g_once_init_leave (&screenshot_screenshot_backend_type_id__once, screenshot_screenshot_backend_type_id);
	}
	return screenshot_screenshot_backend_type_id__once;
}

static void
_vala_screenshot_screenshot_backend_get_property (GObject * object,
                                                  guint property_id,
                                                  GValue * value,
                                                  GParamSpec * pspec)
{
	ScreenshotScreenshotBackend * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SCREENSHOT_TYPE_SCREENSHOT_BACKEND, ScreenshotScreenshotBackend);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

