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

/*
* Copyright (c) 2016 Felipe Escoto (https://github.com/Philip-Scott/Spice-up)
*
* 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 2 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, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Authored by: Felipe Escoto <felescoto95@hotmail.com>
*/

#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <gdk/gdk.h>

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

#define SPICE_WIDGETS_TYPE_TOOLBAR (spice_widgets_toolbar_get_type ())
#define SPICE_WIDGETS_TOOLBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPICE_WIDGETS_TYPE_TOOLBAR, SpiceWidgetsToolbar))
#define SPICE_WIDGETS_TOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SPICE_WIDGETS_TYPE_TOOLBAR, SpiceWidgetsToolbarClass))
#define SPICE_WIDGETS_IS_TOOLBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SPICE_WIDGETS_TYPE_TOOLBAR))
#define SPICE_WIDGETS_IS_TOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SPICE_WIDGETS_TYPE_TOOLBAR))
#define SPICE_WIDGETS_TOOLBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SPICE_WIDGETS_TYPE_TOOLBAR, SpiceWidgetsToolbarClass))

typedef struct _SpiceWidgetsToolbar SpiceWidgetsToolbar;
typedef struct _SpiceWidgetsToolbarClass SpiceWidgetsToolbarClass;
typedef struct _SpiceWidgetsToolbarPrivate SpiceWidgetsToolbarPrivate;

#define SPICE_TYPE_CANVAS_ITEM (spice_canvas_item_get_type ())
#define SPICE_CANVAS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPICE_TYPE_CANVAS_ITEM, SpiceCanvasItem))
#define SPICE_CANVAS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SPICE_TYPE_CANVAS_ITEM, SpiceCanvasItemClass))
#define SPICE_IS_CANVAS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SPICE_TYPE_CANVAS_ITEM))
#define SPICE_IS_CANVAS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SPICE_TYPE_CANVAS_ITEM))
#define SPICE_CANVAS_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SPICE_TYPE_CANVAS_ITEM, SpiceCanvasItemClass))

typedef struct _SpiceCanvasItem SpiceCanvasItem;
typedef struct _SpiceCanvasItemClass SpiceCanvasItemClass;

#define SPICE_WIDGETS_TYPE_IMAGE_TOOLBAR (spice_widgets_image_toolbar_get_type ())
#define SPICE_WIDGETS_IMAGE_TOOLBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPICE_WIDGETS_TYPE_IMAGE_TOOLBAR, SpiceWidgetsImageToolbar))
#define SPICE_WIDGETS_IMAGE_TOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SPICE_WIDGETS_TYPE_IMAGE_TOOLBAR, SpiceWidgetsImageToolbarClass))
#define SPICE_WIDGETS_IS_IMAGE_TOOLBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SPICE_WIDGETS_TYPE_IMAGE_TOOLBAR))
#define SPICE_WIDGETS_IS_IMAGE_TOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SPICE_WIDGETS_TYPE_IMAGE_TOOLBAR))
#define SPICE_WIDGETS_IMAGE_TOOLBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SPICE_WIDGETS_TYPE_IMAGE_TOOLBAR, SpiceWidgetsImageToolbarClass))

typedef struct _SpiceWidgetsImageToolbar SpiceWidgetsImageToolbar;
typedef struct _SpiceWidgetsImageToolbarClass SpiceWidgetsImageToolbarClass;
typedef struct _SpiceWidgetsImageToolbarPrivate SpiceWidgetsImageToolbarPrivate;

#define SPICE_TYPE_SLIDE_MANAGER (spice_slide_manager_get_type ())
#define SPICE_SLIDE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPICE_TYPE_SLIDE_MANAGER, SpiceSlideManager))
#define SPICE_SLIDE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SPICE_TYPE_SLIDE_MANAGER, SpiceSlideManagerClass))
#define SPICE_IS_SLIDE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SPICE_TYPE_SLIDE_MANAGER))
#define SPICE_IS_SLIDE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SPICE_TYPE_SLIDE_MANAGER))
#define SPICE_SLIDE_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SPICE_TYPE_SLIDE_MANAGER, SpiceSlideManagerClass))

typedef struct _SpiceSlideManager SpiceSlideManager;
typedef struct _SpiceSlideManagerClass SpiceSlideManagerClass;
enum  {
	SPICE_WIDGETS_IMAGE_TOOLBAR_0_PROPERTY,
	SPICE_WIDGETS_IMAGE_TOOLBAR_NUM_PROPERTIES
};
static GParamSpec* spice_widgets_image_toolbar_properties[SPICE_WIDGETS_IMAGE_TOOLBAR_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define SPICE_TYPE_IMAGE_ITEM (spice_image_item_get_type ())
#define SPICE_IMAGE_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPICE_TYPE_IMAGE_ITEM, SpiceImageItem))
#define SPICE_IMAGE_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SPICE_TYPE_IMAGE_ITEM, SpiceImageItemClass))
#define SPICE_IS_IMAGE_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SPICE_TYPE_IMAGE_ITEM))
#define SPICE_IS_IMAGE_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SPICE_TYPE_IMAGE_ITEM))
#define SPICE_IMAGE_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SPICE_TYPE_IMAGE_ITEM, SpiceImageItemClass))

typedef struct _SpiceImageItem SpiceImageItem;
typedef struct _SpiceImageItemClass SpiceImageItemClass;

#define SPICE_TYPE_WINDOW (spice_window_get_type ())
#define SPICE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPICE_TYPE_WINDOW, SpiceWindow))
#define SPICE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SPICE_TYPE_WINDOW, SpiceWindowClass))
#define SPICE_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SPICE_TYPE_WINDOW))
#define SPICE_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SPICE_TYPE_WINDOW))
#define SPICE_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SPICE_TYPE_WINDOW, SpiceWindowClass))

typedef struct _SpiceWindow SpiceWindow;
typedef struct _SpiceWindowClass SpiceWindowClass;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define SPICE_TYPE_IMAGE_HANDLER (spice_image_handler_get_type ())
#define SPICE_IMAGE_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPICE_TYPE_IMAGE_HANDLER, SpiceImageHandler))
#define SPICE_IMAGE_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SPICE_TYPE_IMAGE_HANDLER, SpiceImageHandlerClass))
#define SPICE_IS_IMAGE_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SPICE_TYPE_IMAGE_HANDLER))
#define SPICE_IS_IMAGE_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SPICE_TYPE_IMAGE_HANDLER))
#define SPICE_IMAGE_HANDLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SPICE_TYPE_IMAGE_HANDLER, SpiceImageHandlerClass))

typedef struct _SpiceImageHandler SpiceImageHandler;
typedef struct _SpiceImageHandlerClass SpiceImageHandlerClass;

struct _SpiceWidgetsToolbar {
	GtkBox parent_instance;
	SpiceWidgetsToolbarPrivate * priv;
	gboolean init;
	gboolean selecting;
	SpiceCanvasItem* item;
};

struct _SpiceWidgetsToolbarClass {
	GtkBoxClass parent_class;
	void (*item_selected) (SpiceWidgetsToolbar* self, SpiceCanvasItem* item, gboolean new_item);
	void (*update_properties) (SpiceWidgetsToolbar* self);
};

struct _SpiceWidgetsImageToolbar {
	SpiceWidgetsToolbar parent_instance;
	SpiceWidgetsImageToolbarPrivate * priv;
};

struct _SpiceWidgetsImageToolbarClass {
	SpiceWidgetsToolbarClass parent_class;
};

struct _SpiceWidgetsImageToolbarPrivate {
	GtkButton* open_with;
	GtkButton* replace_image;
	SpiceSlideManager* manager;
};

static gint SpiceWidgetsImageToolbar_private_offset;
static gpointer spice_widgets_image_toolbar_parent_class = NULL;

VALA_EXTERN GType spice_widgets_toolbar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SpiceWidgetsToolbar, g_object_unref)
VALA_EXTERN GType spice_canvas_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SpiceCanvasItem, g_object_unref)
VALA_EXTERN GType spice_widgets_image_toolbar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SpiceWidgetsImageToolbar, g_object_unref)
VALA_EXTERN GType spice_slide_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SpiceSlideManager, g_object_unref)
VALA_EXTERN void spice_widgets_toolbar_item_selected (SpiceWidgetsToolbar* self,
                                          SpiceCanvasItem* item,
                                          gboolean new_item);
VALA_EXTERN void spice_widgets_toolbar_update_properties (SpiceWidgetsToolbar* self);
VALA_EXTERN SpiceWidgetsImageToolbar* spice_widgets_image_toolbar_new (SpiceSlideManager* slide_manager);
VALA_EXTERN SpiceWidgetsImageToolbar* spice_widgets_image_toolbar_construct (GType object_type,
                                                                 SpiceSlideManager* slide_manager);
VALA_EXTERN SpiceWidgetsToolbar* spice_widgets_toolbar_construct (GType object_type);
static void spice_widgets_image_toolbar_real_item_selected (SpiceWidgetsToolbar* base,
                                                     SpiceCanvasItem* _item,
                                                     gboolean new_item);
static void spice_widgets_image_toolbar_real_update_properties (SpiceWidgetsToolbar* base);
static GObject * spice_widgets_image_toolbar_constructor (GType type,
                                                   guint n_construct_properties,
                                                   GObjectConstructParam * construct_properties);
static void _spice_widgets_image_toolbar___lambda114_ (SpiceWidgetsImageToolbar* self);
VALA_EXTERN GType spice_image_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SpiceImageItem, g_object_unref)
VALA_EXTERN const gchar* spice_image_item_get_url (SpiceImageItem* self);
VALA_EXTERN GType spice_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SpiceWindow, g_object_unref)
VALA_EXTERN SpiceWindow* spice_application_get_active_spice_window (void);
static void __spice_widgets_image_toolbar___lambda114__gtk_button_clicked (GtkButton* _sender,
                                                                    gpointer self);
static void _spice_widgets_image_toolbar___lambda115_ (SpiceWidgetsImageToolbar* self);
VALA_EXTERN GFile* spice_services_file_manager_open_image (void);
VALA_EXTERN GType spice_image_handler_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SpiceImageHandler, g_object_unref)
VALA_EXTERN SpiceImageHandler* spice_image_item_get_image (SpiceImageItem* self);
VALA_EXTERN void spice_image_handler_replace (SpiceImageHandler* self,
                                  GFile* file);
static void __spice_widgets_image_toolbar___lambda115__gtk_button_clicked (GtkButton* _sender,
                                                                    gpointer self);
static void spice_widgets_image_toolbar_finalize (GObject * obj);
static GType spice_widgets_image_toolbar_get_type_once (void);

static inline gpointer
spice_widgets_image_toolbar_get_instance_private (SpiceWidgetsImageToolbar* self)
{
	return G_STRUCT_MEMBER_P (self, SpiceWidgetsImageToolbar_private_offset);
}

SpiceWidgetsImageToolbar*
spice_widgets_image_toolbar_construct (GType object_type,
                                       SpiceSlideManager* slide_manager)
{
	SpiceWidgetsImageToolbar * self = NULL;
#line 28 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	g_return_val_if_fail (slide_manager != NULL, NULL);
#line 28 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	self = (SpiceWidgetsImageToolbar*) spice_widgets_toolbar_construct (object_type);
#line 29 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	self->priv->manager = slide_manager;
#line 28 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	return self;
#line 228 "ImageBar.c"
}

SpiceWidgetsImageToolbar*
spice_widgets_image_toolbar_new (SpiceSlideManager* slide_manager)
{
#line 28 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	return spice_widgets_image_toolbar_construct (SPICE_WIDGETS_TYPE_IMAGE_TOOLBAR, slide_manager);
#line 236 "ImageBar.c"
}

static void
spice_widgets_image_toolbar_real_item_selected (SpiceWidgetsToolbar* base,
                                                SpiceCanvasItem* _item,
                                                gboolean new_item)
{
	SpiceWidgetsImageToolbar * self;
#line 70 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	self = (SpiceWidgetsImageToolbar*) base;
#line 247 "ImageBar.c"
}

static void
spice_widgets_image_toolbar_real_update_properties (SpiceWidgetsToolbar* base)
{
	SpiceWidgetsImageToolbar * self;
#line 72 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	self = (SpiceWidgetsImageToolbar*) base;
#line 256 "ImageBar.c"
}

static gpointer
_g_object_ref0 (gpointer self)
{
#line 40 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	return self ? g_object_ref (self) : NULL;
#line 264 "ImageBar.c"
}

static void
_spice_widgets_image_toolbar___lambda114_ (SpiceWidgetsImageToolbar* self)
{
	SpiceImageItem* image_item = NULL;
	SpiceCanvasItem* _tmp0_;
	SpiceImageItem* _tmp1_;
	GFile* file = NULL;
	SpiceImageItem* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	GFile* _tmp5_;
	GError* _inner_error0_ = NULL;
#line 40 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_tmp0_ = ((SpiceWidgetsToolbar*) self)->item;
#line 40 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPICE_TYPE_IMAGE_ITEM, SpiceImageItem));
#line 40 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	image_item = _tmp1_;
#line 41 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_tmp2_ = image_item;
#line 41 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_tmp3_ = spice_image_item_get_url (_tmp2_);
#line 41 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_tmp4_ = _tmp3_;
#line 41 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_tmp5_ = g_file_new_for_path (_tmp4_);
#line 41 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	file = _tmp5_;
#line 295 "ImageBar.c"
	{
		SpiceWindow* _tmp6_;
		GFile* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
#line 44 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
		_tmp6_ = spice_application_get_active_spice_window ();
#line 44 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
		_tmp7_ = file;
#line 44 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
		_tmp8_ = g_file_get_uri (_tmp7_);
#line 44 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
		_tmp9_ = _tmp8_;
#line 44 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
		gtk_show_uri_on_window ((GtkWindow*) _tmp6_, _tmp9_, (guint32) GDK_CURRENT_TIME, &_inner_error0_);
#line 44 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
		_g_free0 (_tmp9_);
#line 44 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 315 "ImageBar.c"
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp10_;
		const gchar* _tmp11_;
#line 43 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
		e = _inner_error0_;
#line 43 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
		_inner_error0_ = NULL;
#line 46 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
		_tmp10_ = e;
#line 46 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
		_tmp11_ = _tmp10_->message;
#line 46 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
		g_warning ("ImageBar.vala:46: Could not launch open with portal %s", _tmp11_);
#line 47 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
		_g_error_free0 (e);
#line 47 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
		_g_object_unref0 (file);
#line 47 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
		_g_object_unref0 (image_item);
#line 47 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
		return;
#line 343 "ImageBar.c"
	}
	__finally0:
#line 43 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 43 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
		_g_object_unref0 (file);
#line 43 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
		_g_object_unref0 (image_item);
#line 43 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
		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);
#line 43 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
		g_clear_error (&_inner_error0_);
#line 43 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
		return;
#line 358 "ImageBar.c"
	}
#line 39 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_g_object_unref0 (file);
#line 39 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_g_object_unref0 (image_item);
#line 364 "ImageBar.c"
}

static void
__spice_widgets_image_toolbar___lambda114__gtk_button_clicked (GtkButton* _sender,
                                                               gpointer self)
{
#line 39 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_spice_widgets_image_toolbar___lambda114_ ((SpiceWidgetsImageToolbar*) self);
#line 373 "ImageBar.c"
}

static void
_spice_widgets_image_toolbar___lambda115_ (SpiceWidgetsImageToolbar* self)
{
	GFile* file = NULL;
	GFile* _tmp0_;
	GFile* _tmp1_;
#line 58 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_tmp0_ = spice_services_file_manager_open_image ();
#line 58 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	file = _tmp0_;
#line 60 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_tmp1_ = file;
#line 60 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	if (_tmp1_ != NULL) {
#line 390 "ImageBar.c"
		SpiceImageItem* image_item = NULL;
		SpiceCanvasItem* _tmp2_;
		SpiceImageItem* _tmp3_;
		SpiceImageItem* _tmp4_;
		SpiceImageHandler* _tmp5_;
		SpiceImageHandler* _tmp6_;
		GFile* _tmp7_;
#line 61 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
		_tmp2_ = ((SpiceWidgetsToolbar*) self)->item;
#line 61 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
		_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, SPICE_TYPE_IMAGE_ITEM, SpiceImageItem));
#line 61 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
		image_item = _tmp3_;
#line 62 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
		_tmp4_ = image_item;
#line 62 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
		_tmp5_ = spice_image_item_get_image (_tmp4_);
#line 62 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
		_tmp6_ = _tmp5_;
#line 62 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
		_tmp7_ = file;
#line 62 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
		spice_image_handler_replace (_tmp6_, _tmp7_);
#line 60 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
		_g_object_unref0 (image_item);
#line 416 "ImageBar.c"
	}
#line 57 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_g_object_unref0 (file);
#line 420 "ImageBar.c"
}

static void
__spice_widgets_image_toolbar___lambda115__gtk_button_clicked (GtkButton* _sender,
                                                               gpointer self)
{
#line 57 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_spice_widgets_image_toolbar___lambda115_ ((SpiceWidgetsImageToolbar*) self);
#line 429 "ImageBar.c"
}

static GObject *
spice_widgets_image_toolbar_constructor (GType type,
                                         guint n_construct_properties,
                                         GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SpiceWidgetsImageToolbar * self;
	GtkButton* _tmp0_;
	GtkButton* _tmp1_;
	GtkImage* _tmp2_;
	GtkImage* _tmp3_;
	GtkButton* _tmp4_;
	GtkButton* _tmp5_;
	GtkStyleContext* _tmp6_;
	GtkButton* _tmp7_;
	GtkStyleContext* _tmp8_;
	GtkButton* _tmp9_;
	GtkButton* _tmp10_;
	GtkButton* _tmp11_;
	GtkImage* _tmp12_;
	GtkImage* _tmp13_;
	GtkButton* _tmp14_;
	GtkButton* _tmp15_;
	GtkStyleContext* _tmp16_;
	GtkButton* _tmp17_;
	GtkStyleContext* _tmp18_;
	GtkButton* _tmp19_;
	GtkButton* _tmp20_;
	GtkButton* _tmp21_;
#line 32 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	parent_class = G_OBJECT_CLASS (spice_widgets_image_toolbar_parent_class);
#line 32 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
#line 32 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SPICE_WIDGETS_TYPE_IMAGE_TOOLBAR, SpiceWidgetsImageToolbar);
#line 33 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_tmp0_ = (GtkButton*) gtk_button_new ();
#line 33 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	g_object_ref_sink (_tmp0_);
#line 33 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_g_object_unref0 (self->priv->open_with);
#line 33 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	self->priv->open_with = _tmp0_;
#line 34 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_tmp1_ = self->priv->open_with;
#line 34 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_tmp2_ = (GtkImage*) gtk_image_new_from_icon_name ("applications-graphics-symbolic", (GtkIconSize) GTK_ICON_SIZE_MENU);
#line 34 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	g_object_ref_sink (_tmp2_);
#line 34 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_tmp3_ = _tmp2_;
#line 34 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	gtk_container_add ((GtkContainer*) _tmp1_, (GtkWidget*) _tmp3_);
#line 34 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_g_object_unref0 (_tmp3_);
#line 35 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_tmp4_ = self->priv->open_with;
#line 35 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp4_, _ ("Edit image with…"));
#line 36 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_tmp5_ = self->priv->open_with;
#line 36 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_tmp6_ = gtk_widget_get_style_context ((GtkWidget*) _tmp5_);
#line 36 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	gtk_style_context_add_class (_tmp6_, GTK_STYLE_CLASS_RAISED);
#line 37 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_tmp7_ = self->priv->open_with;
#line 37 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_tmp8_ = gtk_widget_get_style_context ((GtkWidget*) _tmp7_);
#line 37 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	gtk_style_context_add_class (_tmp8_, "image-button");
#line 39 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_tmp9_ = self->priv->open_with;
#line 39 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	g_signal_connect_object (_tmp9_, "clicked", (GCallback) __spice_widgets_image_toolbar___lambda114__gtk_button_clicked, self, 0);
#line 51 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_tmp10_ = (GtkButton*) gtk_button_new ();
#line 51 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	g_object_ref_sink (_tmp10_);
#line 51 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_g_object_unref0 (self->priv->replace_image);
#line 51 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	self->priv->replace_image = _tmp10_;
#line 52 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_tmp11_ = self->priv->replace_image;
#line 52 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_tmp12_ = (GtkImage*) gtk_image_new_from_icon_name ("document-new-symbolic", (GtkIconSize) GTK_ICON_SIZE_MENU);
#line 52 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	g_object_ref_sink (_tmp12_);
#line 52 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_tmp13_ = _tmp12_;
#line 52 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	gtk_container_add ((GtkContainer*) _tmp11_, (GtkWidget*) _tmp13_);
#line 52 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_g_object_unref0 (_tmp13_);
#line 53 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_tmp14_ = self->priv->replace_image;
#line 53 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp14_, _ ("Replace Image…"));
#line 54 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_tmp15_ = self->priv->replace_image;
#line 54 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_tmp16_ = gtk_widget_get_style_context ((GtkWidget*) _tmp15_);
#line 54 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	gtk_style_context_add_class (_tmp16_, GTK_STYLE_CLASS_RAISED);
#line 55 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_tmp17_ = self->priv->replace_image;
#line 55 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_tmp18_ = gtk_widget_get_style_context ((GtkWidget*) _tmp17_);
#line 55 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	gtk_style_context_add_class (_tmp18_, "image-button");
#line 57 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_tmp19_ = self->priv->replace_image;
#line 57 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	g_signal_connect_object (_tmp19_, "clicked", (GCallback) __spice_widgets_image_toolbar___lambda115__gtk_button_clicked, self, 0);
#line 66 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_tmp20_ = self->priv->open_with;
#line 66 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp20_);
#line 67 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_tmp21_ = self->priv->replace_image;
#line 67 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp21_);
#line 32 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	return obj;
#line 558 "ImageBar.c"
}

static void
spice_widgets_image_toolbar_class_init (SpiceWidgetsImageToolbarClass * klass,
                                        gpointer klass_data)
{
#line 22 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	spice_widgets_image_toolbar_parent_class = g_type_class_peek_parent (klass);
#line 22 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	g_type_class_adjust_private_offset (klass, &SpiceWidgetsImageToolbar_private_offset);
#line 22 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	((SpiceWidgetsToolbarClass *) klass)->item_selected = (void (*) (SpiceWidgetsToolbar*, SpiceCanvasItem*, gboolean)) spice_widgets_image_toolbar_real_item_selected;
#line 22 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	((SpiceWidgetsToolbarClass *) klass)->update_properties = (void (*) (SpiceWidgetsToolbar*)) spice_widgets_image_toolbar_real_update_properties;
#line 22 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	G_OBJECT_CLASS (klass)->constructor = spice_widgets_image_toolbar_constructor;
#line 22 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	G_OBJECT_CLASS (klass)->finalize = spice_widgets_image_toolbar_finalize;
#line 577 "ImageBar.c"
}

static void
spice_widgets_image_toolbar_instance_init (SpiceWidgetsImageToolbar * self,
                                           gpointer klass)
{
#line 22 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	self->priv = spice_widgets_image_toolbar_get_instance_private (self);
#line 586 "ImageBar.c"
}

static void
spice_widgets_image_toolbar_finalize (GObject * obj)
{
	SpiceWidgetsImageToolbar * self;
#line 22 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SPICE_WIDGETS_TYPE_IMAGE_TOOLBAR, SpiceWidgetsImageToolbar);
#line 23 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_g_object_unref0 (self->priv->open_with);
#line 24 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	_g_object_unref0 (self->priv->replace_image);
#line 22 "../Spice-up-1.9.1/src/Widgets/Toolbars/ImageBar.vala"
	G_OBJECT_CLASS (spice_widgets_image_toolbar_parent_class)->finalize (obj);
#line 601 "ImageBar.c"
}

static GType
spice_widgets_image_toolbar_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SpiceWidgetsImageToolbarClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) spice_widgets_image_toolbar_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SpiceWidgetsImageToolbar), 0, (GInstanceInitFunc) spice_widgets_image_toolbar_instance_init, NULL };
	GType spice_widgets_image_toolbar_type_id;
	spice_widgets_image_toolbar_type_id = g_type_register_static (SPICE_WIDGETS_TYPE_TOOLBAR, "SpiceWidgetsImageToolbar", &g_define_type_info, 0);
	SpiceWidgetsImageToolbar_private_offset = g_type_add_instance_private (spice_widgets_image_toolbar_type_id, sizeof (SpiceWidgetsImageToolbarPrivate));
	return spice_widgets_image_toolbar_type_id;
}

GType
spice_widgets_image_toolbar_get_type (void)
{
	static volatile gsize spice_widgets_image_toolbar_type_id__once = 0;
	if (g_once_init_enter (&spice_widgets_image_toolbar_type_id__once)) {
		GType spice_widgets_image_toolbar_type_id;
		spice_widgets_image_toolbar_type_id = spice_widgets_image_toolbar_get_type_once ();
		g_once_init_leave (&spice_widgets_image_toolbar_type_id__once, spice_widgets_image_toolbar_type_id);
	}
	return spice_widgets_image_toolbar_type_id__once;
}

