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

/*
* Copyright (c) 2016 elementary LLC. (https://github.com/elementary/photos)
*
* 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
*
* Authored by: Corentin Noël <corentin@elementary.io>
*/

#include "io.elementary.photos.h"
#include <gtk/gtk.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gdk/gdk.h>
#include <pango/pango.h>
#include <float.h>
#include <math.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  {
	EDITABLE_TITLE_0_PROPERTY,
	EDITABLE_TITLE_TEXT_PROPERTY,
	EDITABLE_TITLE_NUM_PROPERTIES
};
static GParamSpec* editable_title_properties[EDITABLE_TITLE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block29Data Block29Data;
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	EDITABLE_TITLE_CHANGED_SIGNAL,
	EDITABLE_TITLE_NUM_SIGNALS
};
static guint editable_title_signals[EDITABLE_TITLE_NUM_SIGNALS] = {0};

struct _EditableTitlePrivate {
	GtkLabel* title;
	GtkEntry* entry;
	GtkStack* stack;
	GtkGrid* grid;
};

struct _Block29Data {
	int _ref_count_;
	EditableTitle* self;
	GtkRevealer* button_revealer;
};

static gint EditableTitle_private_offset;
static gpointer editable_title_parent_class = NULL;

static Block29Data* block29_data_ref (Block29Data* _data29_);
static void block29_data_unref (void * _userdata_);
static gboolean __lambda9_ (Block29Data* _data29_,
                     GdkEventCrossing* event);
static gboolean ___lambda9__gtk_widget_enter_notify_event (GtkWidget* _sender,
                                                    GdkEventCrossing* event,
                                                    gpointer self);
static gboolean __lambda10_ (Block29Data* _data29_,
                      GdkEventCrossing* event);
static gboolean ___lambda10__gtk_widget_leave_notify_event (GtkWidget* _sender,
                                                     GdkEventCrossing* event,
                                                     gpointer self);
static gboolean __lambda11_ (EditableTitle* self,
                      GdkEventButton* event);
static void editable_title_set_editing (EditableTitle* self,
                                 gboolean value);
static gboolean ___lambda11__gtk_widget_button_press_event (GtkWidget* _sender,
                                                     GdkEventButton* event,
                                                     gpointer self);
static void __lambda12_ (EditableTitle* self);
static void ___lambda12__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static void __lambda13_ (EditableTitle* self);
static void ___lambda13__gtk_entry_activate (GtkEntry* _sender,
                                      gpointer self);
static gboolean __lambda14_ (EditableTitle* self,
                      GdkEventFocus* event);
static gboolean ___lambda14__gtk_widget_focus_out_event (GtkWidget* _sender,
                                                  GdkEventFocus* event,
                                                  gpointer self);
static void __lambda15_ (EditableTitle* self,
                  GtkEntryIconPosition p0,
                  GdkEvent* p1);
static void ___lambda15__gtk_entry_icon_release (GtkEntry* _sender,
                                          GtkEntryIconPosition icon_pos,
                                          GdkEvent* event,
                                          gpointer self);
static void editable_title_finalize (GObject * obj);
static GType editable_title_get_type_once (void);
static void _vala_editable_title_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec);
static void _vala_editable_title_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
editable_title_get_instance_private (EditableTitle* self)
{
	return G_STRUCT_MEMBER_P (self, EditableTitle_private_offset);
}

static Block29Data*
block29_data_ref (Block29Data* _data29_)
{
	g_atomic_int_inc (&_data29_->_ref_count_);
	return _data29_;
}

static void
block29_data_unref (void * _userdata_)
{
	Block29Data* _data29_;
	_data29_ = (Block29Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data29_->_ref_count_)) {
		EditableTitle* self;
		self = _data29_->self;
		_g_object_unref0 (_data29_->button_revealer);
		_g_object_unref0 (self);
		g_slice_free (Block29Data, _data29_);
	}
}

static gboolean
__lambda9_ (Block29Data* _data29_,
            GdkEventCrossing* event)
{
	EditableTitle* self;
	gboolean result;
	self = _data29_->self;
	g_return_val_if_fail (event != NULL, FALSE);
	if (event->detail != GDK_NOTIFY_INFERIOR) {
		gtk_revealer_set_reveal_child (_data29_->button_revealer, TRUE);
	}
	result = FALSE;
	return result;
}

static gboolean
___lambda9__gtk_widget_enter_notify_event (GtkWidget* _sender,
                                           GdkEventCrossing* event,
                                           gpointer self)
{
	gboolean result;
	result = __lambda9_ (self, event);
	return result;
}

static gboolean
__lambda10_ (Block29Data* _data29_,
             GdkEventCrossing* event)
{
	EditableTitle* self;
	gboolean result;
	self = _data29_->self;
	g_return_val_if_fail (event != NULL, FALSE);
	if (event->detail != GDK_NOTIFY_INFERIOR) {
		gtk_revealer_set_reveal_child (_data29_->button_revealer, FALSE);
	}
	result = FALSE;
	return result;
}

static gboolean
___lambda10__gtk_widget_leave_notify_event (GtkWidget* _sender,
                                            GdkEventCrossing* event,
                                            gpointer self)
{
	gboolean result;
	result = __lambda10_ (self, event);
	return result;
}

static gboolean
__lambda11_ (EditableTitle* self,
             GdkEventButton* event)
{
	gboolean result;
	g_return_val_if_fail (event != NULL, FALSE);
	editable_title_set_editing (self, TRUE);
	result = FALSE;
	return result;
}

static gboolean
___lambda11__gtk_widget_button_press_event (GtkWidget* _sender,
                                            GdkEventButton* event,
                                            gpointer self)
{
	gboolean result;
	result = __lambda11_ ((EditableTitle*) self, event);
	return result;
}

static void
__lambda12_ (EditableTitle* self)
{
	editable_title_set_editing (self, TRUE);
}

static void
___lambda12__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda12_ ((EditableTitle*) self);
}

static void
__lambda13_ (EditableTitle* self)
{
	editable_title_set_editing (self, FALSE);
}

static void
___lambda13__gtk_entry_activate (GtkEntry* _sender,
                                 gpointer self)
{
	__lambda13_ ((EditableTitle*) self);
}

static gboolean
__lambda14_ (EditableTitle* self,
             GdkEventFocus* event)
{
	gboolean result;
	g_return_val_if_fail (event != NULL, FALSE);
	editable_title_set_editing (self, FALSE);
	result = FALSE;
	return result;
}

static gboolean
___lambda14__gtk_widget_focus_out_event (GtkWidget* _sender,
                                         GdkEventFocus* event,
                                         gpointer self)
{
	gboolean result;
	result = __lambda14_ ((EditableTitle*) self, event);
	return result;
}

static void
__lambda15_ (EditableTitle* self,
             GtkEntryIconPosition p0,
             GdkEvent* p1)
{
	g_return_if_fail (p1 != NULL);
	if (p0 == GTK_ENTRY_ICON_SECONDARY) {
		editable_title_set_editing (self, FALSE);
	}
}

static void
___lambda15__gtk_entry_icon_release (GtkEntry* _sender,
                                     GtkEntryIconPosition icon_pos,
                                     GdkEvent* event,
                                     gpointer self)
{
	__lambda15_ ((EditableTitle*) self, icon_pos, event);
}

EditableTitle*
editable_title_construct (GType object_type,
                          const gchar* title_name)
{
	EditableTitle * self = NULL;
	Block29Data* _data29_;
	GdkEventMask _tmp0_;
	GdkEventMask _tmp1_;
	GdkEventMask _tmp2_;
	GdkEventMask _tmp3_;
	GdkEventMask _tmp4_;
	GdkEventMask _tmp5_;
	GtkLabel* _tmp6_;
	GtkLabel* _tmp7_;
	GtkLabel* _tmp8_;
	GtkStyleContext* _tmp9_;
	GtkLabel* _tmp10_;
	GtkLabel* _tmp11_;
	GtkButton* edit_button = NULL;
	GtkButton* _tmp12_;
	GtkImage* _tmp13_;
	GtkImage* _tmp14_;
	GtkStyleContext* _tmp15_;
	GtkRevealer* _tmp16_;
	GtkGrid* _tmp17_;
	GtkGrid* _tmp18_;
	GtkGrid* _tmp19_;
	GtkGrid* _tmp20_;
	GtkLabel* _tmp21_;
	GtkGrid* _tmp22_;
	GtkEntry* _tmp23_;
	GtkEntry* _tmp24_;
	GtkStack* _tmp25_;
	GtkStack* _tmp26_;
	GtkStack* _tmp27_;
	GtkGrid* _tmp28_;
	GtkStack* _tmp29_;
	GtkEntry* _tmp30_;
	GtkStack* _tmp31_;
	GtkEntry* _tmp32_;
	GtkEntry* _tmp33_;
	GtkEntry* _tmp34_;
	_data29_ = g_slice_new0 (Block29Data);
	_data29_->_ref_count_ = 1;
	self = (EditableTitle*) g_object_new (object_type, NULL);
	_data29_->self = g_object_ref (self);
	gtk_widget_set_valign ((GtkWidget*) self, GTK_ALIGN_CENTER);
	_tmp0_ = gtk_widget_get_events ((GtkWidget*) self);
	_tmp1_ = _tmp0_;
	gtk_widget_set_events ((GtkWidget*) self, _tmp1_ | GDK_ENTER_NOTIFY_MASK);
	_tmp2_ = gtk_widget_get_events ((GtkWidget*) self);
	_tmp3_ = _tmp2_;
	gtk_widget_set_events ((GtkWidget*) self, _tmp3_ | GDK_LEAVE_NOTIFY_MASK);
	_tmp4_ = gtk_widget_get_events ((GtkWidget*) self);
	_tmp5_ = _tmp4_;
	gtk_widget_set_events ((GtkWidget*) self, _tmp5_ | GDK_BUTTON_PRESS_MASK);
	_tmp6_ = (GtkLabel*) gtk_label_new (title_name);
	g_object_ref_sink (_tmp6_);
	_g_object_unref0 (self->priv->title);
	self->priv->title = _tmp6_;
	_tmp7_ = self->priv->title;
	gtk_label_set_ellipsize (_tmp7_, PANGO_ELLIPSIZE_END);
	_tmp8_ = self->priv->title;
	_tmp9_ = gtk_widget_get_style_context ((GtkWidget*) _tmp8_);
	gtk_style_context_add_class (_tmp9_, "h3");
	_tmp10_ = self->priv->title;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp10_, TRUE);
	_tmp11_ = self->priv->title;
	g_object_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, gtk_misc_get_type (), GtkMisc), "xalign", (gfloat) 0, NULL);
	_tmp12_ = (GtkButton*) gtk_button_new ();
	g_object_ref_sink (_tmp12_);
	edit_button = _tmp12_;
	_tmp13_ = (GtkImage*) gtk_image_new_from_icon_name ("edit-symbolic", (GtkIconSize) GTK_ICON_SIZE_MENU);
	g_object_ref_sink (_tmp13_);
	_tmp14_ = _tmp13_;
	gtk_button_set_image (edit_button, (GtkWidget*) _tmp14_);
	_g_object_unref0 (_tmp14_);
	_tmp15_ = gtk_widget_get_style_context ((GtkWidget*) edit_button);
	gtk_style_context_add_class (_tmp15_, GTK_STYLE_CLASS_FLAT);
	_tmp16_ = (GtkRevealer*) gtk_revealer_new ();
	g_object_ref_sink (_tmp16_);
	_data29_->button_revealer = _tmp16_;
	gtk_widget_set_valign ((GtkWidget*) _data29_->button_revealer, GTK_ALIGN_CENTER);
	gtk_revealer_set_transition_type (_data29_->button_revealer, GTK_REVEALER_TRANSITION_TYPE_CROSSFADE);
	gtk_container_add ((GtkContainer*) _data29_->button_revealer, (GtkWidget*) edit_button);
	_tmp17_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp17_);
	_g_object_unref0 (self->priv->grid);
	self->priv->grid = _tmp17_;
	_tmp18_ = self->priv->grid;
	gtk_widget_set_valign ((GtkWidget*) _tmp18_, GTK_ALIGN_CENTER);
	_tmp19_ = self->priv->grid;
	gtk_grid_set_column_spacing (_tmp19_, 12);
	_tmp20_ = self->priv->grid;
	_tmp21_ = self->priv->title;
	gtk_container_add ((GtkContainer*) _tmp20_, (GtkWidget*) _tmp21_);
	_tmp22_ = self->priv->grid;
	gtk_container_add ((GtkContainer*) _tmp22_, (GtkWidget*) _data29_->button_revealer);
	_tmp23_ = (GtkEntry*) gtk_entry_new ();
	g_object_ref_sink (_tmp23_);
	_g_object_unref0 (self->priv->entry);
	self->priv->entry = _tmp23_;
	_tmp24_ = self->priv->entry;
	g_object_set (_tmp24_, "secondary-icon-name", "go-jump-symbolic", NULL);
	_tmp25_ = (GtkStack*) gtk_stack_new ();
	g_object_ref_sink (_tmp25_);
	_g_object_unref0 (self->priv->stack);
	self->priv->stack = _tmp25_;
	_tmp26_ = self->priv->stack;
	gtk_stack_set_transition_type (_tmp26_, GTK_STACK_TRANSITION_TYPE_CROSSFADE);
	_tmp27_ = self->priv->stack;
	_tmp28_ = self->priv->grid;
	gtk_container_add ((GtkContainer*) _tmp27_, (GtkWidget*) _tmp28_);
	_tmp29_ = self->priv->stack;
	_tmp30_ = self->priv->entry;
	gtk_container_add ((GtkContainer*) _tmp29_, (GtkWidget*) _tmp30_);
	_tmp31_ = self->priv->stack;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp31_);
	g_signal_connect_data ((GtkWidget*) self, "enter-notify-event", (GCallback) ___lambda9__gtk_widget_enter_notify_event, block29_data_ref (_data29_), (GClosureNotify) block29_data_unref, 0);
	g_signal_connect_data ((GtkWidget*) self, "leave-notify-event", (GCallback) ___lambda10__gtk_widget_leave_notify_event, block29_data_ref (_data29_), (GClosureNotify) block29_data_unref, 0);
	g_signal_connect_object ((GtkWidget*) self, "button-press-event", (GCallback) ___lambda11__gtk_widget_button_press_event, self, 0);
	g_signal_connect_object (edit_button, "clicked", (GCallback) ___lambda12__gtk_button_clicked, self, 0);
	_tmp32_ = self->priv->entry;
	g_signal_connect_object (_tmp32_, "activate", (GCallback) ___lambda13__gtk_entry_activate, self, 0);
	_tmp33_ = self->priv->entry;
	g_signal_connect_object ((GtkWidget*) _tmp33_, "focus-out-event", (GCallback) ___lambda14__gtk_widget_focus_out_event, self, 0);
	_tmp34_ = self->priv->entry;
	g_signal_connect_object (_tmp34_, "icon-release", (GCallback) ___lambda15__gtk_entry_icon_release, self, 0);
	_g_object_unref0 (edit_button);
	block29_data_unref (_data29_);
	_data29_ = NULL;
	return self;
}

EditableTitle*
editable_title_new (const gchar* title_name)
{
	return editable_title_construct (TYPE_EDITABLE_TITLE, title_name);
}

const gchar*
editable_title_get_text (EditableTitle* self)
{
	const gchar* result;
	GtkLabel* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->title;
	_tmp1_ = gtk_label_get_label (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

void
editable_title_set_text (EditableTitle* self,
                         const gchar* value)
{
	GtkLabel* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->title;
	gtk_label_set_label (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, editable_title_properties[EDITABLE_TITLE_TEXT_PROPERTY]);
}

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

static void
editable_title_set_editing (EditableTitle* self,
                            gboolean value)
{
	g_return_if_fail (self != NULL);
	if (value) {
		GtkEntry* _tmp0_;
		GtkLabel* _tmp1_;
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		GtkStack* _tmp4_;
		GtkEntry* _tmp5_;
		GtkEntry* _tmp6_;
		_tmp0_ = self->priv->entry;
		_tmp1_ = self->priv->title;
		_tmp2_ = gtk_label_get_label (_tmp1_);
		_tmp3_ = _tmp2_;
		gtk_entry_set_text (_tmp0_, _tmp3_);
		_tmp4_ = self->priv->stack;
		_tmp5_ = self->priv->entry;
		gtk_stack_set_visible_child (_tmp4_, (GtkWidget*) _tmp5_);
		_tmp6_ = self->priv->entry;
		gtk_widget_grab_focus ((GtkWidget*) _tmp6_);
	} else {
		gboolean _tmp7_ = FALSE;
		GtkEntry* _tmp8_;
		const gchar* _tmp9_;
		const gchar* _tmp10_;
		gchar* _tmp11_;
		gchar* _tmp12_;
		gboolean _tmp13_;
		GtkStack* _tmp27_;
		GtkGrid* _tmp28_;
		_tmp8_ = self->priv->entry;
		_tmp9_ = gtk_entry_get_text (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = string_strip (_tmp10_);
		_tmp12_ = _tmp11_;
		_tmp13_ = g_strcmp0 (_tmp12_, "") != 0;
		_g_free0 (_tmp12_);
		if (_tmp13_) {
			GtkLabel* _tmp14_;
			const gchar* _tmp15_;
			const gchar* _tmp16_;
			GtkEntry* _tmp17_;
			const gchar* _tmp18_;
			const gchar* _tmp19_;
			_tmp14_ = self->priv->title;
			_tmp15_ = gtk_label_get_label (_tmp14_);
			_tmp16_ = _tmp15_;
			_tmp17_ = self->priv->entry;
			_tmp18_ = gtk_entry_get_text (_tmp17_);
			_tmp19_ = _tmp18_;
			_tmp7_ = g_strcmp0 (_tmp16_, _tmp19_) != 0;
		} else {
			_tmp7_ = FALSE;
		}
		if (_tmp7_) {
			GtkLabel* _tmp20_;
			GtkEntry* _tmp21_;
			const gchar* _tmp22_;
			const gchar* _tmp23_;
			GtkEntry* _tmp24_;
			const gchar* _tmp25_;
			const gchar* _tmp26_;
			_tmp20_ = self->priv->title;
			_tmp21_ = self->priv->entry;
			_tmp22_ = gtk_entry_get_text (_tmp21_);
			_tmp23_ = _tmp22_;
			gtk_label_set_label (_tmp20_, _tmp23_);
			_tmp24_ = self->priv->entry;
			_tmp25_ = gtk_entry_get_text (_tmp24_);
			_tmp26_ = _tmp25_;
			g_signal_emit (self, editable_title_signals[EDITABLE_TITLE_CHANGED_SIGNAL], 0, _tmp26_);
		}
		_tmp27_ = self->priv->stack;
		_tmp28_ = self->priv->grid;
		gtk_stack_set_visible_child (_tmp27_, (GtkWidget*) _tmp28_);
	}
}

static void
editable_title_class_init (EditableTitleClass * klass,
                           gpointer klass_data)
{
	editable_title_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &EditableTitle_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_editable_title_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_editable_title_set_property;
	G_OBJECT_CLASS (klass)->finalize = editable_title_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDITABLE_TITLE_TEXT_PROPERTY, editable_title_properties[EDITABLE_TITLE_TEXT_PROPERTY] = g_param_spec_string ("text", "text", "text", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	editable_title_signals[EDITABLE_TITLE_CHANGED_SIGNAL] = g_signal_new ("changed", TYPE_EDITABLE_TITLE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
}

static void
editable_title_instance_init (EditableTitle * self,
                              gpointer klass)
{
	self->priv = editable_title_get_instance_private (self);
}

static void
editable_title_finalize (GObject * obj)
{
	EditableTitle * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_EDITABLE_TITLE, EditableTitle);
	_g_object_unref0 (self->priv->title);
	_g_object_unref0 (self->priv->entry);
	_g_object_unref0 (self->priv->stack);
	_g_object_unref0 (self->priv->grid);
	G_OBJECT_CLASS (editable_title_parent_class)->finalize (obj);
}

static GType
editable_title_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (EditableTitleClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) editable_title_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (EditableTitle), 0, (GInstanceInitFunc) editable_title_instance_init, NULL };
	GType editable_title_type_id;
	editable_title_type_id = g_type_register_static (gtk_event_box_get_type (), "EditableTitle", &g_define_type_info, 0);
	EditableTitle_private_offset = g_type_add_instance_private (editable_title_type_id, sizeof (EditableTitlePrivate));
	return editable_title_type_id;
}

GType
editable_title_get_type (void)
{
	static volatile gsize editable_title_type_id__once = 0;
	if (g_once_init_enter (&editable_title_type_id__once)) {
		GType editable_title_type_id;
		editable_title_type_id = editable_title_get_type_once ();
		g_once_init_leave (&editable_title_type_id__once, editable_title_type_id);
	}
	return editable_title_type_id__once;
}

static void
_vala_editable_title_get_property (GObject * object,
                                   guint property_id,
                                   GValue * value,
                                   GParamSpec * pspec)
{
	EditableTitle * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_EDITABLE_TITLE, EditableTitle);
	switch (property_id) {
		case EDITABLE_TITLE_TEXT_PROPERTY:
		g_value_set_string (value, editable_title_get_text (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_editable_title_set_property (GObject * object,
                                   guint property_id,
                                   const GValue * value,
                                   GParamSpec * pspec)
{
	EditableTitle * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_EDITABLE_TITLE, EditableTitle);
	switch (property_id) {
		case EDITABLE_TITLE_TEXT_PROPERTY:
		editable_title_set_text (self, g_value_get_string (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;
}

