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

/*-
 * Copyright 2015-2022 elementary, Inc. (https://elementary.io)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 * Authored by: Erasmo Marín
 *
 */

#include "desktop.h"
#include <gio/gio.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <float.h>
#include <math.h>
#include <gdk/gdk.h>
#include <cairo-gobject.h>
#include <gexiv2/gexiv2.h>
#include <glib/gi18n-lib.h>
#include <glib-object.h>
#include <granite-7.h>

#define PANTHEON_SHELL_WALLPAPER_CONTAINER_TOUCH_TARGET_WIDTH 44
#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

enum  {
	PANTHEON_SHELL_WALLPAPER_CONTAINER_0_PROPERTY,
	PANTHEON_SHELL_WALLPAPER_CONTAINER_URI_PROPERTY,
	PANTHEON_SHELL_WALLPAPER_CONTAINER_CHECKED_PROPERTY,
	PANTHEON_SHELL_WALLPAPER_CONTAINER_NUM_PROPERTIES
};
static GParamSpec* pantheon_shell_wallpaper_container_properties[PANTHEON_SHELL_WALLPAPER_CONTAINER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _gdk_event_unref0(var) ((var == NULL) ? NULL : (var = (gdk_event_unref (var), NULL)))
#define __vala_GdkEventSequence_free0(var) ((var == NULL) ? NULL : (var = (_vala_GdkEventSequence_free (var), NULL)))
#define _pantheon_shell_thumbnail_generator_unref0(var) ((var == NULL) ? NULL : (var = (pantheon_shell_thumbnail_generator_unref (var), NULL)))
typedef struct _PantheonShellWallpaperContainerUpdateThumbData PantheonShellWallpaperContainerUpdateThumbData;
enum  {
	PANTHEON_SHELL_WALLPAPER_CONTAINER_TRASH_SIGNAL,
	PANTHEON_SHELL_WALLPAPER_CONTAINER_NUM_SIGNALS
};
static guint pantheon_shell_wallpaper_container_signals[PANTHEON_SHELL_WALLPAPER_CONTAINER_NUM_SIGNALS] = {0};

struct _PantheonShellWallpaperContainerPrivate {
	GMenu* menu_model;
	GSimpleAction* remove_wallpaper_action;
	GtkRevealer* check_revealer;
	GtkEventControllerKey* menu_key_controller;
	GtkGestureClick* click_controller;
	GtkGestureLongPress* long_press_controller;
	GtkPopoverMenu* context_menu;
	gchar* thumb_path;
	gchar* _uri;
};

struct _PantheonShellWallpaperContainerUpdateThumbData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PantheonShellWallpaperContainer* self;
	const gchar* _tmp0_;
	GtkPicture* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* path;
	gchar* _tmp4_;
	GExiv2Metadata* metadata;
	gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	GExiv2Metadata* _tmp9_;
	GExiv2Metadata* _tmp10_;
	const gchar* _tmp11_;
	GError* e;
	const gchar* _tmp12_;
	GError* _tmp13_;
	const gchar* _tmp14_;
	GExiv2Metadata* _tmp15_;
	gchar* artist_name;
	GExiv2Metadata* _tmp16_;
	gchar* _tmp17_;
	const gchar* _tmp18_;
	const gchar* _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	GError* _vala1_e;
	GError* _tmp22_;
	const gchar* _tmp23_;
	GError* _inner_error0_;
};

static gint PantheonShellWallpaperContainer_private_offset;
static gpointer pantheon_shell_wallpaper_container_parent_class = NULL;

static void pantheon_shell_wallpaper_container_construct_from_uri (PantheonShellWallpaperContainer* self);
static void pantheon_shell_wallpaper_container_update_thumb (PantheonShellWallpaperContainer* self,
                                                      GAsyncReadyCallback _callback_,
                                                      gpointer _user_data_);
static void pantheon_shell_wallpaper_container_update_thumb_finish (PantheonShellWallpaperContainer* self,
                                                             GAsyncResult* _res_);
static void pantheon_shell_wallpaper_container_generate_and_load_thumb (PantheonShellWallpaperContainer* self);
static void __lambda7_ (PantheonShellWallpaperContainer* self,
                 gint n_press,
                 gdouble x,
                 gdouble y);
static void pantheon_shell_wallpaper_container_menu_popup_at_pointer (PantheonShellWallpaperContainer* self,
                                                               GtkPopoverMenu* popover,
                                                               gdouble x,
                                                               gdouble y);
static void _vala_GdkEventSequence_free (GdkEventSequence* self);
static void ___lambda7__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                            gint n_press,
                                            gdouble x,
                                            gdouble y,
                                            gpointer self);
static void __lambda8_ (PantheonShellWallpaperContainer* self,
                 gdouble x,
                 gdouble y);
static void ___lambda8__gtk_gesture_long_press_pressed (GtkGestureLongPress* _sender,
                                                 gdouble x,
                                                 gdouble y,
                                                 gpointer self);
static void __lambda9_ (PantheonShellWallpaperContainer* self,
                 guint keyval,
                 guint keycode,
                 GdkModifierType state);
static void pantheon_shell_wallpaper_container_menu_popup_on_keypress (PantheonShellWallpaperContainer* self,
                                                                GtkPopoverMenu* popover);
static void ___lambda9__gtk_event_controller_key_key_released (GtkEventControllerKey* _sender,
                                                        guint keyval,
                                                        guint keycode,
                                                        GdkModifierType state,
                                                        gpointer self);
static void __lambda6_ (PantheonShellWallpaperContainer* self);
static void ___lambda6__pantheon_shell_thumbnail_generator_thumbnail_ready (gpointer self);
static void pantheon_shell_wallpaper_container_update_thumb_data_free (gpointer _data);
static gboolean pantheon_shell_wallpaper_container_update_thumb_co (PantheonShellWallpaperContainerUpdateThumbData* _data_);
static GObject * pantheon_shell_wallpaper_container_constructor (GType type,
                                                          guint n_construct_properties,
                                                          GObjectConstructParam * construct_properties);
static void _pantheon_shell_wallpaper_container___lambda10_ (PantheonShellWallpaperContainer* self);
static void __pantheon_shell_wallpaper_container___lambda10__g_simple_action_activate (GSimpleAction* _sender,
                                                                                GVariant* parameter,
                                                                                gpointer self);
static void _pantheon_shell_wallpaper_container_construct_from_uri_g_object_notify (GObject* _sender,
                                                                             GParamSpec* pspec,
                                                                             gpointer self);
static void pantheon_shell_wallpaper_container_finalize (GObject * obj);
static GType pantheon_shell_wallpaper_container_get_type_once (void);
static void _vala_pantheon_shell_wallpaper_container_get_property (GObject * object,
                                                            guint property_id,
                                                            GValue * value,
                                                            GParamSpec * pspec);
static void _vala_pantheon_shell_wallpaper_container_set_property (GObject * object,
                                                            guint property_id,
                                                            const GValue * value,
                                                            GParamSpec * pspec);

static inline gpointer
pantheon_shell_wallpaper_container_get_instance_private (PantheonShellWallpaperContainer* self)
{
	return G_STRUCT_MEMBER_P (self, PantheonShellWallpaperContainer_private_offset);
}

static gpointer
_gdk_event_ref0 (gpointer self)
{
	return self ? gdk_event_ref (self) : NULL;
}

static void
_vala_GdkEventSequence_free (GdkEventSequence* self)
{
	g_boxed_free (gdk_event_sequence_get_type (), self);
}

static void
__lambda7_ (PantheonShellWallpaperContainer* self,
            gint n_press,
            gdouble x,
            gdouble y)
{
	GdkEventSequence* sequence = NULL;
	GtkGestureClick* _tmp0_;
	GdkEventSequence* _tmp1_;
	GdkEvent* event = NULL;
	GtkGestureClick* _tmp2_;
	GdkEventSequence* _tmp3_;
	GdkEvent* _tmp4_;
	GdkEvent* _tmp5_;
	GdkEvent* _tmp6_;
	_tmp0_ = self->priv->click_controller;
	_tmp1_ = gtk_gesture_single_get_current_sequence ((GtkGestureSingle*) _tmp0_);
	sequence = _tmp1_;
	_tmp2_ = self->priv->click_controller;
	_tmp3_ = sequence;
	_tmp4_ = gtk_gesture_get_last_event ((GtkGesture*) _tmp2_, _tmp3_);
	_tmp5_ = _gdk_event_ref0 (_tmp4_);
	event = _tmp5_;
	_tmp6_ = event;
	if (gdk_event_triggers_context_menu (_tmp6_)) {
		GtkPopoverMenu* _tmp7_;
		GtkPopoverMenu* _tmp8_;
		GtkGestureClick* _tmp9_;
		GtkGestureClick* _tmp10_;
		_tmp7_ = self->priv->context_menu;
		gtk_widget_set_halign ((GtkWidget*) _tmp7_, GTK_ALIGN_START);
		_tmp8_ = self->priv->context_menu;
		pantheon_shell_wallpaper_container_menu_popup_at_pointer (self, _tmp8_, x, y);
		_tmp9_ = self->priv->click_controller;
		gtk_gesture_set_state ((GtkGesture*) _tmp9_, GTK_EVENT_SEQUENCE_CLAIMED);
		_tmp10_ = self->priv->click_controller;
		gtk_event_controller_reset ((GtkEventController*) _tmp10_);
	}
	_gdk_event_unref0 (event);
	__vala_GdkEventSequence_free0 (sequence);
}

static void
___lambda7__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                       gint n_press,
                                       gdouble x,
                                       gdouble y,
                                       gpointer self)
{
	__lambda7_ ((PantheonShellWallpaperContainer*) self, n_press, x, y);
}

static void
__lambda8_ (PantheonShellWallpaperContainer* self,
            gdouble x,
            gdouble y)
{
	GtkRoot* _tmp0_;
	GtkPopoverMenu* _tmp3_;
	_tmp0_ = gtk_widget_get_root ((GtkWidget*) self);
	if (x > ((gdouble) (gtk_widget_get_width ((GtkWidget*) _tmp0_) / 2))) {
		GtkPopoverMenu* _tmp1_;
		_tmp1_ = self->priv->context_menu;
		gtk_widget_set_halign ((GtkWidget*) _tmp1_, GTK_ALIGN_END);
		x = x - PANTHEON_SHELL_WALLPAPER_CONTAINER_TOUCH_TARGET_WIDTH;
	} else {
		GtkPopoverMenu* _tmp2_;
		_tmp2_ = self->priv->context_menu;
		gtk_widget_set_halign ((GtkWidget*) _tmp2_, GTK_ALIGN_START);
		x = x + PANTHEON_SHELL_WALLPAPER_CONTAINER_TOUCH_TARGET_WIDTH;
	}
	_tmp3_ = self->priv->context_menu;
	pantheon_shell_wallpaper_container_menu_popup_at_pointer (self, _tmp3_, x, y - (PANTHEON_SHELL_WALLPAPER_CONTAINER_TOUCH_TARGET_WIDTH * 0.75));
}

static void
___lambda8__gtk_gesture_long_press_pressed (GtkGestureLongPress* _sender,
                                            gdouble x,
                                            gdouble y,
                                            gpointer self)
{
	__lambda8_ ((PantheonShellWallpaperContainer*) self, x, y);
}

static void
__lambda9_ (PantheonShellWallpaperContainer* self,
            guint keyval,
            guint keycode,
            GdkModifierType state)
{
	GdkModifierType mods = 0U;
	mods = state & gtk_accelerator_get_default_mod_mask ();
	switch (keyval) {
		case GDK_KEY_F10:
		{
			if (mods == GDK_SHIFT_MASK) {
				GtkPopoverMenu* _tmp0_;
				_tmp0_ = self->priv->context_menu;
				pantheon_shell_wallpaper_container_menu_popup_on_keypress (self, _tmp0_);
			}
			break;
		}
		case GDK_KEY_Menu:
		case GDK_KEY_MenuKB:
		{
			GtkPopoverMenu* _tmp1_;
			_tmp1_ = self->priv->context_menu;
			pantheon_shell_wallpaper_container_menu_popup_on_keypress (self, _tmp1_);
			break;
		}
		default:
		{
			return;
		}
	}
}

static void
___lambda9__gtk_event_controller_key_key_released (GtkEventControllerKey* _sender,
                                                   guint keyval,
                                                   guint keycode,
                                                   GdkModifierType state,
                                                   gpointer self)
{
	__lambda9_ ((PantheonShellWallpaperContainer*) self, keyval, keycode, state);
}

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

static void
pantheon_shell_wallpaper_container_construct_from_uri (PantheonShellWallpaperContainer* self)
{
	const gchar* _tmp0_;
	GFile* file = NULL;
	const gchar* _tmp5_;
	GFile* _tmp6_;
	GMenu* _tmp19_;
	GtkPopoverMenu* _tmp20_ = NULL;
	GtkPopoverMenu* _tmp21_;
	GtkGestureClick* _tmp22_ = NULL;
	GtkGestureClick* _tmp23_;
	GtkGestureLongPress* _tmp24_ = NULL;
	GtkGestureLongPress* _tmp25_;
	GtkEventControllerKey* _tmp26_;
	GtkEventControllerKey* _tmp27_;
	GtkGestureClick* _tmp28_;
	GtkEventController* _tmp29_;
	GtkGestureLongPress* _tmp30_;
	GtkEventController* _tmp31_;
	GtkEventControllerKey* _tmp32_;
	GtkEventController* _tmp33_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_uri;
	if (_tmp0_ == NULL) {
		GtkGestureClick* _tmp1_;
		GtkGestureLongPress* _tmp2_;
		GtkEventControllerKey* _tmp3_;
		GtkPopoverMenu* _tmp4_;
		_tmp1_ = self->priv->click_controller;
		gtk_widget_remove_controller ((GtkWidget*) self, (GtkEventController*) _tmp1_);
		_tmp2_ = self->priv->long_press_controller;
		gtk_widget_remove_controller ((GtkWidget*) self, (GtkEventController*) _tmp2_);
		_tmp3_ = self->priv->menu_key_controller;
		gtk_widget_remove_controller ((GtkWidget*) self, (GtkEventController*) _tmp3_);
		_g_object_unref0 (self->priv->click_controller);
		self->priv->click_controller = NULL;
		_g_object_unref0 (self->priv->long_press_controller);
		self->priv->long_press_controller = NULL;
		_g_object_unref0 (self->priv->menu_key_controller);
		self->priv->menu_key_controller = NULL;
		_tmp4_ = self->priv->context_menu;
		gtk_widget_unparent ((GtkWidget*) _tmp4_);
		_g_object_unref0 (self->priv->context_menu);
		self->priv->context_menu = NULL;
		return;
	}
	_tmp5_ = self->priv->_uri;
	_tmp6_ = g_file_new_for_uri (_tmp5_);
	file = _tmp6_;
	{
		GFileInfo* info = NULL;
		GFile* _tmp7_;
		GFileInfo* _tmp8_;
		GFileInfo* _tmp9_;
		gchar* _tmp10_;
		gboolean _tmp11_ = FALSE;
		const gchar* _tmp12_;
		GFileInfo* _tmp14_;
		GSimpleAction* _tmp15_;
		GFileInfo* _tmp16_;
		_tmp7_ = file;
		_tmp8_ = g_file_query_info (_tmp7_, "*", G_FILE_QUERY_INFO_NONE, NULL, &_inner_error0_);
		info = _tmp8_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp9_ = info;
		_tmp10_ = g_file_info_get_attribute_as_string (_tmp9_, G_FILE_ATTRIBUTE_THUMBNAIL_PATH);
		_g_free0 (self->priv->thumb_path);
		self->priv->thumb_path = _tmp10_;
		_tmp12_ = self->priv->thumb_path;
		if (_tmp12_ != NULL) {
			GFileInfo* _tmp13_;
			_tmp13_ = info;
			_tmp11_ = g_file_info_get_attribute_boolean (_tmp13_, G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID);
		} else {
			_tmp11_ = FALSE;
		}
		if (_tmp11_) {
			pantheon_shell_wallpaper_container_update_thumb (self, NULL, NULL);
		} else {
			pantheon_shell_wallpaper_container_generate_and_load_thumb (self);
		}
		_tmp14_ = info;
		self->creation_date = g_file_info_get_attribute_uint64 (_tmp14_, G_FILE_ATTRIBUTE_TIME_CREATED);
		_tmp15_ = self->priv->remove_wallpaper_action;
		_tmp16_ = info;
		g_simple_action_set_enabled (_tmp15_, g_file_info_get_attribute_boolean (_tmp16_, G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE));
		_g_object_unref0 (info);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp17_;
		const gchar* _tmp18_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp17_ = e;
		_tmp18_ = _tmp17_->message;
		g_critical ("WallpaperContainer.vala:137: %s", _tmp18_);
		_g_error_free0 (e);
	}
	__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;
	}
	_tmp19_ = self->priv->menu_model;
	_tmp20_ = (GtkPopoverMenu*) gtk_popover_menu_new_from_model ((GMenuModel*) _tmp19_);
	gtk_widget_set_halign ((GtkWidget*) _tmp20_, GTK_ALIGN_START);
	gtk_popover_set_has_arrow ((GtkPopover*) _tmp20_, FALSE);
	g_object_ref_sink (_tmp20_);
	_g_object_unref0 (self->priv->context_menu);
	self->priv->context_menu = _tmp20_;
	_tmp21_ = self->priv->context_menu;
	gtk_widget_set_parent ((GtkWidget*) _tmp21_, (GtkWidget*) self);
	_tmp22_ = (GtkGestureClick*) gtk_gesture_click_new ();
	gtk_gesture_single_set_button ((GtkGestureSingle*) _tmp22_, (guint) 0);
	gtk_gesture_single_set_exclusive ((GtkGestureSingle*) _tmp22_, TRUE);
	_g_object_unref0 (self->priv->click_controller);
	self->priv->click_controller = _tmp22_;
	_tmp23_ = self->priv->click_controller;
	g_signal_connect_object (_tmp23_, "pressed", (GCallback) ___lambda7__gtk_gesture_click_pressed, self, 0);
	_tmp24_ = (GtkGestureLongPress*) gtk_gesture_long_press_new ();
	gtk_gesture_single_set_touch_only ((GtkGestureSingle*) _tmp24_, TRUE);
	_g_object_unref0 (self->priv->long_press_controller);
	self->priv->long_press_controller = _tmp24_;
	_tmp25_ = self->priv->long_press_controller;
	g_signal_connect_object (_tmp25_, "pressed", (GCallback) ___lambda8__gtk_gesture_long_press_pressed, self, 0);
	_tmp26_ = (GtkEventControllerKey*) gtk_event_controller_key_new ();
	_g_object_unref0 (self->priv->menu_key_controller);
	self->priv->menu_key_controller = _tmp26_;
	_tmp27_ = self->priv->menu_key_controller;
	g_signal_connect_object (_tmp27_, "key-released", (GCallback) ___lambda9__gtk_event_controller_key_key_released, self, 0);
	_tmp28_ = self->priv->click_controller;
	_tmp29_ = _g_object_ref0 ((GtkEventController*) _tmp28_);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp29_);
	_tmp30_ = self->priv->long_press_controller;
	_tmp31_ = _g_object_ref0 ((GtkEventController*) _tmp30_);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp31_);
	_tmp32_ = self->priv->menu_key_controller;
	_tmp33_ = _g_object_ref0 ((GtkEventController*) _tmp32_);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp33_);
	_g_object_unref0 (file);
}

static void
pantheon_shell_wallpaper_container_menu_popup_on_keypress (PantheonShellWallpaperContainer* self,
                                                           GtkPopoverMenu* popover)
{
	GdkRectangle _tmp0_ = {0};
	g_return_if_fail (self != NULL);
	g_return_if_fail (popover != NULL);
	gtk_widget_set_halign ((GtkWidget*) popover, GTK_ALIGN_END);
	memset (&_tmp0_, 0, sizeof (GdkRectangle));
	_tmp0_.x = (gint) gtk_widget_get_width ((GtkWidget*) self);
	_tmp0_.y = ((gint) gtk_widget_get_height ((GtkWidget*) self)) / 2;
	gtk_popover_set_pointing_to ((GtkPopover*) popover, &_tmp0_);
	gtk_popover_popup ((GtkPopover*) popover);
}

static void
pantheon_shell_wallpaper_container_menu_popup_at_pointer (PantheonShellWallpaperContainer* self,
                                                          GtkPopoverMenu* popover,
                                                          gdouble x,
                                                          gdouble y)
{
	GdkRectangle rect = {0};
	GdkRectangle _tmp0_ = {0};
	GdkRectangle _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (popover != NULL);
	memset (&_tmp0_, 0, sizeof (GdkRectangle));
	_tmp0_.x = (gint) x;
	_tmp0_.y = (gint) y;
	rect = _tmp0_;
	_tmp1_ = rect;
	g_object_set ((GtkPopover*) popover, "pointing-to", &_tmp1_, NULL);
	gtk_popover_popup ((GtkPopover*) popover);
}

static void
__lambda6_ (PantheonShellWallpaperContainer* self)
{
	GError* _inner_error0_ = NULL;
	{
		GFile* file = NULL;
		const gchar* _tmp0_;
		GFile* _tmp1_;
		GFileInfo* info = NULL;
		GFileInfo* _tmp2_;
		gchar* _tmp3_;
		_tmp0_ = self->priv->_uri;
		_tmp1_ = g_file_new_for_uri (_tmp0_);
		file = _tmp1_;
		_tmp2_ = g_file_query_info (file, G_FILE_ATTRIBUTE_THUMBNAIL_PATH "," G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID, 0, NULL, &_inner_error0_);
		info = _tmp2_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (file);
			goto __catch0_g_error;
		}
		_tmp3_ = g_file_info_get_attribute_as_string (info, G_FILE_ATTRIBUTE_THUMBNAIL_PATH);
		_g_free0 (self->priv->thumb_path);
		self->priv->thumb_path = _tmp3_;
		pantheon_shell_wallpaper_container_update_thumb (self, NULL, NULL);
		_g_object_unref0 (info);
		_g_object_unref0 (file);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		const gchar* _tmp4_;
		GError* _tmp5_;
		const gchar* _tmp6_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp4_ = self->priv->_uri;
		_tmp5_ = e;
		_tmp6_ = _tmp5_->message;
		g_warning ("WallpaperContainer.vala:228: Error loading thumbnail for '%s': %s", _tmp4_, _tmp6_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
___lambda6__pantheon_shell_thumbnail_generator_thumbnail_ready (gpointer self)
{
	__lambda6_ ((PantheonShellWallpaperContainer*) self);
}

static void
pantheon_shell_wallpaper_container_generate_and_load_thumb (PantheonShellWallpaperContainer* self)
{
	PantheonShellThumbnailGenerator* _tmp0_;
	PantheonShellThumbnailGenerator* _tmp1_;
	const gchar* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = pantheon_shell_thumbnail_generator_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->_uri;
	_tmp3_ = gtk_widget_get_scale_factor ((GtkWidget*) self);
	_tmp4_ = _tmp3_;
	pantheon_shell_thumbnail_generator_get_thumbnail (_tmp1_, _tmp2_, (guint) (PANTHEON_SHELL_WALLPAPER_CONTAINER_THUMB_WIDTH * _tmp4_), ___lambda6__pantheon_shell_thumbnail_generator_thumbnail_ready, self);
	_pantheon_shell_thumbnail_generator_unref0 (_tmp1_);
}

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

static void
pantheon_shell_wallpaper_container_update_thumb (PantheonShellWallpaperContainer* self,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_)
{
	PantheonShellWallpaperContainerUpdateThumbData* _data_;
	PantheonShellWallpaperContainer* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (PantheonShellWallpaperContainerUpdateThumbData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pantheon_shell_wallpaper_container_update_thumb_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	pantheon_shell_wallpaper_container_update_thumb_co (_data_);
}

static void
pantheon_shell_wallpaper_container_update_thumb_finish (PantheonShellWallpaperContainer* self,
                                                        GAsyncResult* _res_)
{
	PantheonShellWallpaperContainerUpdateThumbData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static gboolean
pantheon_shell_wallpaper_container_update_thumb_co (PantheonShellWallpaperContainerUpdateThumbData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->thumb_path;
	if (_data_->_tmp0_ == 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;
	}
	_data_->_tmp1_ = _data_->self->image;
	_data_->_tmp2_ = _data_->self->priv->thumb_path;
	gtk_picture_set_filename (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp3_ = _data_->self->priv->_uri;
	if (_data_->_tmp3_ != NULL) {
		_data_->_tmp4_ = g_strdup ("");
		_data_->path = _data_->_tmp4_;
		{
			_data_->_tmp6_ = _data_->self->priv->_uri;
			_data_->_tmp7_ = g_filename_from_uri (_data_->_tmp6_, NULL, &_data_->_inner_error0_);
			_data_->_tmp5_ = _data_->_tmp7_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_data_->_tmp8_ = _data_->_tmp5_;
			_data_->_tmp5_ = NULL;
			_g_free0 (_data_->path);
			_data_->path = _data_->_tmp8_;
			_data_->_tmp9_ = gexiv2_metadata_new ();
			_g_object_unref0 (_data_->metadata);
			_data_->metadata = _data_->_tmp9_;
			_data_->_tmp10_ = _data_->metadata;
			_data_->_tmp11_ = _data_->path;
			gexiv2_metadata_open_path (_data_->_tmp10_, _data_->_tmp11_, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_free0 (_data_->_tmp5_);
				goto __catch0_g_error;
			}
			_g_free0 (_data_->_tmp5_);
		}
		goto __finally0;
		__catch0_g_error:
		{
			_data_->e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp12_ = _data_->path;
			_data_->_tmp13_ = _data_->e;
			_data_->_tmp14_ = _data_->_tmp13_->message;
			g_warning ("WallpaperContainer.vala:248: Error parsing exif metadata of \"%s\": %s", _data_->_tmp12_, _data_->_tmp14_);
			_g_error_free0 (_data_->e);
			_g_object_unref0 (_data_->metadata);
			_g_free0 (_data_->path);
			g_task_return_pointer (_data_->_async_result, _data_, NULL);
			if (_data_->_state_ != 0) {
				while (!g_task_get_completed (_data_->_async_result)) {
					g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
				}
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->metadata);
			_g_free0 (_data_->path);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp15_ = _data_->metadata;
		if (gexiv2_metadata_has_exif (_data_->_tmp15_)) {
			{
				_data_->_tmp16_ = _data_->metadata;
				_data_->_tmp17_ = gexiv2_metadata_try_get_tag_string (_data_->_tmp16_, "Exif.Image.Artist", &_data_->_inner_error0_);
				_data_->artist_name = _data_->_tmp17_;
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					goto __catch1_g_error;
				}
				_data_->_tmp18_ = _data_->artist_name;
				if (_data_->_tmp18_ != NULL) {
					_data_->_tmp19_ = _data_->artist_name;
					_data_->_tmp20_ = g_strdup_printf (_ ("Artist: %s"), _data_->_tmp19_);
					_data_->_tmp21_ = _data_->_tmp20_;
					gtk_widget_set_tooltip_text ((GtkWidget*) _data_->self, _data_->_tmp21_);
					_g_free0 (_data_->_tmp21_);
				}
				_g_free0 (_data_->artist_name);
			}
			goto __finally1;
			__catch1_g_error:
			{
				_data_->_vala1_e = _data_->_inner_error0_;
				_data_->_inner_error0_ = NULL;
				_data_->_tmp22_ = _data_->_vala1_e;
				_data_->_tmp23_ = _data_->_tmp22_->message;
				g_critical ("WallpaperContainer.vala:259: Unable to set wallpaper artist name: %s", _data_->_tmp23_);
				_g_error_free0 (_data_->_vala1_e);
			}
			__finally1:
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_object_unref0 (_data_->metadata);
				_g_free0 (_data_->path);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
				g_clear_error (&_data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
		}
		_g_object_unref0 (_data_->metadata);
		_g_free0 (_data_->path);
	}
	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;
}

PantheonShellWallpaperContainer*
pantheon_shell_wallpaper_container_construct (GType object_type)
{
	PantheonShellWallpaperContainer * self = NULL;
	self = (PantheonShellWallpaperContainer*) granite_bin_construct (object_type);
	return self;
}

PantheonShellWallpaperContainer*
pantheon_shell_wallpaper_container_new (void)
{
	return pantheon_shell_wallpaper_container_construct (PANTHEON_SHELL_TYPE_WALLPAPER_CONTAINER);
}

const gchar*
pantheon_shell_wallpaper_container_get_uri (PantheonShellWallpaperContainer* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_uri;
	result = _tmp0_;
	return result;
}

void
pantheon_shell_wallpaper_container_set_uri (PantheonShellWallpaperContainer* self,
                                            const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = pantheon_shell_wallpaper_container_get_uri (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_uri);
		self->priv->_uri = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, pantheon_shell_wallpaper_container_properties[PANTHEON_SHELL_WALLPAPER_CONTAINER_URI_PROPERTY]);
	}
}

gboolean
pantheon_shell_wallpaper_container_get_checked (PantheonShellWallpaperContainer* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = (gtk_widget_get_state_flags ((GtkWidget*) self) & GTK_STATE_FLAG_CHECKED) == GTK_STATE_FLAG_CHECKED;
	return result;
}

void
pantheon_shell_wallpaper_container_set_checked (PantheonShellWallpaperContainer* self,
                                                gboolean value)
{
	g_return_if_fail (self != NULL);
	if (value) {
		GtkWidget* _tmp0_;
		GtkWidget* _tmp1_;
		GtkRevealer* _tmp2_;
		_tmp0_ = gtk_widget_get_parent ((GtkWidget*) self);
		_tmp1_ = _tmp0_;
		gtk_widget_set_state_flags (_tmp1_, GTK_STATE_FLAG_CHECKED, FALSE);
		_tmp2_ = self->priv->check_revealer;
		gtk_revealer_set_reveal_child (_tmp2_, TRUE);
	} else {
		GtkWidget* _tmp3_;
		GtkWidget* _tmp4_;
		GtkRevealer* _tmp5_;
		_tmp3_ = gtk_widget_get_parent ((GtkWidget*) self);
		_tmp4_ = _tmp3_;
		gtk_widget_unset_state_flags (_tmp4_, GTK_STATE_FLAG_CHECKED);
		_tmp5_ = self->priv->check_revealer;
		gtk_revealer_set_reveal_child (_tmp5_, FALSE);
	}
	gtk_widget_queue_draw ((GtkWidget*) self);
	g_object_notify_by_pspec ((GObject *) self, pantheon_shell_wallpaper_container_properties[PANTHEON_SHELL_WALLPAPER_CONTAINER_CHECKED_PROPERTY]);
}

static void
_pantheon_shell_wallpaper_container___lambda10_ (PantheonShellWallpaperContainer* self)
{
	g_signal_emit (self, pantheon_shell_wallpaper_container_signals[PANTHEON_SHELL_WALLPAPER_CONTAINER_TRASH_SIGNAL], 0);
}

static void
__pantheon_shell_wallpaper_container___lambda10__g_simple_action_activate (GSimpleAction* _sender,
                                                                           GVariant* parameter,
                                                                           gpointer self)
{
	_pantheon_shell_wallpaper_container___lambda10_ ((PantheonShellWallpaperContainer*) self);
}

static void
_pantheon_shell_wallpaper_container_construct_from_uri_g_object_notify (GObject* _sender,
                                                                        GParamSpec* pspec,
                                                                        gpointer self)
{
	pantheon_shell_wallpaper_container_construct_from_uri ((PantheonShellWallpaperContainer*) self);
}

static GObject *
pantheon_shell_wallpaper_container_constructor (GType type,
                                                guint n_construct_properties,
                                                GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	PantheonShellWallpaperContainer * self;
	GtkPicture* _tmp0_ = NULL;
	GtkPicture* _tmp1_;
	GtkCheckButton* check = NULL;
	GtkCheckButton* _tmp2_ = NULL;
	GtkCheckButton* _tmp3_;
	GtkWidget* _tmp4_;
	GtkRevealer* _tmp5_ = NULL;
	GtkOverlay* overlay = NULL;
	GtkPicture* _tmp6_;
	GtkWidget* _tmp7_;
	GtkOverlay* _tmp8_ = NULL;
	GtkOverlay* _tmp9_;
	GtkRevealer* _tmp10_;
	GtkOverlay* _tmp11_;
	GSimpleAction* _tmp12_;
	GSimpleAction* _tmp13_;
	GSimpleActionGroup* action_group = NULL;
	GSimpleActionGroup* _tmp14_;
	GSimpleActionGroup* _tmp15_;
	GSimpleAction* _tmp16_;
	GSimpleActionGroup* _tmp17_;
	GMenu* _tmp18_;
	GMenu* _tmp19_;
	parent_class = G_OBJECT_CLASS (pantheon_shell_wallpaper_container_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PANTHEON_SHELL_TYPE_WALLPAPER_CONTAINER, PantheonShellWallpaperContainer);
	_tmp0_ = (GtkPicture*) gtk_picture_new ();
	gtk_picture_set_content_fit (_tmp0_, GTK_CONTENT_FIT_COVER);
	g_object_set ((GtkWidget*) _tmp0_, "height-request", PANTHEON_SHELL_WALLPAPER_CONTAINER_THUMB_HEIGHT, NULL);
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->image);
	self->image = _tmp0_;
	_tmp1_ = self->image;
	gtk_widget_add_css_class ((GtkWidget*) _tmp1_, GRANITE_CSS_CLASS_CARD);
	_tmp2_ = (GtkCheckButton*) gtk_check_button_new ();
	gtk_check_button_set_active (_tmp2_, TRUE);
	gtk_widget_set_halign ((GtkWidget*) _tmp2_, GTK_ALIGN_START);
	gtk_widget_set_valign ((GtkWidget*) _tmp2_, GTK_ALIGN_START);
	gtk_widget_set_can_focus ((GtkWidget*) _tmp2_, FALSE);
	gtk_widget_set_can_target ((GtkWidget*) _tmp2_, FALSE);
	g_object_ref_sink (_tmp2_);
	check = _tmp2_;
	_tmp3_ = check;
	_tmp4_ = _g_object_ref0 ((GtkWidget*) _tmp3_);
	_tmp5_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_child (_tmp5_, _tmp4_);
	_g_object_unref0 (_tmp4_);
	gtk_revealer_set_transition_type (_tmp5_, GTK_REVEALER_TRANSITION_TYPE_CROSSFADE);
	g_object_ref_sink (_tmp5_);
	_g_object_unref0 (self->priv->check_revealer);
	self->priv->check_revealer = _tmp5_;
	_tmp6_ = self->image;
	_tmp7_ = _g_object_ref0 ((GtkWidget*) _tmp6_);
	_tmp8_ = (GtkOverlay*) gtk_overlay_new ();
	gtk_overlay_set_child (_tmp8_, _tmp7_);
	_g_object_unref0 (_tmp7_);
	g_object_ref_sink (_tmp8_);
	overlay = _tmp8_;
	_tmp9_ = overlay;
	_tmp10_ = self->priv->check_revealer;
	gtk_overlay_add_overlay (_tmp9_, (GtkWidget*) _tmp10_);
	gtk_widget_set_halign ((GtkWidget*) self, GTK_ALIGN_CENTER);
	gtk_widget_set_valign ((GtkWidget*) self, GTK_ALIGN_CENTER);
	gtk_widget_set_focusable ((GtkWidget*) self, TRUE);
	_tmp11_ = overlay;
	granite_bin_set_child ((GraniteBin*) self, (GtkWidget*) _tmp11_);
	_tmp12_ = g_simple_action_new ("trash", NULL);
	_g_object_unref0 (self->priv->remove_wallpaper_action);
	self->priv->remove_wallpaper_action = _tmp12_;
	_tmp13_ = self->priv->remove_wallpaper_action;
	g_signal_connect_object (_tmp13_, "activate", (GCallback) __pantheon_shell_wallpaper_container___lambda10__g_simple_action_activate, self, 0);
	_tmp14_ = g_simple_action_group_new ();
	action_group = _tmp14_;
	_tmp15_ = action_group;
	_tmp16_ = self->priv->remove_wallpaper_action;
	g_action_map_add_action ((GActionMap*) _tmp15_, (GAction*) _tmp16_);
	_tmp17_ = action_group;
	gtk_widget_insert_action_group ((GtkWidget*) self, "wallpaper", (GActionGroup*) _tmp17_);
	_tmp18_ = g_menu_new ();
	_g_object_unref0 (self->priv->menu_model);
	self->priv->menu_model = _tmp18_;
	_tmp19_ = self->priv->menu_model;
	g_menu_append (_tmp19_, _ ("Remove"), "wallpaper.trash");
	g_signal_connect_object ((GObject*) self, "notify::uri", (GCallback) _pantheon_shell_wallpaper_container_construct_from_uri_g_object_notify, self, 0);
	_g_object_unref0 (action_group);
	_g_object_unref0 (overlay);
	_g_object_unref0 (check);
	return obj;
}

static void
pantheon_shell_wallpaper_container_class_init (PantheonShellWallpaperContainerClass * klass,
                                               gpointer klass_data)
{
	pantheon_shell_wallpaper_container_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &PantheonShellWallpaperContainer_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_pantheon_shell_wallpaper_container_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_pantheon_shell_wallpaper_container_set_property;
	G_OBJECT_CLASS (klass)->constructor = pantheon_shell_wallpaper_container_constructor;
	G_OBJECT_CLASS (klass)->finalize = pantheon_shell_wallpaper_container_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PANTHEON_SHELL_WALLPAPER_CONTAINER_URI_PROPERTY, pantheon_shell_wallpaper_container_properties[PANTHEON_SHELL_WALLPAPER_CONTAINER_URI_PROPERTY] = g_param_spec_string ("uri", "uri", "uri", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PANTHEON_SHELL_WALLPAPER_CONTAINER_CHECKED_PROPERTY, pantheon_shell_wallpaper_container_properties[PANTHEON_SHELL_WALLPAPER_CONTAINER_CHECKED_PROPERTY] = g_param_spec_boolean ("checked", "checked", "checked", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	pantheon_shell_wallpaper_container_signals[PANTHEON_SHELL_WALLPAPER_CONTAINER_TRASH_SIGNAL] = g_signal_new ("trash", PANTHEON_SHELL_TYPE_WALLPAPER_CONTAINER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
pantheon_shell_wallpaper_container_instance_init (PantheonShellWallpaperContainer * self,
                                                  gpointer klass)
{
	self->priv = pantheon_shell_wallpaper_container_get_instance_private (self);
	self->priv->thumb_path = NULL;
	self->priv->_uri = NULL;
	self->creation_date = (guint64) 0;
}

static void
pantheon_shell_wallpaper_container_finalize (GObject * obj)
{
	PantheonShellWallpaperContainer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PANTHEON_SHELL_TYPE_WALLPAPER_CONTAINER, PantheonShellWallpaperContainer);
	_g_object_unref0 (self->image);
	_g_object_unref0 (self->priv->menu_model);
	_g_object_unref0 (self->priv->remove_wallpaper_action);
	_g_object_unref0 (self->priv->check_revealer);
	_g_object_unref0 (self->priv->menu_key_controller);
	_g_object_unref0 (self->priv->click_controller);
	_g_object_unref0 (self->priv->long_press_controller);
	_g_object_unref0 (self->priv->context_menu);
	_g_free0 (self->priv->thumb_path);
	_g_free0 (self->priv->_uri);
	G_OBJECT_CLASS (pantheon_shell_wallpaper_container_parent_class)->finalize (obj);
}

static GType
pantheon_shell_wallpaper_container_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PantheonShellWallpaperContainerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pantheon_shell_wallpaper_container_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PantheonShellWallpaperContainer), 0, (GInstanceInitFunc) pantheon_shell_wallpaper_container_instance_init, NULL };
	GType pantheon_shell_wallpaper_container_type_id;
	pantheon_shell_wallpaper_container_type_id = g_type_register_static (GRANITE_TYPE_BIN, "PantheonShellWallpaperContainer", &g_define_type_info, 0);
	PantheonShellWallpaperContainer_private_offset = g_type_add_instance_private (pantheon_shell_wallpaper_container_type_id, sizeof (PantheonShellWallpaperContainerPrivate));
	return pantheon_shell_wallpaper_container_type_id;
}

GType
pantheon_shell_wallpaper_container_get_type (void)
{
	static volatile gsize pantheon_shell_wallpaper_container_type_id__once = 0;
	if (g_once_init_enter (&pantheon_shell_wallpaper_container_type_id__once)) {
		GType pantheon_shell_wallpaper_container_type_id;
		pantheon_shell_wallpaper_container_type_id = pantheon_shell_wallpaper_container_get_type_once ();
		g_once_init_leave (&pantheon_shell_wallpaper_container_type_id__once, pantheon_shell_wallpaper_container_type_id);
	}
	return pantheon_shell_wallpaper_container_type_id__once;
}

static void
_vala_pantheon_shell_wallpaper_container_get_property (GObject * object,
                                                       guint property_id,
                                                       GValue * value,
                                                       GParamSpec * pspec)
{
	PantheonShellWallpaperContainer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PANTHEON_SHELL_TYPE_WALLPAPER_CONTAINER, PantheonShellWallpaperContainer);
	switch (property_id) {
		case PANTHEON_SHELL_WALLPAPER_CONTAINER_URI_PROPERTY:
		g_value_set_string (value, pantheon_shell_wallpaper_container_get_uri (self));
		break;
		case PANTHEON_SHELL_WALLPAPER_CONTAINER_CHECKED_PROPERTY:
		g_value_set_boolean (value, pantheon_shell_wallpaper_container_get_checked (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_pantheon_shell_wallpaper_container_set_property (GObject * object,
                                                       guint property_id,
                                                       const GValue * value,
                                                       GParamSpec * pspec)
{
	PantheonShellWallpaperContainer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PANTHEON_SHELL_TYPE_WALLPAPER_CONTAINER, PantheonShellWallpaperContainer);
	switch (property_id) {
		case PANTHEON_SHELL_WALLPAPER_CONTAINER_URI_PROPERTY:
		pantheon_shell_wallpaper_container_set_uri (self, g_value_get_string (value));
		break;
		case PANTHEON_SHELL_WALLPAPER_CONTAINER_CHECKED_PROPERTY:
		pantheon_shell_wallpaper_container_set_checked (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

