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

/*
* Copyright (c) 2011-2013 Yorba Foundation
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 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., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
/* This file is the master unit file for the EditingTools unit.  It should be edited to include
 * whatever code is deemed necessary.
 *
 * The init () and terminate () methods are mandatory.
 *
 * If the unit needs to be configured prior to initialization, add the proper parameters to
 * the preconfigure () method, implement it, and ensure in init () that it's been called.
 */

#include "io.elementary.photos.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gdk/gdk.h>
#include <cairo-gobject.h>
#include <glib-object.h>
#include <gtk/gtk.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

enum  {
	EDITING_TOOLS_EDITING_TOOL_0_PROPERTY,
	EDITING_TOOLS_EDITING_TOOL_NAME_PROPERTY,
	EDITING_TOOLS_EDITING_TOOL_NUM_PROPERTIES
};
static GParamSpec* editing_tools_editing_tool_properties[EDITING_TOOLS_EDITING_TOOL_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _cairo_surface_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_surface_destroy (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	EDITING_TOOLS_EDITING_TOOL_ACTIVATED_SIGNAL,
	EDITING_TOOLS_EDITING_TOOL_DEACTIVATED_SIGNAL,
	EDITING_TOOLS_EDITING_TOOL_APPLIED_SIGNAL,
	EDITING_TOOLS_EDITING_TOOL_CANCELLED_SIGNAL,
	EDITING_TOOLS_EDITING_TOOL_ABORTED_SIGNAL,
	EDITING_TOOLS_EDITING_TOOL_NUM_SIGNALS
};
static guint editing_tools_editing_tool_signals[EDITING_TOOLS_EDITING_TOOL_NUM_SIGNALS] = {0};
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _EditingToolsEditingToolPrivate {
	EditingToolsEditingToolWindow* tool_window;
	gchar* _name;
};

static gint EditingToolsEditingTool_private_offset;
static gpointer editing_tools_editing_tool_parent_class = NULL;

static void editing_tools_editing_tool_real_activate (EditingToolsEditingTool* self,
                                               EditingToolsPhotoCanvas* canvas);
static gboolean _editing_tools_editing_tool_on_keypress_gtk_widget_key_press_event (GtkWidget* _sender,
                                                                             GdkEventKey* event,
                                                                             gpointer self);
static void editing_tools_editing_tool_real_deactivate (EditingToolsEditingTool* self);
static EditingToolsEditingToolWindow* editing_tools_editing_tool_real_get_tool_window (EditingToolsEditingTool* self);
static GdkPixbuf* editing_tools_editing_tool_real_get_display_pixbuf (EditingToolsEditingTool* self,
                                                               Scaling* scaling,
                                                               Photo* photo,
                                                               Dimensions* max_dim,
                                                               GError** error);
static void editing_tools_editing_tool_real_on_left_click (EditingToolsEditingTool* self,
                                                    gint x,
                                                    gint y);
static void editing_tools_editing_tool_real_on_left_released (EditingToolsEditingTool* self,
                                                       gint x,
                                                       gint y);
static void editing_tools_editing_tool_real_on_motion (EditingToolsEditingTool* self,
                                                gint x,
                                                gint y,
                                                GdkModifierType mask);
static gboolean editing_tools_editing_tool_real_on_leave_notify_event (EditingToolsEditingTool* self);
static gboolean editing_tools_editing_tool_real_on_keypress (EditingToolsEditingTool* self,
                                                      GdkEventKey* event);
static void editing_tools_editing_tool_real_paint (EditingToolsEditingTool* self,
                                            cairo_t* ctx);
static void g_cclosure_user_marshal_VOID__OBJECT_OBJECT_BOXED_BOOLEAN (GClosure * closure,
                                                                GValue * return_value,
                                                                guint n_param_values,
                                                                const GValue * param_values,
                                                                gpointer invocation_hint,
                                                                gpointer marshal_data);
static void editing_tools_editing_tool_finalize (GObject * obj);
static GType editing_tools_editing_tool_get_type_once (void);
static void _vala_editing_tools_editing_tool_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec);
static void _vala_editing_tools_editing_tool_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec);

static inline gpointer
editing_tools_editing_tool_get_instance_private (EditingToolsEditingTool* self)
{
	return G_STRUCT_MEMBER_P (self, EditingToolsEditingTool_private_offset);
}

EditingToolsEditingTool*
editing_tools_editing_tool_construct (GType object_type,
                                      const gchar* name)
{
	EditingToolsEditingTool * self = NULL;
	g_return_val_if_fail (name != NULL, NULL);
	self = (EditingToolsEditingTool*) g_object_new (object_type, "name", name, NULL);
	return self;
}

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

static gboolean
_editing_tools_editing_tool_on_keypress_gtk_widget_key_press_event (GtkWidget* _sender,
                                                                    GdkEventKey* event,
                                                                    gpointer self)
{
	gboolean result;
	result = editing_tools_editing_tool_on_keypress ((EditingToolsEditingTool*) self, event);
	return result;
}

static void
editing_tools_editing_tool_real_activate (EditingToolsEditingTool* self,
                                          EditingToolsPhotoCanvas* canvas)
{
	EditingToolsPhotoCanvas* _tmp0_;
	EditingToolsEditingToolWindow* _tmp1_;
	EditingToolsPhotoCanvas* _tmp2_;
	EditingToolsEditingToolWindow* _tmp3_;
	EditingToolsEditingToolWindow* _tmp4_;
	g_return_if_fail (canvas != NULL);
	_tmp0_ = self->canvas;
	_vala_assert (_tmp0_ == NULL, "this.canvas == null");
	_tmp1_ = self->priv->tool_window;
	_vala_assert (_tmp1_ == NULL, "tool_window == null");
	_tmp2_ = _g_object_ref0 (canvas);
	_g_object_unref0 (self->canvas);
	self->canvas = _tmp2_;
	_tmp3_ = editing_tools_editing_tool_get_tool_window (self);
	_g_object_unref0 (self->priv->tool_window);
	self->priv->tool_window = _tmp3_;
	_tmp4_ = self->priv->tool_window;
	if (_tmp4_ != NULL) {
		EditingToolsEditingToolWindow* _tmp5_;
		_tmp5_ = self->priv->tool_window;
		g_signal_connect_object ((GtkWidget*) _tmp5_, "key-press-event", (GCallback) _editing_tools_editing_tool_on_keypress_gtk_widget_key_press_event, self, 0);
	}
	g_signal_emit (self, editing_tools_editing_tool_signals[EDITING_TOOLS_EDITING_TOOL_ACTIVATED_SIGNAL], 0);
}

void
editing_tools_editing_tool_activate (EditingToolsEditingTool* self,
                                     EditingToolsPhotoCanvas* canvas)
{
	EditingToolsEditingToolClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = EDITING_TOOLS_EDITING_TOOL_GET_CLASS (self);
	if (_klass_->activate) {
		_klass_->activate (self, canvas);
	}
}

static void
editing_tools_editing_tool_real_deactivate (EditingToolsEditingTool* self)
{
	gboolean _tmp0_ = FALSE;
	EditingToolsPhotoCanvas* _tmp1_;
	EditingToolsEditingToolWindow* _tmp3_;
	_tmp1_ = self->canvas;
	if (_tmp1_ == NULL) {
		EditingToolsEditingToolWindow* _tmp2_;
		_tmp2_ = self->priv->tool_window;
		_tmp0_ = _tmp2_ == NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		return;
	}
	_g_object_unref0 (self->canvas);
	self->canvas = NULL;
	_tmp3_ = self->priv->tool_window;
	if (_tmp3_ != NULL) {
		EditingToolsEditingToolWindow* _tmp4_;
		guint _tmp5_;
		_tmp4_ = self->priv->tool_window;
		g_signal_parse_name ("key-press-event", gtk_widget_get_type (), &_tmp5_, NULL, FALSE);
		g_signal_handlers_disconnect_matched ((GtkWidget*) _tmp4_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp5_, 0, NULL, (GCallback) _editing_tools_editing_tool_on_keypress_gtk_widget_key_press_event, self);
		_g_object_unref0 (self->priv->tool_window);
		self->priv->tool_window = NULL;
	}
	g_signal_emit (self, editing_tools_editing_tool_signals[EDITING_TOOLS_EDITING_TOOL_DEACTIVATED_SIGNAL], 0);
}

void
editing_tools_editing_tool_deactivate (EditingToolsEditingTool* self)
{
	EditingToolsEditingToolClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = EDITING_TOOLS_EDITING_TOOL_GET_CLASS (self);
	if (_klass_->deactivate) {
		_klass_->deactivate (self);
	}
}

gboolean
editing_tools_editing_tool_is_activated (EditingToolsEditingTool* self)
{
	EditingToolsPhotoCanvas* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->canvas;
	result = _tmp0_ != NULL;
	return result;
}

static EditingToolsEditingToolWindow*
editing_tools_editing_tool_real_get_tool_window (EditingToolsEditingTool* self)
{
	EditingToolsEditingToolWindow* result;
	result = NULL;
	return result;
}

EditingToolsEditingToolWindow*
editing_tools_editing_tool_get_tool_window (EditingToolsEditingTool* self)
{
	EditingToolsEditingToolClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = EDITING_TOOLS_EDITING_TOOL_GET_CLASS (self);
	if (_klass_->get_tool_window) {
		return _klass_->get_tool_window (self);
	}
	return NULL;
}

static GdkPixbuf*
editing_tools_editing_tool_real_get_display_pixbuf (EditingToolsEditingTool* self,
                                                    Scaling* scaling,
                                                    Photo* photo,
                                                    Dimensions* max_dim,
                                                    GError** error)
{
	Dimensions _vala_max_dim = {0};
	GdkPixbuf* result;
	g_return_val_if_fail (scaling != NULL, NULL);
	g_return_val_if_fail (photo != NULL, NULL);
	dimensions_init (&_vala_max_dim, 0, 0);
	result = NULL;
	if (max_dim) {
		*max_dim = _vala_max_dim;
	}
	return result;
}

GdkPixbuf*
editing_tools_editing_tool_get_display_pixbuf (EditingToolsEditingTool* self,
                                               Scaling* scaling,
                                               Photo* photo,
                                               Dimensions* max_dim,
                                               GError** error)
{
	EditingToolsEditingToolClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = EDITING_TOOLS_EDITING_TOOL_GET_CLASS (self);
	if (_klass_->get_display_pixbuf) {
		return _klass_->get_display_pixbuf (self, scaling, photo, max_dim, error);
	}
	return NULL;
}

static void
editing_tools_editing_tool_real_on_left_click (EditingToolsEditingTool* self,
                                               gint x,
                                               gint y)
{
}

void
editing_tools_editing_tool_on_left_click (EditingToolsEditingTool* self,
                                          gint x,
                                          gint y)
{
	EditingToolsEditingToolClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = EDITING_TOOLS_EDITING_TOOL_GET_CLASS (self);
	if (_klass_->on_left_click) {
		_klass_->on_left_click (self, x, y);
	}
}

static void
editing_tools_editing_tool_real_on_left_released (EditingToolsEditingTool* self,
                                                  gint x,
                                                  gint y)
{
}

void
editing_tools_editing_tool_on_left_released (EditingToolsEditingTool* self,
                                             gint x,
                                             gint y)
{
	EditingToolsEditingToolClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = EDITING_TOOLS_EDITING_TOOL_GET_CLASS (self);
	if (_klass_->on_left_released) {
		_klass_->on_left_released (self, x, y);
	}
}

static void
editing_tools_editing_tool_real_on_motion (EditingToolsEditingTool* self,
                                           gint x,
                                           gint y,
                                           GdkModifierType mask)
{
}

void
editing_tools_editing_tool_on_motion (EditingToolsEditingTool* self,
                                      gint x,
                                      gint y,
                                      GdkModifierType mask)
{
	EditingToolsEditingToolClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = EDITING_TOOLS_EDITING_TOOL_GET_CLASS (self);
	if (_klass_->on_motion) {
		_klass_->on_motion (self, x, y, mask);
	}
}

static gboolean
editing_tools_editing_tool_real_on_leave_notify_event (EditingToolsEditingTool* self)
{
	gboolean result;
	result = FALSE;
	return result;
}

gboolean
editing_tools_editing_tool_on_leave_notify_event (EditingToolsEditingTool* self)
{
	EditingToolsEditingToolClass* _klass_;
	g_return_val_if_fail (self != NULL, FALSE);
	_klass_ = EDITING_TOOLS_EDITING_TOOL_GET_CLASS (self);
	if (_klass_->on_leave_notify_event) {
		return _klass_->on_leave_notify_event (self);
	}
	return FALSE;
}

static gboolean
editing_tools_editing_tool_real_on_keypress (EditingToolsEditingTool* self,
                                             GdkEventKey* event)
{
	const gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = gdk_keyval_name (event->keyval);
	if (g_strcmp0 (_tmp0_, "Escape") == 0) {
		editing_tools_editing_tool_notify_cancel (self);
		result = TRUE;
		return result;
	}
	result = FALSE;
	return result;
}

gboolean
editing_tools_editing_tool_on_keypress (EditingToolsEditingTool* self,
                                        GdkEventKey* event)
{
	EditingToolsEditingToolClass* _klass_;
	g_return_val_if_fail (self != NULL, FALSE);
	_klass_ = EDITING_TOOLS_EDITING_TOOL_GET_CLASS (self);
	if (_klass_->on_keypress) {
		return _klass_->on_keypress (self, event);
	}
	return FALSE;
}

static void
editing_tools_editing_tool_real_paint (EditingToolsEditingTool* self,
                                       cairo_t* ctx)
{
	g_return_if_fail (ctx != NULL);
}

void
editing_tools_editing_tool_paint (EditingToolsEditingTool* self,
                                  cairo_t* ctx)
{
	EditingToolsEditingToolClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = EDITING_TOOLS_EDITING_TOOL_GET_CLASS (self);
	if (_klass_->paint) {
		_klass_->paint (self, ctx);
	}
}

void
editing_tools_editing_tool_notify_cancel (EditingToolsEditingTool* self)
{
	g_return_if_fail (self != NULL);
	g_signal_emit (self, editing_tools_editing_tool_signals[EDITING_TOOLS_EDITING_TOOL_CANCELLED_SIGNAL], 0);
}

const gchar*
editing_tools_editing_tool_get_name (EditingToolsEditingTool* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_name;
	result = _tmp0_;
	return result;
}

static void
editing_tools_editing_tool_set_name (EditingToolsEditingTool* self,
                                     const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = editing_tools_editing_tool_get_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_name);
		self->priv->_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, editing_tools_editing_tool_properties[EDITING_TOOLS_EDITING_TOOL_NAME_PROPERTY]);
	}
}

static void
g_cclosure_user_marshal_VOID__OBJECT_OBJECT_BOXED_BOOLEAN (GClosure * closure,
                                                           GValue * return_value,
                                                           guint n_param_values,
                                                           const GValue * param_values,
                                                           gpointer invocation_hint,
                                                           gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__OBJECT_OBJECT_BOXED_BOOLEAN) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer arg_3, gboolean arg_4, gpointer data2);
	register GMarshalFunc_VOID__OBJECT_OBJECT_BOXED_BOOLEAN callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 5);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__OBJECT_OBJECT_BOXED_BOOLEAN) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_object (param_values + 1), g_value_get_object (param_values + 2), g_value_get_boxed (param_values + 3), g_value_get_boolean (param_values + 4), data2);
}

static void
editing_tools_editing_tool_class_init (EditingToolsEditingToolClass * klass,
                                       gpointer klass_data)
{
	editing_tools_editing_tool_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &EditingToolsEditingTool_private_offset);
	((EditingToolsEditingToolClass *) klass)->activate = (void (*) (EditingToolsEditingTool*, EditingToolsPhotoCanvas*)) editing_tools_editing_tool_real_activate;
	((EditingToolsEditingToolClass *) klass)->deactivate = (void (*) (EditingToolsEditingTool*)) editing_tools_editing_tool_real_deactivate;
	((EditingToolsEditingToolClass *) klass)->get_tool_window = (EditingToolsEditingToolWindow* (*) (EditingToolsEditingTool*)) editing_tools_editing_tool_real_get_tool_window;
	((EditingToolsEditingToolClass *) klass)->get_display_pixbuf = (GdkPixbuf* (*) (EditingToolsEditingTool*, Scaling*, Photo*, Dimensions*, GError**)) editing_tools_editing_tool_real_get_display_pixbuf;
	((EditingToolsEditingToolClass *) klass)->on_left_click = (void (*) (EditingToolsEditingTool*, gint, gint)) editing_tools_editing_tool_real_on_left_click;
	((EditingToolsEditingToolClass *) klass)->on_left_released = (void (*) (EditingToolsEditingTool*, gint, gint)) editing_tools_editing_tool_real_on_left_released;
	((EditingToolsEditingToolClass *) klass)->on_motion = (void (*) (EditingToolsEditingTool*, gint, gint, GdkModifierType)) editing_tools_editing_tool_real_on_motion;
	((EditingToolsEditingToolClass *) klass)->on_leave_notify_event = (gboolean (*) (EditingToolsEditingTool*)) editing_tools_editing_tool_real_on_leave_notify_event;
	((EditingToolsEditingToolClass *) klass)->on_keypress = (gboolean (*) (EditingToolsEditingTool*, GdkEventKey*)) editing_tools_editing_tool_real_on_keypress;
	((EditingToolsEditingToolClass *) klass)->paint = (void (*) (EditingToolsEditingTool*, cairo_t*)) editing_tools_editing_tool_real_paint;
	G_OBJECT_CLASS (klass)->get_property = _vala_editing_tools_editing_tool_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_editing_tools_editing_tool_set_property;
	G_OBJECT_CLASS (klass)->finalize = editing_tools_editing_tool_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDITING_TOOLS_EDITING_TOOL_NAME_PROPERTY, editing_tools_editing_tool_properties[EDITING_TOOLS_EDITING_TOOL_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	editing_tools_editing_tool_signals[EDITING_TOOLS_EDITING_TOOL_ACTIVATED_SIGNAL] = g_signal_new ("activated", EDITING_TOOLS_TYPE_EDITING_TOOL, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	editing_tools_editing_tool_signals[EDITING_TOOLS_EDITING_TOOL_DEACTIVATED_SIGNAL] = g_signal_new ("deactivated", EDITING_TOOLS_TYPE_EDITING_TOOL, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	editing_tools_editing_tool_signals[EDITING_TOOLS_EDITING_TOOL_APPLIED_SIGNAL] = g_signal_new ("applied", EDITING_TOOLS_TYPE_EDITING_TOOL, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_OBJECT_BOXED_BOOLEAN, G_TYPE_NONE, 4, TYPE_COMMAND, gdk_pixbuf_get_type (), TYPE_DIMENSIONS, G_TYPE_BOOLEAN);
	editing_tools_editing_tool_signals[EDITING_TOOLS_EDITING_TOOL_CANCELLED_SIGNAL] = g_signal_new ("cancelled", EDITING_TOOLS_TYPE_EDITING_TOOL, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	editing_tools_editing_tool_signals[EDITING_TOOLS_EDITING_TOOL_ABORTED_SIGNAL] = g_signal_new ("aborted", EDITING_TOOLS_TYPE_EDITING_TOOL, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
editing_tools_editing_tool_instance_init (EditingToolsEditingTool * self,
                                          gpointer klass)
{
	self->priv = editing_tools_editing_tool_get_instance_private (self);
	self->canvas = NULL;
	self->priv->tool_window = NULL;
}

static void
editing_tools_editing_tool_finalize (GObject * obj)
{
	EditingToolsEditingTool * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, EDITING_TOOLS_TYPE_EDITING_TOOL, EditingToolsEditingTool);
	_g_object_unref0 (self->canvas);
	_g_object_unref0 (self->priv->tool_window);
	_cairo_surface_destroy0 (self->surface);
	_g_free0 (self->priv->_name);
	G_OBJECT_CLASS (editing_tools_editing_tool_parent_class)->finalize (obj);
}

static GType
editing_tools_editing_tool_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (EditingToolsEditingToolClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) editing_tools_editing_tool_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (EditingToolsEditingTool), 0, (GInstanceInitFunc) editing_tools_editing_tool_instance_init, NULL };
	GType editing_tools_editing_tool_type_id;
	editing_tools_editing_tool_type_id = g_type_register_static (G_TYPE_OBJECT, "EditingToolsEditingTool", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	EditingToolsEditingTool_private_offset = g_type_add_instance_private (editing_tools_editing_tool_type_id, sizeof (EditingToolsEditingToolPrivate));
	return editing_tools_editing_tool_type_id;
}

GType
editing_tools_editing_tool_get_type (void)
{
	static volatile gsize editing_tools_editing_tool_type_id__once = 0;
	if (g_once_init_enter (&editing_tools_editing_tool_type_id__once)) {
		GType editing_tools_editing_tool_type_id;
		editing_tools_editing_tool_type_id = editing_tools_editing_tool_get_type_once ();
		g_once_init_leave (&editing_tools_editing_tool_type_id__once, editing_tools_editing_tool_type_id);
	}
	return editing_tools_editing_tool_type_id__once;
}

static void
_vala_editing_tools_editing_tool_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec)
{
	EditingToolsEditingTool * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, EDITING_TOOLS_TYPE_EDITING_TOOL, EditingToolsEditingTool);
	switch (property_id) {
		case EDITING_TOOLS_EDITING_TOOL_NAME_PROPERTY:
		g_value_set_string (value, editing_tools_editing_tool_get_name (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_editing_tools_editing_tool_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec)
{
	EditingToolsEditingTool * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, EDITING_TOOLS_TYPE_EDITING_TOOL, EditingToolsEditingTool);
	switch (property_id) {
		case EDITING_TOOLS_EDITING_TOOL_NAME_PROPERTY:
		editing_tools_editing_tool_set_name (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

