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

#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gio/gio.h>
#include <gtk/gtk.h>
#include <canberra.h>
#include <canberra-gtk.h>
#include <gobject/gvaluecollector.h>
#include "budgie-waylandclient.h"
#include <gdk/gdk.h>
#include <gtk-layer-shell/gtk-layer-shell.h>
#include <glib/gi18n-lib.h>
#include <float.h>
#include <math.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <pango/pango.h>
#include <locale.h>
#include <budgie-config.h>

#define BUDGIE_SELECTION "Selection"
#define BUDGIE_WINDOW "Window"
#define BUDGIE_SCREEN "Screen"
#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

typedef enum  {
	BUDGIE_WINDOW_STATE_NONE,
	BUDGIE_WINDOW_STATE_MAINWINDOW,
	BUDGIE_WINDOW_STATE_SELECTINGAREA,
	BUDGIE_WINDOW_STATE_AFTERSHOT,
	BUDGIE_WINDOW_STATE_WAITINGFORSHOT
} BudgieWindowState;

#define BUDGIE_TYPE_WINDOW_STATE (budgie_window_state_get_type ())
typedef enum  {
	BUDGIE_BUTTON_PLACEMENT_LEFT,
	BUDGIE_BUTTON_PLACEMENT_RIGHT
} BudgieButtonPlacement;

#define BUDGIE_TYPE_BUTTON_PLACEMENT (budgie_button_placement_get_type ())

#define BUDGIE_TYPE_CURRENT_STATE (budgie_current_state_get_type ())
#define BUDGIE_CURRENT_STATE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BUDGIE_TYPE_CURRENT_STATE, BudgieCurrentState))
#define BUDGIE_CURRENT_STATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BUDGIE_TYPE_CURRENT_STATE, BudgieCurrentStateClass))
#define BUDGIE_IS_CURRENT_STATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUDGIE_TYPE_CURRENT_STATE))
#define BUDGIE_IS_CURRENT_STATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BUDGIE_TYPE_CURRENT_STATE))
#define BUDGIE_CURRENT_STATE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BUDGIE_TYPE_CURRENT_STATE, BudgieCurrentStateClass))

typedef struct _BudgieCurrentState BudgieCurrentState;
typedef struct _BudgieCurrentStateClass BudgieCurrentStateClass;
typedef struct _BudgieCurrentStatePrivate BudgieCurrentStatePrivate;
enum  {
	BUDGIE_CURRENT_STATE_0_PROPERTY,
	BUDGIE_CURRENT_STATE_SCREENSHOT_SETTINGS_PROPERTY,
	BUDGIE_CURRENT_STATE_NEWSTATE_PROPERTY,
	BUDGIE_CURRENT_STATE_SHOWTOOLTIPS_PROPERTY,
	BUDGIE_CURRENT_STATE_EMIT_CAPTURE_SOUND_PROPERTY,
	BUDGIE_CURRENT_STATE_BUTTONPOS_PROPERTY,
	BUDGIE_CURRENT_STATE_TEMPFILE_PATH_PROPERTY,
	BUDGIE_CURRENT_STATE_STARTEDFROMGUI_PROPERTY,
	BUDGIE_CURRENT_STATE_NUM_PROPERTIES
};
static GParamSpec* budgie_current_state_properties[BUDGIE_CURRENT_STATE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	BUDGIE_CURRENT_STATE_BUTTONPOS_CHANGED_SIGNAL,
	BUDGIE_CURRENT_STATE_NUM_SIGNALS
};
static guint budgie_current_state_signals[BUDGIE_CURRENT_STATE_NUM_SIGNALS] = {0};

#define BUDGIE_TYPE_SCREENSHOT_SERVER (budgie_screenshot_server_get_type ())
#define BUDGIE_SCREENSHOT_SERVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BUDGIE_TYPE_SCREENSHOT_SERVER, BudgieScreenshotServer))
#define BUDGIE_SCREENSHOT_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BUDGIE_TYPE_SCREENSHOT_SERVER, BudgieScreenshotServerClass))
#define BUDGIE_IS_SCREENSHOT_SERVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUDGIE_TYPE_SCREENSHOT_SERVER))
#define BUDGIE_IS_SCREENSHOT_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BUDGIE_TYPE_SCREENSHOT_SERVER))
#define BUDGIE_SCREENSHOT_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BUDGIE_TYPE_SCREENSHOT_SERVER, BudgieScreenshotServerClass))

typedef struct _BudgieScreenshotServer BudgieScreenshotServer;
typedef struct _BudgieScreenshotServerClass BudgieScreenshotServerClass;
typedef struct _BudgieScreenshotServerPrivate BudgieScreenshotServerPrivate;
enum  {
	BUDGIE_SCREENSHOT_SERVER_0_PROPERTY,
	BUDGIE_SCREENSHOT_SERVER_NUM_PROPERTIES
};
static GParamSpec* budgie_screenshot_server_properties[BUDGIE_SCREENSHOT_SERVER_NUM_PROPERTIES];

#define BUDGIE_TYPE_SCREENSHOT_HOME_WINDOW (budgie_screenshot_home_window_get_type ())
#define BUDGIE_SCREENSHOT_HOME_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BUDGIE_TYPE_SCREENSHOT_HOME_WINDOW, BudgieScreenshotHomeWindow))
#define BUDGIE_SCREENSHOT_HOME_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BUDGIE_TYPE_SCREENSHOT_HOME_WINDOW, BudgieScreenshotHomeWindowClass))
#define BUDGIE_IS_SCREENSHOT_HOME_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUDGIE_TYPE_SCREENSHOT_HOME_WINDOW))
#define BUDGIE_IS_SCREENSHOT_HOME_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BUDGIE_TYPE_SCREENSHOT_HOME_WINDOW))
#define BUDGIE_SCREENSHOT_HOME_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BUDGIE_TYPE_SCREENSHOT_HOME_WINDOW, BudgieScreenshotHomeWindowClass))

typedef struct _BudgieScreenshotHomeWindow BudgieScreenshotHomeWindow;
typedef struct _BudgieScreenshotHomeWindowClass BudgieScreenshotHomeWindowClass;
typedef struct _budgie_screenshot_server_StartMainWindowData budgie_screenshot_server_StartMainWindowData;

#define BUDGIE_TYPE_SELECT_LAYER (budgie_select_layer_get_type ())
#define BUDGIE_SELECT_LAYER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BUDGIE_TYPE_SELECT_LAYER, BudgieSelectLayer))
#define BUDGIE_SELECT_LAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BUDGIE_TYPE_SELECT_LAYER, BudgieSelectLayerClass))
#define BUDGIE_IS_SELECT_LAYER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUDGIE_TYPE_SELECT_LAYER))
#define BUDGIE_IS_SELECT_LAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BUDGIE_TYPE_SELECT_LAYER))
#define BUDGIE_SELECT_LAYER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BUDGIE_TYPE_SELECT_LAYER, BudgieSelectLayerClass))

typedef struct _BudgieSelectLayer BudgieSelectLayer;
typedef struct _BudgieSelectLayerClass BudgieSelectLayerClass;
typedef struct _budgie_screenshot_server_StartAreaSelectData budgie_screenshot_server_StartAreaSelectData;

#define BUDGIE_TYPE_MAKE_SCREENSHOT (budgie_make_screenshot_get_type ())
#define BUDGIE_MAKE_SCREENSHOT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BUDGIE_TYPE_MAKE_SCREENSHOT, BudgieMakeScreenshot))
#define BUDGIE_MAKE_SCREENSHOT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BUDGIE_TYPE_MAKE_SCREENSHOT, BudgieMakeScreenshotClass))
#define BUDGIE_IS_MAKE_SCREENSHOT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUDGIE_TYPE_MAKE_SCREENSHOT))
#define BUDGIE_IS_MAKE_SCREENSHOT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BUDGIE_TYPE_MAKE_SCREENSHOT))
#define BUDGIE_MAKE_SCREENSHOT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BUDGIE_TYPE_MAKE_SCREENSHOT, BudgieMakeScreenshotClass))

typedef struct _BudgieMakeScreenshot BudgieMakeScreenshot;
typedef struct _BudgieMakeScreenshotClass BudgieMakeScreenshotClass;
#define _budgie_make_screenshot_unref0(var) ((var == NULL) ? NULL : (var = (budgie_make_screenshot_unref (var), NULL)))
typedef struct _budgie_screenshot_server_StartWindowScreenshotData budgie_screenshot_server_StartWindowScreenshotData;
typedef struct _budgie_screenshot_server_StartFullScreenshotData budgie_screenshot_server_StartFullScreenshotData;
typedef struct _budgie_screenshot_server_StartMainWindowReadyData budgie_screenshot_server_StartMainWindowReadyData;
typedef struct _budgie_screenshot_server_StartAreaSelectReadyData budgie_screenshot_server_StartAreaSelectReadyData;
typedef struct _budgie_screenshot_server_StartWindowScreenshotReadyData budgie_screenshot_server_StartWindowScreenshotReadyData;
typedef struct _budgie_screenshot_server_StartFullScreenshotReadyData budgie_screenshot_server_StartFullScreenshotReadyData;

#define BUDGIE_TYPE_SCREENSHOT_CLIENT (budgie_screenshot_client_get_type ())
#define BUDGIE_SCREENSHOT_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BUDGIE_TYPE_SCREENSHOT_CLIENT, BudgieScreenshotClient))
#define BUDGIE_IS_SCREENSHOT_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUDGIE_TYPE_SCREENSHOT_CLIENT))
#define BUDGIE_SCREENSHOT_CLIENT_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), BUDGIE_TYPE_SCREENSHOT_CLIENT, BudgieScreenshotClientIface))

typedef struct _BudgieScreenshotClient BudgieScreenshotClient;
typedef struct _BudgieScreenshotClientIface BudgieScreenshotClientIface;

#define BUDGIE_TYPE_SCREENSHOT_CLIENT_PROXY (budgie_screenshot_client_proxy_get_type ())
typedef GDBusProxy BudgieScreenshotClientProxy;
typedef GDBusProxyClass BudgieScreenshotClientProxyClass;
typedef struct _budgie_screenshot_client_ScreenshotAreaReadyData budgie_screenshot_client_ScreenshotAreaReadyData;
typedef struct _budgie_screenshot_client_ScreenshotReadyData budgie_screenshot_client_ScreenshotReadyData;
typedef struct _budgie_screenshot_client_ScreenshotWindowReadyData budgie_screenshot_client_ScreenshotWindowReadyData;
typedef struct _BudgieMakeScreenshotPrivate BudgieMakeScreenshotPrivate;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define BUDGIE_TYPE_AFTER_SHOT_WINDOW (budgie_after_shot_window_get_type ())
#define BUDGIE_AFTER_SHOT_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BUDGIE_TYPE_AFTER_SHOT_WINDOW, BudgieAfterShotWindow))
#define BUDGIE_AFTER_SHOT_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BUDGIE_TYPE_AFTER_SHOT_WINDOW, BudgieAfterShotWindowClass))
#define BUDGIE_IS_AFTER_SHOT_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUDGIE_TYPE_AFTER_SHOT_WINDOW))
#define BUDGIE_IS_AFTER_SHOT_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BUDGIE_TYPE_AFTER_SHOT_WINDOW))
#define BUDGIE_AFTER_SHOT_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BUDGIE_TYPE_AFTER_SHOT_WINDOW, BudgieAfterShotWindowClass))

typedef struct _BudgieAfterShotWindow BudgieAfterShotWindow;
typedef struct _BudgieAfterShotWindowClass BudgieAfterShotWindowClass;
typedef struct _BudgieMakeScreenshotShootWindowData BudgieMakeScreenshotShootWindowData;
typedef struct _BudgieMakeScreenshotShootScreenData BudgieMakeScreenshotShootScreenData;
typedef struct _BudgieMakeScreenshotShootAreaData BudgieMakeScreenshotShootAreaData;
#define _ca_proplist_destroy0(var) ((var == NULL) ? NULL : (var = (ca_proplist_destroy (var), NULL)))
typedef struct _BudgieParamSpecMakeScreenshot BudgieParamSpecMakeScreenshot;
typedef struct _BudgieScreenshotHomeWindowPrivate BudgieScreenshotHomeWindowPrivate;
enum  {
	BUDGIE_SCREENSHOT_HOME_WINDOW_0_PROPERTY,
	BUDGIE_SCREENSHOT_HOME_WINDOW_NUM_PROPERTIES
};
static GParamSpec* budgie_screenshot_home_window_properties[BUDGIE_SCREENSHOT_HOME_WINDOW_NUM_PROPERTIES];
typedef struct _Block1Data Block1Data;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
typedef struct _Block2Data Block2Data;
typedef struct _Block3Data Block3Data;
typedef struct _Block4Data Block4Data;
typedef struct _Block5Data Block5Data;
typedef struct _BudgieSelectLayerPrivate BudgieSelectLayerPrivate;
enum  {
	BUDGIE_SELECT_LAYER_0_PROPERTY,
	BUDGIE_SELECT_LAYER_NUM_PROPERTIES
};
static GParamSpec* budgie_select_layer_properties[BUDGIE_SELECT_LAYER_NUM_PROPERTIES];
typedef struct _BudgieSelectLayerTakeShotData BudgieSelectLayerTakeShotData;
typedef struct _BudgieAfterShotWindowPrivate BudgieAfterShotWindowPrivate;
enum  {
	BUDGIE_AFTER_SHOT_WINDOW_0_PROPERTY,
	BUDGIE_AFTER_SHOT_WINDOW_NUM_PROPERTIES
};
static GParamSpec* budgie_after_shot_window_properties[BUDGIE_AFTER_SHOT_WINDOW_NUM_PROPERTIES];
typedef enum  {
	BUDGIE_AFTER_SHOT_WINDOW_COLUMN_DIRPATH,
	BUDGIE_AFTER_SHOT_WINDOW_COLUMN_DISPLAYEDNAME,
	BUDGIE_AFTER_SHOT_WINDOW_COLUMN_ICON,
	BUDGIE_AFTER_SHOT_WINDOW_COLUMN_ISSEPARATOR
} BudgieAfterShotWindowColumn;

#define BUDGIE_AFTER_SHOT_WINDOW_TYPE_COLUMN (budgie_after_shot_window_column_get_type ())
typedef struct _Block6Data Block6Data;
typedef struct _Block7Data Block7Data;
typedef struct _Block8Data Block8Data;
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))

struct _BudgieCurrentState {
	GObject parent_instance;
	BudgieCurrentStatePrivate * priv;
};

struct _BudgieCurrentStateClass {
	GObjectClass parent_class;
};

struct _BudgieCurrentStatePrivate {
	GSettings* buttonplacement;
	GSettings* _screenshot_settings;
	gint _newstate;
	gboolean _showtooltips;
	gboolean _emit_capture_sound;
	gint _buttonpos;
	gchar* _tempfile_path;
	gboolean _startedfromgui;
};

struct _BudgieScreenshotServer {
	GObject parent_instance;
	BudgieScreenshotServerPrivate * priv;
};

struct _BudgieScreenshotServerClass {
	GObjectClass parent_class;
};

struct _BudgieScreenshotServerPrivate {
	BudgieCurrentState* windowstate;
};

struct _budgie_screenshot_server_StartMainWindowData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	BudgieScreenshotServer* self;
	BudgieScreenshotHomeWindow* _tmp0_;
	BudgieScreenshotHomeWindow* _tmp1_;
};

struct _budgie_screenshot_server_StartAreaSelectData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	BudgieScreenshotServer* self;
	BudgieSelectLayer* _tmp0_;
	BudgieSelectLayer* _tmp1_;
};

struct _budgie_screenshot_server_StartWindowScreenshotData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	BudgieScreenshotServer* self;
	BudgieMakeScreenshot* _tmp0_;
	BudgieMakeScreenshot* _tmp1_;
};

struct _budgie_screenshot_server_StartFullScreenshotData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	BudgieScreenshotServer* self;
	BudgieMakeScreenshot* _tmp0_;
	BudgieMakeScreenshot* _tmp1_;
};

struct _budgie_screenshot_server_StartMainWindowReadyData {
	GDBusMethodInvocation* _invocation_;
};

struct _budgie_screenshot_server_StartAreaSelectReadyData {
	GDBusMethodInvocation* _invocation_;
};

struct _budgie_screenshot_server_StartWindowScreenshotReadyData {
	GDBusMethodInvocation* _invocation_;
};

struct _budgie_screenshot_server_StartFullScreenshotReadyData {
	GDBusMethodInvocation* _invocation_;
};

struct _BudgieScreenshotClientIface {
	GTypeInterface parent_iface;
	void (*ScreenshotArea) (BudgieScreenshotClient* self, gint x, gint y, gint width, gint height, gboolean include_cursor, gboolean flash, const gchar* filename, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*ScreenshotArea_finish) (BudgieScreenshotClient* self, GAsyncResult* _res_, gboolean* success, gchar** filename_used, GError** error);
	void (*Screenshot) (BudgieScreenshotClient* self, gboolean include_cursor, gboolean flash, const gchar* filename, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*Screenshot_finish) (BudgieScreenshotClient* self, GAsyncResult* _res_, gboolean* success, gchar** filename_used, GError** error);
	void (*ScreenshotWindow) (BudgieScreenshotClient* self, gboolean include_frame, gboolean include_cursor, gboolean flash, const gchar* filename, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*ScreenshotWindow_finish) (BudgieScreenshotClient* self, GAsyncResult* _res_, gboolean* success, gchar** filename_used, GError** error);
	gboolean (*SupportScreenshotWindow) (BudgieScreenshotClient* self, GError** error);
};

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

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

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

struct _BudgieMakeScreenshot {
	GTypeInstance parent_instance;
	volatile int ref_count;
	BudgieMakeScreenshotPrivate * priv;
};

struct _BudgieMakeScreenshotClass {
	GTypeClass parent_class;
	void (*finalize) (BudgieMakeScreenshot *self);
};

struct _BudgieMakeScreenshotPrivate {
	gint delay;
	gint scale;
	gint* area;
	gint area_length1;
	gint _area_size_;
	gchar* screenshot_mode;
	gboolean include_cursor;
	gboolean include_frame;
	gboolean emit_capture_sound;
	BudgieCurrentState* windowstate;
};

struct _BudgieMakeScreenshotShootWindowData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	BudgieMakeScreenshot* self;
	gboolean success;
	gchar* filename_used;
	gchar* _tmp0_;
	BudgieScreenshotClient* _tmp1_;
	BudgieCurrentState* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	gboolean _tmp5_;
	gchar* _tmp6_;
	GError* e;
	GError* _tmp7_;
	const gchar* _tmp8_;
	BudgieCurrentState* _tmp9_;
	BudgieAfterShotWindow* _tmp10_;
	BudgieAfterShotWindow* _tmp11_;
	GError* _inner_error0_;
};

struct _BudgieMakeScreenshotShootScreenData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	BudgieMakeScreenshot* self;
	gboolean success;
	gchar* filename_used;
	gchar* _tmp0_;
	BudgieScreenshotClient* _tmp1_;
	BudgieCurrentState* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	gboolean _tmp5_;
	gchar* _tmp6_;
	GError* e;
	GError* _tmp7_;
	const gchar* _tmp8_;
	BudgieCurrentState* _tmp9_;
	BudgieAfterShotWindow* _tmp10_;
	BudgieAfterShotWindow* _tmp11_;
	GError* _inner_error0_;
};

struct _BudgieMakeScreenshotShootAreaData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	BudgieMakeScreenshot* self;
	gboolean success;
	gchar* filename_used;
	gchar* _tmp0_;
	gint topleftx;
	gint* _tmp1_;
	gint _tmp1__length1;
	gint _tmp2_;
	gint toplefty;
	gint* _tmp3_;
	gint _tmp3__length1;
	gint _tmp4_;
	gint width;
	gint* _tmp5_;
	gint _tmp5__length1;
	gint _tmp6_;
	gint height;
	gint* _tmp7_;
	gint _tmp7__length1;
	gint _tmp8_;
	gint _tmp9_;
	gint _tmp10_;
	BudgieScreenshotClient* _tmp11_;
	BudgieCurrentState* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	gboolean _tmp15_;
	gchar* _tmp16_;
	GError* e;
	GError* _tmp17_;
	const gchar* _tmp18_;
	BudgieCurrentState* _tmp19_;
	BudgieAfterShotWindow* _tmp20_;
	BudgieAfterShotWindow* _tmp21_;
	GError* _inner_error0_;
};

struct _BudgieParamSpecMakeScreenshot {
	GParamSpec parent_instance;
};

struct _BudgieScreenshotHomeWindow {
	GtkWindow parent_instance;
	BudgieScreenshotHomeWindowPrivate * priv;
};

struct _BudgieScreenshotHomeWindowClass {
	GtkWindowClass parent_class;
};

struct _BudgieScreenshotHomeWindowPrivate {
	GtkHeaderBar* topbar;
	BudgieCurrentState* windowstate;
	gint selectmode;
	gboolean ignore;
	GtkLabel** shortcutlabels;
	gint shortcutlabels_length1;
	gint _shortcutlabels_size_;
	gulong* button_id;
	GtkGrid* maingrid;
	GtkSpinButton* delayspin;
	GtkSwitch* showpointerswitch;
	GtkSwitch* screenshotcapturesoundswitch;
};

struct _Block1Data {
	int _ref_count_;
	BudgieScreenshotHomeWindow* self;
	BudgieWaylandClient* wayland_client;
};

struct _Block2Data {
	int _ref_count_;
	BudgieScreenshotHomeWindow* self;
	GtkPopover* helppopover;
};

struct _Block3Data {
	int _ref_count_;
	BudgieScreenshotHomeWindow* self;
	gchar* shootmode;
};

struct _Block4Data {
	int _ref_count_;
	BudgieScreenshotHomeWindow* self;
	GtkToggleButton** selectbuttons;
	gint selectbuttons_length1;
	gint _selectbuttons_size_;
};

struct _Block5Data {
	int _ref_count_;
	Block4Data * _data4_;
	GtkToggleButton* b;
};

struct _BudgieSelectLayer {
	GObject parent_instance;
	BudgieSelectLayerPrivate * priv;
};

struct _BudgieSelectLayerClass {
	GObjectClass parent_class;
};

struct _BudgieSelectLayerPrivate {
	gint topleftx;
	gint toplefty;
	gint width;
	gint height;
	BudgieCurrentState* windowstate;
};

struct _BudgieSelectLayerTakeShotData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	BudgieSelectLayer* self;
	BudgieCurrentState* _tmp0_;
	gint* area;
	gint* _tmp1_;
	gint area_length1;
	gint _area_size_;
	BudgieMakeScreenshot* _tmp2_;
	BudgieMakeScreenshot* _tmp3_;
};

struct _BudgieAfterShotWindow {
	GtkWindow parent_instance;
	BudgieAfterShotWindowPrivate * priv;
};

struct _BudgieAfterShotWindowClass {
	GtkWindowClass parent_class;
};

struct _BudgieAfterShotWindowPrivate {
	GtkEntry* filenameentry;
	GtkComboBox* pickdir_combo;
	GtkListStore* dir_liststore;
	GtkImage* img;
	GVolumeMonitor* monitor;
	gboolean act_ondropdown;
	gchar** custompath_row;
	gint custompath_row_length1;
	gint _custompath_row_size_;
	gchar** alldirs;
	gint alldirs_length1;
	gint _alldirs_size_;
	GtkButton** decisionbuttons;
	gint decisionbuttons_length1;
	gint _decisionbuttons_size_;
	gchar* extension;
	gint counted_dirs;
	BudgieCurrentState* windowstate;
	gulong* button_id;
};

struct _Block6Data {
	int _ref_count_;
	BudgieAfterShotWindow* self;
	BudgieWaylandClient* wayland_client;
};

struct _Block7Data {
	int _ref_count_;
	BudgieAfterShotWindow* self;
	GtkClipboard* clp;
	GtkHeaderBar* decisionbar;
	GdkPixbuf* pxb;
};

struct _Block8Data {
	int _ref_count_;
	BudgieAfterShotWindow* self;
	GtkEntry* filenameentry;
	GtkClipboard* clp;
	GdkPixbuf* pxb;
};

static gint BudgieCurrentState_private_offset;
static gpointer budgie_current_state_parent_class = NULL;
static gint BudgieScreenshotServer_private_offset;
static gpointer budgie_screenshot_server_parent_class = NULL;
static gint BudgieMakeScreenshot_private_offset;
static gpointer budgie_make_screenshot_parent_class = NULL;
static BudgieScreenshotClient* budgie_make_screenshot_client;
static BudgieScreenshotClient* budgie_make_screenshot_client = NULL;
static gint BudgieScreenshotHomeWindow_private_offset;
static gpointer budgie_screenshot_home_window_parent_class = NULL;
static gint BudgieSelectLayer_private_offset;
static gpointer budgie_select_layer_parent_class = NULL;
static gint BudgieAfterShotWindow_private_offset;
static gpointer budgie_after_shot_window_parent_class = NULL;

VALA_EXTERN GType budgie_window_state_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType budgie_button_placement_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType budgie_current_state_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BudgieCurrentState, g_object_unref)
VALA_EXTERN BudgieCurrentState* budgie_current_state_new (void);
VALA_EXTERN BudgieCurrentState* budgie_current_state_construct (GType object_type);
static void budgie_current_state_set_screenshot_settings (BudgieCurrentState* self,
                                                   GSettings* value);
static void __lambda4_ (BudgieCurrentState* self);
static void budgie_current_state_fill_buttonpos (BudgieCurrentState* self);
static void ___lambda4__g_settings_changed (GSettings* _sender,
                                     const gchar* key,
                                     gpointer self);
VALA_EXTERN GSettings* budgie_current_state_get_screenshot_settings (BudgieCurrentState* self);
VALA_EXTERN void budgie_current_state_set_emit_capture_sound (BudgieCurrentState* self,
                                                  gboolean value);
static void __lambda5_ (BudgieCurrentState* self);
static void ___lambda5__g_settings_changed (GSettings* _sender,
                                     const gchar* key,
                                     gpointer self);
VALA_EXTERN void budgie_current_state_set_showtooltips (BudgieCurrentState* self,
                                            gboolean value);
static void __lambda6_ (BudgieCurrentState* self);
static void ___lambda6__g_settings_changed (GSettings* _sender,
                                     const gchar* key,
                                     gpointer self);
static void budgie_current_state_set_tempfile_path (BudgieCurrentState* self,
                                             const gchar* value);
static void budgie_current_state_set_buttonpos (BudgieCurrentState* self,
                                         gint value);
VALA_EXTERN void budgie_current_state_statechanged (BudgieCurrentState* self,
                                        gint n);
static void budgie_current_state_set_newstate (BudgieCurrentState* self,
                                        gint value);
VALA_EXTERN gint budgie_current_state_get_newstate (BudgieCurrentState* self);
static void budgie_current_state_set_startedfromgui (BudgieCurrentState* self,
                                              gboolean value);
VALA_EXTERN gboolean budgie_current_state_get_startedfromgui (BudgieCurrentState* self);
VALA_EXTERN gboolean budgie_current_state_get_showtooltips (BudgieCurrentState* self);
VALA_EXTERN gboolean budgie_current_state_get_emit_capture_sound (BudgieCurrentState* self);
VALA_EXTERN gint budgie_current_state_get_buttonpos (BudgieCurrentState* self);
VALA_EXTERN const gchar* budgie_current_state_get_tempfile_path (BudgieCurrentState* self);
static GObject * budgie_current_state_constructor (GType type,
                                            guint n_construct_properties,
                                            GObjectConstructParam * construct_properties);
static void budgie_current_state_finalize (GObject * obj);
static GType budgie_current_state_get_type_once (void);
static void _vala_budgie_current_state_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec);
static void _vala_budgie_current_state_set_property (GObject * object,
                                              guint property_id,
                                              const GValue * value,
                                              GParamSpec * pspec);
VALA_EXTERN GType budgie_screenshot_server_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BudgieScreenshotServer, g_object_unref)
VALA_EXTERN guint budgie_screenshot_server_register_object (void* object,
                                                GDBusConnection* connection,
                                                const gchar* path,
                                                GError** error);
VALA_EXTERN BudgieScreenshotServer* budgie_screenshot_server_new (void);
VALA_EXTERN BudgieScreenshotServer* budgie_screenshot_server_construct (GType object_type);
static void budgie_screenshot_server_StartMainWindow_data_free (gpointer _data);
VALA_EXTERN void budgie_screenshot_server_StartMainWindow (BudgieScreenshotServer* self,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_);
VALA_EXTERN void budgie_screenshot_server_StartMainWindow_finish (BudgieScreenshotServer* self,
                                                      GAsyncResult* _res_,
                                                      GError** error);
static gboolean budgie_screenshot_server_StartMainWindow_co (budgie_screenshot_server_StartMainWindowData* _data_);
static gint budgie_screenshot_server_getcurrentstate (BudgieScreenshotServer* self);
VALA_EXTERN BudgieScreenshotHomeWindow* budgie_screenshot_home_window_new (void);
VALA_EXTERN BudgieScreenshotHomeWindow* budgie_screenshot_home_window_construct (GType object_type);
VALA_EXTERN GType budgie_screenshot_home_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BudgieScreenshotHomeWindow, g_object_unref)
static void budgie_screenshot_server_StartAreaSelect_data_free (gpointer _data);
VALA_EXTERN void budgie_screenshot_server_StartAreaSelect (BudgieScreenshotServer* self,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_);
VALA_EXTERN void budgie_screenshot_server_StartAreaSelect_finish (BudgieScreenshotServer* self,
                                                      GAsyncResult* _res_,
                                                      GError** error);
static gboolean budgie_screenshot_server_StartAreaSelect_co (budgie_screenshot_server_StartAreaSelectData* _data_);
static void budgie_screenshot_server_set_target (BudgieScreenshotServer* self,
                                          const gchar* target);
VALA_EXTERN BudgieSelectLayer* budgie_select_layer_new (gint* overrule_delay);
VALA_EXTERN BudgieSelectLayer* budgie_select_layer_construct (GType object_type,
                                                  gint* overrule_delay);
VALA_EXTERN GType budgie_select_layer_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BudgieSelectLayer, g_object_unref)
static void budgie_screenshot_server_StartWindowScreenshot_data_free (gpointer _data);
VALA_EXTERN void budgie_screenshot_server_StartWindowScreenshot (BudgieScreenshotServer* self,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_);
VALA_EXTERN void budgie_screenshot_server_StartWindowScreenshot_finish (BudgieScreenshotServer* self,
                                                            GAsyncResult* _res_,
                                                            GError** error);
static gboolean budgie_screenshot_server_StartWindowScreenshot_co (budgie_screenshot_server_StartWindowScreenshotData* _data_);
VALA_EXTERN BudgieMakeScreenshot* budgie_make_screenshot_new (gint* area,
                                                  gint area_length1);
VALA_EXTERN BudgieMakeScreenshot* budgie_make_screenshot_construct (GType object_type,
                                                        gint* area,
                                                        gint area_length1);
VALA_EXTERN gpointer budgie_make_screenshot_ref (gpointer instance);
VALA_EXTERN void budgie_make_screenshot_unref (gpointer instance);
VALA_EXTERN GParamSpec* budgie_param_spec_make_screenshot (const gchar* name,
                                               const gchar* nick,
                                               const gchar* blurb,
                                               GType object_type,
                                               GParamFlags flags);
VALA_EXTERN void budgie_value_set_make_screenshot (GValue* value,
                                       gpointer v_object);
VALA_EXTERN void budgie_value_take_make_screenshot (GValue* value,
                                        gpointer v_object);
VALA_EXTERN gpointer budgie_value_get_make_screenshot (const GValue* value);
VALA_EXTERN GType budgie_make_screenshot_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BudgieMakeScreenshot, budgie_make_screenshot_unref)
static void budgie_screenshot_server_StartFullScreenshot_data_free (gpointer _data);
VALA_EXTERN void budgie_screenshot_server_StartFullScreenshot (BudgieScreenshotServer* self,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_);
VALA_EXTERN void budgie_screenshot_server_StartFullScreenshot_finish (BudgieScreenshotServer* self,
                                                          GAsyncResult* _res_,
                                                          GError** error);
static gboolean budgie_screenshot_server_StartFullScreenshot_co (budgie_screenshot_server_StartFullScreenshotData* _data_);
static void budgie_screenshot_server_on_bus_acquired (BudgieScreenshotServer* self,
                                               GDBusConnection* conn);
VALA_EXTERN void budgie_screenshot_server_setup_dbus (BudgieScreenshotServer* self,
                                          GError** error);
static void _budgie_screenshot_server_on_bus_acquired_gbus_acquired_callback (GDBusConnection* connection,
                                                                       const gchar* name,
                                                                       gpointer self);
static void __lambda28_ (BudgieScreenshotServer* self);
static void ___lambda28__gbus_name_acquired_callback (GDBusConnection* connection,
                                               const gchar* name,
                                               gpointer self);
static void __lambda29_ (BudgieScreenshotServer* self);
static void ___lambda29__gbus_name_lost_callback (GDBusConnection* connection,
                                           const gchar* name,
                                           gpointer self);
static void budgie_screenshot_server_finalize (GObject * obj);
static GType budgie_screenshot_server_get_type_once (void);
static void _dbus_budgie_screenshot_server_StartMainWindow (BudgieScreenshotServer* self,
                                                     GVariant* _parameters_,
                                                     GDBusMethodInvocation* invocation);
static void _dbus_budgie_screenshot_server_StartMainWindow_ready (GObject * source_object,
                                                           GAsyncResult * _res_,
                                                           gpointer _user_data_);
static void _dbus_budgie_screenshot_server_StartAreaSelect (BudgieScreenshotServer* self,
                                                     GVariant* _parameters_,
                                                     GDBusMethodInvocation* invocation);
static void _dbus_budgie_screenshot_server_StartAreaSelect_ready (GObject * source_object,
                                                           GAsyncResult * _res_,
                                                           gpointer _user_data_);
static void _dbus_budgie_screenshot_server_StartWindowScreenshot (BudgieScreenshotServer* self,
                                                           GVariant* _parameters_,
                                                           GDBusMethodInvocation* invocation);
static void _dbus_budgie_screenshot_server_StartWindowScreenshot_ready (GObject * source_object,
                                                                 GAsyncResult * _res_,
                                                                 gpointer _user_data_);
static void _dbus_budgie_screenshot_server_StartFullScreenshot (BudgieScreenshotServer* self,
                                                         GVariant* _parameters_,
                                                         GDBusMethodInvocation* invocation);
static void _dbus_budgie_screenshot_server_StartFullScreenshot_ready (GObject * source_object,
                                                               GAsyncResult * _res_,
                                                               gpointer _user_data_);
static void _dbus_budgie_screenshot_server_setup_dbus (BudgieScreenshotServer* self,
                                                GVariant* _parameters_,
                                                GDBusMethodInvocation* invocation);
static void budgie_screenshot_server_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* budgie_screenshot_server_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 budgie_screenshot_server_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 _budgie_screenshot_server_unregister_object (gpointer user_data);
VALA_EXTERN GType budgie_screenshot_client_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint budgie_screenshot_client_register_object (void* object,
                                                GDBusConnection* connection,
                                                const gchar* path,
                                                GError** error);
VALA_EXTERN GType budgie_screenshot_client_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BudgieScreenshotClient, g_object_unref)
VALA_EXTERN void budgie_screenshot_client_ScreenshotArea (BudgieScreenshotClient* 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 budgie_screenshot_client_ScreenshotArea_finish (BudgieScreenshotClient* self,
                                                     GAsyncResult* _res_,
                                                     gboolean* success,
                                                     gchar** filename_used,
                                                     GError** error);
VALA_EXTERN void budgie_screenshot_client_Screenshot (BudgieScreenshotClient* self,
                                          gboolean include_cursor,
                                          gboolean flash,
                                          const gchar* filename,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_);
VALA_EXTERN void budgie_screenshot_client_Screenshot_finish (BudgieScreenshotClient* self,
                                                 GAsyncResult* _res_,
                                                 gboolean* success,
                                                 gchar** filename_used,
                                                 GError** error);
VALA_EXTERN void budgie_screenshot_client_ScreenshotWindow (BudgieScreenshotClient* self,
                                                gboolean include_frame,
                                                gboolean include_cursor,
                                                gboolean flash,
                                                const gchar* filename,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_);
VALA_EXTERN void budgie_screenshot_client_ScreenshotWindow_finish (BudgieScreenshotClient* self,
                                                       GAsyncResult* _res_,
                                                       gboolean* success,
                                                       gchar** filename_used,
                                                       GError** error);
VALA_EXTERN gboolean budgie_screenshot_client_SupportScreenshotWindow (BudgieScreenshotClient* self,
                                                           GError** error);
static GType budgie_screenshot_client_get_type_once (void);
static void budgie_screenshot_client_proxy_g_signal (GDBusProxy* proxy,
                                              const gchar* sender_name,
                                              const gchar* signal_name,
                                              GVariant* parameters);
static void _vala_g_async_ready_callback (GObject *source_object,
                                   GAsyncResult *res,
                                   void *user_data);
static void budgie_screenshot_client_proxy_ScreenshotArea_async (BudgieScreenshotClient* self,
                                                          gint x,
                                                          gint y,
                                                          gint width,
                                                          gint height,
                                                          gboolean include_cursor,
                                                          gboolean flash,
                                                          const gchar* filename,
                                                          GAsyncReadyCallback _callback_,
                                                          gpointer _user_data_);
static void budgie_screenshot_client_proxy_ScreenshotArea_finish (BudgieScreenshotClient* self,
                                                           GAsyncResult* _res_,
                                                           gboolean* success,
                                                           gchar** filename_used,
                                                           GError** error);
static void budgie_screenshot_client_proxy_Screenshot_async (BudgieScreenshotClient* self,
                                                      gboolean include_cursor,
                                                      gboolean flash,
                                                      const gchar* filename,
                                                      GAsyncReadyCallback _callback_,
                                                      gpointer _user_data_);
static void budgie_screenshot_client_proxy_Screenshot_finish (BudgieScreenshotClient* self,
                                                       GAsyncResult* _res_,
                                                       gboolean* success,
                                                       gchar** filename_used,
                                                       GError** error);
static void budgie_screenshot_client_proxy_ScreenshotWindow_async (BudgieScreenshotClient* self,
                                                            gboolean include_frame,
                                                            gboolean include_cursor,
                                                            gboolean flash,
                                                            const gchar* filename,
                                                            GAsyncReadyCallback _callback_,
                                                            gpointer _user_data_);
static void budgie_screenshot_client_proxy_ScreenshotWindow_finish (BudgieScreenshotClient* self,
                                                             GAsyncResult* _res_,
                                                             gboolean* success,
                                                             gchar** filename_used,
                                                             GError** error);
static gboolean budgie_screenshot_client_proxy_SupportScreenshotWindow (BudgieScreenshotClient* self,
                                                                 GError** error);
static void budgie_screenshot_client_proxy_budgie_screenshot_client_interface_init (BudgieScreenshotClientIface* iface);
static void _dbus_budgie_screenshot_client_ScreenshotArea (BudgieScreenshotClient* self,
                                                    GVariant* _parameters_,
                                                    GDBusMethodInvocation* invocation);
static void _dbus_budgie_screenshot_client_ScreenshotArea_ready (GObject * source_object,
                                                          GAsyncResult * _res_,
                                                          gpointer _user_data_);
static void _dbus_budgie_screenshot_client_Screenshot (BudgieScreenshotClient* self,
                                                GVariant* _parameters_,
                                                GDBusMethodInvocation* invocation);
static void _dbus_budgie_screenshot_client_Screenshot_ready (GObject * source_object,
                                                      GAsyncResult * _res_,
                                                      gpointer _user_data_);
static void _dbus_budgie_screenshot_client_ScreenshotWindow (BudgieScreenshotClient* self,
                                                      GVariant* _parameters_,
                                                      GDBusMethodInvocation* invocation);
static void _dbus_budgie_screenshot_client_ScreenshotWindow_ready (GObject * source_object,
                                                            GAsyncResult * _res_,
                                                            gpointer _user_data_);
static void _dbus_budgie_screenshot_client_SupportScreenshotWindow (BudgieScreenshotClient* self,
                                                             GVariant* _parameters_,
                                                             GDBusMethodInvocation* invocation);
static void budgie_screenshot_client_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* budgie_screenshot_client_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 budgie_screenshot_client_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 _budgie_screenshot_client_unregister_object (gpointer user_data);
static void budgie_make_screenshot_MakeClientConnection (void);
VALA_EXTERN gboolean budgie_make_screenshot_ScreenshotWindowSupport (void);
static gint* _vala_array_dup1 (gint* self,
                        gssize length);
VALA_EXTERN gint budgie_get_scaling (void);
static gboolean ___lambda9_ (BudgieMakeScreenshot* self);
static void budgie_make_screenshot_shoot_area (BudgieMakeScreenshot* self,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
static void budgie_make_screenshot_shoot_area_finish (BudgieMakeScreenshot* self,
                                               GAsyncResult* _res_);
static gboolean ____lambda9__gsource_func (gpointer self);
static gboolean ___lambda18_ (BudgieMakeScreenshot* self);
static void budgie_make_screenshot_shoot_screen (BudgieMakeScreenshot* self,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_);
static void budgie_make_screenshot_shoot_screen_finish (BudgieMakeScreenshot* self,
                                                 GAsyncResult* _res_);
static gboolean ____lambda18__gsource_func (gpointer self);
static gboolean ___lambda19_ (BudgieMakeScreenshot* self);
static void budgie_make_screenshot_shoot_window (BudgieMakeScreenshot* self,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_);
static void budgie_make_screenshot_shoot_window_finish (BudgieMakeScreenshot* self,
                                                 GAsyncResult* _res_);
static gboolean ____lambda19__gsource_func (gpointer self);
static void budgie_make_screenshot_shoot_window_data_free (gpointer _data);
static gboolean budgie_make_screenshot_shoot_window_co (BudgieMakeScreenshotShootWindowData* _data_);
static void budgie_make_screenshot_play_shuttersound (BudgieMakeScreenshot* self,
                                               gint timeout,
                                               gchar** args,
                                               gint args_length1);
static void budgie_make_screenshot_shoot_window_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_);
VALA_EXTERN BudgieAfterShotWindow* budgie_after_shot_window_new (void);
VALA_EXTERN BudgieAfterShotWindow* budgie_after_shot_window_construct (GType object_type);
VALA_EXTERN GType budgie_after_shot_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BudgieAfterShotWindow, g_object_unref)
static void budgie_make_screenshot_shoot_screen_data_free (gpointer _data);
static gboolean budgie_make_screenshot_shoot_screen_co (BudgieMakeScreenshotShootScreenData* _data_);
static void budgie_make_screenshot_shoot_screen_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_);
static void budgie_make_screenshot_shoot_area_data_free (gpointer _data);
static gboolean budgie_make_screenshot_shoot_area_co (BudgieMakeScreenshotShootAreaData* _data_);
static void budgie_make_screenshot_shoot_area_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_);
static void budgie_make_screenshot_finalize (BudgieMakeScreenshot * obj);
static GType budgie_make_screenshot_get_type_once (void);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static gboolean __lambda7_ (Block1Data* _data1_);
static gboolean ___lambda7__budgie_monitor_callback (gpointer self);
static gboolean __lambda8_ (BudgieScreenshotHomeWindow* self,
                     GdkEventKey* event);
static gboolean ___lambda8__gtk_widget_key_press_event (GtkWidget* _sender,
                                                 GdkEventKey* event,
                                                 gpointer self);
static GtkBox* budgie_screenshot_home_window_setup_areabuttons (BudgieScreenshotHomeWindow* self);
static void __lambda22_ (BudgieScreenshotHomeWindow* self);
static gboolean __lambda23_ (BudgieScreenshotHomeWindow* self);
static gboolean ___lambda23__gsource_func (gpointer self);
static void ___lambda22__gtk_widget_destroy (GtkWidget* _sender,
                                      gpointer self);
static void __lambda24_ (BudgieScreenshotHomeWindow* self);
static void budgie_screenshot_home_window_rearrange_headerbar (BudgieScreenshotHomeWindow* self);
static void ___lambda24__budgie_current_state_buttonpos_changed (BudgieCurrentState* _sender,
                                                          gpointer self);
static gulong* _ulong_dup (gulong* self);
static void budgie_screenshot_home_window_update_current_shortcuts (BudgieScreenshotHomeWindow* self);
static GVariant* _variant_new1 (gchar** value,
                         gint value_length1);
static gchar* _variant_get1 (GVariant* value);
static GtkPopover* budgie_screenshot_home_window_make_info_popover (BudgieScreenshotHomeWindow* self,
                                                             GtkButton* b);
static void budgie_screenshot_home_window_set_margins (BudgieScreenshotHomeWindow* self,
                                                GtkGrid* grid,
                                                gint left,
                                                gint right,
                                                gint top,
                                                gint bottom);
static void _vala_array_add1 (GtkLabel** * array,
                       gint* length,
                       gint* size,
                       GtkLabel* value);
static void _vala_array_add2 (GtkLabel** * array,
                       gint* length,
                       gint* size,
                       GtkLabel* value);
static void _vala_array_add3 (GtkLabel** * array,
                       gint* length,
                       gint* size,
                       GtkLabel* value);
static void _vala_array_add4 (GtkLabel** * array,
                       gint* length,
                       gint* size,
                       GtkLabel* value);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static void __lambda25_ (BudgieScreenshotHomeWindow* self);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
static gboolean __lambda26_ (Block3Data* _data3_);
static gboolean ___lambda26__gsource_func (gpointer self);
static void ___lambda25__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static void __lambda27_ (Block2Data* _data2_);
static void ___lambda27__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static Block4Data* block4_data_ref (Block4Data* _data4_);
static void block4_data_unref (void * _userdata_);
VALA_EXTERN gint budgie_find_stringindex (const gchar* str,
                              gchar** arr,
                              gint arr_length1);
static void _vala_array_add5 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static void _vala_array_add6 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static void _vala_array_add7 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static void _vala_array_add8 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static void _vala_array_add9 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static void _vala_array_add10 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
static Block5Data* block5_data_ref (Block5Data* _data5_);
static void block5_data_unref (void * _userdata_);
static void _vala_array_add11 (GtkToggleButton** * array,
                        gint* length,
                        gint* size,
                        GtkToggleButton* value);
static void ____lambda20_ (Block5Data* _data5_);
static void budgie_screenshot_home_window_select_action (BudgieScreenshotHomeWindow* self,
                                                  GtkToggleButton* b,
                                                  GtkToggleButton** btns,
                                                  gint btns_length1);
static gboolean ___lambda21_ (BudgieScreenshotHomeWindow* self);
static gboolean ____lambda21__gsource_func (gpointer self);
static void _____lambda20__gtk_button_clicked (GtkButton* _sender,
                                        gpointer self);
static void _vala_array_add12 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
static void _vala_array_add13 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
static void _vala_array_add14 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
static void budgie_screenshot_home_window_finalize (GObject * obj);
static GType budgie_screenshot_home_window_get_type_once (void);
static void budgie_select_layer_take_shot (BudgieSelectLayer* self,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);
static void budgie_select_layer_take_shot_finish (BudgieSelectLayer* self,
                                           GAsyncResult* _res_);
static void budgie_select_layer_take_shot_data_free (gpointer _data);
static gboolean budgie_select_layer_take_shot_co (BudgieSelectLayerTakeShotData* _data_);
static void budgie_select_layer_finalize (GObject * obj);
static GType budgie_select_layer_get_type_once (void);
static GType budgie_after_shot_window_column_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static void budgie_after_shot_window_delete_file (BudgieAfterShotWindow* self,
                                           GFile* file);
static GdkPixbuf* budgie_after_shot_window_get_pxb (BudgieAfterShotWindow* self);
static Block6Data* block6_data_ref (Block6Data* _data6_);
static void block6_data_unref (void * _userdata_);
static gboolean __lambda10_ (Block6Data* _data6_);
static gboolean ___lambda10__budgie_monitor_callback (gpointer self);
static void budgie_after_shot_window_makeaftershotwindow (BudgieAfterShotWindow* self,
                                                   GdkPixbuf* pxb);
static Block7Data* block7_data_ref (Block7Data* _data7_);
static void block7_data_unref (void * _userdata_);
static GdkPixbuf* budgie_after_shot_window_resize_pixbuf (BudgieAfterShotWindow* self,
                                                   GdkPixbuf* pxb,
                                                   gint scale);
static gchar* budgie_after_shot_window_get_scrshotname (BudgieAfterShotWindow* self);
static void budgie_after_shot_window_update_dropdown (BudgieAfterShotWindow* self);
static void _budgie_after_shot_window_update_dropdown_g_volume_monitor_mount_added (GVolumeMonitor* _sender,
                                                                             GMount* mount,
                                                                             gpointer self);
static void _budgie_after_shot_window_update_dropdown_g_volume_monitor_mount_removed (GVolumeMonitor* _sender,
                                                                               GMount* mount,
                                                                               gpointer self);
static void __lambda11_ (BudgieAfterShotWindow* self);
static void budgie_after_shot_window_item_changed (BudgieAfterShotWindow* self,
                                            GtkComboBox* combo);
static void ___lambda11__gtk_combo_box_changed (GtkComboBox* _sender,
                                         gpointer self);
static void __lambda12_ (Block7Data* _data7_);
static void budgie_after_shot_window_setup_headerbar (BudgieAfterShotWindow* self,
                                               GtkHeaderBar* bar,
                                               GtkEntry* filenameentry,
                                               GtkClipboard* clp,
                                               GdkPixbuf* pxb);
static void ___lambda12__budgie_current_state_buttonpos_changed (BudgieCurrentState* _sender,
                                                          gpointer self);
static gboolean __lambda17_ (BudgieAfterShotWindow* self,
                      GdkEventKey* event);
static gboolean ___lambda17__gtk_widget_key_press_event (GtkWidget* _sender,
                                                  GdkEventKey* event,
                                                  gpointer self);
static void budgie_after_shot_window_close_window (BudgieAfterShotWindow* self);
static Block8Data* block8_data_ref (Block8Data* _data8_);
static void block8_data_unref (void * _userdata_);
static void budgie_after_shot_window_set_buttoncontent (BudgieAfterShotWindow* self,
                                                 GtkButton* b,
                                                 const gchar* icon);
static void _vala_array_add15 (GtkButton** * array,
                        gint* length,
                        gint* size,
                        GtkButton* value);
static void __lambda13_ (BudgieAfterShotWindow* self);
static void ___lambda13__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static void __lambda14_ (Block8Data* _data8_);
static gchar* budgie_after_shot_window_save_tofile (BudgieAfterShotWindow* self,
                                             GtkEntry* entry,
                                             GtkComboBox* combo,
                                             GdkPixbuf* pxb);
static void ___lambda14__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static void __lambda15_ (Block8Data* _data8_);
static void ___lambda15__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static void __lambda16_ (Block8Data* _data8_);
static void budgie_after_shot_window_open_indefaultapp (BudgieAfterShotWindow* self,
                                                 const gchar* path);
static void ___lambda16__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static gchar* budgie_after_shot_window_get_path_fromcombo (BudgieAfterShotWindow* self,
                                                    GtkComboBox* combo);
static void budgie_after_shot_window_create_row (BudgieAfterShotWindow* self,
                                          const gchar* path,
                                          const gchar* mention,
                                          const gchar* iconname,
                                          gboolean separator);
static void _vala_array_add16 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
static gboolean budgie_after_shot_window_is_separator (BudgieAfterShotWindow* self,
                                                GtkTreeModel* dir_liststore,
                                                GtkTreeIter* iter);
static gchar* budgie_after_shot_window_get_dir_basename (BudgieAfterShotWindow* self,
                                                  const gchar* path);
static gchar* budgie_after_shot_window_get_icon_fromgicon (BudgieAfterShotWindow* self,
                                                    GIcon* ic);
static gchar* budgie_after_shot_window_lookup_icon_name (BudgieAfterShotWindow* self,
                                                  GFile* customdir);
static gboolean _budgie_after_shot_window_is_separator_gtk_tree_view_row_separator_func (GtkTreeModel* model,
                                                                                  GtkTreeIter* iter,
                                                                                  gpointer self);
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
static void budgie_after_shot_window_save_customdir (BudgieAfterShotWindow* self,
                                              GtkDialog* dialog,
                                              gint response_id);
static void budgie_after_shot_window_get_customdir (BudgieAfterShotWindow* self);
static void _budgie_after_shot_window_save_customdir_gtk_dialog_response (GtkDialog* _sender,
                                                                   gint response_id,
                                                                   gpointer self);
static void budgie_after_shot_window_finalize (GObject * obj);
static GType budgie_after_shot_window_get_type_once (void);
static gint budgie_main (gchar** args,
                  gint args_length1);
VALA_EXTERN void budgie_setup_dbus (void);
static void ___lambda30_ (void);
static void ____lambda30__budgie_wayland_client_initialized (BudgieWaylandClient* _sender,
                                                      gpointer self);
static void ___lambda31_ (void);
static void ____lambda31__budgie_wayland_client_initialization_failed (BudgieWaylandClient* _sender,
                                                                gpointer self);
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 gssize _vala_array_length (gpointer array);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static const GDBusArgInfo * const _budgie_screenshot_server_dbus_arg_info_StartMainWindow_in[] = {NULL};
static const GDBusArgInfo * const _budgie_screenshot_server_dbus_arg_info_StartMainWindow_out[] = {NULL};
static const GDBusMethodInfo _budgie_screenshot_server_dbus_method_info_StartMainWindow = {-1, "StartMainWindow", (GDBusArgInfo **) (&_budgie_screenshot_server_dbus_arg_info_StartMainWindow_in), (GDBusArgInfo **) (&_budgie_screenshot_server_dbus_arg_info_StartMainWindow_out), NULL};
static const GDBusArgInfo * const _budgie_screenshot_server_dbus_arg_info_StartAreaSelect_in[] = {NULL};
static const GDBusArgInfo * const _budgie_screenshot_server_dbus_arg_info_StartAreaSelect_out[] = {NULL};
static const GDBusMethodInfo _budgie_screenshot_server_dbus_method_info_StartAreaSelect = {-1, "StartAreaSelect", (GDBusArgInfo **) (&_budgie_screenshot_server_dbus_arg_info_StartAreaSelect_in), (GDBusArgInfo **) (&_budgie_screenshot_server_dbus_arg_info_StartAreaSelect_out), NULL};
static const GDBusArgInfo * const _budgie_screenshot_server_dbus_arg_info_StartWindowScreenshot_in[] = {NULL};
static const GDBusArgInfo * const _budgie_screenshot_server_dbus_arg_info_StartWindowScreenshot_out[] = {NULL};
static const GDBusMethodInfo _budgie_screenshot_server_dbus_method_info_StartWindowScreenshot = {-1, "StartWindowScreenshot", (GDBusArgInfo **) (&_budgie_screenshot_server_dbus_arg_info_StartWindowScreenshot_in), (GDBusArgInfo **) (&_budgie_screenshot_server_dbus_arg_info_StartWindowScreenshot_out), NULL};
static const GDBusArgInfo * const _budgie_screenshot_server_dbus_arg_info_StartFullScreenshot_in[] = {NULL};
static const GDBusArgInfo * const _budgie_screenshot_server_dbus_arg_info_StartFullScreenshot_out[] = {NULL};
static const GDBusMethodInfo _budgie_screenshot_server_dbus_method_info_StartFullScreenshot = {-1, "StartFullScreenshot", (GDBusArgInfo **) (&_budgie_screenshot_server_dbus_arg_info_StartFullScreenshot_in), (GDBusArgInfo **) (&_budgie_screenshot_server_dbus_arg_info_StartFullScreenshot_out), NULL};
static const GDBusArgInfo * const _budgie_screenshot_server_dbus_arg_info_setup_dbus_in[] = {NULL};
static const GDBusArgInfo * const _budgie_screenshot_server_dbus_arg_info_setup_dbus_out[] = {NULL};
static const GDBusMethodInfo _budgie_screenshot_server_dbus_method_info_setup_dbus = {-1, "SetupDbus", (GDBusArgInfo **) (&_budgie_screenshot_server_dbus_arg_info_setup_dbus_in), (GDBusArgInfo **) (&_budgie_screenshot_server_dbus_arg_info_setup_dbus_out), NULL};
static const GDBusMethodInfo * const _budgie_screenshot_server_dbus_method_info[] = {&_budgie_screenshot_server_dbus_method_info_StartMainWindow, &_budgie_screenshot_server_dbus_method_info_StartAreaSelect, &_budgie_screenshot_server_dbus_method_info_StartWindowScreenshot, &_budgie_screenshot_server_dbus_method_info_StartFullScreenshot, &_budgie_screenshot_server_dbus_method_info_setup_dbus, NULL};
static const GDBusSignalInfo * const _budgie_screenshot_server_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo * const _budgie_screenshot_server_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _budgie_screenshot_server_dbus_interface_info = {-1, "org.buddiesofbudgie.BudgieScreenshotControl", (GDBusMethodInfo **) (&_budgie_screenshot_server_dbus_method_info), (GDBusSignalInfo **) (&_budgie_screenshot_server_dbus_signal_info), (GDBusPropertyInfo **) (&_budgie_screenshot_server_dbus_property_info), NULL};
static const GDBusInterfaceVTable _budgie_screenshot_server_dbus_interface_vtable = {budgie_screenshot_server_dbus_interface_method_call, budgie_screenshot_server_dbus_interface_get_property, budgie_screenshot_server_dbus_interface_set_property};
static const GDBusArgInfo _budgie_screenshot_client_dbus_arg_info_ScreenshotArea_x = {-1, "x", "i", NULL};
static const GDBusArgInfo _budgie_screenshot_client_dbus_arg_info_ScreenshotArea_y = {-1, "y", "i", NULL};
static const GDBusArgInfo _budgie_screenshot_client_dbus_arg_info_ScreenshotArea_width = {-1, "width", "i", NULL};
static const GDBusArgInfo _budgie_screenshot_client_dbus_arg_info_ScreenshotArea_height = {-1, "height", "i", NULL};
static const GDBusArgInfo _budgie_screenshot_client_dbus_arg_info_ScreenshotArea_include_cursor = {-1, "include_cursor", "b", NULL};
static const GDBusArgInfo _budgie_screenshot_client_dbus_arg_info_ScreenshotArea_flash = {-1, "flash", "b", NULL};
static const GDBusArgInfo _budgie_screenshot_client_dbus_arg_info_ScreenshotArea_filename = {-1, "filename", "s", NULL};
static const GDBusArgInfo _budgie_screenshot_client_dbus_arg_info_ScreenshotArea_success = {-1, "success", "b", NULL};
static const GDBusArgInfo _budgie_screenshot_client_dbus_arg_info_ScreenshotArea_filename_used = {-1, "filename_used", "s", NULL};
static const GDBusArgInfo * const _budgie_screenshot_client_dbus_arg_info_ScreenshotArea_in[] = {&_budgie_screenshot_client_dbus_arg_info_ScreenshotArea_x, &_budgie_screenshot_client_dbus_arg_info_ScreenshotArea_y, &_budgie_screenshot_client_dbus_arg_info_ScreenshotArea_width, &_budgie_screenshot_client_dbus_arg_info_ScreenshotArea_height, &_budgie_screenshot_client_dbus_arg_info_ScreenshotArea_include_cursor, &_budgie_screenshot_client_dbus_arg_info_ScreenshotArea_flash, &_budgie_screenshot_client_dbus_arg_info_ScreenshotArea_filename, NULL};
static const GDBusArgInfo * const _budgie_screenshot_client_dbus_arg_info_ScreenshotArea_out[] = {&_budgie_screenshot_client_dbus_arg_info_ScreenshotArea_success, &_budgie_screenshot_client_dbus_arg_info_ScreenshotArea_filename_used, NULL};
static const GDBusMethodInfo _budgie_screenshot_client_dbus_method_info_ScreenshotArea = {-1, "ScreenshotArea", (GDBusArgInfo **) (&_budgie_screenshot_client_dbus_arg_info_ScreenshotArea_in), (GDBusArgInfo **) (&_budgie_screenshot_client_dbus_arg_info_ScreenshotArea_out), NULL};
static const GDBusArgInfo _budgie_screenshot_client_dbus_arg_info_Screenshot_include_cursor = {-1, "include_cursor", "b", NULL};
static const GDBusArgInfo _budgie_screenshot_client_dbus_arg_info_Screenshot_flash = {-1, "flash", "b", NULL};
static const GDBusArgInfo _budgie_screenshot_client_dbus_arg_info_Screenshot_filename = {-1, "filename", "s", NULL};
static const GDBusArgInfo _budgie_screenshot_client_dbus_arg_info_Screenshot_success = {-1, "success", "b", NULL};
static const GDBusArgInfo _budgie_screenshot_client_dbus_arg_info_Screenshot_filename_used = {-1, "filename_used", "s", NULL};
static const GDBusArgInfo * const _budgie_screenshot_client_dbus_arg_info_Screenshot_in[] = {&_budgie_screenshot_client_dbus_arg_info_Screenshot_include_cursor, &_budgie_screenshot_client_dbus_arg_info_Screenshot_flash, &_budgie_screenshot_client_dbus_arg_info_Screenshot_filename, NULL};
static const GDBusArgInfo * const _budgie_screenshot_client_dbus_arg_info_Screenshot_out[] = {&_budgie_screenshot_client_dbus_arg_info_Screenshot_success, &_budgie_screenshot_client_dbus_arg_info_Screenshot_filename_used, NULL};
static const GDBusMethodInfo _budgie_screenshot_client_dbus_method_info_Screenshot = {-1, "Screenshot", (GDBusArgInfo **) (&_budgie_screenshot_client_dbus_arg_info_Screenshot_in), (GDBusArgInfo **) (&_budgie_screenshot_client_dbus_arg_info_Screenshot_out), NULL};
static const GDBusArgInfo _budgie_screenshot_client_dbus_arg_info_ScreenshotWindow_include_frame = {-1, "include_frame", "b", NULL};
static const GDBusArgInfo _budgie_screenshot_client_dbus_arg_info_ScreenshotWindow_include_cursor = {-1, "include_cursor", "b", NULL};
static const GDBusArgInfo _budgie_screenshot_client_dbus_arg_info_ScreenshotWindow_flash = {-1, "flash", "b", NULL};
static const GDBusArgInfo _budgie_screenshot_client_dbus_arg_info_ScreenshotWindow_filename = {-1, "filename", "s", NULL};
static const GDBusArgInfo _budgie_screenshot_client_dbus_arg_info_ScreenshotWindow_success = {-1, "success", "b", NULL};
static const GDBusArgInfo _budgie_screenshot_client_dbus_arg_info_ScreenshotWindow_filename_used = {-1, "filename_used", "s", NULL};
static const GDBusArgInfo * const _budgie_screenshot_client_dbus_arg_info_ScreenshotWindow_in[] = {&_budgie_screenshot_client_dbus_arg_info_ScreenshotWindow_include_frame, &_budgie_screenshot_client_dbus_arg_info_ScreenshotWindow_include_cursor, &_budgie_screenshot_client_dbus_arg_info_ScreenshotWindow_flash, &_budgie_screenshot_client_dbus_arg_info_ScreenshotWindow_filename, NULL};
static const GDBusArgInfo * const _budgie_screenshot_client_dbus_arg_info_ScreenshotWindow_out[] = {&_budgie_screenshot_client_dbus_arg_info_ScreenshotWindow_success, &_budgie_screenshot_client_dbus_arg_info_ScreenshotWindow_filename_used, NULL};
static const GDBusMethodInfo _budgie_screenshot_client_dbus_method_info_ScreenshotWindow = {-1, "ScreenshotWindow", (GDBusArgInfo **) (&_budgie_screenshot_client_dbus_arg_info_ScreenshotWindow_in), (GDBusArgInfo **) (&_budgie_screenshot_client_dbus_arg_info_ScreenshotWindow_out), NULL};
static const GDBusArgInfo _budgie_screenshot_client_dbus_arg_info_SupportScreenshotWindow_result = {-1, "result", "b", NULL};
static const GDBusArgInfo * const _budgie_screenshot_client_dbus_arg_info_SupportScreenshotWindow_in[] = {NULL};
static const GDBusArgInfo * const _budgie_screenshot_client_dbus_arg_info_SupportScreenshotWindow_out[] = {&_budgie_screenshot_client_dbus_arg_info_SupportScreenshotWindow_result, NULL};
static const GDBusMethodInfo _budgie_screenshot_client_dbus_method_info_SupportScreenshotWindow = {-1, "SupportScreenshotWindow", (GDBusArgInfo **) (&_budgie_screenshot_client_dbus_arg_info_SupportScreenshotWindow_in), (GDBusArgInfo **) (&_budgie_screenshot_client_dbus_arg_info_SupportScreenshotWindow_out), NULL};
static const GDBusMethodInfo * const _budgie_screenshot_client_dbus_method_info[] = {&_budgie_screenshot_client_dbus_method_info_ScreenshotArea, &_budgie_screenshot_client_dbus_method_info_Screenshot, &_budgie_screenshot_client_dbus_method_info_ScreenshotWindow, &_budgie_screenshot_client_dbus_method_info_SupportScreenshotWindow, NULL};
static const GDBusSignalInfo * const _budgie_screenshot_client_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo * const _budgie_screenshot_client_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _budgie_screenshot_client_dbus_interface_info = {-1, "org.buddiesofbudgie.BudgieScreenshot", (GDBusMethodInfo **) (&_budgie_screenshot_client_dbus_method_info), (GDBusSignalInfo **) (&_budgie_screenshot_client_dbus_signal_info), (GDBusPropertyInfo **) (&_budgie_screenshot_client_dbus_property_info), NULL};
static const GDBusInterfaceVTable _budgie_screenshot_client_dbus_interface_vtable = {budgie_screenshot_client_dbus_interface_method_call, budgie_screenshot_client_dbus_interface_get_property, budgie_screenshot_client_dbus_interface_set_property};

static GType
budgie_window_state_get_type_once (void)
{
	static const GEnumValue values[] = {{BUDGIE_WINDOW_STATE_NONE, "BUDGIE_WINDOW_STATE_NONE", "none"}, {BUDGIE_WINDOW_STATE_MAINWINDOW, "BUDGIE_WINDOW_STATE_MAINWINDOW", "mainwindow"}, {BUDGIE_WINDOW_STATE_SELECTINGAREA, "BUDGIE_WINDOW_STATE_SELECTINGAREA", "selectingarea"}, {BUDGIE_WINDOW_STATE_AFTERSHOT, "BUDGIE_WINDOW_STATE_AFTERSHOT", "aftershot"}, {BUDGIE_WINDOW_STATE_WAITINGFORSHOT, "BUDGIE_WINDOW_STATE_WAITINGFORSHOT", "waitingforshot"}, {0, NULL, NULL}};
	GType budgie_window_state_type_id;
	budgie_window_state_type_id = g_enum_register_static ("BudgieWindowState", values);
	return budgie_window_state_type_id;
}

GType
budgie_window_state_get_type (void)
{
	static volatile gsize budgie_window_state_type_id__once = 0;
	if (g_once_init_enter (&budgie_window_state_type_id__once)) {
		GType budgie_window_state_type_id;
		budgie_window_state_type_id = budgie_window_state_get_type_once ();
		g_once_init_leave (&budgie_window_state_type_id__once, budgie_window_state_type_id);
	}
	return budgie_window_state_type_id__once;
}

static GType
budgie_button_placement_get_type_once (void)
{
	static const GEnumValue values[] = {{BUDGIE_BUTTON_PLACEMENT_LEFT, "BUDGIE_BUTTON_PLACEMENT_LEFT", "left"}, {BUDGIE_BUTTON_PLACEMENT_RIGHT, "BUDGIE_BUTTON_PLACEMENT_RIGHT", "right"}, {0, NULL, NULL}};
	GType budgie_button_placement_type_id;
	budgie_button_placement_type_id = g_enum_register_static ("BudgieButtonPlacement", values);
	return budgie_button_placement_type_id;
}

GType
budgie_button_placement_get_type (void)
{
	static volatile gsize budgie_button_placement_type_id__once = 0;
	if (g_once_init_enter (&budgie_button_placement_type_id__once)) {
		GType budgie_button_placement_type_id;
		budgie_button_placement_type_id = budgie_button_placement_get_type_once ();
		g_once_init_leave (&budgie_button_placement_type_id__once, budgie_button_placement_type_id);
	}
	return budgie_button_placement_type_id__once;
}

static inline gpointer
budgie_current_state_get_instance_private (BudgieCurrentState* self)
{
	return G_STRUCT_MEMBER_P (self, BudgieCurrentState_private_offset);
}

static void
__lambda4_ (BudgieCurrentState* self)
{
	budgie_current_state_fill_buttonpos (self);
	g_signal_emit (self, budgie_current_state_signals[BUDGIE_CURRENT_STATE_BUTTONPOS_CHANGED_SIGNAL], 0);
}

static void
___lambda4__g_settings_changed (GSettings* _sender,
                                const gchar* key,
                                gpointer self)
{
	__lambda4_ ((BudgieCurrentState*) self);
}

static void
__lambda5_ (BudgieCurrentState* self)
{
	GSettings* _tmp0_;
	_tmp0_ = self->priv->_screenshot_settings;
	budgie_current_state_set_emit_capture_sound (self, g_settings_get_boolean (_tmp0_, "screenshot-capture-sound"));
}

static void
___lambda5__g_settings_changed (GSettings* _sender,
                                const gchar* key,
                                gpointer self)
{
	__lambda5_ ((BudgieCurrentState*) self);
}

static void
__lambda6_ (BudgieCurrentState* self)
{
	GSettings* _tmp0_;
	_tmp0_ = self->priv->_screenshot_settings;
	budgie_current_state_set_showtooltips (self, g_settings_get_boolean (_tmp0_, "showtooltips"));
}

static void
___lambda6__g_settings_changed (GSettings* _sender,
                                const gchar* key,
                                gpointer self)
{
	__lambda6_ ((BudgieCurrentState*) self);
}

BudgieCurrentState*
budgie_current_state_construct (GType object_type)
{
	BudgieCurrentState * self = NULL;
	GSettings* _tmp0_;
	GSettings* _tmp1_;
	GSettings* _tmp2_;
	GSettings* _tmp3_;
	GSettings* _tmp4_;
	GSettings* _tmp5_;
	GSettings* _tmp6_;
	GSettings* _tmp7_;
	const gchar* _tmp8_ = NULL;
	const gchar* _tmp9_;
	gchar* tmpdir = NULL;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	self = (BudgieCurrentState*) g_object_new (object_type, NULL);
	_tmp0_ = g_settings_new ("org.buddiesofbudgie.budgie-desktop.screenshot");
	_tmp1_ = _tmp0_;
	budgie_current_state_set_screenshot_settings (self, _tmp1_);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = g_settings_new ("com.solus-project.budgie-wm");
	_g_object_unref0 (self->priv->buttonplacement);
	self->priv->buttonplacement = _tmp2_;
	_tmp3_ = self->priv->buttonplacement;
	g_signal_connect_object (_tmp3_, "changed::button-style", (GCallback) ___lambda4__g_settings_changed, self, 0);
	budgie_current_state_fill_buttonpos (self);
	_tmp4_ = self->priv->_screenshot_settings;
	budgie_current_state_set_emit_capture_sound (self, g_settings_get_boolean (_tmp4_, "screenshot-capture-sound"));
	_tmp5_ = self->priv->_screenshot_settings;
	g_signal_connect_object (_tmp5_, "changed::screenshot-capture-sound", (GCallback) ___lambda5__g_settings_changed, self, 0);
	_tmp6_ = self->priv->_screenshot_settings;
	budgie_current_state_set_showtooltips (self, g_settings_get_boolean (_tmp6_, "showtooltips"));
	_tmp7_ = self->priv->_screenshot_settings;
	g_signal_connect_object (_tmp7_, "changed::showtooltips", (GCallback) ___lambda6__g_settings_changed, self, 0);
	_tmp9_ = g_getenv ("XDG_RUNTIME_DIR");
	_tmp8_ = _tmp9_;
	if (_tmp8_ == NULL) {
		const gchar* _tmp10_;
		_tmp10_ = g_getenv ("HOME");
		_tmp8_ = _tmp10_;
	}
	_tmp11_ = g_strdup (_tmp8_);
	tmpdir = _tmp11_;
	_tmp12_ = g_build_path (G_DIR_SEPARATOR_S, tmpdir, ".budgiescreenshot_tempfile", NULL);
	_tmp13_ = _tmp12_;
	budgie_current_state_set_tempfile_path (self, _tmp13_);
	_g_free0 (_tmp13_);
	_g_free0 (tmpdir);
	return self;
}

BudgieCurrentState*
budgie_current_state_new (void)
{
	return budgie_current_state_construct (BUDGIE_TYPE_CURRENT_STATE);
}

static void
budgie_current_state_fill_buttonpos (BudgieCurrentState* self)
{
	BudgieButtonPlacement _tmp0_ = 0;
	GSettings* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gboolean _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->buttonplacement;
	_tmp2_ = g_settings_get_string (_tmp1_, "button-style");
	_tmp3_ = _tmp2_;
	_tmp4_ = g_strcmp0 (_tmp3_, "left") == 0;
	_g_free0 (_tmp3_);
	if (_tmp4_) {
		_tmp0_ = BUDGIE_BUTTON_PLACEMENT_LEFT;
	} else {
		_tmp0_ = BUDGIE_BUTTON_PLACEMENT_RIGHT;
	}
	budgie_current_state_set_buttonpos (self, (gint) _tmp0_);
}

void
budgie_current_state_statechanged (BudgieCurrentState* self,
                                   gint n)
{
	gboolean _tmp0_ = FALSE;
	gint _tmp1_;
	gboolean _tmp3_ = FALSE;
	gint _tmp4_;
	g_return_if_fail (self != NULL);
	budgie_current_state_set_newstate (self, n);
	_tmp1_ = self->priv->_newstate;
	if (_tmp1_ == ((gint) BUDGIE_WINDOW_STATE_NONE)) {
		budgie_current_state_set_startedfromgui (self, FALSE);
		_tmp0_ = FALSE;
	} else {
		gboolean _tmp2_;
		_tmp2_ = self->priv->_startedfromgui;
		_tmp0_ = _tmp2_;
	}
	_tmp4_ = self->priv->_newstate;
	if (_tmp4_ == ((gint) BUDGIE_WINDOW_STATE_MAINWINDOW)) {
		budgie_current_state_set_startedfromgui (self, TRUE);
		_tmp3_ = TRUE;
	} else {
		gboolean _tmp5_;
		_tmp5_ = self->priv->_startedfromgui;
		_tmp3_ = _tmp5_;
	}
}

GSettings*
budgie_current_state_get_screenshot_settings (BudgieCurrentState* self)
{
	GSettings* result;
	GSettings* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_screenshot_settings;
	result = _tmp0_;
	return result;
}

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

static void
budgie_current_state_set_screenshot_settings (BudgieCurrentState* self,
                                              GSettings* value)
{
	GSettings* old_value;
	g_return_if_fail (self != NULL);
	old_value = budgie_current_state_get_screenshot_settings (self);
	if (old_value != value) {
		GSettings* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_screenshot_settings);
		self->priv->_screenshot_settings = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, budgie_current_state_properties[BUDGIE_CURRENT_STATE_SCREENSHOT_SETTINGS_PROPERTY]);
	}
}

gint
budgie_current_state_get_newstate (BudgieCurrentState* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_newstate;
	return result;
}

static void
budgie_current_state_set_newstate (BudgieCurrentState* self,
                                   gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = budgie_current_state_get_newstate (self);
	if (old_value != value) {
		self->priv->_newstate = value;
		g_object_notify_by_pspec ((GObject *) self, budgie_current_state_properties[BUDGIE_CURRENT_STATE_NEWSTATE_PROPERTY]);
	}
}

gboolean
budgie_current_state_get_showtooltips (BudgieCurrentState* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_showtooltips;
	return result;
}

void
budgie_current_state_set_showtooltips (BudgieCurrentState* self,
                                       gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = budgie_current_state_get_showtooltips (self);
	if (old_value != value) {
		self->priv->_showtooltips = value;
		g_object_notify_by_pspec ((GObject *) self, budgie_current_state_properties[BUDGIE_CURRENT_STATE_SHOWTOOLTIPS_PROPERTY]);
	}
}

gboolean
budgie_current_state_get_emit_capture_sound (BudgieCurrentState* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_emit_capture_sound;
	return result;
}

void
budgie_current_state_set_emit_capture_sound (BudgieCurrentState* self,
                                             gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = budgie_current_state_get_emit_capture_sound (self);
	if (old_value != value) {
		self->priv->_emit_capture_sound = value;
		g_object_notify_by_pspec ((GObject *) self, budgie_current_state_properties[BUDGIE_CURRENT_STATE_EMIT_CAPTURE_SOUND_PROPERTY]);
	}
}

gint
budgie_current_state_get_buttonpos (BudgieCurrentState* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_buttonpos;
	return result;
}

static void
budgie_current_state_set_buttonpos (BudgieCurrentState* self,
                                    gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = budgie_current_state_get_buttonpos (self);
	if (old_value != value) {
		self->priv->_buttonpos = value;
		g_object_notify_by_pspec ((GObject *) self, budgie_current_state_properties[BUDGIE_CURRENT_STATE_BUTTONPOS_PROPERTY]);
	}
}

const gchar*
budgie_current_state_get_tempfile_path (BudgieCurrentState* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_tempfile_path;
	result = _tmp0_;
	return result;
}

static void
budgie_current_state_set_tempfile_path (BudgieCurrentState* self,
                                        const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = budgie_current_state_get_tempfile_path (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_tempfile_path);
		self->priv->_tempfile_path = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, budgie_current_state_properties[BUDGIE_CURRENT_STATE_TEMPFILE_PATH_PROPERTY]);
	}
}

gboolean
budgie_current_state_get_startedfromgui (BudgieCurrentState* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_startedfromgui;
	return result;
}

static void
budgie_current_state_set_startedfromgui (BudgieCurrentState* self,
                                         gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = budgie_current_state_get_startedfromgui (self);
	if (old_value != value) {
		self->priv->_startedfromgui = value;
		g_object_notify_by_pspec ((GObject *) self, budgie_current_state_properties[BUDGIE_CURRENT_STATE_STARTEDFROMGUI_PROPERTY]);
	}
}

static GObject *
budgie_current_state_constructor (GType type,
                                  guint n_construct_properties,
                                  GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	static GWeakRef BudgieCurrentState_singleton__ref;
	static GMutex BudgieCurrentState_singleton__lock;
	BudgieCurrentState * self;
	g_mutex_lock (&BudgieCurrentState_singleton__lock);
	obj = g_weak_ref_get (&BudgieCurrentState_singleton__ref);
	if (obj != NULL) {
		g_mutex_unlock (&BudgieCurrentState_singleton__lock);
		return obj;
	}
	parent_class = G_OBJECT_CLASS (budgie_current_state_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BUDGIE_TYPE_CURRENT_STATE, BudgieCurrentState);
	g_weak_ref_set (&BudgieCurrentState_singleton__ref, obj);
	g_mutex_unlock (&BudgieCurrentState_singleton__lock);
	return obj;
}

static void
budgie_current_state_class_init (BudgieCurrentStateClass * klass,
                                 gpointer klass_data)
{
	budgie_current_state_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BudgieCurrentState_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_budgie_current_state_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_budgie_current_state_set_property;
	G_OBJECT_CLASS (klass)->constructor = budgie_current_state_constructor;
	G_OBJECT_CLASS (klass)->finalize = budgie_current_state_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), BUDGIE_CURRENT_STATE_SCREENSHOT_SETTINGS_PROPERTY, budgie_current_state_properties[BUDGIE_CURRENT_STATE_SCREENSHOT_SETTINGS_PROPERTY] = g_param_spec_object ("screenshot-settings", "screenshot-settings", "screenshot-settings", g_settings_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BUDGIE_CURRENT_STATE_NEWSTATE_PROPERTY, budgie_current_state_properties[BUDGIE_CURRENT_STATE_NEWSTATE_PROPERTY] = g_param_spec_int ("newstate", "newstate", "newstate", G_MININT, G_MAXINT, (gint) BUDGIE_WINDOW_STATE_NONE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BUDGIE_CURRENT_STATE_SHOWTOOLTIPS_PROPERTY, budgie_current_state_properties[BUDGIE_CURRENT_STATE_SHOWTOOLTIPS_PROPERTY] = g_param_spec_boolean ("showtooltips", "showtooltips", "showtooltips", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BUDGIE_CURRENT_STATE_EMIT_CAPTURE_SOUND_PROPERTY, budgie_current_state_properties[BUDGIE_CURRENT_STATE_EMIT_CAPTURE_SOUND_PROPERTY] = g_param_spec_boolean ("emit-capture-sound", "emit-capture-sound", "emit-capture-sound", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BUDGIE_CURRENT_STATE_BUTTONPOS_PROPERTY, budgie_current_state_properties[BUDGIE_CURRENT_STATE_BUTTONPOS_PROPERTY] = g_param_spec_int ("buttonpos", "buttonpos", "buttonpos", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BUDGIE_CURRENT_STATE_TEMPFILE_PATH_PROPERTY, budgie_current_state_properties[BUDGIE_CURRENT_STATE_TEMPFILE_PATH_PROPERTY] = g_param_spec_string ("tempfile-path", "tempfile-path", "tempfile-path", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BUDGIE_CURRENT_STATE_STARTEDFROMGUI_PROPERTY, budgie_current_state_properties[BUDGIE_CURRENT_STATE_STARTEDFROMGUI_PROPERTY] = g_param_spec_boolean ("startedfromgui", "startedfromgui", "startedfromgui", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	budgie_current_state_signals[BUDGIE_CURRENT_STATE_BUTTONPOS_CHANGED_SIGNAL] = g_signal_new ("buttonpos-changed", BUDGIE_TYPE_CURRENT_STATE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
budgie_current_state_instance_init (BudgieCurrentState * self,
                                    gpointer klass)
{
	self->priv = budgie_current_state_get_instance_private (self);
	self->priv->_newstate = (gint) BUDGIE_WINDOW_STATE_NONE;
	self->priv->_showtooltips = TRUE;
	self->priv->_emit_capture_sound = TRUE;
	self->priv->_startedfromgui = FALSE;
}

static void
budgie_current_state_finalize (GObject * obj)
{
	BudgieCurrentState * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BUDGIE_TYPE_CURRENT_STATE, BudgieCurrentState);
	_g_object_unref0 (self->priv->buttonplacement);
	_g_object_unref0 (self->priv->_screenshot_settings);
	_g_free0 (self->priv->_tempfile_path);
	G_OBJECT_CLASS (budgie_current_state_parent_class)->finalize (obj);
}

static GType
budgie_current_state_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BudgieCurrentStateClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) budgie_current_state_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BudgieCurrentState), 0, (GInstanceInitFunc) budgie_current_state_instance_init, NULL };
	GType budgie_current_state_type_id;
	budgie_current_state_type_id = g_type_register_static (G_TYPE_OBJECT, "BudgieCurrentState", &g_define_type_info, 0);
	BudgieCurrentState_private_offset = g_type_add_instance_private (budgie_current_state_type_id, sizeof (BudgieCurrentStatePrivate));
	return budgie_current_state_type_id;
}

GType
budgie_current_state_get_type (void)
{
	static volatile gsize budgie_current_state_type_id__once = 0;
	if (g_once_init_enter (&budgie_current_state_type_id__once)) {
		GType budgie_current_state_type_id;
		budgie_current_state_type_id = budgie_current_state_get_type_once ();
		g_once_init_leave (&budgie_current_state_type_id__once, budgie_current_state_type_id);
	}
	return budgie_current_state_type_id__once;
}

static void
_vala_budgie_current_state_get_property (GObject * object,
                                         guint property_id,
                                         GValue * value,
                                         GParamSpec * pspec)
{
	BudgieCurrentState * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BUDGIE_TYPE_CURRENT_STATE, BudgieCurrentState);
	switch (property_id) {
		case BUDGIE_CURRENT_STATE_SCREENSHOT_SETTINGS_PROPERTY:
		g_value_set_object (value, budgie_current_state_get_screenshot_settings (self));
		break;
		case BUDGIE_CURRENT_STATE_NEWSTATE_PROPERTY:
		g_value_set_int (value, budgie_current_state_get_newstate (self));
		break;
		case BUDGIE_CURRENT_STATE_SHOWTOOLTIPS_PROPERTY:
		g_value_set_boolean (value, budgie_current_state_get_showtooltips (self));
		break;
		case BUDGIE_CURRENT_STATE_EMIT_CAPTURE_SOUND_PROPERTY:
		g_value_set_boolean (value, budgie_current_state_get_emit_capture_sound (self));
		break;
		case BUDGIE_CURRENT_STATE_BUTTONPOS_PROPERTY:
		g_value_set_int (value, budgie_current_state_get_buttonpos (self));
		break;
		case BUDGIE_CURRENT_STATE_TEMPFILE_PATH_PROPERTY:
		g_value_set_string (value, budgie_current_state_get_tempfile_path (self));
		break;
		case BUDGIE_CURRENT_STATE_STARTEDFROMGUI_PROPERTY:
		g_value_set_boolean (value, budgie_current_state_get_startedfromgui (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_budgie_current_state_set_property (GObject * object,
                                         guint property_id,
                                         const GValue * value,
                                         GParamSpec * pspec)
{
	BudgieCurrentState * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BUDGIE_TYPE_CURRENT_STATE, BudgieCurrentState);
	switch (property_id) {
		case BUDGIE_CURRENT_STATE_SCREENSHOT_SETTINGS_PROPERTY:
		budgie_current_state_set_screenshot_settings (self, g_value_get_object (value));
		break;
		case BUDGIE_CURRENT_STATE_NEWSTATE_PROPERTY:
		budgie_current_state_set_newstate (self, g_value_get_int (value));
		break;
		case BUDGIE_CURRENT_STATE_SHOWTOOLTIPS_PROPERTY:
		budgie_current_state_set_showtooltips (self, g_value_get_boolean (value));
		break;
		case BUDGIE_CURRENT_STATE_EMIT_CAPTURE_SOUND_PROPERTY:
		budgie_current_state_set_emit_capture_sound (self, g_value_get_boolean (value));
		break;
		case BUDGIE_CURRENT_STATE_BUTTONPOS_PROPERTY:
		budgie_current_state_set_buttonpos (self, g_value_get_int (value));
		break;
		case BUDGIE_CURRENT_STATE_TEMPFILE_PATH_PROPERTY:
		budgie_current_state_set_tempfile_path (self, g_value_get_string (value));
		break;
		case BUDGIE_CURRENT_STATE_STARTEDFROMGUI_PROPERTY:
		budgie_current_state_set_startedfromgui (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
budgie_screenshot_server_get_instance_private (BudgieScreenshotServer* self)
{
	return G_STRUCT_MEMBER_P (self, BudgieScreenshotServer_private_offset);
}

BudgieScreenshotServer*
budgie_screenshot_server_construct (GType object_type)
{
	BudgieScreenshotServer * self = NULL;
	BudgieCurrentState* _tmp0_;
	self = (BudgieScreenshotServer*) g_object_new (object_type, NULL);
	_tmp0_ = budgie_current_state_new ();
	_g_object_unref0 (self->priv->windowstate);
	self->priv->windowstate = _tmp0_;
	return self;
}

BudgieScreenshotServer*
budgie_screenshot_server_new (void)
{
	return budgie_screenshot_server_construct (BUDGIE_TYPE_SCREENSHOT_SERVER);
}

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

void
budgie_screenshot_server_StartMainWindow (BudgieScreenshotServer* self,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_)
{
	budgie_screenshot_server_StartMainWindowData* _data_;
	BudgieScreenshotServer* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (budgie_screenshot_server_StartMainWindowData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, budgie_screenshot_server_StartMainWindow_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	budgie_screenshot_server_StartMainWindow_co (_data_);
}

void
budgie_screenshot_server_StartMainWindow_finish (BudgieScreenshotServer* self,
                                                 GAsyncResult* _res_,
                                                 GError** error)
{
	budgie_screenshot_server_StartMainWindowData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static gboolean
budgie_screenshot_server_StartMainWindow_co (budgie_screenshot_server_StartMainWindowData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (budgie_screenshot_server_getcurrentstate (_data_->self) == ((gint) BUDGIE_WINDOW_STATE_NONE)) {
		_data_->_tmp0_ = budgie_screenshot_home_window_new ();
		g_object_ref_sink (_data_->_tmp0_);
		_data_->_tmp1_ = _data_->_tmp0_;
		_g_object_unref0 (_data_->_tmp1_);
	}
	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
budgie_screenshot_server_StartAreaSelect_data_free (gpointer _data)
{
	budgie_screenshot_server_StartAreaSelectData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (budgie_screenshot_server_StartAreaSelectData, _data_);
}

void
budgie_screenshot_server_StartAreaSelect (BudgieScreenshotServer* self,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_)
{
	budgie_screenshot_server_StartAreaSelectData* _data_;
	BudgieScreenshotServer* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (budgie_screenshot_server_StartAreaSelectData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, budgie_screenshot_server_StartAreaSelect_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	budgie_screenshot_server_StartAreaSelect_co (_data_);
}

void
budgie_screenshot_server_StartAreaSelect_finish (BudgieScreenshotServer* self,
                                                 GAsyncResult* _res_,
                                                 GError** error)
{
	budgie_screenshot_server_StartAreaSelectData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static gboolean
budgie_screenshot_server_StartAreaSelect_co (budgie_screenshot_server_StartAreaSelectData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (budgie_screenshot_server_getcurrentstate (_data_->self) == ((gint) BUDGIE_WINDOW_STATE_NONE)) {
		budgie_screenshot_server_set_target (_data_->self, BUDGIE_SELECTION);
		_data_->_tmp0_ = budgie_select_layer_new (NULL);
		_data_->_tmp1_ = _data_->_tmp0_;
		_g_object_unref0 (_data_->_tmp1_);
	}
	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
budgie_screenshot_server_StartWindowScreenshot_data_free (gpointer _data)
{
	budgie_screenshot_server_StartWindowScreenshotData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (budgie_screenshot_server_StartWindowScreenshotData, _data_);
}

void
budgie_screenshot_server_StartWindowScreenshot (BudgieScreenshotServer* self,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_)
{
	budgie_screenshot_server_StartWindowScreenshotData* _data_;
	BudgieScreenshotServer* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (budgie_screenshot_server_StartWindowScreenshotData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, budgie_screenshot_server_StartWindowScreenshot_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	budgie_screenshot_server_StartWindowScreenshot_co (_data_);
}

void
budgie_screenshot_server_StartWindowScreenshot_finish (BudgieScreenshotServer* self,
                                                       GAsyncResult* _res_,
                                                       GError** error)
{
	budgie_screenshot_server_StartWindowScreenshotData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static gboolean
budgie_screenshot_server_StartWindowScreenshot_co (budgie_screenshot_server_StartWindowScreenshotData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (budgie_screenshot_server_getcurrentstate (_data_->self) == ((gint) BUDGIE_WINDOW_STATE_NONE)) {
		budgie_screenshot_server_set_target (_data_->self, BUDGIE_WINDOW);
		_data_->_tmp0_ = budgie_make_screenshot_new (NULL, 0);
		_data_->_tmp1_ = _data_->_tmp0_;
		_budgie_make_screenshot_unref0 (_data_->_tmp1_);
	}
	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
budgie_screenshot_server_StartFullScreenshot_data_free (gpointer _data)
{
	budgie_screenshot_server_StartFullScreenshotData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (budgie_screenshot_server_StartFullScreenshotData, _data_);
}

void
budgie_screenshot_server_StartFullScreenshot (BudgieScreenshotServer* self,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_)
{
	budgie_screenshot_server_StartFullScreenshotData* _data_;
	BudgieScreenshotServer* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (budgie_screenshot_server_StartFullScreenshotData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, budgie_screenshot_server_StartFullScreenshot_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	budgie_screenshot_server_StartFullScreenshot_co (_data_);
}

void
budgie_screenshot_server_StartFullScreenshot_finish (BudgieScreenshotServer* self,
                                                     GAsyncResult* _res_,
                                                     GError** error)
{
	budgie_screenshot_server_StartFullScreenshotData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static gboolean
budgie_screenshot_server_StartFullScreenshot_co (budgie_screenshot_server_StartFullScreenshotData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (budgie_screenshot_server_getcurrentstate (_data_->self) == ((gint) BUDGIE_WINDOW_STATE_NONE)) {
		budgie_screenshot_server_set_target (_data_->self, BUDGIE_SCREEN);
		_data_->_tmp0_ = budgie_make_screenshot_new (NULL, 0);
		_data_->_tmp1_ = _data_->_tmp0_;
		_budgie_make_screenshot_unref0 (_data_->_tmp1_);
	}
	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
budgie_screenshot_server_on_bus_acquired (BudgieScreenshotServer* self,
                                          GDBusConnection* conn)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (conn != NULL);
	{
		BudgieScreenshotServer* _tmp0_;
		BudgieScreenshotServer* _tmp1_;
		_tmp0_ = budgie_screenshot_server_new ();
		_tmp1_ = _tmp0_;
		budgie_screenshot_server_register_object (_tmp1_, conn, "/org/buddiesofbudgie/ScreenshotControl", &_inner_error0_);
		_g_object_unref0 (_tmp1_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_IO_ERROR) {
				goto __catch0_g_io_error;
			}
			g_critical ("file %s: line %d: unexpected 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;
		}
	}
	goto __finally0;
	__catch0_g_io_error:
	{
		g_clear_error (&_inner_error0_);
		g_warning ("screenshot.vala:130: on_bus_acquired Could not register service");
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
_budgie_screenshot_server_on_bus_acquired_gbus_acquired_callback (GDBusConnection* connection,
                                                                  const gchar* name,
                                                                  gpointer self)
{
	budgie_screenshot_server_on_bus_acquired ((BudgieScreenshotServer*) self, connection);
}

static void
__lambda28_ (BudgieScreenshotServer* self)
{
}

static void
___lambda28__gbus_name_acquired_callback (GDBusConnection* connection,
                                          const gchar* name,
                                          gpointer self)
{
	__lambda28_ ((BudgieScreenshotServer*) self);
}

static void
__lambda29_ (BudgieScreenshotServer* self)
{
	g_warning ("screenshot.vala:138: setup_dbus Could not acquire name");
}

static void
___lambda29__gbus_name_lost_callback (GDBusConnection* connection,
                                      const gchar* name,
                                      gpointer self)
{
	__lambda29_ ((BudgieScreenshotServer*) self);
}

void
budgie_screenshot_server_setup_dbus (BudgieScreenshotServer* self,
                                     GError** error)
{
	g_return_if_fail (self != NULL);
	g_bus_own_name_with_closures (G_BUS_TYPE_SESSION, "org.buddiesofbudgie.BudgieScreenshotControl", G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT | G_BUS_NAME_OWNER_FLAGS_REPLACE, (GClosure*) ((_budgie_screenshot_server_on_bus_acquired_gbus_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) _budgie_screenshot_server_on_bus_acquired_gbus_acquired_callback, g_object_ref (self), (GClosureNotify) g_object_unref)), (GClosure*) ((___lambda28__gbus_name_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda28__gbus_name_acquired_callback, g_object_ref (self), (GClosureNotify) g_object_unref)), (GClosure*) ((___lambda29__gbus_name_lost_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda29__gbus_name_lost_callback, g_object_ref (self), (GClosureNotify) g_object_unref)));
}

static gint
budgie_screenshot_server_getcurrentstate (BudgieScreenshotServer* self)
{
	BudgieCurrentState* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gint result;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->windowstate;
	_tmp1_ = budgie_current_state_get_newstate (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

static void
budgie_screenshot_server_set_target (BudgieScreenshotServer* self,
                                     const gchar* target)
{
	BudgieCurrentState* _tmp0_;
	GSettings* _tmp1_;
	GSettings* _tmp2_;
	BudgieCurrentState* _tmp3_;
	GSettings* _tmp4_;
	GSettings* _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (target != NULL);
	_tmp0_ = self->priv->windowstate;
	_tmp1_ = budgie_current_state_get_screenshot_settings (_tmp0_);
	_tmp2_ = _tmp1_;
	g_settings_set_string (_tmp2_, "screenshot-mode", target);
	_tmp3_ = self->priv->windowstate;
	_tmp4_ = budgie_current_state_get_screenshot_settings (_tmp3_);
	_tmp5_ = _tmp4_;
	g_settings_set_int (_tmp5_, "delay", 0);
}

static void
budgie_screenshot_server_class_init (BudgieScreenshotServerClass * klass,
                                     gpointer klass_data)
{
	budgie_screenshot_server_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BudgieScreenshotServer_private_offset);
	G_OBJECT_CLASS (klass)->finalize = budgie_screenshot_server_finalize;
}

static void
budgie_screenshot_server_instance_init (BudgieScreenshotServer * self,
                                        gpointer klass)
{
	self->priv = budgie_screenshot_server_get_instance_private (self);
}

static void
budgie_screenshot_server_finalize (GObject * obj)
{
	BudgieScreenshotServer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BUDGIE_TYPE_SCREENSHOT_SERVER, BudgieScreenshotServer);
	_g_object_unref0 (self->priv->windowstate);
	G_OBJECT_CLASS (budgie_screenshot_server_parent_class)->finalize (obj);
}

static GType
budgie_screenshot_server_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BudgieScreenshotServerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) budgie_screenshot_server_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BudgieScreenshotServer), 0, (GInstanceInitFunc) budgie_screenshot_server_instance_init, NULL };
	GType budgie_screenshot_server_type_id;
	budgie_screenshot_server_type_id = g_type_register_static (G_TYPE_OBJECT, "BudgieScreenshotServer", &g_define_type_info, 0);
	g_type_set_qdata (budgie_screenshot_server_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) budgie_screenshot_server_register_object);
	BudgieScreenshotServer_private_offset = g_type_add_instance_private (budgie_screenshot_server_type_id, sizeof (BudgieScreenshotServerPrivate));
	return budgie_screenshot_server_type_id;
}

GType
budgie_screenshot_server_get_type (void)
{
	static volatile gsize budgie_screenshot_server_type_id__once = 0;
	if (g_once_init_enter (&budgie_screenshot_server_type_id__once)) {
		GType budgie_screenshot_server_type_id;
		budgie_screenshot_server_type_id = budgie_screenshot_server_get_type_once ();
		g_once_init_leave (&budgie_screenshot_server_type_id__once, budgie_screenshot_server_type_id);
	}
	return budgie_screenshot_server_type_id__once;
}

static void
_dbus_budgie_screenshot_server_StartMainWindow (BudgieScreenshotServer* self,
                                                GVariant* _parameters_,
                                                GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	budgie_screenshot_server_StartMainWindowReadyData* _ready_data;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (budgie_screenshot_server_StartMainWindowReadyData);
	_ready_data->_invocation_ = invocation;
	budgie_screenshot_server_StartMainWindow (self, (GAsyncReadyCallback) _dbus_budgie_screenshot_server_StartMainWindow_ready, _ready_data);
}

static void
_dbus_budgie_screenshot_server_StartMainWindow_ready (GObject * source_object,
                                                      GAsyncResult * _res_,
                                                      gpointer _user_data_)
{
	budgie_screenshot_server_StartMainWindowReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	budgie_screenshot_server_StartMainWindow_finish ((BudgieScreenshotServer*) 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 (budgie_screenshot_server_StartMainWindowReadyData, _ready_data);
}

static void
_dbus_budgie_screenshot_server_StartAreaSelect (BudgieScreenshotServer* self,
                                                GVariant* _parameters_,
                                                GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	budgie_screenshot_server_StartAreaSelectReadyData* _ready_data;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (budgie_screenshot_server_StartAreaSelectReadyData);
	_ready_data->_invocation_ = invocation;
	budgie_screenshot_server_StartAreaSelect (self, (GAsyncReadyCallback) _dbus_budgie_screenshot_server_StartAreaSelect_ready, _ready_data);
}

static void
_dbus_budgie_screenshot_server_StartAreaSelect_ready (GObject * source_object,
                                                      GAsyncResult * _res_,
                                                      gpointer _user_data_)
{
	budgie_screenshot_server_StartAreaSelectReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	budgie_screenshot_server_StartAreaSelect_finish ((BudgieScreenshotServer*) 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 (budgie_screenshot_server_StartAreaSelectReadyData, _ready_data);
}

static void
_dbus_budgie_screenshot_server_StartWindowScreenshot (BudgieScreenshotServer* self,
                                                      GVariant* _parameters_,
                                                      GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	budgie_screenshot_server_StartWindowScreenshotReadyData* _ready_data;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (budgie_screenshot_server_StartWindowScreenshotReadyData);
	_ready_data->_invocation_ = invocation;
	budgie_screenshot_server_StartWindowScreenshot (self, (GAsyncReadyCallback) _dbus_budgie_screenshot_server_StartWindowScreenshot_ready, _ready_data);
}

static void
_dbus_budgie_screenshot_server_StartWindowScreenshot_ready (GObject * source_object,
                                                            GAsyncResult * _res_,
                                                            gpointer _user_data_)
{
	budgie_screenshot_server_StartWindowScreenshotReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	budgie_screenshot_server_StartWindowScreenshot_finish ((BudgieScreenshotServer*) 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 (budgie_screenshot_server_StartWindowScreenshotReadyData, _ready_data);
}

static void
_dbus_budgie_screenshot_server_StartFullScreenshot (BudgieScreenshotServer* self,
                                                    GVariant* _parameters_,
                                                    GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	budgie_screenshot_server_StartFullScreenshotReadyData* _ready_data;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (budgie_screenshot_server_StartFullScreenshotReadyData);
	_ready_data->_invocation_ = invocation;
	budgie_screenshot_server_StartFullScreenshot (self, (GAsyncReadyCallback) _dbus_budgie_screenshot_server_StartFullScreenshot_ready, _ready_data);
}

static void
_dbus_budgie_screenshot_server_StartFullScreenshot_ready (GObject * source_object,
                                                          GAsyncResult * _res_,
                                                          gpointer _user_data_)
{
	budgie_screenshot_server_StartFullScreenshotReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	budgie_screenshot_server_StartFullScreenshot_finish ((BudgieScreenshotServer*) 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 (budgie_screenshot_server_StartFullScreenshotReadyData, _ready_data);
}

static void
_dbus_budgie_screenshot_server_setup_dbus (BudgieScreenshotServer* self,
                                           GVariant* _parameters_,
                                           GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	budgie_screenshot_server_setup_dbus (self, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
budgie_screenshot_server_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, "StartMainWindow") == 0) {
		_dbus_budgie_screenshot_server_StartMainWindow (object, parameters, invocation);
	} else if (strcmp (method_name, "StartAreaSelect") == 0) {
		_dbus_budgie_screenshot_server_StartAreaSelect (object, parameters, invocation);
	} else if (strcmp (method_name, "StartWindowScreenshot") == 0) {
		_dbus_budgie_screenshot_server_StartWindowScreenshot (object, parameters, invocation);
	} else if (strcmp (method_name, "StartFullScreenshot") == 0) {
		_dbus_budgie_screenshot_server_StartFullScreenshot (object, parameters, invocation);
	} else if (strcmp (method_name, "SetupDbus") == 0) {
		_dbus_budgie_screenshot_server_setup_dbus (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
budgie_screenshot_server_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
budgie_screenshot_server_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
budgie_screenshot_server_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 *) (&_budgie_screenshot_server_dbus_interface_info), &_budgie_screenshot_server_dbus_interface_vtable, data, _budgie_screenshot_server_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}

static void
_budgie_screenshot_server_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);
}

void
budgie_screenshot_client_ScreenshotArea (BudgieScreenshotClient* self,
                                         gint x,
                                         gint y,
                                         gint width,
                                         gint height,
                                         gboolean include_cursor,
                                         gboolean flash,
                                         const gchar* filename,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_)
{
	BudgieScreenshotClientIface* _iface_;
	_iface_ = BUDGIE_SCREENSHOT_CLIENT_GET_INTERFACE (self);
	if (_iface_->ScreenshotArea) {
		_iface_->ScreenshotArea (self, x, y, width, height, include_cursor, flash, filename, _callback_, _user_data_);
	}
}

void
budgie_screenshot_client_ScreenshotArea_finish (BudgieScreenshotClient* self,
                                                GAsyncResult* _res_,
                                                gboolean* success,
                                                gchar** filename_used,
                                                GError** error)
{
	BudgieScreenshotClientIface* _iface_;
	_iface_ = BUDGIE_SCREENSHOT_CLIENT_GET_INTERFACE (self);
	if (_iface_->ScreenshotArea_finish) {
		_iface_->ScreenshotArea_finish (self, _res_, success, filename_used, error);
	}
}

void
budgie_screenshot_client_Screenshot (BudgieScreenshotClient* self,
                                     gboolean include_cursor,
                                     gboolean flash,
                                     const gchar* filename,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	BudgieScreenshotClientIface* _iface_;
	_iface_ = BUDGIE_SCREENSHOT_CLIENT_GET_INTERFACE (self);
	if (_iface_->Screenshot) {
		_iface_->Screenshot (self, include_cursor, flash, filename, _callback_, _user_data_);
	}
}

void
budgie_screenshot_client_Screenshot_finish (BudgieScreenshotClient* self,
                                            GAsyncResult* _res_,
                                            gboolean* success,
                                            gchar** filename_used,
                                            GError** error)
{
	BudgieScreenshotClientIface* _iface_;
	_iface_ = BUDGIE_SCREENSHOT_CLIENT_GET_INTERFACE (self);
	if (_iface_->Screenshot_finish) {
		_iface_->Screenshot_finish (self, _res_, success, filename_used, error);
	}
}

void
budgie_screenshot_client_ScreenshotWindow (BudgieScreenshotClient* self,
                                           gboolean include_frame,
                                           gboolean include_cursor,
                                           gboolean flash,
                                           const gchar* filename,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_)
{
	BudgieScreenshotClientIface* _iface_;
	_iface_ = BUDGIE_SCREENSHOT_CLIENT_GET_INTERFACE (self);
	if (_iface_->ScreenshotWindow) {
		_iface_->ScreenshotWindow (self, include_frame, include_cursor, flash, filename, _callback_, _user_data_);
	}
}

void
budgie_screenshot_client_ScreenshotWindow_finish (BudgieScreenshotClient* self,
                                                  GAsyncResult* _res_,
                                                  gboolean* success,
                                                  gchar** filename_used,
                                                  GError** error)
{
	BudgieScreenshotClientIface* _iface_;
	_iface_ = BUDGIE_SCREENSHOT_CLIENT_GET_INTERFACE (self);
	if (_iface_->ScreenshotWindow_finish) {
		_iface_->ScreenshotWindow_finish (self, _res_, success, filename_used, error);
	}
}

gboolean
budgie_screenshot_client_SupportScreenshotWindow (BudgieScreenshotClient* self,
                                                  GError** error)
{
	BudgieScreenshotClientIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = BUDGIE_SCREENSHOT_CLIENT_GET_INTERFACE (self);
	if (_iface_->SupportScreenshotWindow) {
		return _iface_->SupportScreenshotWindow (self, error);
	}
	return FALSE;
}

static void
budgie_screenshot_client_default_init (BudgieScreenshotClientIface * iface,
                                       gpointer iface_data)
{
}

static GType
budgie_screenshot_client_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BudgieScreenshotClientIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) budgie_screenshot_client_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType budgie_screenshot_client_type_id;
	budgie_screenshot_client_type_id = g_type_register_static (G_TYPE_INTERFACE, "BudgieScreenshotClient", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (budgie_screenshot_client_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (budgie_screenshot_client_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) budgie_screenshot_client_proxy_get_type);
	g_type_set_qdata (budgie_screenshot_client_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.buddiesofbudgie.BudgieScreenshot");
	g_type_set_qdata (budgie_screenshot_client_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_budgie_screenshot_client_dbus_interface_info));
	g_type_set_qdata (budgie_screenshot_client_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) budgie_screenshot_client_register_object);
	return budgie_screenshot_client_type_id;
}

GType
budgie_screenshot_client_get_type (void)
{
	static volatile gsize budgie_screenshot_client_type_id__once = 0;
	if (g_once_init_enter (&budgie_screenshot_client_type_id__once)) {
		GType budgie_screenshot_client_type_id;
		budgie_screenshot_client_type_id = budgie_screenshot_client_get_type_once ();
		g_once_init_leave (&budgie_screenshot_client_type_id__once, budgie_screenshot_client_type_id);
	}
	return budgie_screenshot_client_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (BudgieScreenshotClientProxy, budgie_screenshot_client_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (BUDGIE_TYPE_SCREENSHOT_CLIENT, budgie_screenshot_client_proxy_budgie_screenshot_client_interface_init) )
static void
budgie_screenshot_client_proxy_class_init (BudgieScreenshotClientProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = budgie_screenshot_client_proxy_g_signal;
}

static void
budgie_screenshot_client_proxy_g_signal (GDBusProxy* proxy,
                                         const gchar* sender_name,
                                         const gchar* signal_name,
                                         GVariant* parameters)
{
}

static void
budgie_screenshot_client_proxy_init (BudgieScreenshotClientProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_budgie_screenshot_client_dbus_interface_info));
}

static void
_vala_g_async_ready_callback (GObject *source_object,
                              GAsyncResult *res,
                              void *user_data)
{
	g_task_return_pointer (user_data, g_object_ref (res), g_object_unref);
	g_object_unref (user_data);
}

static void
budgie_screenshot_client_proxy_ScreenshotArea_async (BudgieScreenshotClient* self,
                                                     gint x,
                                                     gint y,
                                                     gint width,
                                                     gint height,
                                                     gboolean include_cursor,
                                                     gboolean flash,
                                                     const gchar* filename,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.buddiesofbudgie.BudgieScreenshot", "ScreenshotArea");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_int32 (x));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_int32 (y));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_int32 (width));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_int32 (height));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_boolean (include_cursor));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_boolean (flash));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (filename));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	if (_callback_ != NULL) {
		g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_task_new ((GObject *) self, NULL, _callback_, _user_data_));
	} else {
		g_dbus_message_set_flags (_message, G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED);
		g_dbus_connection_send_message (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	}
	g_object_unref (_message);
}

static void
budgie_screenshot_client_proxy_ScreenshotArea_finish (BudgieScreenshotClient* self,
                                                      GAsyncResult* _res_,
                                                      gboolean* success,
                                                      gchar** filename_used,
                                                      GError** error)
{
	GAsyncResult *_inner_res;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	gboolean _vala_success = FALSE;
	GVariant* _tmp0_;
	gchar* _vala_filename_used = NULL;
	GVariant* _tmp1_;
	_inner_res = g_task_propagate_pointer ((GTask *) _res_, NULL);
	_reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), _inner_res, error);
	g_object_unref (_inner_res);
	if (!_reply_message) {
		return;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp0_ = g_variant_iter_next_value (&_reply_iter);
	_vala_success = g_variant_get_boolean (_tmp0_);
	g_variant_unref (_tmp0_);
	*success = _vala_success;
	_tmp1_ = g_variant_iter_next_value (&_reply_iter);
	_vala_filename_used = g_variant_dup_string (_tmp1_, NULL);
	g_variant_unref (_tmp1_);
	*filename_used = _vala_filename_used;
	g_object_unref (_reply_message);
}

static void
budgie_screenshot_client_proxy_Screenshot_async (BudgieScreenshotClient* self,
                                                 gboolean include_cursor,
                                                 gboolean flash,
                                                 const gchar* filename,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.buddiesofbudgie.BudgieScreenshot", "Screenshot");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_boolean (include_cursor));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_boolean (flash));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (filename));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	if (_callback_ != NULL) {
		g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_task_new ((GObject *) self, NULL, _callback_, _user_data_));
	} else {
		g_dbus_message_set_flags (_message, G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED);
		g_dbus_connection_send_message (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	}
	g_object_unref (_message);
}

static void
budgie_screenshot_client_proxy_Screenshot_finish (BudgieScreenshotClient* self,
                                                  GAsyncResult* _res_,
                                                  gboolean* success,
                                                  gchar** filename_used,
                                                  GError** error)
{
	GAsyncResult *_inner_res;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	gboolean _vala_success = FALSE;
	GVariant* _tmp2_;
	gchar* _vala_filename_used = NULL;
	GVariant* _tmp3_;
	_inner_res = g_task_propagate_pointer ((GTask *) _res_, NULL);
	_reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), _inner_res, error);
	g_object_unref (_inner_res);
	if (!_reply_message) {
		return;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp2_ = g_variant_iter_next_value (&_reply_iter);
	_vala_success = g_variant_get_boolean (_tmp2_);
	g_variant_unref (_tmp2_);
	*success = _vala_success;
	_tmp3_ = g_variant_iter_next_value (&_reply_iter);
	_vala_filename_used = g_variant_dup_string (_tmp3_, NULL);
	g_variant_unref (_tmp3_);
	*filename_used = _vala_filename_used;
	g_object_unref (_reply_message);
}

static void
budgie_screenshot_client_proxy_ScreenshotWindow_async (BudgieScreenshotClient* self,
                                                       gboolean include_frame,
                                                       gboolean include_cursor,
                                                       gboolean flash,
                                                       const gchar* filename,
                                                       GAsyncReadyCallback _callback_,
                                                       gpointer _user_data_)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.buddiesofbudgie.BudgieScreenshot", "ScreenshotWindow");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_boolean (include_frame));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_boolean (include_cursor));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_boolean (flash));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (filename));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	if (_callback_ != NULL) {
		g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_task_new ((GObject *) self, NULL, _callback_, _user_data_));
	} else {
		g_dbus_message_set_flags (_message, G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED);
		g_dbus_connection_send_message (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	}
	g_object_unref (_message);
}

static void
budgie_screenshot_client_proxy_ScreenshotWindow_finish (BudgieScreenshotClient* self,
                                                        GAsyncResult* _res_,
                                                        gboolean* success,
                                                        gchar** filename_used,
                                                        GError** error)
{
	GAsyncResult *_inner_res;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	gboolean _vala_success = FALSE;
	GVariant* _tmp4_;
	gchar* _vala_filename_used = NULL;
	GVariant* _tmp5_;
	_inner_res = g_task_propagate_pointer ((GTask *) _res_, NULL);
	_reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), _inner_res, error);
	g_object_unref (_inner_res);
	if (!_reply_message) {
		return;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp4_ = g_variant_iter_next_value (&_reply_iter);
	_vala_success = g_variant_get_boolean (_tmp4_);
	g_variant_unref (_tmp4_);
	*success = _vala_success;
	_tmp5_ = g_variant_iter_next_value (&_reply_iter);
	_vala_filename_used = g_variant_dup_string (_tmp5_, NULL);
	g_variant_unref (_tmp5_);
	*filename_used = _vala_filename_used;
	g_object_unref (_reply_message);
}

static gboolean
budgie_screenshot_client_proxy_SupportScreenshotWindow (BudgieScreenshotClient* self,
                                                        GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	gboolean _result = FALSE;
	GVariant* _tmp8_;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.buddiesofbudgie.BudgieScreenshot", "SupportScreenshotWindow");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	_reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
	g_object_unref (_message);
	if (!_reply_message) {
		gboolean _tmp6_ = FALSE;
		return _tmp6_;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		gboolean _tmp7_ = FALSE;
		g_object_unref (_reply_message);
		return _tmp7_;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp8_ = g_variant_iter_next_value (&_reply_iter);
	_result = g_variant_get_boolean (_tmp8_);
	g_variant_unref (_tmp8_);
	g_object_unref (_reply_message);
	return _result;
}

static void
budgie_screenshot_client_proxy_budgie_screenshot_client_interface_init (BudgieScreenshotClientIface* iface)
{
	iface->ScreenshotArea = budgie_screenshot_client_proxy_ScreenshotArea_async;
	iface->ScreenshotArea_finish = budgie_screenshot_client_proxy_ScreenshotArea_finish;
	iface->Screenshot = budgie_screenshot_client_proxy_Screenshot_async;
	iface->Screenshot_finish = budgie_screenshot_client_proxy_Screenshot_finish;
	iface->ScreenshotWindow = budgie_screenshot_client_proxy_ScreenshotWindow_async;
	iface->ScreenshotWindow_finish = budgie_screenshot_client_proxy_ScreenshotWindow_finish;
	iface->SupportScreenshotWindow = budgie_screenshot_client_proxy_SupportScreenshotWindow;
}

static void
_dbus_budgie_screenshot_client_ScreenshotArea (BudgieScreenshotClient* self,
                                               GVariant* _parameters_,
                                               GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	budgie_screenshot_client_ScreenshotAreaReadyData* _ready_data;
	GVariant* _tmp9_;
	GVariant* _tmp10_;
	GVariant* _tmp11_;
	GVariant* _tmp12_;
	GVariant* _tmp13_;
	GVariant* _tmp14_;
	GVariant* _tmp15_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (budgie_screenshot_client_ScreenshotAreaReadyData);
	_ready_data->_invocation_ = invocation;
	_tmp9_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->x = g_variant_get_int32 (_tmp9_);
	g_variant_unref (_tmp9_);
	_tmp10_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->y = g_variant_get_int32 (_tmp10_);
	g_variant_unref (_tmp10_);
	_tmp11_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->width = g_variant_get_int32 (_tmp11_);
	g_variant_unref (_tmp11_);
	_tmp12_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->height = g_variant_get_int32 (_tmp12_);
	g_variant_unref (_tmp12_);
	_tmp13_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->include_cursor = g_variant_get_boolean (_tmp13_);
	g_variant_unref (_tmp13_);
	_tmp14_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->flash = g_variant_get_boolean (_tmp14_);
	g_variant_unref (_tmp14_);
	_tmp15_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->filename = g_variant_dup_string (_tmp15_, NULL);
	g_variant_unref (_tmp15_);
	budgie_screenshot_client_ScreenshotArea (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_budgie_screenshot_client_ScreenshotArea_ready, _ready_data);
	_error:
	;
}

static void
_dbus_budgie_screenshot_client_ScreenshotArea_ready (GObject * source_object,
                                                     GAsyncResult * _res_,
                                                     gpointer _user_data_)
{
	budgie_screenshot_client_ScreenshotAreaReadyData* _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_;
	budgie_screenshot_client_ScreenshotArea_finish ((BudgieScreenshotClient*) 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 (budgie_screenshot_client_ScreenshotAreaReadyData, _ready_data);
}

static void
_dbus_budgie_screenshot_client_Screenshot (BudgieScreenshotClient* self,
                                           GVariant* _parameters_,
                                           GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	budgie_screenshot_client_ScreenshotReadyData* _ready_data;
	GVariant* _tmp16_;
	GVariant* _tmp17_;
	GVariant* _tmp18_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (budgie_screenshot_client_ScreenshotReadyData);
	_ready_data->_invocation_ = invocation;
	_tmp16_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->include_cursor = g_variant_get_boolean (_tmp16_);
	g_variant_unref (_tmp16_);
	_tmp17_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->flash = g_variant_get_boolean (_tmp17_);
	g_variant_unref (_tmp17_);
	_tmp18_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->filename = g_variant_dup_string (_tmp18_, NULL);
	g_variant_unref (_tmp18_);
	budgie_screenshot_client_Screenshot (self, _ready_data->include_cursor, _ready_data->flash, _ready_data->filename, (GAsyncReadyCallback) _dbus_budgie_screenshot_client_Screenshot_ready, _ready_data);
	_error:
	;
}

static void
_dbus_budgie_screenshot_client_Screenshot_ready (GObject * source_object,
                                                 GAsyncResult * _res_,
                                                 gpointer _user_data_)
{
	budgie_screenshot_client_ScreenshotReadyData* _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_;
	budgie_screenshot_client_Screenshot_finish ((BudgieScreenshotClient*) 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 (budgie_screenshot_client_ScreenshotReadyData, _ready_data);
}

static void
_dbus_budgie_screenshot_client_ScreenshotWindow (BudgieScreenshotClient* self,
                                                 GVariant* _parameters_,
                                                 GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	budgie_screenshot_client_ScreenshotWindowReadyData* _ready_data;
	GVariant* _tmp19_;
	GVariant* _tmp20_;
	GVariant* _tmp21_;
	GVariant* _tmp22_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (budgie_screenshot_client_ScreenshotWindowReadyData);
	_ready_data->_invocation_ = invocation;
	_tmp19_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->include_frame = g_variant_get_boolean (_tmp19_);
	g_variant_unref (_tmp19_);
	_tmp20_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->include_cursor = g_variant_get_boolean (_tmp20_);
	g_variant_unref (_tmp20_);
	_tmp21_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->flash = g_variant_get_boolean (_tmp21_);
	g_variant_unref (_tmp21_);
	_tmp22_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->filename = g_variant_dup_string (_tmp22_, NULL);
	g_variant_unref (_tmp22_);
	budgie_screenshot_client_ScreenshotWindow (self, _ready_data->include_frame, _ready_data->include_cursor, _ready_data->flash, _ready_data->filename, (GAsyncReadyCallback) _dbus_budgie_screenshot_client_ScreenshotWindow_ready, _ready_data);
	_error:
	;
}

static void
_dbus_budgie_screenshot_client_ScreenshotWindow_ready (GObject * source_object,
                                                       GAsyncResult * _res_,
                                                       gpointer _user_data_)
{
	budgie_screenshot_client_ScreenshotWindowReadyData* _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_;
	budgie_screenshot_client_ScreenshotWindow_finish ((BudgieScreenshotClient*) 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 (budgie_screenshot_client_ScreenshotWindowReadyData, _ready_data);
}

static void
_dbus_budgie_screenshot_client_SupportScreenshotWindow (BudgieScreenshotClient* self,
                                                        GVariant* _parameters_,
                                                        GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gboolean result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	result = budgie_screenshot_client_SupportScreenshotWindow (self, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_boolean (result));
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
budgie_screenshot_client_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, "ScreenshotArea") == 0) {
		_dbus_budgie_screenshot_client_ScreenshotArea (object, parameters, invocation);
	} else if (strcmp (method_name, "Screenshot") == 0) {
		_dbus_budgie_screenshot_client_Screenshot (object, parameters, invocation);
	} else if (strcmp (method_name, "ScreenshotWindow") == 0) {
		_dbus_budgie_screenshot_client_ScreenshotWindow (object, parameters, invocation);
	} else if (strcmp (method_name, "SupportScreenshotWindow") == 0) {
		_dbus_budgie_screenshot_client_SupportScreenshotWindow (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
budgie_screenshot_client_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
budgie_screenshot_client_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
budgie_screenshot_client_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 *) (&_budgie_screenshot_client_dbus_interface_info), &_budgie_screenshot_client_dbus_interface_vtable, data, _budgie_screenshot_client_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}

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

static inline gpointer
budgie_make_screenshot_get_instance_private (BudgieMakeScreenshot* self)
{
	return G_STRUCT_MEMBER_P (self, BudgieMakeScreenshot_private_offset);
}

static void
budgie_make_screenshot_MakeClientConnection (void)
{
	BudgieScreenshotClient* _tmp0_;
	GError* _inner_error0_ = NULL;
	_tmp0_ = budgie_make_screenshot_client;
	if (_tmp0_ == NULL) {
		{
			BudgieScreenshotClient* _tmp1_ = NULL;
			BudgieScreenshotClient* _tmp2_;
			BudgieScreenshotClient* _tmp3_;
			_tmp2_ = (BudgieScreenshotClient*) g_initable_new (BUDGIE_TYPE_SCREENSHOT_CLIENT_PROXY, NULL, &_inner_error0_, "g-flags", 0, "g-name", "org.buddiesofbudgie.BudgieScreenshot", "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/org/buddiesofbudgie/Screenshot", "g-interface-name", "org.buddiesofbudgie.BudgieScreenshot", NULL);
			_tmp1_ = (BudgieScreenshotClient*) _tmp2_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_tmp3_ = _tmp1_;
			_tmp1_ = NULL;
			_g_object_unref0 (budgie_make_screenshot_client);
			budgie_make_screenshot_client = _tmp3_;
			_g_object_unref0 (_tmp1_);
		}
		goto __finally0;
		__catch0_g_error:
		{
			GError* e = NULL;
			GError* _tmp4_;
			const gchar* _tmp5_;
			e = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp4_ = e;
			_tmp5_ = _tmp4_->message;
			g_warning ("screenshot.vala:179: MakeScreenshot get_proxy_sync %s", _tmp5_);
			_g_object_unref0 (budgie_make_screenshot_client);
			budgie_make_screenshot_client = NULL;
			_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;
		}
	}
}

gboolean
budgie_make_screenshot_ScreenshotWindowSupport (void)
{
	gboolean _tmp2_ = FALSE;
	GError* _inner_error0_ = NULL;
	gboolean result;
	budgie_make_screenshot_MakeClientConnection ();
	{
		gboolean _tmp0_ = FALSE;
		BudgieScreenshotClient* _tmp1_;
		_tmp1_ = budgie_make_screenshot_client;
		_tmp0_ = budgie_screenshot_client_SupportScreenshotWindow (_tmp1_, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		result = _tmp0_;
		return result;
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
		g_warning ("screenshot.vala:192: Unknown Screenshot Window support");
		result = FALSE;
		return result;
	}
	__finally0:
	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 _tmp2_;
}

static gint*
_vala_array_dup1 (gint* self,
                  gssize length)
{
	if (length > 0) {
		return _vala_memdup2 (self, length * sizeof (gint));
	}
	return NULL;
}

static gboolean
___lambda9_ (BudgieMakeScreenshot* self)
{
	gboolean result;
	budgie_make_screenshot_shoot_area (self, NULL, NULL);
	result = FALSE;
	return result;
}

static gboolean
____lambda9__gsource_func (gpointer self)
{
	gboolean result;
	result = ___lambda9_ ((BudgieMakeScreenshot*) self);
	return result;
}

static gboolean
___lambda18_ (BudgieMakeScreenshot* self)
{
	gboolean result;
	budgie_make_screenshot_shoot_screen (self, NULL, NULL);
	result = FALSE;
	return result;
}

static gboolean
____lambda18__gsource_func (gpointer self)
{
	gboolean result;
	result = ___lambda18_ ((BudgieMakeScreenshot*) self);
	return result;
}

static gboolean
___lambda19_ (BudgieMakeScreenshot* self)
{
	gboolean result;
	budgie_make_screenshot_shoot_window (self, NULL, NULL);
	result = FALSE;
	return result;
}

static gboolean
____lambda19__gsource_func (gpointer self)
{
	gboolean result;
	result = ___lambda19_ ((BudgieMakeScreenshot*) self);
	return result;
}

BudgieMakeScreenshot*
budgie_make_screenshot_construct (GType object_type,
                                  gint* area,
                                  gint area_length1)
{
	BudgieMakeScreenshot* self = NULL;
	BudgieCurrentState* _tmp0_;
	gint* _tmp1_;
	gint _tmp1__length1;
	BudgieCurrentState* _tmp2_;
	GSettings* _tmp3_;
	GSettings* _tmp4_;
	BudgieCurrentState* _tmp5_;
	GSettings* _tmp6_;
	GSettings* _tmp7_;
	BudgieCurrentState* _tmp8_;
	GSettings* _tmp9_;
	GSettings* _tmp10_;
	gchar* _tmp11_;
	BudgieCurrentState* _tmp12_;
	GSettings* _tmp13_;
	GSettings* _tmp14_;
	BudgieCurrentState* _tmp15_;
	GSettings* _tmp16_;
	GSettings* _tmp17_;
	const gchar* _tmp18_;
	const gchar* _tmp19_;
	GQuark _tmp21_ = 0U;
	static GQuark _tmp20_label0 = 0;
	static GQuark _tmp20_label1 = 0;
	static GQuark _tmp20_label2 = 0;
	self = (BudgieMakeScreenshot*) g_type_create_instance (object_type);
	budgie_make_screenshot_MakeClientConnection ();
	_tmp0_ = budgie_current_state_new ();
	_g_object_unref0 (self->priv->windowstate);
	self->priv->windowstate = _tmp0_;
	_tmp1_ = (area != NULL) ? _vala_array_dup1 (area, area_length1) : area;
	_tmp1__length1 = area_length1;
	self->priv->area = (g_free (self->priv->area), NULL);
	self->priv->area = _tmp1_;
	self->priv->area_length1 = _tmp1__length1;
	self->priv->_area_size_ = self->priv->area_length1;
	self->priv->scale = budgie_get_scaling ();
	_tmp2_ = self->priv->windowstate;
	_tmp3_ = budgie_current_state_get_screenshot_settings (_tmp2_);
	_tmp4_ = _tmp3_;
	self->priv->delay = g_settings_get_int (_tmp4_, "delay");
	_tmp5_ = self->priv->windowstate;
	_tmp6_ = budgie_current_state_get_screenshot_settings (_tmp5_);
	_tmp7_ = _tmp6_;
	self->priv->emit_capture_sound = g_settings_get_boolean (_tmp7_, "screenshot-capture-sound");
	_tmp8_ = self->priv->windowstate;
	_tmp9_ = budgie_current_state_get_screenshot_settings (_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = g_settings_get_string (_tmp10_, "screenshot-mode");
	_g_free0 (self->priv->screenshot_mode);
	self->priv->screenshot_mode = _tmp11_;
	_tmp12_ = self->priv->windowstate;
	_tmp13_ = budgie_current_state_get_screenshot_settings (_tmp12_);
	_tmp14_ = _tmp13_;
	self->priv->include_cursor = g_settings_get_boolean (_tmp14_, "include-cursor");
	_tmp15_ = self->priv->windowstate;
	_tmp16_ = budgie_current_state_get_screenshot_settings (_tmp15_);
	_tmp17_ = _tmp16_;
	self->priv->include_frame = g_settings_get_boolean (_tmp17_, "include-frame");
	_tmp18_ = self->priv->screenshot_mode;
	_tmp19_ = _tmp18_;
	_tmp21_ = (NULL == _tmp19_) ? 0 : g_quark_from_string (_tmp19_);
	if (_tmp21_ == ((0 != _tmp20_label0) ? _tmp20_label0 : (_tmp20_label0 = g_quark_from_static_string (BUDGIE_SELECTION)))) {
		switch (0) {
			default:
			{
				g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) (200 + (self->priv->delay * 1000)), ____lambda9__gsource_func, budgie_make_screenshot_ref (self), budgie_make_screenshot_unref);
				break;
			}
		}
	} else if (_tmp21_ == ((0 != _tmp20_label1) ? _tmp20_label1 : (_tmp20_label1 = g_quark_from_static_string (BUDGIE_SCREEN)))) {
		switch (0) {
			default:
			{
				g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) (200 + (self->priv->delay * 1000)), ____lambda18__gsource_func, budgie_make_screenshot_ref (self), budgie_make_screenshot_unref);
				break;
			}
		}
	} else if (_tmp21_ == ((0 != _tmp20_label2) ? _tmp20_label2 : (_tmp20_label2 = g_quark_from_static_string (BUDGIE_WINDOW)))) {
		switch (0) {
			default:
			{
				g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) (200 + (self->priv->delay * 1000)), ____lambda19__gsource_func, budgie_make_screenshot_ref (self), budgie_make_screenshot_unref);
				break;
			}
		}
	}
	return self;
}

BudgieMakeScreenshot*
budgie_make_screenshot_new (gint* area,
                            gint area_length1)
{
	return budgie_make_screenshot_construct (BUDGIE_TYPE_MAKE_SCREENSHOT, area, area_length1);
}

static void
budgie_make_screenshot_shoot_window_data_free (gpointer _data)
{
	BudgieMakeScreenshotShootWindowData* _data_;
	_data_ = _data;
	_budgie_make_screenshot_unref0 (_data_->self);
	g_slice_free (BudgieMakeScreenshotShootWindowData, _data_);
}

static gpointer
_budgie_make_screenshot_ref0 (gpointer self)
{
	return self ? budgie_make_screenshot_ref (self) : NULL;
}

static void
budgie_make_screenshot_shoot_window (BudgieMakeScreenshot* self,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	BudgieMakeScreenshotShootWindowData* _data_;
	BudgieMakeScreenshot* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (BudgieMakeScreenshotShootWindowData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, budgie_make_screenshot_shoot_window_data_free);
	_tmp0_ = _budgie_make_screenshot_ref0 (self);
	_data_->self = _tmp0_;
	budgie_make_screenshot_shoot_window_co (_data_);
}

static void
budgie_make_screenshot_shoot_window_finish (BudgieMakeScreenshot* self,
                                            GAsyncResult* _res_)
{
	BudgieMakeScreenshotShootWindowData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
budgie_make_screenshot_shoot_window_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_)
{
	BudgieMakeScreenshotShootWindowData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	budgie_make_screenshot_shoot_window_co (_data_);
}

static gboolean
budgie_make_screenshot_shoot_window_co (BudgieMakeScreenshotShootWindowData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->success = FALSE;
	_data_->_tmp0_ = g_strdup ("");
	_data_->filename_used = _data_->_tmp0_;
	budgie_make_screenshot_play_shuttersound (_data_->self, 200, NULL, (gint) 0);
	{
		_data_->_tmp1_ = budgie_make_screenshot_client;
		_data_->_tmp2_ = _data_->self->priv->windowstate;
		_data_->_tmp3_ = budgie_current_state_get_tempfile_path (_data_->_tmp2_);
		_data_->_tmp4_ = _data_->_tmp3_;
		_data_->_tmp5_ = FALSE;
		_data_->_tmp6_ = NULL;
		_data_->_state_ = 1;
		budgie_screenshot_client_ScreenshotWindow (_data_->_tmp1_, _data_->self->priv->include_frame, _data_->self->priv->include_cursor, TRUE, _data_->_tmp4_, budgie_make_screenshot_shoot_window_ready, _data_);
		return FALSE;
		_state_1:
		budgie_screenshot_client_ScreenshotWindow_finish (_data_->_tmp1_, _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)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp7_ = _data_->e;
		_data_->_tmp8_ = _data_->_tmp7_->message;
		g_warning ("screenshot.vala:239: show_window %s, failed to make screenshot", _data_->_tmp8_);
		_data_->_tmp9_ = _data_->self->priv->windowstate;
		budgie_current_state_statechanged (_data_->_tmp9_, (gint) BUDGIE_WINDOW_STATE_NONE);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_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;
	}
	if (_data_->success) {
		_data_->_tmp10_ = budgie_after_shot_window_new ();
		g_object_ref_sink (_data_->_tmp10_);
		_data_->_tmp11_ = _data_->_tmp10_;
		_g_object_unref0 (_data_->_tmp11_);
	}
	_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 void
budgie_make_screenshot_shoot_screen_data_free (gpointer _data)
{
	BudgieMakeScreenshotShootScreenData* _data_;
	_data_ = _data;
	_budgie_make_screenshot_unref0 (_data_->self);
	g_slice_free (BudgieMakeScreenshotShootScreenData, _data_);
}

static void
budgie_make_screenshot_shoot_screen (BudgieMakeScreenshot* self,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	BudgieMakeScreenshotShootScreenData* _data_;
	BudgieMakeScreenshot* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (BudgieMakeScreenshotShootScreenData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, budgie_make_screenshot_shoot_screen_data_free);
	_tmp0_ = _budgie_make_screenshot_ref0 (self);
	_data_->self = _tmp0_;
	budgie_make_screenshot_shoot_screen_co (_data_);
}

static void
budgie_make_screenshot_shoot_screen_finish (BudgieMakeScreenshot* self,
                                            GAsyncResult* _res_)
{
	BudgieMakeScreenshotShootScreenData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
budgie_make_screenshot_shoot_screen_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_)
{
	BudgieMakeScreenshotShootScreenData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	budgie_make_screenshot_shoot_screen_co (_data_);
}

static gboolean
budgie_make_screenshot_shoot_screen_co (BudgieMakeScreenshotShootScreenData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->success = FALSE;
	_data_->_tmp0_ = g_strdup ("");
	_data_->filename_used = _data_->_tmp0_;
	budgie_make_screenshot_play_shuttersound (_data_->self, 200, NULL, (gint) 0);
	{
		_data_->_tmp1_ = budgie_make_screenshot_client;
		_data_->_tmp2_ = _data_->self->priv->windowstate;
		_data_->_tmp3_ = budgie_current_state_get_tempfile_path (_data_->_tmp2_);
		_data_->_tmp4_ = _data_->_tmp3_;
		_data_->_tmp5_ = FALSE;
		_data_->_tmp6_ = NULL;
		_data_->_state_ = 1;
		budgie_screenshot_client_Screenshot (_data_->_tmp1_, _data_->self->priv->include_cursor, TRUE, _data_->_tmp4_, budgie_make_screenshot_shoot_screen_ready, _data_);
		return FALSE;
		_state_1:
		budgie_screenshot_client_Screenshot_finish (_data_->_tmp1_, _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)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp7_ = _data_->e;
		_data_->_tmp8_ = _data_->_tmp7_->message;
		g_warning ("screenshot.vala:257: shoot_screen %s, failed to make screenshot", _data_->_tmp8_);
		_data_->_tmp9_ = _data_->self->priv->windowstate;
		budgie_current_state_statechanged (_data_->_tmp9_, (gint) BUDGIE_WINDOW_STATE_NONE);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_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;
	}
	if (_data_->success) {
		_data_->_tmp10_ = budgie_after_shot_window_new ();
		g_object_ref_sink (_data_->_tmp10_);
		_data_->_tmp11_ = _data_->_tmp10_;
		_g_object_unref0 (_data_->_tmp11_);
	}
	_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 void
budgie_make_screenshot_shoot_area_data_free (gpointer _data)
{
	BudgieMakeScreenshotShootAreaData* _data_;
	_data_ = _data;
	_budgie_make_screenshot_unref0 (_data_->self);
	g_slice_free (BudgieMakeScreenshotShootAreaData, _data_);
}

static void
budgie_make_screenshot_shoot_area (BudgieMakeScreenshot* self,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	BudgieMakeScreenshotShootAreaData* _data_;
	BudgieMakeScreenshot* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (BudgieMakeScreenshotShootAreaData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, budgie_make_screenshot_shoot_area_data_free);
	_tmp0_ = _budgie_make_screenshot_ref0 (self);
	_data_->self = _tmp0_;
	budgie_make_screenshot_shoot_area_co (_data_);
}

static void
budgie_make_screenshot_shoot_area_finish (BudgieMakeScreenshot* self,
                                          GAsyncResult* _res_)
{
	BudgieMakeScreenshotShootAreaData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
budgie_make_screenshot_shoot_area_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_)
{
	BudgieMakeScreenshotShootAreaData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	budgie_make_screenshot_shoot_area_co (_data_);
}

static gboolean
budgie_make_screenshot_shoot_area_co (BudgieMakeScreenshotShootAreaData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->success = FALSE;
	_data_->_tmp0_ = g_strdup ("");
	_data_->filename_used = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->self->priv->area;
	_data_->_tmp1__length1 = _data_->self->priv->area_length1;
	_data_->_tmp2_ = _data_->_tmp1_[0];
	_data_->topleftx = _data_->_tmp2_;
	_data_->_tmp3_ = _data_->self->priv->area;
	_data_->_tmp3__length1 = _data_->self->priv->area_length1;
	_data_->_tmp4_ = _data_->_tmp3_[1];
	_data_->toplefty = _data_->_tmp4_;
	_data_->_tmp5_ = _data_->self->priv->area;
	_data_->_tmp5__length1 = _data_->self->priv->area_length1;
	_data_->_tmp6_ = _data_->_tmp5_[2];
	_data_->width = _data_->_tmp6_;
	_data_->_tmp7_ = _data_->self->priv->area;
	_data_->_tmp7__length1 = _data_->self->priv->area_length1;
	_data_->_tmp8_ = _data_->_tmp7_[3];
	_data_->height = _data_->_tmp8_;
	if (_data_->height == 0) {
		_data_->height = 1;
		_data_->_tmp9_ = _data_->height;
	} else {
		_data_->_tmp9_ = _data_->height;
	}
	if (_data_->width == 0) {
		_data_->width = 1;
		_data_->_tmp10_ = _data_->width;
	} else {
		_data_->_tmp10_ = _data_->width;
	}
	budgie_make_screenshot_play_shuttersound (_data_->self, 0, NULL, (gint) 0);
	{
		_data_->_tmp11_ = budgie_make_screenshot_client;
		_data_->_tmp12_ = _data_->self->priv->windowstate;
		_data_->_tmp13_ = budgie_current_state_get_tempfile_path (_data_->_tmp12_);
		_data_->_tmp14_ = _data_->_tmp13_;
		_data_->_tmp15_ = FALSE;
		_data_->_tmp16_ = NULL;
		_data_->_state_ = 1;
		budgie_screenshot_client_ScreenshotArea (_data_->_tmp11_, _data_->topleftx * _data_->self->priv->scale, _data_->toplefty * _data_->self->priv->scale, _data_->width * _data_->self->priv->scale, _data_->height * _data_->self->priv->scale, _data_->self->priv->include_cursor, TRUE, _data_->_tmp14_, budgie_make_screenshot_shoot_area_ready, _data_);
		return FALSE;
		_state_1:
		budgie_screenshot_client_ScreenshotArea_finish (_data_->_tmp11_, _data_->_res_, &_data_->_tmp15_, &_data_->_tmp16_, &_data_->_inner_error0_);
		_data_->success = _data_->_tmp15_;
		_g_free0 (_data_->filename_used);
		_data_->filename_used = _data_->_tmp16_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp17_ = _data_->e;
		_data_->_tmp18_ = _data_->_tmp17_->message;
		g_warning ("screenshot.vala:285: shoot_area %s, failed to make screenshot", _data_->_tmp18_);
		_data_->_tmp19_ = _data_->self->priv->windowstate;
		budgie_current_state_statechanged (_data_->_tmp19_, (gint) BUDGIE_WINDOW_STATE_NONE);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_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;
	}
	if (_data_->success) {
		_data_->_tmp20_ = budgie_after_shot_window_new ();
		g_object_ref_sink (_data_->_tmp20_);
		_data_->_tmp21_ = _data_->_tmp20_;
		_g_object_unref0 (_data_->_tmp21_);
	}
	_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 void
budgie_make_screenshot_play_shuttersound (BudgieMakeScreenshot* self,
                                          gint timeout,
                                          gchar** args,
                                          gint args_length1)
{
	ca_proplist* props = NULL;
	ca_proplist* _tmp0_ = NULL;
	ca_proplist* _tmp1_;
	ca_proplist* _tmp2_;
	ca_proplist* _tmp3_;
	ca_context* _tmp4_;
	ca_proplist* _tmp5_;
	g_return_if_fail (self != NULL);
	if (!self->priv->emit_capture_sound) {
		return;
	}
	ca_proplist_create (&_tmp0_);
	_ca_proplist_destroy0 (props);
	props = _tmp0_;
	_tmp1_ = props;
	ca_proplist_sets (_tmp1_, CA_PROP_CANBERRA_CACHE_CONTROL, "volatile");
	_tmp2_ = props;
	ca_proplist_sets (_tmp2_, CA_PROP_EVENT_ID, "screen-capture");
	_tmp3_ = props;
	ca_proplist_sets (_tmp3_, CA_PROP_CANBERRA_ENABLE, "1");
	_tmp4_ = ca_gtk_context_get ();
	_tmp5_ = props;
	ca_context_play_full (_tmp4_, (guint32) 0, _tmp5_, NULL, NULL);
	_ca_proplist_destroy0 (props);
}

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

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

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

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

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

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

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

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

void
budgie_value_set_make_screenshot (GValue* value,
                                  gpointer v_object)
{
	BudgieMakeScreenshot * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, BUDGIE_TYPE_MAKE_SCREENSHOT));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, BUDGIE_TYPE_MAKE_SCREENSHOT));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		budgie_make_screenshot_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		budgie_make_screenshot_unref (old);
	}
}

void
budgie_value_take_make_screenshot (GValue* value,
                                   gpointer v_object)
{
	BudgieMakeScreenshot * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, BUDGIE_TYPE_MAKE_SCREENSHOT));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, BUDGIE_TYPE_MAKE_SCREENSHOT));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		budgie_make_screenshot_unref (old);
	}
}

static void
budgie_make_screenshot_class_init (BudgieMakeScreenshotClass * klass,
                                   gpointer klass_data)
{
	budgie_make_screenshot_parent_class = g_type_class_peek_parent (klass);
	((BudgieMakeScreenshotClass *) klass)->finalize = budgie_make_screenshot_finalize;
	g_type_class_adjust_private_offset (klass, &BudgieMakeScreenshot_private_offset);
}

static void
budgie_make_screenshot_instance_init (BudgieMakeScreenshot * self,
                                      gpointer klass)
{
	self->priv = budgie_make_screenshot_get_instance_private (self);
	self->ref_count = 1;
}

static void
budgie_make_screenshot_finalize (BudgieMakeScreenshot * obj)
{
	BudgieMakeScreenshot * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BUDGIE_TYPE_MAKE_SCREENSHOT, BudgieMakeScreenshot);
	g_signal_handlers_destroy (self);
	self->priv->area = (g_free (self->priv->area), NULL);
	_g_free0 (self->priv->screenshot_mode);
	_g_object_unref0 (self->priv->windowstate);
}

static GType
budgie_make_screenshot_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { budgie_value_make_screenshot_init, budgie_value_make_screenshot_free_value, budgie_value_make_screenshot_copy_value, budgie_value_make_screenshot_peek_pointer, "p", budgie_value_make_screenshot_collect_value, "p", budgie_value_make_screenshot_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (BudgieMakeScreenshotClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) budgie_make_screenshot_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BudgieMakeScreenshot), 0, (GInstanceInitFunc) budgie_make_screenshot_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType budgie_make_screenshot_type_id;
	budgie_make_screenshot_type_id = g_type_register_fundamental (g_type_fundamental_next (), "BudgieMakeScreenshot", &g_define_type_info, &g_define_type_fundamental_info, 0);
	BudgieMakeScreenshot_private_offset = g_type_add_instance_private (budgie_make_screenshot_type_id, sizeof (BudgieMakeScreenshotPrivate));
	return budgie_make_screenshot_type_id;
}

GType
budgie_make_screenshot_get_type (void)
{
	static volatile gsize budgie_make_screenshot_type_id__once = 0;
	if (g_once_init_enter (&budgie_make_screenshot_type_id__once)) {
		GType budgie_make_screenshot_type_id;
		budgie_make_screenshot_type_id = budgie_make_screenshot_get_type_once ();
		g_once_init_leave (&budgie_make_screenshot_type_id__once, budgie_make_screenshot_type_id);
	}
	return budgie_make_screenshot_type_id__once;
}

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

void
budgie_make_screenshot_unref (gpointer instance)
{
	BudgieMakeScreenshot * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		BUDGIE_MAKE_SCREENSHOT_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static inline gpointer
budgie_screenshot_home_window_get_instance_private (BudgieScreenshotHomeWindow* self)
{
	return G_STRUCT_MEMBER_P (self, BudgieScreenshotHomeWindow_private_offset);
}

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

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

static gboolean
__lambda7_ (Block1Data* _data1_)
{
	BudgieScreenshotHomeWindow* self;
	GdkMonitor* monitor = NULL;
	BudgieWaylandClient* _tmp0_;
	GdkMonitor* _tmp1_;
	GdkMonitor* _tmp2_;
	GdkMonitor* _tmp3_;
	GdkMonitor* _tmp4_;
	GdkMonitor* _tmp5_;
	gboolean result;
	self = _data1_->self;
	_tmp0_ = _data1_->wayland_client;
	_tmp1_ = budgie_wayland_client_get_gdk_monitor (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	monitor = _tmp3_;
	_tmp4_ = monitor;
	if (_tmp4_ == NULL) {
		g_warning ("screenshot.vala:342: Failed to get monitor for screenshot home window");
		result = FALSE;
		_g_object_unref0 (monitor);
		return result;
	}
	gtk_layer_init_for_window ((GtkWindow*) self);
	gtk_layer_set_layer ((GtkWindow*) self, GTK_LAYER_SHELL_LAYER_TOP);
	_tmp5_ = monitor;
	gtk_layer_set_monitor ((GtkWindow*) self, _tmp5_);
	gtk_layer_set_anchor ((GtkWindow*) self, GTK_LAYER_SHELL_EDGE_TOP, FALSE);
	gtk_layer_set_anchor ((GtkWindow*) self, GTK_LAYER_SHELL_EDGE_LEFT, FALSE);
	gtk_layer_set_keyboard_mode ((GtkWindow*) self, GTK_LAYER_SHELL_KEYBOARD_MODE_ON_DEMAND);
	result = TRUE;
	_g_object_unref0 (monitor);
	return result;
}

static gboolean
___lambda7__budgie_monitor_callback (gpointer self)
{
	gboolean result;
	result = __lambda7_ (self);
	return result;
}

static gboolean
__lambda8_ (BudgieScreenshotHomeWindow* self,
            GdkEventKey* event)
{
	gboolean result;
	g_return_val_if_fail (event != NULL, FALSE);
	if (event->keyval == GDK_KEY_Escape) {
		gtk_window_close ((GtkWindow*) self);
		result = TRUE;
		return result;
	}
	result = FALSE;
	return result;
}

static gboolean
___lambda8__gtk_widget_key_press_event (GtkWidget* _sender,
                                        GdkEventKey* event,
                                        gpointer self)
{
	gboolean result;
	result = __lambda8_ ((BudgieScreenshotHomeWindow*) self, event);
	return result;
}

static gboolean
__lambda23_ (BudgieScreenshotHomeWindow* self)
{
	BudgieCurrentState* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gboolean result;
	_tmp0_ = self->priv->windowstate;
	_tmp1_ = budgie_current_state_get_newstate (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == ((gint) BUDGIE_WINDOW_STATE_MAINWINDOW)) {
		BudgieCurrentState* _tmp3_;
		_tmp3_ = self->priv->windowstate;
		budgie_current_state_statechanged (_tmp3_, (gint) BUDGIE_WINDOW_STATE_NONE);
	}
	result = FALSE;
	return result;
}

static gboolean
___lambda23__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda23_ ((BudgieScreenshotHomeWindow*) self);
	return result;
}

static void
__lambda22_ (BudgieScreenshotHomeWindow* self)
{
	g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 100, ___lambda23__gsource_func, g_object_ref (self), g_object_unref);
}

static void
___lambda22__gtk_widget_destroy (GtkWidget* _sender,
                                 gpointer self)
{
	__lambda22_ ((BudgieScreenshotHomeWindow*) self);
}

static void
__lambda24_ (BudgieScreenshotHomeWindow* self)
{
	budgie_screenshot_home_window_rearrange_headerbar (self);
}

static void
___lambda24__budgie_current_state_buttonpos_changed (BudgieCurrentState* _sender,
                                                     gpointer self)
{
	__lambda24_ ((BudgieScreenshotHomeWindow*) self);
}

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

static gpointer
__ulong_dup0 (gpointer self)
{
	return self ? _ulong_dup (self) : NULL;
}

BudgieScreenshotHomeWindow*
budgie_screenshot_home_window_construct (GType object_type)
{
	BudgieScreenshotHomeWindow * self = NULL;
	Block1Data* _data1_;
	BudgieWaylandClient* _tmp0_;
	BudgieWaylandClient* _tmp1_;
	gboolean window_configured = FALSE;
	BudgieWaylandClient* _tmp2_;
	BudgieCurrentState* _tmp3_;
	BudgieCurrentState* _tmp4_;
	GtkIconTheme* theme = NULL;
	GtkIconTheme* _tmp5_;
	GtkIconTheme* _tmp6_;
	GtkIconTheme* _tmp7_;
	gchar* home_css = NULL;
	gchar* _tmp8_;
	GtkHeaderBar* _tmp9_;
	GtkHeaderBar* _tmp10_;
	GtkHeaderBar* _tmp11_;
	GdkScreen* screen = NULL;
	GdkScreen* _tmp12_;
	GdkScreen* _tmp13_;
	GtkCssProvider* css_provider = NULL;
	GtkCssProvider* _tmp14_;
	GtkBox* areabuttonbox = NULL;
	GtkBox* _tmp19_;
	GtkGrid* _tmp20_;
	GtkBox* _tmp21_;
	BudgieCurrentState* _tmp22_;
	GSettings* _tmp23_;
	GSettings* _tmp24_;
	GtkSwitch* _tmp25_;
	BudgieCurrentState* _tmp26_;
	GSettings* _tmp27_;
	GSettings* _tmp28_;
	GtkSwitch* _tmp29_;
	BudgieCurrentState* _tmp30_;
	GSettings* _tmp31_;
	GSettings* _tmp32_;
	GtkSpinButton* _tmp33_;
	BudgieCurrentState* _tmp34_;
	gulong _tmp35_;
	gulong _tmp36_;
	gulong* _tmp37_;
	GError* _inner_error0_ = NULL;
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	self = (BudgieScreenshotHomeWindow*) g_object_new (object_type, NULL);
	_data1_->self = g_object_ref (self);
	_tmp0_ = budgie_wayland_client_new ();
	_data1_->wayland_client = _tmp0_;
	_tmp1_ = _data1_->wayland_client;
	if (!budgie_wayland_client_is_initialised (_tmp1_)) {
		g_warning ("screenshot.vala:334: WaylandClient not initialized for ScreenshotHomeW" \
"indow");
		block1_data_unref (_data1_);
		_data1_ = NULL;
		return self;
	}
	_tmp2_ = _data1_->wayland_client;
	window_configured = budgie_wayland_client_with_valid_monitor (_tmp2_, ___lambda7__budgie_monitor_callback, block1_data_ref (_data1_), block1_data_unref);
	if (!window_configured) {
		g_warning ("screenshot.vala:357: Failed to configure screenshot home window");
		block1_data_unref (_data1_);
		_data1_ = NULL;
		return self;
	}
	gtk_window_set_decorated ((GtkWindow*) self, TRUE);
	_tmp3_ = budgie_current_state_new ();
	_g_object_unref0 (self->priv->windowstate);
	self->priv->windowstate = _tmp3_;
	gtk_window_set_startup_id ((GtkWindow*) self, "org.buddiesofbudgie.BudgieScreenshot");
	gtk_window_set_title ((GtkWindow*) self, _ ("Budgie Screenshot"));
	gtk_window_set_wmclass ((GtkWindow*) self, "org.buddiesofbudgie.BudgieScreenshot", "org.buddiesofbudgie.BudgieScreenshot");
	_tmp4_ = self->priv->windowstate;
	budgie_current_state_statechanged (_tmp4_, (gint) BUDGIE_WINDOW_STATE_MAINWINDOW);
	_tmp5_ = gtk_icon_theme_get_default ();
	_tmp6_ = _g_object_ref0 (_tmp5_);
	theme = _tmp6_;
	_tmp7_ = theme;
	gtk_icon_theme_add_resource_path (_tmp7_, "/org/buddiesofbudgie/Screenshot/icons/scalable/apps/");
	_tmp8_ = g_strdup ("\n" \
"\t\t\t.buttonlabel {\n" \
"\t\t\t\tmargin-top: -12px;\n" \
"\t\t\t}\n" \
"\t\t\t.centerbutton {\n" \
"\t\t\t\tborder-radius: 0px 0px 0px 0px;\n" \
"\t\t\t\tborder-width: 0px;\n" \
"\t\t\t}\n" \
"\t\t\t.optionslabel {\n" \
"\t\t\t\tmargin-left: 12px;\n" \
"\t\t\t\tmargin-bottom: 2px;\n" \
"\t\t\t}\n" \
"\t\t\t.popoverheader {\n" \
"\t\t\t\tmargin-bottom: 5px;\n" \
"\t\t\t\tfont-weight: bold;\n" \
"\t\t\t}\n" \
"\t\t\t");
	home_css = _tmp8_;
	_tmp9_ = (GtkHeaderBar*) gtk_header_bar_new ();
	g_object_ref_sink (_tmp9_);
	_g_object_unref0 (self->priv->topbar);
	self->priv->topbar = _tmp9_;
	_tmp10_ = self->priv->topbar;
	gtk_header_bar_set_show_close_button (_tmp10_, TRUE);
	_tmp11_ = self->priv->topbar;
	gtk_window_set_titlebar ((GtkWindow*) self, (GtkWidget*) _tmp11_);
	g_signal_connect_object ((GtkWidget*) self, "key-press-event", (GCallback) ___lambda8__gtk_widget_key_press_event, self, 0);
	_tmp12_ = gtk_window_get_screen ((GtkWindow*) self);
	_tmp13_ = _g_object_ref0 (_tmp12_);
	screen = _tmp13_;
	_tmp14_ = gtk_css_provider_new ();
	css_provider = _tmp14_;
	{
		GtkCssProvider* _tmp15_;
		const gchar* _tmp16_;
		GdkScreen* _tmp17_;
		GtkCssProvider* _tmp18_;
		_tmp15_ = css_provider;
		_tmp16_ = home_css;
		gtk_css_provider_load_from_data (_tmp15_, _tmp16_, (gssize) -1, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp17_ = screen;
		_tmp18_ = css_provider;
		gtk_style_context_add_provider_for_screen (_tmp17_, (GtkStyleProvider*) _tmp18_, (guint) GTK_STYLE_PROVIDER_PRIORITY_USER);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
		g_warning ("screenshot.vala:413: Error loading css data");
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (css_provider);
		_g_object_unref0 (screen);
		_g_free0 (home_css);
		_g_object_unref0 (theme);
		block1_data_unref (_data1_);
		_data1_ = 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 NULL;
	}
	_tmp19_ = budgie_screenshot_home_window_setup_areabuttons (self);
	areabuttonbox = _tmp19_;
	_tmp20_ = self->priv->maingrid;
	_tmp21_ = areabuttonbox;
	gtk_grid_attach (_tmp20_, (GtkWidget*) _tmp21_, 0, 0, 1, 1);
	_tmp22_ = self->priv->windowstate;
	_tmp23_ = budgie_current_state_get_screenshot_settings (_tmp22_);
	_tmp24_ = _tmp23_;
	_tmp25_ = self->priv->showpointerswitch;
	g_settings_bind (_tmp24_, "include-cursor", (GObject*) _tmp25_, "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
	_tmp26_ = self->priv->windowstate;
	_tmp27_ = budgie_current_state_get_screenshot_settings (_tmp26_);
	_tmp28_ = _tmp27_;
	_tmp29_ = self->priv->screenshotcapturesoundswitch;
	g_settings_bind (_tmp28_, "screenshot-capture-sound", (GObject*) _tmp29_, "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
	_tmp30_ = self->priv->windowstate;
	_tmp31_ = budgie_current_state_get_screenshot_settings (_tmp30_);
	_tmp32_ = _tmp31_;
	_tmp33_ = self->priv->delayspin;
	g_settings_bind (_tmp32_, "delay", (GObject*) _tmp33_, "value", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
	g_signal_connect_object ((GtkWidget*) self, "destroy", (GCallback) ___lambda22__gtk_widget_destroy, self, 0);
	_tmp34_ = self->priv->windowstate;
	_tmp35_ = g_signal_connect_object (_tmp34_, "buttonpos-changed", (GCallback) ___lambda24__budgie_current_state_buttonpos_changed, self, 0);
	_tmp36_ = _tmp35_;
	_tmp37_ = __ulong_dup0 (&_tmp36_);
	_g_free0 (self->priv->button_id);
	self->priv->button_id = _tmp37_;
	budgie_screenshot_home_window_rearrange_headerbar (self);
	gtk_widget_show_all ((GtkWidget*) self);
	_g_object_unref0 (areabuttonbox);
	_g_object_unref0 (css_provider);
	_g_object_unref0 (screen);
	_g_free0 (home_css);
	_g_object_unref0 (theme);
	block1_data_unref (_data1_);
	_data1_ = NULL;
	return self;
}

BudgieScreenshotHomeWindow*
budgie_screenshot_home_window_new (void)
{
	return budgie_screenshot_home_window_construct (BUDGIE_TYPE_SCREENSHOT_HOME_WINDOW);
}

static GVariant*
_variant_new1 (gchar** value,
               gint value_length1)
{
	gchar** _tmp12_;
	GVariantBuilder _tmp13_;
	gint _tmp14_;
	_tmp12_ = value;
	g_variant_builder_init (&_tmp13_, G_VARIANT_TYPE ("as"));
	for (_tmp14_ = 0; _tmp14_ < value_length1; _tmp14_++) {
		g_variant_builder_add_value (&_tmp13_, g_variant_new_string (*_tmp12_));
		_tmp12_++;
	}
	return g_variant_ref_sink (g_variant_builder_end (&_tmp13_));
}

static gchar*
_variant_get1 (GVariant* value)
{
	return g_variant_dup_string (value, NULL);
}

static gchar*
string_replace (const gchar* self,
                const gchar* old,
                const gchar* replacement)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (replacement != NULL, NULL);
	if ((*((gchar*) self)) == '\0') {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = (*((gchar*) old)) == '\0';
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = g_strcmp0 (old, replacement) == 0;
	}
	if (_tmp0_) {
		gchar* _tmp2_;
		_tmp2_ = g_strdup (self);
		result = _tmp2_;
		return result;
	}
	{
		GRegex* regex = NULL;
		gchar* _tmp3_;
		gchar* _tmp4_;
		GRegex* _tmp5_;
		GRegex* _tmp6_;
		gchar* _tmp7_ = NULL;
		GRegex* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		_tmp3_ = g_regex_escape_string (old, -1);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_regex_new (_tmp4_, 0, 0, &_inner_error0_);
		_tmp6_ = _tmp5_;
		_g_free0 (_tmp4_);
		regex = _tmp6_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected 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;
		}
		_tmp8_ = regex;
		_tmp9_ = g_regex_replace_literal (_tmp8_, self, (gssize) -1, 0, replacement, 0, &_inner_error0_);
		_tmp7_ = _tmp9_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_regex_unref0 (regex);
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected 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;
		}
		_tmp10_ = _tmp7_;
		_tmp7_ = NULL;
		result = _tmp10_;
		_g_free0 (_tmp7_);
		_g_regex_unref0 (regex);
		return result;
	}
	goto __finally0;
	__catch0_g_regex_error:
	{
		g_clear_error (&_inner_error0_);
		g_assert_not_reached ();
	}
	__finally0:
	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;
}

static void
budgie_screenshot_home_window_update_current_shortcuts (BudgieScreenshotHomeWindow* self)
{
	GSettings* scrshot_shortcuts = NULL;
	GSettings* _tmp0_;
	gchar** keyvals = NULL;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar** _tmp4_;
	gint keyvals_length1;
	gint _keyvals_size_;
	gint currshot = 0;
	gchar** _tmp5_;
	gint _tmp5__length1;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_settings_new ("com.solus-project.budgie-wm");
	scrshot_shortcuts = _tmp0_;
	_tmp1_ = g_strdup ("take-full-screenshot");
	_tmp2_ = g_strdup ("take-window-screenshot");
	_tmp3_ = g_strdup ("take-region-screenshot");
	_tmp4_ = g_new0 (gchar*, 3 + 1);
	_tmp4_[0] = _tmp1_;
	_tmp4_[1] = _tmp2_;
	_tmp4_[2] = _tmp3_;
	keyvals = _tmp4_;
	keyvals_length1 = 3;
	_keyvals_size_ = keyvals_length1;
	currshot = 0;
	_tmp5_ = keyvals;
	_tmp5__length1 = keyvals_length1;
	{
		gchar** s_collection = NULL;
		gint s_collection_length1 = 0;
		gint _s_collection_size_ = 0;
		gint s_it = 0;
		s_collection = _tmp5_;
		s_collection_length1 = _tmp5__length1;
		for (s_it = 0; s_it < s_collection_length1; s_it = s_it + 1) {
			gchar* _tmp6_;
			gchar* s = NULL;
			_tmp6_ = g_strdup (s_collection[s_it]);
			s = _tmp6_;
			{
				GVariant* shc = NULL;
				GSettings* _tmp7_;
				const gchar* _tmp8_;
				gchar** _tmp9_;
				gchar** _tmp10_;
				gchar** _tmp11_;
				gint _tmp11__length1;
				GVariant* _tmp15_;
				GVariant* _tmp16_;
				gchar* shc_action = NULL;
				GVariant* _tmp17_;
				GVariant* _tmp18_;
				GVariant* _tmp19_;
				gchar* _tmp20_;
				gchar* _tmp21_;
				gchar* newaction = NULL;
				const gchar* _tmp22_;
				gchar* _tmp23_;
				gchar* _tmp24_;
				gchar* _tmp25_;
				gchar* _tmp26_;
				gchar** newaction_steps = NULL;
				const gchar* _tmp27_;
				gchar** _tmp28_;
				gchar** _tmp29_;
				gint newaction_steps_length1;
				gint _newaction_steps_size_;
				gint action_len = 0;
				gchar** _tmp30_;
				gint _tmp30__length1;
				gboolean _tmp31_ = FALSE;
				GtkLabel** _tmp44_;
				gint _tmp44__length1;
				GtkLabel* _tmp45_;
				const gchar* _tmp46_;
				_tmp7_ = scrshot_shortcuts;
				_tmp8_ = s;
				_tmp10_ = _tmp9_ = g_settings_get_strv (_tmp7_, _tmp8_);
				_tmp11_ = _tmp10_;
				_tmp11__length1 = _vala_array_length (_tmp9_);
				_tmp15_ = _variant_new1 (_tmp11_, _vala_array_length (_tmp9_));
				_tmp16_ = _tmp15_;
				_tmp11_ = (_vala_array_free (_tmp11_, _tmp11__length1, (GDestroyNotify) g_free), NULL);
				shc = _tmp16_;
				_tmp17_ = shc;
				_tmp18_ = g_variant_get_child_value (_tmp17_, (gsize) 0);
				_tmp19_ = _tmp18_;
				_tmp20_ = _variant_get1 (_tmp19_);
				_tmp21_ = _tmp20_;
				_g_variant_unref0 (_tmp19_);
				shc_action = _tmp21_;
				_tmp22_ = shc_action;
				_tmp23_ = string_replace (_tmp22_, "<", "");
				_tmp24_ = _tmp23_;
				_tmp25_ = string_replace (_tmp24_, ">", " + ");
				_tmp26_ = _tmp25_;
				_g_free0 (_tmp24_);
				newaction = _tmp26_;
				_tmp27_ = newaction;
				_tmp29_ = _tmp28_ = g_strsplit (_tmp27_, " + ", 0);
				newaction_steps = _tmp29_;
				newaction_steps_length1 = _vala_array_length (_tmp28_);
				_newaction_steps_size_ = newaction_steps_length1;
				_tmp30_ = newaction_steps;
				_tmp30__length1 = newaction_steps_length1;
				action_len = _tmp30__length1;
				if (action_len == 2) {
					gchar** _tmp32_;
					gint _tmp32__length1;
					const gchar* _tmp33_;
					gint _tmp34_;
					gint _tmp35_;
					_tmp32_ = newaction_steps;
					_tmp32__length1 = newaction_steps_length1;
					_tmp33_ = _tmp32_[1];
					_tmp34_ = strlen (_tmp33_);
					_tmp35_ = _tmp34_;
					_tmp31_ = _tmp35_ == 1;
				} else {
					_tmp31_ = FALSE;
				}
				if (_tmp31_) {
					const gchar* _tmp36_;
					gchar** _tmp37_;
					gint _tmp37__length1;
					const gchar* _tmp38_;
					gchar** _tmp39_;
					gint _tmp39__length1;
					const gchar* _tmp40_;
					gchar* _tmp41_;
					gchar* _tmp42_;
					gchar* _tmp43_;
					_tmp36_ = newaction;
					_tmp37_ = newaction_steps;
					_tmp37__length1 = newaction_steps_length1;
					_tmp38_ = _tmp37_[1];
					_tmp39_ = newaction_steps;
					_tmp39__length1 = newaction_steps_length1;
					_tmp40_ = _tmp39_[1];
					_tmp41_ = g_utf8_strup (_tmp40_, (gssize) -1);
					_tmp42_ = _tmp41_;
					_tmp43_ = string_replace (_tmp36_, _tmp38_, _tmp42_);
					_g_free0 (newaction);
					newaction = _tmp43_;
					_g_free0 (_tmp42_);
				}
				_tmp44_ = self->priv->shortcutlabels;
				_tmp44__length1 = self->priv->shortcutlabels_length1;
				_tmp45_ = _tmp44_[currshot];
				_tmp46_ = newaction;
				gtk_label_set_text (_tmp45_, _tmp46_);
				currshot += 1;
				newaction_steps = (_vala_array_free (newaction_steps, newaction_steps_length1, (GDestroyNotify) g_free), NULL);
				_g_free0 (newaction);
				_g_free0 (shc_action);
				_g_variant_unref0 (shc);
				_g_free0 (s);
			}
		}
	}
	keyvals = (_vala_array_free (keyvals, keyvals_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (scrshot_shortcuts);
}

static void
_vala_array_add1 (GtkLabel** * array,
                  gint* length,
                  gint* size,
                  GtkLabel* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkLabel*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add2 (GtkLabel** * array,
                  gint* length,
                  gint* size,
                  GtkLabel* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkLabel*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add3 (GtkLabel** * array,
                  gint* length,
                  gint* size,
                  GtkLabel* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkLabel*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add4 (GtkLabel** * array,
                  gint* length,
                  gint* size,
                  GtkLabel* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkLabel*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static GtkPopover*
budgie_screenshot_home_window_make_info_popover (BudgieScreenshotHomeWindow* self,
                                                 GtkButton* b)
{
	GtkPopover* newpopover = NULL;
	GtkPopover* _tmp0_;
	GtkGrid* popovergrid = NULL;
	GtkGrid* _tmp1_;
	GtkGrid* _tmp2_;
	gboolean window_support = FALSE;
	GtkLabel** shortcutnames = NULL;
	GtkLabel** _tmp3_;
	gint shortcutnames_length1;
	gint _shortcutnames_size_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	GtkLabel* _tmp6_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	GtkLabel* _tmp12_;
	GtkLabel** _tmp13_;
	GtkLabel* header = NULL;
	GtkLabel* _tmp14_;
	GtkLabel* _tmp15_;
	GtkStyleContext* _tmp16_;
	GtkLabel* _tmp17_;
	gint ypos = 0;
	GtkGrid* _tmp18_;
	GtkLabel* _tmp19_;
	GtkLabel** _tmp20_;
	gint _tmp20__length1;
	GtkPopover* _tmp31_;
	GtkGrid* _tmp32_;
	GtkGrid* _tmp33_;
	GtkPopover* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (b != NULL, NULL);
	_tmp0_ = (GtkPopover*) gtk_popover_new ((GtkWidget*) b);
	g_object_ref_sink (_tmp0_);
	newpopover = _tmp0_;
	_tmp1_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp1_);
	popovergrid = _tmp1_;
	_tmp2_ = popovergrid;
	budgie_screenshot_home_window_set_margins (self, _tmp2_, 15, 15, 15, 15);
	window_support = budgie_make_screenshot_ScreenshotWindowSupport ();
	_tmp3_ = g_new0 (GtkLabel*, 0 + 1);
	shortcutnames = _tmp3_;
	shortcutnames_length1 = 0;
	_shortcutnames_size_ = shortcutnames_length1;
	_tmp4_ = g_strconcat (_ ("Screenshot entire screen"), ":\t", NULL);
	_tmp5_ = _tmp4_;
	_tmp6_ = (GtkLabel*) gtk_label_new (_tmp5_);
	g_object_ref_sink (_tmp6_);
	_vala_array_add1 (&shortcutnames, &shortcutnames_length1, &_shortcutnames_size_, _tmp6_);
	_g_free0 (_tmp5_);
	if (window_support) {
		gchar* _tmp7_;
		gchar* _tmp8_;
		GtkLabel* _tmp9_;
		_tmp7_ = g_strconcat (_ ("Screenshot active window"), ":\t", NULL);
		_tmp8_ = _tmp7_;
		_tmp9_ = (GtkLabel*) gtk_label_new (_tmp8_);
		g_object_ref_sink (_tmp9_);
		_vala_array_add2 (&shortcutnames, &shortcutnames_length1, &_shortcutnames_size_, _tmp9_);
		_g_free0 (_tmp8_);
	}
	_tmp10_ = g_strconcat (_ ("Screenshot selected area"), ":\t", NULL);
	_tmp11_ = _tmp10_;
	_tmp12_ = (GtkLabel*) gtk_label_new (_tmp11_);
	g_object_ref_sink (_tmp12_);
	_vala_array_add3 (&shortcutnames, &shortcutnames_length1, &_shortcutnames_size_, _tmp12_);
	_g_free0 (_tmp11_);
	_tmp13_ = g_new0 (GtkLabel*, 0 + 1);
	self->priv->shortcutlabels = (_vala_array_free (self->priv->shortcutlabels, self->priv->shortcutlabels_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->shortcutlabels = _tmp13_;
	self->priv->shortcutlabels_length1 = 0;
	self->priv->_shortcutlabels_size_ = self->priv->shortcutlabels_length1;
	_tmp14_ = (GtkLabel*) gtk_label_new ("Shortcuts:");
	g_object_ref_sink (_tmp14_);
	header = _tmp14_;
	_tmp15_ = header;
	_tmp16_ = gtk_widget_get_style_context ((GtkWidget*) _tmp15_);
	gtk_style_context_add_class (_tmp16_, "popoverheader");
	_tmp17_ = header;
	gtk_label_set_xalign (_tmp17_, (gfloat) 0);
	ypos = 1;
	_tmp18_ = popovergrid;
	_tmp19_ = header;
	gtk_grid_attach (_tmp18_, (GtkWidget*) _tmp19_, 0, 0, 1, 1);
	_tmp20_ = shortcutnames;
	_tmp20__length1 = shortcutnames_length1;
	{
		GtkLabel** l_collection = NULL;
		gint l_collection_length1 = 0;
		gint _l_collection_size_ = 0;
		gint l_it = 0;
		l_collection = _tmp20_;
		l_collection_length1 = _tmp20__length1;
		for (l_it = 0; l_it < l_collection_length1; l_it = l_it + 1) {
			GtkLabel* _tmp21_;
			GtkLabel* l = NULL;
			_tmp21_ = _g_object_ref0 (l_collection[l_it]);
			l = _tmp21_;
			{
				GtkLabel* _tmp22_;
				GtkGrid* _tmp23_;
				GtkLabel* _tmp24_;
				GtkLabel* newshortcutlabel = NULL;
				GtkLabel* _tmp25_;
				GtkLabel* _tmp26_;
				GtkLabel* _tmp27_;
				GtkLabel* _tmp28_;
				GtkGrid* _tmp29_;
				GtkLabel* _tmp30_;
				_tmp22_ = l;
				gtk_label_set_xalign (_tmp22_, (gfloat) 0);
				_tmp23_ = popovergrid;
				_tmp24_ = l;
				gtk_grid_attach (_tmp23_, (GtkWidget*) _tmp24_, 0, ypos, 1, 1);
				_tmp25_ = (GtkLabel*) gtk_label_new ("");
				g_object_ref_sink (_tmp25_);
				newshortcutlabel = _tmp25_;
				_tmp26_ = newshortcutlabel;
				gtk_label_set_xalign (_tmp26_, (gfloat) 0);
				_tmp27_ = newshortcutlabel;
				_tmp28_ = _g_object_ref0 (_tmp27_);
				_vala_array_add4 (&self->priv->shortcutlabels, &self->priv->shortcutlabels_length1, &self->priv->_shortcutlabels_size_, _tmp28_);
				_tmp29_ = popovergrid;
				_tmp30_ = newshortcutlabel;
				gtk_grid_attach (_tmp29_, (GtkWidget*) _tmp30_, 1, ypos, 1, 1);
				ypos += 1;
				_g_object_unref0 (newshortcutlabel);
				_g_object_unref0 (l);
			}
		}
	}
	_tmp31_ = newpopover;
	_tmp32_ = popovergrid;
	gtk_container_add ((GtkContainer*) _tmp31_, (GtkWidget*) _tmp32_);
	_tmp33_ = popovergrid;
	gtk_widget_show_all ((GtkWidget*) _tmp33_);
	result = newpopover;
	_g_object_unref0 (header);
	shortcutnames = (_vala_array_free (shortcutnames, shortcutnames_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (popovergrid);
	return result;
}

static Block2Data*
block2_data_ref (Block2Data* _data2_)
{
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}

static void
block2_data_unref (void * _userdata_)
{
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		BudgieScreenshotHomeWindow* self;
		self = _data2_->self;
		_g_object_unref0 (_data2_->helppopover);
		_g_object_unref0 (self);
		g_slice_free (Block2Data, _data2_);
	}
}

static Block3Data*
block3_data_ref (Block3Data* _data3_)
{
	g_atomic_int_inc (&_data3_->_ref_count_);
	return _data3_;
}

static void
block3_data_unref (void * _userdata_)
{
	Block3Data* _data3_;
	_data3_ = (Block3Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
		BudgieScreenshotHomeWindow* self;
		self = _data3_->self;
		_g_free0 (_data3_->shootmode);
		_g_object_unref0 (self);
		g_slice_free (Block3Data, _data3_);
	}
}

static gboolean
__lambda26_ (Block3Data* _data3_)
{
	BudgieScreenshotHomeWindow* self;
	const gchar* _tmp0_;
	GQuark _tmp2_ = 0U;
	static GQuark _tmp1_label0 = 0;
	static GQuark _tmp1_label1 = 0;
	static GQuark _tmp1_label2 = 0;
	gboolean result;
	self = _data3_->self;
	_tmp0_ = _data3_->shootmode;
	_tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
	if (_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string (BUDGIE_SELECTION)))) {
		switch (0) {
			default:
			{
				BudgieSelectLayer* _tmp3_;
				BudgieSelectLayer* _tmp4_;
				_tmp3_ = budgie_select_layer_new (NULL);
				_tmp4_ = _tmp3_;
				_g_object_unref0 (_tmp4_);
				break;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label1) ? _tmp1_label1 : (_tmp1_label1 = g_quark_from_static_string (BUDGIE_SCREEN)))) {
		switch (0) {
			default:
			{
				BudgieCurrentState* _tmp5_;
				BudgieMakeScreenshot* _tmp6_;
				BudgieMakeScreenshot* _tmp7_;
				_tmp5_ = self->priv->windowstate;
				budgie_current_state_statechanged (_tmp5_, (gint) BUDGIE_WINDOW_STATE_WAITINGFORSHOT);
				_tmp6_ = budgie_make_screenshot_new (NULL, 0);
				_tmp7_ = _tmp6_;
				_budgie_make_screenshot_unref0 (_tmp7_);
				break;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label2) ? _tmp1_label2 : (_tmp1_label2 = g_quark_from_static_string (BUDGIE_WINDOW)))) {
		switch (0) {
			default:
			{
				BudgieCurrentState* _tmp8_;
				BudgieMakeScreenshot* _tmp9_;
				BudgieMakeScreenshot* _tmp10_;
				_tmp8_ = self->priv->windowstate;
				budgie_current_state_statechanged (_tmp8_, (gint) BUDGIE_WINDOW_STATE_WAITINGFORSHOT);
				_tmp9_ = budgie_make_screenshot_new (NULL, 0);
				_tmp10_ = _tmp9_;
				_budgie_make_screenshot_unref0 (_tmp10_);
				break;
			}
		}
	}
	result = FALSE;
	return result;
}

static gboolean
___lambda26__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda26_ (self);
	return result;
}

static void
__lambda25_ (BudgieScreenshotHomeWindow* self)
{
	Block3Data* _data3_;
	BudgieCurrentState* _tmp0_;
	gulong* _tmp1_;
	BudgieCurrentState* _tmp2_;
	GSettings* _tmp3_;
	GSettings* _tmp4_;
	gchar* _tmp5_;
	_data3_ = g_slice_new0 (Block3Data);
	_data3_->_ref_count_ = 1;
	_data3_->self = g_object_ref (self);
	_tmp0_ = self->priv->windowstate;
	_tmp1_ = self->priv->button_id;
	g_signal_handler_disconnect ((GObject*) _tmp0_, *_tmp1_);
	gtk_window_close ((GtkWindow*) self);
	_tmp2_ = self->priv->windowstate;
	_tmp3_ = budgie_current_state_get_screenshot_settings (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_settings_get_string (_tmp4_, "screenshot-mode");
	_data3_->shootmode = _tmp5_;
	g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 100, ___lambda26__gsource_func, block3_data_ref (_data3_), block3_data_unref);
	block3_data_unref (_data3_);
	_data3_ = NULL;
}

static void
___lambda25__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda25_ ((BudgieScreenshotHomeWindow*) self);
}

static void
__lambda27_ (Block2Data* _data2_)
{
	BudgieScreenshotHomeWindow* self;
	GtkPopover* _tmp0_;
	self = _data2_->self;
	budgie_screenshot_home_window_update_current_shortcuts (self);
	_tmp0_ = _data2_->helppopover;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, TRUE);
}

static void
___lambda27__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda27_ (self);
}

static void
budgie_screenshot_home_window_rearrange_headerbar (BudgieScreenshotHomeWindow* self)
{
	Block2Data* _data2_;
	GtkHeaderBar* _tmp0_;
	GList* _tmp1_;
	GtkButton* shootbutton = NULL;
	GtkButton* _tmp4_;
	BudgieCurrentState* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	GThemedIcon* iconfile = NULL;
	GThemedIcon* _tmp9_;
	GtkImage* shootimage = NULL;
	GThemedIcon* _tmp10_;
	GtkImage* _tmp11_;
	GtkImage* _tmp12_;
	GtkImage* _tmp13_;
	GtkImage* _tmp14_;
	GtkButton* _tmp15_;
	GtkImage* _tmp16_;
	GtkButton* _tmp17_;
	GtkStyleContext* _tmp18_;
	GtkButton* _tmp19_;
	GtkButton* helpbutton = NULL;
	GtkButton* _tmp20_;
	GtkButton* _tmp21_;
	GtkPopover* _tmp22_;
	GtkButton* _tmp23_;
	GtkButton* _tmp24_;
	GtkButton* _tmp25_;
	GtkStyleContext* _tmp26_;
	BudgieCurrentState* _tmp27_;
	gint _tmp28_;
	gint _tmp29_;
	GtkButton* _tmp38_;
	g_return_if_fail (self != NULL);
	_data2_ = g_slice_new0 (Block2Data);
	_data2_->_ref_count_ = 1;
	_data2_->self = g_object_ref (self);
	_tmp0_ = self->priv->topbar;
	_tmp1_ = gtk_container_get_children ((GtkContainer*) _tmp0_);
	{
		GList* w_collection = NULL;
		GList* w_it = NULL;
		w_collection = _tmp1_;
		for (w_it = w_collection; w_it != NULL; w_it = w_it->next) {
			GtkWidget* _tmp2_;
			GtkWidget* w = NULL;
			_tmp2_ = _g_object_ref0 ((GtkWidget*) w_it->data);
			w = _tmp2_;
			{
				GtkWidget* _tmp3_;
				_tmp3_ = w;
				gtk_widget_destroy (_tmp3_);
				_g_object_unref0 (w);
			}
		}
		(w_collection == NULL) ? NULL : (w_collection = (g_list_free (w_collection), NULL));
	}
	_tmp4_ = (GtkButton*) gtk_button_new ();
	g_object_ref_sink (_tmp4_);
	shootbutton = _tmp4_;
	_tmp5_ = self->priv->windowstate;
	_tmp6_ = budgie_current_state_get_showtooltips (_tmp5_);
	_tmp7_ = _tmp6_;
	if (_tmp7_) {
		GtkButton* _tmp8_;
		_tmp8_ = shootbutton;
		gtk_widget_set_tooltip_text ((GtkWidget*) _tmp8_, "Take a screenshot");
	}
	gtk_widget_set_name ((GtkWidget*) self, "shootscreen-symbolic");
	_tmp9_ = (GThemedIcon*) g_themed_icon_new ("shootscreen-symbolic");
	iconfile = _tmp9_;
	_tmp10_ = iconfile;
	_tmp11_ = (GtkImage*) gtk_image_new_from_gicon ((GIcon*) _tmp10_, (GtkIconSize) GTK_ICON_SIZE_DND);
	g_object_ref_sink (_tmp11_);
	shootimage = _tmp11_;
	_tmp12_ = shootimage;
	gtk_image_set_pixel_size (_tmp12_, 24);
	_tmp13_ = shootimage;
	gtk_widget_set_margin_start ((GtkWidget*) _tmp13_, 10);
	_tmp14_ = shootimage;
	gtk_widget_set_margin_end ((GtkWidget*) _tmp14_, 10);
	_tmp15_ = shootbutton;
	_tmp16_ = shootimage;
	gtk_container_add ((GtkContainer*) _tmp15_, (GtkWidget*) _tmp16_);
	_tmp17_ = shootbutton;
	_tmp18_ = gtk_widget_get_style_context ((GtkWidget*) _tmp17_);
	gtk_style_context_add_class (_tmp18_, GTK_STYLE_CLASS_SUGGESTED_ACTION);
	_tmp19_ = shootbutton;
	g_signal_connect_object (_tmp19_, "clicked", (GCallback) ___lambda25__gtk_button_clicked, self, 0);
	_tmp20_ = (GtkButton*) gtk_button_new ();
	g_object_ref_sink (_tmp20_);
	helpbutton = _tmp20_;
	_tmp21_ = helpbutton;
	_tmp22_ = budgie_screenshot_home_window_make_info_popover (self, _tmp21_);
	_data2_->helppopover = _tmp22_;
	_tmp23_ = helpbutton;
	g_signal_connect_data (_tmp23_, "clicked", (GCallback) ___lambda27__gtk_button_clicked, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
	_tmp24_ = helpbutton;
	gtk_button_set_label (_tmp24_, "･･･");
	_tmp25_ = helpbutton;
	_tmp26_ = gtk_widget_get_style_context ((GtkWidget*) _tmp25_);
	gtk_style_context_add_class (_tmp26_, GTK_STYLE_CLASS_RAISED);
	_tmp27_ = self->priv->windowstate;
	_tmp28_ = budgie_current_state_get_buttonpos (_tmp27_);
	_tmp29_ = _tmp28_;
	if (_tmp29_ == ((gint) BUDGIE_BUTTON_PLACEMENT_LEFT)) {
		GtkHeaderBar* _tmp30_;
		GtkButton* _tmp31_;
		GtkHeaderBar* _tmp32_;
		GtkButton* _tmp33_;
		_tmp30_ = self->priv->topbar;
		_tmp31_ = shootbutton;
		gtk_header_bar_pack_end (_tmp30_, (GtkWidget*) _tmp31_);
		_tmp32_ = self->priv->topbar;
		_tmp33_ = helpbutton;
		gtk_header_bar_pack_end (_tmp32_, (GtkWidget*) _tmp33_);
	} else {
		GtkHeaderBar* _tmp34_;
		GtkButton* _tmp35_;
		GtkHeaderBar* _tmp36_;
		GtkButton* _tmp37_;
		_tmp34_ = self->priv->topbar;
		_tmp35_ = shootbutton;
		gtk_header_bar_pack_start (_tmp34_, (GtkWidget*) _tmp35_);
		_tmp36_ = self->priv->topbar;
		_tmp37_ = helpbutton;
		gtk_header_bar_pack_start (_tmp36_, (GtkWidget*) _tmp37_);
	}
	gtk_widget_show_all ((GtkWidget*) self);
	_tmp38_ = shootbutton;
	gtk_widget_grab_focus ((GtkWidget*) _tmp38_);
	_g_object_unref0 (helpbutton);
	_g_object_unref0 (shootimage);
	_g_object_unref0 (iconfile);
	_g_object_unref0 (shootbutton);
	block2_data_unref (_data2_);
	_data2_ = NULL;
}

static Block4Data*
block4_data_ref (Block4Data* _data4_)
{
	g_atomic_int_inc (&_data4_->_ref_count_);
	return _data4_;
}

static void
block4_data_unref (void * _userdata_)
{
	Block4Data* _data4_;
	_data4_ = (Block4Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data4_->_ref_count_)) {
		BudgieScreenshotHomeWindow* self;
		self = _data4_->self;
		_data4_->selectbuttons = (_vala_array_free (_data4_->selectbuttons, _data4_->selectbuttons_length1, (GDestroyNotify) g_object_unref), NULL);
		_g_object_unref0 (self);
		g_slice_free (Block4Data, _data4_);
	}
}

static void
_vala_array_add5 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add6 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add7 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add8 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add9 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add10 (gchar** * array,
                   gint* length,
                   gint* size,
                   gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = 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_)) {
		BudgieScreenshotHomeWindow* self;
		self = _data5_->_data4_->self;
		_g_object_unref0 (_data5_->b);
		block4_data_unref (_data5_->_data4_);
		_data5_->_data4_ = NULL;
		g_slice_free (Block5Data, _data5_);
	}
}

static void
_vala_array_add11 (GtkToggleButton** * array,
                   gint* length,
                   gint* size,
                   GtkToggleButton* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkToggleButton*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static gboolean
___lambda21_ (BudgieScreenshotHomeWindow* self)
{
	gboolean result;
	self->priv->ignore = FALSE;
	result = FALSE;
	return result;
}

static gboolean
____lambda21__gsource_func (gpointer self)
{
	gboolean result;
	result = ___lambda21_ ((BudgieScreenshotHomeWindow*) self);
	return result;
}

static void
____lambda20_ (Block5Data* _data5_)
{
	Block4Data* _data4_;
	BudgieScreenshotHomeWindow* self;
	_data4_ = _data5_->_data4_;
	self = _data4_->self;
	if (!self->priv->ignore) {
		GtkToggleButton* _tmp0_;
		GtkToggleButton** _tmp1_;
		gint _tmp1__length1;
		GtkToggleButton* _tmp2_;
		self->priv->ignore = TRUE;
		_tmp0_ = _data5_->b;
		_tmp1_ = _data4_->selectbuttons;
		_tmp1__length1 = _data4_->selectbuttons_length1;
		budgie_screenshot_home_window_select_action (self, _tmp0_, _tmp1_, (gint) _tmp1__length1);
		_tmp2_ = _data5_->b;
		gtk_toggle_button_set_active (_tmp2_, TRUE);
		g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 200, ____lambda21__gsource_func, g_object_ref (self), g_object_unref);
	}
}

static void
_____lambda20__gtk_button_clicked (GtkButton* _sender,
                                   gpointer self)
{
	____lambda20_ (self);
}

static GtkBox*
budgie_screenshot_home_window_setup_areabuttons (BudgieScreenshotHomeWindow* self)
{
	Block4Data* _data4_;
	GtkBox* areabuttonbox = NULL;
	GtkBox* _tmp0_;
	gchar* mode = NULL;
	BudgieCurrentState* _tmp1_;
	GSettings* _tmp2_;
	GSettings* _tmp3_;
	gchar* _tmp4_;
	gchar** mode_options = NULL;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar** _tmp8_;
	gint mode_options_length1;
	gint _mode_options_size_;
	gint active = 0;
	const gchar* _tmp9_;
	gchar** _tmp10_;
	gint _tmp10__length1;
	gboolean window_support = FALSE;
	gchar** areabuttons_labels = NULL;
	gchar** _tmp11_;
	gint areabuttons_labels_length1;
	gint _areabuttons_labels_size_;
	gchar** icon_names = NULL;
	gchar** _tmp12_;
	gint icon_names_length1;
	gint _icon_names_size_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gint i = 0;
	GtkToggleButton** _tmp19_;
	gchar** _tmp20_;
	gint _tmp20__length1;
	GtkBox* result;
	g_return_val_if_fail (self != NULL, NULL);
	_data4_ = g_slice_new0 (Block4Data);
	_data4_->_ref_count_ = 1;
	_data4_->self = g_object_ref (self);
	_tmp0_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp0_);
	areabuttonbox = _tmp0_;
	_tmp1_ = self->priv->windowstate;
	_tmp2_ = budgie_current_state_get_screenshot_settings (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_settings_get_string (_tmp3_, "screenshot-mode");
	mode = _tmp4_;
	_tmp5_ = g_strdup (BUDGIE_SCREEN);
	_tmp6_ = g_strdup (BUDGIE_WINDOW);
	_tmp7_ = g_strdup (BUDGIE_SELECTION);
	_tmp8_ = g_new0 (gchar*, 3 + 1);
	_tmp8_[0] = _tmp5_;
	_tmp8_[1] = _tmp6_;
	_tmp8_[2] = _tmp7_;
	mode_options = _tmp8_;
	mode_options_length1 = 3;
	_mode_options_size_ = mode_options_length1;
	_tmp9_ = mode;
	_tmp10_ = mode_options;
	_tmp10__length1 = mode_options_length1;
	active = budgie_find_stringindex (_tmp9_, _tmp10_, (gint) _tmp10__length1);
	window_support = budgie_make_screenshot_ScreenshotWindowSupport ();
	_tmp11_ = g_new0 (gchar*, 0 + 1);
	areabuttons_labels = _tmp11_;
	areabuttons_labels_length1 = 0;
	_areabuttons_labels_size_ = areabuttons_labels_length1;
	_tmp12_ = g_new0 (gchar*, 0 + 1);
	icon_names = _tmp12_;
	icon_names_length1 = 0;
	_icon_names_size_ = icon_names_length1;
	_tmp13_ = g_strdup (_ (BUDGIE_SCREEN));
	_vala_array_add5 (&areabuttons_labels, &areabuttons_labels_length1, &_areabuttons_labels_size_, _tmp13_);
	_tmp14_ = g_strdup ("selectscreen-symbolic");
	_vala_array_add6 (&icon_names, &icon_names_length1, &_icon_names_size_, _tmp14_);
	if (window_support) {
		gchar* _tmp15_;
		gchar* _tmp16_;
		_tmp15_ = g_strdup (_ (BUDGIE_WINDOW));
		_vala_array_add7 (&areabuttons_labels, &areabuttons_labels_length1, &_areabuttons_labels_size_, _tmp15_);
		_tmp16_ = g_strdup ("selectwindow-symbolic");
		_vala_array_add8 (&icon_names, &icon_names_length1, &_icon_names_size_, _tmp16_);
	}
	_tmp17_ = g_strdup (_ (BUDGIE_SELECTION));
	_vala_array_add9 (&areabuttons_labels, &areabuttons_labels_length1, &_areabuttons_labels_size_, _tmp17_);
	_tmp18_ = g_strdup ("selectselection-symbolic");
	_vala_array_add10 (&icon_names, &icon_names_length1, &_icon_names_size_, _tmp18_);
	i = 0;
	_tmp19_ = g_new0 (GtkToggleButton*, 0 + 1);
	_data4_->selectbuttons = _tmp19_;
	_data4_->selectbuttons_length1 = 0;
	_data4_->_selectbuttons_size_ = _data4_->selectbuttons_length1;
	_tmp20_ = areabuttons_labels;
	_tmp20__length1 = areabuttons_labels_length1;
	{
		gchar** s_collection = NULL;
		gint s_collection_length1 = 0;
		gint _s_collection_size_ = 0;
		gint s_it = 0;
		s_collection = _tmp20_;
		s_collection_length1 = _tmp20__length1;
		for (s_it = 0; s_it < s_collection_length1; s_it = s_it + 1) {
			gchar* _tmp21_;
			gchar* s = NULL;
			_tmp21_ = g_strdup (s_collection[s_it]);
			s = _tmp21_;
			{
				Block5Data* _data5_;
				GThemedIcon* iconfile = NULL;
				gchar** _tmp22_;
				gint _tmp22__length1;
				const gchar* _tmp23_;
				GThemedIcon* _tmp24_;
				GtkImage* selecticon = NULL;
				GThemedIcon* _tmp25_;
				GtkImage* _tmp26_;
				GtkImage* _tmp27_;
				GtkBox* buttonbox = NULL;
				GtkBox* _tmp28_;
				GtkBox* _tmp29_;
				GtkImage* _tmp30_;
				GtkLabel* selectionlabel = NULL;
				const gchar* _tmp31_;
				GtkLabel* _tmp32_;
				GtkLabel* _tmp33_;
				GtkLabel* _tmp34_;
				GtkLabel* _tmp35_;
				GtkStyleContext* _tmp36_;
				GtkBox* _tmp37_;
				GtkLabel* _tmp38_;
				GtkToggleButton* _tmp39_;
				GtkToggleButton* _tmp40_;
				GtkStyleContext* _tmp41_;
				GtkToggleButton* _tmp42_;
				GtkBox* _tmp43_;
				GtkToggleButton* _tmp44_;
				GtkBox* _tmp45_;
				GtkToggleButton* _tmp46_;
				GtkToggleButton* _tmp47_;
				GtkToggleButton* _tmp48_;
				GtkToggleButton* _tmp49_;
				_data5_ = g_slice_new0 (Block5Data);
				_data5_->_ref_count_ = 1;
				_data5_->_data4_ = block4_data_ref (_data4_);
				_tmp22_ = icon_names;
				_tmp22__length1 = icon_names_length1;
				_tmp23_ = _tmp22_[i];
				gtk_widget_set_name ((GtkWidget*) self, _tmp23_);
				_tmp24_ = (GThemedIcon*) g_themed_icon_new (_tmp23_);
				iconfile = _tmp24_;
				_tmp25_ = iconfile;
				_tmp26_ = (GtkImage*) gtk_image_new_from_gicon ((GIcon*) _tmp25_, (GtkIconSize) GTK_ICON_SIZE_DIALOG);
				g_object_ref_sink (_tmp26_);
				selecticon = _tmp26_;
				_tmp27_ = selecticon;
				gtk_image_set_pixel_size (_tmp27_, 60);
				_tmp28_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 4);
				g_object_ref_sink (_tmp28_);
				buttonbox = _tmp28_;
				_tmp29_ = buttonbox;
				_tmp30_ = selecticon;
				gtk_box_pack_start (_tmp29_, (GtkWidget*) _tmp30_, TRUE, TRUE, (guint) 0);
				_tmp31_ = s;
				_tmp32_ = (GtkLabel*) gtk_label_new (_tmp31_);
				g_object_ref_sink (_tmp32_);
				selectionlabel = _tmp32_;
				_tmp33_ = selectionlabel;
				gtk_label_set_xalign (_tmp33_, 0.5f);
				_tmp34_ = selectionlabel;
				gtk_widget_set_margin_bottom ((GtkWidget*) _tmp34_, 8);
				_tmp35_ = selectionlabel;
				_tmp36_ = gtk_widget_get_style_context ((GtkWidget*) _tmp35_);
				gtk_style_context_add_class (_tmp36_, "buttonlabel");
				_tmp37_ = buttonbox;
				_tmp38_ = selectionlabel;
				gtk_box_pack_start (_tmp37_, (GtkWidget*) _tmp38_, TRUE, TRUE, (guint) 0);
				_tmp39_ = (GtkToggleButton*) gtk_toggle_button_new ();
				g_object_ref_sink (_tmp39_);
				_data5_->b = _tmp39_;
				_tmp40_ = _data5_->b;
				_tmp41_ = gtk_widget_get_style_context ((GtkWidget*) _tmp40_);
				gtk_style_context_add_class (_tmp41_, "centerbutton");
				_tmp42_ = _data5_->b;
				_tmp43_ = buttonbox;
				gtk_container_add ((GtkContainer*) _tmp42_, (GtkWidget*) _tmp43_);
				_tmp44_ = _data5_->b;
				gtk_toggle_button_set_active (_tmp44_, i == active);
				_tmp45_ = areabuttonbox;
				_tmp46_ = _data5_->b;
				gtk_box_pack_start (_tmp45_, (GtkWidget*) _tmp46_, TRUE, TRUE, (guint) 0);
				_tmp47_ = _data5_->b;
				_tmp48_ = _g_object_ref0 (_tmp47_);
				_vala_array_add11 (&_data4_->selectbuttons, &_data4_->selectbuttons_length1, &_data4_->_selectbuttons_size_, _tmp48_);
				_tmp49_ = _data5_->b;
				g_signal_connect_data ((GtkButton*) _tmp49_, "clicked", (GCallback) _____lambda20__gtk_button_clicked, block5_data_ref (_data5_), (GClosureNotify) block5_data_unref, 0);
				i += 1;
				_g_object_unref0 (selectionlabel);
				_g_object_unref0 (buttonbox);
				_g_object_unref0 (selecticon);
				_g_object_unref0 (iconfile);
				_g_free0 (s);
				block5_data_unref (_data5_);
				_data5_ = NULL;
			}
		}
	}
	result = areabuttonbox;
	icon_names = (_vala_array_free (icon_names, icon_names_length1, (GDestroyNotify) g_free), NULL);
	areabuttons_labels = (_vala_array_free (areabuttons_labels, areabuttons_labels_length1, (GDestroyNotify) g_free), NULL);
	mode_options = (_vala_array_free (mode_options, mode_options_length1, (GDestroyNotify) g_free), NULL);
	_g_free0 (mode);
	block4_data_unref (_data4_);
	_data4_ = NULL;
	return result;
}

static void
_vala_array_add12 (gchar** * array,
                   gint* length,
                   gint* size,
                   gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add13 (gchar** * array,
                   gint* length,
                   gint* size,
                   gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add14 (gchar** * array,
                   gint* length,
                   gint* size,
                   gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
budgie_screenshot_home_window_select_action (BudgieScreenshotHomeWindow* self,
                                             GtkToggleButton* b,
                                             GtkToggleButton** btns,
                                             gint btns_length1)
{
	gchar** selectmodes = NULL;
	gchar** _tmp0_;
	gint selectmodes_length1;
	gint _selectmodes_size_;
	gboolean window_support = FALSE;
	gchar* _tmp1_;
	gchar* _tmp3_;
	gint i = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (b != NULL);
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	selectmodes = _tmp0_;
	selectmodes_length1 = 0;
	_selectmodes_size_ = selectmodes_length1;
	window_support = budgie_make_screenshot_ScreenshotWindowSupport ();
	_tmp1_ = g_strdup (BUDGIE_SCREEN);
	_vala_array_add12 (&selectmodes, &selectmodes_length1, &_selectmodes_size_, _tmp1_);
	if (window_support) {
		gchar* _tmp2_;
		_tmp2_ = g_strdup (BUDGIE_WINDOW);
		_vala_array_add13 (&selectmodes, &selectmodes_length1, &_selectmodes_size_, _tmp2_);
	}
	_tmp3_ = g_strdup (BUDGIE_SELECTION);
	_vala_array_add14 (&selectmodes, &selectmodes_length1, &_selectmodes_size_, _tmp3_);
	i = 0;
	{
		GtkToggleButton** bt_collection = NULL;
		gint bt_collection_length1 = 0;
		gint _bt_collection_size_ = 0;
		gint bt_it = 0;
		bt_collection = btns;
		bt_collection_length1 = btns_length1;
		for (bt_it = 0; bt_it < bt_collection_length1; bt_it = bt_it + 1) {
			GtkToggleButton* _tmp4_;
			GtkToggleButton* bt = NULL;
			_tmp4_ = _g_object_ref0 (bt_collection[bt_it]);
			bt = _tmp4_;
			{
				GtkToggleButton* _tmp5_;
				_tmp5_ = bt;
				if (_tmp5_ != b) {
					GtkToggleButton* _tmp6_;
					_tmp6_ = bt;
					gtk_toggle_button_set_active (_tmp6_, FALSE);
				} else {
					BudgieCurrentState* _tmp7_;
					GSettings* _tmp8_;
					GSettings* _tmp9_;
					gchar** _tmp10_;
					gint _tmp10__length1;
					const gchar* _tmp11_;
					self->priv->selectmode = i;
					_tmp7_ = self->priv->windowstate;
					_tmp8_ = budgie_current_state_get_screenshot_settings (_tmp7_);
					_tmp9_ = _tmp8_;
					_tmp10_ = selectmodes;
					_tmp10__length1 = selectmodes_length1;
					_tmp11_ = _tmp10_[i];
					g_settings_set_string (_tmp9_, "screenshot-mode", _tmp11_);
				}
				i += 1;
				_g_object_unref0 (bt);
			}
		}
	}
	selectmodes = (_vala_array_free (selectmodes, selectmodes_length1, (GDestroyNotify) g_free), NULL);
}

static void
budgie_screenshot_home_window_set_margins (BudgieScreenshotHomeWindow* self,
                                           GtkGrid* grid,
                                           gint left,
                                           gint right,
                                           gint top,
                                           gint bottom)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (grid != NULL);
	gtk_widget_set_margin_start ((GtkWidget*) grid, left);
	gtk_widget_set_margin_end ((GtkWidget*) grid, right);
	gtk_widget_set_margin_top ((GtkWidget*) grid, top);
	gtk_widget_set_margin_bottom ((GtkWidget*) grid, bottom);
}

static void
budgie_screenshot_home_window_class_init (BudgieScreenshotHomeWindowClass * klass,
                                          gpointer klass_data)
{
	budgie_screenshot_home_window_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BudgieScreenshotHomeWindow_private_offset);
	G_OBJECT_CLASS (klass)->finalize = budgie_screenshot_home_window_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/buddiesofbudgie/Screenshot/screenshothome.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "maingrid", FALSE, BudgieScreenshotHomeWindow_private_offset + G_STRUCT_OFFSET (BudgieScreenshotHomeWindowPrivate, maingrid));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "delayspin", FALSE, BudgieScreenshotHomeWindow_private_offset + G_STRUCT_OFFSET (BudgieScreenshotHomeWindowPrivate, delayspin));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "showpointerswitch", FALSE, BudgieScreenshotHomeWindow_private_offset + G_STRUCT_OFFSET (BudgieScreenshotHomeWindowPrivate, showpointerswitch));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "screenshotcapturesoundswitch", FALSE, BudgieScreenshotHomeWindow_private_offset + G_STRUCT_OFFSET (BudgieScreenshotHomeWindowPrivate, screenshotcapturesoundswitch));
}

static void
budgie_screenshot_home_window_instance_init (BudgieScreenshotHomeWindow * self,
                                             gpointer klass)
{
	self->priv = budgie_screenshot_home_window_get_instance_private (self);
	self->priv->selectmode = 0;
	self->priv->ignore = FALSE;
	self->priv->button_id = NULL;
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
budgie_screenshot_home_window_finalize (GObject * obj)
{
	BudgieScreenshotHomeWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BUDGIE_TYPE_SCREENSHOT_HOME_WINDOW, BudgieScreenshotHomeWindow);
	_g_object_unref0 (self->priv->topbar);
	_g_object_unref0 (self->priv->windowstate);
	self->priv->shortcutlabels = (_vala_array_free (self->priv->shortcutlabels, self->priv->shortcutlabels_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_free0 (self->priv->button_id);
	G_OBJECT_CLASS (budgie_screenshot_home_window_parent_class)->finalize (obj);
}

static GType
budgie_screenshot_home_window_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BudgieScreenshotHomeWindowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) budgie_screenshot_home_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BudgieScreenshotHomeWindow), 0, (GInstanceInitFunc) budgie_screenshot_home_window_instance_init, NULL };
	GType budgie_screenshot_home_window_type_id;
	budgie_screenshot_home_window_type_id = g_type_register_static (gtk_window_get_type (), "BudgieScreenshotHomeWindow", &g_define_type_info, 0);
	BudgieScreenshotHomeWindow_private_offset = g_type_add_instance_private (budgie_screenshot_home_window_type_id, sizeof (BudgieScreenshotHomeWindowPrivate));
	return budgie_screenshot_home_window_type_id;
}

GType
budgie_screenshot_home_window_get_type (void)
{
	static volatile gsize budgie_screenshot_home_window_type_id__once = 0;
	if (g_once_init_enter (&budgie_screenshot_home_window_type_id__once)) {
		GType budgie_screenshot_home_window_type_id;
		budgie_screenshot_home_window_type_id = budgie_screenshot_home_window_get_type_once ();
		g_once_init_leave (&budgie_screenshot_home_window_type_id__once, budgie_screenshot_home_window_type_id);
	}
	return budgie_screenshot_home_window_type_id__once;
}

static inline gpointer
budgie_select_layer_get_instance_private (BudgieSelectLayer* self)
{
	return G_STRUCT_MEMBER_P (self, BudgieSelectLayer_private_offset);
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	return result;
}

BudgieSelectLayer*
budgie_select_layer_construct (GType object_type,
                               gint* overrule_delay)
{
	BudgieSelectLayer * self = NULL;
	BudgieCurrentState* _tmp0_;
	BudgieCurrentState* _tmp1_;
	GError* _inner_error0_ = NULL;
	self = (BudgieSelectLayer*) g_object_new (object_type, NULL);
	_tmp0_ = budgie_current_state_new ();
	_g_object_unref0 (self->priv->windowstate);
	self->priv->windowstate = _tmp0_;
	_tmp1_ = self->priv->windowstate;
	budgie_current_state_statechanged (_tmp1_, (gint) BUDGIE_WINDOW_STATE_SELECTINGAREA);
	{
		gchar** argv = NULL;
		gchar* _tmp2_;
		gchar** _tmp3_;
		gint argv_length1;
		gint _argv_size_;
		gchar* output = NULL;
		gchar* _tmp4_;
		gchar* stderr = NULL;
		gchar* _tmp5_;
		gint status = 0;
		gchar** _tmp6_;
		gint _tmp6__length1;
		gchar* _tmp7_ = NULL;
		gchar* _tmp8_ = NULL;
		gint _tmp9_ = 0;
		gchar** parts = NULL;
		const gchar* _tmp12_;
		gchar* _tmp13_;
		gchar* _tmp14_;
		gchar** _tmp15_;
		gchar** _tmp16_;
		gchar** _tmp17_;
		gint _tmp17__length1;
		gint parts_length1;
		gint _parts_size_;
		gchar** _tmp18_;
		gint _tmp18__length1;
		gchar** position = NULL;
		gchar** _tmp21_;
		gint _tmp21__length1;
		const gchar* _tmp22_;
		gchar** _tmp23_;
		gchar** _tmp24_;
		gint position_length1;
		gint _position_size_;
		gchar** size = NULL;
		gchar** _tmp25_;
		gint _tmp25__length1;
		const gchar* _tmp26_;
		gchar** _tmp27_;
		gchar** _tmp28_;
		gint size_length1;
		gint _size_size_;
		gboolean _tmp29_ = FALSE;
		gchar** _tmp30_;
		gint _tmp30__length1;
		gchar** _tmp34_;
		gint _tmp34__length1;
		const gchar* _tmp35_;
		gchar** _tmp36_;
		gint _tmp36__length1;
		const gchar* _tmp37_;
		gchar** _tmp38_;
		gint _tmp38__length1;
		const gchar* _tmp39_;
		gchar** _tmp40_;
		gint _tmp40__length1;
		const gchar* _tmp41_;
		_tmp2_ = g_strdup ("slurp");
		_tmp3_ = g_new0 (gchar*, 1 + 1);
		_tmp3_[0] = _tmp2_;
		argv = _tmp3_;
		argv_length1 = 1;
		_argv_size_ = argv_length1;
		_tmp4_ = g_strdup ("");
		output = _tmp4_;
		_tmp5_ = g_strdup ("");
		stderr = _tmp5_;
		status = 0;
		_tmp6_ = argv;
		_tmp6__length1 = argv_length1;
		g_spawn_sync (NULL, _tmp6_, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, &_tmp7_, &_tmp8_, &_tmp9_, &_inner_error0_);
		_g_free0 (output);
		output = _tmp7_;
		_g_free0 (stderr);
		stderr = _tmp8_;
		status = _tmp9_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_free0 (stderr);
			_g_free0 (output);
			argv = (_vala_array_free (argv, argv_length1, (GDestroyNotify) g_free), NULL);
			goto __catch0_g_error;
		}
		if (status != 0) {
			const gchar* _tmp10_;
			GError* _tmp11_;
			_tmp10_ = stderr;
			_tmp11_ = g_error_new ((GQuark) -1, 0, "Error: %s", _tmp10_);
			_inner_error0_ = _tmp11_;
			_g_free0 (stderr);
			_g_free0 (output);
			argv = (_vala_array_free (argv, argv_length1, (GDestroyNotify) g_free), NULL);
			goto __catch0_g_error;
		}
		_tmp12_ = output;
		_tmp13_ = string_strip (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp16_ = _tmp15_ = g_strsplit (_tmp14_, " ", 0);
		_tmp17_ = _tmp16_;
		_tmp17__length1 = _vala_array_length (_tmp15_);
		_g_free0 (_tmp14_);
		parts = _tmp17_;
		parts_length1 = _tmp17__length1;
		_parts_size_ = parts_length1;
		_tmp18_ = parts;
		_tmp18__length1 = parts_length1;
		if (_tmp18__length1 < 2) {
			const gchar* _tmp19_;
			GError* _tmp20_;
			_tmp19_ = output;
			_tmp20_ = g_error_new ((GQuark) -1, 0, "Unexpected output format (1): %s", _tmp19_);
			_inner_error0_ = _tmp20_;
			parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
			_g_free0 (stderr);
			_g_free0 (output);
			argv = (_vala_array_free (argv, argv_length1, (GDestroyNotify) g_free), NULL);
			goto __catch0_g_error;
		}
		_tmp21_ = parts;
		_tmp21__length1 = parts_length1;
		_tmp22_ = _tmp21_[0];
		_tmp24_ = _tmp23_ = g_strsplit (_tmp22_, ",", 0);
		position = _tmp24_;
		position_length1 = _vala_array_length (_tmp23_);
		_position_size_ = position_length1;
		_tmp25_ = parts;
		_tmp25__length1 = parts_length1;
		_tmp26_ = _tmp25_[1];
		_tmp28_ = _tmp27_ = g_strsplit (_tmp26_, "x", 0);
		size = _tmp28_;
		size_length1 = _vala_array_length (_tmp27_);
		_size_size_ = size_length1;
		_tmp30_ = position;
		_tmp30__length1 = position_length1;
		if (_tmp30__length1 != 2) {
			_tmp29_ = TRUE;
		} else {
			gchar** _tmp31_;
			gint _tmp31__length1;
			_tmp31_ = size;
			_tmp31__length1 = size_length1;
			_tmp29_ = _tmp31__length1 != 2;
		}
		if (_tmp29_) {
			const gchar* _tmp32_;
			GError* _tmp33_;
			_tmp32_ = output;
			_tmp33_ = g_error_new ((GQuark) -1, 0, "Unexpected output format (2): %s", _tmp32_);
			_inner_error0_ = _tmp33_;
			size = (_vala_array_free (size, size_length1, (GDestroyNotify) g_free), NULL);
			position = (_vala_array_free (position, position_length1, (GDestroyNotify) g_free), NULL);
			parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
			_g_free0 (stderr);
			_g_free0 (output);
			argv = (_vala_array_free (argv, argv_length1, (GDestroyNotify) g_free), NULL);
			goto __catch0_g_error;
		}
		_tmp34_ = position;
		_tmp34__length1 = position_length1;
		_tmp35_ = _tmp34_[0];
		self->priv->topleftx = atoi (_tmp35_);
		_tmp36_ = position;
		_tmp36__length1 = position_length1;
		_tmp37_ = _tmp36_[1];
		self->priv->toplefty = atoi (_tmp37_);
		_tmp38_ = size;
		_tmp38__length1 = size_length1;
		_tmp39_ = _tmp38_[0];
		self->priv->width = atoi (_tmp39_);
		_tmp40_ = size;
		_tmp40__length1 = size_length1;
		_tmp41_ = _tmp40_[1];
		self->priv->height = atoi (_tmp41_);
		size = (_vala_array_free (size, size_length1, (GDestroyNotify) g_free), NULL);
		position = (_vala_array_free (position, position_length1, (GDestroyNotify) g_free), NULL);
		parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
		_g_free0 (stderr);
		_g_free0 (output);
		argv = (_vala_array_free (argv, argv_length1, (GDestroyNotify) g_free), NULL);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp42_;
		const gchar* _tmp43_;
		BudgieCurrentState* _tmp44_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp42_ = e;
		_tmp43_ = _tmp42_->message;
		g_warning ("screenshot.vala:720: Error: %s", _tmp43_);
		_tmp44_ = self->priv->windowstate;
		budgie_current_state_statechanged (_tmp44_, (gint) BUDGIE_WINDOW_STATE_NONE);
		_g_error_free0 (e);
		return self;
	}
	__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 NULL;
	}
	budgie_select_layer_take_shot (self, NULL, NULL);
	return self;
}

BudgieSelectLayer*
budgie_select_layer_new (gint* overrule_delay)
{
	return budgie_select_layer_construct (BUDGIE_TYPE_SELECT_LAYER, overrule_delay);
}

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

static void
budgie_select_layer_take_shot (BudgieSelectLayer* self,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_)
{
	BudgieSelectLayerTakeShotData* _data_;
	BudgieSelectLayer* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (BudgieSelectLayerTakeShotData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, budgie_select_layer_take_shot_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	budgie_select_layer_take_shot_co (_data_);
}

static void
budgie_select_layer_take_shot_finish (BudgieSelectLayer* self,
                                      GAsyncResult* _res_)
{
	BudgieSelectLayerTakeShotData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static gboolean
budgie_select_layer_take_shot_co (BudgieSelectLayerTakeShotData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->windowstate;
	budgie_current_state_statechanged (_data_->_tmp0_, (gint) BUDGIE_WINDOW_STATE_WAITINGFORSHOT);
	_data_->_tmp1_ = g_new0 (gint, 4);
	_data_->_tmp1_[0] = _data_->self->priv->topleftx;
	_data_->_tmp1_[1] = _data_->self->priv->toplefty;
	_data_->_tmp1_[2] = _data_->self->priv->width;
	_data_->_tmp1_[3] = _data_->self->priv->height;
	_data_->area = _data_->_tmp1_;
	_data_->area_length1 = 4;
	_data_->_area_size_ = _data_->area_length1;
	_data_->_tmp2_ = budgie_make_screenshot_new (_data_->area, _data_->area_length1);
	_data_->_tmp3_ = _data_->_tmp2_;
	_budgie_make_screenshot_unref0 (_data_->_tmp3_);
	_data_->area = (g_free (_data_->area), 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
budgie_select_layer_class_init (BudgieSelectLayerClass * klass,
                                gpointer klass_data)
{
	budgie_select_layer_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BudgieSelectLayer_private_offset);
	G_OBJECT_CLASS (klass)->finalize = budgie_select_layer_finalize;
}

static void
budgie_select_layer_instance_init (BudgieSelectLayer * self,
                                   gpointer klass)
{
	self->priv = budgie_select_layer_get_instance_private (self);
}

static void
budgie_select_layer_finalize (GObject * obj)
{
	BudgieSelectLayer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BUDGIE_TYPE_SELECT_LAYER, BudgieSelectLayer);
	_g_object_unref0 (self->priv->windowstate);
	G_OBJECT_CLASS (budgie_select_layer_parent_class)->finalize (obj);
}

static GType
budgie_select_layer_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BudgieSelectLayerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) budgie_select_layer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BudgieSelectLayer), 0, (GInstanceInitFunc) budgie_select_layer_instance_init, NULL };
	GType budgie_select_layer_type_id;
	budgie_select_layer_type_id = g_type_register_static (G_TYPE_OBJECT, "BudgieSelectLayer", &g_define_type_info, 0);
	BudgieSelectLayer_private_offset = g_type_add_instance_private (budgie_select_layer_type_id, sizeof (BudgieSelectLayerPrivate));
	return budgie_select_layer_type_id;
}

GType
budgie_select_layer_get_type (void)
{
	static volatile gsize budgie_select_layer_type_id__once = 0;
	if (g_once_init_enter (&budgie_select_layer_type_id__once)) {
		GType budgie_select_layer_type_id;
		budgie_select_layer_type_id = budgie_select_layer_get_type_once ();
		g_once_init_leave (&budgie_select_layer_type_id__once, budgie_select_layer_type_id);
	}
	return budgie_select_layer_type_id__once;
}

static inline gpointer
budgie_after_shot_window_get_instance_private (BudgieAfterShotWindow* self)
{
	return G_STRUCT_MEMBER_P (self, BudgieAfterShotWindow_private_offset);
}

static GType
budgie_after_shot_window_column_get_type_once (void)
{
	static const GEnumValue values[] = {{BUDGIE_AFTER_SHOT_WINDOW_COLUMN_DIRPATH, "BUDGIE_AFTER_SHOT_WINDOW_COLUMN_DIRPATH", "dirpath"}, {BUDGIE_AFTER_SHOT_WINDOW_COLUMN_DISPLAYEDNAME, "BUDGIE_AFTER_SHOT_WINDOW_COLUMN_DISPLAYEDNAME", "displayedname"}, {BUDGIE_AFTER_SHOT_WINDOW_COLUMN_ICON, "BUDGIE_AFTER_SHOT_WINDOW_COLUMN_ICON", "icon"}, {BUDGIE_AFTER_SHOT_WINDOW_COLUMN_ISSEPARATOR, "BUDGIE_AFTER_SHOT_WINDOW_COLUMN_ISSEPARATOR", "isseparator"}, {0, NULL, NULL}};
	GType budgie_after_shot_window_column_type_id;
	budgie_after_shot_window_column_type_id = g_enum_register_static ("BudgieAfterShotWindowColumn", values);
	return budgie_after_shot_window_column_type_id;
}

static GType
budgie_after_shot_window_column_get_type (void)
{
	static volatile gsize budgie_after_shot_window_column_type_id__once = 0;
	if (g_once_init_enter (&budgie_after_shot_window_column_type_id__once)) {
		GType budgie_after_shot_window_column_type_id;
		budgie_after_shot_window_column_type_id = budgie_after_shot_window_column_get_type_once ();
		g_once_init_leave (&budgie_after_shot_window_column_type_id__once, budgie_after_shot_window_column_type_id);
	}
	return budgie_after_shot_window_column_type_id__once;
}

static void
budgie_after_shot_window_delete_file (BudgieAfterShotWindow* self,
                                      GFile* file)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (file != NULL);
	{
		g_file_delete (file, NULL, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static GdkPixbuf*
budgie_after_shot_window_get_pxb (BudgieAfterShotWindow* self)
{
	GFile* pixfile = NULL;
	BudgieCurrentState* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	GFile* _tmp3_;
	gint n = 0;
	GError* _inner_error0_ = NULL;
	GdkPixbuf* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->windowstate;
	_tmp1_ = budgie_current_state_get_tempfile_path (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_file_new_for_path (_tmp2_);
	pixfile = _tmp3_;
	n = 0;
	while (TRUE) {
		GFile* _tmp4_;
		if (!(n < 20)) {
			break;
		}
		g_usleep ((gulong) 100000);
		_tmp4_ = pixfile;
		if (g_file_query_exists (_tmp4_, NULL)) {
			{
				GdkPixbuf* pxb = NULL;
				BudgieCurrentState* _tmp5_;
				const gchar* _tmp6_;
				const gchar* _tmp7_;
				GdkPixbuf* _tmp8_;
				GFile* _tmp9_;
				_tmp5_ = self->priv->windowstate;
				_tmp6_ = budgie_current_state_get_tempfile_path (_tmp5_);
				_tmp7_ = _tmp6_;
				_tmp8_ = gdk_pixbuf_new_from_file (_tmp7_, &_inner_error0_);
				pxb = _tmp8_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					goto __catch0_g_error;
				}
				_tmp9_ = pixfile;
				budgie_after_shot_window_delete_file (self, _tmp9_);
				result = pxb;
				_g_object_unref0 (pixfile);
				return result;
			}
			goto __finally0;
			__catch0_g_error:
			{
				g_clear_error (&_inner_error0_);
				g_message ("screenshot.vala:792: unable to load image from /tmp");
			}
			__finally0:
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_object_unref0 (pixfile);
				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;
			}
		}
		n += 1;
	}
	result = NULL;
	_g_object_unref0 (pixfile);
	return result;
}

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

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

static gboolean
__lambda10_ (Block6Data* _data6_)
{
	BudgieAfterShotWindow* self;
	GdkMonitor* monitor = NULL;
	BudgieWaylandClient* _tmp0_;
	GdkMonitor* _tmp1_;
	GdkMonitor* _tmp2_;
	GdkMonitor* _tmp3_;
	GdkMonitor* _tmp4_;
	GdkMonitor* _tmp5_;
	gboolean result;
	self = _data6_->self;
	_tmp0_ = _data6_->wayland_client;
	_tmp1_ = budgie_wayland_client_get_gdk_monitor (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	monitor = _tmp3_;
	_tmp4_ = monitor;
	if (_tmp4_ == NULL) {
		g_warning ("screenshot.vala:812: Failed to get monitor for after shot window");
		result = FALSE;
		_g_object_unref0 (monitor);
		return result;
	}
	gtk_layer_init_for_window ((GtkWindow*) self);
	gtk_layer_set_layer ((GtkWindow*) self, GTK_LAYER_SHELL_LAYER_TOP);
	_tmp5_ = monitor;
	gtk_layer_set_monitor ((GtkWindow*) self, _tmp5_);
	gtk_layer_set_anchor ((GtkWindow*) self, GTK_LAYER_SHELL_EDGE_TOP, FALSE);
	gtk_layer_set_anchor ((GtkWindow*) self, GTK_LAYER_SHELL_EDGE_LEFT, FALSE);
	gtk_layer_set_keyboard_mode ((GtkWindow*) self, GTK_LAYER_SHELL_KEYBOARD_MODE_ON_DEMAND);
	result = TRUE;
	_g_object_unref0 (monitor);
	return result;
}

static gboolean
___lambda10__budgie_monitor_callback (gpointer self)
{
	gboolean result;
	result = __lambda10_ (self);
	return result;
}

BudgieAfterShotWindow*
budgie_after_shot_window_construct (GType object_type)
{
	BudgieAfterShotWindow * self = NULL;
	Block6Data* _data6_;
	BudgieWaylandClient* _tmp0_;
	BudgieWaylandClient* _tmp1_;
	gboolean window_configured = FALSE;
	BudgieWaylandClient* _tmp2_;
	BudgieCurrentState* _tmp3_;
	GdkPixbuf* pxb = NULL;
	GdkPixbuf* _tmp4_;
	GdkPixbuf* _tmp5_;
	_data6_ = g_slice_new0 (Block6Data);
	_data6_->_ref_count_ = 1;
	self = (BudgieAfterShotWindow*) g_object_new (object_type, NULL);
	_data6_->self = g_object_ref (self);
	_tmp0_ = budgie_wayland_client_new ();
	_data6_->wayland_client = _tmp0_;
	_tmp1_ = _data6_->wayland_client;
	if (!budgie_wayland_client_is_initialised (_tmp1_)) {
		g_warning ("screenshot.vala:805: WaylandClient not initialized for AfterShotWindow");
		block6_data_unref (_data6_);
		_data6_ = NULL;
		return self;
	}
	_tmp2_ = _data6_->wayland_client;
	window_configured = budgie_wayland_client_with_valid_monitor (_tmp2_, ___lambda10__budgie_monitor_callback, block6_data_ref (_data6_), block6_data_unref);
	if (!window_configured) {
		g_warning ("screenshot.vala:826: Failed to configure after shot window");
		block6_data_unref (_data6_);
		_data6_ = NULL;
		return self;
	}
	gtk_window_set_decorated ((GtkWindow*) self, TRUE);
	gtk_window_set_startup_id ((GtkWindow*) self, "org.buddiesofbudgie.BudgieScreenshot");
	gtk_window_set_title ((GtkWindow*) self, _ ("Budgie Screenshot"));
	gtk_window_set_wmclass ((GtkWindow*) self, "org.buddiesofbudgie.BudgieScreenshot", "org.buddiesofbudgie.BudgieScreenshot");
	_tmp3_ = budgie_current_state_new ();
	_g_object_unref0 (self->priv->windowstate);
	self->priv->windowstate = _tmp3_;
	_tmp4_ = budgie_after_shot_window_get_pxb (self);
	pxb = _tmp4_;
	_tmp5_ = pxb;
	if (_tmp5_ == NULL) {
		BudgieCurrentState* _tmp6_;
		_tmp6_ = self->priv->windowstate;
		budgie_current_state_statechanged (_tmp6_, (gint) BUDGIE_WINDOW_STATE_NONE);
	} else {
		GdkPixbuf* _tmp7_;
		_tmp7_ = pxb;
		budgie_after_shot_window_makeaftershotwindow (self, _tmp7_);
	}
	_g_object_unref0 (pxb);
	block6_data_unref (_data6_);
	_data6_ = NULL;
	return self;
}

BudgieAfterShotWindow*
budgie_after_shot_window_new (void)
{
	return budgie_after_shot_window_construct (BUDGIE_TYPE_AFTER_SHOT_WINDOW);
}

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

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

static void
_budgie_after_shot_window_update_dropdown_g_volume_monitor_mount_added (GVolumeMonitor* _sender,
                                                                        GMount* mount,
                                                                        gpointer self)
{
	budgie_after_shot_window_update_dropdown ((BudgieAfterShotWindow*) self);
}

static void
_budgie_after_shot_window_update_dropdown_g_volume_monitor_mount_removed (GVolumeMonitor* _sender,
                                                                          GMount* mount,
                                                                          gpointer self)
{
	budgie_after_shot_window_update_dropdown ((BudgieAfterShotWindow*) self);
}

static void
__lambda11_ (BudgieAfterShotWindow* self)
{
	if (self->priv->act_ondropdown) {
		GtkComboBox* _tmp0_;
		_tmp0_ = self->priv->pickdir_combo;
		budgie_after_shot_window_item_changed (self, _tmp0_);
	}
}

static void
___lambda11__gtk_combo_box_changed (GtkComboBox* _sender,
                                    gpointer self)
{
	__lambda11_ ((BudgieAfterShotWindow*) self);
}

static void
__lambda12_ (Block7Data* _data7_)
{
	BudgieAfterShotWindow* self;
	GtkButton** _tmp0_;
	GtkEntry* _tmp1_;
	self = _data7_->self;
	_tmp0_ = g_new0 (GtkButton*, 0 + 1);
	self->priv->decisionbuttons = (_vala_array_free (self->priv->decisionbuttons, self->priv->decisionbuttons_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->decisionbuttons = _tmp0_;
	self->priv->decisionbuttons_length1 = 0;
	self->priv->_decisionbuttons_size_ = self->priv->decisionbuttons_length1;
	_tmp1_ = self->priv->filenameentry;
	budgie_after_shot_window_setup_headerbar (self, _data7_->decisionbar, _tmp1_, _data7_->clp, _data7_->pxb);
}

static void
___lambda12__budgie_current_state_buttonpos_changed (BudgieCurrentState* _sender,
                                                     gpointer self)
{
	__lambda12_ (self);
}

static gboolean
__lambda17_ (BudgieAfterShotWindow* self,
             GdkEventKey* event)
{
	gboolean result;
	g_return_val_if_fail (event != NULL, FALSE);
	if (event->keyval == GDK_KEY_Escape) {
		GtkButton** _tmp0_;
		gint _tmp0__length1;
		GtkButton* _tmp1_;
		_tmp0_ = self->priv->decisionbuttons;
		_tmp0__length1 = self->priv->decisionbuttons_length1;
		_tmp1_ = _tmp0_[0];
		gtk_button_clicked (_tmp1_);
		result = TRUE;
		return result;
	}
	result = FALSE;
	return result;
}

static gboolean
___lambda17__gtk_widget_key_press_event (GtkWidget* _sender,
                                         GdkEventKey* event,
                                         gpointer self)
{
	gboolean result;
	result = __lambda17_ ((BudgieAfterShotWindow*) self, event);
	return result;
}

static void
budgie_after_shot_window_makeaftershotwindow (BudgieAfterShotWindow* self,
                                              GdkPixbuf* pxb)
{
	Block7Data* _data7_;
	GdkPixbuf* _tmp0_;
	gint scale = 0;
	GtkClipboard* _tmp1_;
	GtkClipboard* _tmp2_;
	BudgieCurrentState* _tmp3_;
	GdkPixbuf* pixbuf = NULL;
	GdkPixbuf* _tmp4_;
	GtkImage* _tmp5_;
	GtkEntry* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	GVolumeMonitor* _tmp9_;
	GVolumeMonitor* _tmp10_;
	GVolumeMonitor* _tmp11_;
	GtkComboBox* _tmp12_;
	GtkHeaderBar* _tmp13_;
	BudgieCurrentState* _tmp14_;
	gulong _tmp15_;
	gulong _tmp16_;
	gulong* _tmp17_;
	GtkEntry* _tmp18_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (pxb != NULL);
	_data7_ = g_slice_new0 (Block7Data);
	_data7_->_ref_count_ = 1;
	_data7_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (pxb);
	_g_object_unref0 (_data7_->pxb);
	_data7_->pxb = _tmp0_;
	gtk_window_set_keep_above ((GtkWindow*) self, TRUE);
	scale = budgie_get_scaling ();
	_tmp1_ = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data7_->clp = _tmp2_;
	_tmp3_ = self->priv->windowstate;
	budgie_current_state_statechanged (_tmp3_, (gint) BUDGIE_WINDOW_STATE_AFTERSHOT);
	_tmp4_ = budgie_after_shot_window_resize_pixbuf (self, _data7_->pxb, scale);
	pixbuf = _tmp4_;
	_tmp5_ = self->priv->img;
	gtk_image_set_from_pixbuf (_tmp5_, pixbuf);
	_tmp6_ = self->priv->filenameentry;
	_tmp7_ = budgie_after_shot_window_get_scrshotname (self);
	_tmp8_ = _tmp7_;
	gtk_entry_set_text (_tmp6_, _tmp8_);
	_g_free0 (_tmp8_);
	_tmp9_ = g_volume_monitor_get ();
	_g_object_unref0 (self->priv->monitor);
	self->priv->monitor = _tmp9_;
	_tmp10_ = self->priv->monitor;
	g_signal_connect_object (_tmp10_, "mount-added", (GCallback) _budgie_after_shot_window_update_dropdown_g_volume_monitor_mount_added, self, 0);
	_tmp11_ = self->priv->monitor;
	g_signal_connect_object (_tmp11_, "mount-removed", (GCallback) _budgie_after_shot_window_update_dropdown_g_volume_monitor_mount_removed, self, 0);
	budgie_after_shot_window_update_dropdown (self);
	_tmp12_ = self->priv->pickdir_combo;
	g_signal_connect_object (_tmp12_, "changed", (GCallback) ___lambda11__gtk_combo_box_changed, self, 0);
	_tmp13_ = (GtkHeaderBar*) gtk_header_bar_new ();
	g_object_ref_sink (_tmp13_);
	_data7_->decisionbar = _tmp13_;
	gtk_header_bar_set_show_close_button (_data7_->decisionbar, FALSE);
	_tmp14_ = self->priv->windowstate;
	_tmp15_ = g_signal_connect_data (_tmp14_, "buttonpos-changed", (GCallback) ___lambda12__budgie_current_state_buttonpos_changed, block7_data_ref (_data7_), (GClosureNotify) block7_data_unref, 0);
	_tmp16_ = _tmp15_;
	_tmp17_ = __ulong_dup0 (&_tmp16_);
	_g_free0 (self->priv->button_id);
	self->priv->button_id = _tmp17_;
	_tmp18_ = self->priv->filenameentry;
	budgie_after_shot_window_setup_headerbar (self, _data7_->decisionbar, _tmp18_, _data7_->clp, _data7_->pxb);
	g_signal_connect_object ((GtkWidget*) self, "key-press-event", (GCallback) ___lambda17__gtk_widget_key_press_event, self, 0);
	_g_object_unref0 (pixbuf);
	block7_data_unref (_data7_);
	_data7_ = NULL;
}

static void
budgie_after_shot_window_close_window (BudgieAfterShotWindow* self)
{
	BudgieCurrentState* _tmp0_;
	gulong* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->windowstate;
	_tmp1_ = self->priv->button_id;
	g_signal_handler_disconnect ((GObject*) _tmp0_, *_tmp1_);
	gtk_window_close ((GtkWindow*) self);
}

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

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

static void
_vala_array_add15 (GtkButton** * array,
                   gint* length,
                   gint* size,
                   GtkButton* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkButton*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
__lambda13_ (BudgieAfterShotWindow* self)
{
	BudgieCurrentState* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	_tmp0_ = self->priv->windowstate;
	_tmp1_ = budgie_current_state_get_startedfromgui (_tmp0_);
	_tmp2_ = _tmp1_;
	if (!_tmp2_) {
		BudgieCurrentState* _tmp3_;
		_tmp3_ = self->priv->windowstate;
		budgie_current_state_statechanged (_tmp3_, (gint) BUDGIE_WINDOW_STATE_NONE);
		budgie_after_shot_window_close_window (self);
	} else {
		BudgieCurrentState* _tmp4_;
		BudgieScreenshotHomeWindow* _tmp5_;
		BudgieScreenshotHomeWindow* _tmp6_;
		_tmp4_ = self->priv->windowstate;
		budgie_current_state_statechanged (_tmp4_, (gint) BUDGIE_WINDOW_STATE_MAINWINDOW);
		budgie_after_shot_window_close_window (self);
		_tmp5_ = budgie_screenshot_home_window_new ();
		g_object_ref_sink (_tmp5_);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp6_);
	}
}

static void
___lambda13__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda13_ ((BudgieAfterShotWindow*) self);
}

static void
__lambda14_ (Block8Data* _data8_)
{
	BudgieAfterShotWindow* self;
	GtkComboBox* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gboolean _tmp3_;
	self = _data8_->self;
	_tmp0_ = self->priv->pickdir_combo;
	_tmp1_ = budgie_after_shot_window_save_tofile (self, _data8_->filenameentry, _tmp0_, _data8_->pxb);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strcmp0 (_tmp2_, "fail") != 0;
	_g_free0 (_tmp2_);
	if (_tmp3_) {
		BudgieCurrentState* _tmp4_;
		_tmp4_ = self->priv->windowstate;
		budgie_current_state_statechanged (_tmp4_, (gint) BUDGIE_WINDOW_STATE_NONE);
		budgie_after_shot_window_close_window (self);
	}
}

static void
___lambda14__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda14_ (self);
}

static void
__lambda15_ (Block8Data* _data8_)
{
	BudgieAfterShotWindow* self;
	BudgieCurrentState* _tmp0_;
	self = _data8_->self;
	gtk_clipboard_set_image (_data8_->clp, _data8_->pxb);
	_tmp0_ = self->priv->windowstate;
	budgie_current_state_statechanged (_tmp0_, (gint) BUDGIE_WINDOW_STATE_NONE);
	budgie_after_shot_window_close_window (self);
}

static void
___lambda15__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda15_ (self);
}

static void
__lambda16_ (Block8Data* _data8_)
{
	BudgieAfterShotWindow* self;
	gchar* usedpath = NULL;
	GtkComboBox* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	self = _data8_->self;
	_tmp0_ = self->priv->pickdir_combo;
	_tmp1_ = budgie_after_shot_window_save_tofile (self, _data8_->filenameentry, _tmp0_, _data8_->pxb);
	usedpath = _tmp1_;
	_tmp2_ = usedpath;
	if (g_strcmp0 (_tmp2_, "fail") != 0) {
		const gchar* _tmp3_;
		BudgieCurrentState* _tmp4_;
		_tmp3_ = usedpath;
		budgie_after_shot_window_open_indefaultapp (self, _tmp3_);
		_tmp4_ = self->priv->windowstate;
		budgie_current_state_statechanged (_tmp4_, (gint) BUDGIE_WINDOW_STATE_NONE);
		budgie_after_shot_window_close_window (self);
	}
	_g_free0 (usedpath);
}

static void
___lambda16__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda16_ (self);
}

static void
budgie_after_shot_window_setup_headerbar (BudgieAfterShotWindow* self,
                                          GtkHeaderBar* bar,
                                          GtkEntry* filenameentry,
                                          GtkClipboard* clp,
                                          GdkPixbuf* pxb)
{
	Block8Data* _data8_;
	GtkEntry* _tmp0_;
	GtkClipboard* _tmp1_;
	GdkPixbuf* _tmp2_;
	GList* _tmp3_;
	gchar** tooltips = NULL;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar** _tmp10_;
	gint tooltips_length1;
	gint _tooltips_size_;
	gchar** header_imagenames = NULL;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar** _tmp15_;
	gint header_imagenames_length1;
	gint _header_imagenames_size_;
	gint currbutton = 0;
	gchar** _tmp16_;
	gint _tmp16__length1;
	GtkButton** _tmp30_;
	gint _tmp30__length1;
	GtkButton* _tmp31_;
	GtkStyleContext* _tmp32_;
	gchar** align = NULL;
	gchar* _tmp33_;
	gchar* _tmp34_;
	gchar* _tmp35_;
	gchar* _tmp36_;
	gchar** _tmp37_;
	gint align_length1;
	gint _align_size_;
	gchar** _tmp38_ = NULL;
	gint _tmp38__length1 = 0;
	gint __tmp38__size_ = 0;
	BudgieCurrentState* _tmp39_;
	gint _tmp40_;
	gint _tmp41_;
	gint b_index = 0;
	GtkButton** _tmp49_;
	gint _tmp49__length1;
	GtkButton** _tmp55_;
	gint _tmp55__length1;
	GtkButton* _tmp56_;
	GtkButton** _tmp57_;
	gint _tmp57__length1;
	GtkButton* _tmp58_;
	GtkButton** _tmp59_;
	gint _tmp59__length1;
	GtkButton* _tmp60_;
	GtkButton** _tmp61_;
	gint _tmp61__length1;
	GtkButton* _tmp62_;
	GtkButton** _tmp63_;
	gint _tmp63__length1;
	GtkButton* _tmp64_;
	GtkButton** _tmp65_;
	gint _tmp65__length1;
	GtkButton* _tmp66_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (bar != NULL);
	g_return_if_fail (filenameentry != NULL);
	g_return_if_fail (clp != NULL);
	g_return_if_fail (pxb != NULL);
	_data8_ = g_slice_new0 (Block8Data);
	_data8_->_ref_count_ = 1;
	_data8_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (filenameentry);
	_g_object_unref0 (_data8_->filenameentry);
	_data8_->filenameentry = _tmp0_;
	_tmp1_ = _g_object_ref0 (clp);
	_g_object_unref0 (_data8_->clp);
	_data8_->clp = _tmp1_;
	_tmp2_ = _g_object_ref0 (pxb);
	_g_object_unref0 (_data8_->pxb);
	_data8_->pxb = _tmp2_;
	_tmp3_ = gtk_container_get_children ((GtkContainer*) bar);
	{
		GList* w_collection = NULL;
		GList* w_it = NULL;
		w_collection = _tmp3_;
		for (w_it = w_collection; w_it != NULL; w_it = w_it->next) {
			GtkWidget* _tmp4_;
			GtkWidget* w = NULL;
			_tmp4_ = _g_object_ref0 ((GtkWidget*) w_it->data);
			w = _tmp4_;
			{
				GtkWidget* _tmp5_;
				_tmp5_ = w;
				gtk_widget_destroy (_tmp5_);
				_g_object_unref0 (w);
			}
		}
		(w_collection == NULL) ? NULL : (w_collection = (g_list_free (w_collection), NULL));
	}
	_tmp6_ = g_strdup (_ ("Cancel screenshot"));
	_tmp7_ = g_strdup (_ ("Save screenshot to the selected directory"));
	_tmp8_ = g_strdup (_ ("Copy screenshot to the clipboard"));
	_tmp9_ = g_strdup (_ ("Open screenshot in default application"));
	_tmp10_ = g_new0 (gchar*, 4 + 1);
	_tmp10_[0] = _tmp6_;
	_tmp10_[1] = _tmp7_;
	_tmp10_[2] = _tmp8_;
	_tmp10_[3] = _tmp9_;
	tooltips = _tmp10_;
	tooltips_length1 = 4;
	_tooltips_size_ = tooltips_length1;
	_tmp11_ = g_strdup ("trash-shot-symbolic");
	_tmp12_ = g_strdup ("save-shot-symbolic");
	_tmp13_ = g_strdup ("clipboard-shot-symbolic");
	_tmp14_ = g_strdup ("edit-shot-symbolic");
	_tmp15_ = g_new0 (gchar*, 4 + 1);
	_tmp15_[0] = _tmp11_;
	_tmp15_[1] = _tmp12_;
	_tmp15_[2] = _tmp13_;
	_tmp15_[3] = _tmp14_;
	header_imagenames = _tmp15_;
	header_imagenames_length1 = 4;
	_header_imagenames_size_ = header_imagenames_length1;
	currbutton = 0;
	_tmp16_ = header_imagenames;
	_tmp16__length1 = header_imagenames_length1;
	{
		gchar** s_collection = NULL;
		gint s_collection_length1 = 0;
		gint _s_collection_size_ = 0;
		gint s_it = 0;
		s_collection = _tmp16_;
		s_collection_length1 = _tmp16__length1;
		for (s_it = 0; s_it < s_collection_length1; s_it = s_it + 1) {
			gchar* _tmp17_;
			gchar* s = NULL;
			_tmp17_ = g_strdup (s_collection[s_it]);
			s = _tmp17_;
			{
				GtkButton* decisionbutton = NULL;
				GtkButton* _tmp18_;
				BudgieCurrentState* _tmp19_;
				gboolean _tmp20_;
				gboolean _tmp21_;
				GtkButton* _tmp25_;
				GtkButton* _tmp26_;
				const gchar* _tmp27_;
				GtkButton* _tmp28_;
				GtkButton* _tmp29_;
				_tmp18_ = (GtkButton*) gtk_button_new ();
				g_object_ref_sink (_tmp18_);
				decisionbutton = _tmp18_;
				_tmp19_ = self->priv->windowstate;
				_tmp20_ = budgie_current_state_get_showtooltips (_tmp19_);
				_tmp21_ = _tmp20_;
				if (_tmp21_) {
					GtkButton* _tmp22_;
					gchar** _tmp23_;
					gint _tmp23__length1;
					const gchar* _tmp24_;
					_tmp22_ = decisionbutton;
					_tmp23_ = tooltips;
					_tmp23__length1 = tooltips_length1;
					_tmp24_ = _tmp23_[currbutton];
					gtk_widget_set_tooltip_text ((GtkWidget*) _tmp22_, _tmp24_);
				}
				_tmp25_ = decisionbutton;
				gtk_widget_set_can_focus ((GtkWidget*) _tmp25_, TRUE);
				_tmp26_ = decisionbutton;
				_tmp27_ = s;
				budgie_after_shot_window_set_buttoncontent (self, _tmp26_, _tmp27_);
				_tmp28_ = decisionbutton;
				_tmp29_ = _g_object_ref0 (_tmp28_);
				_vala_array_add15 (&self->priv->decisionbuttons, &self->priv->decisionbuttons_length1, &self->priv->_decisionbuttons_size_, _tmp29_);
				currbutton += 1;
				_g_object_unref0 (decisionbutton);
				_g_free0 (s);
			}
		}
	}
	_tmp30_ = self->priv->decisionbuttons;
	_tmp30__length1 = self->priv->decisionbuttons_length1;
	_tmp31_ = _tmp30_[1];
	_tmp32_ = gtk_widget_get_style_context ((GtkWidget*) _tmp31_);
	gtk_style_context_add_class (_tmp32_, GTK_STYLE_CLASS_SUGGESTED_ACTION);
	_tmp33_ = g_strdup ("left");
	_tmp34_ = g_strdup ("right");
	_tmp35_ = g_strdup ("right");
	_tmp36_ = g_strdup ("right");
	_tmp37_ = g_new0 (gchar*, 4 + 1);
	_tmp37_[0] = _tmp33_;
	_tmp37_[1] = _tmp34_;
	_tmp37_[2] = _tmp35_;
	_tmp37_[3] = _tmp36_;
	align = _tmp37_;
	align_length1 = 4;
	_align_size_ = align_length1;
	_tmp39_ = self->priv->windowstate;
	_tmp40_ = budgie_current_state_get_buttonpos (_tmp39_);
	_tmp41_ = _tmp40_;
	if (_tmp41_ == ((gint) BUDGIE_BUTTON_PLACEMENT_LEFT)) {
		gchar* _tmp42_;
		gchar* _tmp43_;
		gchar* _tmp44_;
		gchar* _tmp45_;
		gchar** _tmp46_;
		gchar** _tmp47_;
		gint _tmp47__length1;
		_tmp42_ = g_strdup ("right");
		_tmp43_ = g_strdup ("left");
		_tmp44_ = g_strdup ("left");
		_tmp45_ = g_strdup ("left");
		_tmp46_ = g_new0 (gchar*, 4 + 1);
		_tmp46_[0] = _tmp42_;
		_tmp46_[1] = _tmp43_;
		_tmp46_[2] = _tmp44_;
		_tmp46_[3] = _tmp45_;
		align = (_vala_array_free (align, align_length1, (GDestroyNotify) g_free), NULL);
		align = _tmp46_;
		align_length1 = 4;
		_align_size_ = align_length1;
		_tmp47_ = align;
		_tmp47__length1 = align_length1;
		_tmp38_ = _tmp47_;
		_tmp38__length1 = _tmp47__length1;
		__tmp38__size_ = _tmp38__length1;
	} else {
		gchar** _tmp48_;
		gint _tmp48__length1;
		_tmp48_ = align;
		_tmp48__length1 = align_length1;
		_tmp38_ = _tmp48_;
		_tmp38__length1 = _tmp48__length1;
		__tmp38__size_ = _tmp38__length1;
	}
	b_index = 0;
	_tmp49_ = self->priv->decisionbuttons;
	_tmp49__length1 = self->priv->decisionbuttons_length1;
	{
		GtkButton** b_collection = NULL;
		gint b_collection_length1 = 0;
		gint _b_collection_size_ = 0;
		gint b_it = 0;
		b_collection = _tmp49_;
		b_collection_length1 = _tmp49__length1;
		for (b_it = 0; b_it < b_collection_length1; b_it = b_it + 1) {
			GtkButton* _tmp50_;
			GtkButton* b = NULL;
			_tmp50_ = _g_object_ref0 (b_collection[b_it]);
			b = _tmp50_;
			{
				gchar** _tmp51_;
				gint _tmp51__length1;
				const gchar* _tmp52_;
				_tmp51_ = align;
				_tmp51__length1 = align_length1;
				_tmp52_ = _tmp51_[b_index];
				if (g_strcmp0 (_tmp52_, "left") == 0) {
					GtkButton* _tmp53_;
					_tmp53_ = b;
					gtk_header_bar_pack_end (bar, (GtkWidget*) _tmp53_);
				} else {
					GtkButton* _tmp54_;
					_tmp54_ = b;
					gtk_header_bar_pack_start (bar, (GtkWidget*) _tmp54_);
				}
				b_index += 1;
				_g_object_unref0 (b);
			}
		}
	}
	_tmp55_ = self->priv->decisionbuttons;
	_tmp55__length1 = self->priv->decisionbuttons_length1;
	_tmp56_ = _tmp55_[0];
	g_signal_connect_object (_tmp56_, "clicked", (GCallback) ___lambda13__gtk_button_clicked, self, 0);
	_tmp57_ = self->priv->decisionbuttons;
	_tmp57__length1 = self->priv->decisionbuttons_length1;
	_tmp58_ = _tmp57_[1];
	gtk_widget_set_can_default ((GtkWidget*) _tmp58_, TRUE);
	_tmp59_ = self->priv->decisionbuttons;
	_tmp59__length1 = self->priv->decisionbuttons_length1;
	_tmp60_ = _tmp59_[1];
	g_signal_connect_data (_tmp60_, "clicked", (GCallback) ___lambda14__gtk_button_clicked, block8_data_ref (_data8_), (GClosureNotify) block8_data_unref, 0);
	_tmp61_ = self->priv->decisionbuttons;
	_tmp61__length1 = self->priv->decisionbuttons_length1;
	_tmp62_ = _tmp61_[2];
	g_signal_connect_data (_tmp62_, "clicked", (GCallback) ___lambda15__gtk_button_clicked, block8_data_ref (_data8_), (GClosureNotify) block8_data_unref, 0);
	_tmp63_ = self->priv->decisionbuttons;
	_tmp63__length1 = self->priv->decisionbuttons_length1;
	_tmp64_ = _tmp63_[3];
	g_signal_connect_data (_tmp64_, "clicked", (GCallback) ___lambda16__gtk_button_clicked, block8_data_ref (_data8_), (GClosureNotify) block8_data_unref, 0);
	gtk_window_set_titlebar ((GtkWindow*) self, (GtkWidget*) bar);
	gtk_widget_show_all ((GtkWidget*) self);
	_tmp65_ = self->priv->decisionbuttons;
	_tmp65__length1 = self->priv->decisionbuttons_length1;
	_tmp66_ = _tmp65_[1];
	gtk_widget_grab_focus ((GtkWidget*) _tmp66_);
	align = (_vala_array_free (align, align_length1, (GDestroyNotify) g_free), NULL);
	header_imagenames = (_vala_array_free (header_imagenames, header_imagenames_length1, (GDestroyNotify) g_free), NULL);
	tooltips = (_vala_array_free (tooltips, tooltips_length1, (GDestroyNotify) g_free), NULL);
	block8_data_unref (_data8_);
	_data8_ = NULL;
}

static void
budgie_after_shot_window_open_indefaultapp (BudgieAfterShotWindow* self,
                                            const gchar* path)
{
	GFile* file = NULL;
	GFile* _tmp0_;
	GFile* _tmp1_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (path != NULL);
	_tmp0_ = g_file_new_for_path (path);
	file = _tmp0_;
	_tmp1_ = file;
	if (g_file_query_exists (_tmp1_, NULL)) {
		{
			GFile* _tmp2_;
			gchar* _tmp3_;
			gchar* _tmp4_;
			_tmp2_ = file;
			_tmp3_ = g_file_get_uri (_tmp2_);
			_tmp4_ = _tmp3_;
			g_app_info_launch_default_for_uri (_tmp4_, NULL, &_inner_error0_);
			_g_free0 (_tmp4_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		}
		goto __finally0;
		__catch0_g_error:
		{
			g_clear_error (&_inner_error0_);
			g_warning ("screenshot.vala:990: Unable to launch %s", path);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (file);
			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 (file);
}

static gchar*
budgie_after_shot_window_get_path_fromcombo (BudgieAfterShotWindow* self,
                                             GtkComboBox* combo)
{
	GtkTreeIter iter = {0};
	GValue val = {0};
	GtkTreeIter _tmp0_ = {0};
	GtkListStore* _tmp1_;
	GtkTreeIter _tmp2_;
	GValue _tmp3_ = {0};
	GValue _tmp4_;
	gchar* _tmp5_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (combo != NULL, NULL);
	gtk_combo_box_get_active_iter (combo, &_tmp0_);
	iter = _tmp0_;
	_tmp1_ = self->priv->dir_liststore;
	_tmp2_ = iter;
	gtk_tree_model_get_value ((GtkTreeModel*) _tmp1_, &_tmp2_, 0, &_tmp3_);
	G_IS_VALUE (&val) ? (g_value_unset (&val), NULL) : NULL;
	val = _tmp3_;
	_tmp4_ = val;
	_tmp5_ = g_strdup (g_value_get_string (&_tmp4_));
	result = _tmp5_;
	G_IS_VALUE (&val) ? (g_value_unset (&val), NULL) : NULL;
	return result;
}

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

static gchar*
budgie_after_shot_window_get_scrshotname (BudgieAfterShotWindow* self)
{
	BudgieCurrentState* _tmp0_;
	GSettings* _tmp1_;
	GSettings* _tmp2_;
	gchar* _tmp3_;
	GDateTime* now = NULL;
	GDateTime* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->windowstate;
	_tmp1_ = budgie_current_state_get_screenshot_settings (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_settings_get_string (_tmp2_, "file-type");
	_g_free0 (self->priv->extension);
	self->priv->extension = _tmp3_;
	_tmp4_ = g_date_time_new_now_local ();
	now = _tmp4_;
	_tmp5_ = self->priv->extension;
	_tmp6_ = string_to_string (_tmp5_);
	_tmp7_ = g_strconcat ("Snapshot_%F_%H-%M-%S.", _tmp6_, NULL);
	_tmp8_ = _tmp7_;
	_tmp9_ = g_date_time_format (now, _tmp8_);
	_tmp10_ = _tmp9_;
	_g_free0 (_tmp8_);
	result = _tmp10_;
	_g_date_time_unref0 (now);
	return result;
}

static gchar*
budgie_after_shot_window_save_tofile (BudgieAfterShotWindow* self,
                                      GtkEntry* entry,
                                      GtkComboBox* combo,
                                      GdkPixbuf* pxb)
{
	gchar* found_dir = NULL;
	gchar* _tmp0_;
	gchar* fname = NULL;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_ = NULL;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gboolean _tmp9_;
	gchar* usedpath = NULL;
	const gchar* _tmp17_;
	const gchar* _tmp18_;
	const gchar* _tmp19_;
	const gchar* _tmp20_;
	gchar* _tmp21_;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (entry != NULL, NULL);
	g_return_val_if_fail (combo != NULL, NULL);
	g_return_val_if_fail (pxb != NULL, NULL);
	_tmp0_ = budgie_after_shot_window_get_path_fromcombo (self, combo);
	found_dir = _tmp0_;
	_tmp1_ = gtk_entry_get_text (entry);
	_tmp2_ = g_strdup (_tmp1_);
	fname = _tmp2_;
	_tmp4_ = fname;
	_tmp5_ = self->priv->extension;
	_tmp6_ = string_to_string (_tmp5_);
	_tmp7_ = g_strconcat (".", _tmp6_, NULL);
	_tmp8_ = _tmp7_;
	_tmp9_ = g_str_has_suffix (_tmp4_, _tmp8_);
	_g_free0 (_tmp8_);
	if (_tmp9_) {
		const gchar* _tmp10_;
		_tmp10_ = fname;
		_tmp3_ = _tmp10_;
	} else {
		const gchar* _tmp11_;
		const gchar* _tmp12_;
		const gchar* _tmp13_;
		const gchar* _tmp14_;
		gchar* _tmp15_;
		const gchar* _tmp16_;
		_tmp11_ = fname;
		_tmp12_ = string_to_string (_tmp11_);
		_tmp13_ = self->priv->extension;
		_tmp14_ = string_to_string (_tmp13_);
		_tmp15_ = g_strconcat (_tmp12_, ".", _tmp14_, NULL);
		_g_free0 (fname);
		fname = _tmp15_;
		_tmp16_ = fname;
		_tmp3_ = _tmp16_;
	}
	_tmp17_ = found_dir;
	_tmp18_ = string_to_string (_tmp17_);
	_tmp19_ = fname;
	_tmp20_ = string_to_string (_tmp19_);
	_tmp21_ = g_strconcat (_tmp18_, "/", _tmp20_, NULL);
	usedpath = _tmp21_;
	{
		const gchar* _tmp22_;
		const gchar* _tmp23_;
		_tmp22_ = usedpath;
		_tmp23_ = self->priv->extension;
		gdk_pixbuf_save (pxb, _tmp22_, _tmp23_, &_inner_error0_, NULL);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp24_;
		const gchar* _tmp25_;
		GtkButton* savebutton = NULL;
		GtkButton** _tmp26_;
		gint _tmp26__length1;
		GtkButton* _tmp27_;
		GtkButton* _tmp28_;
		GtkButton* _tmp29_;
		GtkButton* _tmp30_;
		gchar* _tmp31_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp24_ = e;
		_tmp25_ = _tmp24_->message;
		g_warning ("screenshot.vala:1022: save_tofile %s", _tmp25_);
		_tmp26_ = self->priv->decisionbuttons;
		_tmp26__length1 = self->priv->decisionbuttons_length1;
		_tmp27_ = _tmp26_[1];
		_tmp28_ = _g_object_ref0 (_tmp27_);
		savebutton = _tmp28_;
		_tmp29_ = savebutton;
		budgie_after_shot_window_set_buttoncontent (self, _tmp29_, "saveshot-noaccess-symbolic");
		_tmp30_ = savebutton;
		gtk_widget_set_tooltip_text ((GtkWidget*) _tmp30_, "A permission error on the directory occurred");
		_tmp31_ = g_strdup ("fail");
		result = _tmp31_;
		_g_object_unref0 (savebutton);
		_g_error_free0 (e);
		_g_free0 (usedpath);
		_g_free0 (fname);
		_g_free0 (found_dir);
		return result;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (usedpath);
		_g_free0 (fname);
		_g_free0 (found_dir);
		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 = usedpath;
	_g_free0 (fname);
	_g_free0 (found_dir);
	return result;
}

static void
budgie_after_shot_window_set_buttoncontent (BudgieAfterShotWindow* self,
                                            GtkButton* b,
                                            const gchar* icon)
{
	GList* _tmp0_;
	GtkIconTheme* theme = NULL;
	GtkIconTheme* _tmp3_;
	GtkIconTheme* _tmp4_;
	GThemedIcon* iconfile = NULL;
	GThemedIcon* _tmp5_;
	GtkImage* buttonimage = NULL;
	GtkImage* _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (b != NULL);
	g_return_if_fail (icon != NULL);
	_tmp0_ = gtk_container_get_children ((GtkContainer*) b);
	{
		GList* w_collection = NULL;
		GList* w_it = NULL;
		w_collection = _tmp0_;
		for (w_it = w_collection; w_it != NULL; w_it = w_it->next) {
			GtkWidget* _tmp1_;
			GtkWidget* w = NULL;
			_tmp1_ = _g_object_ref0 ((GtkWidget*) w_it->data);
			w = _tmp1_;
			{
				GtkWidget* _tmp2_;
				_tmp2_ = w;
				gtk_widget_destroy (_tmp2_);
				_g_object_unref0 (w);
			}
		}
		(w_collection == NULL) ? NULL : (w_collection = (g_list_free (w_collection), NULL));
	}
	_tmp3_ = gtk_icon_theme_get_default ();
	_tmp4_ = _g_object_ref0 (_tmp3_);
	theme = _tmp4_;
	gtk_icon_theme_add_resource_path (theme, "/org/buddiesofbudgie/Screenshot/icons/scalable/apps/");
	gtk_widget_set_name ((GtkWidget*) self, icon);
	_tmp5_ = (GThemedIcon*) g_themed_icon_new (icon);
	iconfile = _tmp5_;
	_tmp6_ = (GtkImage*) gtk_image_new_from_gicon ((GIcon*) iconfile, (GtkIconSize) GTK_ICON_SIZE_BUTTON);
	g_object_ref_sink (_tmp6_);
	buttonimage = _tmp6_;
	gtk_image_set_pixel_size (buttonimage, 24);
	gtk_widget_set_margin_start ((GtkWidget*) buttonimage, 8);
	gtk_widget_set_margin_end ((GtkWidget*) buttonimage, 8);
	gtk_container_add ((GtkContainer*) b, (GtkWidget*) buttonimage);
	gtk_widget_show_all ((GtkWidget*) b);
	_g_object_unref0 (buttonimage);
	_g_object_unref0 (iconfile);
	_g_object_unref0 (theme);
}

static GdkPixbuf*
budgie_after_shot_window_resize_pixbuf (BudgieAfterShotWindow* self,
                                        GdkPixbuf* pxb,
                                        gint scale)
{
	gint maxw_h = 0;
	gfloat resize = 0.0F;
	gint scaled_width = 0;
	gint scaled_height = 0;
	gboolean _tmp0_ = FALSE;
	gint dest_width = 0;
	gint dest_height = 0;
	GdkPixbuf* resized = NULL;
	GdkPixbuf* _tmp3_;
	GdkPixbuf* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (pxb != NULL, NULL);
	maxw_h = 345;
	resize = (gfloat) 1;
	scaled_width = (gint) (gdk_pixbuf_get_width (pxb) / scale);
	scaled_height = (gint) (gdk_pixbuf_get_height (pxb) / scale);
	if (scaled_width > maxw_h) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = scaled_height > maxw_h;
	}
	if (_tmp0_) {
		gfloat _tmp1_ = 0.0F;
		gfloat _tmp2_ = 0.0F;
		if (scaled_width >= scaled_height) {
			resize = ((gfloat) maxw_h) / scaled_width;
			_tmp1_ = resize;
		} else {
			_tmp1_ = resize;
		}
		if (scaled_height >= scaled_width) {
			resize = ((gfloat) maxw_h) / scaled_height;
			_tmp2_ = resize;
		} else {
			_tmp2_ = resize;
		}
	}
	dest_width = (gint) (scaled_width * resize);
	dest_height = (gint) (scaled_height * resize);
	_tmp3_ = gdk_pixbuf_scale_simple (pxb, dest_width, dest_height, GDK_INTERP_BILINEAR);
	resized = _tmp3_;
	result = resized;
	return result;
}

static void
_vala_array_add16 (gchar** * array,
                   gint* length,
                   gint* size,
                   gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
budgie_after_shot_window_create_row (BudgieAfterShotWindow* self,
                                     const gchar* path,
                                     const gchar* mention,
                                     const gchar* iconname,
                                     gboolean separator)
{
	GtkTreeIter iter = {0};
	GtkListStore* _tmp0_;
	GtkTreeIter _tmp1_ = {0};
	GtkListStore* _tmp2_;
	GtkTreeIter _tmp3_;
	GtkListStore* _tmp4_;
	GtkTreeIter _tmp5_;
	GtkListStore* _tmp6_;
	GtkTreeIter _tmp7_;
	GtkListStore* _tmp8_;
	GtkTreeIter _tmp9_;
	gchar* _tmp10_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->dir_liststore;
	gtk_list_store_append (_tmp0_, &_tmp1_);
	iter = _tmp1_;
	_tmp2_ = self->priv->dir_liststore;
	_tmp3_ = iter;
	gtk_list_store_set (_tmp2_, &_tmp3_, BUDGIE_AFTER_SHOT_WINDOW_COLUMN_DIRPATH, path, -1);
	_tmp4_ = self->priv->dir_liststore;
	_tmp5_ = iter;
	gtk_list_store_set (_tmp4_, &_tmp5_, BUDGIE_AFTER_SHOT_WINDOW_COLUMN_DISPLAYEDNAME, mention, -1);
	_tmp6_ = self->priv->dir_liststore;
	_tmp7_ = iter;
	gtk_list_store_set (_tmp6_, &_tmp7_, BUDGIE_AFTER_SHOT_WINDOW_COLUMN_ICON, iconname, -1);
	_tmp8_ = self->priv->dir_liststore;
	_tmp9_ = iter;
	gtk_list_store_set (_tmp8_, &_tmp9_, BUDGIE_AFTER_SHOT_WINDOW_COLUMN_ISSEPARATOR, separator, -1);
	_tmp10_ = g_strdup (path);
	_vala_array_add16 (&self->priv->alldirs, &self->priv->alldirs_length1, &self->priv->_alldirs_size_, _tmp10_);
}

static gboolean
budgie_after_shot_window_is_separator (BudgieAfterShotWindow* self,
                                       GtkTreeModel* dir_liststore,
                                       GtkTreeIter* iter)
{
	GValue is_sep = {0};
	GtkTreeIter _tmp0_;
	GValue _tmp1_ = {0};
	GValue _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (dir_liststore != NULL, FALSE);
	g_return_val_if_fail (iter != NULL, FALSE);
	_tmp0_ = *iter;
	gtk_tree_model_get_value (dir_liststore, &_tmp0_, 3, &_tmp1_);
	G_IS_VALUE (&is_sep) ? (g_value_unset (&is_sep), NULL) : NULL;
	is_sep = _tmp1_;
	_tmp2_ = is_sep;
	result = g_value_get_boolean (&_tmp2_);
	G_IS_VALUE (&is_sep) ? (g_value_unset (&is_sep), NULL) : NULL;
	return result;
}

static gchar*
budgie_after_shot_window_get_dir_basename (BudgieAfterShotWindow* self,
                                           const gchar* path)
{
	gchar** dirmention = NULL;
	gchar** _tmp0_;
	gchar** _tmp1_;
	gint dirmention_length1;
	gint _dirmention_size_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (path != NULL, NULL);
	_tmp1_ = _tmp0_ = g_strsplit (path, "/", 0);
	dirmention = _tmp1_;
	dirmention_length1 = _vala_array_length (_tmp0_);
	_dirmention_size_ = dirmention_length1;
	_tmp2_ = dirmention[dirmention_length1 - 1];
	_tmp3_ = g_strdup (_tmp2_);
	result = _tmp3_;
	dirmention = (_vala_array_free (dirmention, dirmention_length1, (GDestroyNotify) g_free), NULL);
	return result;
}

static gboolean
_budgie_after_shot_window_is_separator_gtk_tree_view_row_separator_func (GtkTreeModel* model,
                                                                         GtkTreeIter* iter,
                                                                         gpointer self)
{
	gboolean result;
	result = budgie_after_shot_window_is_separator ((BudgieAfterShotWindow*) self, model, iter);
	return result;
}

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
budgie_after_shot_window_update_dropdown (BudgieAfterShotWindow* self)
{
	gchar** _tmp0_;
	GtkComboBox* _tmp1_;
	GtkListStore* _tmp2_;
	gchar** userdir_iconnames = NULL;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar** _tmp11_;
	gint userdir_iconnames_length1;
	gint _userdir_iconnames_size_;
	gchar* homedir_path = NULL;
	const gchar* _tmp12_;
	gchar* _tmp13_;
	GFile* homedir_file = NULL;
	const gchar* _tmp14_;
	GFile* _tmp15_;
	gint n_dirs = 0;
	const gchar* _tmp38_;
	const gchar* _tmp39_;
	gchar* _tmp40_;
	gchar* _tmp41_;
	gboolean add_separator = FALSE;
	GList* mounts = NULL;
	GVolumeMonitor* _tmp42_;
	GList* _tmp43_;
	GList* _tmp44_;
	gchar* saved_custom_path = NULL;
	BudgieCurrentState* _tmp60_;
	GSettings* _tmp61_;
	GSettings* _tmp62_;
	gchar* _tmp63_;
	const gchar* _tmp64_;
	gint r_index = 0;
	gchar** _tmp82_;
	gint _tmp82__length1;
	GtkComboBox* _tmp95_;
	GtkCellRendererText* cell = NULL;
	GtkCellRendererText* _tmp96_;
	GtkCellRendererText* _tmp97_;
	GtkCellRendererText* _tmp98_;
	GValue _tmp99_ = {0};
	GtkCellRendererText* _tmp100_;
	GtkCellRendererPixbuf* cell_pb = NULL;
	GtkCellRendererPixbuf* _tmp101_;
	GtkComboBox* _tmp102_;
	GtkCellRendererText* _tmp103_;
	GtkComboBox* _tmp104_;
	GtkCellRendererPixbuf* _tmp105_;
	GtkComboBox* _tmp106_;
	GtkCellRendererText* _tmp107_;
	GtkComboBox* _tmp108_;
	GtkCellRendererPixbuf* _tmp109_;
	gint active_row = 0;
	BudgieCurrentState* _tmp110_;
	GSettings* _tmp111_;
	GSettings* _tmp112_;
	gint _tmp113_ = 0;
	gint _tmp114_ = 0;
	GtkComboBox* _tmp115_;
	GtkComboBox* _tmp116_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	self->priv->alldirs = (_vala_array_free (self->priv->alldirs, self->priv->alldirs_length1, (GDestroyNotify) g_free), NULL);
	self->priv->alldirs = _tmp0_;
	self->priv->alldirs_length1 = 0;
	self->priv->_alldirs_size_ = self->priv->alldirs_length1;
	self->priv->act_ondropdown = FALSE;
	_tmp1_ = self->priv->pickdir_combo;
	gtk_cell_layout_clear ((GtkCellLayout*) _tmp1_);
	_tmp2_ = self->priv->dir_liststore;
	gtk_list_store_clear (_tmp2_);
	_tmp3_ = g_strdup ("user-desktop");
	_tmp4_ = g_strdup ("folder-documents");
	_tmp5_ = g_strdup ("folder-download");
	_tmp6_ = g_strdup ("folder-music");
	_tmp7_ = g_strdup ("folder-pictures");
	_tmp8_ = g_strdup ("folder-publicshare");
	_tmp9_ = g_strdup ("folder-templates");
	_tmp10_ = g_strdup ("folder-videos");
	_tmp11_ = g_new0 (gchar*, 8 + 1);
	_tmp11_[0] = _tmp3_;
	_tmp11_[1] = _tmp4_;
	_tmp11_[2] = _tmp5_;
	_tmp11_[3] = _tmp6_;
	_tmp11_[4] = _tmp7_;
	_tmp11_[5] = _tmp8_;
	_tmp11_[6] = _tmp9_;
	_tmp11_[7] = _tmp10_;
	userdir_iconnames = _tmp11_;
	userdir_iconnames_length1 = 8;
	_userdir_iconnames_size_ = userdir_iconnames_length1;
	_tmp12_ = g_get_home_dir ();
	_tmp13_ = g_strdup (_tmp12_);
	homedir_path = _tmp13_;
	_tmp14_ = homedir_path;
	_tmp15_ = g_file_new_for_path (_tmp14_);
	homedir_file = _tmp15_;
	n_dirs = (gint) G_USER_N_DIRECTORIES;
	self->priv->counted_dirs = 0;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp16_ = FALSE;
			_tmp16_ = TRUE;
			while (TRUE) {
				gchar* path = NULL;
				const gchar* _tmp18_;
				gchar* _tmp19_;
				GFile* file = NULL;
				const gchar* _tmp20_;
				GFile* _tmp21_;
				gchar* mention = NULL;
				const gchar* _tmp22_;
				gchar* _tmp23_;
				gchar* iconname = NULL;
				gchar** _tmp24_;
				gint _tmp24__length1;
				const gchar* _tmp25_;
				gchar* _tmp26_;
				gboolean _tmp27_ = FALSE;
				GFile* _tmp28_;
				if (!_tmp16_) {
					gint _tmp17_;
					_tmp17_ = i;
					i = _tmp17_ + 1;
				}
				_tmp16_ = FALSE;
				if (!(i < n_dirs)) {
					break;
				}
				_tmp18_ = g_get_user_special_dir (i);
				_tmp19_ = g_strdup (_tmp18_);
				path = _tmp19_;
				_tmp20_ = path;
				_tmp21_ = g_file_new_for_path (_tmp20_);
				file = _tmp21_;
				_tmp22_ = path;
				_tmp23_ = budgie_after_shot_window_get_dir_basename (self, _tmp22_);
				mention = _tmp23_;
				_tmp24_ = userdir_iconnames;
				_tmp24__length1 = userdir_iconnames_length1;
				_tmp25_ = _tmp24_[i];
				_tmp26_ = g_strdup (_tmp25_);
				iconname = _tmp26_;
				_tmp28_ = file;
				if (g_file_query_exists (_tmp28_, NULL)) {
					GFile* _tmp29_;
					gchar* _tmp30_;
					gchar* _tmp31_;
					GFile* _tmp32_;
					gchar* _tmp33_;
					gchar* _tmp34_;
					_tmp29_ = file;
					_tmp30_ = g_file_get_path (_tmp29_);
					_tmp31_ = _tmp30_;
					_tmp32_ = homedir_file;
					_tmp33_ = g_file_get_path (_tmp32_);
					_tmp34_ = _tmp33_;
					_tmp27_ = g_strcmp0 (_tmp31_, _tmp34_) != 0;
					_g_free0 (_tmp34_);
					_g_free0 (_tmp31_);
				} else {
					_tmp27_ = FALSE;
				}
				if (_tmp27_) {
					const gchar* _tmp35_;
					const gchar* _tmp36_;
					const gchar* _tmp37_;
					_tmp35_ = path;
					_tmp36_ = mention;
					_tmp37_ = iconname;
					budgie_after_shot_window_create_row (self, _tmp35_, _tmp36_, _tmp37_, FALSE);
					self->priv->counted_dirs = self->priv->counted_dirs + 1;
				}
				_g_free0 (iconname);
				_g_free0 (mention);
				_g_object_unref0 (file);
				_g_free0 (path);
			}
		}
	}
	budgie_after_shot_window_create_row (self, NULL, NULL, NULL, TRUE);
	_tmp38_ = g_get_home_dir ();
	_tmp39_ = g_get_home_dir ();
	_tmp40_ = budgie_after_shot_window_get_dir_basename (self, _tmp39_);
	_tmp41_ = _tmp40_;
	budgie_after_shot_window_create_row (self, _tmp38_, _tmp41_, "user-home", FALSE);
	_g_free0 (_tmp41_);
	budgie_after_shot_window_create_row (self, NULL, NULL, NULL, TRUE);
	add_separator = FALSE;
	_tmp42_ = self->priv->monitor;
	_tmp43_ = g_volume_monitor_get_mounts (_tmp42_);
	mounts = _tmp43_;
	_tmp44_ = mounts;
	{
		GList* mount_collection = NULL;
		GList* mount_it = NULL;
		mount_collection = _tmp44_;
		for (mount_it = mount_collection; mount_it != NULL; mount_it = mount_it->next) {
			GMount* _tmp45_;
			GMount* mount = NULL;
			_tmp45_ = _g_object_ref0 ((GMount*) mount_it->data);
			mount = _tmp45_;
			{
				GIcon* icon = NULL;
				GMount* _tmp46_;
				GIcon* _tmp47_;
				gchar* ic_name = NULL;
				GIcon* _tmp48_;
				gchar* _tmp49_;
				gchar* displayedname = NULL;
				GMount* _tmp50_;
				gchar* _tmp51_;
				gchar* dirpath = NULL;
				GMount* _tmp52_;
				GFile* _tmp53_;
				GFile* _tmp54_;
				gchar* _tmp55_;
				gchar* _tmp56_;
				const gchar* _tmp57_;
				const gchar* _tmp58_;
				const gchar* _tmp59_;
				add_separator = TRUE;
				_tmp46_ = mount;
				_tmp47_ = g_mount_get_icon (_tmp46_);
				icon = _tmp47_;
				_tmp48_ = icon;
				_tmp49_ = budgie_after_shot_window_get_icon_fromgicon (self, _tmp48_);
				ic_name = _tmp49_;
				_tmp50_ = mount;
				_tmp51_ = g_mount_get_name (_tmp50_);
				displayedname = _tmp51_;
				_tmp52_ = mount;
				_tmp53_ = g_mount_get_default_location (_tmp52_);
				_tmp54_ = _tmp53_;
				_tmp55_ = g_file_get_path (_tmp54_);
				_tmp56_ = _tmp55_;
				_g_object_unref0 (_tmp54_);
				dirpath = _tmp56_;
				_tmp57_ = dirpath;
				_tmp58_ = displayedname;
				_tmp59_ = ic_name;
				budgie_after_shot_window_create_row (self, _tmp57_, _tmp58_, _tmp59_, FALSE);
				_g_free0 (dirpath);
				_g_free0 (displayedname);
				_g_free0 (ic_name);
				_g_object_unref0 (icon);
				_g_object_unref0 (mount);
			}
		}
	}
	if (add_separator) {
		budgie_after_shot_window_create_row (self, NULL, NULL, NULL, TRUE);
	}
	_tmp60_ = self->priv->windowstate;
	_tmp61_ = budgie_current_state_get_screenshot_settings (_tmp60_);
	_tmp62_ = _tmp61_;
	_tmp63_ = g_settings_get_string (_tmp62_, "last-save-directory-path");
	saved_custom_path = _tmp63_;
	_tmp64_ = saved_custom_path;
	if (g_strcmp0 (_tmp64_, "") != 0) {
		GFile* custom_file = NULL;
		const gchar* _tmp65_;
		GFile* _tmp66_;
		GFile* _tmp67_;
		_tmp65_ = saved_custom_path;
		_tmp66_ = g_file_new_for_path (_tmp65_);
		custom_file = _tmp66_;
		_tmp67_ = custom_file;
		if (g_file_query_exists (_tmp67_, NULL)) {
			gchar* ic_name = NULL;
			GFile* _tmp68_;
			gchar* _tmp69_;
			gchar* mention = NULL;
			const gchar* _tmp70_;
			gchar* _tmp71_;
			const gchar* _tmp72_;
			gchar* _tmp73_;
			const gchar* _tmp74_;
			gchar* _tmp75_;
			const gchar* _tmp76_;
			gchar* _tmp77_;
			gchar** _tmp78_;
			_tmp68_ = custom_file;
			_tmp69_ = budgie_after_shot_window_lookup_icon_name (self, _tmp68_);
			ic_name = _tmp69_;
			_tmp70_ = saved_custom_path;
			_tmp71_ = g_path_get_basename (_tmp70_);
			mention = _tmp71_;
			_tmp72_ = saved_custom_path;
			_tmp73_ = g_strdup (_tmp72_);
			_tmp74_ = mention;
			_tmp75_ = g_strdup (_tmp74_);
			_tmp76_ = ic_name;
			_tmp77_ = g_strdup (_tmp76_);
			_tmp78_ = g_new0 (gchar*, 3 + 1);
			_tmp78_[0] = _tmp73_;
			_tmp78_[1] = _tmp75_;
			_tmp78_[2] = _tmp77_;
			self->priv->custompath_row = (_vala_array_free (self->priv->custompath_row, self->priv->custompath_row_length1, (GDestroyNotify) g_free), NULL);
			self->priv->custompath_row = _tmp78_;
			self->priv->custompath_row_length1 = 3;
			self->priv->_custompath_row_size_ = self->priv->custompath_row_length1;
			_g_free0 (mention);
			_g_free0 (ic_name);
		} else {
			BudgieCurrentState* _tmp79_;
			GSettings* _tmp80_;
			GSettings* _tmp81_;
			_tmp79_ = self->priv->windowstate;
			_tmp80_ = budgie_current_state_get_screenshot_settings (_tmp79_);
			_tmp81_ = _tmp80_;
			g_settings_set_string (_tmp81_, "last-save-directory-path", "");
		}
		_g_object_unref0 (custom_file);
	}
	r_index = -1;
	_tmp82_ = self->priv->custompath_row;
	_tmp82__length1 = self->priv->custompath_row_length1;
	if (_tmp82_ != NULL) {
		gchar* c_path = NULL;
		gchar** _tmp83_;
		gint _tmp83__length1;
		const gchar* _tmp84_;
		gchar* _tmp85_;
		const gchar* _tmp86_;
		gchar** _tmp87_;
		gint _tmp87__length1;
		_tmp83_ = self->priv->custompath_row;
		_tmp83__length1 = self->priv->custompath_row_length1;
		_tmp84_ = _tmp83_[0];
		_tmp85_ = g_strdup (_tmp84_);
		c_path = _tmp85_;
		_tmp86_ = c_path;
		_tmp87_ = self->priv->alldirs;
		_tmp87__length1 = self->priv->alldirs_length1;
		r_index = budgie_find_stringindex (_tmp86_, _tmp87_, (gint) _tmp87__length1);
		if (r_index == -1) {
			const gchar* _tmp88_;
			gchar** _tmp89_;
			gint _tmp89__length1;
			const gchar* _tmp90_;
			gchar** _tmp91_;
			gint _tmp91__length1;
			const gchar* _tmp92_;
			const gchar* _tmp93_;
			gchar** _tmp94_;
			gint _tmp94__length1;
			_tmp88_ = c_path;
			_tmp89_ = self->priv->custompath_row;
			_tmp89__length1 = self->priv->custompath_row_length1;
			_tmp90_ = _tmp89_[1];
			_tmp91_ = self->priv->custompath_row;
			_tmp91__length1 = self->priv->custompath_row_length1;
			_tmp92_ = _tmp91_[2];
			budgie_after_shot_window_create_row (self, _tmp88_, _tmp90_, _tmp92_, FALSE);
			_tmp93_ = c_path;
			_tmp94_ = self->priv->alldirs;
			_tmp94__length1 = self->priv->alldirs_length1;
			r_index = budgie_find_stringindex (_tmp93_, _tmp94_, (gint) _tmp94__length1);
			budgie_after_shot_window_create_row (self, NULL, NULL, NULL, TRUE);
		}
		_g_free0 (c_path);
	}
	budgie_after_shot_window_create_row (self, NULL, _ ("Other..."), NULL, FALSE);
	_tmp95_ = self->priv->pickdir_combo;
	gtk_combo_box_set_row_separator_func (_tmp95_, _budgie_after_shot_window_is_separator_gtk_tree_view_row_separator_func, g_object_ref (self), g_object_unref);
	_tmp96_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	g_object_ref_sink (_tmp96_);
	cell = _tmp96_;
	_tmp97_ = cell;
	gtk_cell_renderer_set_padding ((GtkCellRenderer*) _tmp97_, 10, 1);
	_tmp98_ = cell;
	g_value_init (&_tmp99_, pango_ellipsize_mode_get_type ());
	g_value_set_enum (&_tmp99_, PANGO_ELLIPSIZE_END);
	g_object_set_property ((GObject*) _tmp98_, "ellipsize", &_tmp99_);
	G_IS_VALUE (&_tmp99_) ? (g_value_unset (&_tmp99_), NULL) : NULL;
	_tmp100_ = cell;
	gtk_cell_renderer_set_fixed_size ((GtkCellRenderer*) _tmp100_, 15, -1);
	_tmp101_ = (GtkCellRendererPixbuf*) gtk_cell_renderer_pixbuf_new ();
	g_object_ref_sink (_tmp101_);
	cell_pb = _tmp101_;
	_tmp102_ = self->priv->pickdir_combo;
	_tmp103_ = cell;
	gtk_cell_layout_pack_end ((GtkCellLayout*) _tmp102_, (GtkCellRenderer*) _tmp103_, FALSE);
	_tmp104_ = self->priv->pickdir_combo;
	_tmp105_ = cell_pb;
	gtk_cell_layout_pack_end ((GtkCellLayout*) _tmp104_, (GtkCellRenderer*) _tmp105_, FALSE);
	_tmp106_ = self->priv->pickdir_combo;
	_tmp107_ = cell;
	gtk_cell_layout_set_attributes ((GtkCellLayout*) _tmp106_, (GtkCellRenderer*) _tmp107_, "text", BUDGIE_AFTER_SHOT_WINDOW_COLUMN_DISPLAYEDNAME, NULL);
	_tmp108_ = self->priv->pickdir_combo;
	_tmp109_ = cell_pb;
	gtk_cell_layout_set_attributes ((GtkCellLayout*) _tmp108_, (GtkCellRenderer*) _tmp109_, "icon_name", BUDGIE_AFTER_SHOT_WINDOW_COLUMN_ICON, NULL);
	_tmp110_ = self->priv->windowstate;
	_tmp111_ = budgie_current_state_get_screenshot_settings (_tmp110_);
	_tmp112_ = _tmp111_;
	active_row = g_settings_get_int (_tmp112_, "last-save-directory");
	if (active_row > (self->priv->counted_dirs - 1)) {
		active_row = self->priv->counted_dirs + 1;
		_tmp113_ = active_row;
	} else {
		_tmp113_ = active_row;
	}
	if (r_index != -1) {
		active_row = r_index;
		_tmp114_ = active_row;
	} else {
		_tmp114_ = active_row;
	}
	_tmp115_ = self->priv->pickdir_combo;
	gtk_combo_box_set_active (_tmp115_, active_row);
	_tmp116_ = self->priv->pickdir_combo;
	gtk_widget_show ((GtkWidget*) _tmp116_);
	self->priv->act_ondropdown = TRUE;
	_g_object_unref0 (cell_pb);
	_g_object_unref0 (cell);
	_g_free0 (saved_custom_path);
	(mounts == NULL) ? NULL : (mounts = (_g_list_free__g_object_unref0_ (mounts), NULL));
	_g_object_unref0 (homedir_file);
	_g_free0 (homedir_path);
	userdir_iconnames = (_vala_array_free (userdir_iconnames, userdir_iconnames_length1, (GDestroyNotify) g_free), NULL);
}

static gchar*
budgie_after_shot_window_lookup_icon_name (BudgieAfterShotWindow* self,
                                           GFile* customdir)
{
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (customdir != NULL, NULL);
	{
		GFileInfo* info = NULL;
		GFileInfo* _tmp0_;
		GIcon* icon = NULL;
		GIcon* _tmp1_;
		GIcon* _tmp2_;
		GIcon* _tmp3_;
		gchar* _tmp4_;
		_tmp0_ = g_file_query_info (customdir, "standard::icon", 0, NULL, &_inner_error0_);
		info = _tmp0_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp1_ = g_file_info_get_icon (info);
		_tmp2_ = _g_object_ref0 (_tmp1_);
		icon = _tmp2_;
		_tmp3_ = icon;
		_tmp4_ = budgie_after_shot_window_get_icon_fromgicon (self, _tmp3_);
		result = _tmp4_;
		_g_object_unref0 (icon);
		_g_object_unref0 (info);
		return result;
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp5_;
		const gchar* _tmp6_;
		gchar* _tmp7_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp5_ = e;
		_tmp6_ = _tmp5_->message;
		g_warning ("screenshot.vala:1229: lookup_icon_name %s", _tmp6_);
		_tmp7_ = g_strdup ("");
		result = _tmp7_;
		_g_error_free0 (e);
		return result;
	}
	__finally0:
	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;
}

static void
budgie_after_shot_window_save_customdir (BudgieAfterShotWindow* self,
                                         GtkDialog* dialog,
                                         gint response_id)
{
	GtkFileChooserDialog* save_dialog = NULL;
	GtkFileChooserDialog* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (dialog != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (dialog, gtk_file_chooser_dialog_get_type ()) ? ((GtkFileChooserDialog*) dialog) : NULL);
	save_dialog = _tmp0_;
	if (response_id == ((gint) GTK_RESPONSE_ACCEPT)) {
		GFile* file = NULL;
		GtkFileChooserDialog* _tmp1_;
		GFile* _tmp2_;
		gchar* ic_name = NULL;
		GFile* _tmp3_;
		gchar* _tmp4_;
		gchar* custompath = NULL;
		GFile* _tmp5_;
		gchar* _tmp6_;
		gchar* mention = NULL;
		const gchar* _tmp7_;
		gchar* _tmp8_;
		const gchar* _tmp9_;
		gchar* _tmp10_;
		const gchar* _tmp11_;
		gchar* _tmp12_;
		const gchar* _tmp13_;
		gchar* _tmp14_;
		gchar** _tmp15_;
		BudgieCurrentState* _tmp16_;
		GSettings* _tmp17_;
		GSettings* _tmp18_;
		const gchar* _tmp19_;
		_tmp1_ = save_dialog;
		_tmp2_ = gtk_file_chooser_get_file ((GtkFileChooser*) _tmp1_);
		file = _tmp2_;
		_tmp3_ = file;
		_tmp4_ = budgie_after_shot_window_lookup_icon_name (self, _tmp3_);
		ic_name = _tmp4_;
		_tmp5_ = file;
		_tmp6_ = g_file_get_path (_tmp5_);
		custompath = _tmp6_;
		_tmp7_ = custompath;
		_tmp8_ = g_path_get_basename (_tmp7_);
		mention = _tmp8_;
		_tmp9_ = custompath;
		_tmp10_ = g_strdup (_tmp9_);
		_tmp11_ = mention;
		_tmp12_ = g_strdup (_tmp11_);
		_tmp13_ = ic_name;
		_tmp14_ = g_strdup (_tmp13_);
		_tmp15_ = g_new0 (gchar*, 3 + 1);
		_tmp15_[0] = _tmp10_;
		_tmp15_[1] = _tmp12_;
		_tmp15_[2] = _tmp14_;
		self->priv->custompath_row = (_vala_array_free (self->priv->custompath_row, self->priv->custompath_row_length1, (GDestroyNotify) g_free), NULL);
		self->priv->custompath_row = _tmp15_;
		self->priv->custompath_row_length1 = 3;
		self->priv->_custompath_row_size_ = self->priv->custompath_row_length1;
		_tmp16_ = self->priv->windowstate;
		_tmp17_ = budgie_current_state_get_screenshot_settings (_tmp16_);
		_tmp18_ = _tmp17_;
		_tmp19_ = custompath;
		g_settings_set_string (_tmp18_, "last-save-directory-path", _tmp19_);
		budgie_after_shot_window_update_dropdown (self);
		_g_free0 (mention);
		_g_free0 (custompath);
		_g_free0 (ic_name);
		_g_object_unref0 (file);
	} else {
		GtkComboBox* _tmp20_;
		BudgieCurrentState* _tmp21_;
		GSettings* _tmp22_;
		GSettings* _tmp23_;
		_tmp20_ = self->priv->pickdir_combo;
		_tmp21_ = self->priv->windowstate;
		_tmp22_ = budgie_current_state_get_screenshot_settings (_tmp21_);
		_tmp23_ = _tmp22_;
		gtk_combo_box_set_active (_tmp20_, g_settings_get_int (_tmp23_, "last-save-directory"));
	}
	gtk_widget_destroy ((GtkWidget*) dialog);
	gtk_widget_show ((GtkWidget*) self);
	_g_object_unref0 (save_dialog);
}

static gchar*
budgie_after_shot_window_get_icon_fromgicon (BudgieAfterShotWindow* self,
                                             GIcon* ic)
{
	gchar* found_icon = NULL;
	gchar* _tmp0_;
	gchar** iconinfo = NULL;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar** _tmp3_;
	gchar** _tmp4_;
	gchar** _tmp5_;
	gint _tmp5__length1;
	gint iconinfo_length1;
	gint _iconinfo_size_;
	const gchar* _tmp6_ = NULL;
	gchar** _tmp7_;
	gint _tmp7__length1;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (ic != NULL, NULL);
	_tmp0_ = g_strdup ("");
	found_icon = _tmp0_;
	_tmp1_ = g_icon_to_string (ic);
	_tmp2_ = _tmp1_;
	_tmp4_ = _tmp3_ = g_strsplit (_tmp2_, " ", 0);
	_tmp5_ = _tmp4_;
	_tmp5__length1 = _vala_array_length (_tmp3_);
	_g_free0 (_tmp2_);
	iconinfo = _tmp5_;
	iconinfo_length1 = _tmp5__length1;
	_iconinfo_size_ = iconinfo_length1;
	_tmp7_ = iconinfo;
	_tmp7__length1 = iconinfo_length1;
	if (_tmp7__length1 >= 3) {
		gchar** _tmp8_;
		gint _tmp8__length1;
		const gchar* _tmp9_;
		gchar* _tmp10_;
		const gchar* _tmp11_;
		_tmp8_ = iconinfo;
		_tmp8__length1 = iconinfo_length1;
		_tmp9_ = _tmp8_[2];
		_tmp10_ = g_strdup (_tmp9_);
		_g_free0 (found_icon);
		found_icon = _tmp10_;
		_tmp11_ = found_icon;
		_tmp6_ = _tmp11_;
	} else {
		gchar** _tmp12_;
		gint _tmp12__length1;
		const gchar* _tmp13_;
		gchar* _tmp14_;
		const gchar* _tmp15_;
		_tmp12_ = iconinfo;
		_tmp12__length1 = iconinfo_length1;
		_tmp13_ = _tmp12_[0];
		_tmp14_ = g_strdup (_tmp13_);
		_g_free0 (found_icon);
		found_icon = _tmp14_;
		_tmp15_ = found_icon;
		_tmp6_ = _tmp15_;
	}
	result = found_icon;
	iconinfo = (_vala_array_free (iconinfo, iconinfo_length1, (GDestroyNotify) g_free), NULL);
	return result;
}

static void
_budgie_after_shot_window_save_customdir_gtk_dialog_response (GtkDialog* _sender,
                                                              gint response_id,
                                                              gpointer self)
{
	budgie_after_shot_window_save_customdir ((BudgieAfterShotWindow*) self, _sender, response_id);
}

static void
budgie_after_shot_window_get_customdir (BudgieAfterShotWindow* self)
{
	GtkFileChooserDialog* dialog = NULL;
	GtkFileChooserDialog* _tmp0_;
	g_return_if_fail (self != NULL);
	gtk_widget_hide ((GtkWidget*) self);
	_tmp0_ = (GtkFileChooserDialog*) gtk_file_chooser_dialog_new (_ ("Open Folder"), (GtkWindow*) self, GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, _ ("Cancel"), GTK_RESPONSE_CANCEL, _ ("Open"), GTK_RESPONSE_ACCEPT, NULL, NULL);
	g_object_ref_sink (_tmp0_);
	dialog = _tmp0_;
	gtk_window_set_modal ((GtkWindow*) dialog, TRUE);
	gtk_window_set_transient_for ((GtkWindow*) dialog, (GtkWindow*) self);
	g_signal_connect_object ((GtkDialog*) dialog, "response", (GCallback) _budgie_after_shot_window_save_customdir_gtk_dialog_response, self, 0);
	gtk_widget_show ((GtkWidget*) dialog);
	_g_object_unref0 (dialog);
}

static void
budgie_after_shot_window_item_changed (BudgieAfterShotWindow* self,
                                       GtkComboBox* combo)
{
	gint new_selection = 0;
	GtkButton* savebutton = NULL;
	GtkButton** _tmp6_;
	gint _tmp6__length1;
	GtkButton* _tmp7_;
	GtkButton* _tmp8_;
	GtkButton* _tmp9_;
	GtkButton* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gboolean _tmp13_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (combo != NULL);
	new_selection = gtk_combo_box_get_active (combo);
	if (new_selection <= self->priv->counted_dirs) {
		BudgieCurrentState* _tmp0_;
		GSettings* _tmp1_;
		GSettings* _tmp2_;
		BudgieCurrentState* _tmp3_;
		GSettings* _tmp4_;
		GSettings* _tmp5_;
		_tmp0_ = self->priv->windowstate;
		_tmp1_ = budgie_current_state_get_screenshot_settings (_tmp0_);
		_tmp2_ = _tmp1_;
		g_settings_set_int (_tmp2_, "last-save-directory", new_selection);
		_tmp3_ = self->priv->windowstate;
		_tmp4_ = budgie_current_state_get_screenshot_settings (_tmp3_);
		_tmp5_ = _tmp4_;
		g_settings_set_string (_tmp5_, "last-save-directory-path", "");
	}
	_tmp6_ = self->priv->decisionbuttons;
	_tmp6__length1 = self->priv->decisionbuttons_length1;
	_tmp7_ = _tmp6_[1];
	_tmp8_ = _g_object_ref0 (_tmp7_);
	savebutton = _tmp8_;
	_tmp9_ = savebutton;
	budgie_after_shot_window_set_buttoncontent (self, _tmp9_, "save-shot-symbolic");
	_tmp10_ = savebutton;
	gtk_widget_set_has_tooltip ((GtkWidget*) _tmp10_, FALSE);
	_tmp11_ = budgie_after_shot_window_get_path_fromcombo (self, combo);
	_tmp12_ = _tmp11_;
	_tmp13_ = _tmp12_ == NULL;
	_g_free0 (_tmp12_);
	if (_tmp13_) {
		budgie_after_shot_window_get_customdir (self);
	} else {
		self->priv->custompath_row = (_vala_array_free (self->priv->custompath_row, self->priv->custompath_row_length1, (GDestroyNotify) g_free), NULL);
		self->priv->custompath_row = NULL;
		self->priv->custompath_row_length1 = 0;
		self->priv->_custompath_row_size_ = self->priv->custompath_row_length1;
	}
	_g_object_unref0 (savebutton);
}

static void
budgie_after_shot_window_class_init (BudgieAfterShotWindowClass * klass,
                                     gpointer klass_data)
{
	budgie_after_shot_window_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BudgieAfterShotWindow_private_offset);
	G_OBJECT_CLASS (klass)->finalize = budgie_after_shot_window_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/buddiesofbudgie/Screenshot/aftershot.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "filenameentry", FALSE, BudgieAfterShotWindow_private_offset + G_STRUCT_OFFSET (BudgieAfterShotWindowPrivate, filenameentry));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "pickdir_combo", FALSE, BudgieAfterShotWindow_private_offset + G_STRUCT_OFFSET (BudgieAfterShotWindowPrivate, pickdir_combo));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "dir_liststore", FALSE, BudgieAfterShotWindow_private_offset + G_STRUCT_OFFSET (BudgieAfterShotWindowPrivate, dir_liststore));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "img", FALSE, BudgieAfterShotWindow_private_offset + G_STRUCT_OFFSET (BudgieAfterShotWindowPrivate, img));
}

static void
budgie_after_shot_window_instance_init (BudgieAfterShotWindow * self,
                                        gpointer klass)
{
	gchar** _tmp0_;
	GtkButton** _tmp1_;
	self->priv = budgie_after_shot_window_get_instance_private (self);
	self->priv->act_ondropdown = TRUE;
	self->priv->custompath_row = NULL;
	self->priv->custompath_row_length1 = 0;
	self->priv->_custompath_row_size_ = self->priv->custompath_row_length1;
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	self->priv->alldirs = _tmp0_;
	self->priv->alldirs_length1 = 0;
	self->priv->_alldirs_size_ = self->priv->alldirs_length1;
	_tmp1_ = g_new0 (GtkButton*, 0 + 1);
	self->priv->decisionbuttons = _tmp1_;
	self->priv->decisionbuttons_length1 = 0;
	self->priv->_decisionbuttons_size_ = self->priv->decisionbuttons_length1;
	self->priv->button_id = NULL;
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
budgie_after_shot_window_finalize (GObject * obj)
{
	BudgieAfterShotWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BUDGIE_TYPE_AFTER_SHOT_WINDOW, BudgieAfterShotWindow);
	_g_object_unref0 (self->priv->monitor);
	self->priv->custompath_row = (_vala_array_free (self->priv->custompath_row, self->priv->custompath_row_length1, (GDestroyNotify) g_free), NULL);
	self->priv->alldirs = (_vala_array_free (self->priv->alldirs, self->priv->alldirs_length1, (GDestroyNotify) g_free), NULL);
	self->priv->decisionbuttons = (_vala_array_free (self->priv->decisionbuttons, self->priv->decisionbuttons_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_free0 (self->priv->extension);
	_g_object_unref0 (self->priv->windowstate);
	_g_free0 (self->priv->button_id);
	G_OBJECT_CLASS (budgie_after_shot_window_parent_class)->finalize (obj);
}

static GType
budgie_after_shot_window_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BudgieAfterShotWindowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) budgie_after_shot_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BudgieAfterShotWindow), 0, (GInstanceInitFunc) budgie_after_shot_window_instance_init, NULL };
	GType budgie_after_shot_window_type_id;
	budgie_after_shot_window_type_id = g_type_register_static (gtk_window_get_type (), "BudgieAfterShotWindow", &g_define_type_info, 0);
	BudgieAfterShotWindow_private_offset = g_type_add_instance_private (budgie_after_shot_window_type_id, sizeof (BudgieAfterShotWindowPrivate));
	return budgie_after_shot_window_type_id;
}

GType
budgie_after_shot_window_get_type (void)
{
	static volatile gsize budgie_after_shot_window_type_id__once = 0;
	if (g_once_init_enter (&budgie_after_shot_window_type_id__once)) {
		GType budgie_after_shot_window_type_id;
		budgie_after_shot_window_type_id = budgie_after_shot_window_get_type_once ();
		g_once_init_leave (&budgie_after_shot_window_type_id__once, budgie_after_shot_window_type_id);
	}
	return budgie_after_shot_window_type_id__once;
}

gint
budgie_get_scaling (void)
{
	BudgieWaylandClient* wayland_client = NULL;
	BudgieWaylandClient* _tmp0_;
	BudgieWaylandClient* _tmp1_;
	BudgieWaylandClient* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	gint result;
	_tmp0_ = budgie_wayland_client_new ();
	wayland_client = _tmp0_;
	_tmp1_ = wayland_client;
	if (!budgie_wayland_client_is_initialised (_tmp1_)) {
		g_warning ("screenshot.vala:1324: WaylandClient not initialized, using default sca" \
"le of 1");
		result = 1;
		_g_object_unref0 (wayland_client);
		return result;
	}
	_tmp2_ = wayland_client;
	_tmp3_ = budgie_wayland_client_get_scale (_tmp2_);
	_tmp4_ = _tmp3_;
	result = _tmp4_;
	_g_object_unref0 (wayland_client);
	return result;
}

gint
budgie_find_stringindex (const gchar* str,
                         gchar** arr,
                         gint arr_length1)
{
	gint result;
	g_return_val_if_fail (str != NULL, 0);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				const gchar* _tmp2_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				if (!(i < arr_length1)) {
					break;
				}
				_tmp2_ = arr[i];
				if (g_strcmp0 (str, _tmp2_) == 0) {
					result = i;
					return result;
				}
			}
		}
	}
	result = -1;
	return result;
}

static void
___lambda30_ (void)
{
	g_debug ("screenshot.vala:1357: WaylandClient ready, setting up D-Bus");
	budgie_setup_dbus ();
}

static void
____lambda30__budgie_wayland_client_initialized (BudgieWaylandClient* _sender,
                                                 gpointer self)
{
	___lambda30_ ();
}

static void
___lambda31_ (void)
{
	g_critical ("screenshot.vala:1362: WaylandClient initialization failed, exiting");
	gtk_main_quit ();
}

static void
____lambda31__budgie_wayland_client_initialization_failed (BudgieWaylandClient* _sender,
                                                           gpointer self)
{
	___lambda31_ ();
}

static gint
budgie_main (gchar** args,
             gint args_length1)
{
	BudgieWaylandClient* client = NULL;
	BudgieWaylandClient* _tmp0_;
	BudgieWaylandClient* _tmp1_;
	gint result;
	gtk_init ((gint*) (&args_length1), &args);
	setlocale (LC_ALL, "");
	bindtextdomain (BUDGIE_GETTEXT_PACKAGE, BUDGIE_LOCALEDIR);
	bind_textdomain_codeset (BUDGIE_GETTEXT_PACKAGE, "UTF-8");
	textdomain (BUDGIE_GETTEXT_PACKAGE);
	_tmp0_ = budgie_wayland_client_new ();
	client = _tmp0_;
	_tmp1_ = client;
	if (budgie_wayland_client_is_initialised (_tmp1_)) {
		budgie_setup_dbus ();
	} else {
		BudgieWaylandClient* _tmp2_;
		BudgieWaylandClient* _tmp3_;
		_tmp2_ = client;
		g_signal_connect (_tmp2_, "initialized", (GCallback) ____lambda30__budgie_wayland_client_initialized, NULL);
		_tmp3_ = client;
		g_signal_connect (_tmp3_, "initialization-failed", (GCallback) ____lambda31__budgie_wayland_client_initialization_failed, NULL);
	}
	gtk_main ();
	result = 0;
	_g_object_unref0 (client);
	return result;
}

int
main (int argc,
      char ** argv)
{
	return budgie_main (argv, argc);
}

void
budgie_setup_dbus (void)
{
	BudgieScreenshotServer* screenshotcontrol = NULL;
	GError* _inner_error0_ = NULL;
	{
		BudgieScreenshotServer* _tmp0_;
		_tmp0_ = budgie_screenshot_server_new ();
		_g_object_unref0 (screenshotcontrol);
		screenshotcontrol = _tmp0_;
		budgie_screenshot_server_setup_dbus (screenshotcontrol, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp1_;
		const gchar* _tmp2_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp1_ = e;
		_tmp2_ = _tmp1_->message;
		g_warning ("screenshot.vala:1378: ScreenshotServer error: %s", _tmp2_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (screenshotcontrol);
		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 (screenshotcontrol);
}

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);
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

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

