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

/*
 * Copyright © 2023 Alain M. (https://github.com/alainm23/planify)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation; either
 * version 3 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: Alain M. <alainmh23@gmail.com>
 */

#include "planify.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <glib-object.h>
#include <gee.h>
#include <gio/gio.h>
#include <adwaita.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  {
	WIDGETS_CONTEXT_MENU_MENU_CHECK_PICKER_0_PROPERTY,
	WIDGETS_CONTEXT_MENU_MENU_CHECK_PICKER_TITLE_PROPERTY,
	WIDGETS_CONTEXT_MENU_MENU_CHECK_PICKER_ICON_PROPERTY,
	WIDGETS_CONTEXT_MENU_MENU_CHECK_PICKER_NUM_PROPERTIES
};
static GParamSpec* widgets_context_menu_menu_check_picker_properties[WIDGETS_CONTEXT_MENU_MENU_CHECK_PICKER_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)))
typedef struct _Block27Data Block27Data;
enum  {
	WIDGETS_CONTEXT_MENU_MENU_CHECK_PICKER_FILTER_CHANGE_SIGNAL,
	WIDGETS_CONTEXT_MENU_MENU_CHECK_PICKER_NUM_SIGNALS
};
static guint widgets_context_menu_menu_check_picker_signals[WIDGETS_CONTEXT_MENU_MENU_CHECK_PICKER_NUM_SIGNALS] = {0};
enum  {
	WIDGETS_CONTEXT_MENU_MENU_ITEM_CHECK_PICKER_0_PROPERTY,
	WIDGETS_CONTEXT_MENU_MENU_ITEM_CHECK_PICKER_FILTER_PROPERTY,
	WIDGETS_CONTEXT_MENU_MENU_ITEM_CHECK_PICKER_ACTIVE_PROPERTY,
	WIDGETS_CONTEXT_MENU_MENU_ITEM_CHECK_PICKER_NUM_PROPERTIES
};
static GParamSpec* widgets_context_menu_menu_item_check_picker_properties[WIDGETS_CONTEXT_MENU_MENU_ITEM_CHECK_PICKER_NUM_PROPERTIES];
typedef struct _Block28Data Block28Data;
enum  {
	WIDGETS_CONTEXT_MENU_MENU_ITEM_CHECK_PICKER_CHECKED_SIGNAL,
	WIDGETS_CONTEXT_MENU_MENU_ITEM_CHECK_PICKER_NUM_SIGNALS
};
static guint widgets_context_menu_menu_item_check_picker_signals[WIDGETS_CONTEXT_MENU_MENU_ITEM_CHECK_PICKER_NUM_SIGNALS] = {0};

struct _WidgetsContextMenuMenuCheckPickerPrivate {
	gchar* _title;
	gchar* _icon;
	GtkImage* menu_icon;
	GtkRevealer* menu_icon_revealer;
	GtkLabel* menu_title;
	GtkListBox* listbox;
};

struct _Block27Data {
	int _ref_count_;
	WidgetsContextMenuMenuCheckPicker* self;
	GtkImage* arrow_icon;
	GtkRevealer* listbox_revealer;
};

struct _WidgetsContextMenuMenuItemCheckPickerPrivate {
	ObjectsFiltersFilterItem* _filter;
	GtkCheckButton* check_button;
};

struct _Block28Data {
	int _ref_count_;
	WidgetsContextMenuMenuItemCheckPicker* self;
	GtkGestureClick* gesture;
};

static gint WidgetsContextMenuMenuCheckPicker_private_offset;
static gpointer widgets_context_menu_menu_check_picker_parent_class = NULL;
static gint WidgetsContextMenuMenuItemCheckPicker_private_offset;
static gpointer widgets_context_menu_menu_item_check_picker_parent_class = NULL;

static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
static void ____lambda364_ (WidgetsContextMenuMenuCheckPicker* self,
                     ObjectsFiltersFilterItem* filter,
                     gboolean active);
static void _____lambda364__widgets_context_menu_menu_item_check_picker_checked (WidgetsContextMenuMenuItemCheckPicker* _sender,
                                                                          ObjectsFiltersFilterItem* filter,
                                                                          gboolean active,
                                                                          gpointer self);
static void g_cclosure_user_marshal_VOID__OBJECT_BOOLEAN (GClosure * closure,
                                                   GValue * return_value,
                                                   guint n_param_values,
                                                   const GValue * param_values,
                                                   gpointer invocation_hint,
                                                   gpointer marshal_data);
static GObject * widgets_context_menu_menu_check_picker_constructor (GType type,
                                                              guint n_construct_properties,
                                                              GObjectConstructParam * construct_properties);
static Block27Data* block27_data_ref (Block27Data* _data27_);
static void block27_data_unref (void * _userdata_);
static void _widgets_context_menu_menu_check_picker___lambda365_ (Block27Data* _data27_);
static void __widgets_context_menu_menu_check_picker___lambda365__gtk_button_clicked (GtkButton* _sender,
                                                                               gpointer self);
static void widgets_context_menu_menu_check_picker_finalize (GObject * obj);
static GType widgets_context_menu_menu_check_picker_get_type_once (void);
static void _vala_widgets_context_menu_menu_check_picker_get_property (GObject * object,
                                                                guint property_id,
                                                                GValue * value,
                                                                GParamSpec * pspec);
static void _vala_widgets_context_menu_menu_check_picker_set_property (GObject * object,
                                                                guint property_id,
                                                                const GValue * value,
                                                                GParamSpec * pspec);
static GObject * widgets_context_menu_menu_item_check_picker_constructor (GType type,
                                                                   guint n_construct_properties,
                                                                   GObjectConstructParam * construct_properties);
static Block28Data* block28_data_ref (Block28Data* _data28_);
static void block28_data_unref (void * _userdata_);
static void _widgets_context_menu_menu_item_check_picker___lambda362_ (Block28Data* _data28_);
static void __widgets_context_menu_menu_item_check_picker___lambda362__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                                                           gint n_press,
                                                                                           gdouble x,
                                                                                           gdouble y,
                                                                                           gpointer self);
static void _widgets_context_menu_menu_item_check_picker___lambda363_ (WidgetsContextMenuMenuItemCheckPicker* self);
static void __widgets_context_menu_menu_item_check_picker___lambda363__gtk_list_box_row_activate (GtkListBoxRow* _sender,
                                                                                           gpointer self);
static void widgets_context_menu_menu_item_check_picker_finalize (GObject * obj);
static GType widgets_context_menu_menu_item_check_picker_get_type_once (void);
static void _vala_widgets_context_menu_menu_item_check_picker_get_property (GObject * object,
                                                                     guint property_id,
                                                                     GValue * value,
                                                                     GParamSpec * pspec);
static void _vala_widgets_context_menu_menu_item_check_picker_set_property (GObject * object,
                                                                     guint property_id,
                                                                     const GValue * value,
                                                                     GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
widgets_context_menu_menu_check_picker_get_instance_private (WidgetsContextMenuMenuCheckPicker* self)
{
	return G_STRUCT_MEMBER_P (self, WidgetsContextMenuMenuCheckPicker_private_offset);
}

WidgetsContextMenuMenuCheckPicker*
widgets_context_menu_menu_check_picker_construct (GType object_type,
                                                  const gchar* title,
                                                  const gchar* icon)
{
	WidgetsContextMenuMenuCheckPicker * self = NULL;
	g_return_val_if_fail (title != NULL, NULL);
	self = (WidgetsContextMenuMenuCheckPicker*) g_object_new (object_type, "title", title, "icon", icon, "hexpand", TRUE, NULL);
	return self;
}

WidgetsContextMenuMenuCheckPicker*
widgets_context_menu_menu_check_picker_new (const gchar* title,
                                            const gchar* icon)
{
	return widgets_context_menu_menu_check_picker_construct (WIDGETS_CONTEXT_MENU_TYPE_MENU_CHECK_PICKER, title, icon);
}

static void
_g_object_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}

static inline void
_g_list_free__g_object_unref0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) _g_object_unref0_);
}

static void
____lambda364_ (WidgetsContextMenuMenuCheckPicker* self,
                ObjectsFiltersFilterItem* filter,
                gboolean active)
{
	g_return_if_fail (filter != NULL);
	g_signal_emit (self, widgets_context_menu_menu_check_picker_signals[WIDGETS_CONTEXT_MENU_MENU_CHECK_PICKER_FILTER_CHANGE_SIGNAL], 0, filter, active);
}

static void
_____lambda364__widgets_context_menu_menu_item_check_picker_checked (WidgetsContextMenuMenuItemCheckPicker* _sender,
                                                                     ObjectsFiltersFilterItem* filter,
                                                                     gboolean active,
                                                                     gpointer self)
{
	____lambda364_ ((WidgetsContextMenuMenuCheckPicker*) self, filter, active);
}

void
widgets_context_menu_menu_check_picker_set_items (WidgetsContextMenuMenuCheckPicker* self,
                                                  GeeArrayList* filters)
{
	GeeHashMap* _tmp0_;
	Util* _tmp1_;
	Util* _tmp2_;
	GtkListBox* _tmp3_;
	GList* _tmp4_;
	GList* _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (filters != NULL);
	_tmp0_ = self->filters_map;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp0_);
	_tmp1_ = util_get_default ();
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->listbox;
	_tmp4_ = util_get_children (_tmp2_, _tmp3_);
	_tmp5_ = _tmp4_;
	_g_object_unref0 (_tmp2_);
	{
		GList* child_collection = NULL;
		GList* child_it = NULL;
		child_collection = _tmp5_;
		for (child_it = child_collection; child_it != NULL; child_it = child_it->next) {
			GtkWidget* child = NULL;
			child = (GtkWidget*) ((GtkListBoxRow*) child_it->data);
			{
				GtkListBox* _tmp6_;
				GtkWidget* _tmp7_;
				_tmp6_ = self->priv->listbox;
				_tmp7_ = child;
				gtk_list_box_remove (_tmp6_, _tmp7_);
			}
		}
		(child_collection == NULL) ? NULL : (child_collection = (_g_list_free__g_object_unref0_ (child_collection), NULL));
	}
	{
		GeeArrayList* _filter_list = NULL;
		gint _filter_size = 0;
		GeeArrayList* _tmp8_;
		gint _tmp9_;
		gint _tmp10_;
		gint _filter_index = 0;
		_filter_list = filters;
		_tmp8_ = _filter_list;
		_tmp9_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp8_);
		_tmp10_ = _tmp9_;
		_filter_size = _tmp10_;
		_filter_index = -1;
		while (TRUE) {
			gint _tmp11_;
			gint _tmp12_;
			ObjectsFiltersFilterItem* filter = NULL;
			GeeArrayList* _tmp13_;
			gpointer _tmp14_;
			GeeHashMap* _tmp15_;
			ObjectsFiltersFilterItem* _tmp16_;
			const gchar* _tmp17_;
			const gchar* _tmp18_;
			ObjectsFiltersFilterItem* _tmp19_;
			WidgetsContextMenuMenuItemCheckPicker* _tmp20_;
			WidgetsContextMenuMenuItemCheckPicker* _tmp21_;
			GeeHashMap* _tmp22_;
			ObjectsFiltersFilterItem* _tmp23_;
			const gchar* _tmp24_;
			const gchar* _tmp25_;
			gpointer _tmp26_;
			WidgetsContextMenuMenuItemCheckPicker* _tmp27_;
			GtkListBox* _tmp28_;
			GeeHashMap* _tmp29_;
			ObjectsFiltersFilterItem* _tmp30_;
			const gchar* _tmp31_;
			const gchar* _tmp32_;
			gpointer _tmp33_;
			WidgetsContextMenuMenuItemCheckPicker* _tmp34_;
			_filter_index = _filter_index + 1;
			_tmp11_ = _filter_index;
			_tmp12_ = _filter_size;
			if (!(_tmp11_ < _tmp12_)) {
				break;
			}
			_tmp13_ = _filter_list;
			_tmp14_ = gee_abstract_list_get ((GeeAbstractList*) _tmp13_, _filter_index);
			filter = (ObjectsFiltersFilterItem*) _tmp14_;
			_tmp15_ = self->filters_map;
			_tmp16_ = filter;
			_tmp17_ = objects_filters_filter_item_get_id (_tmp16_);
			_tmp18_ = _tmp17_;
			_tmp19_ = filter;
			_tmp20_ = widgets_context_menu_menu_item_check_picker_new (_tmp19_);
			g_object_ref_sink (_tmp20_);
			_tmp21_ = _tmp20_;
			gee_abstract_map_set ((GeeAbstractMap*) _tmp15_, _tmp18_, _tmp21_);
			_g_object_unref0 (_tmp21_);
			_tmp22_ = self->filters_map;
			_tmp23_ = filter;
			_tmp24_ = objects_filters_filter_item_get_id (_tmp23_);
			_tmp25_ = _tmp24_;
			_tmp26_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp22_, _tmp25_);
			_tmp27_ = (WidgetsContextMenuMenuItemCheckPicker*) _tmp26_;
			g_signal_connect_object (_tmp27_, "checked", (GCallback) _____lambda364__widgets_context_menu_menu_item_check_picker_checked, self, 0);
			_g_object_unref0 (_tmp27_);
			_tmp28_ = self->priv->listbox;
			_tmp29_ = self->filters_map;
			_tmp30_ = filter;
			_tmp31_ = objects_filters_filter_item_get_id (_tmp30_);
			_tmp32_ = _tmp31_;
			_tmp33_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp29_, _tmp32_);
			_tmp34_ = (WidgetsContextMenuMenuItemCheckPicker*) _tmp33_;
			gtk_list_box_append (_tmp28_, (GtkWidget*) _tmp34_);
			_g_object_unref0 (_tmp34_);
			_g_object_unref0 (filter);
		}
	}
}

void
widgets_context_menu_menu_check_picker_unchecked (WidgetsContextMenuMenuCheckPicker* self,
                                                  ObjectsFiltersFilterItem* filter)
{
	GeeHashMap* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (filter != NULL);
	_tmp0_ = self->filters_map;
	_tmp1_ = objects_filters_filter_item_get_id (filter);
	_tmp2_ = _tmp1_;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, _tmp2_)) {
		GeeHashMap* _tmp3_;
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		gpointer _tmp6_;
		WidgetsContextMenuMenuItemCheckPicker* _tmp7_;
		_tmp3_ = self->filters_map;
		_tmp4_ = objects_filters_filter_item_get_id (filter);
		_tmp5_ = _tmp4_;
		_tmp6_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp3_, _tmp5_);
		_tmp7_ = (WidgetsContextMenuMenuItemCheckPicker*) _tmp6_;
		widgets_context_menu_menu_item_check_picker_set_active (_tmp7_, FALSE);
		_g_object_unref0 (_tmp7_);
	}
}

const gchar*
widgets_context_menu_menu_check_picker_get_title (WidgetsContextMenuMenuCheckPicker* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_title;
	result = _tmp0_;
	return result;
}

static void
widgets_context_menu_menu_check_picker_set_title (WidgetsContextMenuMenuCheckPicker* self,
                                                  const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = widgets_context_menu_menu_check_picker_get_title (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_title);
		self->priv->_title = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, widgets_context_menu_menu_check_picker_properties[WIDGETS_CONTEXT_MENU_MENU_CHECK_PICKER_TITLE_PROPERTY]);
	}
}

const gchar*
widgets_context_menu_menu_check_picker_get_icon (WidgetsContextMenuMenuCheckPicker* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_icon;
	result = _tmp0_;
	return result;
}

static void
widgets_context_menu_menu_check_picker_set_icon (WidgetsContextMenuMenuCheckPicker* self,
                                                 const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = widgets_context_menu_menu_check_picker_get_icon (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_icon);
		self->priv->_icon = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, widgets_context_menu_menu_check_picker_properties[WIDGETS_CONTEXT_MENU_MENU_CHECK_PICKER_ICON_PROPERTY]);
	}
}

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

static Block27Data*
block27_data_ref (Block27Data* _data27_)
{
	g_atomic_int_inc (&_data27_->_ref_count_);
	return _data27_;
}

static void
block27_data_unref (void * _userdata_)
{
	Block27Data* _data27_;
	_data27_ = (Block27Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data27_->_ref_count_)) {
		WidgetsContextMenuMenuCheckPicker* self;
		self = _data27_->self;
		_g_object_unref0 (_data27_->listbox_revealer);
		_g_object_unref0 (_data27_->arrow_icon);
		_g_object_unref0 (self);
		g_slice_free (Block27Data, _data27_);
	}
}

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

static void
_widgets_context_menu_menu_check_picker___lambda365_ (Block27Data* _data27_)
{
	WidgetsContextMenuMenuCheckPicker* self;
	GtkRevealer* _tmp0_;
	GtkRevealer* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	GtkRevealer* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	self = _data27_->self;
	_tmp0_ = _data27_->listbox_revealer;
	_tmp1_ = _data27_->listbox_revealer;
	_tmp2_ = gtk_revealer_get_reveal_child (_tmp1_);
	_tmp3_ = _tmp2_;
	gtk_revealer_set_reveal_child (_tmp0_, !_tmp3_);
	_tmp4_ = _data27_->listbox_revealer;
	_tmp5_ = gtk_revealer_get_reveal_child (_tmp4_);
	_tmp6_ = _tmp5_;
	if (_tmp6_) {
		GtkImage* _tmp7_;
		_tmp7_ = _data27_->arrow_icon;
		gtk_widget_add_css_class ((GtkWidget*) _tmp7_, "opened");
	} else {
		GtkImage* _tmp8_;
		_tmp8_ = _data27_->arrow_icon;
		gtk_widget_remove_css_class ((GtkWidget*) _tmp8_, "opened");
	}
}

static void
__widgets_context_menu_menu_check_picker___lambda365__gtk_button_clicked (GtkButton* _sender,
                                                                          gpointer self)
{
	_widgets_context_menu_menu_check_picker___lambda365_ (self);
}

static GObject *
widgets_context_menu_menu_check_picker_constructor (GType type,
                                                    guint n_construct_properties,
                                                    GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	WidgetsContextMenuMenuCheckPicker * self;
	Block27Data* _data27_;
	GeeHashMap* _tmp0_;
	GtkImage* _tmp1_ = NULL;
	GtkImage* _tmp2_;
	GtkWidget* _tmp3_;
	GtkRevealer* _tmp4_ = NULL;
	const gchar* _tmp5_;
	const gchar* _tmp9_;
	GtkLabel* _tmp10_;
	GtkLabel* _tmp11_;
	GThemedIcon* _tmp12_;
	GtkImage* _tmp13_ = NULL;
	GtkImage* _tmp14_;
	GtkImage* _tmp15_;
	GtkBox* itemselector_grid = NULL;
	GtkBox* _tmp16_ = NULL;
	GtkBox* _tmp17_;
	GtkRevealer* _tmp18_;
	GtkBox* _tmp19_;
	GtkLabel* _tmp20_;
	GtkBox* _tmp21_;
	GtkImage* _tmp22_;
	GtkButton* button = NULL;
	GtkButton* _tmp23_;
	GtkButton* _tmp24_;
	GtkBox* _tmp25_;
	GtkButton* _tmp26_;
	GtkButton* _tmp27_;
	GtkButton* _tmp28_;
	gchar* _tmp29_;
	gchar** _tmp30_;
	GtkListBox* _tmp31_ = NULL;
	GtkListBox* _tmp32_;
	GtkWidget* _tmp33_;
	GtkRevealer* _tmp34_ = NULL;
	GtkBox* main_grid = NULL;
	GtkBox* _tmp35_ = NULL;
	GtkBox* _tmp36_;
	GtkButton* _tmp37_;
	GtkBox* _tmp38_;
	GtkRevealer* _tmp39_;
	GtkBox* _tmp40_;
	GtkButton* _tmp41_;
	parent_class = G_OBJECT_CLASS (widgets_context_menu_menu_check_picker_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_CONTEXT_MENU_TYPE_MENU_CHECK_PICKER, WidgetsContextMenuMenuCheckPicker);
	_data27_ = g_slice_new0 (Block27Data);
	_data27_->_ref_count_ = 1;
	_data27_->self = g_object_ref (self);
	_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, WIDGETS_CONTEXT_MENU_TYPE_MENU_ITEM_CHECK_PICKER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (self->filters_map);
	self->filters_map = _tmp0_;
	_tmp1_ = (GtkImage*) gtk_image_new ();
	gtk_widget_set_valign ((GtkWidget*) _tmp1_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->menu_icon);
	self->priv->menu_icon = _tmp1_;
	_tmp2_ = self->priv->menu_icon;
	_tmp3_ = _g_object_ref0 ((GtkWidget*) _tmp2_);
	_tmp4_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_transition_type (_tmp4_, GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT);
	gtk_revealer_set_reveal_child (_tmp4_, FALSE);
	gtk_revealer_set_child (_tmp4_, _tmp3_);
	_g_object_unref0 (_tmp3_);
	g_object_ref_sink (_tmp4_);
	_g_object_unref0 (self->priv->menu_icon_revealer);
	self->priv->menu_icon_revealer = _tmp4_;
	_tmp5_ = self->priv->_icon;
	if (_tmp5_ != NULL) {
		GtkRevealer* _tmp6_;
		GtkImage* _tmp7_;
		const gchar* _tmp8_;
		_tmp6_ = self->priv->menu_icon_revealer;
		gtk_revealer_set_reveal_child (_tmp6_, TRUE);
		_tmp7_ = self->priv->menu_icon;
		_tmp8_ = self->priv->_icon;
		g_object_set (_tmp7_, "icon-name", _tmp8_, NULL);
	}
	_tmp9_ = self->priv->_title;
	_tmp10_ = (GtkLabel*) gtk_label_new (_tmp9_);
	g_object_ref_sink (_tmp10_);
	_g_object_unref0 (self->priv->menu_title);
	self->priv->menu_title = _tmp10_;
	_tmp11_ = self->priv->menu_title;
	gtk_label_set_use_markup (_tmp11_, TRUE);
	_tmp12_ = (GThemedIcon*) g_themed_icon_new ("go-next-symbolic");
	_tmp13_ = (GtkImage*) gtk_image_new ();
	g_object_set (_tmp13_, "gicon", (GIcon*) _tmp12_, NULL);
	_g_object_unref0 (_tmp12_);
	gtk_image_set_pixel_size (_tmp13_, 16);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp13_, TRUE);
	gtk_widget_set_halign ((GtkWidget*) _tmp13_, GTK_ALIGN_END);
	g_object_ref_sink (_tmp13_);
	_data27_->arrow_icon = _tmp13_;
	_tmp14_ = _data27_->arrow_icon;
	gtk_widget_add_css_class ((GtkWidget*) _tmp14_, "transition");
	_tmp15_ = _data27_->arrow_icon;
	gtk_widget_add_css_class ((GtkWidget*) _tmp15_, "hidden-button");
	_tmp16_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp16_, TRUE);
	g_object_ref_sink (_tmp16_);
	itemselector_grid = _tmp16_;
	_tmp17_ = itemselector_grid;
	_tmp18_ = self->priv->menu_icon_revealer;
	gtk_box_append (_tmp17_, (GtkWidget*) _tmp18_);
	_tmp19_ = itemselector_grid;
	_tmp20_ = self->priv->menu_title;
	gtk_box_append (_tmp19_, (GtkWidget*) _tmp20_);
	_tmp21_ = itemselector_grid;
	_tmp22_ = _data27_->arrow_icon;
	gtk_box_append (_tmp21_, (GtkWidget*) _tmp22_);
	_tmp23_ = (GtkButton*) gtk_button_new ();
	g_object_ref_sink (_tmp23_);
	button = _tmp23_;
	_tmp24_ = button;
	_tmp25_ = itemselector_grid;
	gtk_button_set_child (_tmp24_, (GtkWidget*) _tmp25_);
	_tmp26_ = button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp26_, "flat");
	_tmp27_ = button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp27_, "transition");
	_tmp28_ = button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp28_, "no-font-bold");
	_tmp29_ = g_strdup ("listbox-background");
	_tmp30_ = g_new0 (gchar*, 1 + 1);
	_tmp30_[0] = _tmp29_;
	_tmp31_ = (GtkListBox*) gtk_list_box_new ();
	gtk_widget_set_css_classes ((GtkWidget*) _tmp31_, _tmp30_);
	_tmp30_ = (_vala_array_free (_tmp30_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp31_);
	_g_object_unref0 (self->priv->listbox);
	self->priv->listbox = _tmp31_;
	_tmp32_ = self->priv->listbox;
	_tmp33_ = _g_object_ref0 ((GtkWidget*) _tmp32_);
	_tmp34_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_transition_type (_tmp34_, GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN);
	gtk_revealer_set_child (_tmp34_, _tmp33_);
	_g_object_unref0 (_tmp33_);
	g_object_ref_sink (_tmp34_);
	_data27_->listbox_revealer = _tmp34_;
	_tmp35_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp35_, TRUE);
	g_object_ref_sink (_tmp35_);
	main_grid = _tmp35_;
	_tmp36_ = main_grid;
	_tmp37_ = button;
	gtk_box_append (_tmp36_, (GtkWidget*) _tmp37_);
	_tmp38_ = main_grid;
	_tmp39_ = _data27_->listbox_revealer;
	gtk_box_append (_tmp38_, (GtkWidget*) _tmp39_);
	_tmp40_ = main_grid;
	adw_bin_set_child ((AdwBin*) self, (GtkWidget*) _tmp40_);
	_tmp41_ = button;
	g_signal_connect_data (_tmp41_, "clicked", (GCallback) __widgets_context_menu_menu_check_picker___lambda365__gtk_button_clicked, block27_data_ref (_data27_), (GClosureNotify) block27_data_unref, 0);
	_g_object_unref0 (main_grid);
	_g_object_unref0 (button);
	_g_object_unref0 (itemselector_grid);
	block27_data_unref (_data27_);
	_data27_ = NULL;
	return obj;
}

static void
widgets_context_menu_menu_check_picker_class_init (WidgetsContextMenuMenuCheckPickerClass * klass,
                                                   gpointer klass_data)
{
	widgets_context_menu_menu_check_picker_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &WidgetsContextMenuMenuCheckPicker_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_widgets_context_menu_menu_check_picker_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_widgets_context_menu_menu_check_picker_set_property;
	G_OBJECT_CLASS (klass)->constructor = widgets_context_menu_menu_check_picker_constructor;
	G_OBJECT_CLASS (klass)->finalize = widgets_context_menu_menu_check_picker_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_CONTEXT_MENU_MENU_CHECK_PICKER_TITLE_PROPERTY, widgets_context_menu_menu_check_picker_properties[WIDGETS_CONTEXT_MENU_MENU_CHECK_PICKER_TITLE_PROPERTY] = g_param_spec_string ("title", "title", "title", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_CONTEXT_MENU_MENU_CHECK_PICKER_ICON_PROPERTY, widgets_context_menu_menu_check_picker_properties[WIDGETS_CONTEXT_MENU_MENU_CHECK_PICKER_ICON_PROPERTY] = g_param_spec_string ("icon", "icon", "icon", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	widgets_context_menu_menu_check_picker_signals[WIDGETS_CONTEXT_MENU_MENU_CHECK_PICKER_FILTER_CHANGE_SIGNAL] = g_signal_new ("filter-change", WIDGETS_CONTEXT_MENU_TYPE_MENU_CHECK_PICKER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_BOOLEAN, G_TYPE_NONE, 2, OBJECTS_FILTERS_TYPE_FILTER_ITEM, G_TYPE_BOOLEAN);
}

static void
widgets_context_menu_menu_check_picker_instance_init (WidgetsContextMenuMenuCheckPicker * self,
                                                      gpointer klass)
{
	self->priv = widgets_context_menu_menu_check_picker_get_instance_private (self);
}

static void
widgets_context_menu_menu_check_picker_finalize (GObject * obj)
{
	WidgetsContextMenuMenuCheckPicker * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_CONTEXT_MENU_TYPE_MENU_CHECK_PICKER, WidgetsContextMenuMenuCheckPicker);
	g_debug ("MenuCheckPicker.vala:44: Destroying - Widgets.ContextMenu.MenuCheckPic" \
"ker\n");
	_g_free0 (self->priv->_title);
	_g_free0 (self->priv->_icon);
	_g_object_unref0 (self->priv->menu_icon);
	_g_object_unref0 (self->priv->menu_icon_revealer);
	_g_object_unref0 (self->priv->menu_title);
	_g_object_unref0 (self->priv->listbox);
	_g_object_unref0 (self->filters_map);
	G_OBJECT_CLASS (widgets_context_menu_menu_check_picker_parent_class)->finalize (obj);
}

static GType
widgets_context_menu_menu_check_picker_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (WidgetsContextMenuMenuCheckPickerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) widgets_context_menu_menu_check_picker_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WidgetsContextMenuMenuCheckPicker), 0, (GInstanceInitFunc) widgets_context_menu_menu_check_picker_instance_init, NULL };
	GType widgets_context_menu_menu_check_picker_type_id;
	widgets_context_menu_menu_check_picker_type_id = g_type_register_static (adw_bin_get_type (), "WidgetsContextMenuMenuCheckPicker", &g_define_type_info, 0);
	WidgetsContextMenuMenuCheckPicker_private_offset = g_type_add_instance_private (widgets_context_menu_menu_check_picker_type_id, sizeof (WidgetsContextMenuMenuCheckPickerPrivate));
	return widgets_context_menu_menu_check_picker_type_id;
}

GType
widgets_context_menu_menu_check_picker_get_type (void)
{
	static volatile gsize widgets_context_menu_menu_check_picker_type_id__once = 0;
	if (g_once_init_enter (&widgets_context_menu_menu_check_picker_type_id__once)) {
		GType widgets_context_menu_menu_check_picker_type_id;
		widgets_context_menu_menu_check_picker_type_id = widgets_context_menu_menu_check_picker_get_type_once ();
		g_once_init_leave (&widgets_context_menu_menu_check_picker_type_id__once, widgets_context_menu_menu_check_picker_type_id);
	}
	return widgets_context_menu_menu_check_picker_type_id__once;
}

static void
_vala_widgets_context_menu_menu_check_picker_get_property (GObject * object,
                                                           guint property_id,
                                                           GValue * value,
                                                           GParamSpec * pspec)
{
	WidgetsContextMenuMenuCheckPicker * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_CONTEXT_MENU_TYPE_MENU_CHECK_PICKER, WidgetsContextMenuMenuCheckPicker);
	switch (property_id) {
		case WIDGETS_CONTEXT_MENU_MENU_CHECK_PICKER_TITLE_PROPERTY:
		g_value_set_string (value, widgets_context_menu_menu_check_picker_get_title (self));
		break;
		case WIDGETS_CONTEXT_MENU_MENU_CHECK_PICKER_ICON_PROPERTY:
		g_value_set_string (value, widgets_context_menu_menu_check_picker_get_icon (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_widgets_context_menu_menu_check_picker_set_property (GObject * object,
                                                           guint property_id,
                                                           const GValue * value,
                                                           GParamSpec * pspec)
{
	WidgetsContextMenuMenuCheckPicker * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_CONTEXT_MENU_TYPE_MENU_CHECK_PICKER, WidgetsContextMenuMenuCheckPicker);
	switch (property_id) {
		case WIDGETS_CONTEXT_MENU_MENU_CHECK_PICKER_TITLE_PROPERTY:
		widgets_context_menu_menu_check_picker_set_title (self, g_value_get_string (value));
		break;
		case WIDGETS_CONTEXT_MENU_MENU_CHECK_PICKER_ICON_PROPERTY:
		widgets_context_menu_menu_check_picker_set_icon (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
widgets_context_menu_menu_item_check_picker_get_instance_private (WidgetsContextMenuMenuItemCheckPicker* self)
{
	return G_STRUCT_MEMBER_P (self, WidgetsContextMenuMenuItemCheckPicker_private_offset);
}

WidgetsContextMenuMenuItemCheckPicker*
widgets_context_menu_menu_item_check_picker_construct (GType object_type,
                                                       ObjectsFiltersFilterItem* filter)
{
	WidgetsContextMenuMenuItemCheckPicker * self = NULL;
	g_return_val_if_fail (filter != NULL, NULL);
	self = (WidgetsContextMenuMenuItemCheckPicker*) g_object_new (object_type, "filter", filter, NULL);
	return self;
}

WidgetsContextMenuMenuItemCheckPicker*
widgets_context_menu_menu_item_check_picker_new (ObjectsFiltersFilterItem* filter)
{
	return widgets_context_menu_menu_item_check_picker_construct (WIDGETS_CONTEXT_MENU_TYPE_MENU_ITEM_CHECK_PICKER, filter);
}

ObjectsFiltersFilterItem*
widgets_context_menu_menu_item_check_picker_get_filter (WidgetsContextMenuMenuItemCheckPicker* self)
{
	ObjectsFiltersFilterItem* result;
	ObjectsFiltersFilterItem* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_filter;
	result = _tmp0_;
	return result;
}

static void
widgets_context_menu_menu_item_check_picker_set_filter (WidgetsContextMenuMenuItemCheckPicker* self,
                                                        ObjectsFiltersFilterItem* value)
{
	ObjectsFiltersFilterItem* old_value;
	g_return_if_fail (self != NULL);
	old_value = widgets_context_menu_menu_item_check_picker_get_filter (self);
	if (old_value != value) {
		ObjectsFiltersFilterItem* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_filter);
		self->priv->_filter = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, widgets_context_menu_menu_item_check_picker_properties[WIDGETS_CONTEXT_MENU_MENU_ITEM_CHECK_PICKER_FILTER_PROPERTY]);
	}
}

gboolean
widgets_context_menu_menu_item_check_picker_get_active (WidgetsContextMenuMenuItemCheckPicker* self)
{
	gboolean result;
	GtkCheckButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->check_button;
	_tmp1_ = gtk_check_button_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

void
widgets_context_menu_menu_item_check_picker_set_active (WidgetsContextMenuMenuItemCheckPicker* self,
                                                        gboolean value)
{
	GtkCheckButton* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->check_button;
	gtk_check_button_set_active (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, widgets_context_menu_menu_item_check_picker_properties[WIDGETS_CONTEXT_MENU_MENU_ITEM_CHECK_PICKER_ACTIVE_PROPERTY]);
}

static Block28Data*
block28_data_ref (Block28Data* _data28_)
{
	g_atomic_int_inc (&_data28_->_ref_count_);
	return _data28_;
}

static void
block28_data_unref (void * _userdata_)
{
	Block28Data* _data28_;
	_data28_ = (Block28Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data28_->_ref_count_)) {
		WidgetsContextMenuMenuItemCheckPicker* self;
		self = _data28_->self;
		_g_object_unref0 (_data28_->gesture);
		_g_object_unref0 (self);
		g_slice_free (Block28Data, _data28_);
	}
}

static void
_widgets_context_menu_menu_item_check_picker___lambda362_ (Block28Data* _data28_)
{
	WidgetsContextMenuMenuItemCheckPicker* self;
	GtkGestureClick* _tmp0_;
	GtkCheckButton* _tmp1_;
	GtkCheckButton* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	ObjectsFiltersFilterItem* _tmp5_;
	GtkCheckButton* _tmp6_;
	gboolean _tmp7_;
	gboolean _tmp8_;
	self = _data28_->self;
	_tmp0_ = _data28_->gesture;
	gtk_gesture_set_state ((GtkGesture*) _tmp0_, GTK_EVENT_SEQUENCE_CLAIMED);
	_tmp1_ = self->priv->check_button;
	_tmp2_ = self->priv->check_button;
	_tmp3_ = gtk_check_button_get_active (_tmp2_);
	_tmp4_ = _tmp3_;
	gtk_check_button_set_active (_tmp1_, !_tmp4_);
	_tmp5_ = self->priv->_filter;
	_tmp6_ = self->priv->check_button;
	_tmp7_ = gtk_check_button_get_active (_tmp6_);
	_tmp8_ = _tmp7_;
	g_signal_emit (self, widgets_context_menu_menu_item_check_picker_signals[WIDGETS_CONTEXT_MENU_MENU_ITEM_CHECK_PICKER_CHECKED_SIGNAL], 0, _tmp5_, _tmp8_);
}

static void
__widgets_context_menu_menu_item_check_picker___lambda362__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                                                      gint n_press,
                                                                                      gdouble x,
                                                                                      gdouble y,
                                                                                      gpointer self)
{
	_widgets_context_menu_menu_item_check_picker___lambda362_ (self);
}

static void
_widgets_context_menu_menu_item_check_picker___lambda363_ (WidgetsContextMenuMenuItemCheckPicker* self)
{
	GtkCheckButton* _tmp0_;
	GtkCheckButton* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	ObjectsFiltersFilterItem* _tmp4_;
	GtkCheckButton* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	_tmp0_ = self->priv->check_button;
	_tmp1_ = self->priv->check_button;
	_tmp2_ = gtk_check_button_get_active (_tmp1_);
	_tmp3_ = _tmp2_;
	gtk_check_button_set_active (_tmp0_, !_tmp3_);
	_tmp4_ = self->priv->_filter;
	_tmp5_ = self->priv->check_button;
	_tmp6_ = gtk_check_button_get_active (_tmp5_);
	_tmp7_ = _tmp6_;
	g_signal_emit (self, widgets_context_menu_menu_item_check_picker_signals[WIDGETS_CONTEXT_MENU_MENU_ITEM_CHECK_PICKER_CHECKED_SIGNAL], 0, _tmp4_, _tmp7_);
}

static void
__widgets_context_menu_menu_item_check_picker___lambda363__gtk_list_box_row_activate (GtkListBoxRow* _sender,
                                                                                      gpointer self)
{
	_widgets_context_menu_menu_item_check_picker___lambda363_ ((WidgetsContextMenuMenuItemCheckPicker*) self);
}

static GObject *
widgets_context_menu_menu_item_check_picker_constructor (GType type,
                                                         guint n_construct_properties,
                                                         GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	WidgetsContextMenuMenuItemCheckPicker * self;
	Block28Data* _data28_;
	ObjectsFiltersFilterItem* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar** _tmp4_;
	GtkCheckButton* _tmp5_ = NULL;
	GtkBox* content_box = NULL;
	GtkBox* _tmp6_ = NULL;
	GtkBox* _tmp7_;
	GtkCheckButton* _tmp8_;
	GtkBox* _tmp9_;
	GtkGestureClick* _tmp10_;
	GtkGestureClick* _tmp11_;
	GtkEventController* _tmp12_;
	GtkGestureClick* _tmp13_;
	parent_class = G_OBJECT_CLASS (widgets_context_menu_menu_item_check_picker_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_CONTEXT_MENU_TYPE_MENU_ITEM_CHECK_PICKER, WidgetsContextMenuMenuItemCheckPicker);
	_data28_ = g_slice_new0 (Block28Data);
	_data28_->_ref_count_ = 1;
	_data28_->self = g_object_ref (self);
	gtk_widget_add_css_class ((GtkWidget*) self, "border-radius-6");
	_tmp0_ = self->priv->_filter;
	_tmp1_ = objects_filters_filter_item_get_name (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strdup ("checkbutton-label");
	_tmp4_ = g_new0 (gchar*, 1 + 1);
	_tmp4_[0] = _tmp3_;
	_tmp5_ = (GtkCheckButton*) gtk_check_button_new_with_label (_tmp2_);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp5_, TRUE);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp5_, _tmp4_);
	_tmp4_ = (_vala_array_free (_tmp4_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp5_);
	_g_object_unref0 (self->priv->check_button);
	self->priv->check_button = _tmp5_;
	_tmp6_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp6_, 3);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp6_, 3);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp6_, 3);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp6_, 3);
	g_object_ref_sink (_tmp6_);
	content_box = _tmp6_;
	_tmp7_ = content_box;
	_tmp8_ = self->priv->check_button;
	gtk_box_append (_tmp7_, (GtkWidget*) _tmp8_);
	_tmp9_ = content_box;
	gtk_list_box_row_set_child ((GtkListBoxRow*) self, (GtkWidget*) _tmp9_);
	_tmp10_ = (GtkGestureClick*) gtk_gesture_click_new ();
	_data28_->gesture = _tmp10_;
	_tmp11_ = _data28_->gesture;
	_tmp12_ = _g_object_ref0 ((GtkEventController*) _tmp11_);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp12_);
	_tmp13_ = _data28_->gesture;
	g_signal_connect_data (_tmp13_, "pressed", (GCallback) __widgets_context_menu_menu_item_check_picker___lambda362__gtk_gesture_click_pressed, block28_data_ref (_data28_), (GClosureNotify) block28_data_unref, 0);
	g_signal_connect_object ((GtkListBoxRow*) self, "activate", (GCallback) __widgets_context_menu_menu_item_check_picker___lambda363__gtk_list_box_row_activate, self, 0);
	_g_object_unref0 (content_box);
	block28_data_unref (_data28_);
	_data28_ = NULL;
	return obj;
}

static void
widgets_context_menu_menu_item_check_picker_class_init (WidgetsContextMenuMenuItemCheckPickerClass * klass,
                                                        gpointer klass_data)
{
	widgets_context_menu_menu_item_check_picker_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &WidgetsContextMenuMenuItemCheckPicker_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_widgets_context_menu_menu_item_check_picker_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_widgets_context_menu_menu_item_check_picker_set_property;
	G_OBJECT_CLASS (klass)->constructor = widgets_context_menu_menu_item_check_picker_constructor;
	G_OBJECT_CLASS (klass)->finalize = widgets_context_menu_menu_item_check_picker_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_CONTEXT_MENU_MENU_ITEM_CHECK_PICKER_FILTER_PROPERTY, widgets_context_menu_menu_item_check_picker_properties[WIDGETS_CONTEXT_MENU_MENU_ITEM_CHECK_PICKER_FILTER_PROPERTY] = g_param_spec_object ("filter", "filter", "filter", OBJECTS_FILTERS_TYPE_FILTER_ITEM, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_CONTEXT_MENU_MENU_ITEM_CHECK_PICKER_ACTIVE_PROPERTY, widgets_context_menu_menu_item_check_picker_properties[WIDGETS_CONTEXT_MENU_MENU_ITEM_CHECK_PICKER_ACTIVE_PROPERTY] = g_param_spec_boolean ("active", "active", "active", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	widgets_context_menu_menu_item_check_picker_signals[WIDGETS_CONTEXT_MENU_MENU_ITEM_CHECK_PICKER_CHECKED_SIGNAL] = g_signal_new ("checked", WIDGETS_CONTEXT_MENU_TYPE_MENU_ITEM_CHECK_PICKER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_BOOLEAN, G_TYPE_NONE, 2, OBJECTS_FILTERS_TYPE_FILTER_ITEM, G_TYPE_BOOLEAN);
}

static void
widgets_context_menu_menu_item_check_picker_instance_init (WidgetsContextMenuMenuItemCheckPicker * self,
                                                           gpointer klass)
{
	self->priv = widgets_context_menu_menu_item_check_picker_get_instance_private (self);
}

static void
widgets_context_menu_menu_item_check_picker_finalize (GObject * obj)
{
	WidgetsContextMenuMenuItemCheckPicker * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_CONTEXT_MENU_TYPE_MENU_ITEM_CHECK_PICKER, WidgetsContextMenuMenuItemCheckPicker);
	_g_object_unref0 (self->priv->_filter);
	_g_object_unref0 (self->priv->check_button);
	G_OBJECT_CLASS (widgets_context_menu_menu_item_check_picker_parent_class)->finalize (obj);
}

static GType
widgets_context_menu_menu_item_check_picker_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (WidgetsContextMenuMenuItemCheckPickerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) widgets_context_menu_menu_item_check_picker_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WidgetsContextMenuMenuItemCheckPicker), 0, (GInstanceInitFunc) widgets_context_menu_menu_item_check_picker_instance_init, NULL };
	GType widgets_context_menu_menu_item_check_picker_type_id;
	widgets_context_menu_menu_item_check_picker_type_id = g_type_register_static (gtk_list_box_row_get_type (), "WidgetsContextMenuMenuItemCheckPicker", &g_define_type_info, 0);
	WidgetsContextMenuMenuItemCheckPicker_private_offset = g_type_add_instance_private (widgets_context_menu_menu_item_check_picker_type_id, sizeof (WidgetsContextMenuMenuItemCheckPickerPrivate));
	return widgets_context_menu_menu_item_check_picker_type_id;
}

GType
widgets_context_menu_menu_item_check_picker_get_type (void)
{
	static volatile gsize widgets_context_menu_menu_item_check_picker_type_id__once = 0;
	if (g_once_init_enter (&widgets_context_menu_menu_item_check_picker_type_id__once)) {
		GType widgets_context_menu_menu_item_check_picker_type_id;
		widgets_context_menu_menu_item_check_picker_type_id = widgets_context_menu_menu_item_check_picker_get_type_once ();
		g_once_init_leave (&widgets_context_menu_menu_item_check_picker_type_id__once, widgets_context_menu_menu_item_check_picker_type_id);
	}
	return widgets_context_menu_menu_item_check_picker_type_id__once;
}

static void
_vala_widgets_context_menu_menu_item_check_picker_get_property (GObject * object,
                                                                guint property_id,
                                                                GValue * value,
                                                                GParamSpec * pspec)
{
	WidgetsContextMenuMenuItemCheckPicker * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_CONTEXT_MENU_TYPE_MENU_ITEM_CHECK_PICKER, WidgetsContextMenuMenuItemCheckPicker);
	switch (property_id) {
		case WIDGETS_CONTEXT_MENU_MENU_ITEM_CHECK_PICKER_FILTER_PROPERTY:
		g_value_set_object (value, widgets_context_menu_menu_item_check_picker_get_filter (self));
		break;
		case WIDGETS_CONTEXT_MENU_MENU_ITEM_CHECK_PICKER_ACTIVE_PROPERTY:
		g_value_set_boolean (value, widgets_context_menu_menu_item_check_picker_get_active (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_widgets_context_menu_menu_item_check_picker_set_property (GObject * object,
                                                                guint property_id,
                                                                const GValue * value,
                                                                GParamSpec * pspec)
{
	WidgetsContextMenuMenuItemCheckPicker * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_CONTEXT_MENU_TYPE_MENU_ITEM_CHECK_PICKER, WidgetsContextMenuMenuItemCheckPicker);
	switch (property_id) {
		case WIDGETS_CONTEXT_MENU_MENU_ITEM_CHECK_PICKER_FILTER_PROPERTY:
		widgets_context_menu_menu_item_check_picker_set_filter (self, g_value_get_object (value));
		break;
		case WIDGETS_CONTEXT_MENU_MENU_ITEM_CHECK_PICKER_ACTIVE_PROPERTY:
		widgets_context_menu_menu_item_check_picker_set_active (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

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;
}

