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

/* Collections.vala
 *
 * Copyright (C) 2009-2025 Jerry Casiano
 *
 * 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, see <http://www.gnu.org/licenses/gpl-3.0.txt>.
*/

#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <glib-object.h>
#include <gio/gio.h>
#include "font-manager.h"
#include <glib/gstdio.h>
#include <json-glib/json-glib.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <float.h>
#include <math.h>

#define FONT_MANAGER_DEFAULT_COLLECTION_NAME _ ("Enter Collection Name")
#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 FONT_MANAGER_TYPE_FONT_LIST_FILTER_MODEL (font_manager_font_list_filter_model_get_type ())
#define FONT_MANAGER_FONT_LIST_FILTER_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_FONT_LIST_FILTER_MODEL, FontManagerFontListFilterModel))
#define FONT_MANAGER_FONT_LIST_FILTER_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_FONT_LIST_FILTER_MODEL, FontManagerFontListFilterModelClass))
#define FONT_MANAGER_IS_FONT_LIST_FILTER_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_FONT_LIST_FILTER_MODEL))
#define FONT_MANAGER_IS_FONT_LIST_FILTER_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_FONT_LIST_FILTER_MODEL))
#define FONT_MANAGER_FONT_LIST_FILTER_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_FONT_LIST_FILTER_MODEL, FontManagerFontListFilterModelClass))

typedef struct _FontManagerFontListFilterModel FontManagerFontListFilterModel;
typedef struct _FontManagerFontListFilterModelClass FontManagerFontListFilterModelClass;
typedef struct _FontManagerFontListFilterModelPrivate FontManagerFontListFilterModelPrivate;

#define FONT_MANAGER_TYPE_CACHEABLE (font_manager_cacheable_get_type ())
#define FONT_MANAGER_CACHEABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_CACHEABLE, FontManagerCacheable))
#define FONT_MANAGER_CACHEABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_CACHEABLE, FontManagerCacheableClass))
#define FONT_MANAGER_IS_CACHEABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_CACHEABLE))
#define FONT_MANAGER_IS_CACHEABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_CACHEABLE))
#define FONT_MANAGER_CACHEABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_CACHEABLE, FontManagerCacheableClass))

typedef struct _FontManagerCacheable FontManagerCacheable;
typedef struct _FontManagerCacheableClass FontManagerCacheableClass;

#define FONT_MANAGER_TYPE_FONT_LIST_FILTER (font_manager_font_list_filter_get_type ())
#define FONT_MANAGER_FONT_LIST_FILTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_FONT_LIST_FILTER, FontManagerFontListFilter))
#define FONT_MANAGER_FONT_LIST_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_FONT_LIST_FILTER, FontManagerFontListFilterClass))
#define FONT_MANAGER_IS_FONT_LIST_FILTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_FONT_LIST_FILTER))
#define FONT_MANAGER_IS_FONT_LIST_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_FONT_LIST_FILTER))
#define FONT_MANAGER_FONT_LIST_FILTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_FONT_LIST_FILTER, FontManagerFontListFilterClass))

typedef struct _FontManagerFontListFilter FontManagerFontListFilter;
typedef struct _FontManagerFontListFilterClass FontManagerFontListFilterClass;

#define FONT_MANAGER_TYPE_COLLECTION_LIST_MODEL (font_manager_collection_list_model_get_type ())
#define FONT_MANAGER_COLLECTION_LIST_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_COLLECTION_LIST_MODEL, FontManagerCollectionListModel))
#define FONT_MANAGER_COLLECTION_LIST_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_COLLECTION_LIST_MODEL, FontManagerCollectionListModelClass))
#define FONT_MANAGER_IS_COLLECTION_LIST_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_COLLECTION_LIST_MODEL))
#define FONT_MANAGER_IS_COLLECTION_LIST_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_COLLECTION_LIST_MODEL))
#define FONT_MANAGER_COLLECTION_LIST_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_COLLECTION_LIST_MODEL, FontManagerCollectionListModelClass))

typedef struct _FontManagerCollectionListModel FontManagerCollectionListModel;
typedef struct _FontManagerCollectionListModelClass FontManagerCollectionListModelClass;
typedef struct _FontManagerCollectionListModelPrivate FontManagerCollectionListModelPrivate;
typedef enum  {
	FONT_MANAGER_SORT_TYPE_NAME,
	FONT_MANAGER_SORT_TYPE_SIZE,
	FONT_MANAGER_SORT_TYPE_NONE,
	FONT_MANAGER_SORT_TYPE_N_SORT_OPTIONS
} FontManagerSortType;

#define FONT_MANAGER_TYPE_SORT_TYPE (font_manager_sort_type_get_type ())
enum  {
	FONT_MANAGER_COLLECTION_LIST_MODEL_0_PROPERTY,
	FONT_MANAGER_COLLECTION_LIST_MODEL_SORT_TYPE_PROPERTY,
	FONT_MANAGER_COLLECTION_LIST_MODEL_DISABLED_FAMILIES_PROPERTY,
	FONT_MANAGER_COLLECTION_LIST_MODEL_AVAILABLE_FAMILIES_PROPERTY,
	FONT_MANAGER_COLLECTION_LIST_MODEL_NUM_PROPERTIES
};
static GParamSpec* font_manager_collection_list_model_properties[FONT_MANAGER_COLLECTION_LIST_MODEL_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block1Data Block1Data;
#define _g_ptr_array_unref0(var) ((var == NULL) ? NULL : (var = (g_ptr_array_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define FONT_MANAGER_TYPE_COLLECTION (font_manager_collection_get_type ())
#define FONT_MANAGER_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_COLLECTION, FontManagerCollection))
#define FONT_MANAGER_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_COLLECTION, FontManagerCollectionClass))
#define FONT_MANAGER_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_COLLECTION))
#define FONT_MANAGER_IS_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_COLLECTION))
#define FONT_MANAGER_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_COLLECTION, FontManagerCollectionClass))

typedef struct _FontManagerCollection FontManagerCollection;
typedef struct _FontManagerCollectionClass FontManagerCollectionClass;
#define __vala_JsonNode_free0(var) ((var == NULL) ? NULL : (var = (_vala_JsonNode_free (var), NULL)))
#define _json_array_unref0(var) ((var == NULL) ? NULL : (var = (json_array_unref (var), NULL)))
#define _json_object_unref0(var) ((var == NULL) ? NULL : (var = (json_object_unref (var), NULL)))
enum  {
	FONT_MANAGER_COLLECTION_LIST_MODEL_CHANGED_SIGNAL,
	FONT_MANAGER_COLLECTION_LIST_MODEL_NUM_SIGNALS
};
static guint font_manager_collection_list_model_signals[FONT_MANAGER_COLLECTION_LIST_MODEL_NUM_SIGNALS] = {0};

#define FONT_MANAGER_TYPE_LIST_ITEM_ROW (font_manager_list_item_row_get_type ())
#define FONT_MANAGER_LIST_ITEM_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_LIST_ITEM_ROW, FontManagerListItemRow))
#define FONT_MANAGER_LIST_ITEM_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_LIST_ITEM_ROW, FontManagerListItemRowClass))
#define FONT_MANAGER_IS_LIST_ITEM_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_LIST_ITEM_ROW))
#define FONT_MANAGER_IS_LIST_ITEM_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_LIST_ITEM_ROW))
#define FONT_MANAGER_LIST_ITEM_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_LIST_ITEM_ROW, FontManagerListItemRowClass))

typedef struct _FontManagerListItemRow FontManagerListItemRow;
typedef struct _FontManagerListItemRowClass FontManagerListItemRowClass;
typedef struct _FontManagerListItemRowPrivate FontManagerListItemRowPrivate;

#define FONT_MANAGER_TYPE_TREE_LIST_ITEM_ROW (font_manager_tree_list_item_row_get_type ())
#define FONT_MANAGER_TREE_LIST_ITEM_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_TREE_LIST_ITEM_ROW, FontManagerTreeListItemRow))
#define FONT_MANAGER_TREE_LIST_ITEM_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_TREE_LIST_ITEM_ROW, FontManagerTreeListItemRowClass))
#define FONT_MANAGER_IS_TREE_LIST_ITEM_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_TREE_LIST_ITEM_ROW))
#define FONT_MANAGER_IS_TREE_LIST_ITEM_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_TREE_LIST_ITEM_ROW))
#define FONT_MANAGER_TREE_LIST_ITEM_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_TREE_LIST_ITEM_ROW, FontManagerTreeListItemRowClass))

typedef struct _FontManagerTreeListItemRow FontManagerTreeListItemRow;
typedef struct _FontManagerTreeListItemRowClass FontManagerTreeListItemRowClass;
typedef struct _FontManagerTreeListItemRowPrivate FontManagerTreeListItemRowPrivate;

#define FONT_MANAGER_TYPE_COLLECTION_LIST_ROW (font_manager_collection_list_row_get_type ())
#define FONT_MANAGER_COLLECTION_LIST_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_COLLECTION_LIST_ROW, FontManagerCollectionListRow))
#define FONT_MANAGER_COLLECTION_LIST_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_COLLECTION_LIST_ROW, FontManagerCollectionListRowClass))
#define FONT_MANAGER_IS_COLLECTION_LIST_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_COLLECTION_LIST_ROW))
#define FONT_MANAGER_IS_COLLECTION_LIST_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_COLLECTION_LIST_ROW))
#define FONT_MANAGER_COLLECTION_LIST_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_COLLECTION_LIST_ROW, FontManagerCollectionListRowClass))

typedef struct _FontManagerCollectionListRow FontManagerCollectionListRow;
typedef struct _FontManagerCollectionListRowClass FontManagerCollectionListRowClass;
typedef struct _FontManagerCollectionListRowPrivate FontManagerCollectionListRowPrivate;
enum  {
	FONT_MANAGER_COLLECTION_LIST_ROW_0_PROPERTY,
	FONT_MANAGER_COLLECTION_LIST_ROW_NUM_PROPERTIES
};
static GParamSpec* font_manager_collection_list_row_properties[FONT_MANAGER_COLLECTION_LIST_ROW_NUM_PROPERTIES];

#define FONT_MANAGER_TYPE_COLLECTION_RENAME_POPOVER (font_manager_collection_rename_popover_get_type ())
#define FONT_MANAGER_COLLECTION_RENAME_POPOVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_COLLECTION_RENAME_POPOVER, FontManagerCollectionRenamePopover))
#define FONT_MANAGER_COLLECTION_RENAME_POPOVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_COLLECTION_RENAME_POPOVER, FontManagerCollectionRenamePopoverClass))
#define FONT_MANAGER_IS_COLLECTION_RENAME_POPOVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_COLLECTION_RENAME_POPOVER))
#define FONT_MANAGER_IS_COLLECTION_RENAME_POPOVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_COLLECTION_RENAME_POPOVER))
#define FONT_MANAGER_COLLECTION_RENAME_POPOVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_COLLECTION_RENAME_POPOVER, FontManagerCollectionRenamePopoverClass))

typedef struct _FontManagerCollectionRenamePopover FontManagerCollectionRenamePopover;
typedef struct _FontManagerCollectionRenamePopoverClass FontManagerCollectionRenamePopoverClass;
typedef struct _FontManagerCollectionRenamePopoverPrivate FontManagerCollectionRenamePopoverPrivate;
enum  {
	FONT_MANAGER_COLLECTION_RENAME_POPOVER_0_PROPERTY,
	FONT_MANAGER_COLLECTION_RENAME_POPOVER_NAME_ENTRY_PROPERTY,
	FONT_MANAGER_COLLECTION_RENAME_POPOVER_RENAME_BUTTON_PROPERTY,
	FONT_MANAGER_COLLECTION_RENAME_POPOVER_NUM_PROPERTIES
};
static GParamSpec* font_manager_collection_rename_popover_properties[FONT_MANAGER_COLLECTION_RENAME_POPOVER_NUM_PROPERTIES];
enum  {
	FONT_MANAGER_COLLECTION_RENAME_POPOVER_RENAMED_SIGNAL,
	FONT_MANAGER_COLLECTION_RENAME_POPOVER_NUM_SIGNALS
};
static guint font_manager_collection_rename_popover_signals[FONT_MANAGER_COLLECTION_RENAME_POPOVER_NUM_SIGNALS] = {0};

#define FONT_MANAGER_TYPE_FILTER_LIST_VIEW (font_manager_filter_list_view_get_type ())
#define FONT_MANAGER_FILTER_LIST_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_FILTER_LIST_VIEW, FontManagerFilterListView))
#define FONT_MANAGER_FILTER_LIST_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_FILTER_LIST_VIEW, FontManagerFilterListViewClass))
#define FONT_MANAGER_IS_FILTER_LIST_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_FILTER_LIST_VIEW))
#define FONT_MANAGER_IS_FILTER_LIST_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_FILTER_LIST_VIEW))
#define FONT_MANAGER_FILTER_LIST_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_FILTER_LIST_VIEW, FontManagerFilterListViewClass))

typedef struct _FontManagerFilterListView FontManagerFilterListView;
typedef struct _FontManagerFilterListViewClass FontManagerFilterListViewClass;
typedef struct _FontManagerFilterListViewPrivate FontManagerFilterListViewPrivate;

#define FONT_MANAGER_TYPE_COLLECTION_LIST_VIEW (font_manager_collection_list_view_get_type ())
#define FONT_MANAGER_COLLECTION_LIST_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_COLLECTION_LIST_VIEW, FontManagerCollectionListView))
#define FONT_MANAGER_COLLECTION_LIST_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_COLLECTION_LIST_VIEW, FontManagerCollectionListViewClass))
#define FONT_MANAGER_IS_COLLECTION_LIST_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_COLLECTION_LIST_VIEW))
#define FONT_MANAGER_IS_COLLECTION_LIST_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_COLLECTION_LIST_VIEW))
#define FONT_MANAGER_COLLECTION_LIST_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_COLLECTION_LIST_VIEW, FontManagerCollectionListViewClass))

typedef struct _FontManagerCollectionListView FontManagerCollectionListView;
typedef struct _FontManagerCollectionListViewClass FontManagerCollectionListViewClass;
typedef struct _FontManagerCollectionListViewPrivate FontManagerCollectionListViewPrivate;
enum  {
	FONT_MANAGER_COLLECTION_LIST_VIEW_0_PROPERTY,
	FONT_MANAGER_COLLECTION_LIST_VIEW_DISABLED_FAMILIES_PROPERTY,
	FONT_MANAGER_COLLECTION_LIST_VIEW_NUM_PROPERTIES
};
static GParamSpec* font_manager_collection_list_view_properties[FONT_MANAGER_COLLECTION_LIST_VIEW_NUM_PROPERTIES];

#define FONT_MANAGER_TYPE_MENU_ENTRY (font_manager_menu_entry_get_type ())
typedef struct _FontManagerMenuEntry FontManagerMenuEntry;
typedef struct _Block2Data Block2Data;

#define FONT_MANAGER_TYPE_BASE_CONTEXT_MENU (font_manager_base_context_menu_get_type ())
#define FONT_MANAGER_BASE_CONTEXT_MENU(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_BASE_CONTEXT_MENU, FontManagerBaseContextMenu))
#define FONT_MANAGER_BASE_CONTEXT_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_BASE_CONTEXT_MENU, FontManagerBaseContextMenuClass))
#define FONT_MANAGER_IS_BASE_CONTEXT_MENU(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_BASE_CONTEXT_MENU))
#define FONT_MANAGER_IS_BASE_CONTEXT_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_BASE_CONTEXT_MENU))
#define FONT_MANAGER_BASE_CONTEXT_MENU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_BASE_CONTEXT_MENU, FontManagerBaseContextMenuClass))

typedef struct _FontManagerBaseContextMenu FontManagerBaseContextMenu;
typedef struct _FontManagerBaseContextMenuClass FontManagerBaseContextMenuClass;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define FONT_MANAGER_TYPE_APPLICATION (font_manager_application_get_type ())
#define FONT_MANAGER_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_APPLICATION, FontManagerApplication))
#define FONT_MANAGER_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_APPLICATION, FontManagerApplicationClass))
#define FONT_MANAGER_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_APPLICATION))
#define FONT_MANAGER_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_APPLICATION))
#define FONT_MANAGER_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_APPLICATION, FontManagerApplicationClass))

typedef struct _FontManagerApplication FontManagerApplication;
typedef struct _FontManagerApplicationClass FontManagerApplicationClass;

#define FONT_MANAGER_TYPE_ARCHIVE_MANAGER (font_manager_archive_manager_get_type ())
#define FONT_MANAGER_ARCHIVE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_ARCHIVE_MANAGER, FontManagerArchiveManager))
#define FONT_MANAGER_ARCHIVE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_ARCHIVE_MANAGER, FontManagerArchiveManagerClass))
#define FONT_MANAGER_IS_ARCHIVE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_ARCHIVE_MANAGER))
#define FONT_MANAGER_IS_ARCHIVE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_ARCHIVE_MANAGER))
#define FONT_MANAGER_ARCHIVE_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_ARCHIVE_MANAGER, FontManagerArchiveManagerClass))

typedef struct _FontManagerArchiveManager FontManagerArchiveManager;
typedef struct _FontManagerArchiveManagerClass FontManagerArchiveManagerClass;
#define _gdk_content_formats_unref0(var) ((var == NULL) ? NULL : (var = (gdk_content_formats_unref (var), NULL)))
#define __vala_GValue_free0(var) ((var == NULL) ? NULL : (var = (_vala_GValue_free (var), NULL)))
enum  {
	FONT_MANAGER_COLLECTION_LIST_VIEW_CHANGED_SIGNAL,
	FONT_MANAGER_COLLECTION_LIST_VIEW_NUM_SIGNALS
};
static guint font_manager_collection_list_view_signals[FONT_MANAGER_COLLECTION_LIST_VIEW_NUM_SIGNALS] = {0};
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _FontManagerFontListFilterModel {
	GObject parent_instance;
	FontManagerFontListFilterModelPrivate * priv;
};

struct _FontManagerFontListFilterModelClass {
	GObjectClass parent_class;
	void (*add_item) (FontManagerFontListFilterModel* self, FontManagerFontListFilter* item);
	void (*remove_item) (FontManagerFontListFilterModel* self, FontManagerFontListFilter* item);
};

struct _FontManagerCollectionListModel {
	FontManagerFontListFilterModel parent_instance;
	FontManagerCollectionListModelPrivate * priv;
};

struct _FontManagerCollectionListModelClass {
	FontManagerFontListFilterModelClass parent_class;
};

struct _FontManagerCollectionListModelPrivate {
	FontManagerSortType _sort_type;
	FontManagerReject* _disabled_families;
	FontManagerStringSet* _available_families;
};

struct _Block1Data {
	int _ref_count_;
	GPtrArray* self;
	GCompareDataFunc compare_func;
	gpointer compare_func_target;
};

struct _FontManagerListItemRow {
	GtkBox parent_instance;
	FontManagerListItemRowPrivate * priv;
};

struct _FontManagerListItemRowClass {
	GtkBoxClass parent_class;
	void (*on_item_set) (FontManagerListItemRow* self);
	void (*reset) (FontManagerListItemRow* self);
};

struct _FontManagerTreeListItemRow {
	FontManagerListItemRow parent_instance;
	FontManagerTreeListItemRowPrivate * priv;
};

struct _FontManagerTreeListItemRowClass {
	FontManagerListItemRowClass parent_class;
	void (*show_context_menu) (FontManagerTreeListItemRow* self, GdkEvent* event, gdouble x, gdouble y);
};

struct _FontManagerCollectionListRow {
	FontManagerTreeListItemRow parent_instance;
	FontManagerCollectionListRowPrivate * priv;
};

struct _FontManagerCollectionListRowClass {
	FontManagerTreeListItemRowClass parent_class;
};

struct _FontManagerCollectionListRowPrivate {
	GPtrArray* bindings;
	gulong signal_id;
	guint state_change_timeout;
};

struct _FontManagerCollectionRenamePopover {
	GtkPopover parent_instance;
	FontManagerCollectionRenamePopoverPrivate * priv;
};

struct _FontManagerCollectionRenamePopoverClass {
	GtkPopoverClass parent_class;
};

struct _FontManagerCollectionRenamePopoverPrivate {
	GtkEntry* _name_entry;
	GtkButton* _rename_button;
};

struct _FontManagerFilterListView {
	GtkBox parent_instance;
	FontManagerFilterListViewPrivate * priv;
	GtkListView* listview;
};

struct _FontManagerFilterListViewClass {
	GtkBoxClass parent_class;
	void (*on_show_context_menu) (FontManagerFilterListView* self, gint n_press, gdouble x, gdouble y);
	void (*setup_list_row) (FontManagerFilterListView* self, GtkSignalListItemFactory* factory, GObject* item);
	void (*bind_list_row) (FontManagerFilterListView* self, GtkSignalListItemFactory* factory, GObject* item);
	void (*collapse_all) (FontManagerFilterListView* self);
	void (*on_row_selected) (FontManagerFilterListView* self, GtkTreeListRow* row);
	void (*on_selection_changed) (FontManagerFilterListView* self, guint position, guint n_items);
};

struct _FontManagerCollectionListView {
	FontManagerFilterListView parent_instance;
	FontManagerCollectionListViewPrivate * priv;
};

struct _FontManagerCollectionListViewClass {
	FontManagerFilterListViewClass parent_class;
};

struct _FontManagerCollectionListViewPrivate {
	FontManagerReject* _disabled_families;
	guint update_timeout;
	GtkLabel* menu_title;
	GtkPopoverMenu* context_menu;
	GdkRectangle clicked_area;
	FontManagerCollectionRenamePopover* rename_popover;
};

struct _FontManagerMenuEntry {
	gchar* action_name;
	gchar* display_name;
};

struct _Block2Data {
	int _ref_count_;
	FontManagerCollectionListView* self;
	guint position;
};

static gint FontManagerCollectionListModel_private_offset;
static gpointer font_manager_collection_list_model_parent_class = NULL;
static gint FontManagerCollectionListRow_private_offset;
static gpointer font_manager_collection_list_row_parent_class = NULL;
static gint FontManagerCollectionRenamePopover_private_offset;
static gpointer font_manager_collection_rename_popover_parent_class = NULL;
static gint FontManagerCollectionListView_private_offset;
static gpointer font_manager_collection_list_view_parent_class = NULL;

VALA_EXTERN GType font_manager_font_list_filter_model_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerFontListFilterModel, g_object_unref)
VALA_EXTERN GType font_manager_cacheable_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerCacheable, g_object_unref)
VALA_EXTERN GType font_manager_font_list_filter_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerFontListFilter, g_object_unref)
VALA_EXTERN GType font_manager_collection_list_model_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerCollectionListModel, g_object_unref)
VALA_EXTERN GType font_manager_sort_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void font_manager_font_list_filter_model_add_item (FontManagerFontListFilterModel* self,
                                                   FontManagerFontListFilter* item);
static void font_manager_collection_list_model_on_sort_type_changed (FontManagerCollectionListModel* self);
VALA_EXTERN GPtrArray* font_manager_font_list_filter_model_get_items (FontManagerFontListFilterModel* self);
VALA_EXTERN void font_manager_font_list_filter_model_clear (FontManagerFontListFilterModel* self);
VALA_EXTERN FontManagerSortType font_manager_collection_list_model_get_sort_type (FontManagerCollectionListModel* self);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static gint ___lambda1__gcompare_data_func (gconstpointer a,
                                     gconstpointer b,
                                     gpointer self);
static gint ___lambda43_ (FontManagerCollectionListModel* self,
                   FontManagerFontListFilter* a,
                   FontManagerFontListFilter* b);
VALA_EXTERN gchar* font_manager_font_list_filter_get_name (FontManagerFontListFilter* self);
static gint ____lambda43__gcompare_data_func (gconstpointer a,
                                       gconstpointer b,
                                       gpointer self);
static gint ____lambda44_ (FontManagerCollectionListModel* self,
                    FontManagerFontListFilter* a,
                    FontManagerFontListFilter* b);
VALA_EXTERN gint font_manager_font_list_filter_get_size (FontManagerFontListFilter* self);
static gint _____lambda44__gcompare_data_func (gconstpointer a,
                                        gconstpointer b,
                                        gpointer self);
static gint ____lambda45_ (FontManagerCollectionListModel* self,
                    FontManagerFontListFilter* a,
                    FontManagerFontListFilter* b);
VALA_EXTERN gint font_manager_filter_sort (FontManagerFontListFilter* a,
                               FontManagerFontListFilter* b);
static gint _____lambda45__gcompare_data_func (gconstpointer a,
                                        gconstpointer b,
                                        gpointer self);
VALA_EXTERN void font_manager_font_list_filter_model_set_items (FontManagerFontListFilterModel* self,
                                                    GPtrArray* value);
VALA_EXTERN gchar* font_manager_collection_list_model_get_cache_file (void);
VALA_EXTERN GListModel* font_manager_collection_list_model_get_child_model (GObject* item);
VALA_EXTERN GType font_manager_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerCollection, g_object_unref)
VALA_EXTERN FontManagerCollectionListModel* font_manager_collection_list_model_new (void);
VALA_EXTERN FontManagerCollectionListModel* font_manager_collection_list_model_construct (GType object_type);
VALA_EXTERN FontManagerStringSet* font_manager_collection_list_model_get_full_contents (FontManagerCollectionListModel* self);
VALA_EXTERN FontManagerStringSet* font_manager_collection_get_full_contents (FontManagerCollection* self);
static void font_manager_collection_list_model_real_add_item (FontManagerFontListFilterModel* base,
                                                       FontManagerFontListFilter* item);
static void __lambda55_ (FontManagerCollectionListModel* self);
VALA_EXTERN gboolean font_manager_collection_list_model_save (FontManagerCollectionListModel* self);
static void ___lambda55__font_manager_cacheable_changed (FontManagerCacheable* _sender,
                                                  gpointer self);
VALA_EXTERN void font_manager_collection_list_model_move_item (FontManagerCollectionListModel* self,
                                                   FontManagerFontListFilter* item);
static void font_manager_collection_list_model_add_from_json_node (FontManagerCollectionListModel* self,
                                                            JsonNode* node);
VALA_EXTERN void font_manager_collection_list_model_load (FontManagerCollectionListModel* self);
static void _vala_JsonNode_free (JsonNode* self);
static void ___lambda56_ (FontManagerCollectionListModel* self,
                   JsonArray* a,
                   guint i,
                   JsonNode* n);
static void ____lambda56__json_array_foreach (JsonArray* array,
                                       guint index_,
                                       JsonNode* element_node,
                                       gpointer self);
static void ____lambda57_ (FontManagerCollectionListModel* self,
                    JsonObject* o,
                    const gchar* s,
                    JsonNode* n);
static void _____lambda57__json_object_foreach (JsonObject* object,
                                         const gchar* member_name,
                                         JsonNode* member_node,
                                         gpointer self);
VALA_EXTERN FontManagerFontListFilterModel* font_manager_font_list_filter_model_new (void);
VALA_EXTERN FontManagerFontListFilterModel* font_manager_font_list_filter_model_construct (GType object_type);
VALA_EXTERN void font_manager_collection_list_model_set_sort_type (FontManagerCollectionListModel* self,
                                                       FontManagerSortType value);
VALA_EXTERN FontManagerReject* font_manager_collection_list_model_get_disabled_families (FontManagerCollectionListModel* self);
VALA_EXTERN void font_manager_collection_list_model_set_disabled_families (FontManagerCollectionListModel* self,
                                                               FontManagerReject* value);
VALA_EXTERN FontManagerStringSet* font_manager_collection_list_model_get_available_families (FontManagerCollectionListModel* self);
VALA_EXTERN void font_manager_collection_list_model_set_available_families (FontManagerCollectionListModel* self,
                                                                FontManagerStringSet* value);
static GObject * font_manager_collection_list_model_constructor (GType type,
                                                          guint n_construct_properties,
                                                          GObjectConstructParam * construct_properties);
VALA_EXTERN gboolean font_manager_load_user_font_resources (void);
static void _font_manager_collection_list_model_on_sort_type_changed_g_object_notify (GObject* _sender,
                                                                               GParamSpec* pspec,
                                                                               gpointer self);
static void font_manager_collection_list_model_finalize (GObject * obj);
static GType font_manager_collection_list_model_get_type_once (void);
static void _vala_font_manager_collection_list_model_get_property (GObject * object,
                                                            guint property_id,
                                                            GValue * value,
                                                            GParamSpec * pspec);
static void _vala_font_manager_collection_list_model_set_property (GObject * object,
                                                            guint property_id,
                                                            const GValue * value,
                                                            GParamSpec * pspec);
VALA_EXTERN GType font_manager_list_item_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerListItemRow, g_object_unref)
VALA_EXTERN GType font_manager_tree_list_item_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerTreeListItemRow, g_object_unref)
VALA_EXTERN GType font_manager_collection_list_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerCollectionListRow, g_object_unref)
VALA_EXTERN void font_manager_list_item_row_reset (FontManagerListItemRow* self);
VALA_EXTERN void font_manager_list_item_row_on_item_set (FontManagerListItemRow* self);
static void _g_object_unref0_ (gpointer var);
static void font_manager_collection_list_row_real_reset (FontManagerListItemRow* base);
static void __lambda59_ (FontManagerCollectionListRow* self,
                  GBinding* binding);
static void ___lambda59__gfunc (gconstpointer data,
                         gpointer self);
VALA_EXTERN GtkCheckButton* font_manager_list_item_row_get_item_state (FontManagerListItemRow* self);
static gboolean font_manager_collection_list_row_update_item_state (FontManagerCollectionListRow* self);
VALA_EXTERN GObject* font_manager_list_item_row_get_item (FontManagerListItemRow* self);
VALA_EXTERN GtkEditableLabel* font_manager_list_item_row_get_edit_label (FontManagerListItemRow* self);
VALA_EXTERN void font_manager_font_list_filter_set_name (FontManagerFontListFilter* self,
                                             const gchar* value);
static void font_manager_collection_list_row_queue_item_state_update (FontManagerCollectionListRow* self);
static gboolean _font_manager_collection_list_row_update_item_state_gsource_func (gpointer self);
static void font_manager_collection_list_row_real_on_item_set (FontManagerListItemRow* base);
VALA_EXTERN GtkImage* font_manager_list_item_row_get_item_icon (FontManagerListItemRow* self);
VALA_EXTERN gchar* font_manager_font_list_filter_get_icon (FontManagerFontListFilter* self);
VALA_EXTERN GtkLabel* font_manager_list_item_row_get_item_count (FontManagerListItemRow* self);
VALA_EXTERN void font_manager_collection_on_state_toggled (GtkCheckButton* check,
                                               FontManagerCollection* self);
static void _font_manager_collection_on_state_toggled_gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                         gpointer self);
VALA_EXTERN FontManagerCollectionListRow* font_manager_collection_list_row_new (void);
VALA_EXTERN FontManagerCollectionListRow* font_manager_collection_list_row_construct (GType object_type);
VALA_EXTERN FontManagerTreeListItemRow* font_manager_tree_list_item_row_new (void);
VALA_EXTERN FontManagerTreeListItemRow* font_manager_tree_list_item_row_construct (GType object_type);
static GObject * font_manager_collection_list_row_constructor (GType type,
                                                        guint n_construct_properties,
                                                        GObjectConstructParam * construct_properties);
VALA_EXTERN GtkLabel* font_manager_list_item_row_get_item_label (FontManagerListItemRow* self);
VALA_EXTERN GtkImage* font_manager_list_item_row_get_drag_handle (FontManagerListItemRow* self);
static void _font_manager_collection_list_row___lambda60_ (FontManagerCollectionListRow* self);
static void __font_manager_collection_list_row___lambda60__gtk_editable_changed (GtkEditable* _sender,
                                                                          gpointer self);
static void font_manager_collection_list_row_finalize (GObject * obj);
static GType font_manager_collection_list_row_get_type_once (void);
VALA_EXTERN GType font_manager_collection_rename_popover_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerCollectionRenamePopover, g_object_unref)
static void font_manager_collection_rename_popover_real_constructed (GObject* base);
VALA_EXTERN GtkEntry* font_manager_collection_rename_popover_get_name_entry (FontManagerCollectionRenamePopover* self);
VALA_EXTERN GtkButton* font_manager_collection_rename_popover_get_rename_button (FontManagerCollectionRenamePopover* self);
static void __lambda42_ (FontManagerCollectionRenamePopover* self);
static void ___lambda42__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
VALA_EXTERN FontManagerCollectionRenamePopover* font_manager_collection_rename_popover_new (void);
VALA_EXTERN FontManagerCollectionRenamePopover* font_manager_collection_rename_popover_construct (GType object_type);
static void font_manager_collection_rename_popover_finalize (GObject * obj);
static GType font_manager_collection_rename_popover_get_type_once (void);
static void _vala_font_manager_collection_rename_popover_get_property (GObject * object,
                                                                guint property_id,
                                                                GValue * value,
                                                                GParamSpec * pspec);
VALA_EXTERN GType font_manager_filter_list_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerFilterListView, g_object_unref)
VALA_EXTERN GType font_manager_collection_list_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerCollectionListView, g_object_unref)
VALA_EXTERN void font_manager_filter_list_view_setup_list_row (FontManagerFilterListView* self,
                                                   GtkSignalListItemFactory* factory,
                                                   GObject* item);
VALA_EXTERN void font_manager_filter_list_view_bind_list_row (FontManagerFilterListView* self,
                                                  GtkSignalListItemFactory* factory,
                                                  GObject* item);
VALA_EXTERN void font_manager_filter_list_view_on_show_context_menu (FontManagerFilterListView* self,
                                                         gint n_press,
                                                         gdouble x,
                                                         gdouble y);
VALA_EXTERN GType font_manager_menu_entry_get_type (void) G_GNUC_CONST ;
VALA_EXTERN FontManagerMenuEntry* font_manager_menu_entry_dup (const FontManagerMenuEntry* self);
VALA_EXTERN void font_manager_menu_entry_free (FontManagerMenuEntry* self);
VALA_EXTERN void font_manager_menu_entry_copy (const FontManagerMenuEntry* self,
                                   FontManagerMenuEntry* dest);
VALA_EXTERN void font_manager_menu_entry_destroy (FontManagerMenuEntry* self);
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (FontManagerMenuEntry, font_manager_menu_entry_destroy)
static gboolean font_manager_collection_list_view_update (FontManagerCollectionListView* self);
VALA_EXTERN GtkSingleSelection* font_manager_filter_list_view_get_selection (FontManagerFilterListView* self);
VALA_EXTERN void font_manager_collection_list_view_queue_update (FontManagerCollectionListView* self);
static gboolean _font_manager_collection_list_view_update_gsource_func (gpointer self);
VALA_EXTERN void font_manager_collection_list_view_save (FontManagerCollectionListView* self);
VALA_EXTERN FontManagerFontListFilterModel* font_manager_filter_list_view_get_model (FontManagerFilterListView* self);
static void font_manager_collection_list_view_on_click (FontManagerCollectionListView* self,
                                                 gint n_press,
                                                 gdouble x,
                                                 gdouble y);
static void font_manager_collection_list_view_real_setup_list_row (FontManagerFilterListView* base,
                                                            GtkSignalListItemFactory* factory,
                                                            GObject* item);
VALA_EXTERN void font_manager_tree_list_item_row_set_expander (FontManagerTreeListItemRow* self,
                                                   GtkTreeExpander* value);
VALA_EXTERN void font_manager_tree_list_item_row_set_selection (FontManagerTreeListItemRow* self,
                                                    GtkSelectionModel* value);
static void font_manager_collection_list_view_add_drag_source (FontManagerCollectionListView* self,
                                                        FontManagerCollectionListRow* row);
static void font_manager_collection_list_view_add_drop_target (FontManagerCollectionListView* self,
                                                        GtkWidget* widget);
static void __lambda61_ (FontManagerCollectionListView* self);
static gboolean __lambda62_ (FontManagerCollectionListView* self);
static gboolean ___lambda62__gsource_func (gpointer self);
static void ___lambda61__font_manager_list_item_row_item_state_changed (FontManagerListItemRow* _sender,
                                                                 GObject* item,
                                                                 gpointer self);
static void font_manager_collection_list_view_real_bind_list_row (FontManagerFilterListView* base,
                                                           GtkSignalListItemFactory* factory,
                                                           GObject* item);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
VALA_EXTERN GtkTreeListModel* font_manager_filter_list_view_get_treemodel (FontManagerFilterListView* self);
VALA_EXTERN void font_manager_font_list_filter_set_depth (FontManagerFontListFilter* self,
                                              gint value);
VALA_EXTERN void font_manager_list_item_row_set_item (FontManagerListItemRow* self,
                                          GObject* value);
static void __lambda63_ (Block2Data* _data2_);
static gboolean __lambda64_ (Block2Data* _data2_);
static gboolean ___lambda64__gsource_func (gpointer self);
static void ___lambda63__g_object_notify (GObject* _sender,
                                   GParamSpec* pspec,
                                   gpointer self);
static void font_manager_collection_list_view_init_context_menu (FontManagerCollectionListView* self);
VALA_EXTERN GType font_manager_base_context_menu_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerBaseContextMenu, g_object_unref)
VALA_EXTERN FontManagerBaseContextMenu* font_manager_base_context_menu_new (GtkWidget* parent);
VALA_EXTERN FontManagerBaseContextMenu* font_manager_base_context_menu_construct (GType object_type,
                                                                      GtkWidget* parent);
VALA_EXTERN GtkPopoverMenu* font_manager_base_context_menu_get_popover (FontManagerBaseContextMenu* self);
VALA_EXTERN GtkLabel* font_manager_base_context_menu_get_menu_title (FontManagerBaseContextMenu* self);
VALA_EXTERN GMenu* font_manager_base_context_menu_get_menu (FontManagerBaseContextMenu* self);
static void font_manager_collection_list_view_update_context_menu (FontManagerCollectionListView* self);
VALA_EXTERN FontManagerFontListFilter* font_manager_filter_list_view_get_selected_item (FontManagerFilterListView* self);
static void font_manager_collection_list_view_real_on_show_context_menu (FontManagerFilterListView* base,
                                                                  gint n_press,
                                                                  gdouble x,
                                                                  gdouble y);
static void font_manager_collection_list_view_on_folder_selection_ready (FontManagerCollectionListView* self,
                                                                  GObject* obj,
                                                                  GAsyncResult* res);
VALA_EXTERN void font_manager_copy_files (FontManagerStringSet* filelist,
                              GFile* destination,
                              gboolean show_progress,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_);
VALA_EXTERN void font_manager_copy_files_finish (GAsyncResult* _res_);
VALA_EXTERN FontManagerStringSet* font_manager_collection_get_filelist (FontManagerCollection* self);
static void ___lambda65_ (FontManagerCollectionListView* self,
                   GObject* obj,
                   GAsyncResult* res);
static void ____lambda65__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
static void font_manager_collection_list_view_on_compress_complete (FontManagerCollectionListView* self,
                                                             GObject* source,
                                                             GTask* task);
VALA_EXTERN GType font_manager_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerApplication, g_object_unref)
VALA_EXTERN guint font_manager_application_register_object (void* object,
                                                GDBusConnection* connection,
                                                const gchar* path,
                                                GError** error);
VALA_EXTERN FontManagerApplication* font_manager_get_default_application (void);
static void font_manager_collection_list_view_compress_selected_collection (GTask* task,
                                                                     GObject* source,
                                                                     void* data,
                                                                     GCancellable* cancellable);
VALA_EXTERN GType font_manager_archive_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerArchiveManager, g_object_unref)
VALA_EXTERN FontManagerArchiveManager* font_manager_archive_manager_new (void);
VALA_EXTERN FontManagerArchiveManager* font_manager_archive_manager_construct (GType object_type);
VALA_EXTERN gint64 font_manager_get_filelist_file_size (FontManagerStringSet* filelist);
VALA_EXTERN gboolean font_manager_archive_manager_compress (FontManagerArchiveManager* self,
                                                FontManagerStringSet* filelist,
                                                GFile* output_file);
static void font_manager_collection_list_view_compress (FontManagerCollectionListView* self,
                                                 GtkWidget* widget,
                                                 const gchar* action,
                                                 GVariant* parameter);
static void _font_manager_collection_list_view_on_compress_complete_gasync_ready_callback (GObject* source_object,
                                                                                    GTask* task,
                                                                                    gpointer self);
static void _font_manager_collection_list_view_compress_selected_collection_gtask_thread_func (GTask* task,
                                                                                        GObject* source_object,
                                                                                        void* task_data,
                                                                                        GCancellable* cancellable);
static void font_manager_collection_list_view_copy_to (FontManagerCollectionListView* self,
                                                GtkWidget* widget,
                                                const gchar* action,
                                                GVariant* parameter);
VALA_EXTERN GtkFileDialog* font_manager_file_selector_get_target_directory (void);
VALA_EXTERN GtkWindow* font_manager_get_parent_window (GtkWidget* widget);
static void _font_manager_collection_list_view_on_folder_selection_ready_gasync_ready_callback (GObject* source_object,
                                                                                         GAsyncResult* res,
                                                                                         gpointer self);
VALA_EXTERN void font_manager_collection_list_view_add_new_collection (FontManagerCollectionListView* self);
VALA_EXTERN void font_manager_filter_list_view_collapse_all (FontManagerFilterListView* self);
VALA_EXTERN FontManagerCollection* font_manager_collection_new (const gchar* name,
                                                    const gchar* comment);
VALA_EXTERN FontManagerCollection* font_manager_collection_construct (GType object_type,
                                                          const gchar* name,
                                                          const gchar* comment);
static void font_manager_collection_list_view_rename_selected_collection (FontManagerCollectionListView* self,
                                                                   GtkWidget* widget,
                                                                   const gchar* action,
                                                                   GVariant* parameter);
VALA_EXTERN void font_manager_collection_list_view_remove_selected_collection (FontManagerCollectionListView* self);
VALA_EXTERN guint font_manager_filter_list_view_get_selected_position (FontManagerFilterListView* self);
VALA_EXTERN void font_manager_font_list_filter_model_remove_item (FontManagerFontListFilterModel* self,
                                                      FontManagerFontListFilter* item);
static void ___lambda66_ (FontManagerCollectionListView* self,
                   const gchar* new_name);
static gboolean __lambda67_ (FontManagerCollectionListView* self);
static gboolean ___lambda67__gsource_func (gpointer self);
static void ____lambda66__font_manager_collection_rename_popover_renamed (FontManagerCollectionRenamePopover* _sender,
                                                                   const gchar* new_name,
                                                                   gpointer self);
static gboolean font_manager_collection_list_view_on_accept_drop (FontManagerCollectionListView* self,
                                                           GtkDropTarget* target,
                                                           GdkDrop* drop);
static gboolean _font_manager_collection_list_view_on_accept_drop_gtk_drop_target_accept (GtkDropTarget* _sender,
                                                                                   GdkDrop* drop,
                                                                                   gpointer self);
static gboolean font_manager_collection_list_view_on_drop (FontManagerCollectionListView* self,
                                                    GtkDropTarget* target,
                                                    GValue* val,
                                                    gdouble x,
                                                    gdouble y);
static gboolean _font_manager_collection_list_view_on_drop_gtk_drop_target_drop (GtkDropTarget* _sender,
                                                                          GValue* value,
                                                                          gdouble x,
                                                                          gdouble y,
                                                                          gpointer self);
static GdkContentProvider* font_manager_collection_list_view_on_prepare_drag (FontManagerCollectionListView* self,
                                                                       GtkDragSource* source,
                                                                       gdouble x,
                                                                       gdouble y);
static GdkContentProvider* _font_manager_collection_list_view_on_prepare_drag_gtk_drag_source_prepare (GtkDragSource* _sender,
                                                                                                gdouble x,
                                                                                                gdouble y,
                                                                                                gpointer self);
static void font_manager_collection_list_view_on_drag_begin (FontManagerCollectionListView* self,
                                                      GtkDragSource* source,
                                                      GdkDrag* drag);
static void _font_manager_collection_list_view_on_drag_begin_gtk_drag_source_drag_begin (GtkDragSource* _sender,
                                                                                  GdkDrag* drag,
                                                                                  gpointer self);
static void font_manager_collection_list_view_on_drag_end (FontManagerCollectionListView* self,
                                                    GtkDragSource* source,
                                                    GdkDrag* drag,
                                                    gboolean delete_data);
static void _font_manager_collection_list_view_on_drag_end_gtk_drag_source_drag_end (GtkDragSource* _sender,
                                                                              GdkDrag* drag,
                                                                              gboolean delete_data,
                                                                              gpointer self);
static GtkTreeListRow* font_manager_collection_list_view_get_list_row_for_widget (FontManagerCollectionListView* self,
                                                                           GtkWidget* widget);
static GValue* _g_value_dup (GValue* self);
static void _vala_GValue_free (GValue* self);
VALA_EXTERN gboolean font_manager_collection_contains (FontManagerCollection* self,
                                           FontManagerCollection* collection);
VALA_EXTERN gint font_manager_font_list_filter_get_depth (FontManagerFontListFilter* self);
static gboolean font_manager_collection_list_view_on_external_drop (FontManagerCollectionListView* self,
                                                             GtkDropTarget* target,
                                                             GValue* val,
                                                             gdouble x,
                                                             gdouble y);
VALA_EXTERN void font_manager_collection_add (FontManagerCollection* self,
                                  FontManagerStringSet* new_families);
VALA_EXTERN void font_manager_collection_queue_state_update (FontManagerCollection* self);
VALA_EXTERN FontManagerCollectionListView* font_manager_collection_list_view_new (void);
VALA_EXTERN FontManagerCollectionListView* font_manager_collection_list_view_construct (GType object_type);
VALA_EXTERN FontManagerFilterListView* font_manager_filter_list_view_new (void);
VALA_EXTERN FontManagerFilterListView* font_manager_filter_list_view_construct (GType object_type);
VALA_EXTERN FontManagerReject* font_manager_collection_list_view_get_disabled_families (FontManagerCollectionListView* self);
VALA_EXTERN void font_manager_collection_list_view_set_disabled_families (FontManagerCollectionListView* self,
                                                              FontManagerReject* value);
static GObject * font_manager_collection_list_view_constructor (GType type,
                                                         guint n_construct_properties,
                                                         GObjectConstructParam * construct_properties);
static GListModel* _font_manager_collection_list_model_get_child_model_gtk_tree_list_model_create_model_func (GObject* item,
                                                                                                       gpointer self);
VALA_EXTERN void font_manager_filter_list_view_set_treemodel (FontManagerFilterListView* self,
                                                  GtkTreeListModel* value);
VALA_EXTERN void font_manager_filter_list_view_set_selection (FontManagerFilterListView* self,
                                                  GtkSingleSelection* value);
static void _font_manager_collection_list_view_update_context_menu_font_manager_filter_list_view_selection_changed (FontManagerFilterListView* _sender,
                                                                                                             FontManagerFontListFilter* item,
                                                                                                             gpointer self);
static void _font_manager_collection_list_view___lambda68_ (FontManagerCollectionListView* self);
static void __font_manager_collection_list_view___lambda68__font_manager_collection_list_model_changed (FontManagerCollectionListModel* _sender,
                                                                                                 gpointer self);
static void _font_manager_collection_list_view_on_click_gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                                            gint n_press,
                                                                            gdouble x,
                                                                            gdouble y,
                                                                            gpointer self);
static void _font_manager_collection_list_view___lambda69_ (FontManagerCollectionListView* self);
static void ___lambda70_ (FontManagerCollectionListView* self);
static void ____lambda70__font_manager_string_set_changed (FontManagerStringSet* _sender,
                                                    gpointer self);
static void __font_manager_collection_list_view___lambda69__g_object_notify (GObject* _sender,
                                                                      GParamSpec* pspec,
                                                                      gpointer self);
static void font_manager_collection_list_view_finalize (GObject * obj);
static GType font_manager_collection_list_view_get_type_once (void);
static void _vala_font_manager_collection_list_view_get_property (GObject * object,
                                                           guint property_id,
                                                           GValue * value,
                                                           GParamSpec * pspec);
static void _vala_font_manager_collection_list_view_set_property (GObject * object,
                                                           guint property_id,
                                                           const GValue * value,
                                                           GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static const FontManagerMenuEntry FONT_MANAGER_COLLECTION_LIST_VIEW_collection_menu_entries[3] = {{"copy_to", N_ ("Copy to…")}, {"compress", N_ ("Compress…")}, {"rename", N_ ("Rename…")}};

static inline gpointer
font_manager_collection_list_model_get_instance_private (FontManagerCollectionListModel* self)
{
	return G_STRUCT_MEMBER_P (self, FontManagerCollectionListModel_private_offset);
}

static gpointer
_g_ptr_array_ref0 (gpointer self)
{
	return self ? g_ptr_array_ref (self) : NULL;
}

static Block1Data*
block1_data_ref (Block1Data* _data1_)
{
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}

static void
block1_data_unref (void * _userdata_)
{
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		GPtrArray* self;
		self = _data1_->self;
		_g_ptr_array_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}

static gint
__lambda1_ (Block1Data* _data1_,
            gconstpointer** a,
            gconstpointer** b)
{
	GPtrArray* self;
	gint result;
	self = _data1_->self;
	result = _data1_->compare_func ((gconstpointer**) (*a), (gconstpointer**) (*b), _data1_->compare_func_target);
	return result;
}

static gint
___lambda1__gcompare_data_func (gconstpointer a,
                                gconstpointer b,
                                gpointer self)
{
	gint result;
	result = __lambda1_ (self, a, b);
	return result;
}

static void
vala_g_ptr_array_sort_with_data (GPtrArray* self,
                                 GCompareDataFunc compare_func,
                                 gpointer compare_func_target)
{
	Block1Data* _data1_;
	g_return_if_fail (self != NULL);
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	_data1_->self = g_ptr_array_ref (self);
	_data1_->compare_func = compare_func;
	_data1_->compare_func_target = compare_func_target;
	g_ptr_array_sort_with_data (self, ___lambda1__gcompare_data_func, _data1_);
	block1_data_unref (_data1_);
	_data1_ = NULL;
}

static gint
___lambda43_ (FontManagerCollectionListModel* self,
              FontManagerFontListFilter* a,
              FontManagerFontListFilter* b)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gint _tmp6_;
	gint result;
	g_return_val_if_fail (a != NULL, 0);
	g_return_val_if_fail (b != NULL, 0);
	_tmp0_ = font_manager_font_list_filter_get_name (a);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp3_ = font_manager_font_list_filter_get_name (b);
	_tmp4_ = _tmp3_;
	_tmp5_ = _tmp4_;
	_tmp6_ = font_manager_natural_sort (_tmp2_, _tmp5_);
	_g_free0 (_tmp5_);
	_g_free0 (_tmp2_);
	result = _tmp6_;
	return result;
}

static gint
____lambda43__gcompare_data_func (gconstpointer a,
                                  gconstpointer b,
                                  gpointer self)
{
	gint result;
	result = ___lambda43_ ((FontManagerCollectionListModel*) self, (FontManagerFontListFilter*) a, (FontManagerFontListFilter*) b);
	return result;
}

static gint
____lambda44_ (FontManagerCollectionListModel* self,
               FontManagerFontListFilter* a,
               FontManagerFontListFilter* b)
{
	gint a_size = 0;
	gint _tmp0_;
	gint _tmp1_;
	gint b_size = 0;
	gint _tmp2_;
	gint _tmp3_;
	gint _tmp4_ = 0;
	gint result;
	g_return_val_if_fail (a != NULL, 0);
	g_return_val_if_fail (b != NULL, 0);
	_tmp0_ = font_manager_font_list_filter_get_size (a);
	_tmp1_ = _tmp0_;
	a_size = _tmp1_;
	_tmp2_ = font_manager_font_list_filter_get_size (b);
	_tmp3_ = _tmp2_;
	b_size = _tmp3_;
	if (a_size == b_size) {
		_tmp4_ = 0;
	} else {
		gint _tmp5_ = 0;
		if (a_size < b_size) {
			_tmp5_ = 1;
		} else {
			_tmp5_ = -1;
		}
		_tmp4_ = _tmp5_;
	}
	result = _tmp4_;
	return result;
}

static gint
_____lambda44__gcompare_data_func (gconstpointer a,
                                   gconstpointer b,
                                   gpointer self)
{
	gint result;
	result = ____lambda44_ ((FontManagerCollectionListModel*) self, (FontManagerFontListFilter*) a, (FontManagerFontListFilter*) b);
	return result;
}

static gint
____lambda45_ (FontManagerCollectionListModel* self,
               FontManagerFontListFilter* a,
               FontManagerFontListFilter* b)
{
	gint result;
	g_return_val_if_fail (a != NULL, 0);
	g_return_val_if_fail (b != NULL, 0);
	result = font_manager_filter_sort (a, b);
	return result;
}

static gint
_____lambda45__gcompare_data_func (gconstpointer a,
                                   gconstpointer b,
                                   gpointer self)
{
	gint result;
	result = ____lambda45_ ((FontManagerCollectionListModel*) self, (FontManagerFontListFilter*) a, (FontManagerFontListFilter*) b);
	return result;
}

static void
font_manager_collection_list_model_on_sort_type_changed (FontManagerCollectionListModel* self)
{
	GPtrArray* _tmp0_;
	GPtrArray* _tmp1_;
	GPtrArray* tmp = NULL;
	GPtrArray* _tmp2_;
	GPtrArray* _tmp3_;
	GPtrArray* _tmp4_;
	FontManagerSortType _tmp5_;
	GPtrArray* _tmp10_;
	g_return_if_fail (self != NULL);
	_tmp0_ = font_manager_font_list_filter_model_get_items ((FontManagerFontListFilterModel*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == NULL) {
		return;
	}
	_tmp2_ = font_manager_font_list_filter_model_get_items ((FontManagerFontListFilterModel*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = _g_ptr_array_ref0 (_tmp3_);
	tmp = _tmp4_;
	font_manager_font_list_filter_model_clear ((FontManagerFontListFilterModel*) self);
	_tmp5_ = self->priv->_sort_type;
	if (_tmp5_ == FONT_MANAGER_SORT_TYPE_NAME) {
		GPtrArray* _tmp6_;
		_tmp6_ = tmp;
		vala_g_ptr_array_sort_with_data (_tmp6_, ____lambda43__gcompare_data_func, self);
	} else {
		FontManagerSortType _tmp7_;
		_tmp7_ = self->priv->_sort_type;
		if (_tmp7_ == FONT_MANAGER_SORT_TYPE_SIZE) {
			GPtrArray* _tmp8_;
			_tmp8_ = tmp;
			vala_g_ptr_array_sort_with_data (_tmp8_, _____lambda44__gcompare_data_func, self);
		} else {
			GPtrArray* _tmp9_;
			_tmp9_ = tmp;
			vala_g_ptr_array_sort_with_data (_tmp9_, _____lambda45__gcompare_data_func, self);
		}
	}
	_tmp10_ = tmp;
	font_manager_font_list_filter_model_set_items ((FontManagerFontListFilterModel*) self, _tmp10_);
	g_list_model_items_changed ((GListModel*) self, (guint) 0, (guint) 0, g_list_model_get_n_items ((GListModel*) self));
	_g_ptr_array_unref0 (tmp);
	return;
}

gchar*
font_manager_collection_list_model_get_cache_file (void)
{
	gchar* dirpath = NULL;
	gchar* _tmp0_;
	gchar* filepath = NULL;
	gchar* _tmp1_;
	gchar* result;
	_tmp0_ = font_manager_get_package_config_directory ();
	dirpath = _tmp0_;
	_tmp1_ = g_build_filename (dirpath, "Collections.json", NULL);
	filepath = _tmp1_;
	g_mkdir_with_parents (dirpath, 0755);
	result = filepath;
	_g_free0 (dirpath);
	return result;
}

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

GListModel*
font_manager_collection_list_model_get_child_model (GObject* item)
{
	FontManagerCollection* collection = NULL;
	FontManagerCollection* _tmp0_;
	FontManagerCollectionListModel* child = NULL;
	FontManagerCollectionListModel* _tmp1_;
	GBindingFlags flags = 0U;
	GListModel* result;
	g_return_val_if_fail (item != NULL, NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (item, FONT_MANAGER_TYPE_COLLECTION, FontManagerCollection));
	collection = _tmp0_;
	_tmp1_ = font_manager_collection_list_model_new ();
	child = _tmp1_;
	flags = G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE;
	g_object_bind_property_with_closures ((GObject*) collection, "children", (GObject*) child, "items", flags, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	result = (GListModel*) child;
	_g_object_unref0 (collection);
	return result;
}

FontManagerStringSet*
font_manager_collection_list_model_get_full_contents (FontManagerCollectionListModel* self)
{
	FontManagerStringSet* full_contents = NULL;
	FontManagerStringSet* _tmp0_;
	GPtrArray* _tmp1_;
	GPtrArray* _tmp2_;
	gpointer* _tmp3_;
	gint _tmp3__length1;
	FontManagerStringSet* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = font_manager_string_set_new ();
	full_contents = _tmp0_;
	_tmp1_ = font_manager_font_list_filter_model_get_items ((FontManagerFontListFilterModel*) self);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_->pdata;
	_tmp3__length1 = _tmp2_->len;
	{
		FontManagerFontListFilter** entry_collection = NULL;
		gint entry_collection_length1 = 0;
		gint _entry_collection_size_ = 0;
		gint entry_it = 0;
		entry_collection = _tmp3_;
		entry_collection_length1 = _tmp3__length1;
		for (entry_it = 0; entry_it < entry_collection_length1; entry_it = entry_it + 1) {
			FontManagerFontListFilter* _tmp4_;
			FontManagerFontListFilter* entry = NULL;
			_tmp4_ = _g_object_ref0 (entry_collection[entry_it]);
			entry = _tmp4_;
			{
				FontManagerStringSet* _tmp5_;
				FontManagerFontListFilter* _tmp6_;
				FontManagerStringSet* _tmp7_;
				FontManagerStringSet* _tmp8_;
				_tmp5_ = full_contents;
				_tmp6_ = entry;
				_tmp7_ = font_manager_collection_get_full_contents (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, FONT_MANAGER_TYPE_COLLECTION, FontManagerCollection));
				_tmp8_ = _tmp7_;
				font_manager_string_set_add_all (_tmp5_, _tmp8_);
				_g_object_unref0 (_tmp8_);
				_g_object_unref0 (entry);
			}
		}
	}
	result = full_contents;
	return result;
}

static void
__lambda55_ (FontManagerCollectionListModel* self)
{
	font_manager_collection_list_model_save (self);
	g_signal_emit (self, font_manager_collection_list_model_signals[FONT_MANAGER_COLLECTION_LIST_MODEL_CHANGED_SIGNAL], 0);
}

static void
___lambda55__font_manager_cacheable_changed (FontManagerCacheable* _sender,
                                             gpointer self)
{
	__lambda55_ ((FontManagerCollectionListModel*) self);
}

static void
font_manager_collection_list_model_real_add_item (FontManagerFontListFilterModel* base,
                                                  FontManagerFontListFilter* item)
{
	FontManagerCollectionListModel * self;
	GBindingFlags flags = 0U;
	self = (FontManagerCollectionListModel*) base;
	g_return_if_fail (item != NULL);
	FONT_MANAGER_FONT_LIST_FILTER_MODEL_CLASS (font_manager_collection_list_model_parent_class)->add_item (G_TYPE_CHECK_INSTANCE_CAST (self, FONT_MANAGER_TYPE_FONT_LIST_FILTER_MODEL, FontManagerFontListFilterModel), item);
	flags = G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE;
	g_object_bind_property_with_closures ((GObject*) self, "available-families", (GObject*) G_TYPE_CHECK_INSTANCE_CAST (item, FONT_MANAGER_TYPE_COLLECTION, FontManagerCollection), "available-families", flags, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	g_object_bind_property_with_closures ((GObject*) self, "disabled-families", (GObject*) G_TYPE_CHECK_INSTANCE_CAST (item, FONT_MANAGER_TYPE_COLLECTION, FontManagerCollection), "disabled-families", flags, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	g_signal_connect_object ((FontManagerCacheable*) G_TYPE_CHECK_INSTANCE_CAST (item, FONT_MANAGER_TYPE_COLLECTION, FontManagerCollection), "changed", (GCallback) ___lambda55__font_manager_cacheable_changed, self, G_CONNECT_AFTER);
	return;
}

void
font_manager_collection_list_model_move_item (FontManagerCollectionListModel* self,
                                              FontManagerFontListFilter* item)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	FONT_MANAGER_FONT_LIST_FILTER_MODEL_CLASS (font_manager_collection_list_model_parent_class)->add_item (G_TYPE_CHECK_INSTANCE_CAST (self, FONT_MANAGER_TYPE_FONT_LIST_FILTER_MODEL, FontManagerFontListFilterModel), item);
	return;
}

static void
font_manager_collection_list_model_add_from_json_node (FontManagerCollectionListModel* self,
                                                       JsonNode* node)
{
	GObject* collection = NULL;
	GObject* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (node != NULL);
	_tmp0_ = json_gobject_deserialize (FONT_MANAGER_TYPE_COLLECTION, node);
	collection = _tmp0_;
	font_manager_font_list_filter_model_add_item ((FontManagerFontListFilterModel*) self, (FontManagerFontListFilter*) G_TYPE_CHECK_INSTANCE_CAST (collection, FONT_MANAGER_TYPE_COLLECTION, FontManagerCollection));
	_g_object_unref0 (collection);
	return;
}

static void
_vala_JsonNode_free (JsonNode* self)
{
	g_boxed_free (json_node_get_type (), self);
}

static gpointer
_json_array_ref0 (gpointer self)
{
	return self ? json_array_ref (self) : NULL;
}

static void
___lambda56_ (FontManagerCollectionListModel* self,
              JsonArray* a,
              guint i,
              JsonNode* n)
{
	g_return_if_fail (a != NULL);
	g_return_if_fail (n != NULL);
	font_manager_collection_list_model_add_from_json_node (self, n);
}

static void
____lambda56__json_array_foreach (JsonArray* array,
                                  guint index_,
                                  JsonNode* element_node,
                                  gpointer self)
{
	___lambda56_ ((FontManagerCollectionListModel*) self, array, index_, element_node);
}

static gpointer
_json_object_ref0 (gpointer self)
{
	return self ? json_object_ref (self) : NULL;
}

static void
____lambda57_ (FontManagerCollectionListModel* self,
               JsonObject* o,
               const gchar* s,
               JsonNode* n)
{
	g_return_if_fail (o != NULL);
	g_return_if_fail (s != NULL);
	g_return_if_fail (n != NULL);
	font_manager_collection_list_model_add_from_json_node (self, n);
}

static void
_____lambda57__json_object_foreach (JsonObject* object,
                                    const gchar* member_name,
                                    JsonNode* member_node,
                                    gpointer self)
{
	____lambda57_ ((FontManagerCollectionListModel*) self, object, member_name, member_node);
}

void
font_manager_collection_list_model_load (FontManagerCollectionListModel* self)
{
	JsonNode* root = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	JsonNode* _tmp2_;
	JsonNode* _tmp3_;
	JsonNode* _tmp4_;
	JsonNodeType node_type = 0;
	JsonNode* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = font_manager_collection_list_model_get_cache_file ();
	_tmp1_ = _tmp0_;
	_tmp2_ = font_manager_load_json_file (_tmp1_);
	_tmp3_ = _tmp2_;
	_g_free0 (_tmp1_);
	root = _tmp3_;
	_tmp4_ = root;
	if (_tmp4_ == NULL) {
		__vala_JsonNode_free0 (root);
		return;
	}
	_tmp5_ = root;
	node_type = json_node_get_node_type (_tmp5_);
	if (node_type == JSON_NODE_ARRAY) {
		JsonArray* array = NULL;
		JsonNode* _tmp6_;
		JsonArray* _tmp7_;
		JsonArray* _tmp8_;
		JsonArray* _tmp9_;
		_tmp6_ = root;
		_tmp7_ = json_node_get_array (_tmp6_);
		_tmp8_ = _json_array_ref0 (_tmp7_);
		array = _tmp8_;
		_tmp9_ = array;
		json_array_foreach_element (_tmp9_, ____lambda56__json_array_foreach, self);
		_json_array_unref0 (array);
	} else {
		if (node_type == JSON_NODE_OBJECT) {
			JsonObject* obj = NULL;
			JsonNode* _tmp10_;
			JsonObject* _tmp11_;
			JsonObject* _tmp12_;
			JsonObject* _tmp13_;
			JsonObject* entries = NULL;
			JsonObject* _tmp14_;
			JsonObject* _tmp15_;
			JsonObject* _tmp16_;
			JsonObject* _tmp17_;
			_tmp10_ = root;
			_tmp11_ = json_node_get_object (_tmp10_);
			_tmp12_ = _json_object_ref0 (_tmp11_);
			obj = _tmp12_;
			_tmp13_ = obj;
			_vala_assert (json_object_has_member (_tmp13_, "entries"), "obj.has_member(\"entries\")");
			_tmp14_ = obj;
			_tmp15_ = json_object_get_object_member (_tmp14_, "entries");
			_tmp16_ = _json_object_ref0 (_tmp15_);
			entries = _tmp16_;
			_tmp17_ = entries;
			json_object_foreach_member (_tmp17_, _____lambda57__json_object_foreach, self);
			_json_object_unref0 (entries);
			_json_object_unref0 (obj);
		} else {
			g_assert_not_reached ();
		}
	}
	__vala_JsonNode_free0 (root);
	return;
}

gboolean
font_manager_collection_list_model_save (FontManagerCollectionListModel* self)
{
	JsonNode* node = NULL;
	JsonNode* _tmp0_;
	JsonArray* array = NULL;
	JsonArray* _tmp1_;
	GPtrArray* _tmp2_;
	GPtrArray* _tmp3_;
	JsonNode* _tmp8_;
	JsonArray* _tmp9_;
	JsonNode* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gboolean _tmp13_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = json_node_new (JSON_NODE_ARRAY);
	node = _tmp0_;
	_tmp1_ = json_array_new ();
	array = _tmp1_;
	_tmp2_ = font_manager_font_list_filter_model_get_items ((FontManagerFontListFilterModel*) self);
	_tmp3_ = _tmp2_;
	{
		GPtrArray* collection_collection = NULL;
		guint collection_index = 0U;
		collection_collection = _tmp3_;
		for (collection_index = 0; collection_index < collection_collection->len; collection_index = collection_index + 1) {
			FontManagerFontListFilter* _tmp4_;
			FontManagerFontListFilter* collection = NULL;
			_tmp4_ = _g_object_ref0 ((FontManagerFontListFilter*) g_ptr_array_index (collection_collection, collection_index));
			collection = _tmp4_;
			{
				JsonArray* _tmp5_;
				FontManagerFontListFilter* _tmp6_;
				JsonNode* _tmp7_;
				_tmp5_ = array;
				_tmp6_ = collection;
				_tmp7_ = json_gobject_serialize ((GObject*) _tmp6_);
				json_array_add_element (_tmp5_, _tmp7_);
				_g_object_unref0 (collection);
			}
		}
	}
	_tmp8_ = node;
	_tmp9_ = array;
	json_node_set_array (_tmp8_, _tmp9_);
	_tmp10_ = node;
	_tmp11_ = font_manager_collection_list_model_get_cache_file ();
	_tmp12_ = _tmp11_;
	_tmp13_ = font_manager_write_json_file (_tmp10_, _tmp12_, TRUE);
	_g_free0 (_tmp12_);
	result = _tmp13_;
	_json_array_unref0 (array);
	__vala_JsonNode_free0 (node);
	return result;
}

FontManagerCollectionListModel*
font_manager_collection_list_model_construct (GType object_type)
{
	FontManagerCollectionListModel * self = NULL;
	self = (FontManagerCollectionListModel*) font_manager_font_list_filter_model_construct (object_type);
	return self;
}

FontManagerCollectionListModel*
font_manager_collection_list_model_new (void)
{
	return font_manager_collection_list_model_construct (FONT_MANAGER_TYPE_COLLECTION_LIST_MODEL);
}

FontManagerSortType
font_manager_collection_list_model_get_sort_type (FontManagerCollectionListModel* self)
{
	FontManagerSortType result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_sort_type;
	return result;
}

void
font_manager_collection_list_model_set_sort_type (FontManagerCollectionListModel* self,
                                                  FontManagerSortType value)
{
	FontManagerSortType old_value;
	g_return_if_fail (self != NULL);
	old_value = font_manager_collection_list_model_get_sort_type (self);
	if (old_value != value) {
		self->priv->_sort_type = value;
		g_object_notify_by_pspec ((GObject *) self, font_manager_collection_list_model_properties[FONT_MANAGER_COLLECTION_LIST_MODEL_SORT_TYPE_PROPERTY]);
	}
}

FontManagerReject*
font_manager_collection_list_model_get_disabled_families (FontManagerCollectionListModel* self)
{
	FontManagerReject* result;
	FontManagerReject* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_disabled_families;
	result = _tmp0_;
	return result;
}

void
font_manager_collection_list_model_set_disabled_families (FontManagerCollectionListModel* self,
                                                          FontManagerReject* value)
{
	FontManagerReject* old_value;
	g_return_if_fail (self != NULL);
	old_value = font_manager_collection_list_model_get_disabled_families (self);
	if (old_value != value) {
		FontManagerReject* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_disabled_families);
		self->priv->_disabled_families = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, font_manager_collection_list_model_properties[FONT_MANAGER_COLLECTION_LIST_MODEL_DISABLED_FAMILIES_PROPERTY]);
	}
}

FontManagerStringSet*
font_manager_collection_list_model_get_available_families (FontManagerCollectionListModel* self)
{
	FontManagerStringSet* result;
	FontManagerStringSet* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_available_families;
	result = _tmp0_;
	return result;
}

void
font_manager_collection_list_model_set_available_families (FontManagerCollectionListModel* self,
                                                           FontManagerStringSet* value)
{
	FontManagerStringSet* old_value;
	g_return_if_fail (self != NULL);
	old_value = font_manager_collection_list_model_get_available_families (self);
	if (old_value != value) {
		FontManagerStringSet* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_available_families);
		self->priv->_available_families = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, font_manager_collection_list_model_properties[FONT_MANAGER_COLLECTION_LIST_MODEL_AVAILABLE_FAMILIES_PROPERTY]);
	}
}

static void
_font_manager_collection_list_model_on_sort_type_changed_g_object_notify (GObject* _sender,
                                                                          GParamSpec* pspec,
                                                                          gpointer self)
{
	font_manager_collection_list_model_on_sort_type_changed ((FontManagerCollectionListModel*) self);
}

static GObject *
font_manager_collection_list_model_constructor (GType type,
                                                guint n_construct_properties,
                                                GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	FontManagerCollectionListModel * self;
	FontManagerStringSet* _tmp0_;
	FontManagerStringSet* _tmp1_;
	parent_class = G_OBJECT_CLASS (font_manager_collection_list_model_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FONT_MANAGER_TYPE_COLLECTION_LIST_MODEL, FontManagerCollectionListModel);
	font_manager_update_font_configuration ();
	font_manager_load_user_font_resources ();
	_tmp0_ = font_manager_list_available_font_families ();
	_tmp1_ = _tmp0_;
	font_manager_collection_list_model_set_available_families (self, _tmp1_);
	_g_object_unref0 (_tmp1_);
	font_manager_collection_list_model_load (self);
	g_signal_connect_object ((GObject*) self, "notify::sort-type", (GCallback) _font_manager_collection_list_model_on_sort_type_changed_g_object_notify, self, G_CONNECT_AFTER);
	return obj;
}

static void
font_manager_collection_list_model_class_init (FontManagerCollectionListModelClass * klass,
                                               gpointer klass_data)
{
	font_manager_collection_list_model_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FontManagerCollectionListModel_private_offset);
	((FontManagerFontListFilterModelClass *) klass)->add_item = (void (*) (FontManagerFontListFilterModel*, FontManagerFontListFilter*)) font_manager_collection_list_model_real_add_item;
	G_OBJECT_CLASS (klass)->get_property = _vala_font_manager_collection_list_model_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_font_manager_collection_list_model_set_property;
	G_OBJECT_CLASS (klass)->constructor = font_manager_collection_list_model_constructor;
	G_OBJECT_CLASS (klass)->finalize = font_manager_collection_list_model_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_COLLECTION_LIST_MODEL_SORT_TYPE_PROPERTY, font_manager_collection_list_model_properties[FONT_MANAGER_COLLECTION_LIST_MODEL_SORT_TYPE_PROPERTY] = g_param_spec_enum ("sort-type", "sort-type", "sort-type", FONT_MANAGER_TYPE_SORT_TYPE, FONT_MANAGER_SORT_TYPE_NONE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_COLLECTION_LIST_MODEL_DISABLED_FAMILIES_PROPERTY, font_manager_collection_list_model_properties[FONT_MANAGER_COLLECTION_LIST_MODEL_DISABLED_FAMILIES_PROPERTY] = g_param_spec_object ("disabled-families", "disabled-families", "disabled-families", font_manager_reject_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_COLLECTION_LIST_MODEL_AVAILABLE_FAMILIES_PROPERTY, font_manager_collection_list_model_properties[FONT_MANAGER_COLLECTION_LIST_MODEL_AVAILABLE_FAMILIES_PROPERTY] = g_param_spec_object ("available-families", "available-families", "available-families", font_manager_string_set_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	font_manager_collection_list_model_signals[FONT_MANAGER_COLLECTION_LIST_MODEL_CHANGED_SIGNAL] = g_signal_new ("changed", FONT_MANAGER_TYPE_COLLECTION_LIST_MODEL, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
font_manager_collection_list_model_instance_init (FontManagerCollectionListModel * self,
                                                  gpointer klass)
{
	self->priv = font_manager_collection_list_model_get_instance_private (self);
	self->priv->_sort_type = FONT_MANAGER_SORT_TYPE_NONE;
	self->priv->_disabled_families = NULL;
	self->priv->_available_families = NULL;
}

static void
font_manager_collection_list_model_finalize (GObject * obj)
{
	FontManagerCollectionListModel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FONT_MANAGER_TYPE_COLLECTION_LIST_MODEL, FontManagerCollectionListModel);
	_g_object_unref0 (self->priv->_disabled_families);
	_g_object_unref0 (self->priv->_available_families);
	G_OBJECT_CLASS (font_manager_collection_list_model_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
font_manager_collection_list_model_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FontManagerCollectionListModelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) font_manager_collection_list_model_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FontManagerCollectionListModel), 0, (GInstanceInitFunc) font_manager_collection_list_model_instance_init, NULL };
	GType font_manager_collection_list_model_type_id;
	font_manager_collection_list_model_type_id = g_type_register_static (FONT_MANAGER_TYPE_FONT_LIST_FILTER_MODEL, "FontManagerCollectionListModel", &g_define_type_info, 0);
	FontManagerCollectionListModel_private_offset = g_type_add_instance_private (font_manager_collection_list_model_type_id, sizeof (FontManagerCollectionListModelPrivate));
	return font_manager_collection_list_model_type_id;
}

GType
font_manager_collection_list_model_get_type (void)
{
	static volatile gsize font_manager_collection_list_model_type_id__once = 0;
	if (g_once_init_enter (&font_manager_collection_list_model_type_id__once)) {
		GType font_manager_collection_list_model_type_id;
		font_manager_collection_list_model_type_id = font_manager_collection_list_model_get_type_once ();
		g_once_init_leave (&font_manager_collection_list_model_type_id__once, font_manager_collection_list_model_type_id);
	}
	return font_manager_collection_list_model_type_id__once;
}

static void
_vala_font_manager_collection_list_model_get_property (GObject * object,
                                                       guint property_id,
                                                       GValue * value,
                                                       GParamSpec * pspec)
{
	FontManagerCollectionListModel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FONT_MANAGER_TYPE_COLLECTION_LIST_MODEL, FontManagerCollectionListModel);
	switch (property_id) {
		case FONT_MANAGER_COLLECTION_LIST_MODEL_SORT_TYPE_PROPERTY:
		g_value_set_enum (value, font_manager_collection_list_model_get_sort_type (self));
		break;
		case FONT_MANAGER_COLLECTION_LIST_MODEL_DISABLED_FAMILIES_PROPERTY:
		g_value_set_object (value, font_manager_collection_list_model_get_disabled_families (self));
		break;
		case FONT_MANAGER_COLLECTION_LIST_MODEL_AVAILABLE_FAMILIES_PROPERTY:
		g_value_set_object (value, font_manager_collection_list_model_get_available_families (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_font_manager_collection_list_model_set_property (GObject * object,
                                                       guint property_id,
                                                       const GValue * value,
                                                       GParamSpec * pspec)
{
	FontManagerCollectionListModel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FONT_MANAGER_TYPE_COLLECTION_LIST_MODEL, FontManagerCollectionListModel);
	switch (property_id) {
		case FONT_MANAGER_COLLECTION_LIST_MODEL_SORT_TYPE_PROPERTY:
		font_manager_collection_list_model_set_sort_type (self, g_value_get_enum (value));
		break;
		case FONT_MANAGER_COLLECTION_LIST_MODEL_DISABLED_FAMILIES_PROPERTY:
		font_manager_collection_list_model_set_disabled_families (self, g_value_get_object (value));
		break;
		case FONT_MANAGER_COLLECTION_LIST_MODEL_AVAILABLE_FAMILIES_PROPERTY:
		font_manager_collection_list_model_set_available_families (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
font_manager_collection_list_row_get_instance_private (FontManagerCollectionListRow* self)
{
	return G_STRUCT_MEMBER_P (self, FontManagerCollectionListRow_private_offset);
}

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

static void
__lambda59_ (FontManagerCollectionListRow* self,
             GBinding* binding)
{
	GBinding* _tmp0_;
	g_return_if_fail (binding != NULL);
	_tmp0_ = _g_object_ref0 (binding);
	g_binding_unbind (_tmp0_);
}

static void
___lambda59__gfunc (gconstpointer data,
                    gpointer self)
{
	__lambda59_ ((FontManagerCollectionListRow*) self, (GBinding*) data);
}

static void
font_manager_collection_list_row_real_reset (FontManagerListItemRow* base)
{
	FontManagerCollectionListRow * self;
	GPtrArray* _tmp0_;
	GPtrArray* _tmp1_;
	self = (FontManagerCollectionListRow*) base;
	_tmp0_ = self->priv->bindings;
	g_ptr_array_foreach (_tmp0_, ___lambda59__gfunc, self);
	_tmp1_ = g_ptr_array_new_full ((guint) 0, _g_object_unref0_);
	_g_ptr_array_unref0 (self->priv->bindings);
	self->priv->bindings = _tmp1_;
	if (self->priv->signal_id != ((gulong) 0)) {
		GtkCheckButton* _tmp2_;
		GtkCheckButton* _tmp3_;
		_tmp2_ = font_manager_list_item_row_get_item_state ((FontManagerListItemRow*) self);
		_tmp3_ = _tmp2_;
		g_signal_handler_disconnect (_tmp3_, self->priv->signal_id);
	}
	self->priv->signal_id = (gulong) 0;
	return;
}

static gboolean
font_manager_collection_list_row_update_item_state (FontManagerCollectionListRow* self)
{
	GObject* _tmp0_;
	GObject* _tmp1_;
	GtkEditableLabel* _tmp2_;
	GtkEditableLabel* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	GtkEditableLabel* _tmp6_;
	GtkEditableLabel* _tmp7_;
	GtkEditableLabel* _tmp8_;
	GtkEditableLabel* _tmp9_;
	const gchar* _tmp10_;
	const gchar* _tmp11_;
	gint _tmp12_;
	gint _tmp13_;
	GObject* _tmp14_;
	GObject* _tmp15_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = font_manager_list_item_row_get_item ((FontManagerListItemRow*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = font_manager_list_item_row_get_edit_label ((FontManagerListItemRow*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = gtk_editable_get_text ((GtkEditable*) _tmp3_);
	_tmp5_ = _tmp4_;
	font_manager_font_list_filter_set_name ((FontManagerFontListFilter*) G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, FONT_MANAGER_TYPE_COLLECTION, FontManagerCollection), _tmp5_);
	_tmp6_ = font_manager_list_item_row_get_edit_label ((FontManagerListItemRow*) self);
	_tmp7_ = _tmp6_;
	_tmp8_ = font_manager_list_item_row_get_edit_label ((FontManagerListItemRow*) self);
	_tmp9_ = _tmp8_;
	_tmp10_ = gtk_editable_get_text ((GtkEditable*) _tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = strlen (_tmp11_);
	_tmp13_ = _tmp12_;
	gtk_editable_set_position ((GtkEditable*) _tmp7_, _tmp13_);
	_tmp14_ = font_manager_list_item_row_get_item ((FontManagerListItemRow*) self);
	_tmp15_ = _tmp14_;
	g_signal_emit_by_name ((FontManagerListItemRow*) self, "item-state-changed", _tmp15_);
	self->priv->state_change_timeout = (guint) 0;
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
_font_manager_collection_list_row_update_item_state_gsource_func (gpointer self)
{
	gboolean result;
	result = font_manager_collection_list_row_update_item_state ((FontManagerCollectionListRow*) self);
	return result;
}

static void
font_manager_collection_list_row_queue_item_state_update (FontManagerCollectionListRow* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->state_change_timeout != ((guint) 0)) {
		g_source_remove (self->priv->state_change_timeout);
	}
	self->priv->state_change_timeout = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 500, _font_manager_collection_list_row_update_item_state_gsource_func, g_object_ref (self), g_object_unref);
	return;
}

static void
_font_manager_collection_on_state_toggled_gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                    gpointer self)
{
	font_manager_collection_on_state_toggled (_sender, (FontManagerCollection*) self);
}

static void
font_manager_collection_list_row_real_on_item_set (FontManagerListItemRow* base)
{
	FontManagerCollectionListRow * self;
	GObject* _tmp0_;
	GObject* _tmp1_;
	FontManagerCollection* collection = NULL;
	GObject* _tmp2_;
	GObject* _tmp3_;
	FontManagerCollection* _tmp4_;
	GtkImage* _tmp5_;
	GtkImage* _tmp6_;
	FontManagerCollection* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	GtkImage* _tmp11_;
	GtkImage* _tmp12_;
	gboolean _tmp13_;
	gboolean _tmp14_;
	GtkLabel* _tmp21_;
	GtkLabel* _tmp22_;
	FontManagerCollection* _tmp23_;
	gint _tmp24_;
	gint _tmp25_;
	gchar* _tmp26_;
	gchar* _tmp27_;
	GBindingFlags flags = 0U;
	GPtrArray* _tmp28_;
	FontManagerCollection* _tmp29_;
	GtkEditableLabel* _tmp30_;
	GtkEditableLabel* _tmp31_;
	GBinding* _tmp32_;
	GBinding* _tmp33_;
	GPtrArray* _tmp34_;
	FontManagerCollection* _tmp35_;
	GtkCheckButton* _tmp36_;
	GtkCheckButton* _tmp37_;
	GBinding* _tmp38_;
	GBinding* _tmp39_;
	GPtrArray* _tmp40_;
	FontManagerCollection* _tmp41_;
	GtkCheckButton* _tmp42_;
	GtkCheckButton* _tmp43_;
	GBinding* _tmp44_;
	GBinding* _tmp45_;
	GtkCheckButton* _tmp46_;
	GtkCheckButton* _tmp47_;
	FontManagerCollection* _tmp48_;
	gulong _tmp49_;
	self = (FontManagerCollectionListRow*) base;
	font_manager_list_item_row_reset ((FontManagerListItemRow*) self);
	_tmp0_ = font_manager_list_item_row_get_item ((FontManagerListItemRow*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == NULL) {
		return;
	}
	_tmp2_ = font_manager_list_item_row_get_item ((FontManagerListItemRow*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, FONT_MANAGER_TYPE_COLLECTION, FontManagerCollection));
	collection = _tmp4_;
	_tmp5_ = font_manager_list_item_row_get_item_icon ((FontManagerListItemRow*) self);
	_tmp6_ = _tmp5_;
	_tmp7_ = collection;
	_tmp8_ = font_manager_font_list_filter_get_icon ((FontManagerFontListFilter*) _tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = _tmp9_;
	gtk_widget_set_visible ((GtkWidget*) _tmp6_, _tmp10_ != NULL);
	_g_free0 (_tmp10_);
	_tmp11_ = font_manager_list_item_row_get_item_icon ((FontManagerListItemRow*) self);
	_tmp12_ = _tmp11_;
	_tmp13_ = gtk_widget_get_visible ((GtkWidget*) _tmp12_);
	_tmp14_ = _tmp13_;
	if (_tmp14_) {
		GtkImage* _tmp15_;
		GtkImage* _tmp16_;
		FontManagerCollection* _tmp17_;
		gchar* _tmp18_;
		gchar* _tmp19_;
		gchar* _tmp20_;
		_tmp15_ = font_manager_list_item_row_get_item_icon ((FontManagerListItemRow*) self);
		_tmp16_ = _tmp15_;
		_tmp17_ = collection;
		_tmp18_ = font_manager_font_list_filter_get_icon ((FontManagerFontListFilter*) _tmp17_);
		_tmp19_ = _tmp18_;
		_tmp20_ = _tmp19_;
		gtk_image_set_from_icon_name (_tmp16_, _tmp20_);
		_g_free0 (_tmp20_);
	}
	_tmp21_ = font_manager_list_item_row_get_item_count ((FontManagerListItemRow*) self);
	_tmp22_ = _tmp21_;
	_tmp23_ = collection;
	_tmp24_ = font_manager_font_list_filter_get_size ((FontManagerFontListFilter*) _tmp23_);
	_tmp25_ = _tmp24_;
	_tmp26_ = g_strdup_printf ("%i", _tmp25_);
	_tmp27_ = _tmp26_;
	gtk_label_set_label (_tmp22_, _tmp27_);
	_g_free0 (_tmp27_);
	flags = G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE;
	_tmp28_ = self->priv->bindings;
	_tmp29_ = collection;
	_tmp30_ = font_manager_list_item_row_get_edit_label ((FontManagerListItemRow*) self);
	_tmp31_ = _tmp30_;
	_tmp32_ = g_object_bind_property_with_closures ((GObject*) _tmp29_, "name", (GObject*) _tmp31_, "text", flags, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp33_ = _g_object_ref0 (_tmp32_);
	g_ptr_array_add (_tmp28_, _tmp33_);
	_tmp34_ = self->priv->bindings;
	_tmp35_ = collection;
	_tmp36_ = font_manager_list_item_row_get_item_state ((FontManagerListItemRow*) self);
	_tmp37_ = _tmp36_;
	_tmp38_ = g_object_bind_property_with_closures ((GObject*) _tmp35_, "active", (GObject*) _tmp37_, "active", flags, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp39_ = _g_object_ref0 (_tmp38_);
	g_ptr_array_add (_tmp34_, _tmp39_);
	_tmp40_ = self->priv->bindings;
	_tmp41_ = collection;
	_tmp42_ = font_manager_list_item_row_get_item_state ((FontManagerListItemRow*) self);
	_tmp43_ = _tmp42_;
	_tmp44_ = g_object_bind_property_with_closures ((GObject*) _tmp41_, "inconsistent", (GObject*) _tmp43_, "inconsistent", flags, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp45_ = _g_object_ref0 (_tmp44_);
	g_ptr_array_add (_tmp40_, _tmp45_);
	_tmp46_ = font_manager_list_item_row_get_item_state ((FontManagerListItemRow*) self);
	_tmp47_ = _tmp46_;
	_tmp48_ = collection;
	_tmp49_ = g_signal_connect_object (_tmp47_, "toggled", (GCallback) _font_manager_collection_on_state_toggled_gtk_check_button_toggled, _tmp48_, 0);
	self->priv->signal_id = _tmp49_;
	_g_object_unref0 (collection);
	return;
}

FontManagerCollectionListRow*
font_manager_collection_list_row_construct (GType object_type)
{
	FontManagerCollectionListRow * self = NULL;
	self = (FontManagerCollectionListRow*) font_manager_tree_list_item_row_construct (object_type);
	return self;
}

FontManagerCollectionListRow*
font_manager_collection_list_row_new (void)
{
	return font_manager_collection_list_row_construct (FONT_MANAGER_TYPE_COLLECTION_LIST_ROW);
}

static void
_font_manager_collection_list_row___lambda60_ (FontManagerCollectionListRow* self)
{
	GObject* _tmp0_;
	GObject* _tmp1_;
	gchar* new_name = NULL;
	GtkEditableLabel* _tmp2_;
	GtkEditableLabel* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	FontManagerCollection* collection = NULL;
	GObject* _tmp7_;
	GObject* _tmp8_;
	FontManagerCollection* _tmp9_;
	gboolean _tmp10_ = FALSE;
	const gchar* _tmp11_;
	_tmp0_ = font_manager_list_item_row_get_item ((FontManagerListItemRow*) self);
	_tmp1_ = _tmp0_;
	g_return_if_fail (FONT_MANAGER_IS_COLLECTION (_tmp1_));
	_tmp2_ = font_manager_list_item_row_get_edit_label ((FontManagerListItemRow*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = gtk_editable_get_text ((GtkEditable*) _tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_strdup (_tmp5_);
	new_name = _tmp6_;
	_tmp7_ = font_manager_list_item_row_get_item ((FontManagerListItemRow*) self);
	_tmp8_ = _tmp7_;
	_tmp9_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, FONT_MANAGER_TYPE_COLLECTION, FontManagerCollection));
	collection = _tmp9_;
	_tmp11_ = new_name;
	if (g_strcmp0 (_tmp11_, "") == 0) {
		_tmp10_ = TRUE;
	} else {
		const gchar* _tmp12_;
		FontManagerCollection* _tmp13_;
		gchar* _tmp14_;
		gchar* _tmp15_;
		gchar* _tmp16_;
		_tmp12_ = new_name;
		_tmp13_ = collection;
		_tmp14_ = font_manager_font_list_filter_get_name ((FontManagerFontListFilter*) _tmp13_);
		_tmp15_ = _tmp14_;
		_tmp16_ = _tmp15_;
		_tmp10_ = g_strcmp0 (_tmp12_, _tmp16_) == 0;
		_g_free0 (_tmp16_);
	}
	if (_tmp10_) {
		_g_object_unref0 (collection);
		_g_free0 (new_name);
		return;
	}
	font_manager_collection_list_row_queue_item_state_update (self);
	_g_object_unref0 (collection);
	_g_free0 (new_name);
}

static void
__font_manager_collection_list_row___lambda60__gtk_editable_changed (GtkEditable* _sender,
                                                                     gpointer self)
{
	_font_manager_collection_list_row___lambda60_ ((FontManagerCollectionListRow*) self);
}

static GObject *
font_manager_collection_list_row_constructor (GType type,
                                              guint n_construct_properties,
                                              GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	FontManagerCollectionListRow * self;
	GtkLabel* _tmp0_;
	GtkLabel* _tmp1_;
	GtkCheckButton* _tmp2_;
	GtkCheckButton* _tmp3_;
	GtkLabel* _tmp4_;
	GtkLabel* _tmp5_;
	GtkEditableLabel* _tmp6_;
	GtkEditableLabel* _tmp7_;
	GtkImage* _tmp8_;
	GtkImage* _tmp9_;
	GtkEditableLabel* _tmp10_;
	GtkEditableLabel* _tmp11_;
	parent_class = G_OBJECT_CLASS (font_manager_collection_list_row_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FONT_MANAGER_TYPE_COLLECTION_LIST_ROW, FontManagerCollectionListRow);
	gtk_widget_set_margin_start ((GtkWidget*) self, 0);
	_tmp0_ = font_manager_list_item_row_get_item_label ((FontManagerListItemRow*) self);
	_tmp1_ = _tmp0_;
	gtk_widget_set_visible ((GtkWidget*) _tmp1_, FALSE);
	_tmp2_ = font_manager_list_item_row_get_item_state ((FontManagerListItemRow*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = font_manager_list_item_row_get_item_count ((FontManagerListItemRow*) self);
	_tmp5_ = _tmp4_;
	gtk_widget_set_visible ((GtkWidget*) _tmp5_, TRUE);
	gtk_widget_set_visible ((GtkWidget*) _tmp3_, TRUE);
	_tmp6_ = font_manager_list_item_row_get_edit_label ((FontManagerListItemRow*) self);
	_tmp7_ = _tmp6_;
	_tmp8_ = font_manager_list_item_row_get_drag_handle ((FontManagerListItemRow*) self);
	_tmp9_ = _tmp8_;
	gtk_widget_set_visible ((GtkWidget*) _tmp9_, TRUE);
	gtk_widget_set_visible ((GtkWidget*) _tmp7_, TRUE);
	_tmp10_ = font_manager_list_item_row_get_edit_label ((FontManagerListItemRow*) self);
	_tmp11_ = _tmp10_;
	g_signal_connect_object ((GtkEditable*) _tmp11_, "changed", (GCallback) __font_manager_collection_list_row___lambda60__gtk_editable_changed, self, G_CONNECT_AFTER);
	return obj;
}

static void
font_manager_collection_list_row_class_init (FontManagerCollectionListRowClass * klass,
                                             gpointer klass_data)
{
	font_manager_collection_list_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FontManagerCollectionListRow_private_offset);
	((FontManagerListItemRowClass *) klass)->reset = (void (*) (FontManagerListItemRow*)) font_manager_collection_list_row_real_reset;
	((FontManagerListItemRowClass *) klass)->on_item_set = (void (*) (FontManagerListItemRow*)) font_manager_collection_list_row_real_on_item_set;
	G_OBJECT_CLASS (klass)->constructor = font_manager_collection_list_row_constructor;
	G_OBJECT_CLASS (klass)->finalize = font_manager_collection_list_row_finalize;
}

static void
font_manager_collection_list_row_instance_init (FontManagerCollectionListRow * self,
                                                gpointer klass)
{
	GPtrArray* _tmp0_;
	self->priv = font_manager_collection_list_row_get_instance_private (self);
	_tmp0_ = g_ptr_array_new_full ((guint) 0, _g_object_unref0_);
	self->priv->bindings = _tmp0_;
	self->priv->signal_id = (gulong) 0;
	self->priv->state_change_timeout = (guint) 0;
}

static void
font_manager_collection_list_row_finalize (GObject * obj)
{
	FontManagerCollectionListRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FONT_MANAGER_TYPE_COLLECTION_LIST_ROW, FontManagerCollectionListRow);
	_g_ptr_array_unref0 (self->priv->bindings);
	G_OBJECT_CLASS (font_manager_collection_list_row_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
font_manager_collection_list_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FontManagerCollectionListRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) font_manager_collection_list_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FontManagerCollectionListRow), 0, (GInstanceInitFunc) font_manager_collection_list_row_instance_init, NULL };
	GType font_manager_collection_list_row_type_id;
	font_manager_collection_list_row_type_id = g_type_register_static (FONT_MANAGER_TYPE_TREE_LIST_ITEM_ROW, "FontManagerCollectionListRow", &g_define_type_info, 0);
	FontManagerCollectionListRow_private_offset = g_type_add_instance_private (font_manager_collection_list_row_type_id, sizeof (FontManagerCollectionListRowPrivate));
	return font_manager_collection_list_row_type_id;
}

GType
font_manager_collection_list_row_get_type (void)
{
	static volatile gsize font_manager_collection_list_row_type_id__once = 0;
	if (g_once_init_enter (&font_manager_collection_list_row_type_id__once)) {
		GType font_manager_collection_list_row_type_id;
		font_manager_collection_list_row_type_id = font_manager_collection_list_row_get_type_once ();
		g_once_init_leave (&font_manager_collection_list_row_type_id__once, font_manager_collection_list_row_type_id);
	}
	return font_manager_collection_list_row_type_id__once;
}

static inline gpointer
font_manager_collection_rename_popover_get_instance_private (FontManagerCollectionRenamePopover* self)
{
	return G_STRUCT_MEMBER_P (self, FontManagerCollectionRenamePopover_private_offset);
}

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
__lambda42_ (FontManagerCollectionRenamePopover* self)
{
	GtkEntry* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	_tmp0_ = self->priv->_name_entry;
	_tmp1_ = gtk_editable_get_text ((GtkEditable*) _tmp0_);
	_tmp2_ = string_strip (_tmp1_);
	_tmp3_ = _tmp2_;
	g_signal_emit (self, font_manager_collection_rename_popover_signals[FONT_MANAGER_COLLECTION_RENAME_POPOVER_RENAMED_SIGNAL], 0, _tmp3_);
	_g_free0 (_tmp3_);
	gtk_popover_popdown ((GtkPopover*) self);
}

static void
___lambda42__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda42_ ((FontManagerCollectionRenamePopover*) self);
}

static void
font_manager_collection_rename_popover_real_constructed (GObject* base)
{
	FontManagerCollectionRenamePopover * self;
	GtkEntry* _tmp0_;
	GtkButton* _tmp1_;
	GtkButton* _tmp2_;
	self = (FontManagerCollectionRenamePopover*) base;
	_tmp0_ = self->priv->_name_entry;
	gtk_widget_grab_focus ((GtkWidget*) _tmp0_);
	_tmp1_ = self->priv->_rename_button;
	gtk_popover_set_default_widget ((GtkPopover*) self, (GtkWidget*) _tmp1_);
	_tmp2_ = self->priv->_rename_button;
	g_signal_connect_object (_tmp2_, "clicked", (GCallback) ___lambda42__gtk_button_clicked, self, 0);
	G_OBJECT_CLASS (font_manager_collection_rename_popover_parent_class)->constructed ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_popover_get_type (), GtkPopover));
	return;
}

FontManagerCollectionRenamePopover*
font_manager_collection_rename_popover_construct (GType object_type)
{
	FontManagerCollectionRenamePopover * self = NULL;
	self = (FontManagerCollectionRenamePopover*) g_object_new (object_type, NULL);
	return self;
}

FontManagerCollectionRenamePopover*
font_manager_collection_rename_popover_new (void)
{
	return font_manager_collection_rename_popover_construct (FONT_MANAGER_TYPE_COLLECTION_RENAME_POPOVER);
}

GtkEntry*
font_manager_collection_rename_popover_get_name_entry (FontManagerCollectionRenamePopover* self)
{
	GtkEntry* result;
	GtkEntry* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_name_entry;
	result = _tmp0_;
	return result;
}

GtkButton*
font_manager_collection_rename_popover_get_rename_button (FontManagerCollectionRenamePopover* self)
{
	GtkButton* result;
	GtkButton* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_rename_button;
	result = _tmp0_;
	return result;
}

static void
font_manager_collection_rename_popover_class_init (FontManagerCollectionRenamePopoverClass * klass,
                                                   gpointer klass_data)
{
	font_manager_collection_rename_popover_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FontManagerCollectionRenamePopover_private_offset);
	((GObjectClass *) klass)->constructed = (void (*) (GObject*)) font_manager_collection_rename_popover_real_constructed;
	G_OBJECT_CLASS (klass)->get_property = _vala_font_manager_collection_rename_popover_get_property;
	G_OBJECT_CLASS (klass)->finalize = font_manager_collection_rename_popover_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_COLLECTION_RENAME_POPOVER_NAME_ENTRY_PROPERTY, font_manager_collection_rename_popover_properties[FONT_MANAGER_COLLECTION_RENAME_POPOVER_NAME_ENTRY_PROPERTY] = g_param_spec_object ("name-entry", "name-entry", "name-entry", gtk_entry_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_COLLECTION_RENAME_POPOVER_RENAME_BUTTON_PROPERTY, font_manager_collection_rename_popover_properties[FONT_MANAGER_COLLECTION_RENAME_POPOVER_RENAME_BUTTON_PROPERTY] = g_param_spec_object ("rename-button", "rename-button", "rename-button", gtk_button_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/com/github/FontManager/FontManager/ui/font-manager-collection-rename-popover.ui");
	font_manager_collection_rename_popover_signals[FONT_MANAGER_COLLECTION_RENAME_POPOVER_RENAMED_SIGNAL] = g_signal_new ("renamed", FONT_MANAGER_TYPE_COLLECTION_RENAME_POPOVER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "name_entry", FALSE, FontManagerCollectionRenamePopover_private_offset + G_STRUCT_OFFSET (FontManagerCollectionRenamePopoverPrivate, _name_entry));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "rename_button", FALSE, FontManagerCollectionRenamePopover_private_offset + G_STRUCT_OFFSET (FontManagerCollectionRenamePopoverPrivate, _rename_button));
}

static void
font_manager_collection_rename_popover_instance_init (FontManagerCollectionRenamePopover * self,
                                                      gpointer klass)
{
	self->priv = font_manager_collection_rename_popover_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
font_manager_collection_rename_popover_finalize (GObject * obj)
{
	FontManagerCollectionRenamePopover * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FONT_MANAGER_TYPE_COLLECTION_RENAME_POPOVER, FontManagerCollectionRenamePopover);
	G_OBJECT_CLASS (font_manager_collection_rename_popover_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
font_manager_collection_rename_popover_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FontManagerCollectionRenamePopoverClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) font_manager_collection_rename_popover_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FontManagerCollectionRenamePopover), 0, (GInstanceInitFunc) font_manager_collection_rename_popover_instance_init, NULL };
	GType font_manager_collection_rename_popover_type_id;
	font_manager_collection_rename_popover_type_id = g_type_register_static (gtk_popover_get_type (), "FontManagerCollectionRenamePopover", &g_define_type_info, 0);
	FontManagerCollectionRenamePopover_private_offset = g_type_add_instance_private (font_manager_collection_rename_popover_type_id, sizeof (FontManagerCollectionRenamePopoverPrivate));
	return font_manager_collection_rename_popover_type_id;
}

GType
font_manager_collection_rename_popover_get_type (void)
{
	static volatile gsize font_manager_collection_rename_popover_type_id__once = 0;
	if (g_once_init_enter (&font_manager_collection_rename_popover_type_id__once)) {
		GType font_manager_collection_rename_popover_type_id;
		font_manager_collection_rename_popover_type_id = font_manager_collection_rename_popover_get_type_once ();
		g_once_init_leave (&font_manager_collection_rename_popover_type_id__once, font_manager_collection_rename_popover_type_id);
	}
	return font_manager_collection_rename_popover_type_id__once;
}

static void
_vala_font_manager_collection_rename_popover_get_property (GObject * object,
                                                           guint property_id,
                                                           GValue * value,
                                                           GParamSpec * pspec)
{
	FontManagerCollectionRenamePopover * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FONT_MANAGER_TYPE_COLLECTION_RENAME_POPOVER, FontManagerCollectionRenamePopover);
	switch (property_id) {
		case FONT_MANAGER_COLLECTION_RENAME_POPOVER_NAME_ENTRY_PROPERTY:
		g_value_set_object (value, font_manager_collection_rename_popover_get_name_entry (self));
		break;
		case FONT_MANAGER_COLLECTION_RENAME_POPOVER_RENAME_BUTTON_PROPERTY:
		g_value_set_object (value, font_manager_collection_rename_popover_get_rename_button (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
font_manager_collection_list_view_get_instance_private (FontManagerCollectionListView* self)
{
	return G_STRUCT_MEMBER_P (self, FontManagerCollectionListView_private_offset);
}

static gboolean
font_manager_collection_list_view_update (FontManagerCollectionListView* self)
{
	GtkListView* _tmp0_;
	GtkListView* _tmp1_;
	GtkSingleSelection* _tmp2_;
	GtkSingleSelection* _tmp3_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = ((FontManagerFilterListView*) self)->listview;
	gtk_list_view_set_model (_tmp0_, NULL);
	_tmp1_ = ((FontManagerFilterListView*) self)->listview;
	_tmp2_ = font_manager_filter_list_view_get_selection ((FontManagerFilterListView*) self);
	_tmp3_ = _tmp2_;
	gtk_list_view_set_model (_tmp1_, (GtkSelectionModel*) _tmp3_);
	self->priv->update_timeout = (guint) 0;
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
_font_manager_collection_list_view_update_gsource_func (gpointer self)
{
	gboolean result;
	result = font_manager_collection_list_view_update ((FontManagerCollectionListView*) self);
	return result;
}

void
font_manager_collection_list_view_queue_update (FontManagerCollectionListView* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->update_timeout != ((guint) 0)) {
		g_source_remove (self->priv->update_timeout);
	}
	self->priv->update_timeout = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 333, _font_manager_collection_list_view_update_gsource_func, g_object_ref (self), g_object_unref);
	return;
}

void
font_manager_collection_list_view_save (FontManagerCollectionListView* self)
{
	FontManagerFontListFilterModel* _tmp0_;
	FontManagerFontListFilterModel* _tmp1_;
	FontManagerFontListFilterModel* _tmp2_;
	FontManagerFontListFilterModel* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = font_manager_filter_list_view_get_model ((FontManagerFilterListView*) self);
	_tmp1_ = _tmp0_;
	_vala_return_if_fail (_tmp1_ != NULL, "model != null");
	_tmp2_ = font_manager_filter_list_view_get_model ((FontManagerFilterListView*) self);
	_tmp3_ = _tmp2_;
	font_manager_collection_list_model_save (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, FONT_MANAGER_TYPE_COLLECTION_LIST_MODEL, FontManagerCollectionListModel));
	return;
}

static void
font_manager_collection_list_view_on_click (FontManagerCollectionListView* self,
                                            gint n_press,
                                            gdouble x,
                                            gdouble y)
{
	GtkPopoverMenu* _tmp0_;
	GdkRectangle _tmp1_;
	g_return_if_fail (self != NULL);
	self->priv->clicked_area.x = (gint) x;
	self->priv->clicked_area.y = (gint) y;
	self->priv->clicked_area.width = 2;
	self->priv->clicked_area.height = 2;
	_tmp0_ = self->priv->context_menu;
	_tmp1_ = self->priv->clicked_area;
	gtk_popover_set_pointing_to ((GtkPopover*) _tmp0_, &_tmp1_);
	return;
}

static gboolean
__lambda62_ (FontManagerCollectionListView* self)
{
	gboolean result;
	font_manager_collection_list_view_save (self);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda62__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda62_ ((FontManagerCollectionListView*) self);
	return result;
}

static void
__lambda61_ (FontManagerCollectionListView* self)
{
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda62__gsource_func, g_object_ref (self), g_object_unref);
}

static void
___lambda61__font_manager_list_item_row_item_state_changed (FontManagerListItemRow* _sender,
                                                            GObject* item,
                                                            gpointer self)
{
	__lambda61_ ((FontManagerCollectionListView*) self);
}

static void
font_manager_collection_list_view_real_setup_list_row (FontManagerFilterListView* base,
                                                       GtkSignalListItemFactory* factory,
                                                       GObject* item)
{
	FontManagerCollectionListView * self;
	GtkListItem* list_item = NULL;
	GtkListItem* _tmp0_;
	GtkTreeExpander* tree_expander = NULL;
	GtkTreeExpander* _tmp1_;
	FontManagerCollectionListRow* row = NULL;
	FontManagerCollectionListRow* _tmp2_;
	GtkSingleSelection* _tmp3_;
	GtkSingleSelection* _tmp4_;
	self = (FontManagerCollectionListView*) base;
	g_return_if_fail (factory != NULL);
	g_return_if_fail (item != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (item, gtk_list_item_get_type (), GtkListItem));
	list_item = _tmp0_;
	_tmp1_ = (GtkTreeExpander*) gtk_tree_expander_new ();
	g_object_ref_sink (_tmp1_);
	tree_expander = _tmp1_;
	gtk_tree_expander_set_indent_for_icon (tree_expander, FALSE);
	_tmp2_ = font_manager_collection_list_row_new ();
	g_object_ref_sink (_tmp2_);
	row = _tmp2_;
	font_manager_tree_list_item_row_set_expander ((FontManagerTreeListItemRow*) row, tree_expander);
	_tmp3_ = font_manager_filter_list_view_get_selection ((FontManagerFilterListView*) self);
	_tmp4_ = _tmp3_;
	font_manager_tree_list_item_row_set_selection ((FontManagerTreeListItemRow*) row, (GtkSelectionModel*) _tmp4_);
	gtk_tree_expander_set_child (tree_expander, (GtkWidget*) row);
	gtk_list_item_set_child (list_item, (GtkWidget*) tree_expander);
	font_manager_collection_list_view_add_drag_source (self, row);
	font_manager_collection_list_view_add_drop_target (self, (GtkWidget*) row);
	g_signal_connect_object ((FontManagerListItemRow*) row, "item-state-changed", (GCallback) ___lambda61__font_manager_list_item_row_item_state_changed, self, 0);
	_g_object_unref0 (row);
	_g_object_unref0 (tree_expander);
	_g_object_unref0 (list_item);
	return;
}

static Block2Data*
block2_data_ref (Block2Data* _data2_)
{
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}

static void
block2_data_unref (void * _userdata_)
{
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		FontManagerCollectionListView* self;
		self = _data2_->self;
		_g_object_unref0 (self);
		g_slice_free (Block2Data, _data2_);
	}
}

static gboolean
__lambda64_ (Block2Data* _data2_)
{
	FontManagerCollectionListView* self;
	GtkTreeListModel* _tmp0_;
	GtkTreeListModel* _tmp1_;
	gboolean result;
	self = _data2_->self;
	_tmp0_ = font_manager_filter_list_view_get_treemodel ((FontManagerFilterListView*) self);
	_tmp1_ = _tmp0_;
	g_list_model_items_changed ((GListModel*) _tmp1_, _data2_->position, (guint) 0, (guint) 0);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda64__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda64_ (self);
	return result;
}

static void
__lambda63_ (Block2Data* _data2_)
{
	FontManagerCollectionListView* self;
	self = _data2_->self;
	g_idle_add_full (G_PRIORITY_LOW, ___lambda64__gsource_func, block2_data_ref (_data2_), block2_data_unref);
}

static void
___lambda63__g_object_notify (GObject* _sender,
                              GParamSpec* pspec,
                              gpointer self)
{
	__lambda63_ (self);
}

static void
font_manager_collection_list_view_real_bind_list_row (FontManagerFilterListView* base,
                                                      GtkSignalListItemFactory* factory,
                                                      GObject* item)
{
	FontManagerCollectionListView * self;
	Block2Data* _data2_;
	GtkListItem* list_item = NULL;
	GtkListItem* _tmp0_;
	GtkTreeListRow* list_row = NULL;
	GtkTreeListModel* _tmp1_;
	GtkTreeListModel* _tmp2_;
	GtkTreeListRow* _tmp3_;
	GtkTreeExpander* tree_expander = NULL;
	GtkWidget* _tmp4_;
	GtkTreeExpander* _tmp5_;
	FontManagerCollectionListRow* row = NULL;
	GtkWidget* _tmp6_;
	FontManagerCollectionListRow* _tmp7_;
	GObject* object = NULL;
	GObject* _tmp8_;
	FontManagerCollection* collection = NULL;
	FontManagerCollection* _tmp9_;
	self = (FontManagerCollectionListView*) base;
	g_return_if_fail (factory != NULL);
	g_return_if_fail (item != NULL);
	_data2_ = g_slice_new0 (Block2Data);
	_data2_->_ref_count_ = 1;
	_data2_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (item, gtk_list_item_get_type (), GtkListItem));
	list_item = _tmp0_;
	_data2_->position = gtk_list_item_get_position (list_item);
	_tmp1_ = font_manager_filter_list_view_get_treemodel ((FontManagerFilterListView*) self);
	_tmp2_ = _tmp1_;
	_tmp3_ = gtk_tree_list_model_get_row (_tmp2_, _data2_->position);
	list_row = _tmp3_;
	_tmp4_ = gtk_list_item_get_child (list_item);
	_tmp5_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_tree_expander_get_type (), GtkTreeExpander));
	tree_expander = _tmp5_;
	gtk_tree_expander_set_list_row (tree_expander, list_row);
	_tmp6_ = gtk_tree_expander_get_child (tree_expander);
	_tmp7_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, FONT_MANAGER_TYPE_COLLECTION_LIST_ROW, FontManagerCollectionListRow));
	row = _tmp7_;
	_tmp8_ = gtk_tree_list_row_get_item (list_row);
	object = _tmp8_;
	_tmp9_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (object, FONT_MANAGER_TYPE_COLLECTION, FontManagerCollection));
	collection = _tmp9_;
	font_manager_font_list_filter_set_depth ((FontManagerFontListFilter*) collection, (gint) gtk_tree_list_row_get_depth (list_row));
	font_manager_list_item_row_set_item ((FontManagerListItemRow*) row, object);
	g_signal_connect_data ((GObject*) collection, "notify::inconsistent", (GCallback) ___lambda63__g_object_notify, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, G_CONNECT_AFTER);
	_g_object_unref0 (collection);
	_g_object_unref0 (object);
	_g_object_unref0 (row);
	_g_object_unref0 (tree_expander);
	_g_object_unref0 (list_row);
	_g_object_unref0 (list_item);
	block2_data_unref (_data2_);
	_data2_ = NULL;
	return;
}

static void
font_manager_collection_list_view_init_context_menu (FontManagerCollectionListView* self)
{
	FontManagerBaseContextMenu* base_menu = NULL;
	GtkListView* _tmp0_;
	FontManagerBaseContextMenu* _tmp1_;
	FontManagerBaseContextMenu* _tmp2_;
	GtkPopoverMenu* _tmp3_;
	GtkPopoverMenu* _tmp4_;
	GtkPopoverMenu* _tmp5_;
	FontManagerBaseContextMenu* _tmp6_;
	GtkLabel* _tmp7_;
	GtkLabel* _tmp8_;
	GtkLabel* _tmp9_;
	GMenu* menu = NULL;
	FontManagerBaseContextMenu* _tmp10_;
	GMenu* _tmp11_;
	GMenu* _tmp12_;
	GMenu* _tmp13_;
	g_return_if_fail (self != NULL);
	_tmp0_ = ((FontManagerFilterListView*) self)->listview;
	_tmp1_ = font_manager_base_context_menu_new ((GtkWidget*) _tmp0_);
	base_menu = _tmp1_;
	_tmp2_ = base_menu;
	_tmp3_ = font_manager_base_context_menu_get_popover (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _g_object_ref0 (_tmp4_);
	_g_object_unref0 (self->priv->context_menu);
	self->priv->context_menu = _tmp5_;
	_tmp6_ = base_menu;
	_tmp7_ = font_manager_base_context_menu_get_menu_title (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = _g_object_ref0 (_tmp8_);
	_g_object_unref0 (self->priv->menu_title);
	self->priv->menu_title = _tmp9_;
	_tmp10_ = base_menu;
	_tmp11_ = font_manager_base_context_menu_get_menu (_tmp10_);
	_tmp12_ = _tmp11_;
	_tmp13_ = _g_object_ref0 (_tmp12_);
	menu = _tmp13_;
	{
		FontManagerMenuEntry* entry_collection = NULL;
		gint entry_collection_length1 = 0;
		gint _entry_collection_size_ = 0;
		gint entry_it = 0;
		entry_collection = FONT_MANAGER_COLLECTION_LIST_VIEW_collection_menu_entries;
		entry_collection_length1 = G_N_ELEMENTS (FONT_MANAGER_COLLECTION_LIST_VIEW_collection_menu_entries);
		for (entry_it = 0; entry_it < entry_collection_length1; entry_it = entry_it + 1) {
			FontManagerMenuEntry entry = {0};
			entry = entry_collection[entry_it];
			{
				GMenuItem* item = NULL;
				FontManagerMenuEntry _tmp14_;
				const gchar* _tmp15_;
				FontManagerMenuEntry _tmp16_;
				const gchar* _tmp17_;
				GMenuItem* _tmp18_;
				GMenu* _tmp19_;
				GMenuItem* _tmp20_;
				_tmp14_ = entry;
				_tmp15_ = _tmp14_.display_name;
				_tmp16_ = entry;
				_tmp17_ = _tmp16_.action_name;
				_tmp18_ = g_menu_item_new (_tmp15_, _tmp17_);
				item = _tmp18_;
				_tmp19_ = menu;
				_tmp20_ = item;
				g_menu_append_item (_tmp19_, _tmp20_);
				_g_object_unref0 (item);
			}
		}
	}
	_g_object_unref0 (menu);
	_g_object_unref0 (base_menu);
	return;
}

static void
font_manager_collection_list_view_update_context_menu (FontManagerCollectionListView* self)
{
	GtkLabel* _tmp0_;
	FontManagerFontListFilter* _tmp1_;
	FontManagerFontListFilter* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->menu_title;
	_tmp1_ = font_manager_filter_list_view_get_selected_item ((FontManagerFilterListView*) self);
	_tmp2_ = _tmp1_;
	_tmp3_ = font_manager_font_list_filter_get_name (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _tmp4_;
	gtk_label_set_label (_tmp0_, _tmp5_);
	_g_free0 (_tmp5_);
	return;
}

static void
font_manager_collection_list_view_real_on_show_context_menu (FontManagerFilterListView* base,
                                                             gint n_press,
                                                             gdouble x,
                                                             gdouble y)
{
	FontManagerCollectionListView * self;
	FontManagerFontListFilter* _tmp0_;
	FontManagerFontListFilter* _tmp1_;
	GtkPopoverMenu* _tmp2_;
	self = (FontManagerCollectionListView*) base;
	_tmp0_ = font_manager_filter_list_view_get_selected_item ((FontManagerFilterListView*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == NULL) {
		return;
	}
	_tmp2_ = self->priv->context_menu;
	gtk_popover_popup ((GtkPopover*) _tmp2_);
	return;
}

static void
___lambda65_ (FontManagerCollectionListView* self,
              GObject* obj,
              GAsyncResult* res)
{
	g_return_if_fail (res != NULL);
	font_manager_copy_files_finish (res);
}

static void
____lambda65__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	___lambda65_ ((FontManagerCollectionListView*) self, source_object, res);
	g_object_unref (self);
}

static void
font_manager_collection_list_view_on_folder_selection_ready (FontManagerCollectionListView* self,
                                                             GObject* obj,
                                                             GAsyncResult* res)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (res != NULL);
	g_return_if_fail (obj != NULL);
	{
		GtkFileDialog* dialog = NULL;
		GtkFileDialog* _tmp0_;
		GFile* target_dir = NULL;
		GFile* _tmp1_;
		gchar* destination = NULL;
		gchar* _tmp2_;
		gchar* _tmp3_;
		FontManagerFontListFilter* _tmp4_;
		FontManagerFontListFilter* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		const gchar* _tmp11_;
		GFile* tmp = NULL;
		const gchar* _tmp12_;
		GFile* _tmp13_;
		FontManagerFontListFilter* _tmp14_;
		FontManagerFontListFilter* _tmp15_;
		FontManagerStringSet* _tmp16_;
		FontManagerStringSet* _tmp17_;
		GFile* _tmp18_;
		_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (obj, gtk_file_dialog_get_type (), GtkFileDialog));
		dialog = _tmp0_;
		_tmp1_ = gtk_file_dialog_select_folder_finish (dialog, res, &_inner_error0_);
		target_dir = _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (dialog);
			goto __catch0_g_error;
		}
		_tmp2_ = g_file_get_path (target_dir);
		_tmp3_ = _tmp2_;
		_tmp4_ = font_manager_filter_list_view_get_selected_item ((FontManagerFilterListView*) self);
		_tmp5_ = _tmp4_;
		_tmp6_ = font_manager_font_list_filter_get_name (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = _tmp7_;
		_tmp9_ = g_build_filename (_tmp3_, _tmp8_, NULL);
		_tmp10_ = _tmp9_;
		_g_free0 (_tmp8_);
		_g_free0 (_tmp3_);
		destination = _tmp10_;
		_tmp11_ = destination;
		g_return_if_fail (g_mkdir_with_parents (_tmp11_, 0755) == 0);
		_tmp12_ = destination;
		_tmp13_ = g_file_new_for_path (_tmp12_);
		tmp = _tmp13_;
		_tmp14_ = font_manager_filter_list_view_get_selected_item ((FontManagerFilterListView*) self);
		_tmp15_ = _tmp14_;
		_tmp16_ = font_manager_collection_get_filelist (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, FONT_MANAGER_TYPE_COLLECTION, FontManagerCollection));
		_tmp17_ = _tmp16_;
		_tmp18_ = tmp;
		font_manager_copy_files (_tmp17_, _tmp18_, TRUE, ____lambda65__gasync_ready_callback, g_object_ref (self));
		_g_object_unref0 (_tmp17_);
		_g_object_unref0 (tmp);
		_g_free0 (destination);
		_g_object_unref0 (target_dir);
		_g_object_unref0 (dialog);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp19_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp19_ = e;
		if (_tmp19_->code == GTK_DIALOG_ERROR_FAILED) {
			GError* _tmp20_;
			const gchar* _tmp21_;
			_tmp20_ = e;
			_tmp21_ = _tmp20_->message;
			g_warning ("Collections.vala:391: %s", _tmp21_);
		} else {
			const gchar* _tmp22_;
			const gchar* _tmp23_;
			GError* _tmp24_;
			const gchar* _tmp25_;
			_tmp22_ = gtk_widget_get_name ((GtkWidget*) self);
			_tmp23_ = _tmp22_;
			_tmp24_ = e;
			_tmp25_ = _tmp24_->message;
			g_debug ("Collections.vala:393: %s.on_file_selections_ready : %s", _tmp23_, _tmp25_);
		}
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	return;
}

static void
font_manager_collection_list_view_on_compress_complete (FontManagerCollectionListView* self,
                                                        GObject* source,
                                                        GTask* task)
{
	gboolean _result_ = FALSE;
	gchar* title = NULL;
	gchar* _tmp3_;
	gchar* body = NULL;
	gchar* _tmp4_;
	GThemedIcon* icon = NULL;
	GThemedIcon* _tmp7_;
	GNotification* notification = NULL;
	const gchar* _tmp8_;
	GNotification* _tmp9_;
	const gchar* _tmp10_;
	FontManagerApplication* _tmp11_;
	FontManagerApplication* _tmp12_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (task != NULL);
	_result_ = FALSE;
	{
		gboolean _tmp0_ = FALSE;
		_tmp0_ = g_task_propagate_boolean (task, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_result_ = _tmp0_;
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp1_;
		const gchar* _tmp2_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp1_ = e;
		_tmp2_ = _tmp1_->message;
		g_warning ("Collections.vala:403: %s", _tmp2_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_tmp3_ = g_strdup (_ ("Archive created successfully."));
	title = _tmp3_;
	_tmp4_ = g_strdup (_ ("The resulting file can be found in your home directory."));
	body = _tmp4_;
	if (!_result_) {
		gchar* _tmp5_;
		gchar* _tmp6_;
		_tmp5_ = g_strdup (_ ("Error exporting collection"));
		_g_free0 (title);
		title = _tmp5_;
		_tmp6_ = g_strdup (_ ("Start the application from a terminal and try again for more informati" \
"on"));
		_g_free0 (body);
		body = _tmp6_;
	}
	_tmp7_ = (GThemedIcon*) g_themed_icon_new (FONT_MANAGER_BUS_ID);
	icon = _tmp7_;
	_tmp8_ = title;
	_tmp9_ = g_notification_new (_tmp8_);
	notification = _tmp9_;
	_tmp10_ = body;
	g_notification_set_body (notification, _tmp10_);
	g_notification_set_icon (notification, (GIcon*) icon);
	_tmp11_ = font_manager_get_default_application ();
	_tmp12_ = _tmp11_;
	g_application_send_notification ((GApplication*) _tmp12_, "compress-complete", notification);
	_g_object_unref0 (_tmp12_);
	_g_object_unref0 (notification);
	_g_object_unref0 (icon);
	_g_free0 (body);
	_g_free0 (title);
	return;
}

static void
font_manager_collection_list_view_compress_selected_collection (GTask* task,
                                                                GObject* source,
                                                                void* data,
                                                                GCancellable* cancellable)
{
	const gchar* home = NULL;
	const gchar* _tmp0_;
	FontManagerCollectionListView* collections = NULL;
	FontManagerCollectionListView* _tmp1_;
	gchar* outpath = NULL;
	const gchar* _tmp2_;
	FontManagerCollectionListView* _tmp3_;
	FontManagerFontListFilter* _tmp4_;
	FontManagerFontListFilter* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	GFile* output = NULL;
	const gchar* _tmp11_;
	GFile* _tmp12_;
	FontManagerArchiveManager* libarchive = NULL;
	FontManagerArchiveManager* _tmp13_;
	FontManagerStringSet* filelist = NULL;
	FontManagerCollectionListView* _tmp14_;
	FontManagerFontListFilter* _tmp15_;
	FontManagerFontListFilter* _tmp16_;
	FontManagerStringSet* _tmp17_;
	gint64 filesize = 0LL;
	FontManagerStringSet* _tmp18_;
	gboolean _result_ = FALSE;
	FontManagerArchiveManager* _tmp31_;
	FontManagerStringSet* _tmp32_;
	GFile* _tmp33_;
	g_return_if_fail (task != NULL);
	g_return_if_fail (source != NULL);
	g_return_if_fail (FONT_MANAGER_IS_COLLECTION_LIST_VIEW (source));
	_tmp0_ = g_get_home_dir ();
	home = _tmp0_;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (source, FONT_MANAGER_TYPE_COLLECTION_LIST_VIEW, FontManagerCollectionListView));
	collections = _tmp1_;
	_tmp2_ = home;
	_tmp3_ = collections;
	_tmp4_ = font_manager_filter_list_view_get_selected_item ((FontManagerFilterListView*) _tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = font_manager_font_list_filter_get_name (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = _tmp7_;
	_tmp9_ = g_build_filename (_tmp2_, _tmp8_, NULL);
	_tmp10_ = _tmp9_;
	_g_free0 (_tmp8_);
	outpath = _tmp10_;
	_tmp11_ = outpath;
	_tmp12_ = g_file_new_for_path (_tmp11_);
	output = _tmp12_;
	_tmp13_ = font_manager_archive_manager_new ();
	libarchive = _tmp13_;
	_tmp14_ = collections;
	_tmp15_ = font_manager_filter_list_view_get_selected_item ((FontManagerFilterListView*) _tmp14_);
	_tmp16_ = _tmp15_;
	_tmp17_ = font_manager_collection_get_filelist (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, FONT_MANAGER_TYPE_COLLECTION, FontManagerCollection));
	filelist = _tmp17_;
	_tmp18_ = filelist;
	filesize = font_manager_get_filelist_file_size (_tmp18_);
	if (filesize > ((gint64) 125000000)) {
		gchar* title = NULL;
		gchar* _tmp19_;
		gchar* body = NULL;
		gchar* _tmp20_;
		GThemedIcon* icon = NULL;
		GThemedIcon* _tmp21_;
		GNotification* notification = NULL;
		const gchar* _tmp22_;
		GNotification* _tmp23_;
		GNotification* _tmp24_;
		const gchar* _tmp25_;
		GNotification* _tmp26_;
		GThemedIcon* _tmp27_;
		FontManagerApplication* _tmp28_;
		FontManagerApplication* _tmp29_;
		GNotification* _tmp30_;
		_tmp19_ = g_strdup (_ ("Creating archive from selected collection."));
		title = _tmp19_;
		_tmp20_ = g_strdup (_ ("This may take some time for large collections…"));
		body = _tmp20_;
		_tmp21_ = (GThemedIcon*) g_themed_icon_new (FONT_MANAGER_BUS_ID);
		icon = _tmp21_;
		_tmp22_ = title;
		_tmp23_ = g_notification_new (_tmp22_);
		notification = _tmp23_;
		_tmp24_ = notification;
		_tmp25_ = body;
		g_notification_set_body (_tmp24_, _tmp25_);
		_tmp26_ = notification;
		_tmp27_ = icon;
		g_notification_set_icon (_tmp26_, (GIcon*) _tmp27_);
		_tmp28_ = font_manager_get_default_application ();
		_tmp29_ = _tmp28_;
		_tmp30_ = notification;
		g_application_send_notification ((GApplication*) _tmp29_, "compress-started", _tmp30_);
		_g_object_unref0 (_tmp29_);
		_g_object_unref0 (notification);
		_g_object_unref0 (icon);
		_g_free0 (body);
		_g_free0 (title);
	}
	_tmp31_ = libarchive;
	_tmp32_ = filelist;
	_tmp33_ = output;
	_result_ = font_manager_archive_manager_compress (_tmp31_, _tmp32_, _tmp33_);
	g_task_return_boolean (task, _result_);
	_g_object_unref0 (filelist);
	_g_object_unref0 (libarchive);
	_g_object_unref0 (output);
	_g_free0 (outpath);
	_g_object_unref0 (collections);
	return;
}

static void
_font_manager_collection_list_view_on_compress_complete_gasync_ready_callback (GObject* source_object,
                                                                               GTask* task,
                                                                               gpointer self)
{
	font_manager_collection_list_view_on_compress_complete ((FontManagerCollectionListView*) self, source_object, task);
	g_object_unref (self);
}

static void
_font_manager_collection_list_view_compress_selected_collection_gtask_thread_func (GTask* task,
                                                                                   GObject* source_object,
                                                                                   void* task_data,
                                                                                   GCancellable* cancellable)
{
	font_manager_collection_list_view_compress_selected_collection (task, source_object, task_data, cancellable);
}

static void
font_manager_collection_list_view_compress (FontManagerCollectionListView* self,
                                            GtkWidget* widget,
                                            const gchar* action,
                                            GVariant* parameter)
{
	FontManagerFontListFilter* _tmp0_;
	FontManagerFontListFilter* _tmp1_;
	GTask* task = NULL;
	GTask* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (widget != NULL);
	_tmp0_ = font_manager_filter_list_view_get_selected_item ((FontManagerFilterListView*) self);
	_tmp1_ = _tmp0_;
	_vala_return_if_fail (_tmp1_ != NULL, "selected_item != null");
	_tmp2_ = g_task_new ((GObject*) self, NULL, _font_manager_collection_list_view_on_compress_complete_gasync_ready_callback, g_object_ref (self));
	task = _tmp2_;
	g_task_run_in_thread (task, _font_manager_collection_list_view_compress_selected_collection_gtask_thread_func);
	_g_object_unref0 (task);
	return;
}

static void
_font_manager_collection_list_view_on_folder_selection_ready_gasync_ready_callback (GObject* source_object,
                                                                                    GAsyncResult* res,
                                                                                    gpointer self)
{
	font_manager_collection_list_view_on_folder_selection_ready ((FontManagerCollectionListView*) self, source_object, res);
	g_object_unref (self);
}

static void
font_manager_collection_list_view_copy_to (FontManagerCollectionListView* self,
                                           GtkWidget* widget,
                                           const gchar* action,
                                           GVariant* parameter)
{
	FontManagerFontListFilter* _tmp0_;
	FontManagerFontListFilter* _tmp1_;
	GtkFileDialog* dialog = NULL;
	GtkFileDialog* _tmp2_;
	GtkWindow* _tmp3_;
	GtkWindow* _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (widget != NULL);
	_tmp0_ = font_manager_filter_list_view_get_selected_item ((FontManagerFilterListView*) self);
	_tmp1_ = _tmp0_;
	_vala_return_if_fail (_tmp1_ != NULL, "selected_item != null");
	_tmp2_ = font_manager_file_selector_get_target_directory ();
	dialog = _tmp2_;
	_tmp3_ = font_manager_get_parent_window ((GtkWidget*) self);
	_tmp4_ = _tmp3_;
	gtk_file_dialog_select_folder (dialog, _tmp4_, NULL, _font_manager_collection_list_view_on_folder_selection_ready_gasync_ready_callback, g_object_ref (self));
	_g_object_unref0 (_tmp4_);
	_g_object_unref0 (dialog);
	return;
}

void
font_manager_collection_list_view_add_new_collection (FontManagerCollectionListView* self)
{
	GtkListView* _tmp0_;
	GtkListView* _tmp1_;
	FontManagerFontListFilterModel* _tmp2_;
	FontManagerFontListFilterModel* _tmp3_;
	FontManagerCollection* _tmp4_;
	FontManagerCollection* _tmp5_;
	GtkListView* _tmp6_;
	FontManagerFontListFilterModel* _tmp7_;
	FontManagerFontListFilterModel* _tmp8_;
	GtkListView* _tmp9_;
	g_return_if_fail (self != NULL);
	font_manager_filter_list_view_collapse_all ((FontManagerFilterListView*) self);
	_tmp0_ = ((FontManagerFilterListView*) self)->listview;
	self->priv->clicked_area.x = gtk_widget_get_width ((GtkWidget*) _tmp0_) / 2;
	_tmp1_ = ((FontManagerFilterListView*) self)->listview;
	self->priv->clicked_area.y = gtk_widget_get_height ((GtkWidget*) _tmp1_) / 2;
	_tmp2_ = font_manager_filter_list_view_get_model ((FontManagerFilterListView*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = font_manager_collection_new (NULL, NULL);
	_tmp5_ = _tmp4_;
	font_manager_font_list_filter_model_add_item ((FontManagerFontListFilterModel*) G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, FONT_MANAGER_TYPE_COLLECTION_LIST_MODEL, FontManagerCollectionListModel), (FontManagerFontListFilter*) _tmp5_);
	_g_object_unref0 (_tmp5_);
	_tmp6_ = ((FontManagerFilterListView*) self)->listview;
	_tmp7_ = font_manager_filter_list_view_get_model ((FontManagerFilterListView*) self);
	_tmp8_ = _tmp7_;
	gtk_list_view_scroll_to (_tmp6_, g_list_model_get_n_items ((GListModel*) _tmp8_) - 1, GTK_LIST_SCROLL_SELECT, NULL);
	_tmp9_ = ((FontManagerFilterListView*) self)->listview;
	font_manager_collection_list_view_rename_selected_collection (self, (GtkWidget*) _tmp9_, NULL, NULL);
	return;
}

void
font_manager_collection_list_view_remove_selected_collection (FontManagerCollectionListView* self)
{
	GtkTreeListRow* list_row = NULL;
	GtkTreeListModel* _tmp0_;
	GtkTreeListModel* _tmp1_;
	guint _tmp2_;
	guint _tmp3_;
	GObject* _tmp4_;
	FontManagerFontListFilterModel* target_model = NULL;
	FontManagerFontListFilterModel* _tmp5_;
	FontManagerFontListFilterModel* _tmp6_;
	FontManagerFontListFilterModel* _tmp7_;
	GtkTreeListRow* parent_row = NULL;
	GtkTreeListRow* _tmp8_;
	GtkTreeListRow* _tmp9_;
	GtkTreeListRow* _tmp10_;
	FontManagerFontListFilterModel* _tmp16_;
	FontManagerFontListFilter* _tmp17_;
	FontManagerFontListFilter* _tmp18_;
	GtkTreeListRow* _tmp19_;
	FontManagerFontListFilterModel* _tmp20_;
	g_return_if_fail (self != NULL);
	_tmp0_ = font_manager_filter_list_view_get_treemodel ((FontManagerFilterListView*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = font_manager_filter_list_view_get_selected_position ((FontManagerFilterListView*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_list_model_get_item ((GListModel*) _tmp1_, _tmp3_);
	list_row = G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_tree_list_row_get_type (), GtkTreeListRow);
	_tmp5_ = font_manager_filter_list_view_get_model ((FontManagerFilterListView*) self);
	_tmp6_ = _tmp5_;
	_tmp7_ = _g_object_ref0 (_tmp6_);
	target_model = _tmp7_;
	_tmp8_ = list_row;
	_tmp9_ = gtk_tree_list_row_get_parent (_tmp8_);
	parent_row = _tmp9_;
	_tmp10_ = parent_row;
	if (_tmp10_ != NULL) {
		GtkTreeListRow* _tmp11_;
		GListModel* _tmp12_;
		FontManagerFontListFilterModel* _tmp13_;
		_tmp11_ = parent_row;
		_tmp12_ = gtk_tree_list_row_get_children (_tmp11_);
		_tmp13_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, FONT_MANAGER_TYPE_FONT_LIST_FILTER_MODEL, FontManagerFontListFilterModel));
		_g_object_unref0 (target_model);
		target_model = _tmp13_;
	} else {
		GtkTreeListRow* _tmp14_;
		GtkTreeListRow* _tmp15_;
		_tmp14_ = list_row;
		_tmp15_ = _g_object_ref0 (_tmp14_);
		_g_object_unref0 (parent_row);
		parent_row = _tmp15_;
	}
	_tmp16_ = target_model;
	_tmp17_ = font_manager_filter_list_view_get_selected_item ((FontManagerFilterListView*) self);
	_tmp18_ = _tmp17_;
	font_manager_font_list_filter_model_remove_item (_tmp16_, _tmp18_);
	_tmp19_ = parent_row;
	_tmp20_ = target_model;
	gtk_tree_list_row_set_expanded (_tmp19_, g_list_model_get_n_items ((GListModel*) _tmp20_) != ((guint) 0));
	font_manager_collection_list_view_save (self);
	font_manager_collection_list_view_queue_update (self);
	_g_object_unref0 (parent_row);
	_g_object_unref0 (target_model);
	_g_object_unref0 (list_row);
	return;
}

static gboolean
__lambda67_ (FontManagerCollectionListView* self)
{
	gboolean result;
	font_manager_collection_list_view_save (self);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda67__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda67_ ((FontManagerCollectionListView*) self);
	return result;
}

static void
___lambda66_ (FontManagerCollectionListView* self,
              const gchar* new_name)
{
	gboolean _tmp0_ = FALSE;
	FontManagerFontListFilter* _tmp6_;
	FontManagerFontListFilter* _tmp7_;
	FontManagerFontListFilter* _tmp8_;
	FontManagerFontListFilter* _tmp9_;
	g_return_if_fail (new_name != NULL);
	if (g_strcmp0 (new_name, "") == 0) {
		_tmp0_ = TRUE;
	} else {
		FontManagerFontListFilter* _tmp1_;
		FontManagerFontListFilter* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		_tmp1_ = font_manager_filter_list_view_get_selected_item ((FontManagerFilterListView*) self);
		_tmp2_ = _tmp1_;
		_tmp3_ = font_manager_font_list_filter_get_name (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = _tmp4_;
		_tmp0_ = g_strcmp0 (new_name, _tmp5_) == 0;
		_g_free0 (_tmp5_);
	}
	if (_tmp0_) {
		return;
	}
	_tmp6_ = font_manager_filter_list_view_get_selected_item ((FontManagerFilterListView*) self);
	_tmp7_ = _tmp6_;
	font_manager_font_list_filter_set_name (_tmp7_, new_name);
	_tmp8_ = font_manager_filter_list_view_get_selected_item ((FontManagerFilterListView*) self);
	_tmp9_ = _tmp8_;
	g_signal_emit_by_name ((FontManagerCacheable*) _tmp9_, "changed");
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda67__gsource_func, g_object_ref (self), g_object_unref);
}

static void
____lambda66__font_manager_collection_rename_popover_renamed (FontManagerCollectionRenamePopover* _sender,
                                                              const gchar* new_name,
                                                              gpointer self)
{
	___lambda66_ ((FontManagerCollectionListView*) self, new_name);
}

static void
font_manager_collection_list_view_rename_selected_collection (FontManagerCollectionListView* self,
                                                              GtkWidget* widget,
                                                              const gchar* action,
                                                              GVariant* parameter)
{
	FontManagerFontListFilter* _tmp0_;
	FontManagerFontListFilter* _tmp1_;
	FontManagerCollectionRenamePopover* _tmp2_;
	FontManagerCollectionRenamePopover* _tmp7_;
	GtkEntry* _tmp8_;
	GtkEntry* _tmp9_;
	FontManagerFontListFilter* _tmp10_;
	FontManagerFontListFilter* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	FontManagerCollectionRenamePopover* _tmp15_;
	GdkRectangle _tmp16_;
	FontManagerCollectionRenamePopover* _tmp17_;
	FontManagerCollectionRenamePopover* _tmp18_;
	GtkEntry* _tmp19_;
	GtkEntry* _tmp20_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (widget != NULL);
	_tmp0_ = font_manager_filter_list_view_get_selected_item ((FontManagerFilterListView*) self);
	_tmp1_ = _tmp0_;
	_vala_return_if_fail (_tmp1_ != NULL, "selected_item != null");
	_tmp2_ = self->priv->rename_popover;
	if (_tmp2_ == NULL) {
		FontManagerCollectionRenamePopover* _tmp3_;
		FontManagerCollectionRenamePopover* _tmp4_;
		GtkListView* _tmp5_;
		FontManagerCollectionRenamePopover* _tmp6_;
		_tmp3_ = font_manager_collection_rename_popover_new ();
		g_object_ref_sink (_tmp3_);
		_g_object_unref0 (self->priv->rename_popover);
		self->priv->rename_popover = _tmp3_;
		_tmp4_ = self->priv->rename_popover;
		_tmp5_ = ((FontManagerFilterListView*) self)->listview;
		gtk_widget_set_parent ((GtkWidget*) _tmp4_, (GtkWidget*) _tmp5_);
		_tmp6_ = self->priv->rename_popover;
		g_signal_connect_object (_tmp6_, "renamed", (GCallback) ____lambda66__font_manager_collection_rename_popover_renamed, self, 0);
	}
	_tmp7_ = self->priv->rename_popover;
	_tmp8_ = font_manager_collection_rename_popover_get_name_entry (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = font_manager_filter_list_view_get_selected_item ((FontManagerFilterListView*) self);
	_tmp11_ = _tmp10_;
	_tmp12_ = font_manager_font_list_filter_get_name (_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = _tmp13_;
	gtk_editable_set_text ((GtkEditable*) _tmp9_, _tmp14_);
	_g_free0 (_tmp14_);
	_tmp15_ = self->priv->rename_popover;
	_tmp16_ = self->priv->clicked_area;
	gtk_popover_set_pointing_to ((GtkPopover*) _tmp15_, &_tmp16_);
	_tmp17_ = self->priv->rename_popover;
	gtk_popover_popup ((GtkPopover*) _tmp17_);
	_tmp18_ = self->priv->rename_popover;
	_tmp19_ = font_manager_collection_rename_popover_get_name_entry (_tmp18_);
	_tmp20_ = _tmp19_;
	gtk_widget_grab_focus ((GtkWidget*) _tmp20_);
	return;
}

static gboolean
_font_manager_collection_list_view_on_accept_drop_gtk_drop_target_accept (GtkDropTarget* _sender,
                                                                          GdkDrop* drop,
                                                                          gpointer self)
{
	gboolean result;
	result = font_manager_collection_list_view_on_accept_drop ((FontManagerCollectionListView*) self, _sender, drop);
	return result;
}

static gboolean
_font_manager_collection_list_view_on_drop_gtk_drop_target_drop (GtkDropTarget* _sender,
                                                                 GValue* value,
                                                                 gdouble x,
                                                                 gdouble y,
                                                                 gpointer self)
{
	gboolean result;
	result = font_manager_collection_list_view_on_drop ((FontManagerCollectionListView*) self, _sender, value, x, y);
	return result;
}

static void
font_manager_collection_list_view_add_drop_target (FontManagerCollectionListView* self,
                                                   GtkWidget* widget)
{
	GdkDragAction actions = 0U;
	GtkDropTarget* target = NULL;
	GtkDropTarget* _tmp0_;
	GType* _tmp1_;
	GType* _tmp2_;
	gint _tmp2__length1;
	GtkEventController* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (widget != NULL);
	actions = GDK_ACTION_COPY | GDK_ACTION_MOVE;
	_tmp0_ = gtk_drop_target_new (G_TYPE_INVALID, actions);
	target = _tmp0_;
	_tmp1_ = g_new0 (GType, 2);
	_tmp1_[0] = FONT_MANAGER_TYPE_FONT_LIST_FILTER;
	_tmp1_[1] = G_TYPE_PTR_ARRAY;
	_tmp2_ = _tmp1_;
	_tmp2__length1 = 2;
	gtk_drop_target_set_gtypes (target, _tmp2_, (gsize) 2);
	_tmp2_ = (g_free (_tmp2_), NULL);
	_tmp3_ = _g_object_ref0 ((GtkEventController*) target);
	gtk_widget_add_controller (widget, _tmp3_);
	g_signal_connect_object (target, "accept", (GCallback) _font_manager_collection_list_view_on_accept_drop_gtk_drop_target_accept, self, 0);
	g_signal_connect_object (target, "drop", (GCallback) _font_manager_collection_list_view_on_drop_gtk_drop_target_drop, self, 0);
	_g_object_unref0 (target);
	return;
}

static GdkContentProvider*
_font_manager_collection_list_view_on_prepare_drag_gtk_drag_source_prepare (GtkDragSource* _sender,
                                                                            gdouble x,
                                                                            gdouble y,
                                                                            gpointer self)
{
	GdkContentProvider* result;
	result = font_manager_collection_list_view_on_prepare_drag ((FontManagerCollectionListView*) self, _sender, x, y);
	return result;
}

static void
_font_manager_collection_list_view_on_drag_begin_gtk_drag_source_drag_begin (GtkDragSource* _sender,
                                                                             GdkDrag* drag,
                                                                             gpointer self)
{
	font_manager_collection_list_view_on_drag_begin ((FontManagerCollectionListView*) self, _sender, drag);
}

static void
_font_manager_collection_list_view_on_drag_end_gtk_drag_source_drag_end (GtkDragSource* _sender,
                                                                         GdkDrag* drag,
                                                                         gboolean delete_data,
                                                                         gpointer self)
{
	font_manager_collection_list_view_on_drag_end ((FontManagerCollectionListView*) self, _sender, drag, delete_data);
}

static void
font_manager_collection_list_view_add_drag_source (FontManagerCollectionListView* self,
                                                   FontManagerCollectionListRow* row)
{
	GtkDragSource* drag_source = NULL;
	GtkDragSource* _tmp0_;
	GtkEventController* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (row != NULL);
	_tmp0_ = gtk_drag_source_new ();
	drag_source = _tmp0_;
	_tmp1_ = _g_object_ref0 ((GtkEventController*) drag_source);
	gtk_widget_add_controller ((GtkWidget*) row, _tmp1_);
	g_signal_connect_object (drag_source, "prepare", (GCallback) _font_manager_collection_list_view_on_prepare_drag_gtk_drag_source_prepare, self, 0);
	g_signal_connect_object (drag_source, "drag-begin", (GCallback) _font_manager_collection_list_view_on_drag_begin_gtk_drag_source_drag_begin, self, 0);
	g_signal_connect_object (drag_source, "drag-end", (GCallback) _font_manager_collection_list_view_on_drag_end_gtk_drag_source_drag_end, self, 0);
	gtk_drag_source_set_actions (drag_source, GDK_ACTION_MOVE);
	_g_object_unref0 (drag_source);
	return;
}

static GdkContentProvider*
font_manager_collection_list_view_on_prepare_drag (FontManagerCollectionListView* self,
                                                   GtkDragSource* source,
                                                   gdouble x,
                                                   gdouble y)
{
	FontManagerCollectionListRow* row = NULL;
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	FontManagerCollectionListRow* _tmp2_;
	GValue selection = {0};
	GValue _tmp3_ = {0};
	GObject* _tmp4_;
	GObject* _tmp5_;
	GValue _tmp6_;
	GdkContentProvider* _tmp7_;
	GdkContentProvider* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (source != NULL, NULL);
	_tmp0_ = gtk_event_controller_get_widget ((GtkEventController*) source);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, FONT_MANAGER_TYPE_COLLECTION_LIST_ROW, FontManagerCollectionListRow));
	row = _tmp2_;
	g_value_init (&_tmp3_, FONT_MANAGER_TYPE_FONT_LIST_FILTER);
	selection = _tmp3_;
	_tmp4_ = font_manager_list_item_row_get_item ((FontManagerListItemRow*) row);
	_tmp5_ = _tmp4_;
	g_value_set_object (&selection, (GObject*) G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, FONT_MANAGER_TYPE_FONT_LIST_FILTER, FontManagerFontListFilter));
	_tmp6_ = selection;
	_tmp7_ = gdk_content_provider_new_for_value (&_tmp6_);
	result = _tmp7_;
	G_IS_VALUE (&selection) ? (g_value_unset (&selection), NULL) : NULL;
	_g_object_unref0 (row);
	return result;
}

static void
font_manager_collection_list_view_on_drag_begin (FontManagerCollectionListView* self,
                                                 GtkDragSource* source,
                                                 GdkDrag* drag)
{
	FontManagerCollectionListRow* row = NULL;
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	FontManagerCollectionListRow* _tmp2_;
	GtkLabel* drag_icon = NULL;
	GtkLabel* _tmp3_;
	GtkLabel* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	GtkLabel* _tmp7_;
	GtkDragIcon* gtk_drag_icon = NULL;
	GtkWidget* _tmp8_;
	GtkDragIcon* _tmp9_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (source != NULL);
	g_return_if_fail (drag != NULL);
	_tmp0_ = gtk_event_controller_get_widget ((GtkEventController*) source);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, FONT_MANAGER_TYPE_COLLECTION_LIST_ROW, FontManagerCollectionListRow));
	row = _tmp2_;
	_tmp3_ = font_manager_list_item_row_get_item_label ((FontManagerListItemRow*) row);
	_tmp4_ = _tmp3_;
	_tmp5_ = gtk_label_get_label (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = (GtkLabel*) gtk_label_new (_tmp6_);
	g_object_ref_sink (_tmp7_);
	drag_icon = _tmp7_;
	gtk_widget_add_css_class ((GtkWidget*) drag_icon, "FontManagerListRowDrag");
	_tmp8_ = gtk_drag_icon_get_for_drag (drag);
	_tmp9_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_drag_icon_get_type (), GtkDragIcon));
	gtk_drag_icon = _tmp9_;
	gtk_drag_icon_set_child (gtk_drag_icon, (GtkWidget*) drag_icon);
	_g_object_unref0 (gtk_drag_icon);
	_g_object_unref0 (drag_icon);
	_g_object_unref0 (row);
	return;
}

static GtkTreeListRow*
font_manager_collection_list_view_get_list_row_for_widget (FontManagerCollectionListView* self,
                                                           GtkWidget* widget)
{
	GType e_type = 0UL;
	GtkTreeExpander* expander = NULL;
	GtkWidget* _tmp0_;
	GtkTreeExpander* _tmp1_;
	GtkTreeListRow* _tmp2_;
	GtkTreeListRow* _tmp3_;
	GtkTreeListRow* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (widget != NULL, NULL);
	e_type = gtk_tree_expander_get_type ();
	_tmp0_ = gtk_widget_get_ancestor (widget, e_type);
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_tree_expander_get_type (), GtkTreeExpander));
	expander = _tmp1_;
	_tmp2_ = gtk_tree_expander_get_list_row (expander);
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_tree_list_row_get_type (), GtkTreeListRow));
	result = _tmp3_;
	_g_object_unref0 (expander);
	return result;
}

static void
font_manager_collection_list_view_on_drag_end (FontManagerCollectionListView* self,
                                               GtkDragSource* source,
                                               GdkDrag* drag,
                                               gboolean delete_data)
{
	GtkTreeListRow* list_row = NULL;
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	GtkTreeListRow* _tmp2_;
	GtkTreeListRow* _tmp3_;
	FontManagerFontListFilterModel* target_model = NULL;
	FontManagerFontListFilterModel* _tmp4_;
	FontManagerFontListFilterModel* _tmp5_;
	FontManagerFontListFilterModel* _tmp6_;
	GtkTreeListRow* parent_row = NULL;
	GtkTreeListRow* _tmp7_;
	GtkTreeListRow* _tmp8_;
	FontManagerCollection* dropped_collection = NULL;
	GtkTreeListRow* _tmp21_;
	FontManagerFontListFilterModel* _tmp27_;
	FontManagerCollection* _tmp28_;
	GtkTreeListRow* _tmp29_;
	FontManagerFontListFilterModel* _tmp30_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (source != NULL);
	g_return_if_fail (drag != NULL);
	if (!delete_data) {
		return;
	}
	_tmp0_ = gtk_event_controller_get_widget ((GtkEventController*) source);
	_tmp1_ = _tmp0_;
	_tmp2_ = font_manager_collection_list_view_get_list_row_for_widget (self, _tmp1_);
	list_row = _tmp2_;
	_tmp3_ = list_row;
	g_return_if_fail (_tmp3_ != NULL);
	_tmp4_ = font_manager_filter_list_view_get_model ((FontManagerFilterListView*) self);
	_tmp5_ = _tmp4_;
	_tmp6_ = _g_object_ref0 (_tmp5_);
	target_model = _tmp6_;
	_tmp7_ = list_row;
	_tmp8_ = gtk_tree_list_row_get_parent (_tmp7_);
	parent_row = _tmp8_;
	dropped_collection = NULL;
	{
		GdkContentProvider* content = NULL;
		GdkContentProvider* _tmp9_;
		GdkContentProvider* _tmp10_;
		GdkContentProvider* _tmp11_;
		GValue val = {0};
		GValue _tmp12_ = {0};
		GdkContentProvider* _tmp13_;
		GObject* _tmp14_;
		FontManagerCollection* _tmp15_;
		_tmp9_ = gdk_drag_get_content (drag);
		_tmp10_ = _tmp9_;
		_tmp11_ = _g_object_ref0 (_tmp10_);
		content = _tmp11_;
		g_value_init (&_tmp12_, FONT_MANAGER_TYPE_FONT_LIST_FILTER);
		val = _tmp12_;
		_tmp13_ = content;
		gdk_content_provider_get_value (_tmp13_, &val, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			G_IS_VALUE (&val) ? (g_value_unset (&val), NULL) : NULL;
			_g_object_unref0 (content);
			goto __catch0_g_error;
		}
		_tmp14_ = g_value_get_object (&val);
		_tmp15_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, FONT_MANAGER_TYPE_COLLECTION, FontManagerCollection));
		_g_object_unref0 (dropped_collection);
		dropped_collection = _tmp15_;
		G_IS_VALUE (&val) ? (g_value_unset (&val), NULL) : NULL;
		_g_object_unref0 (content);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp16_;
		const gchar* _tmp17_;
		GtkTreeListRow* _tmp18_;
		GObject* _tmp19_;
		GObject* _tmp20_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp16_ = e;
		_tmp17_ = _tmp16_->message;
		g_warning ("Collections.vala:569: %s", _tmp17_);
		_tmp18_ = list_row;
		_tmp19_ = gtk_tree_list_row_get_item (_tmp18_);
		_tmp20_ = _tmp19_;
		_g_object_unref0 (dropped_collection);
		dropped_collection = G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, FONT_MANAGER_TYPE_COLLECTION, FontManagerCollection);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (dropped_collection);
		_g_object_unref0 (parent_row);
		_g_object_unref0 (target_model);
		_g_object_unref0 (list_row);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_tmp21_ = parent_row;
	if (_tmp21_ != NULL) {
		GtkTreeListRow* _tmp22_;
		GListModel* _tmp23_;
		FontManagerFontListFilterModel* _tmp24_;
		_tmp22_ = parent_row;
		_tmp23_ = gtk_tree_list_row_get_children (_tmp22_);
		_tmp24_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, FONT_MANAGER_TYPE_FONT_LIST_FILTER_MODEL, FontManagerFontListFilterModel));
		_g_object_unref0 (target_model);
		target_model = _tmp24_;
	} else {
		GtkTreeListRow* _tmp25_;
		GtkTreeListRow* _tmp26_;
		_tmp25_ = list_row;
		_tmp26_ = _g_object_ref0 (_tmp25_);
		_g_object_unref0 (parent_row);
		parent_row = _tmp26_;
	}
	_tmp27_ = target_model;
	_tmp28_ = dropped_collection;
	font_manager_font_list_filter_model_remove_item (_tmp27_, (FontManagerFontListFilter*) _tmp28_);
	_tmp29_ = parent_row;
	_tmp30_ = target_model;
	gtk_tree_list_row_set_expanded (_tmp29_, g_list_model_get_n_items ((GListModel*) _tmp30_) != ((guint) 0));
	font_manager_collection_list_view_save (self);
	font_manager_collection_list_view_queue_update (self);
	_g_object_unref0 (dropped_collection);
	_g_object_unref0 (parent_row);
	_g_object_unref0 (target_model);
	_g_object_unref0 (list_row);
	return;
}

static GValue*
_g_value_dup (GValue* self)
{
	return g_boxed_copy (G_TYPE_VALUE, self);
}

static gpointer
__g_value_dup0 (gpointer self)
{
	return self ? _g_value_dup (self) : NULL;
}

static void
_vala_GValue_free (GValue* self)
{
	g_boxed_free (G_TYPE_VALUE, self);
}

static gboolean
font_manager_collection_list_view_on_accept_drop (FontManagerCollectionListView* self,
                                                  GtkDropTarget* target,
                                                  GdkDrop* drop)
{
	GdkContentFormats* formats = NULL;
	GdkDrag* _tmp0_;
	GdkDrag* _tmp1_;
	GdkContentProvider* _tmp2_;
	GdkContentProvider* _tmp3_;
	GdkContentFormats* _tmp4_;
	GdkContentFormats* _tmp5_;
	GdkContentFormats* _tmp6_;
	GdkContentFormats* _tmp9_;
	FontManagerCollection* dropped_collection = NULL;
	GtkWidget* _tmp28_;
	GtkWidget* _tmp29_;
	gboolean _tmp51_ = FALSE;
	GtkWidget* _tmp52_;
	GtkWidget* _tmp53_;
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (target != NULL, FALSE);
	g_return_val_if_fail (drop != NULL, FALSE);
	_tmp0_ = gdk_drop_get_drag (drop);
	_tmp1_ = _tmp0_;
	_tmp2_ = gdk_drag_get_content (_tmp1_);
	_tmp3_ = _tmp2_;
	g_object_get (_tmp3_, "formats", &_tmp4_, NULL);
	_tmp5_ = _tmp4_;
	formats = _tmp5_;
	_tmp6_ = formats;
	if (gdk_content_formats_contain_gtype (_tmp6_, G_TYPE_PTR_ARRAY)) {
		GtkWidget* _tmp7_;
		GtkWidget* _tmp8_;
		_tmp7_ = gtk_event_controller_get_widget ((GtkEventController*) target);
		_tmp8_ = _tmp7_;
		result = FONT_MANAGER_IS_COLLECTION_LIST_ROW (_tmp8_);
		_gdk_content_formats_unref0 (formats);
		return result;
	}
	_tmp9_ = formats;
	if (!gdk_content_formats_contain_gtype (_tmp9_, FONT_MANAGER_TYPE_FONT_LIST_FILTER)) {
		result = FALSE;
		_gdk_content_formats_unref0 (formats);
		return result;
	}
	dropped_collection = NULL;
	{
		GdkContentProvider* content = NULL;
		GdkDrag* _tmp10_;
		GdkDrag* _tmp11_;
		GdkContentProvider* _tmp12_;
		GdkContentProvider* _tmp13_;
		GdkContentProvider* _tmp14_;
		GValue* val = NULL;
		GValue _tmp15_ = {0};
		GValue _tmp16_;
		GValue* _tmp17_;
		GValue* _tmp18_;
		GdkContentProvider* _tmp19_;
		GObject* object = NULL;
		GValue* _tmp20_;
		GObject* _tmp21_;
		GObject* _tmp22_;
		GObject* _tmp23_;
		FontManagerCollection* _tmp24_;
		_tmp10_ = gdk_drop_get_drag (drop);
		_tmp11_ = _tmp10_;
		_tmp12_ = gdk_drag_get_content (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = _g_object_ref0 (_tmp13_);
		content = _tmp14_;
		g_value_init (&_tmp15_, G_TYPE_OBJECT);
		_tmp16_ = _tmp15_;
		_tmp17_ = __g_value_dup0 (&_tmp16_);
		_tmp18_ = _tmp17_;
		G_IS_VALUE (&_tmp16_) ? (g_value_unset (&_tmp16_), NULL) : NULL;
		val = _tmp18_;
		_tmp19_ = content;
		gdk_content_provider_get_value (_tmp19_, val, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			__vala_GValue_free0 (val);
			_g_object_unref0 (content);
			goto __catch0_g_error;
		}
		_tmp20_ = val;
		_tmp21_ = g_value_get_object (_tmp20_);
		_tmp22_ = _g_object_ref0 (_tmp21_);
		object = _tmp22_;
		_tmp23_ = object;
		_tmp24_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, FONT_MANAGER_TYPE_COLLECTION, FontManagerCollection));
		_g_object_unref0 (dropped_collection);
		dropped_collection = _tmp24_;
		_g_object_unref0 (object);
		__vala_GValue_free0 (val);
		_g_object_unref0 (content);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp25_;
		const gchar* _tmp26_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp25_ = e;
		_tmp26_ = _tmp25_->message;
		g_warning ("Collections.vala:598: %s", _tmp26_);
		result = FALSE;
		_g_error_free0 (e);
		_g_object_unref0 (dropped_collection);
		_gdk_content_formats_unref0 (formats);
		return result;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp27_ = FALSE;
		_g_object_unref0 (dropped_collection);
		_gdk_content_formats_unref0 (formats);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return _tmp27_;
	}
	_tmp28_ = gtk_event_controller_get_widget ((GtkEventController*) target);
	_tmp29_ = _tmp28_;
	if (FONT_MANAGER_IS_COLLECTION_LIST_ROW (_tmp29_)) {
		GtkTreeListRow* list_row = NULL;
		GtkWidget* _tmp30_;
		GtkWidget* _tmp31_;
		GtkTreeListRow* _tmp32_;
		GtkTreeListRow* _tmp33_;
		FontManagerCollection* target_collection = NULL;
		GtkTreeListRow* _tmp34_;
		GObject* _tmp35_;
		GObject* _tmp36_;
		FontManagerCollection* _tmp37_;
		FontManagerCollection* _tmp38_;
		GtkTreeListRow* parent_row = NULL;
		GtkTreeListRow* _tmp39_;
		GtkTreeListRow* _tmp40_;
		FontManagerCollection* _tmp49_;
		FontManagerCollection* _tmp50_;
		_tmp30_ = gtk_event_controller_get_widget ((GtkEventController*) target);
		_tmp31_ = _tmp30_;
		_tmp32_ = font_manager_collection_list_view_get_list_row_for_widget (self, _tmp31_);
		list_row = _tmp32_;
		_tmp33_ = list_row;
		g_return_val_if_fail (_tmp33_ != NULL, FALSE);
		_tmp34_ = list_row;
		_tmp35_ = gtk_tree_list_row_get_item (_tmp34_);
		_tmp36_ = _tmp35_;
		target_collection = G_TYPE_CHECK_INSTANCE_CAST (_tmp36_, FONT_MANAGER_TYPE_COLLECTION, FontManagerCollection);
		_tmp37_ = target_collection;
		_tmp38_ = dropped_collection;
		if (_tmp37_ == _tmp38_) {
			result = FALSE;
			_g_object_unref0 (target_collection);
			_g_object_unref0 (list_row);
			_g_object_unref0 (dropped_collection);
			_gdk_content_formats_unref0 (formats);
			return result;
		}
		_tmp39_ = list_row;
		_tmp40_ = gtk_tree_list_row_get_parent (_tmp39_);
		parent_row = _tmp40_;
		while (TRUE) {
			GtkTreeListRow* _tmp41_;
			FontManagerCollection* parent = NULL;
			GtkTreeListRow* _tmp42_;
			GObject* _tmp43_;
			GObject* _tmp44_;
			FontManagerCollection* _tmp45_;
			FontManagerCollection* _tmp46_;
			GtkTreeListRow* _tmp47_;
			GtkTreeListRow* _tmp48_;
			_tmp41_ = parent_row;
			if (!(_tmp41_ != NULL)) {
				break;
			}
			_tmp42_ = parent_row;
			_tmp43_ = gtk_tree_list_row_get_item (_tmp42_);
			_tmp44_ = _tmp43_;
			parent = G_TYPE_CHECK_INSTANCE_CAST (_tmp44_, FONT_MANAGER_TYPE_COLLECTION, FontManagerCollection);
			_tmp45_ = dropped_collection;
			_tmp46_ = parent;
			if (_tmp45_ == _tmp46_) {
				result = FALSE;
				_g_object_unref0 (parent);
				_g_object_unref0 (parent_row);
				_g_object_unref0 (target_collection);
				_g_object_unref0 (list_row);
				_g_object_unref0 (dropped_collection);
				_gdk_content_formats_unref0 (formats);
				return result;
			}
			_tmp47_ = parent_row;
			_tmp48_ = gtk_tree_list_row_get_parent (_tmp47_);
			_g_object_unref0 (parent_row);
			parent_row = _tmp48_;
			_g_object_unref0 (parent);
		}
		_tmp49_ = target_collection;
		_tmp50_ = dropped_collection;
		if (font_manager_collection_contains (_tmp49_, _tmp50_)) {
			result = FALSE;
			_g_object_unref0 (parent_row);
			_g_object_unref0 (target_collection);
			_g_object_unref0 (list_row);
			_g_object_unref0 (dropped_collection);
			_gdk_content_formats_unref0 (formats);
			return result;
		}
		_g_object_unref0 (parent_row);
		_g_object_unref0 (target_collection);
		_g_object_unref0 (list_row);
	}
	_tmp52_ = gtk_event_controller_get_widget ((GtkEventController*) target);
	_tmp53_ = _tmp52_;
	if (FONT_MANAGER_IS_COLLECTION_LIST_ROW (_tmp53_)) {
		_tmp51_ = TRUE;
	} else {
		gboolean _tmp54_ = FALSE;
		gboolean _tmp55_ = FALSE;
		GtkWidget* _tmp56_;
		GtkWidget* _tmp57_;
		_tmp56_ = gtk_event_controller_get_widget ((GtkEventController*) target);
		_tmp57_ = _tmp56_;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp57_, gtk_list_view_get_type ())) {
			GtkWidget* _tmp58_;
			GtkWidget* _tmp59_;
			const gchar* _tmp60_;
			const gchar* _tmp61_;
			GtkListView* _tmp62_;
			const gchar* _tmp63_;
			const gchar* _tmp64_;
			_tmp58_ = gtk_event_controller_get_widget ((GtkEventController*) target);
			_tmp59_ = _tmp58_;
			_tmp60_ = gtk_widget_get_name (_tmp59_);
			_tmp61_ = _tmp60_;
			_tmp62_ = ((FontManagerFilterListView*) self)->listview;
			_tmp63_ = gtk_widget_get_name ((GtkWidget*) _tmp62_);
			_tmp64_ = _tmp63_;
			_tmp55_ = g_strcmp0 (_tmp61_, _tmp64_) == 0;
		} else {
			_tmp55_ = FALSE;
		}
		if (_tmp55_) {
			FontManagerCollection* _tmp65_;
			gint _tmp66_;
			gint _tmp67_;
			_tmp65_ = dropped_collection;
			_tmp66_ = font_manager_font_list_filter_get_depth ((FontManagerFontListFilter*) _tmp65_);
			_tmp67_ = _tmp66_;
			_tmp54_ = _tmp67_ > 0;
		} else {
			_tmp54_ = FALSE;
		}
		_tmp51_ = _tmp54_;
	}
	result = _tmp51_;
	_g_object_unref0 (dropped_collection);
	_gdk_content_formats_unref0 (formats);
	return result;
}

static gboolean
font_manager_collection_list_view_on_external_drop (FontManagerCollectionListView* self,
                                                    GtkDropTarget* target,
                                                    GValue* val,
                                                    gdouble x,
                                                    gdouble y)
{
	GPtrArray* objects = NULL;
	GValue _tmp0_;
	GPtrArray* _tmp1_;
	GtkTreeListRow* list_row = NULL;
	GtkWidget* _tmp2_;
	GtkWidget* _tmp3_;
	GtkTreeListRow* _tmp4_;
	GtkTreeListRow* _tmp5_;
	FontManagerCollection* collection = NULL;
	GtkTreeListRow* _tmp6_;
	GObject* _tmp7_;
	GObject* _tmp8_;
	FontManagerStringSet* new_families = NULL;
	FontManagerStringSet* _tmp9_;
	GPtrArray* _tmp10_;
	FontManagerCollection* _tmp18_;
	FontManagerStringSet* _tmp19_;
	FontManagerCollection* _tmp20_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (target != NULL, FALSE);
	g_return_val_if_fail (val != NULL, FALSE);
	_tmp0_ = *val;
	_tmp1_ = _g_ptr_array_ref0 (g_value_get_boxed (&_tmp0_));
	objects = _tmp1_;
	_tmp2_ = gtk_event_controller_get_widget ((GtkEventController*) target);
	_tmp3_ = _tmp2_;
	_tmp4_ = font_manager_collection_list_view_get_list_row_for_widget (self, _tmp3_);
	list_row = _tmp4_;
	_tmp5_ = list_row;
	g_return_val_if_fail (_tmp5_ != NULL, FALSE);
	_tmp6_ = list_row;
	_tmp7_ = gtk_tree_list_row_get_item (_tmp6_);
	_tmp8_ = _tmp7_;
	collection = G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, FONT_MANAGER_TYPE_COLLECTION, FontManagerCollection);
	_tmp9_ = font_manager_string_set_new ();
	new_families = _tmp9_;
	_tmp10_ = objects;
	{
		GPtrArray* object_collection = NULL;
		guint object_index = 0U;
		object_collection = _tmp10_;
		for (object_index = 0; object_index < object_collection->len; object_index = object_index + 1) {
			GObject* _tmp11_;
			GObject* object = NULL;
			_tmp11_ = _g_object_ref0 ((GObject*) g_ptr_array_index (object_collection, object_index));
			object = _tmp11_;
			{
				GObject* _tmp12_;
				_tmp12_ = object;
				if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp12_, font_manager_family_get_type ())) {
					FontManagerStringSet* _tmp13_;
					GObject* _tmp14_;
					gchar* _tmp15_;
					gchar* _tmp16_;
					gchar* _tmp17_;
					_tmp13_ = new_families;
					_tmp14_ = object;
					g_object_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, font_manager_family_get_type (), FontManagerFamily), "family", &_tmp15_, NULL);
					_tmp16_ = _tmp15_;
					_tmp17_ = _tmp16_;
					font_manager_string_set_add (_tmp13_, _tmp17_);
					_g_free0 (_tmp17_);
				}
				_g_object_unref0 (object);
			}
		}
	}
	_tmp18_ = collection;
	_tmp19_ = new_families;
	font_manager_collection_add (_tmp18_, _tmp19_);
	_tmp20_ = collection;
	font_manager_collection_queue_state_update (_tmp20_);
	g_signal_emit (self, font_manager_collection_list_view_signals[FONT_MANAGER_COLLECTION_LIST_VIEW_CHANGED_SIGNAL], 0);
	font_manager_collection_list_view_queue_update (self);
	font_manager_collection_list_view_save (self);
	result = TRUE;
	_g_object_unref0 (new_families);
	_g_object_unref0 (collection);
	_g_object_unref0 (list_row);
	_g_ptr_array_unref0 (objects);
	return result;
}

static gboolean
font_manager_collection_list_view_on_drop (FontManagerCollectionListView* self,
                                           GtkDropTarget* target,
                                           GValue* val,
                                           gdouble x,
                                           gdouble y)
{
	GtkWidget* widget = NULL;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	GtkWidget* _tmp3_;
	FontManagerCollection* filter = NULL;
	GObject* _tmp4_;
	FontManagerCollection* _tmp5_;
	FontManagerCollection* _tmp6_;
	FontManagerFontListFilterModel* target_model = NULL;
	FontManagerFontListFilterModel* _tmp7_;
	FontManagerFontListFilterModel* _tmp8_;
	FontManagerFontListFilterModel* _tmp9_;
	GtkWidget* _tmp10_;
	FontManagerFontListFilterModel* _tmp28_;
	FontManagerFontListFilterModel* _tmp29_;
	FontManagerCollection* _tmp30_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (target != NULL, FALSE);
	g_return_val_if_fail (val != NULL, FALSE);
	if (G_VALUE_HOLDS (val, G_TYPE_PTR_ARRAY)) {
		GValue _tmp0_;
		_tmp0_ = *val;
		result = font_manager_collection_list_view_on_external_drop (self, target, &_tmp0_, x, y);
		return result;
	}
	g_return_val_if_fail (G_VALUE_HOLDS (val, FONT_MANAGER_TYPE_FONT_LIST_FILTER), FALSE);
	_tmp1_ = gtk_event_controller_get_widget ((GtkEventController*) target);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	widget = _tmp3_;
	_tmp4_ = g_value_get_object (val);
	_tmp5_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, FONT_MANAGER_TYPE_COLLECTION, FontManagerCollection));
	filter = _tmp5_;
	_tmp6_ = filter;
	font_manager_font_list_filter_set_depth ((FontManagerFontListFilter*) _tmp6_, 0);
	_tmp7_ = font_manager_filter_list_view_get_model ((FontManagerFilterListView*) self);
	_tmp8_ = _tmp7_;
	_tmp9_ = _g_object_ref0 (_tmp8_);
	target_model = _tmp9_;
	_tmp10_ = widget;
	if (FONT_MANAGER_IS_COLLECTION_LIST_ROW (_tmp10_)) {
		GtkTreeListRow* list_row = NULL;
		GtkWidget* _tmp11_;
		GtkWidget* _tmp12_;
		GtkTreeListRow* _tmp13_;
		GtkTreeListRow* _tmp14_;
		FontManagerCollection* collection = NULL;
		GtkTreeListRow* _tmp15_;
		GObject* _tmp16_;
		GObject* _tmp17_;
		FontManagerCollection* _tmp18_;
		FontManagerCollection* _tmp19_;
		FontManagerCollection* _tmp20_;
		GtkTreeListRow* _tmp21_;
		GListModel* _tmp22_;
		FontManagerFontListFilterModel* _tmp23_;
		FontManagerCollection* _tmp24_;
		GtkTreeListRow* _tmp25_;
		guint _tmp26_;
		guint _tmp27_;
		_tmp11_ = gtk_event_controller_get_widget ((GtkEventController*) target);
		_tmp12_ = _tmp11_;
		_tmp13_ = font_manager_collection_list_view_get_list_row_for_widget (self, _tmp12_);
		list_row = _tmp13_;
		_tmp14_ = list_row;
		g_return_val_if_fail (_tmp14_ != NULL, FALSE);
		_tmp15_ = list_row;
		_tmp16_ = gtk_tree_list_row_get_item (_tmp15_);
		_tmp17_ = _tmp16_;
		collection = G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, FONT_MANAGER_TYPE_COLLECTION, FontManagerCollection);
		_tmp18_ = collection;
		g_return_val_if_fail (_tmp18_ != NULL, FALSE);
		_tmp19_ = collection;
		_tmp20_ = filter;
		if (font_manager_collection_contains (_tmp19_, _tmp20_)) {
			result = FALSE;
			_g_object_unref0 (collection);
			_g_object_unref0 (list_row);
			_g_object_unref0 (target_model);
			_g_object_unref0 (filter);
			_g_object_unref0 (widget);
			return result;
		}
		_tmp21_ = list_row;
		_tmp22_ = gtk_tree_list_row_get_children (_tmp21_);
		_tmp23_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, FONT_MANAGER_TYPE_FONT_LIST_FILTER_MODEL, FontManagerFontListFilterModel));
		_g_object_unref0 (target_model);
		target_model = _tmp23_;
		_tmp24_ = filter;
		_tmp25_ = list_row;
		_tmp26_ = gtk_tree_list_row_get_depth (_tmp25_);
		_tmp27_ = _tmp26_;
		font_manager_font_list_filter_set_depth ((FontManagerFontListFilter*) _tmp24_, ((gint) _tmp27_) + 1);
		_g_object_unref0 (collection);
		_g_object_unref0 (list_row);
	}
	_tmp28_ = target_model;
	if (_tmp28_ == NULL) {
		result = FALSE;
		_g_object_unref0 (target_model);
		_g_object_unref0 (filter);
		_g_object_unref0 (widget);
		return result;
	}
	_tmp29_ = target_model;
	_tmp30_ = filter;
	font_manager_collection_list_model_move_item (G_TYPE_CHECK_INSTANCE_CAST (_tmp29_, FONT_MANAGER_TYPE_COLLECTION_LIST_MODEL, FontManagerCollectionListModel), (FontManagerFontListFilter*) _tmp30_);
	result = TRUE;
	_g_object_unref0 (target_model);
	_g_object_unref0 (filter);
	_g_object_unref0 (widget);
	return result;
}

FontManagerCollectionListView*
font_manager_collection_list_view_construct (GType object_type)
{
	FontManagerCollectionListView * self = NULL;
	self = (FontManagerCollectionListView*) font_manager_filter_list_view_construct (object_type);
	return self;
}

FontManagerCollectionListView*
font_manager_collection_list_view_new (void)
{
	return font_manager_collection_list_view_construct (FONT_MANAGER_TYPE_COLLECTION_LIST_VIEW);
}

FontManagerReject*
font_manager_collection_list_view_get_disabled_families (FontManagerCollectionListView* self)
{
	FontManagerReject* result;
	FontManagerReject* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_disabled_families;
	result = _tmp0_;
	return result;
}

void
font_manager_collection_list_view_set_disabled_families (FontManagerCollectionListView* self,
                                                         FontManagerReject* value)
{
	FontManagerReject* old_value;
	g_return_if_fail (self != NULL);
	old_value = font_manager_collection_list_view_get_disabled_families (self);
	if (old_value != value) {
		FontManagerReject* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_disabled_families);
		self->priv->_disabled_families = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, font_manager_collection_list_view_properties[FONT_MANAGER_COLLECTION_LIST_VIEW_DISABLED_FAMILIES_PROPERTY]);
	}
}

static GListModel*
_font_manager_collection_list_model_get_child_model_gtk_tree_list_model_create_model_func (GObject* item,
                                                                                           gpointer self)
{
	GListModel* result;
	result = font_manager_collection_list_model_get_child_model (item);
	return result;
}

static void
_font_manager_collection_list_view_update_context_menu_font_manager_filter_list_view_selection_changed (FontManagerFilterListView* _sender,
                                                                                                        FontManagerFontListFilter* item,
                                                                                                        gpointer self)
{
	font_manager_collection_list_view_update_context_menu ((FontManagerCollectionListView*) self);
}

static void
_font_manager_collection_list_view___lambda68_ (FontManagerCollectionListView* self)
{
	g_signal_emit (self, font_manager_collection_list_view_signals[FONT_MANAGER_COLLECTION_LIST_VIEW_CHANGED_SIGNAL], 0);
	font_manager_collection_list_view_queue_update (self);
}

static void
__font_manager_collection_list_view___lambda68__font_manager_collection_list_model_changed (FontManagerCollectionListModel* _sender,
                                                                                            gpointer self)
{
	_font_manager_collection_list_view___lambda68_ ((FontManagerCollectionListView*) self);
}

static void
_font_manager_collection_list_view_on_click_gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                                       gint n_press,
                                                                       gdouble x,
                                                                       gdouble y,
                                                                       gpointer self)
{
	font_manager_collection_list_view_on_click ((FontManagerCollectionListView*) self, n_press, x, y);
}

static void
___lambda70_ (FontManagerCollectionListView* self)
{
	FontManagerFontListFilter* _tmp0_;
	FontManagerFontListFilter* _tmp1_;
	_tmp0_ = font_manager_filter_list_view_get_selected_item ((FontManagerFilterListView*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		GtkTreeListModel* _tmp2_;
		GtkTreeListModel* _tmp3_;
		guint _tmp4_;
		guint _tmp5_;
		_tmp2_ = font_manager_filter_list_view_get_treemodel ((FontManagerFilterListView*) self);
		_tmp3_ = _tmp2_;
		_tmp4_ = font_manager_filter_list_view_get_selected_position ((FontManagerFilterListView*) self);
		_tmp5_ = _tmp4_;
		g_list_model_items_changed ((GListModel*) _tmp3_, _tmp5_, (guint) 0, (guint) 0);
	}
}

static void
____lambda70__font_manager_string_set_changed (FontManagerStringSet* _sender,
                                               gpointer self)
{
	___lambda70_ ((FontManagerCollectionListView*) self);
}

static void
_font_manager_collection_list_view___lambda69_ (FontManagerCollectionListView* self)
{
	FontManagerReject* _tmp0_;
	_tmp0_ = self->priv->_disabled_families;
	if (_tmp0_ != NULL) {
		FontManagerReject* _tmp1_;
		_tmp1_ = self->priv->_disabled_families;
		g_signal_connect_object ((FontManagerStringSet*) _tmp1_, "changed", (GCallback) ____lambda70__font_manager_string_set_changed, self, G_CONNECT_AFTER);
	}
}

static void
__font_manager_collection_list_view___lambda69__g_object_notify (GObject* _sender,
                                                                 GParamSpec* pspec,
                                                                 gpointer self)
{
	_font_manager_collection_list_view___lambda69_ ((FontManagerCollectionListView*) self);
}

static GObject *
font_manager_collection_list_view_constructor (GType type,
                                               guint n_construct_properties,
                                               GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	FontManagerCollectionListView * self;
	GtkListView* _tmp0_;
	FontManagerCollectionListModel* collection_model = NULL;
	FontManagerCollectionListModel* _tmp1_;
	FontManagerCollectionListModel* _tmp2_;
	GListModel* _tmp3_;
	GtkTreeListModel* _tmp4_;
	GtkTreeListModel* _tmp5_;
	GtkTreeListModel* _tmp6_;
	GtkTreeListModel* _tmp7_;
	GListModel* _tmp8_;
	GtkSingleSelection* _tmp9_;
	GtkSingleSelection* _tmp10_;
	GtkListView* _tmp11_;
	FontManagerCollectionListModel* _tmp12_;
	GtkGesture* click = NULL;
	GtkGestureClick* _tmp13_ = NULL;
	GtkGesture* _tmp14_;
	GtkListView* _tmp15_;
	GtkGesture* _tmp16_;
	GtkEventController* _tmp17_;
	GBindingFlags flags = 0U;
	FontManagerFontListFilterModel* _tmp18_;
	FontManagerFontListFilterModel* _tmp19_;
	GtkSingleSelection* _tmp20_;
	GtkSingleSelection* _tmp21_;
	parent_class = G_OBJECT_CLASS (font_manager_collection_list_view_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FONT_MANAGER_TYPE_COLLECTION_LIST_VIEW, FontManagerCollectionListView);
	_tmp0_ = ((FontManagerFilterListView*) self)->listview;
	font_manager_widget_set_name ((GtkWidget*) _tmp0_, "FontManagerCollectionListView");
	_tmp1_ = font_manager_collection_list_model_new ();
	collection_model = _tmp1_;
	_tmp2_ = collection_model;
	_tmp3_ = _g_object_ref0 ((GListModel*) _tmp2_);
	_tmp4_ = gtk_tree_list_model_new (_tmp3_, FALSE, TRUE, _font_manager_collection_list_model_get_child_model_gtk_tree_list_model_create_model_func, NULL, NULL);
	_tmp5_ = _tmp4_;
	font_manager_filter_list_view_set_treemodel ((FontManagerFilterListView*) self, _tmp5_);
	_g_object_unref0 (_tmp5_);
	_tmp6_ = font_manager_filter_list_view_get_treemodel ((FontManagerFilterListView*) self);
	_tmp7_ = _tmp6_;
	_tmp8_ = _g_object_ref0 ((GListModel*) _tmp7_);
	_tmp9_ = gtk_single_selection_new (_tmp8_);
	_tmp10_ = _tmp9_;
	font_manager_filter_list_view_set_selection ((FontManagerFilterListView*) self, _tmp10_);
	_g_object_unref0 (_tmp10_);
	_tmp11_ = ((FontManagerFilterListView*) self)->listview;
	font_manager_collection_list_view_add_drop_target (self, (GtkWidget*) _tmp11_);
	font_manager_collection_list_view_init_context_menu (self);
	g_signal_connect_object ((FontManagerFilterListView*) self, "selection-changed", (GCallback) _font_manager_collection_list_view_update_context_menu_font_manager_filter_list_view_selection_changed, self, G_CONNECT_AFTER);
	_tmp12_ = collection_model;
	g_signal_connect_object (_tmp12_, "changed", (GCallback) __font_manager_collection_list_view___lambda68__font_manager_collection_list_model_changed, self, 0);
	memset (&self->priv->clicked_area, 0, sizeof (GdkRectangle));
	_tmp13_ = (GtkGestureClick*) gtk_gesture_click_new ();
	gtk_gesture_single_set_button ((GtkGestureSingle*) _tmp13_, (guint) GDK_BUTTON_PRIMARY);
	click = (GtkGesture*) _tmp13_;
	_tmp14_ = click;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, gtk_gesture_click_get_type (), GtkGestureClick), "pressed", (GCallback) _font_manager_collection_list_view_on_click_gtk_gesture_click_pressed, self, 0);
	_tmp15_ = ((FontManagerFilterListView*) self)->listview;
	_tmp16_ = click;
	_tmp17_ = _g_object_ref0 ((GtkEventController*) _tmp16_);
	gtk_widget_add_controller ((GtkWidget*) _tmp15_, _tmp17_);
	flags = G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE;
	_tmp18_ = font_manager_filter_list_view_get_model ((FontManagerFilterListView*) self);
	_tmp19_ = _tmp18_;
	g_object_bind_property_with_closures ((GObject*) self, "disabled-families", (GObject*) _tmp19_, "disabled-families", flags, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp20_ = font_manager_filter_list_view_get_selection ((FontManagerFilterListView*) self);
	_tmp21_ = _tmp20_;
	gtk_single_selection_set_selected (_tmp21_, GTK_INVALID_LIST_POSITION);
	g_signal_connect_object ((GObject*) self, "notify::disabled-families", (GCallback) __font_manager_collection_list_view___lambda69__g_object_notify, self, G_CONNECT_AFTER);
	_g_object_unref0 (click);
	_g_object_unref0 (collection_model);
	return obj;
}

static void
font_manager_collection_list_view_class_init (FontManagerCollectionListViewClass * klass,
                                              gpointer klass_data)
{
	font_manager_collection_list_view_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FontManagerCollectionListView_private_offset);
	((FontManagerFilterListViewClass *) klass)->setup_list_row = (void (*) (FontManagerFilterListView*, GtkSignalListItemFactory*, GObject*)) font_manager_collection_list_view_real_setup_list_row;
	((FontManagerFilterListViewClass *) klass)->bind_list_row = (void (*) (FontManagerFilterListView*, GtkSignalListItemFactory*, GObject*)) font_manager_collection_list_view_real_bind_list_row;
	((FontManagerFilterListViewClass *) klass)->on_show_context_menu = (void (*) (FontManagerFilterListView*, gint, gdouble, gdouble)) font_manager_collection_list_view_real_on_show_context_menu;
	G_OBJECT_CLASS (klass)->get_property = _vala_font_manager_collection_list_view_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_font_manager_collection_list_view_set_property;
	G_OBJECT_CLASS (klass)->constructor = font_manager_collection_list_view_constructor;
	G_OBJECT_CLASS (klass)->finalize = font_manager_collection_list_view_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_COLLECTION_LIST_VIEW_DISABLED_FAMILIES_PROPERTY, font_manager_collection_list_view_properties[FONT_MANAGER_COLLECTION_LIST_VIEW_DISABLED_FAMILIES_PROPERTY] = g_param_spec_object ("disabled-families", "disabled-families", "disabled-families", font_manager_reject_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	font_manager_collection_list_view_signals[FONT_MANAGER_COLLECTION_LIST_VIEW_CHANGED_SIGNAL] = g_signal_new ("changed", FONT_MANAGER_TYPE_COLLECTION_LIST_VIEW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gtk_widget_class_install_action (GTK_WIDGET_CLASS (klass), "compress", NULL, (GtkWidgetActionActivateFunc) font_manager_collection_list_view_compress);
	gtk_widget_class_install_action (GTK_WIDGET_CLASS (klass), "copy_to", NULL, (GtkWidgetActionActivateFunc) font_manager_collection_list_view_copy_to);
	gtk_widget_class_install_action (GTK_WIDGET_CLASS (klass), "rename", NULL, (GtkWidgetActionActivateFunc) font_manager_collection_list_view_rename_selected_collection);
	gtk_widget_class_add_binding_action (GTK_WIDGET_CLASS (klass), GDK_KEY_F2, 0, "rename", NULL, NULL);
}

static void
font_manager_collection_list_view_instance_init (FontManagerCollectionListView * self,
                                                 gpointer klass)
{
	self->priv = font_manager_collection_list_view_get_instance_private (self);
	self->priv->_disabled_families = NULL;
	self->priv->update_timeout = (guint) 0;
	self->priv->rename_popover = NULL;
}

static void
font_manager_collection_list_view_finalize (GObject * obj)
{
	FontManagerCollectionListView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FONT_MANAGER_TYPE_COLLECTION_LIST_VIEW, FontManagerCollectionListView);
	_g_object_unref0 (self->priv->_disabled_families);
	_g_object_unref0 (self->priv->menu_title);
	_g_object_unref0 (self->priv->context_menu);
	_g_object_unref0 (self->priv->rename_popover);
	G_OBJECT_CLASS (font_manager_collection_list_view_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
font_manager_collection_list_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FontManagerCollectionListViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) font_manager_collection_list_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FontManagerCollectionListView), 0, (GInstanceInitFunc) font_manager_collection_list_view_instance_init, NULL };
	GType font_manager_collection_list_view_type_id;
	font_manager_collection_list_view_type_id = g_type_register_static (FONT_MANAGER_TYPE_FILTER_LIST_VIEW, "FontManagerCollectionListView", &g_define_type_info, 0);
	FontManagerCollectionListView_private_offset = g_type_add_instance_private (font_manager_collection_list_view_type_id, sizeof (FontManagerCollectionListViewPrivate));
	return font_manager_collection_list_view_type_id;
}

GType
font_manager_collection_list_view_get_type (void)
{
	static volatile gsize font_manager_collection_list_view_type_id__once = 0;
	if (g_once_init_enter (&font_manager_collection_list_view_type_id__once)) {
		GType font_manager_collection_list_view_type_id;
		font_manager_collection_list_view_type_id = font_manager_collection_list_view_get_type_once ();
		g_once_init_leave (&font_manager_collection_list_view_type_id__once, font_manager_collection_list_view_type_id);
	}
	return font_manager_collection_list_view_type_id__once;
}

static void
_vala_font_manager_collection_list_view_get_property (GObject * object,
                                                      guint property_id,
                                                      GValue * value,
                                                      GParamSpec * pspec)
{
	FontManagerCollectionListView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FONT_MANAGER_TYPE_COLLECTION_LIST_VIEW, FontManagerCollectionListView);
	switch (property_id) {
		case FONT_MANAGER_COLLECTION_LIST_VIEW_DISABLED_FAMILIES_PROPERTY:
		g_value_set_object (value, font_manager_collection_list_view_get_disabled_families (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_font_manager_collection_list_view_set_property (GObject * object,
                                                      guint property_id,
                                                      const GValue * value,
                                                      GParamSpec * pspec)
{
	FontManagerCollectionListView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FONT_MANAGER_TYPE_COLLECTION_LIST_VIEW, FontManagerCollectionListView);
	switch (property_id) {
		case FONT_MANAGER_COLLECTION_LIST_VIEW_DISABLED_FAMILIES_PROPERTY:
		font_manager_collection_list_view_set_disabled_families (self, g_value_get_object (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;
}

