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

#include "pantheon-files-core.h"
#include <glib.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <stdlib.h>
#include <string.h>
#include <pango/pango.h>
#include <glib-object.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  {
	FILES_ABSTRACT_EDITABLE_LABEL_0_PROPERTY,
	FILES_ABSTRACT_EDITABLE_LABEL_EDITING_CANCELED_PROPERTY,
	FILES_ABSTRACT_EDITABLE_LABEL_NUM_PROPERTIES
};
static GParamSpec* files_abstract_editable_label_properties[FILES_ABSTRACT_EDITABLE_LABEL_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _FilesAbstractEditableLabelPrivate {
	gboolean _editing_canceled;
	GtkEventControllerKey* key_controller;
};

static gint FilesAbstractEditableLabel_private_offset;
static gpointer files_abstract_editable_label_parent_class = NULL;
static GtkEditableInterface * files_abstract_editable_label_gtk_editable_parent_iface = NULL;
static GtkCellEditableIface * files_abstract_editable_label_gtk_cell_editable_parent_iface = NULL;

static gboolean _files_abstract_editable_label_on_key_press_event_gtk_event_controller_key_key_pressed (GtkEventControllerKey* _sender,
                                                                                                 guint keyval,
                                                                                                 guint keycode,
                                                                                                 GdkModifierType state,
                                                                                                 gpointer self);
static gboolean __lambda71_ (FilesAbstractEditableLabel* self);
static gboolean ___lambda71__gtk_widget_button_press_event (GtkWidget* _sender,
                                                     GdkEventButton* event,
                                                     gpointer self);
static gboolean files_abstract_editable_label_real_on_key_press_event (FilesAbstractEditableLabel* self,
                                                                guint keyval,
                                                                guint keycode,
                                                                GdkModifierType state);
static void files_abstract_editable_label_real_set_text (FilesAbstractEditableLabel* self,
                                                  const gchar* text);
static void files_abstract_editable_label_real_set_line_wrap (FilesAbstractEditableLabel* self,
                                                       gboolean wrap);
static void files_abstract_editable_label_real_set_line_wrap_mode (FilesAbstractEditableLabel* self,
                                                            PangoWrapMode mode);
static void files_abstract_editable_label_real_set_justify (FilesAbstractEditableLabel* self,
                                                     GtkJustification jtype);
static void files_abstract_editable_label_real_set_padding (FilesAbstractEditableLabel* self,
                                                     gint xpad,
                                                     gint ypad);
static void files_abstract_editable_label_real_set_size_request (FilesAbstractEditableLabel* self,
                                                          gint width,
                                                          gint height);
static gchar* files_abstract_editable_label_real_get_text (FilesAbstractEditableLabel* self);
static void files_abstract_editable_label_real_select_region (FilesAbstractEditableLabel* self,
                                                       gint start_pos,
                                                       gint end_pos);
static void files_abstract_editable_label_real_do_delete_text (FilesAbstractEditableLabel* self,
                                                        gint start_pos,
                                                        gint end_pos);
static void files_abstract_editable_label_real_do_insert_text (FilesAbstractEditableLabel* self,
                                                        const gchar* new_text,
                                                        gint new_text_length,
                                                        gint* position);
static gchar* files_abstract_editable_label_real_get_chars (FilesAbstractEditableLabel* self,
                                                     gint start_pos,
                                                     gint end_pos);
static gint files_abstract_editable_label_real_get_position (FilesAbstractEditableLabel* self);
static gboolean files_abstract_editable_label_real_get_selection_bounds (FilesAbstractEditableLabel* self,
                                                                  gint* start_pos,
                                                                  gint* end_pos);
static void files_abstract_editable_label_real_set_position (FilesAbstractEditableLabel* self,
                                                      gint position);
static void files_abstract_editable_label_real_start_editing (FilesAbstractEditableLabel* self,
                                                       GdkEvent* event);
static void files_abstract_editable_label_finalize (GObject * obj);
static GType files_abstract_editable_label_get_type_once (void);
static void _vala_files_abstract_editable_label_get_property (GObject * object,
                                                       guint property_id,
                                                       GValue * value,
                                                       GParamSpec * pspec);
static void _vala_files_abstract_editable_label_set_property (GObject * object,
                                                       guint property_id,
                                                       const GValue * value,
                                                       GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
files_abstract_editable_label_get_instance_private (FilesAbstractEditableLabel* self)
{
	return G_STRUCT_MEMBER_P (self, FilesAbstractEditableLabel_private_offset);
}

static gboolean
_files_abstract_editable_label_on_key_press_event_gtk_event_controller_key_key_pressed (GtkEventControllerKey* _sender,
                                                                                        guint keyval,
                                                                                        guint keycode,
                                                                                        GdkModifierType state,
                                                                                        gpointer self)
{
	gboolean result;
	result = files_abstract_editable_label_on_key_press_event ((FilesAbstractEditableLabel*) self, keyval, keycode, state);
	return result;
}

static gboolean
__lambda71_ (FilesAbstractEditableLabel* self)
{
	gboolean result;
	result = TRUE;
	return result;
}

static gboolean
___lambda71__gtk_widget_button_press_event (GtkWidget* _sender,
                                            GdkEventButton* event,
                                            gpointer self)
{
	gboolean result;
	result = __lambda71_ ((FilesAbstractEditableLabel*) self);
	return result;
}

void
files_abstract_editable_label_connect_editable_widget (FilesAbstractEditableLabel* self,
                                                       GtkWidget* editable_widget)
{
	GtkEventControllerKey* _tmp0_;
	GtkEventControllerKey* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (editable_widget != NULL);
	_tmp0_ = (GtkEventControllerKey*) gtk_event_controller_key_new (editable_widget);
	_g_object_unref0 (self->priv->key_controller);
	self->priv->key_controller = _tmp0_;
	_tmp1_ = self->priv->key_controller;
	g_signal_connect_object (_tmp1_, "key-pressed", (GCallback) _files_abstract_editable_label_on_key_press_event_gtk_event_controller_key_key_pressed, self, 0);
	g_signal_connect_object (editable_widget, "button-press-event", (GCallback) ___lambda71__gtk_widget_button_press_event, self, G_CONNECT_AFTER);
}

static gboolean
files_abstract_editable_label_real_on_key_press_event (FilesAbstractEditableLabel* self,
                                                       guint keyval,
                                                       guint keycode,
                                                       GdkModifierType state)
{
	GdkModifierType mods = 0U;
	gboolean only_control_pressed = FALSE;
	gboolean result;
	mods = state & gtk_accelerator_get_default_mod_mask ();
	only_control_pressed = mods == GDK_CONTROL_MASK;
	switch (keyval) {
		case GDK_KEY_Return:
		case GDK_KEY_KP_Enter:
		{
			if (mods == 0) {
				files_abstract_editable_label_end_editing (self, FALSE);
				result = TRUE;
				return result;
			}
			break;
		}
		case GDK_KEY_Escape:
		{
			files_abstract_editable_label_end_editing (self, TRUE);
			result = TRUE;
			return result;
		}
		case GDK_KEY_z:
		{
			if (only_control_pressed) {
				const gchar* _tmp0_;
				_tmp0_ = self->original_name;
				files_abstract_editable_label_set_text (self, _tmp0_);
				result = TRUE;
				return result;
			}
			break;
		}
		default:
		{
			break;
		}
	}
	result = FALSE;
	return result;
}

gboolean
files_abstract_editable_label_on_key_press_event (FilesAbstractEditableLabel* self,
                                                  guint keyval,
                                                  guint keycode,
                                                  GdkModifierType state)
{
	FilesAbstractEditableLabelClass* _klass_;
	g_return_val_if_fail (self != NULL, FALSE);
	_klass_ = FILES_ABSTRACT_EDITABLE_LABEL_GET_CLASS (self);
	if (_klass_->on_key_press_event) {
		return _klass_->on_key_press_event (self, keyval, keycode, state);
	}
	return FALSE;
}

void
files_abstract_editable_label_end_editing (FilesAbstractEditableLabel* self,
                                           gboolean cancelled)
{
	g_return_if_fail (self != NULL);
	files_abstract_editable_label_set_editing_canceled (self, cancelled);
	gtk_cell_editable_remove_widget ((GtkCellEditable*) self);
	gtk_cell_editable_editing_done ((GtkCellEditable*) self);
}

static void
files_abstract_editable_label_real_set_text (FilesAbstractEditableLabel* self,
                                             const gchar* text)
{
	gchar* _tmp0_;
	g_return_if_fail (text != NULL);
	_tmp0_ = g_strdup (text);
	_g_free0 (self->original_name);
	self->original_name = _tmp0_;
}

void
files_abstract_editable_label_set_text (FilesAbstractEditableLabel* self,
                                        const gchar* text)
{
	FilesAbstractEditableLabelClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = FILES_ABSTRACT_EDITABLE_LABEL_GET_CLASS (self);
	if (_klass_->set_text) {
		_klass_->set_text (self, text);
	}
}

static void
files_abstract_editable_label_real_set_line_wrap (FilesAbstractEditableLabel* self,
                                                  gboolean wrap)
{
}

void
files_abstract_editable_label_set_line_wrap (FilesAbstractEditableLabel* self,
                                             gboolean wrap)
{
	FilesAbstractEditableLabelClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = FILES_ABSTRACT_EDITABLE_LABEL_GET_CLASS (self);
	if (_klass_->set_line_wrap) {
		_klass_->set_line_wrap (self, wrap);
	}
}

static void
files_abstract_editable_label_real_set_line_wrap_mode (FilesAbstractEditableLabel* self,
                                                       PangoWrapMode mode)
{
}

void
files_abstract_editable_label_set_line_wrap_mode (FilesAbstractEditableLabel* self,
                                                  PangoWrapMode mode)
{
	FilesAbstractEditableLabelClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = FILES_ABSTRACT_EDITABLE_LABEL_GET_CLASS (self);
	if (_klass_->set_line_wrap_mode) {
		_klass_->set_line_wrap_mode (self, mode);
	}
}

static void
files_abstract_editable_label_real_set_justify (FilesAbstractEditableLabel* self,
                                                GtkJustification jtype)
{
}

void
files_abstract_editable_label_set_justify (FilesAbstractEditableLabel* self,
                                           GtkJustification jtype)
{
	FilesAbstractEditableLabelClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = FILES_ABSTRACT_EDITABLE_LABEL_GET_CLASS (self);
	if (_klass_->set_justify) {
		_klass_->set_justify (self, jtype);
	}
}

static void
files_abstract_editable_label_real_set_padding (FilesAbstractEditableLabel* self,
                                                gint xpad,
                                                gint ypad)
{
}

void
files_abstract_editable_label_set_padding (FilesAbstractEditableLabel* self,
                                           gint xpad,
                                           gint ypad)
{
	FilesAbstractEditableLabelClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = FILES_ABSTRACT_EDITABLE_LABEL_GET_CLASS (self);
	if (_klass_->set_padding) {
		_klass_->set_padding (self, xpad, ypad);
	}
}

static void
files_abstract_editable_label_real_set_size_request (FilesAbstractEditableLabel* self,
                                                     gint width,
                                                     gint height)
{
	g_critical ("Type `%s' does not implement abstract method `files_abstract_editable_label_set_size_request'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}

void
files_abstract_editable_label_set_size_request (FilesAbstractEditableLabel* self,
                                                gint width,
                                                gint height)
{
	FilesAbstractEditableLabelClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = FILES_ABSTRACT_EDITABLE_LABEL_GET_CLASS (self);
	if (_klass_->set_size_request) {
		_klass_->set_size_request (self, width, height);
	}
}

static gchar*
files_abstract_editable_label_real_get_text (FilesAbstractEditableLabel* self)
{
	g_critical ("Type `%s' does not implement abstract method `files_abstract_editable_label_get_text'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}

gchar*
files_abstract_editable_label_get_text (FilesAbstractEditableLabel* self)
{
	FilesAbstractEditableLabelClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = FILES_ABSTRACT_EDITABLE_LABEL_GET_CLASS (self);
	if (_klass_->get_text) {
		return _klass_->get_text (self);
	}
	return NULL;
}

static void
files_abstract_editable_label_real_select_region (FilesAbstractEditableLabel* self,
                                                  gint start_pos,
                                                  gint end_pos)
{
	g_critical ("Type `%s' does not implement abstract method `files_abstract_editable_label_select_region'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}

void
files_abstract_editable_label_select_region (FilesAbstractEditableLabel* self,
                                             gint start_pos,
                                             gint end_pos)
{
	FilesAbstractEditableLabelClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = FILES_ABSTRACT_EDITABLE_LABEL_GET_CLASS (self);
	if (_klass_->select_region) {
		_klass_->select_region (self, start_pos, end_pos);
	}
}

static void
files_abstract_editable_label_real_do_delete_text (FilesAbstractEditableLabel* self,
                                                   gint start_pos,
                                                   gint end_pos)
{
	g_critical ("Type `%s' does not implement abstract method `files_abstract_editable_label_do_delete_text'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}

void
files_abstract_editable_label_do_delete_text (FilesAbstractEditableLabel* self,
                                              gint start_pos,
                                              gint end_pos)
{
	FilesAbstractEditableLabelClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = FILES_ABSTRACT_EDITABLE_LABEL_GET_CLASS (self);
	if (_klass_->do_delete_text) {
		_klass_->do_delete_text (self, start_pos, end_pos);
	}
}

static void
files_abstract_editable_label_real_do_insert_text (FilesAbstractEditableLabel* self,
                                                   const gchar* new_text,
                                                   gint new_text_length,
                                                   gint* position)
{
	g_critical ("Type `%s' does not implement abstract method `files_abstract_editable_label_do_insert_text'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}

void
files_abstract_editable_label_do_insert_text (FilesAbstractEditableLabel* self,
                                              const gchar* new_text,
                                              gint new_text_length,
                                              gint* position)
{
	FilesAbstractEditableLabelClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = FILES_ABSTRACT_EDITABLE_LABEL_GET_CLASS (self);
	if (_klass_->do_insert_text) {
		_klass_->do_insert_text (self, new_text, new_text_length, position);
	}
}

static gchar*
files_abstract_editable_label_real_get_chars (FilesAbstractEditableLabel* self,
                                              gint start_pos,
                                              gint end_pos)
{
	g_critical ("Type `%s' does not implement abstract method `files_abstract_editable_label_get_chars'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}

gchar*
files_abstract_editable_label_get_chars (FilesAbstractEditableLabel* self,
                                         gint start_pos,
                                         gint end_pos)
{
	FilesAbstractEditableLabelClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = FILES_ABSTRACT_EDITABLE_LABEL_GET_CLASS (self);
	if (_klass_->get_chars) {
		return _klass_->get_chars (self, start_pos, end_pos);
	}
	return NULL;
}

static gint
files_abstract_editable_label_real_get_position (FilesAbstractEditableLabel* self)
{
	gint _tmp0_ = 0;
	g_critical ("Type `%s' does not implement abstract method `files_abstract_editable_label_get_position'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return _tmp0_;
}

gint
files_abstract_editable_label_get_position (FilesAbstractEditableLabel* self)
{
	FilesAbstractEditableLabelClass* _klass_;
	g_return_val_if_fail (self != NULL, -1);
	_klass_ = FILES_ABSTRACT_EDITABLE_LABEL_GET_CLASS (self);
	if (_klass_->get_position) {
		return _klass_->get_position (self);
	}
	return -1;
}

static gboolean
files_abstract_editable_label_real_get_selection_bounds (FilesAbstractEditableLabel* self,
                                                         gint* start_pos,
                                                         gint* end_pos)
{
	gboolean _tmp0_ = FALSE;
	g_critical ("Type `%s' does not implement abstract method `files_abstract_editable_label_get_selection_bounds'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return _tmp0_;
}

gboolean
files_abstract_editable_label_get_selection_bounds (FilesAbstractEditableLabel* self,
                                                    gint* start_pos,
                                                    gint* end_pos)
{
	FilesAbstractEditableLabelClass* _klass_;
	g_return_val_if_fail (self != NULL, FALSE);
	_klass_ = FILES_ABSTRACT_EDITABLE_LABEL_GET_CLASS (self);
	if (_klass_->get_selection_bounds) {
		return _klass_->get_selection_bounds (self, start_pos, end_pos);
	}
	return FALSE;
}

static void
files_abstract_editable_label_real_set_position (FilesAbstractEditableLabel* self,
                                                 gint position)
{
	g_critical ("Type `%s' does not implement abstract method `files_abstract_editable_label_set_position'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}

void
files_abstract_editable_label_set_position (FilesAbstractEditableLabel* self,
                                            gint position)
{
	FilesAbstractEditableLabelClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = FILES_ABSTRACT_EDITABLE_LABEL_GET_CLASS (self);
	if (_klass_->set_position) {
		_klass_->set_position (self, position);
	}
}

/** CellEditable interface */
static void
files_abstract_editable_label_real_start_editing (FilesAbstractEditableLabel* self,
                                                  GdkEvent* event)
{
}

void
files_abstract_editable_label_start_editing (FilesAbstractEditableLabel* self,
                                             GdkEvent* event)
{
	FilesAbstractEditableLabelClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = FILES_ABSTRACT_EDITABLE_LABEL_GET_CLASS (self);
	if (_klass_->start_editing) {
		_klass_->start_editing (self, event);
	}
}

FilesAbstractEditableLabel*
files_abstract_editable_label_construct (GType object_type)
{
	FilesAbstractEditableLabel * self = NULL;
	self = (FilesAbstractEditableLabel*) g_object_new (object_type, NULL);
	return self;
}

gboolean
files_abstract_editable_label_get_editing_canceled (FilesAbstractEditableLabel* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_editing_canceled;
	return result;
}

void
files_abstract_editable_label_set_editing_canceled (FilesAbstractEditableLabel* self,
                                                    gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = files_abstract_editable_label_get_editing_canceled (self);
	if (old_value != value) {
		self->priv->_editing_canceled = value;
		g_object_notify_by_pspec ((GObject *) self, files_abstract_editable_label_properties[FILES_ABSTRACT_EDITABLE_LABEL_EDITING_CANCELED_PROPERTY]);
	}
}

static void
files_abstract_editable_label_class_init (FilesAbstractEditableLabelClass * klass,
                                          gpointer klass_data)
{
	files_abstract_editable_label_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FilesAbstractEditableLabel_private_offset);
	((FilesAbstractEditableLabelClass *) klass)->on_key_press_event = (gboolean (*) (FilesAbstractEditableLabel*, guint, guint, GdkModifierType)) files_abstract_editable_label_real_on_key_press_event;
	((FilesAbstractEditableLabelClass *) klass)->set_text = (void (*) (FilesAbstractEditableLabel*, const gchar*)) files_abstract_editable_label_real_set_text;
	((FilesAbstractEditableLabelClass *) klass)->set_line_wrap = (void (*) (FilesAbstractEditableLabel*, gboolean)) files_abstract_editable_label_real_set_line_wrap;
	((FilesAbstractEditableLabelClass *) klass)->set_line_wrap_mode = (void (*) (FilesAbstractEditableLabel*, PangoWrapMode)) files_abstract_editable_label_real_set_line_wrap_mode;
	((FilesAbstractEditableLabelClass *) klass)->set_justify = (void (*) (FilesAbstractEditableLabel*, GtkJustification)) files_abstract_editable_label_real_set_justify;
	((FilesAbstractEditableLabelClass *) klass)->set_padding = (void (*) (FilesAbstractEditableLabel*, gint, gint)) files_abstract_editable_label_real_set_padding;
	((FilesAbstractEditableLabelClass *) klass)->set_size_request = (void (*) (FilesAbstractEditableLabel*, gint, gint)) files_abstract_editable_label_real_set_size_request;
	((FilesAbstractEditableLabelClass *) klass)->get_text = (gchar* (*) (FilesAbstractEditableLabel*)) files_abstract_editable_label_real_get_text;
	((FilesAbstractEditableLabelClass *) klass)->select_region = (void (*) (FilesAbstractEditableLabel*, gint, gint)) files_abstract_editable_label_real_select_region;
	((FilesAbstractEditableLabelClass *) klass)->do_delete_text = (void (*) (FilesAbstractEditableLabel*, gint, gint)) files_abstract_editable_label_real_do_delete_text;
	((FilesAbstractEditableLabelClass *) klass)->do_insert_text = (void (*) (FilesAbstractEditableLabel*, const gchar*, gint, gint*)) files_abstract_editable_label_real_do_insert_text;
	((FilesAbstractEditableLabelClass *) klass)->get_chars = (gchar* (*) (FilesAbstractEditableLabel*, gint, gint)) files_abstract_editable_label_real_get_chars;
	((FilesAbstractEditableLabelClass *) klass)->get_position = (gint (*) (FilesAbstractEditableLabel*)) files_abstract_editable_label_real_get_position;
	((FilesAbstractEditableLabelClass *) klass)->get_selection_bounds = (gboolean (*) (FilesAbstractEditableLabel*, gint*, gint*)) files_abstract_editable_label_real_get_selection_bounds;
	((FilesAbstractEditableLabelClass *) klass)->set_position = (void (*) (FilesAbstractEditableLabel*, gint)) files_abstract_editable_label_real_set_position;
	((FilesAbstractEditableLabelClass *) klass)->start_editing = (void (*) (FilesAbstractEditableLabel*, GdkEvent*)) files_abstract_editable_label_real_start_editing;
	G_OBJECT_CLASS (klass)->get_property = _vala_files_abstract_editable_label_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_files_abstract_editable_label_set_property;
	G_OBJECT_CLASS (klass)->finalize = files_abstract_editable_label_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FILES_ABSTRACT_EDITABLE_LABEL_EDITING_CANCELED_PROPERTY, files_abstract_editable_label_properties[FILES_ABSTRACT_EDITABLE_LABEL_EDITING_CANCELED_PROPERTY] = g_param_spec_boolean ("editing-canceled", "editing-canceled", "editing-canceled", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
files_abstract_editable_label_gtk_editable_interface_init (GtkEditableInterface * iface,
                                                           gpointer iface_data)
{
	files_abstract_editable_label_gtk_editable_parent_iface = g_type_interface_peek_parent (iface);
	iface->set_selection_bounds = (void (*) (GtkEditable*, gint, gint)) files_abstract_editable_label_select_region;
	iface->delete_text = (void (*) (GtkEditable*, gint, gint)) files_abstract_editable_label_do_delete_text;
	iface->insert_text = (void (*) (GtkEditable*, const gchar*, gint, gint*)) files_abstract_editable_label_do_insert_text;
	iface->get_chars = (gchar* (*) (GtkEditable*, gint, gint)) files_abstract_editable_label_get_chars;
	iface->get_position = (gint (*) (GtkEditable*)) files_abstract_editable_label_get_position;
	iface->get_selection_bounds = (gboolean (*) (GtkEditable*, gint*, gint*)) files_abstract_editable_label_get_selection_bounds;
	iface->set_position = (void (*) (GtkEditable*, gint)) files_abstract_editable_label_set_position;
}

static void
files_abstract_editable_label_gtk_cell_editable_interface_init (GtkCellEditableIface * iface,
                                                                gpointer iface_data)
{
	files_abstract_editable_label_gtk_cell_editable_parent_iface = g_type_interface_peek_parent (iface);
	iface->start_editing = (void (*) (GtkCellEditable*, GdkEvent*)) files_abstract_editable_label_start_editing;
}

static void
files_abstract_editable_label_instance_init (FilesAbstractEditableLabel * self,
                                             gpointer klass)
{
	self->priv = files_abstract_editable_label_get_instance_private (self);
}

static void
files_abstract_editable_label_finalize (GObject * obj)
{
	FilesAbstractEditableLabel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FILES_TYPE_ABSTRACT_EDITABLE_LABEL, FilesAbstractEditableLabel);
	_g_free0 (self->original_name);
	_g_object_unref0 (self->priv->key_controller);
	G_OBJECT_CLASS (files_abstract_editable_label_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
files_abstract_editable_label_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FilesAbstractEditableLabelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) files_abstract_editable_label_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FilesAbstractEditableLabel), 0, (GInstanceInitFunc) files_abstract_editable_label_instance_init, NULL };
	static const GInterfaceInfo gtk_editable_info = { (GInterfaceInitFunc) files_abstract_editable_label_gtk_editable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo gtk_cell_editable_info = { (GInterfaceInitFunc) files_abstract_editable_label_gtk_cell_editable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType files_abstract_editable_label_type_id;
	files_abstract_editable_label_type_id = g_type_register_static (gtk_frame_get_type (), "FilesAbstractEditableLabel", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	g_type_add_interface_static (files_abstract_editable_label_type_id, gtk_editable_get_type (), &gtk_editable_info);
	g_type_add_interface_static (files_abstract_editable_label_type_id, gtk_cell_editable_get_type (), &gtk_cell_editable_info);
	FilesAbstractEditableLabel_private_offset = g_type_add_instance_private (files_abstract_editable_label_type_id, sizeof (FilesAbstractEditableLabelPrivate));
	return files_abstract_editable_label_type_id;
}

GType
files_abstract_editable_label_get_type (void)
{
	static volatile gsize files_abstract_editable_label_type_id__once = 0;
	if (g_once_init_enter (&files_abstract_editable_label_type_id__once)) {
		GType files_abstract_editable_label_type_id;
		files_abstract_editable_label_type_id = files_abstract_editable_label_get_type_once ();
		g_once_init_leave (&files_abstract_editable_label_type_id__once, files_abstract_editable_label_type_id);
	}
	return files_abstract_editable_label_type_id__once;
}

static void
_vala_files_abstract_editable_label_get_property (GObject * object,
                                                  guint property_id,
                                                  GValue * value,
                                                  GParamSpec * pspec)
{
	FilesAbstractEditableLabel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FILES_TYPE_ABSTRACT_EDITABLE_LABEL, FilesAbstractEditableLabel);
	switch (property_id) {
		case FILES_ABSTRACT_EDITABLE_LABEL_EDITING_CANCELED_PROPERTY:
		g_value_set_boolean (value, files_abstract_editable_label_get_editing_canceled (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_files_abstract_editable_label_set_property (GObject * object,
                                                  guint property_id,
                                                  const GValue * value,
                                                  GParamSpec * pspec)
{
	FilesAbstractEditableLabel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FILES_TYPE_ABSTRACT_EDITABLE_LABEL, FilesAbstractEditableLabel);
	switch (property_id) {
		case FILES_ABSTRACT_EDITABLE_LABEL_EDITING_CANCELED_PROPERTY:
		files_abstract_editable_label_set_editing_canceled (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

