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

/*
 * Copyright 2021-2023 elementary, Inc. (https://elementary.io)
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

#include <gtk/gtk.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib/gi18n-lib.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
#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 TASKS_WIDGETS_ENTRY_POPOVER_TYPE_GENERIC (tasks_widgets_entry_popover_generic_get_type ())
#define TASKS_WIDGETS_ENTRY_POPOVER_GENERIC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TASKS_WIDGETS_ENTRY_POPOVER_TYPE_GENERIC, TasksWidgetsEntryPopoverGeneric))
#define TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TASKS_WIDGETS_ENTRY_POPOVER_TYPE_GENERIC, TasksWidgetsEntryPopoverGenericClass))
#define TASKS_WIDGETS_ENTRY_POPOVER_IS_GENERIC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TASKS_WIDGETS_ENTRY_POPOVER_TYPE_GENERIC))
#define TASKS_WIDGETS_ENTRY_POPOVER_IS_GENERIC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TASKS_WIDGETS_ENTRY_POPOVER_TYPE_GENERIC))
#define TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TASKS_WIDGETS_ENTRY_POPOVER_TYPE_GENERIC, TasksWidgetsEntryPopoverGenericClass))

typedef struct _TasksWidgetsEntryPopoverGeneric TasksWidgetsEntryPopoverGeneric;
typedef struct _TasksWidgetsEntryPopoverGenericClass TasksWidgetsEntryPopoverGenericClass;
typedef struct _TasksWidgetsEntryPopoverGenericPrivate TasksWidgetsEntryPopoverGenericPrivate;
enum  {
	TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_0_PROPERTY,
	TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_T_TYPE,
	TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_T_DUP_FUNC,
	TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_T_DESTROY_FUNC,
	TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_POPOVER_PROPERTY,
	TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_ICON_NAME_PROPERTY,
	TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_PLACEHOLDER_PROPERTY,
	TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_VALUE_PROPERTY,
	TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_NUM_PROPERTIES
};
static GParamSpec* tasks_widgets_entry_popover_generic_properties[TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block33Data Block33Data;
enum  {
	TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_VALUE_FORMAT_SIGNAL,
	TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_VALUE_CHANGED_SIGNAL,
	TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_NUM_SIGNALS
};
static guint tasks_widgets_entry_popover_generic_signals[TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_NUM_SIGNALS] = {0};

struct _TasksWidgetsEntryPopoverGeneric {
	GtkWidget parent_instance;
	TasksWidgetsEntryPopoverGenericPrivate * priv;
};

struct _TasksWidgetsEntryPopoverGenericClass {
	GtkWidgetClass parent_class;
};

struct _TasksWidgetsEntryPopoverGenericPrivate {
	GType t_type;
	GBoxedCopyFunc t_dup_func;
	GDestroyNotify t_destroy_func;
	GtkPopover* _popover;
	gchar* _icon_name;
	gchar* _placeholder;
	gpointer _value;
	gpointer value_on_popover_show;
};

struct _Block33Data {
	int _ref_count_;
	TasksWidgetsEntryPopoverGeneric* self;
	GtkLabel* label;
	GtkRevealer* delete_button_revealer;
};

static gint TasksWidgetsEntryPopoverGeneric_private_offset;
static gpointer tasks_widgets_entry_popover_generic_parent_class = NULL;

VALA_EXTERN GType tasks_widgets_entry_popover_generic_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TasksWidgetsEntryPopoverGeneric, g_object_unref)
VALA_EXTERN TasksWidgetsEntryPopoverGeneric* tasks_widgets_entry_popover_generic_construct (GType object_type,
                                                                                GType t_type,
                                                                                GBoxedCopyFunc t_dup_func,
                                                                                GDestroyNotify t_destroy_func,
                                                                                const gchar* placeholder,
                                                                                const gchar* icon_name);
VALA_EXTERN GtkPopover* tasks_widgets_entry_popover_generic_get_popover (TasksWidgetsEntryPopoverGeneric* self);
static void tasks_widgets_entry_popover_generic_set_popover (TasksWidgetsEntryPopoverGeneric* self,
                                                      GtkPopover* value);
VALA_EXTERN const gchar* tasks_widgets_entry_popover_generic_get_icon_name (TasksWidgetsEntryPopoverGeneric* self);
static void tasks_widgets_entry_popover_generic_set_icon_name (TasksWidgetsEntryPopoverGeneric* self,
                                                        const gchar* value);
VALA_EXTERN const gchar* tasks_widgets_entry_popover_generic_get_placeholder (TasksWidgetsEntryPopoverGeneric* self);
static void tasks_widgets_entry_popover_generic_set_placeholder (TasksWidgetsEntryPopoverGeneric* self,
                                                          const gchar* value);
VALA_EXTERN gconstpointer tasks_widgets_entry_popover_generic_get_value (TasksWidgetsEntryPopoverGeneric* self);
VALA_EXTERN void tasks_widgets_entry_popover_generic_set_value (TasksWidgetsEntryPopoverGeneric* self,
                                                    gconstpointer value);
static void g_cclosure_user_marshal_STRING__POINTER (GClosure * closure,
                                              GValue * return_value,
                                              guint n_param_values,
                                              const GValue * param_values,
                                              gpointer invocation_hint,
                                              gpointer marshal_data);
static GObject * tasks_widgets_entry_popover_generic_constructor (GType type,
                                                           guint n_construct_properties,
                                                           GObjectConstructParam * construct_properties);
static Block33Data* block33_data_ref (Block33Data* _data33_);
static void block33_data_unref (void * _userdata_);
static void _tasks_widgets_entry_popover_generic___lambda38_ (TasksWidgetsEntryPopoverGeneric* self);
static void __tasks_widgets_entry_popover_generic___lambda38__gtk_button_clicked (GtkButton* _sender,
                                                                           gpointer self);
static void _tasks_widgets_entry_popover_generic___lambda39_ (Block33Data* _data33_);
static void __tasks_widgets_entry_popover_generic___lambda39__gtk_menu_button_activate (GtkMenuButton* _sender,
                                                                                 gpointer self);
static void _tasks_widgets_entry_popover_generic___lambda40_ (Block33Data* _data33_);
static void __tasks_widgets_entry_popover_generic___lambda40__g_object_notify (GObject* _sender,
                                                                        GParamSpec* pspec,
                                                                        gpointer self);
static void _tasks_widgets_entry_popover_generic___lambda41_ (Block33Data* _data33_);
static void __tasks_widgets_entry_popover_generic___lambda41__gtk_event_controller_motion_enter (GtkEventControllerMotion* _sender,
                                                                                          gdouble x,
                                                                                          gdouble y,
                                                                                          gpointer self);
static void _tasks_widgets_entry_popover_generic___lambda42_ (Block33Data* _data33_);
static void __tasks_widgets_entry_popover_generic___lambda42__gtk_event_controller_motion_leave (GtkEventControllerMotion* _sender,
                                                                                          gpointer self);
static void _tasks_widgets_entry_popover_generic___lambda43_ (TasksWidgetsEntryPopoverGeneric* self);
static gboolean __lambda44_ (TasksWidgetsEntryPopoverGeneric* self);
static gboolean ___lambda44__gsource_func (gpointer self);
static void __tasks_widgets_entry_popover_generic___lambda43__gtk_widget_show (GtkWidget* _sender,
                                                                        gpointer self);
static void _tasks_widgets_entry_popover_generic___lambda45_ (TasksWidgetsEntryPopoverGeneric* self);
static gboolean __lambda46_ (TasksWidgetsEntryPopoverGeneric* self);
static gboolean ___lambda46__gsource_func (gpointer self);
static void __tasks_widgets_entry_popover_generic___lambda45__gtk_popover_closed (GtkPopover* _sender,
                                                                           gpointer self);
static void tasks_widgets_entry_popover_generic_finalize (GObject * obj);
static GType tasks_widgets_entry_popover_generic_get_type_once (void);
static void _vala_tasks_widgets_entry_popover_generic_get_property (GObject * object,
                                                             guint property_id,
                                                             GValue * value,
                                                             GParamSpec * pspec);
static void _vala_tasks_widgets_entry_popover_generic_set_property (GObject * object,
                                                             guint property_id,
                                                             const GValue * value,
                                                             GParamSpec * pspec);

static inline gpointer
tasks_widgets_entry_popover_generic_get_instance_private (TasksWidgetsEntryPopoverGeneric* self)
{
	return G_STRUCT_MEMBER_P (self, TasksWidgetsEntryPopoverGeneric_private_offset);
}

TasksWidgetsEntryPopoverGeneric*
tasks_widgets_entry_popover_generic_construct (GType object_type,
                                               GType t_type,
                                               GBoxedCopyFunc t_dup_func,
                                               GDestroyNotify t_destroy_func,
                                               const gchar* placeholder,
                                               const gchar* icon_name)
{
	TasksWidgetsEntryPopoverGeneric * self = NULL;
	g_return_val_if_fail (placeholder != NULL, NULL);
	self = (TasksWidgetsEntryPopoverGeneric*) g_object_new (object_type, "t-type", t_type, "t-dup-func", t_dup_func, "t-destroy-func", t_destroy_func, "icon-name", icon_name, "placeholder", placeholder, NULL);
	self->priv->t_type = t_type;
	self->priv->t_dup_func = t_dup_func;
	self->priv->t_destroy_func = t_destroy_func;
	return self;
}

GtkPopover*
tasks_widgets_entry_popover_generic_get_popover (TasksWidgetsEntryPopoverGeneric* self)
{
	GtkPopover* result;
	GtkPopover* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_popover;
	result = _tmp0_;
	return result;
}

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

static void
tasks_widgets_entry_popover_generic_set_popover (TasksWidgetsEntryPopoverGeneric* self,
                                                 GtkPopover* value)
{
	GtkPopover* old_value;
	g_return_if_fail (self != NULL);
	old_value = tasks_widgets_entry_popover_generic_get_popover (self);
	if (old_value != value) {
		GtkPopover* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_popover);
		self->priv->_popover = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tasks_widgets_entry_popover_generic_properties[TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_POPOVER_PROPERTY]);
	}
}

const gchar*
tasks_widgets_entry_popover_generic_get_icon_name (TasksWidgetsEntryPopoverGeneric* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_icon_name;
	result = _tmp0_;
	return result;
}

static void
tasks_widgets_entry_popover_generic_set_icon_name (TasksWidgetsEntryPopoverGeneric* self,
                                                   const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tasks_widgets_entry_popover_generic_get_icon_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_icon_name);
		self->priv->_icon_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tasks_widgets_entry_popover_generic_properties[TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_ICON_NAME_PROPERTY]);
	}
}

const gchar*
tasks_widgets_entry_popover_generic_get_placeholder (TasksWidgetsEntryPopoverGeneric* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_placeholder;
	result = _tmp0_;
	return result;
}

static void
tasks_widgets_entry_popover_generic_set_placeholder (TasksWidgetsEntryPopoverGeneric* self,
                                                     const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tasks_widgets_entry_popover_generic_get_placeholder (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_placeholder);
		self->priv->_placeholder = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tasks_widgets_entry_popover_generic_properties[TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_PLACEHOLDER_PROPERTY]);
	}
}

gconstpointer
tasks_widgets_entry_popover_generic_get_value (TasksWidgetsEntryPopoverGeneric* self)
{
	gconstpointer result;
	gconstpointer _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_value;
	result = _tmp0_;
	return result;
}

void
tasks_widgets_entry_popover_generic_set_value (TasksWidgetsEntryPopoverGeneric* self,
                                               gconstpointer value)
{
	gpointer old_value;
	g_return_if_fail (self != NULL);
	old_value = tasks_widgets_entry_popover_generic_get_value (self);
	if (old_value != value) {
		gpointer _tmp0_;
		_tmp0_ = ((value != NULL) && (self->priv->t_dup_func != NULL)) ? self->priv->t_dup_func ((gpointer) value) : ((gpointer) value);
		((self->priv->_value == NULL) || (self->priv->t_destroy_func == NULL)) ? NULL : (self->priv->_value = (self->priv->t_destroy_func (self->priv->_value), NULL));
		self->priv->_value = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tasks_widgets_entry_popover_generic_properties[TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_VALUE_PROPERTY]);
	}
}

static void
g_cclosure_user_marshal_STRING__POINTER (GClosure * closure,
                                         GValue * return_value,
                                         guint n_param_values,
                                         const GValue * param_values,
                                         gpointer invocation_hint,
                                         gpointer marshal_data)
{
	typedef const char* (*GMarshalFunc_STRING__POINTER) (gpointer data1, gpointer arg_1, gpointer data2);
	register GMarshalFunc_STRING__POINTER callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	const char* v_return;
	cc = (GCClosure *) closure;
	g_return_if_fail (return_value != NULL);
	g_return_if_fail (n_param_values == 2);
	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_STRING__POINTER) (marshal_data ? marshal_data : cc->callback);
	v_return = callback (data1, g_value_get_pointer (param_values + 1), data2);
	g_value_take_string (return_value, v_return);
}

static Block33Data*
block33_data_ref (Block33Data* _data33_)
{
	g_atomic_int_inc (&_data33_->_ref_count_);
	return _data33_;
}

static void
block33_data_unref (void * _userdata_)
{
	Block33Data* _data33_;
	_data33_ = (Block33Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data33_->_ref_count_)) {
		TasksWidgetsEntryPopoverGeneric* self;
		self = _data33_->self;
		_g_object_unref0 (_data33_->delete_button_revealer);
		_g_object_unref0 (_data33_->label);
		_g_object_unref0 (self);
		g_slice_free (Block33Data, _data33_);
	}
}

static void
_tasks_widgets_entry_popover_generic___lambda38_ (TasksWidgetsEntryPopoverGeneric* self)
{
	gboolean value_has_changed = FALSE;
	gconstpointer _tmp0_;
	_tmp0_ = self->priv->_value;
	value_has_changed = _tmp0_ != NULL;
	tasks_widgets_entry_popover_generic_set_value (self, NULL);
	if (value_has_changed) {
		gconstpointer _tmp1_;
		_tmp1_ = self->priv->_value;
		g_signal_emit (self, tasks_widgets_entry_popover_generic_signals[TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_VALUE_CHANGED_SIGNAL], 0, _tmp1_);
	}
}

static void
__tasks_widgets_entry_popover_generic___lambda38__gtk_button_clicked (GtkButton* _sender,
                                                                      gpointer self)
{
	_tasks_widgets_entry_popover_generic___lambda38_ ((TasksWidgetsEntryPopoverGeneric*) self);
}

static void
_tasks_widgets_entry_popover_generic___lambda39_ (Block33Data* _data33_)
{
	TasksWidgetsEntryPopoverGeneric* self;
	GtkRevealer* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	self = _data33_->self;
	_tmp0_ = _data33_->delete_button_revealer;
	_tmp1_ = gtk_revealer_get_reveal_child (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		GtkRevealer* _tmp3_;
		_tmp3_ = _data33_->delete_button_revealer;
		gtk_revealer_set_reveal_child (_tmp3_, FALSE);
	}
}

static void
__tasks_widgets_entry_popover_generic___lambda39__gtk_menu_button_activate (GtkMenuButton* _sender,
                                                                            gpointer self)
{
	_tasks_widgets_entry_popover_generic___lambda39_ (self);
}

static void
_tasks_widgets_entry_popover_generic___lambda40_ (Block33Data* _data33_)
{
	TasksWidgetsEntryPopoverGeneric* self;
	gchar* value_formatted = NULL;
	gconstpointer _tmp0_;
	gchar* _tmp1_ = NULL;
	const gchar* _tmp2_;
	self = _data33_->self;
	_tmp0_ = self->priv->_value;
	g_signal_emit (self, tasks_widgets_entry_popover_generic_signals[TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_VALUE_FORMAT_SIGNAL], 0, _tmp0_, &_tmp1_);
	value_formatted = _tmp1_;
	_tmp2_ = value_formatted;
	if (_tmp2_ == NULL) {
		GtkLabel* _tmp3_;
		const gchar* _tmp4_;
		GtkRevealer* _tmp5_;
		gboolean _tmp6_;
		gboolean _tmp7_;
		_tmp3_ = _data33_->label;
		_tmp4_ = self->priv->_placeholder;
		gtk_label_set_label (_tmp3_, _tmp4_);
		_tmp5_ = _data33_->delete_button_revealer;
		_tmp6_ = gtk_revealer_get_reveal_child (_tmp5_);
		_tmp7_ = _tmp6_;
		if (_tmp7_) {
			GtkRevealer* _tmp8_;
			_tmp8_ = _data33_->delete_button_revealer;
			gtk_revealer_set_reveal_child (_tmp8_, FALSE);
		}
	} else {
		GtkLabel* _tmp9_;
		const gchar* _tmp10_;
		_tmp9_ = _data33_->label;
		_tmp10_ = value_formatted;
		gtk_label_set_label (_tmp9_, _tmp10_);
	}
	_g_free0 (value_formatted);
}

static void
__tasks_widgets_entry_popover_generic___lambda40__g_object_notify (GObject* _sender,
                                                                   GParamSpec* pspec,
                                                                   gpointer self)
{
	_tasks_widgets_entry_popover_generic___lambda40_ (self);
}

static void
_tasks_widgets_entry_popover_generic___lambda41_ (Block33Data* _data33_)
{
	TasksWidgetsEntryPopoverGeneric* self;
	gconstpointer _tmp0_;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_;
	gboolean _tmp3_;
	self = _data33_->self;
	_tmp0_ = self->priv->_value;
	g_signal_emit (self, tasks_widgets_entry_popover_generic_signals[TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_VALUE_FORMAT_SIGNAL], 0, _tmp0_, &_tmp1_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_ != NULL;
	_g_free0 (_tmp2_);
	if (_tmp3_) {
		GtkRevealer* _tmp4_;
		_tmp4_ = _data33_->delete_button_revealer;
		gtk_revealer_set_reveal_child (_tmp4_, TRUE);
	}
}

static void
__tasks_widgets_entry_popover_generic___lambda41__gtk_event_controller_motion_enter (GtkEventControllerMotion* _sender,
                                                                                     gdouble x,
                                                                                     gdouble y,
                                                                                     gpointer self)
{
	_tasks_widgets_entry_popover_generic___lambda41_ (self);
}

static void
_tasks_widgets_entry_popover_generic___lambda42_ (Block33Data* _data33_)
{
	TasksWidgetsEntryPopoverGeneric* self;
	GtkRevealer* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	self = _data33_->self;
	_tmp0_ = _data33_->delete_button_revealer;
	_tmp1_ = gtk_revealer_get_reveal_child (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		GtkRevealer* _tmp3_;
		_tmp3_ = _data33_->delete_button_revealer;
		gtk_revealer_set_reveal_child (_tmp3_, FALSE);
	}
}

static void
__tasks_widgets_entry_popover_generic___lambda42__gtk_event_controller_motion_leave (GtkEventControllerMotion* _sender,
                                                                                     gpointer self)
{
	_tasks_widgets_entry_popover_generic___lambda42_ (self);
}

static gboolean
__lambda44_ (TasksWidgetsEntryPopoverGeneric* self)
{
	gconstpointer _tmp0_;
	gpointer _tmp1_;
	gboolean result;
	_tmp0_ = self->priv->_value;
	_tmp1_ = ((_tmp0_ != NULL) && (self->priv->t_dup_func != NULL)) ? self->priv->t_dup_func ((gpointer) _tmp0_) : ((gpointer) _tmp0_);
	((self->priv->value_on_popover_show == NULL) || (self->priv->t_destroy_func == NULL)) ? NULL : (self->priv->value_on_popover_show = (self->priv->t_destroy_func (self->priv->value_on_popover_show), NULL));
	self->priv->value_on_popover_show = _tmp1_;
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda44__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda44_ ((TasksWidgetsEntryPopoverGeneric*) self);
	return result;
}

static void
_tasks_widgets_entry_popover_generic___lambda43_ (TasksWidgetsEntryPopoverGeneric* self)
{
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda44__gsource_func, g_object_ref (self), g_object_unref);
}

static void
__tasks_widgets_entry_popover_generic___lambda43__gtk_widget_show (GtkWidget* _sender,
                                                                   gpointer self)
{
	_tasks_widgets_entry_popover_generic___lambda43_ ((TasksWidgetsEntryPopoverGeneric*) self);
}

static gboolean
__lambda46_ (TasksWidgetsEntryPopoverGeneric* self)
{
	gconstpointer _tmp0_;
	gconstpointer _tmp1_;
	gboolean result;
	_tmp0_ = self->priv->_value;
	_tmp1_ = self->priv->value_on_popover_show;
	if (_tmp0_ != _tmp1_) {
		gconstpointer _tmp2_;
		_tmp2_ = self->priv->_value;
		g_signal_emit (self, tasks_widgets_entry_popover_generic_signals[TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_VALUE_CHANGED_SIGNAL], 0, _tmp2_);
	}
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda46__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda46_ ((TasksWidgetsEntryPopoverGeneric*) self);
	return result;
}

static void
_tasks_widgets_entry_popover_generic___lambda45_ (TasksWidgetsEntryPopoverGeneric* self)
{
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda46__gsource_func, g_object_ref (self), g_object_unref);
}

static void
__tasks_widgets_entry_popover_generic___lambda45__gtk_popover_closed (GtkPopover* _sender,
                                                                      gpointer self)
{
	_tasks_widgets_entry_popover_generic___lambda45_ ((TasksWidgetsEntryPopoverGeneric*) self);
}

static GObject *
tasks_widgets_entry_popover_generic_constructor (GType type,
                                                 guint n_construct_properties,
                                                 GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TasksWidgetsEntryPopoverGeneric * self;
	Block33Data* _data33_;
	GtkPopover* _tmp0_ = NULL;
	GtkPopover* _tmp1_;
	const gchar* _tmp2_;
	GtkLabel* _tmp3_;
	GtkBox* popover_button_box = NULL;
	GtkBox* _tmp4_;
	const gchar* _tmp5_;
	GtkBox* _tmp10_;
	GtkLabel* _tmp11_;
	GtkMenuButton* popover_button = NULL;
	GtkBox* _tmp12_;
	GtkWidget* _tmp13_;
	GtkPopover* _tmp14_;
	GtkPopover* _tmp15_;
	GtkMenuButton* _tmp16_ = NULL;
	GtkLabel* _tmp17_;
	GtkMenuButton* _tmp18_;
	GtkButton* delete_button = NULL;
	gchar* _tmp19_;
	GtkButton* _tmp20_ = NULL;
	GtkButton* _tmp21_;
	GtkButton* _tmp22_;
	GtkWidget* _tmp23_;
	GtkRevealer* _tmp24_ = NULL;
	GtkBox* button_box = NULL;
	GtkBox* _tmp25_;
	GtkBox* _tmp26_;
	GtkMenuButton* _tmp27_;
	GtkBox* _tmp28_;
	GtkRevealer* _tmp29_;
	GtkBox* _tmp30_;
	GtkButton* _tmp31_;
	GtkMenuButton* _tmp32_;
	GtkEventControllerMotion* motion_controller = NULL;
	GtkEventControllerMotion* _tmp33_;
	GtkEventControllerMotion* _tmp34_;
	GtkEventController* _tmp35_;
	GtkEventControllerMotion* _tmp36_;
	GtkEventControllerMotion* _tmp37_;
	GtkPopover* _tmp38_;
	GtkPopover* _tmp39_;
	parent_class = G_OBJECT_CLASS (tasks_widgets_entry_popover_generic_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TASKS_WIDGETS_ENTRY_POPOVER_TYPE_GENERIC, TasksWidgetsEntryPopoverGeneric);
	_data33_ = g_slice_new0 (Block33Data);
	_data33_->_ref_count_ = 1;
	_data33_->self = g_object_ref (self);
	_tmp0_ = (GtkPopover*) gtk_popover_new ();
	gtk_popover_set_autohide (_tmp0_, TRUE);
	g_object_ref_sink (_tmp0_);
	_tmp1_ = _tmp0_;
	tasks_widgets_entry_popover_generic_set_popover (self, _tmp1_);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = self->priv->_placeholder;
	_tmp3_ = (GtkLabel*) gtk_label_new (_tmp2_);
	g_object_ref_sink (_tmp3_);
	_data33_->label = _tmp3_;
	_tmp4_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp4_);
	popover_button_box = _tmp4_;
	_tmp5_ = self->priv->_icon_name;
	if (_tmp5_ != NULL) {
		GtkBox* _tmp6_;
		const gchar* _tmp7_;
		GtkImage* _tmp8_;
		GtkImage* _tmp9_;
		_tmp6_ = popover_button_box;
		_tmp7_ = self->priv->_icon_name;
		_tmp8_ = (GtkImage*) gtk_image_new_from_icon_name (_tmp7_);
		g_object_ref_sink (_tmp8_);
		_tmp9_ = _tmp8_;
		gtk_box_append (_tmp6_, (GtkWidget*) _tmp9_);
		_g_object_unref0 (_tmp9_);
	}
	_tmp10_ = popover_button_box;
	_tmp11_ = _data33_->label;
	gtk_box_append (_tmp10_, (GtkWidget*) _tmp11_);
	_tmp12_ = popover_button_box;
	_tmp13_ = _g_object_ref0 ((GtkWidget*) _tmp12_);
	_tmp14_ = self->priv->_popover;
	_tmp15_ = _g_object_ref0 (_tmp14_);
	_tmp16_ = (GtkMenuButton*) gtk_menu_button_new ();
	gtk_menu_button_set_child (_tmp16_, _tmp13_);
	_g_object_unref0 (_tmp13_);
	gtk_menu_button_set_has_frame (_tmp16_, FALSE);
	gtk_menu_button_set_popover (_tmp16_, _tmp15_);
	_g_object_unref0 (_tmp15_);
	g_object_ref_sink (_tmp16_);
	popover_button = _tmp16_;
	_tmp17_ = _data33_->label;
	_tmp18_ = popover_button;
	gtk_label_set_mnemonic_widget (_tmp17_, (GtkWidget*) _tmp18_);
	_tmp19_ = g_strdup (_ ("Remove"));
	_tmp20_ = (GtkButton*) gtk_button_new_from_icon_name ("process-stop-symbolic");
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp20_, _tmp19_);
	_g_free0 (_tmp19_);
	g_object_ref_sink (_tmp20_);
	delete_button = _tmp20_;
	_tmp21_ = delete_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp21_, "delete-button");
	_tmp22_ = delete_button;
	_tmp23_ = _g_object_ref0 ((GtkWidget*) _tmp22_);
	_tmp24_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_child (_tmp24_, _tmp23_);
	_g_object_unref0 (_tmp23_);
	gtk_revealer_set_transition_type (_tmp24_, GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT);
	gtk_revealer_set_reveal_child (_tmp24_, FALSE);
	g_object_ref_sink (_tmp24_);
	_data33_->delete_button_revealer = _tmp24_;
	_tmp25_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp25_);
	button_box = _tmp25_;
	_tmp26_ = button_box;
	_tmp27_ = popover_button;
	gtk_box_append (_tmp26_, (GtkWidget*) _tmp27_);
	_tmp28_ = button_box;
	_tmp29_ = _data33_->delete_button_revealer;
	gtk_box_append (_tmp28_, (GtkWidget*) _tmp29_);
	_tmp30_ = button_box;
	gtk_widget_set_parent ((GtkWidget*) _tmp30_, (GtkWidget*) self);
	_tmp31_ = delete_button;
	g_signal_connect_object (_tmp31_, "clicked", (GCallback) __tasks_widgets_entry_popover_generic___lambda38__gtk_button_clicked, self, 0);
	_tmp32_ = popover_button;
	g_signal_connect_data (_tmp32_, "activate", (GCallback) __tasks_widgets_entry_popover_generic___lambda39__gtk_menu_button_activate, block33_data_ref (_data33_), (GClosureNotify) block33_data_unref, 0);
	g_signal_connect_data ((GObject*) self, "notify::value", (GCallback) __tasks_widgets_entry_popover_generic___lambda40__g_object_notify, block33_data_ref (_data33_), (GClosureNotify) block33_data_unref, 0);
	_tmp33_ = (GtkEventControllerMotion*) gtk_event_controller_motion_new ();
	motion_controller = _tmp33_;
	_tmp34_ = motion_controller;
	_tmp35_ = _g_object_ref0 ((GtkEventController*) _tmp34_);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp35_);
	_tmp36_ = motion_controller;
	g_signal_connect_data (_tmp36_, "enter", (GCallback) __tasks_widgets_entry_popover_generic___lambda41__gtk_event_controller_motion_enter, block33_data_ref (_data33_), (GClosureNotify) block33_data_unref, 0);
	_tmp37_ = motion_controller;
	g_signal_connect_data (_tmp37_, "leave", (GCallback) __tasks_widgets_entry_popover_generic___lambda42__gtk_event_controller_motion_leave, block33_data_ref (_data33_), (GClosureNotify) block33_data_unref, 0);
	_tmp38_ = self->priv->_popover;
	g_signal_connect_object ((GtkWidget*) _tmp38_, "show", (GCallback) __tasks_widgets_entry_popover_generic___lambda43__gtk_widget_show, self, 0);
	_tmp39_ = self->priv->_popover;
	g_signal_connect_object (_tmp39_, "closed", (GCallback) __tasks_widgets_entry_popover_generic___lambda45__gtk_popover_closed, self, 0);
	_g_object_unref0 (motion_controller);
	_g_object_unref0 (button_box);
	_g_object_unref0 (delete_button);
	_g_object_unref0 (popover_button);
	_g_object_unref0 (popover_button_box);
	block33_data_unref (_data33_);
	_data33_ = NULL;
	return obj;
}

static void
tasks_widgets_entry_popover_generic_base_init (TasksWidgetsEntryPopoverGenericClass * klass)
{
	gtk_widget_class_set_css_name (GTK_WIDGET_CLASS (klass), "entry-popover");
	gtk_widget_class_set_layout_manager_type (GTK_WIDGET_CLASS (klass), gtk_bin_layout_get_type ());
}

static void
tasks_widgets_entry_popover_generic_class_init (TasksWidgetsEntryPopoverGenericClass * klass,
                                                gpointer klass_data)
{
	tasks_widgets_entry_popover_generic_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TasksWidgetsEntryPopoverGeneric_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tasks_widgets_entry_popover_generic_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tasks_widgets_entry_popover_generic_set_property;
	G_OBJECT_CLASS (klass)->constructor = tasks_widgets_entry_popover_generic_constructor;
	G_OBJECT_CLASS (klass)->finalize = tasks_widgets_entry_popover_generic_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_T_TYPE, g_param_spec_gtype ("t-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_T_DUP_FUNC, g_param_spec_pointer ("t-dup-func", "dup func", "dup func", G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_T_DESTROY_FUNC, g_param_spec_pointer ("t-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_POPOVER_PROPERTY, tasks_widgets_entry_popover_generic_properties[TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_POPOVER_PROPERTY] = g_param_spec_object ("popover", "popover", "popover", gtk_popover_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_ICON_NAME_PROPERTY, tasks_widgets_entry_popover_generic_properties[TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_ICON_NAME_PROPERTY] = g_param_spec_string ("icon-name", "icon-name", "icon-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_PLACEHOLDER_PROPERTY, tasks_widgets_entry_popover_generic_properties[TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_PLACEHOLDER_PROPERTY] = g_param_spec_string ("placeholder", "placeholder", "placeholder", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_VALUE_PROPERTY, tasks_widgets_entry_popover_generic_properties[TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_VALUE_PROPERTY] = g_param_spec_pointer ("value", "value", "value", G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	tasks_widgets_entry_popover_generic_signals[TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_VALUE_FORMAT_SIGNAL] = g_signal_new ("value-format", TASKS_WIDGETS_ENTRY_POPOVER_TYPE_GENERIC, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_STRING__POINTER, G_TYPE_STRING, 1, G_TYPE_POINTER);
	tasks_widgets_entry_popover_generic_signals[TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_VALUE_CHANGED_SIGNAL] = g_signal_new ("value-changed", TASKS_WIDGETS_ENTRY_POPOVER_TYPE_GENERIC, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER);
}

static void
tasks_widgets_entry_popover_generic_instance_init (TasksWidgetsEntryPopoverGeneric * self,
                                                   gpointer klass)
{
	self->priv = tasks_widgets_entry_popover_generic_get_instance_private (self);
}

static void
tasks_widgets_entry_popover_generic_finalize (GObject * obj)
{
	TasksWidgetsEntryPopoverGeneric * self;
	GtkWidget* _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TASKS_WIDGETS_ENTRY_POPOVER_TYPE_GENERIC, TasksWidgetsEntryPopoverGeneric);
	_tmp0_ = gtk_widget_get_last_child ((GtkWidget*) self);
	gtk_widget_unparent (_tmp0_);
	_g_object_unref0 (self->priv->_popover);
	_g_free0 (self->priv->_icon_name);
	_g_free0 (self->priv->_placeholder);
	((self->priv->_value == NULL) || (self->priv->t_destroy_func == NULL)) ? NULL : (self->priv->_value = (self->priv->t_destroy_func (self->priv->_value), NULL));
	((self->priv->value_on_popover_show == NULL) || (self->priv->t_destroy_func == NULL)) ? NULL : (self->priv->value_on_popover_show = (self->priv->t_destroy_func (self->priv->value_on_popover_show), NULL));
	G_OBJECT_CLASS (tasks_widgets_entry_popover_generic_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tasks_widgets_entry_popover_generic_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TasksWidgetsEntryPopoverGenericClass), (GBaseInitFunc) tasks_widgets_entry_popover_generic_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tasks_widgets_entry_popover_generic_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TasksWidgetsEntryPopoverGeneric), 0, (GInstanceInitFunc) tasks_widgets_entry_popover_generic_instance_init, NULL };
	GType tasks_widgets_entry_popover_generic_type_id;
	tasks_widgets_entry_popover_generic_type_id = g_type_register_static (gtk_widget_get_type (), "TasksWidgetsEntryPopoverGeneric", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	TasksWidgetsEntryPopoverGeneric_private_offset = g_type_add_instance_private (tasks_widgets_entry_popover_generic_type_id, sizeof (TasksWidgetsEntryPopoverGenericPrivate));
	return tasks_widgets_entry_popover_generic_type_id;
}

GType
tasks_widgets_entry_popover_generic_get_type (void)
{
	static gsize tasks_widgets_entry_popover_generic_type_id__once = 0;
	if (g_once_init_enter (&tasks_widgets_entry_popover_generic_type_id__once)) {
		GType tasks_widgets_entry_popover_generic_type_id;
		tasks_widgets_entry_popover_generic_type_id = tasks_widgets_entry_popover_generic_get_type_once ();
		g_once_init_leave (&tasks_widgets_entry_popover_generic_type_id__once, tasks_widgets_entry_popover_generic_type_id);
	}
	return tasks_widgets_entry_popover_generic_type_id__once;
}

static void
_vala_tasks_widgets_entry_popover_generic_get_property (GObject * object,
                                                        guint property_id,
                                                        GValue * value,
                                                        GParamSpec * pspec)
{
	TasksWidgetsEntryPopoverGeneric * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TASKS_WIDGETS_ENTRY_POPOVER_TYPE_GENERIC, TasksWidgetsEntryPopoverGeneric);
	switch (property_id) {
		case TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_POPOVER_PROPERTY:
		g_value_set_object (value, tasks_widgets_entry_popover_generic_get_popover (self));
		break;
		case TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_ICON_NAME_PROPERTY:
		g_value_set_string (value, tasks_widgets_entry_popover_generic_get_icon_name (self));
		break;
		case TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_PLACEHOLDER_PROPERTY:
		g_value_set_string (value, tasks_widgets_entry_popover_generic_get_placeholder (self));
		break;
		case TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_VALUE_PROPERTY:
		g_value_set_pointer (value, tasks_widgets_entry_popover_generic_get_value (self));
		break;
		case TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_T_TYPE:
		g_value_set_gtype (value, self->priv->t_type);
		break;
		case TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_T_DUP_FUNC:
		g_value_set_pointer (value, self->priv->t_dup_func);
		break;
		case TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_T_DESTROY_FUNC:
		g_value_set_pointer (value, self->priv->t_destroy_func);
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tasks_widgets_entry_popover_generic_set_property (GObject * object,
                                                        guint property_id,
                                                        const GValue * value,
                                                        GParamSpec * pspec)
{
	TasksWidgetsEntryPopoverGeneric * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TASKS_WIDGETS_ENTRY_POPOVER_TYPE_GENERIC, TasksWidgetsEntryPopoverGeneric);
	switch (property_id) {
		case TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_POPOVER_PROPERTY:
		tasks_widgets_entry_popover_generic_set_popover (self, g_value_get_object (value));
		break;
		case TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_ICON_NAME_PROPERTY:
		tasks_widgets_entry_popover_generic_set_icon_name (self, g_value_get_string (value));
		break;
		case TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_PLACEHOLDER_PROPERTY:
		tasks_widgets_entry_popover_generic_set_placeholder (self, g_value_get_string (value));
		break;
		case TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_VALUE_PROPERTY:
		tasks_widgets_entry_popover_generic_set_value (self, g_value_get_pointer (value));
		break;
		case TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_T_TYPE:
		self->priv->t_type = g_value_get_gtype (value);
		break;
		case TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_T_DUP_FUNC:
		self->priv->t_dup_func = g_value_get_pointer (value);
		break;
		case TASKS_WIDGETS_ENTRY_POPOVER_GENERIC_T_DESTROY_FUNC:
		self->priv->t_destroy_func = g_value_get_pointer (value);
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

