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

/* Utils.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 <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#include "font-manager.h"
#include <gdk/gdk.h>
#include <float.h>
#include <math.h>
#include <sqlite3.h>
#include <json-glib/json-glib.h>
#include <pango/pango.h>
#include <glib/gi18n-lib.h>

#define FONT_MANAGER_SELECT_NON_LOCAL_FONTS "\n" \
"    SELECT DISTINCT description, Orthography.sample FROM Fonts\n" \
"    JOIN Orthography USING (filepath, findex)\n" \
"    WHERE Orthography.sample IS NOT NULL;\n" \
"    "
#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_MENU_ENTRY (font_manager_menu_entry_get_type ())
typedef struct _FontManagerMenuEntry FontManagerMenuEntry;
#define _g_free0(var) (var = (g_free (var), NULL))

#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;
typedef struct _FontManagerBaseContextMenuPrivate FontManagerBaseContextMenuPrivate;
enum  {
	FONT_MANAGER_BASE_CONTEXT_MENU_0_PROPERTY,
	FONT_MANAGER_BASE_CONTEXT_MENU_POPOVER_PROPERTY,
	FONT_MANAGER_BASE_CONTEXT_MENU_MENU_TITLE_PROPERTY,
	FONT_MANAGER_BASE_CONTEXT_MENU_MENU_PROPERTY,
	FONT_MANAGER_BASE_CONTEXT_MENU_NUM_PROPERTIES
};
static GParamSpec* font_manager_base_context_menu_properties[FONT_MANAGER_BASE_CONTEXT_MENU_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#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;
enum  {
	FONT_MANAGER_LIST_ITEM_ROW_0_PROPERTY,
	FONT_MANAGER_LIST_ITEM_ROW_ITEM_PROPERTY,
	FONT_MANAGER_LIST_ITEM_ROW_ITEM_LABEL_PROPERTY,
	FONT_MANAGER_LIST_ITEM_ROW_ITEM_COUNT_PROPERTY,
	FONT_MANAGER_LIST_ITEM_ROW_ITEM_ICON_PROPERTY,
	FONT_MANAGER_LIST_ITEM_ROW_ITEM_STATE_PROPERTY,
	FONT_MANAGER_LIST_ITEM_ROW_ITEM_PREVIEW_PROPERTY,
	FONT_MANAGER_LIST_ITEM_ROW_EDIT_LABEL_PROPERTY,
	FONT_MANAGER_LIST_ITEM_ROW_DRAG_AREA_PROPERTY,
	FONT_MANAGER_LIST_ITEM_ROW_DRAG_HANDLE_PROPERTY,
	FONT_MANAGER_LIST_ITEM_ROW_NUM_PROPERTIES
};
static GParamSpec* font_manager_list_item_row_properties[FONT_MANAGER_LIST_ITEM_ROW_NUM_PROPERTIES];
enum  {
	FONT_MANAGER_LIST_ITEM_ROW_ITEM_STATE_CHANGED_SIGNAL,
	FONT_MANAGER_LIST_ITEM_ROW_NUM_SIGNALS
};
static guint font_manager_list_item_row_signals[FONT_MANAGER_LIST_ITEM_ROW_NUM_SIGNALS] = {0};

#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;
enum  {
	FONT_MANAGER_TREE_LIST_ITEM_ROW_0_PROPERTY,
	FONT_MANAGER_TREE_LIST_ITEM_ROW_EXPANDER_PROPERTY,
	FONT_MANAGER_TREE_LIST_ITEM_ROW_SELECTION_PROPERTY,
	FONT_MANAGER_TREE_LIST_ITEM_ROW_NUM_PROPERTIES
};
static GParamSpec* font_manager_tree_list_item_row_properties[FONT_MANAGER_TREE_LIST_ITEM_ROW_NUM_PROPERTIES];
#define _gdk_event_unref0(var) ((var == NULL) ? NULL : (var = (gdk_event_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
typedef struct _Block14Data Block14Data;
typedef struct _Block15Data Block15Data;
#define _json_object_unref0(var) ((var == NULL) ? NULL : (var = (json_object_unref (var), NULL)))
#define _json_array_unref0(var) ((var == NULL) ? NULL : (var = (json_array_unref (var), NULL)))
typedef struct _Block16Data Block16Data;

#define FONT_MANAGER_TYPE_USER_SOURCE_MODEL (font_manager_user_source_model_get_type ())
#define FONT_MANAGER_USER_SOURCE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_USER_SOURCE_MODEL, FontManagerUserSourceModel))
#define FONT_MANAGER_USER_SOURCE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_USER_SOURCE_MODEL, FontManagerUserSourceModelClass))
#define FONT_MANAGER_IS_USER_SOURCE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_USER_SOURCE_MODEL))
#define FONT_MANAGER_IS_USER_SOURCE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_USER_SOURCE_MODEL))
#define FONT_MANAGER_USER_SOURCE_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_USER_SOURCE_MODEL, FontManagerUserSourceModelClass))

typedef struct _FontManagerUserSourceModel FontManagerUserSourceModel;
typedef struct _FontManagerUserSourceModelClass FontManagerUserSourceModelClass;

#define FONT_MANAGER_TYPE_PROGRESS_DIALOG (font_manager_progress_dialog_get_type ())
#define FONT_MANAGER_PROGRESS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_PROGRESS_DIALOG, FontManagerProgressDialog))
#define FONT_MANAGER_PROGRESS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_PROGRESS_DIALOG, FontManagerProgressDialogClass))
#define FONT_MANAGER_IS_PROGRESS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_PROGRESS_DIALOG))
#define FONT_MANAGER_IS_PROGRESS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_PROGRESS_DIALOG))
#define FONT_MANAGER_PROGRESS_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_PROGRESS_DIALOG, FontManagerProgressDialogClass))

typedef struct _FontManagerProgressDialog FontManagerProgressDialog;
typedef struct _FontManagerProgressDialogClass FontManagerProgressDialogClass;

#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_MAIN_WINDOW (font_manager_main_window_get_type ())
#define FONT_MANAGER_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_MAIN_WINDOW, FontManagerMainWindow))
#define FONT_MANAGER_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_MAIN_WINDOW, FontManagerMainWindowClass))
#define FONT_MANAGER_IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_MAIN_WINDOW))
#define FONT_MANAGER_IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_MAIN_WINDOW))
#define FONT_MANAGER_MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_MAIN_WINDOW, FontManagerMainWindowClass))

typedef struct _FontManagerMainWindow FontManagerMainWindow;
typedef struct _FontManagerMainWindowClass FontManagerMainWindowClass;
typedef struct _FontManagerCopyFilesData FontManagerCopyFilesData;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
#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 _FontManagerMenuEntry {
	gchar* action_name;
	gchar* display_name;
};

struct _FontManagerBaseContextMenu {
	GObject parent_instance;
	FontManagerBaseContextMenuPrivate * priv;
};

struct _FontManagerBaseContextMenuClass {
	GObjectClass parent_class;
};

struct _FontManagerBaseContextMenuPrivate {
	GtkPopoverMenu* _popover;
	GtkLabel* _menu_title;
	GMenu* _menu;
};

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

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

struct _FontManagerListItemRowPrivate {
	GObject* _item;
	GtkLabel* _item_label;
	GtkLabel* _item_count;
	GtkImage* _item_icon;
	GtkCheckButton* _item_state;
	GtkInscription* _item_preview;
	GtkEditableLabel* _edit_label;
	GtkBox* _drag_area;
	GtkImage* _drag_handle;
};

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 _FontManagerTreeListItemRowPrivate {
	GtkTreeExpander* _expander;
	GtkSelectionModel* _selection;
};

struct _Block14Data {
	int _ref_count_;
	GHashTable* samples;
};

struct _Block15Data {
	int _ref_count_;
	Block14Data * _data14_;
	gchar* description;
};

struct _Block16Data {
	int _ref_count_;
	gboolean res;
};

struct _FontManagerCopyFilesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	FontManagerStringSet* filelist;
	GFile* destination;
	gboolean show_progress;
	guint total;
	guint _tmp0_;
	guint _tmp1_;
	guint processed;
	FontManagerProgressDialog* progress;
	GtkWindow* parent;
	FontManagerApplication* _tmp2_;
	FontManagerApplication* _tmp3_;
	FontManagerMainWindow* _tmp4_;
	FontManagerMainWindow* _tmp5_;
	GtkWindow* _tmp6_;
	GtkWindow* _tmp7_;
	GtkWindow* _tmp8_;
	FontManagerProgressDialog* _tmp9_;
	FontManagerProgressDialog* _tmp10_;
	FontManagerStringSet* _filepath_list;
	guint _filepath_size;
	FontManagerStringSet* _tmp11_;
	guint _tmp12_;
	guint _tmp13_;
	gint _filepath_index;
	gint _tmp14_;
	guint _tmp15_;
	gchar* filepath;
	FontManagerStringSet* _tmp16_;
	const gchar* _tmp17_;
	gchar* _tmp18_;
	GFile* original;
	const gchar* _tmp19_;
	GFile* _tmp20_;
	gchar* filename;
	GFile* _tmp21_;
	gchar* _tmp22_;
	gchar* path;
	gchar* _tmp23_;
	gchar* _tmp24_;
	const gchar* _tmp25_;
	gchar* _tmp26_;
	gchar* _tmp27_;
	GFile* copy;
	const gchar* _tmp28_;
	GFile* _tmp29_;
	GFileCopyFlags flags;
	GFile* _tmp30_;
	GFile* _tmp31_;
	GError* e;
	GError* _tmp32_;
	const gchar* _tmp33_;
	FontManagerProgressDialog* _tmp34_;
	FontManagerProgressData* progress_data;
	const gchar* _tmp35_;
	guint _tmp36_;
	guint _tmp37_;
	FontManagerProgressData* _tmp38_;
	FontManagerProgressDialog* _tmp39_;
	FontManagerProgressData* _tmp40_;
	FontManagerProgressDialog* _tmp41_;
	FontManagerProgressDialog* _tmp42_;
	GError* _inner_error0_;
};

static gint FontManagerBaseContextMenu_private_offset;
static gpointer font_manager_base_context_menu_parent_class = NULL;
static gint FontManagerListItemRow_private_offset;
static gpointer font_manager_list_item_row_parent_class = NULL;
static gint FontManagerTreeListItemRow_private_offset;
static gpointer font_manager_tree_list_item_row_parent_class = NULL;

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)
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);
static void font_manager_base_context_menu_set_menu_title (FontManagerBaseContextMenu* self,
                                                    GtkLabel* value);
static void font_manager_base_context_menu_set_menu (FontManagerBaseContextMenu* self,
                                              GMenu* value);
VALA_EXTERN GMenu* font_manager_base_context_menu_get_menu (FontManagerBaseContextMenu* self);
static void font_manager_base_context_menu_set_popover (FontManagerBaseContextMenu* self,
                                                 GtkPopoverMenu* value);
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);
static void font_manager_base_context_menu_finalize (GObject * obj);
static GType font_manager_base_context_menu_get_type_once (void);
static void _vala_font_manager_base_context_menu_get_property (GObject * object,
                                                        guint property_id,
                                                        GValue * value,
                                                        GParamSpec * pspec);
static void _vala_font_manager_base_context_menu_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 void font_manager_list_item_row_on_item_set (FontManagerListItemRow* self);
VALA_EXTERN void font_manager_list_item_row_reset (FontManagerListItemRow* self);
static void font_manager_list_item_row_real_on_item_set (FontManagerListItemRow* self);
static void font_manager_list_item_row_real_reset (FontManagerListItemRow* self);
VALA_EXTERN FontManagerListItemRow* font_manager_list_item_row_new (void);
VALA_EXTERN FontManagerListItemRow* font_manager_list_item_row_construct (GType object_type);
VALA_EXTERN GObject* font_manager_list_item_row_get_item (FontManagerListItemRow* self);
VALA_EXTERN void font_manager_list_item_row_set_item (FontManagerListItemRow* self,
                                          GObject* value);
VALA_EXTERN GtkLabel* font_manager_list_item_row_get_item_label (FontManagerListItemRow* self);
VALA_EXTERN GtkLabel* font_manager_list_item_row_get_item_count (FontManagerListItemRow* self);
VALA_EXTERN GtkImage* font_manager_list_item_row_get_item_icon (FontManagerListItemRow* self);
VALA_EXTERN GtkCheckButton* font_manager_list_item_row_get_item_state (FontManagerListItemRow* self);
VALA_EXTERN GtkInscription* font_manager_list_item_row_get_item_preview (FontManagerListItemRow* self);
VALA_EXTERN GtkEditableLabel* font_manager_list_item_row_get_edit_label (FontManagerListItemRow* self);
VALA_EXTERN GtkBox* font_manager_list_item_row_get_drag_area (FontManagerListItemRow* self);
VALA_EXTERN GtkImage* font_manager_list_item_row_get_drag_handle (FontManagerListItemRow* self);
static GObject * font_manager_list_item_row_constructor (GType type,
                                                  guint n_construct_properties,
                                                  GObjectConstructParam * construct_properties);
static void _font_manager_list_item_row___lambda28_ (FontManagerListItemRow* self,
                                              GParamSpec* pspec);
static void __font_manager_list_item_row___lambda28__g_object_notify (GObject* _sender,
                                                               GParamSpec* pspec,
                                                               gpointer self);
static void _font_manager_list_item_row___lambda29_ (FontManagerListItemRow* self,
                                              GtkCheckButton* pspec);
static void __font_manager_list_item_row___lambda29__gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                        gpointer self);
static void font_manager_list_item_row_finalize (GObject * obj);
static GType font_manager_list_item_row_get_type_once (void);
static void _vala_font_manager_list_item_row_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec);
static void _vala_font_manager_list_item_row_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec);
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 void font_manager_tree_list_item_row_show_context_menu (FontManagerTreeListItemRow* self,
                                                        GdkEvent* event,
                                                        gdouble x,
                                                        gdouble y);
static void font_manager_tree_list_item_row_real_show_context_menu (FontManagerTreeListItemRow* self,
                                                             GdkEvent* event,
                                                             gdouble x,
                                                             gdouble y);
static void font_manager_tree_list_item_row_on_click (FontManagerTreeListItemRow* self,
                                               GtkGestureClick* click,
                                               gint n_press,
                                               gdouble x,
                                               gdouble y);
VALA_EXTERN GtkTreeExpander* font_manager_tree_list_item_row_get_expander (FontManagerTreeListItemRow* self);
VALA_EXTERN GtkSelectionModel* font_manager_tree_list_item_row_get_selection (FontManagerTreeListItemRow* self);
VALA_EXTERN FontManagerTreeListItemRow* font_manager_tree_list_item_row_new (void);
VALA_EXTERN FontManagerTreeListItemRow* font_manager_tree_list_item_row_construct (GType object_type);
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 GObject * font_manager_tree_list_item_row_constructor (GType type,
                                                       guint n_construct_properties,
                                                       GObjectConstructParam * construct_properties);
static void _font_manager_tree_list_item_row_on_click_gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                                          gint n_press,
                                                                          gdouble x,
                                                                          gdouble y,
                                                                          gpointer self);
static void font_manager_tree_list_item_row_finalize (GObject * obj);
static GType font_manager_tree_list_item_row_get_type_once (void);
static void _vala_font_manager_tree_list_item_row_get_property (GObject * object,
                                                         guint property_id,
                                                         GValue * value,
                                                         GParamSpec * pspec);
static void _vala_font_manager_tree_list_item_row_set_property (GObject * object,
                                                         guint property_id,
                                                         const GValue * value,
                                                         GParamSpec * pspec);
VALA_EXTERN GHashTable* font_manager_get_non_local_samples (void);
static void _g_free0_ (gpointer var);
VALA_EXTERN FontManagerDatabase* font_manager_database_proxy_get_default_db (void);
VALA_EXTERN void font_manager_update_item_preview_text (JsonArray* available_fonts);
static Block14Data* block14_data_ref (Block14Data* _data14_);
static void block14_data_unref (void * _userdata_);
static void __lambda206_ (Block14Data* _data14_,
                   JsonArray* array,
                   guint index,
                   JsonNode* node);
static Block15Data* block15_data_ref (Block15Data* _data15_);
static void block15_data_unref (void * _userdata_);
static void __lambda207_ (Block15Data* _data15_,
                   JsonArray* a,
                   guint i,
                   JsonNode* n);
static void ___lambda207__json_array_foreach (JsonArray* array,
                                       guint index_,
                                       JsonNode* element_node,
                                       gpointer self);
static void ___lambda206__json_array_foreach (JsonArray* array,
                                       guint index_,
                                       JsonNode* element_node,
                                       gpointer self);
VALA_EXTERN GtkImage* font_manager_inline_help_widget (const gchar* message);
VALA_EXTERN GtkWindow* font_manager_get_parent_window (GtkWidget* widget);
VALA_EXTERN void font_manager_set_control_sensitivity (GtkWidget* widget,
                                           gboolean sensitive);
VALA_EXTERN gboolean font_manager_load_user_font_resources (void);
static Block16Data* block16_data_ref (Block16Data* _data16_);
static void block16_data_unref (void * _userdata_);
VALA_EXTERN GType font_manager_user_source_model_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerUserSourceModel, g_object_unref)
VALA_EXTERN FontManagerUserSourceModel* font_manager_user_source_model_new (void);
VALA_EXTERN FontManagerUserSourceModel* font_manager_user_source_model_construct (GType object_type);
VALA_EXTERN void font_manager_user_source_model_reload (FontManagerUserSourceModel* self);
VALA_EXTERN GPtrArray* font_manager_user_source_model_get_items (FontManagerUserSourceModel* self);
static void __lambda58_ (Block16Data* _data16_,
                  FontManagerSource* source);
static void ___lambda58__gfunc (gconstpointer data,
                         gpointer self);
VALA_EXTERN JsonArray* font_manager_get_sorted_font_list (PangoContext* ctx);
VALA_EXTERN gboolean font_manager_remove_directory_tree_if_empty (GFile* dir);
VALA_EXTERN gboolean font_manager_remove_directory (GFile* dir,
                                        gboolean recursive);
static void font_manager_copy_files_data_free (gpointer _data);
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_);
static gboolean font_manager_copy_files_co (FontManagerCopyFilesData* _data_);
VALA_EXTERN GType font_manager_progress_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerProgressDialog, g_object_unref)
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);
VALA_EXTERN GType font_manager_main_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerMainWindow, g_object_unref)
VALA_EXTERN FontManagerMainWindow* font_manager_application_get_main_window (FontManagerApplication* self);
VALA_EXTERN FontManagerProgressDialog* font_manager_progress_dialog_new (GtkWindow* parent,
                                                             const gchar* title);
VALA_EXTERN FontManagerProgressDialog* font_manager_progress_dialog_construct (GType object_type,
                                                                   GtkWindow* parent,
                                                                   const gchar* title);
static gboolean _font_manager_copy_files_co_gsource_func (gpointer self);
VALA_EXTERN void font_manager_progress_dialog_update (FontManagerProgressDialog* self,
                                          FontManagerProgressData* data);
VALA_EXTERN gboolean font_manager_copy_directory (GFile* source,
                                      GFile* destination,
                                      GFileCopyFlags flags);
VALA_EXTERN gint64 font_manager_get_filelist_file_size (FontManagerStringSet* filelist);
VALA_EXTERN FontManagerStringSet* font_manager_get_command_line_input (GVariantDict* options);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

void
font_manager_menu_entry_copy (const FontManagerMenuEntry* self,
                              FontManagerMenuEntry* dest)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	_tmp0_ = (*self).action_name;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 ((*dest).action_name);
	(*dest).action_name = _tmp1_;
	_tmp2_ = (*self).display_name;
	_tmp3_ = g_strdup (_tmp2_);
	_g_free0 ((*dest).display_name);
	(*dest).display_name = _tmp3_;
}

void
font_manager_menu_entry_destroy (FontManagerMenuEntry* self)
{
	_g_free0 ((*self).action_name);
	_g_free0 ((*self).display_name);
}

FontManagerMenuEntry*
font_manager_menu_entry_dup (const FontManagerMenuEntry* self)
{
	FontManagerMenuEntry* dup;
	dup = g_new0 (FontManagerMenuEntry, 1);
	font_manager_menu_entry_copy (self, dup);
	return dup;
}

void
font_manager_menu_entry_free (FontManagerMenuEntry* self)
{
	font_manager_menu_entry_destroy (self);
	g_free (self);
}

 G_GNUC_NO_INLINE static GType
font_manager_menu_entry_get_type_once (void)
{
	GType font_manager_menu_entry_type_id;
	font_manager_menu_entry_type_id = g_boxed_type_register_static ("FontManagerMenuEntry", (GBoxedCopyFunc) font_manager_menu_entry_dup, (GBoxedFreeFunc) font_manager_menu_entry_free);
	return font_manager_menu_entry_type_id;
}

GType
font_manager_menu_entry_get_type (void)
{
	static volatile gsize font_manager_menu_entry_type_id__once = 0;
	if (g_once_init_enter (&font_manager_menu_entry_type_id__once)) {
		GType font_manager_menu_entry_type_id;
		font_manager_menu_entry_type_id = font_manager_menu_entry_get_type_once ();
		g_once_init_leave (&font_manager_menu_entry_type_id__once, font_manager_menu_entry_type_id);
	}
	return font_manager_menu_entry_type_id__once;
}

static inline gpointer
font_manager_base_context_menu_get_instance_private (FontManagerBaseContextMenu* self)
{
	return G_STRUCT_MEMBER_P (self, FontManagerBaseContextMenu_private_offset);
}

FontManagerBaseContextMenu*
font_manager_base_context_menu_construct (GType object_type,
                                          GtkWidget* parent)
{
	FontManagerBaseContextMenu * self = NULL;
	GMenu* root = NULL;
	GMenu* _tmp0_;
	GMenuItem* title_item = NULL;
	GMenuItem* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar** _tmp4_;
	GtkLabel* _tmp5_ = NULL;
	GtkLabel* _tmp6_;
	GMenu* _tmp7_;
	GMenu* _tmp8_;
	GMenu* _tmp9_;
	GtkPopoverMenu* _tmp10_;
	GtkPopoverMenu* _tmp11_;
	GtkPopoverMenu* _tmp12_;
	GtkPopoverMenu* _tmp13_;
	GtkLabel* _tmp14_;
	GtkPopoverMenu* _tmp15_;
	g_return_val_if_fail (parent != NULL, NULL);
	self = (FontManagerBaseContextMenu*) g_object_new (object_type, NULL);
	_tmp0_ = g_menu_new ();
	root = _tmp0_;
	_tmp1_ = g_menu_item_new (NULL, NULL);
	title_item = _tmp1_;
	g_menu_item_set_attribute (title_item, "custom", "s", "menu-title", NULL);
	_tmp2_ = g_strdup ("heading");
	_tmp3_ = g_strdup ("dim-label");
	_tmp4_ = g_new0 (gchar*, 2 + 1);
	_tmp4_[0] = _tmp2_;
	_tmp4_[1] = _tmp3_;
	_tmp5_ = (GtkLabel*) gtk_label_new ("");
	gtk_widget_set_margin_start ((GtkWidget*) _tmp5_, FONT_MANAGER_DEFAULT_MARGIN * 2);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp5_, FONT_MANAGER_DEFAULT_MARGIN * 2);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp5_, _tmp4_);
	_tmp4_ = (_vala_array_free (_tmp4_, 2, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp5_);
	_tmp6_ = _tmp5_;
	font_manager_base_context_menu_set_menu_title (self, _tmp6_);
	_g_object_unref0 (_tmp6_);
	g_menu_prepend_item (root, title_item);
	_tmp7_ = g_menu_new ();
	_tmp8_ = _tmp7_;
	font_manager_base_context_menu_set_menu (self, _tmp8_);
	_g_object_unref0 (_tmp8_);
	_tmp9_ = self->priv->_menu;
	g_menu_append_section (root, NULL, (GMenuModel*) _tmp9_);
	_tmp10_ = (GtkPopoverMenu*) gtk_popover_menu_new_from_model ((GMenuModel*) root);
	g_object_ref_sink (_tmp10_);
	_tmp11_ = _tmp10_;
	font_manager_base_context_menu_set_popover (self, _tmp11_);
	_g_object_unref0 (_tmp11_);
	_tmp12_ = self->priv->_popover;
	gtk_widget_set_parent ((GtkWidget*) _tmp12_, parent);
	_tmp13_ = self->priv->_popover;
	_tmp14_ = self->priv->_menu_title;
	gtk_popover_menu_add_child (_tmp13_, (GtkWidget*) _tmp14_, "menu-title");
	_tmp15_ = self->priv->_popover;
	gtk_popover_set_offset ((GtkPopover*) _tmp15_, 0, 6);
	_g_object_unref0 (title_item);
	_g_object_unref0 (root);
	return self;
	return self;
}

FontManagerBaseContextMenu*
font_manager_base_context_menu_new (GtkWidget* parent)
{
	return font_manager_base_context_menu_construct (FONT_MANAGER_TYPE_BASE_CONTEXT_MENU, parent);
}

GtkPopoverMenu*
font_manager_base_context_menu_get_popover (FontManagerBaseContextMenu* self)
{
	GtkPopoverMenu* result;
	GtkPopoverMenu* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_popover;
	result = _tmp0_;
	return result;
}

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

static void
font_manager_base_context_menu_set_popover (FontManagerBaseContextMenu* self,
                                            GtkPopoverMenu* value)
{
	GtkPopoverMenu* old_value;
	g_return_if_fail (self != NULL);
	old_value = font_manager_base_context_menu_get_popover (self);
	if (old_value != value) {
		GtkPopoverMenu* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_popover);
		self->priv->_popover = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, font_manager_base_context_menu_properties[FONT_MANAGER_BASE_CONTEXT_MENU_POPOVER_PROPERTY]);
	}
}

GtkLabel*
font_manager_base_context_menu_get_menu_title (FontManagerBaseContextMenu* self)
{
	GtkLabel* result;
	GtkLabel* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_menu_title;
	result = _tmp0_;
	return result;
}

static void
font_manager_base_context_menu_set_menu_title (FontManagerBaseContextMenu* self,
                                               GtkLabel* value)
{
	GtkLabel* old_value;
	g_return_if_fail (self != NULL);
	old_value = font_manager_base_context_menu_get_menu_title (self);
	if (old_value != value) {
		GtkLabel* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_menu_title);
		self->priv->_menu_title = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, font_manager_base_context_menu_properties[FONT_MANAGER_BASE_CONTEXT_MENU_MENU_TITLE_PROPERTY]);
	}
}

GMenu*
font_manager_base_context_menu_get_menu (FontManagerBaseContextMenu* self)
{
	GMenu* result;
	GMenu* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_menu;
	result = _tmp0_;
	return result;
}

static void
font_manager_base_context_menu_set_menu (FontManagerBaseContextMenu* self,
                                         GMenu* value)
{
	GMenu* old_value;
	g_return_if_fail (self != NULL);
	old_value = font_manager_base_context_menu_get_menu (self);
	if (old_value != value) {
		GMenu* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_menu);
		self->priv->_menu = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, font_manager_base_context_menu_properties[FONT_MANAGER_BASE_CONTEXT_MENU_MENU_PROPERTY]);
	}
}

static void
font_manager_base_context_menu_class_init (FontManagerBaseContextMenuClass * klass,
                                           gpointer klass_data)
{
	font_manager_base_context_menu_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FontManagerBaseContextMenu_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_font_manager_base_context_menu_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_font_manager_base_context_menu_set_property;
	G_OBJECT_CLASS (klass)->finalize = font_manager_base_context_menu_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_BASE_CONTEXT_MENU_POPOVER_PROPERTY, font_manager_base_context_menu_properties[FONT_MANAGER_BASE_CONTEXT_MENU_POPOVER_PROPERTY] = g_param_spec_object ("popover", "popover", "popover", gtk_popover_menu_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_BASE_CONTEXT_MENU_MENU_TITLE_PROPERTY, font_manager_base_context_menu_properties[FONT_MANAGER_BASE_CONTEXT_MENU_MENU_TITLE_PROPERTY] = g_param_spec_object ("menu-title", "menu-title", "menu-title", gtk_label_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_BASE_CONTEXT_MENU_MENU_PROPERTY, font_manager_base_context_menu_properties[FONT_MANAGER_BASE_CONTEXT_MENU_MENU_PROPERTY] = g_param_spec_object ("menu", "menu", "menu", g_menu_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
font_manager_base_context_menu_instance_init (FontManagerBaseContextMenu * self,
                                              gpointer klass)
{
	self->priv = font_manager_base_context_menu_get_instance_private (self);
}

static void
font_manager_base_context_menu_finalize (GObject * obj)
{
	FontManagerBaseContextMenu * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FONT_MANAGER_TYPE_BASE_CONTEXT_MENU, FontManagerBaseContextMenu);
	_g_object_unref0 (self->priv->_popover);
	_g_object_unref0 (self->priv->_menu_title);
	_g_object_unref0 (self->priv->_menu);
	G_OBJECT_CLASS (font_manager_base_context_menu_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
font_manager_base_context_menu_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FontManagerBaseContextMenuClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) font_manager_base_context_menu_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FontManagerBaseContextMenu), 0, (GInstanceInitFunc) font_manager_base_context_menu_instance_init, NULL };
	GType font_manager_base_context_menu_type_id;
	font_manager_base_context_menu_type_id = g_type_register_static (G_TYPE_OBJECT, "FontManagerBaseContextMenu", &g_define_type_info, 0);
	FontManagerBaseContextMenu_private_offset = g_type_add_instance_private (font_manager_base_context_menu_type_id, sizeof (FontManagerBaseContextMenuPrivate));
	return font_manager_base_context_menu_type_id;
}

GType
font_manager_base_context_menu_get_type (void)
{
	static volatile gsize font_manager_base_context_menu_type_id__once = 0;
	if (g_once_init_enter (&font_manager_base_context_menu_type_id__once)) {
		GType font_manager_base_context_menu_type_id;
		font_manager_base_context_menu_type_id = font_manager_base_context_menu_get_type_once ();
		g_once_init_leave (&font_manager_base_context_menu_type_id__once, font_manager_base_context_menu_type_id);
	}
	return font_manager_base_context_menu_type_id__once;
}

static void
_vala_font_manager_base_context_menu_get_property (GObject * object,
                                                   guint property_id,
                                                   GValue * value,
                                                   GParamSpec * pspec)
{
	FontManagerBaseContextMenu * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FONT_MANAGER_TYPE_BASE_CONTEXT_MENU, FontManagerBaseContextMenu);
	switch (property_id) {
		case FONT_MANAGER_BASE_CONTEXT_MENU_POPOVER_PROPERTY:
		g_value_set_object (value, font_manager_base_context_menu_get_popover (self));
		break;
		case FONT_MANAGER_BASE_CONTEXT_MENU_MENU_TITLE_PROPERTY:
		g_value_set_object (value, font_manager_base_context_menu_get_menu_title (self));
		break;
		case FONT_MANAGER_BASE_CONTEXT_MENU_MENU_PROPERTY:
		g_value_set_object (value, font_manager_base_context_menu_get_menu (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_font_manager_base_context_menu_set_property (GObject * object,
                                                   guint property_id,
                                                   const GValue * value,
                                                   GParamSpec * pspec)
{
	FontManagerBaseContextMenu * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FONT_MANAGER_TYPE_BASE_CONTEXT_MENU, FontManagerBaseContextMenu);
	switch (property_id) {
		case FONT_MANAGER_BASE_CONTEXT_MENU_POPOVER_PROPERTY:
		font_manager_base_context_menu_set_popover (self, g_value_get_object (value));
		break;
		case FONT_MANAGER_BASE_CONTEXT_MENU_MENU_TITLE_PROPERTY:
		font_manager_base_context_menu_set_menu_title (self, g_value_get_object (value));
		break;
		case FONT_MANAGER_BASE_CONTEXT_MENU_MENU_PROPERTY:
		font_manager_base_context_menu_set_menu (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
font_manager_list_item_row_get_instance_private (FontManagerListItemRow* self)
{
	return G_STRUCT_MEMBER_P (self, FontManagerListItemRow_private_offset);
}

static void
font_manager_list_item_row_real_on_item_set (FontManagerListItemRow* self)
{
}

void
font_manager_list_item_row_on_item_set (FontManagerListItemRow* self)
{
	FontManagerListItemRowClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = FONT_MANAGER_LIST_ITEM_ROW_GET_CLASS (self);
	if (_klass_->on_item_set) {
		_klass_->on_item_set (self);
	}
}

static void
font_manager_list_item_row_real_reset (FontManagerListItemRow* self)
{
}

void
font_manager_list_item_row_reset (FontManagerListItemRow* self)
{
	FontManagerListItemRowClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = FONT_MANAGER_LIST_ITEM_ROW_GET_CLASS (self);
	if (_klass_->reset) {
		_klass_->reset (self);
	}
}

FontManagerListItemRow*
font_manager_list_item_row_construct (GType object_type)
{
	FontManagerListItemRow * self = NULL;
	self = (FontManagerListItemRow*) g_object_new (object_type, NULL);
	return self;
}

FontManagerListItemRow*
font_manager_list_item_row_new (void)
{
	return font_manager_list_item_row_construct (FONT_MANAGER_TYPE_LIST_ITEM_ROW);
}

GObject*
font_manager_list_item_row_get_item (FontManagerListItemRow* self)
{
	GObject* result;
	GObject* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_item;
	result = _tmp0_;
	return result;
}

void
font_manager_list_item_row_set_item (FontManagerListItemRow* self,
                                     GObject* value)
{
	GObject* old_value;
	g_return_if_fail (self != NULL);
	old_value = font_manager_list_item_row_get_item (self);
	if (old_value != value) {
		GObject* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_item);
		self->priv->_item = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, font_manager_list_item_row_properties[FONT_MANAGER_LIST_ITEM_ROW_ITEM_PROPERTY]);
	}
}

GtkLabel*
font_manager_list_item_row_get_item_label (FontManagerListItemRow* self)
{
	GtkLabel* result;
	GtkLabel* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_item_label;
	result = _tmp0_;
	return result;
}

GtkLabel*
font_manager_list_item_row_get_item_count (FontManagerListItemRow* self)
{
	GtkLabel* result;
	GtkLabel* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_item_count;
	result = _tmp0_;
	return result;
}

GtkImage*
font_manager_list_item_row_get_item_icon (FontManagerListItemRow* self)
{
	GtkImage* result;
	GtkImage* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_item_icon;
	result = _tmp0_;
	return result;
}

GtkCheckButton*
font_manager_list_item_row_get_item_state (FontManagerListItemRow* self)
{
	GtkCheckButton* result;
	GtkCheckButton* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_item_state;
	result = _tmp0_;
	return result;
}

GtkInscription*
font_manager_list_item_row_get_item_preview (FontManagerListItemRow* self)
{
	GtkInscription* result;
	GtkInscription* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_item_preview;
	result = _tmp0_;
	return result;
}

GtkEditableLabel*
font_manager_list_item_row_get_edit_label (FontManagerListItemRow* self)
{
	GtkEditableLabel* result;
	GtkEditableLabel* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_edit_label;
	result = _tmp0_;
	return result;
}

GtkBox*
font_manager_list_item_row_get_drag_area (FontManagerListItemRow* self)
{
	GtkBox* result;
	GtkBox* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_drag_area;
	result = _tmp0_;
	return result;
}

GtkImage*
font_manager_list_item_row_get_drag_handle (FontManagerListItemRow* self)
{
	GtkImage* result;
	GtkImage* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_drag_handle;
	result = _tmp0_;
	return result;
}

static void
_font_manager_list_item_row___lambda28_ (FontManagerListItemRow* self,
                                         GParamSpec* pspec)
{
	g_return_if_fail (pspec != NULL);
	font_manager_list_item_row_on_item_set (self);
}

static void
__font_manager_list_item_row___lambda28__g_object_notify (GObject* _sender,
                                                          GParamSpec* pspec,
                                                          gpointer self)
{
	_font_manager_list_item_row___lambda28_ ((FontManagerListItemRow*) self, pspec);
}

static void
_font_manager_list_item_row___lambda29_ (FontManagerListItemRow* self,
                                         GtkCheckButton* pspec)
{
	GObject* _tmp0_;
	g_return_if_fail (pspec != NULL);
	_tmp0_ = self->priv->_item;
	g_signal_emit (self, font_manager_list_item_row_signals[FONT_MANAGER_LIST_ITEM_ROW_ITEM_STATE_CHANGED_SIGNAL], 0, _tmp0_);
}

static void
__font_manager_list_item_row___lambda29__gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                   gpointer self)
{
	_font_manager_list_item_row___lambda29_ ((FontManagerListItemRow*) self, _sender);
}

static GObject *
font_manager_list_item_row_constructor (GType type,
                                        guint n_construct_properties,
                                        GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	FontManagerListItemRow * self;
	GtkCheckButton* _tmp0_;
	parent_class = G_OBJECT_CLASS (font_manager_list_item_row_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FONT_MANAGER_TYPE_LIST_ITEM_ROW, FontManagerListItemRow);
	g_signal_connect_object ((GObject*) self, "notify::item", (GCallback) __font_manager_list_item_row___lambda28__g_object_notify, self, 0);
	_tmp0_ = self->priv->_item_state;
	g_signal_connect_object (_tmp0_, "toggled", (GCallback) __font_manager_list_item_row___lambda29__gtk_check_button_toggled, self, 0);
	return obj;
}

static void
font_manager_list_item_row_class_init (FontManagerListItemRowClass * klass,
                                       gpointer klass_data)
{
	font_manager_list_item_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FontManagerListItemRow_private_offset);
	((FontManagerListItemRowClass *) klass)->on_item_set = (void (*) (FontManagerListItemRow*)) font_manager_list_item_row_real_on_item_set;
	((FontManagerListItemRowClass *) klass)->reset = (void (*) (FontManagerListItemRow*)) font_manager_list_item_row_real_reset;
	G_OBJECT_CLASS (klass)->get_property = _vala_font_manager_list_item_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_font_manager_list_item_row_set_property;
	G_OBJECT_CLASS (klass)->constructor = font_manager_list_item_row_constructor;
	G_OBJECT_CLASS (klass)->finalize = font_manager_list_item_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_LIST_ITEM_ROW_ITEM_PROPERTY, font_manager_list_item_row_properties[FONT_MANAGER_LIST_ITEM_ROW_ITEM_PROPERTY] = g_param_spec_object ("item", "item", "item", G_TYPE_OBJECT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_LIST_ITEM_ROW_ITEM_LABEL_PROPERTY, font_manager_list_item_row_properties[FONT_MANAGER_LIST_ITEM_ROW_ITEM_LABEL_PROPERTY] = g_param_spec_object ("item-label", "item-label", "item-label", gtk_label_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_LIST_ITEM_ROW_ITEM_COUNT_PROPERTY, font_manager_list_item_row_properties[FONT_MANAGER_LIST_ITEM_ROW_ITEM_COUNT_PROPERTY] = g_param_spec_object ("item-count", "item-count", "item-count", gtk_label_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_LIST_ITEM_ROW_ITEM_ICON_PROPERTY, font_manager_list_item_row_properties[FONT_MANAGER_LIST_ITEM_ROW_ITEM_ICON_PROPERTY] = g_param_spec_object ("item-icon", "item-icon", "item-icon", gtk_image_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_LIST_ITEM_ROW_ITEM_STATE_PROPERTY, font_manager_list_item_row_properties[FONT_MANAGER_LIST_ITEM_ROW_ITEM_STATE_PROPERTY] = g_param_spec_object ("item-state", "item-state", "item-state", gtk_check_button_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_LIST_ITEM_ROW_ITEM_PREVIEW_PROPERTY, font_manager_list_item_row_properties[FONT_MANAGER_LIST_ITEM_ROW_ITEM_PREVIEW_PROPERTY] = g_param_spec_object ("item-preview", "item-preview", "item-preview", gtk_inscription_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_LIST_ITEM_ROW_EDIT_LABEL_PROPERTY, font_manager_list_item_row_properties[FONT_MANAGER_LIST_ITEM_ROW_EDIT_LABEL_PROPERTY] = g_param_spec_object ("edit-label", "edit-label", "edit-label", gtk_editable_label_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_LIST_ITEM_ROW_DRAG_AREA_PROPERTY, font_manager_list_item_row_properties[FONT_MANAGER_LIST_ITEM_ROW_DRAG_AREA_PROPERTY] = g_param_spec_object ("drag-area", "drag-area", "drag-area", gtk_box_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_LIST_ITEM_ROW_DRAG_HANDLE_PROPERTY, font_manager_list_item_row_properties[FONT_MANAGER_LIST_ITEM_ROW_DRAG_HANDLE_PROPERTY] = g_param_spec_object ("drag-handle", "drag-handle", "drag-handle", gtk_image_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-list-item-row.ui");
	font_manager_list_item_row_signals[FONT_MANAGER_LIST_ITEM_ROW_ITEM_STATE_CHANGED_SIGNAL] = g_signal_new ("item-state-changed", FONT_MANAGER_TYPE_LIST_ITEM_ROW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, G_TYPE_OBJECT);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "item_label", FALSE, FontManagerListItemRow_private_offset + G_STRUCT_OFFSET (FontManagerListItemRowPrivate, _item_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "item_count", FALSE, FontManagerListItemRow_private_offset + G_STRUCT_OFFSET (FontManagerListItemRowPrivate, _item_count));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "item_icon", FALSE, FontManagerListItemRow_private_offset + G_STRUCT_OFFSET (FontManagerListItemRowPrivate, _item_icon));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "item_state", FALSE, FontManagerListItemRow_private_offset + G_STRUCT_OFFSET (FontManagerListItemRowPrivate, _item_state));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "item_preview", FALSE, FontManagerListItemRow_private_offset + G_STRUCT_OFFSET (FontManagerListItemRowPrivate, _item_preview));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "edit_label", FALSE, FontManagerListItemRow_private_offset + G_STRUCT_OFFSET (FontManagerListItemRowPrivate, _edit_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "drag_area", FALSE, FontManagerListItemRow_private_offset + G_STRUCT_OFFSET (FontManagerListItemRowPrivate, _drag_area));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "drag_handle", FALSE, FontManagerListItemRow_private_offset + G_STRUCT_OFFSET (FontManagerListItemRowPrivate, _drag_handle));
}

static void
font_manager_list_item_row_instance_init (FontManagerListItemRow * self,
                                          gpointer klass)
{
	self->priv = font_manager_list_item_row_get_instance_private (self);
	self->priv->_item = NULL;
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
font_manager_list_item_row_finalize (GObject * obj)
{
	FontManagerListItemRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FONT_MANAGER_TYPE_LIST_ITEM_ROW, FontManagerListItemRow);
	_g_object_unref0 (self->priv->_item);
	G_OBJECT_CLASS (font_manager_list_item_row_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
font_manager_list_item_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FontManagerListItemRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) font_manager_list_item_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FontManagerListItemRow), 0, (GInstanceInitFunc) font_manager_list_item_row_instance_init, NULL };
	GType font_manager_list_item_row_type_id;
	font_manager_list_item_row_type_id = g_type_register_static (gtk_box_get_type (), "FontManagerListItemRow", &g_define_type_info, 0);
	FontManagerListItemRow_private_offset = g_type_add_instance_private (font_manager_list_item_row_type_id, sizeof (FontManagerListItemRowPrivate));
	return font_manager_list_item_row_type_id;
}

GType
font_manager_list_item_row_get_type (void)
{
	static volatile gsize font_manager_list_item_row_type_id__once = 0;
	if (g_once_init_enter (&font_manager_list_item_row_type_id__once)) {
		GType font_manager_list_item_row_type_id;
		font_manager_list_item_row_type_id = font_manager_list_item_row_get_type_once ();
		g_once_init_leave (&font_manager_list_item_row_type_id__once, font_manager_list_item_row_type_id);
	}
	return font_manager_list_item_row_type_id__once;
}

static void
_vala_font_manager_list_item_row_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec)
{
	FontManagerListItemRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FONT_MANAGER_TYPE_LIST_ITEM_ROW, FontManagerListItemRow);
	switch (property_id) {
		case FONT_MANAGER_LIST_ITEM_ROW_ITEM_PROPERTY:
		g_value_set_object (value, font_manager_list_item_row_get_item (self));
		break;
		case FONT_MANAGER_LIST_ITEM_ROW_ITEM_LABEL_PROPERTY:
		g_value_set_object (value, font_manager_list_item_row_get_item_label (self));
		break;
		case FONT_MANAGER_LIST_ITEM_ROW_ITEM_COUNT_PROPERTY:
		g_value_set_object (value, font_manager_list_item_row_get_item_count (self));
		break;
		case FONT_MANAGER_LIST_ITEM_ROW_ITEM_ICON_PROPERTY:
		g_value_set_object (value, font_manager_list_item_row_get_item_icon (self));
		break;
		case FONT_MANAGER_LIST_ITEM_ROW_ITEM_STATE_PROPERTY:
		g_value_set_object (value, font_manager_list_item_row_get_item_state (self));
		break;
		case FONT_MANAGER_LIST_ITEM_ROW_ITEM_PREVIEW_PROPERTY:
		g_value_set_object (value, font_manager_list_item_row_get_item_preview (self));
		break;
		case FONT_MANAGER_LIST_ITEM_ROW_EDIT_LABEL_PROPERTY:
		g_value_set_object (value, font_manager_list_item_row_get_edit_label (self));
		break;
		case FONT_MANAGER_LIST_ITEM_ROW_DRAG_AREA_PROPERTY:
		g_value_set_object (value, font_manager_list_item_row_get_drag_area (self));
		break;
		case FONT_MANAGER_LIST_ITEM_ROW_DRAG_HANDLE_PROPERTY:
		g_value_set_object (value, font_manager_list_item_row_get_drag_handle (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_font_manager_list_item_row_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec)
{
	FontManagerListItemRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FONT_MANAGER_TYPE_LIST_ITEM_ROW, FontManagerListItemRow);
	switch (property_id) {
		case FONT_MANAGER_LIST_ITEM_ROW_ITEM_PROPERTY:
		font_manager_list_item_row_set_item (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
font_manager_tree_list_item_row_get_instance_private (FontManagerTreeListItemRow* self)
{
	return G_STRUCT_MEMBER_P (self, FontManagerTreeListItemRow_private_offset);
}

static void
font_manager_tree_list_item_row_real_show_context_menu (FontManagerTreeListItemRow* self,
                                                        GdkEvent* event,
                                                        gdouble x,
                                                        gdouble y)
{
	g_return_if_fail (event != NULL);
}

void
font_manager_tree_list_item_row_show_context_menu (FontManagerTreeListItemRow* self,
                                                   GdkEvent* event,
                                                   gdouble x,
                                                   gdouble y)
{
	FontManagerTreeListItemRowClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = FONT_MANAGER_TREE_LIST_ITEM_ROW_GET_CLASS (self);
	if (_klass_->show_context_menu) {
		_klass_->show_context_menu (self, event, x, y);
	}
}

static gpointer
_gdk_event_ref0 (gpointer self)
{
	return self ? gdk_event_ref (self) : NULL;
}

static void
font_manager_tree_list_item_row_on_click (FontManagerTreeListItemRow* self,
                                          GtkGestureClick* click,
                                          gint n_press,
                                          gdouble x,
                                          gdouble y)
{
	gboolean _tmp0_ = FALSE;
	GtkTreeExpander* _tmp1_;
	GtkTreeListRow* row = NULL;
	GtkTreeExpander* _tmp3_;
	GtkTreeListRow* _tmp4_;
	GtkTreeListRow* _tmp5_;
	GtkTreeListRow* _tmp6_;
	guint position = 0U;
	GtkTreeListRow* _tmp7_;
	GtkSelectionModel* _tmp8_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (click != NULL);
	_tmp1_ = self->priv->_expander;
	if (_tmp1_ == NULL) {
		_tmp0_ = TRUE;
	} else {
		GtkSelectionModel* _tmp2_;
		_tmp2_ = self->priv->_selection;
		_tmp0_ = _tmp2_ == NULL;
	}
	if (_tmp0_) {
		return;
	}
	_tmp3_ = self->priv->_expander;
	_tmp4_ = gtk_tree_expander_get_list_row (_tmp3_);
	_tmp5_ = _g_object_ref0 (_tmp4_);
	row = _tmp5_;
	_tmp6_ = row;
	if (_tmp6_ == NULL) {
		_g_object_unref0 (row);
		return;
	}
	_tmp7_ = row;
	position = gtk_tree_list_row_get_position (_tmp7_);
	_tmp8_ = self->priv->_selection;
	if (gtk_selection_model_is_selected (_tmp8_, position)) {
		GtkEditableLabel* _tmp9_;
		GtkEditableLabel* _tmp10_;
		gboolean _tmp11_;
		gboolean _tmp12_;
		GdkEvent* event = NULL;
		GdkEvent* _tmp15_;
		GdkEvent* _tmp16_;
		GdkEvent* _tmp17_;
		GdkEvent* _tmp18_;
		gboolean expanded = FALSE;
		GtkTreeListRow* _tmp20_;
		gboolean _tmp21_;
		gboolean _tmp22_;
		GtkTreeListRow* _tmp23_;
		gboolean _tmp24_;
		gboolean _tmp25_;
		_tmp9_ = font_manager_list_item_row_get_edit_label ((FontManagerListItemRow*) self);
		_tmp10_ = _tmp9_;
		_tmp11_ = gtk_widget_get_visible ((GtkWidget*) _tmp10_);
		_tmp12_ = _tmp11_;
		if (_tmp12_) {
			GtkEditableLabel* _tmp13_;
			GtkEditableLabel* _tmp14_;
			_tmp13_ = font_manager_list_item_row_get_edit_label ((FontManagerListItemRow*) self);
			_tmp14_ = _tmp13_;
			gtk_editable_set_editable ((GtkEditable*) _tmp14_, TRUE);
		}
		_tmp15_ = gtk_event_controller_get_current_event ((GtkEventController*) click);
		_tmp16_ = _gdk_event_ref0 (_tmp15_);
		event = _tmp16_;
		_tmp17_ = event;
		if (_tmp17_ == NULL) {
			_gdk_event_unref0 (event);
			_g_object_unref0 (row);
			return;
		}
		_tmp18_ = event;
		if (gdk_event_triggers_context_menu (_tmp18_)) {
			GdkEvent* _tmp19_;
			_tmp19_ = event;
			font_manager_tree_list_item_row_show_context_menu (self, _tmp19_, x, y);
			_gdk_event_unref0 (event);
			_g_object_unref0 (row);
			return;
		}
		_tmp20_ = row;
		_tmp21_ = gtk_tree_list_row_get_expanded (_tmp20_);
		_tmp22_ = _tmp21_;
		expanded = _tmp22_;
		_tmp23_ = row;
		g_object_get (_tmp23_, "expandable", &_tmp24_, NULL);
		_tmp25_ = _tmp24_;
		if (_tmp25_) {
			GtkTreeListRow* _tmp26_;
			_tmp26_ = row;
			gtk_tree_list_row_set_expanded (_tmp26_, !expanded);
		}
		_gdk_event_unref0 (event);
	} else {
		GtkEditableLabel* _tmp27_;
		GtkEditableLabel* _tmp28_;
		_tmp27_ = font_manager_list_item_row_get_edit_label ((FontManagerListItemRow*) self);
		_tmp28_ = _tmp27_;
		gtk_editable_set_editable ((GtkEditable*) _tmp28_, FALSE);
	}
	_g_object_unref0 (row);
	return;
}

FontManagerTreeListItemRow*
font_manager_tree_list_item_row_construct (GType object_type)
{
	FontManagerTreeListItemRow * self = NULL;
	self = (FontManagerTreeListItemRow*) font_manager_list_item_row_construct (object_type);
	return self;
}

FontManagerTreeListItemRow*
font_manager_tree_list_item_row_new (void)
{
	return font_manager_tree_list_item_row_construct (FONT_MANAGER_TYPE_TREE_LIST_ITEM_ROW);
}

GtkTreeExpander*
font_manager_tree_list_item_row_get_expander (FontManagerTreeListItemRow* self)
{
	GtkTreeExpander* result;
	GtkTreeExpander* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_expander;
	result = _tmp0_;
	return result;
}

void
font_manager_tree_list_item_row_set_expander (FontManagerTreeListItemRow* self,
                                              GtkTreeExpander* value)
{
	GtkTreeExpander* old_value;
	g_return_if_fail (self != NULL);
	old_value = font_manager_tree_list_item_row_get_expander (self);
	if (old_value != value) {
		GtkTreeExpander* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_expander);
		self->priv->_expander = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, font_manager_tree_list_item_row_properties[FONT_MANAGER_TREE_LIST_ITEM_ROW_EXPANDER_PROPERTY]);
	}
}

GtkSelectionModel*
font_manager_tree_list_item_row_get_selection (FontManagerTreeListItemRow* self)
{
	GtkSelectionModel* result;
	GtkSelectionModel* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_selection;
	result = _tmp0_;
	return result;
}

void
font_manager_tree_list_item_row_set_selection (FontManagerTreeListItemRow* self,
                                               GtkSelectionModel* value)
{
	GtkSelectionModel* old_value;
	g_return_if_fail (self != NULL);
	old_value = font_manager_tree_list_item_row_get_selection (self);
	if (old_value != value) {
		GtkSelectionModel* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_selection);
		self->priv->_selection = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, font_manager_tree_list_item_row_properties[FONT_MANAGER_TREE_LIST_ITEM_ROW_SELECTION_PROPERTY]);
	}
}

static void
_font_manager_tree_list_item_row_on_click_gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                                     gint n_press,
                                                                     gdouble x,
                                                                     gdouble y,
                                                                     gpointer self)
{
	font_manager_tree_list_item_row_on_click ((FontManagerTreeListItemRow*) self, _sender, n_press, x, y);
}

static GObject *
font_manager_tree_list_item_row_constructor (GType type,
                                             guint n_construct_properties,
                                             GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	FontManagerTreeListItemRow * self;
	GtkGestureClick* click = NULL;
	GtkGestureClick* _tmp0_;
	GtkGestureClick* _tmp1_;
	GtkEventController* _tmp2_;
	GtkGestureClick* _tmp3_;
	parent_class = G_OBJECT_CLASS (font_manager_tree_list_item_row_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FONT_MANAGER_TYPE_TREE_LIST_ITEM_ROW, FontManagerTreeListItemRow);
	_tmp0_ = (GtkGestureClick*) gtk_gesture_click_new ();
	click = _tmp0_;
	_tmp1_ = click;
	_tmp2_ = _g_object_ref0 ((GtkEventController*) _tmp1_);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp2_);
	_tmp3_ = click;
	g_signal_connect_object (_tmp3_, "pressed", (GCallback) _font_manager_tree_list_item_row_on_click_gtk_gesture_click_pressed, self, 0);
	_g_object_unref0 (click);
	return obj;
}

static void
font_manager_tree_list_item_row_class_init (FontManagerTreeListItemRowClass * klass,
                                            gpointer klass_data)
{
	font_manager_tree_list_item_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FontManagerTreeListItemRow_private_offset);
	((FontManagerTreeListItemRowClass *) klass)->show_context_menu = (void (*) (FontManagerTreeListItemRow*, GdkEvent*, gdouble, gdouble)) font_manager_tree_list_item_row_real_show_context_menu;
	G_OBJECT_CLASS (klass)->get_property = _vala_font_manager_tree_list_item_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_font_manager_tree_list_item_row_set_property;
	G_OBJECT_CLASS (klass)->constructor = font_manager_tree_list_item_row_constructor;
	G_OBJECT_CLASS (klass)->finalize = font_manager_tree_list_item_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_TREE_LIST_ITEM_ROW_EXPANDER_PROPERTY, font_manager_tree_list_item_row_properties[FONT_MANAGER_TREE_LIST_ITEM_ROW_EXPANDER_PROPERTY] = g_param_spec_object ("expander", "expander", "expander", gtk_tree_expander_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_TREE_LIST_ITEM_ROW_SELECTION_PROPERTY, font_manager_tree_list_item_row_properties[FONT_MANAGER_TREE_LIST_ITEM_ROW_SELECTION_PROPERTY] = g_param_spec_object ("selection", "selection", "selection", gtk_selection_model_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
font_manager_tree_list_item_row_instance_init (FontManagerTreeListItemRow * self,
                                               gpointer klass)
{
	self->priv = font_manager_tree_list_item_row_get_instance_private (self);
	self->priv->_expander = NULL;
	self->priv->_selection = NULL;
}

static void
font_manager_tree_list_item_row_finalize (GObject * obj)
{
	FontManagerTreeListItemRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FONT_MANAGER_TYPE_TREE_LIST_ITEM_ROW, FontManagerTreeListItemRow);
	_g_object_unref0 (self->priv->_expander);
	_g_object_unref0 (self->priv->_selection);
	G_OBJECT_CLASS (font_manager_tree_list_item_row_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
font_manager_tree_list_item_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FontManagerTreeListItemRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) font_manager_tree_list_item_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FontManagerTreeListItemRow), 0, (GInstanceInitFunc) font_manager_tree_list_item_row_instance_init, NULL };
	GType font_manager_tree_list_item_row_type_id;
	font_manager_tree_list_item_row_type_id = g_type_register_static (FONT_MANAGER_TYPE_LIST_ITEM_ROW, "FontManagerTreeListItemRow", &g_define_type_info, 0);
	FontManagerTreeListItemRow_private_offset = g_type_add_instance_private (font_manager_tree_list_item_row_type_id, sizeof (FontManagerTreeListItemRowPrivate));
	return font_manager_tree_list_item_row_type_id;
}

GType
font_manager_tree_list_item_row_get_type (void)
{
	static volatile gsize font_manager_tree_list_item_row_type_id__once = 0;
	if (g_once_init_enter (&font_manager_tree_list_item_row_type_id__once)) {
		GType font_manager_tree_list_item_row_type_id;
		font_manager_tree_list_item_row_type_id = font_manager_tree_list_item_row_get_type_once ();
		g_once_init_leave (&font_manager_tree_list_item_row_type_id__once, font_manager_tree_list_item_row_type_id);
	}
	return font_manager_tree_list_item_row_type_id__once;
}

static void
_vala_font_manager_tree_list_item_row_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec)
{
	FontManagerTreeListItemRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FONT_MANAGER_TYPE_TREE_LIST_ITEM_ROW, FontManagerTreeListItemRow);
	switch (property_id) {
		case FONT_MANAGER_TREE_LIST_ITEM_ROW_EXPANDER_PROPERTY:
		g_value_set_object (value, font_manager_tree_list_item_row_get_expander (self));
		break;
		case FONT_MANAGER_TREE_LIST_ITEM_ROW_SELECTION_PROPERTY:
		g_value_set_object (value, font_manager_tree_list_item_row_get_selection (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_font_manager_tree_list_item_row_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec)
{
	FontManagerTreeListItemRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FONT_MANAGER_TYPE_TREE_LIST_ITEM_ROW, FontManagerTreeListItemRow);
	switch (property_id) {
		case FONT_MANAGER_TREE_LIST_ITEM_ROW_EXPANDER_PROPERTY:
		font_manager_tree_list_item_row_set_expander (self, g_value_get_object (value));
		break;
		case FONT_MANAGER_TREE_LIST_ITEM_ROW_SELECTION_PROPERTY:
		font_manager_tree_list_item_row_set_selection (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

GHashTable*
font_manager_get_non_local_samples (void)
{
	GHashTable* _result_ = NULL;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GHashTable* _tmp2_;
	GError* _inner_error0_ = NULL;
	GHashTable* result;
	_tmp0_ = g_str_hash;
	_tmp1_ = g_str_equal;
	_tmp2_ = g_hash_table_new_full (_tmp0_, _tmp1_, _g_free0_, _g_free0_);
	_result_ = _tmp2_;
	{
		FontManagerDatabase* db = NULL;
		FontManagerDatabase* _tmp3_;
		FontManagerDatabase* _tmp4_;
		FontManagerDatabase* _tmp24_;
		_tmp3_ = font_manager_database_proxy_get_default_db ();
		db = _tmp3_;
		_tmp4_ = db;
		font_manager_database_execute_query (_tmp4_, FONT_MANAGER_SELECT_NON_LOCAL_FONTS, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (db);
			goto __catch0_g_error;
		}
		{
			FontManagerDatabaseIterator* _row_it = NULL;
			FontManagerDatabase* _tmp5_;
			FontManagerDatabaseIterator* _tmp6_;
			_tmp5_ = db;
			_tmp6_ = font_manager_database_iterator (_tmp5_);
			_row_it = _tmp6_;
			while (TRUE) {
				FontManagerDatabaseIterator* _tmp7_;
				sqlite3_stmt* row = NULL;
				FontManagerDatabaseIterator* _tmp8_;
				sqlite3_stmt* _tmp9_;
				gchar* description = NULL;
				sqlite3_stmt* _tmp10_;
				const gchar* _tmp11_;
				gchar* _tmp12_;
				gchar* sample = NULL;
				sqlite3_stmt* _tmp13_;
				const gchar* _tmp14_;
				gchar* _tmp15_;
				gboolean _tmp16_ = FALSE;
				const gchar* _tmp17_;
				GHashTable* _tmp19_;
				const gchar* _tmp20_;
				gchar* _tmp21_;
				const gchar* _tmp22_;
				gchar* _tmp23_;
				_tmp7_ = _row_it;
				if (!font_manager_database_iterator_next (_tmp7_)) {
					break;
				}
				_tmp8_ = _row_it;
				_tmp9_ = font_manager_database_iterator_get (_tmp8_);
				row = _tmp9_;
				_tmp10_ = row;
				_tmp11_ = (const gchar*) sqlite3_column_text (_tmp10_, 0);
				_tmp12_ = g_strdup (_tmp11_);
				description = _tmp12_;
				_tmp13_ = row;
				_tmp14_ = (const gchar*) sqlite3_column_text (_tmp13_, 1);
				_tmp15_ = g_strdup (_tmp14_);
				sample = _tmp15_;
				_tmp17_ = description;
				if (_tmp17_ == NULL) {
					_tmp16_ = TRUE;
				} else {
					const gchar* _tmp18_;
					_tmp18_ = sample;
					_tmp16_ = _tmp18_ == NULL;
				}
				if (_tmp16_) {
					_g_free0 (sample);
					_g_free0 (description);
					continue;
				}
				_tmp19_ = _result_;
				_tmp20_ = description;
				_tmp21_ = g_strdup (_tmp20_);
				_tmp22_ = sample;
				_tmp23_ = g_strdup (_tmp22_);
				g_hash_table_insert (_tmp19_, _tmp21_, _tmp23_);
				_g_free0 (sample);
				_g_free0 (description);
			}
			_g_object_unref0 (_row_it);
		}
		_tmp24_ = db;
		font_manager_database_end_query (_tmp24_);
		_g_object_unref0 (db);
	}
	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_message ("Utils.vala:145: %s", _tmp26_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_hash_table_unref0 (_result_);
		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 NULL;
	}
	result = _result_;
	return result;
}

static Block14Data*
block14_data_ref (Block14Data* _data14_)
{
	g_atomic_int_inc (&_data14_->_ref_count_);
	return _data14_;
}

static void
block14_data_unref (void * _userdata_)
{
	Block14Data* _data14_;
	_data14_ = (Block14Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data14_->_ref_count_)) {
		_g_hash_table_unref0 (_data14_->samples);
		g_slice_free (Block14Data, _data14_);
	}
}

static Block15Data*
block15_data_ref (Block15Data* _data15_)
{
	g_atomic_int_inc (&_data15_->_ref_count_);
	return _data15_;
}

static void
block15_data_unref (void * _userdata_)
{
	Block15Data* _data15_;
	_data15_ = (Block15Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data15_->_ref_count_)) {
		_g_free0 (_data15_->description);
		block14_data_unref (_data15_->_data14_);
		_data15_->_data14_ = NULL;
		g_slice_free (Block15Data, _data15_);
	}
}

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

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

static void
__lambda207_ (Block15Data* _data15_,
              JsonArray* a,
              guint i,
              JsonNode* n)
{
	Block14Data* _data14_;
	JsonObject* v = NULL;
	JsonObject* _tmp0_;
	JsonObject* _tmp1_;
	JsonObject* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	const gchar* _tmp5_;
	_data14_ = _data15_->_data14_;
	g_return_if_fail (a != NULL);
	g_return_if_fail (n != NULL);
	_tmp0_ = json_node_get_object (n);
	_tmp1_ = _json_object_ref0 (_tmp0_);
	v = _tmp1_;
	_tmp2_ = v;
	_tmp3_ = json_object_get_string_member (_tmp2_, "description");
	_tmp4_ = g_strdup (_tmp3_);
	_g_free0 (_data15_->description);
	_data15_->description = _tmp4_;
	_tmp5_ = _data15_->description;
	if (g_hash_table_contains (_data14_->samples, _tmp5_)) {
		JsonObject* _tmp6_;
		const gchar* _tmp7_;
		gconstpointer _tmp8_;
		_tmp6_ = v;
		_tmp7_ = _data15_->description;
		_tmp8_ = g_hash_table_lookup (_data14_->samples, _tmp7_);
		json_object_set_string_member (_tmp6_, "preview-text", (const gchar*) _tmp8_);
	}
	_json_object_unref0 (v);
}

static void
___lambda207__json_array_foreach (JsonArray* array,
                                  guint index_,
                                  JsonNode* element_node,
                                  gpointer self)
{
	__lambda207_ (self, array, index_, element_node);
}

static void
__lambda206_ (Block14Data* _data14_,
              JsonArray* array,
              guint index,
              JsonNode* node)
{
	Block15Data* _data15_;
	JsonObject* item = NULL;
	JsonObject* _tmp0_;
	JsonObject* _tmp1_;
	JsonObject* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	const gchar* _tmp5_;
	JsonArray* variants = NULL;
	JsonObject* _tmp9_;
	JsonArray* _tmp10_;
	JsonArray* _tmp11_;
	g_return_if_fail (array != NULL);
	g_return_if_fail (node != NULL);
	_data15_ = g_slice_new0 (Block15Data);
	_data15_->_ref_count_ = 1;
	_data15_->_data14_ = block14_data_ref (_data14_);
	_tmp0_ = json_node_get_object (node);
	_tmp1_ = _json_object_ref0 (_tmp0_);
	item = _tmp1_;
	_tmp2_ = item;
	_tmp3_ = json_object_get_string_member (_tmp2_, "description");
	_tmp4_ = g_strdup (_tmp3_);
	_data15_->description = _tmp4_;
	_tmp5_ = _data15_->description;
	if (g_hash_table_contains (_data14_->samples, _tmp5_)) {
		JsonObject* _tmp6_;
		const gchar* _tmp7_;
		gconstpointer _tmp8_;
		_tmp6_ = item;
		_tmp7_ = _data15_->description;
		_tmp8_ = g_hash_table_lookup (_data14_->samples, _tmp7_);
		json_object_set_string_member (_tmp6_, "preview-text", (const gchar*) _tmp8_);
	}
	_tmp9_ = item;
	_tmp10_ = json_object_get_array_member (_tmp9_, "variations");
	_tmp11_ = _json_array_ref0 (_tmp10_);
	variants = _tmp11_;
	json_array_foreach_element (variants, ___lambda207__json_array_foreach, _data15_);
	_json_array_unref0 (variants);
	_json_object_unref0 (item);
	block15_data_unref (_data15_);
	_data15_ = NULL;
}

static void
___lambda206__json_array_foreach (JsonArray* array,
                                  guint index_,
                                  JsonNode* element_node,
                                  gpointer self)
{
	__lambda206_ (self, array, index_, element_node);
}

void
font_manager_update_item_preview_text (JsonArray* available_fonts)
{
	Block14Data* _data14_;
	GHashTable* _tmp0_;
	g_return_if_fail (available_fonts != NULL);
	_data14_ = g_slice_new0 (Block14Data);
	_data14_->_ref_count_ = 1;
	_tmp0_ = font_manager_get_non_local_samples ();
	_data14_->samples = _tmp0_;
	json_array_foreach_element (available_fonts, ___lambda206__json_array_foreach, _data14_);
	block14_data_unref (_data14_);
	_data14_ = NULL;
	return;
}

GtkImage*
font_manager_inline_help_widget (const gchar* message)
{
	GtkImage* help = NULL;
	gchar* _tmp0_;
	GtkImage* _tmp1_ = NULL;
	GtkImage* result;
	g_return_val_if_fail (message != NULL, NULL);
	_tmp0_ = g_strdup (message);
	_tmp1_ = (GtkImage*) gtk_image_new_from_icon_name ("dialog-question-symbolic");
	gtk_image_set_pixel_size (_tmp1_, 24);
	gtk_widget_set_opacity ((GtkWidget*) _tmp1_, 0.333);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp1_, TRUE);
	gtk_widget_set_halign ((GtkWidget*) _tmp1_, GTK_ALIGN_END);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp1_, FONT_MANAGER_DEFAULT_MARGIN);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp1_, FONT_MANAGER_DEFAULT_MARGIN);
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp1_, _tmp0_);
	_g_free0 (_tmp0_);
	g_object_ref_sink (_tmp1_);
	help = _tmp1_;
	result = help;
	return result;
}

GtkWindow*
font_manager_get_parent_window (GtkWidget* widget)
{
	GtkWidget* ancestor = NULL;
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWindow* _tmp2_ = NULL;
	GtkWidget* _tmp3_;
	GtkWindow* _tmp5_;
	GtkWindow* result;
	g_return_val_if_fail (widget != NULL, NULL);
	_tmp0_ = gtk_widget_get_ancestor (widget, gtk_window_get_type ());
	_tmp1_ = _g_object_ref0 (_tmp0_);
	ancestor = _tmp1_;
	_tmp3_ = ancestor;
	if (_tmp3_ != NULL) {
		GtkWidget* _tmp4_;
		_tmp4_ = ancestor;
		_tmp2_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_window_get_type (), GtkWindow);
	} else {
		_tmp2_ = NULL;
	}
	_tmp5_ = _g_object_ref0 (_tmp2_);
	result = _tmp5_;
	_g_object_unref0 (ancestor);
	return result;
}

void
font_manager_set_control_sensitivity (GtkWidget* widget,
                                      gboolean sensitive)
{
	gboolean _tmp0_ = FALSE;
	gdouble _tmp1_ = 0.0;
	if (widget == NULL) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = !G_TYPE_CHECK_INSTANCE_TYPE (widget, gtk_widget_get_type ());
	}
	if (_tmp0_) {
		return;
	}
	gtk_widget_set_sensitive (widget, sensitive);
	if (sensitive) {
		_tmp1_ = 0.9;
	} else {
		_tmp1_ = 0.45;
	}
	gtk_widget_set_opacity (widget, _tmp1_);
	gtk_widget_set_has_tooltip (widget, sensitive);
	return;
}

static Block16Data*
block16_data_ref (Block16Data* _data16_)
{
	g_atomic_int_inc (&_data16_->_ref_count_);
	return _data16_;
}

static void
block16_data_unref (void * _userdata_)
{
	Block16Data* _data16_;
	_data16_ = (Block16Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data16_->_ref_count_)) {
		g_slice_free (Block16Data, _data16_);
	}
}

static void
__lambda58_ (Block16Data* _data16_,
             FontManagerSource* source)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	g_return_if_fail (source != NULL);
	g_object_get (source, "available", &_tmp1_, NULL);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		gchar* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		g_object_get (source, "path", &_tmp3_, NULL);
		_tmp4_ = _tmp3_;
		_tmp5_ = _tmp4_;
		_tmp0_ = !font_manager_add_application_font_directory (_tmp5_);
		_g_free0 (_tmp5_);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gchar* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		_data16_->res = FALSE;
		g_object_get (source, "path", &_tmp6_, NULL);
		_tmp7_ = _tmp6_;
		_tmp8_ = _tmp7_;
		g_warning ("Utils.vala:215: Failed to register user font source! : %s", _tmp8_);
		_g_free0 (_tmp8_);
	}
	g_object_get (source, "path", &_tmp9_, NULL);
	_tmp10_ = _tmp9_;
	_tmp11_ = _tmp10_;
	g_debug ("Utils.vala:217: Loaded user font resource : %s", _tmp11_);
	_g_free0 (_tmp11_);
}

static void
___lambda58__gfunc (gconstpointer data,
                    gpointer self)
{
	__lambda58_ (self, (FontManagerSource*) data);
}

gboolean
font_manager_load_user_font_resources (void)
{
	Block16Data* _data16_;
	gchar* legacy_font_dir = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gboolean _tmp5_;
	FontManagerUserSourceModel* source_model = NULL;
	FontManagerUserSourceModel* _tmp6_;
	FontManagerUserSourceModel* _tmp7_;
	FontManagerUserSourceModel* _tmp8_;
	GPtrArray* _tmp9_;
	GPtrArray* _tmp10_;
	FontManagerReject* reject = NULL;
	FontManagerReject* _tmp11_;
	FontManagerStringSet* files = NULL;
	FontManagerStringSet* _tmp19_;
	GError* _inner_error0_ = NULL;
	gboolean result;
	_data16_ = g_slice_new0 (Block16Data);
	_data16_->_ref_count_ = 1;
	font_manager_clear_application_fonts ();
	_data16_->res = TRUE;
	_tmp0_ = g_get_home_dir ();
	_tmp1_ = g_build_filename (_tmp0_, ".fonts", NULL);
	legacy_font_dir = _tmp1_;
	_tmp2_ = legacy_font_dir;
	if (!font_manager_add_application_font_directory (_tmp2_)) {
		_data16_->res = FALSE;
		g_warning ("Utils.vala:204: Failed to add legacy user font directory to configurat" \
"ion!");
	}
	_tmp3_ = font_manager_get_user_font_directory ();
	_tmp4_ = _tmp3_;
	_tmp5_ = !font_manager_add_application_font_directory (_tmp4_);
	_g_free0 (_tmp4_);
	if (_tmp5_) {
		_data16_->res = FALSE;
		g_critical ("Utils.vala:208: Failed to add default user font directory to configura" \
"tion!");
	}
	_tmp6_ = font_manager_user_source_model_new ();
	source_model = _tmp6_;
	_tmp7_ = source_model;
	font_manager_user_source_model_reload (_tmp7_);
	_tmp8_ = source_model;
	_tmp9_ = font_manager_user_source_model_get_items (_tmp8_);
	_tmp10_ = _tmp9_;
	g_ptr_array_foreach (_tmp10_, ___lambda58__gfunc, _data16_);
	_g_object_unref0 (source_model);
	source_model = NULL;
	_tmp11_ = font_manager_reject_new ();
	reject = _tmp11_;
	font_manager_selections_load ((FontManagerSelections*) reject);
	files = NULL;
	{
		FontManagerDatabase* db = NULL;
		FontManagerDatabase* _tmp12_;
		FontManagerStringSet* _tmp13_ = NULL;
		FontManagerStringSet* _tmp14_;
		FontManagerStringSet* _tmp15_;
		_tmp12_ = font_manager_database_proxy_get_default_db ();
		db = _tmp12_;
		_tmp14_ = font_manager_reject_get_rejected_files (reject, db, &_inner_error0_);
		_tmp13_ = _tmp14_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (db);
			goto __catch0_g_error;
		}
		_tmp15_ = _tmp13_;
		_tmp13_ = NULL;
		_g_object_unref0 (files);
		files = _tmp15_;
		_g_object_unref0 (_tmp13_);
		_g_object_unref0 (db);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp16_;
		const gchar* _tmp17_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp16_ = e;
		_tmp17_ = _tmp16_->message;
		g_warning ("Utils.vala:227: %s", _tmp17_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp18_ = FALSE;
		_g_object_unref0 (files);
		_g_object_unref0 (reject);
		_g_object_unref0 (source_model);
		_g_free0 (legacy_font_dir);
		block16_data_unref (_data16_);
		_data16_ = 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 _tmp18_;
	}
	_tmp19_ = files;
	if (_tmp19_ != NULL) {
		{
			FontManagerStringSet* _path_list = NULL;
			FontManagerStringSet* _tmp20_;
			guint _path_size = 0U;
			FontManagerStringSet* _tmp21_;
			guint _tmp22_;
			guint _tmp23_;
			gint _path_index = 0;
			_tmp20_ = files;
			_path_list = _tmp20_;
			_tmp21_ = _path_list;
			g_object_get (_tmp21_, "size", &_tmp22_, NULL);
			_tmp23_ = _tmp22_;
			_path_size = _tmp23_;
			_path_index = -1;
			while (TRUE) {
				gint _tmp24_;
				guint _tmp25_;
				gchar* path = NULL;
				FontManagerStringSet* _tmp26_;
				const gchar* _tmp27_;
				gchar* _tmp28_;
				const gchar* _tmp29_;
				const gchar* _tmp30_;
				_path_index = _path_index + 1;
				_tmp24_ = _path_index;
				_tmp25_ = _path_size;
				if (!(((guint) _tmp24_) < _tmp25_)) {
					break;
				}
				_tmp26_ = _path_list;
				_tmp27_ = font_manager_string_set_get (_tmp26_, (guint) _path_index);
				_tmp28_ = g_strdup (_tmp27_);
				path = _tmp28_;
				_tmp29_ = path;
				font_manager_add_application_font (_tmp29_);
				_tmp30_ = path;
				g_debug ("Utils.vala:232: Added rejected path to application configuration :%s", _tmp30_);
				_g_free0 (path);
			}
		}
	}
	result = _data16_->res;
	_g_object_unref0 (files);
	_g_object_unref0 (reject);
	_g_object_unref0 (source_model);
	_g_free0 (legacy_font_dir);
	block16_data_unref (_data16_);
	_data16_ = NULL;
	return result;
}

JsonArray*
font_manager_get_sorted_font_list (PangoContext* ctx)
{
	JsonObject* fonts = NULL;
	JsonObject* _tmp0_;
	JsonArray* sorted_fonts = NULL;
	JsonArray* _tmp1_;
	JsonArray* result;
	font_manager_update_font_configuration ();
	if (font_manager_load_user_font_resources ()) {
		if (ctx != NULL) {
			font_manager_clear_pango_cache (ctx);
		}
	} else {
		g_critical ("Utils.vala:244: Failed to load user font resources, will be unable to " \
"render properly");
	}
	_tmp0_ = font_manager_get_available_fonts (NULL);
	fonts = _tmp0_;
	_tmp1_ = font_manager_sort_json_font_listing (fonts);
	sorted_fonts = _tmp1_;
	result = sorted_fonts;
	_json_object_unref0 (fonts);
	return result;
}

gboolean
font_manager_remove_directory_tree_if_empty (GFile* dir)
{
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (dir != NULL, FALSE);
	{
		GFileEnumerator* enumerator = NULL;
		GFileEnumerator* _tmp0_;
		GFileInfo* _tmp1_ = NULL;
		GFileEnumerator* _tmp2_;
		GFileInfo* _tmp3_;
		GFile* parent = NULL;
		GFile* _tmp4_;
		GFile* _tmp5_;
		_tmp0_ = g_file_enumerate_children (dir, G_FILE_ATTRIBUTE_STANDARD_NAME, G_FILE_QUERY_INFO_NONE, NULL, &_inner_error0_);
		enumerator = _tmp0_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp2_ = enumerator;
		_tmp3_ = g_file_enumerator_next_file (_tmp2_, NULL, &_inner_error0_);
		_tmp1_ = _tmp3_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (enumerator);
			goto __catch0_g_error;
		}
		if (_tmp1_ != NULL) {
			result = FALSE;
			_g_object_unref0 (_tmp1_);
			_g_object_unref0 (enumerator);
			return result;
		}
		_tmp4_ = g_file_get_parent (dir);
		parent = _tmp4_;
		g_file_delete (dir, NULL, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (parent);
			_g_object_unref0 (_tmp1_);
			_g_object_unref0 (enumerator);
			goto __catch0_g_error;
		}
		_tmp5_ = parent;
		if (_tmp5_ != NULL) {
			GFile* _tmp6_;
			_tmp6_ = parent;
			font_manager_remove_directory_tree_if_empty (_tmp6_);
		}
		result = TRUE;
		_g_object_unref0 (parent);
		_g_object_unref0 (_tmp1_);
		_g_object_unref0 (enumerator);
		return result;
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp7_;
		const gchar* _tmp8_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp7_ = e;
		_tmp8_ = _tmp7_->message;
		g_warning ("Utils.vala:262: %s", _tmp8_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp9_ = FALSE;
		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 _tmp9_;
	}
	result = FALSE;
	return result;
}

gboolean
font_manager_remove_directory (GFile* dir,
                               gboolean recursive)
{
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (dir != NULL, FALSE);
	{
		if (recursive) {
			GFileInfo* fileinfo = NULL;
			GFileEnumerator* enumerator = NULL;
			GFileEnumerator* _tmp0_;
			_tmp0_ = g_file_enumerate_children (dir, G_FILE_ATTRIBUTE_STANDARD_NAME, G_FILE_QUERY_INFO_NONE, NULL, &_inner_error0_);
			enumerator = _tmp0_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_object_unref0 (fileinfo);
				goto __catch0_g_error;
			}
			while (TRUE) {
				GFileInfo* _tmp1_ = NULL;
				GFileEnumerator* _tmp2_;
				GFileInfo* _tmp3_;
				GFileInfo* _tmp4_;
				GFileInfo* _tmp5_;
				_tmp2_ = enumerator;
				_tmp3_ = g_file_enumerator_next_file (_tmp2_, NULL, &_inner_error0_);
				_tmp1_ = _tmp3_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_g_object_unref0 (enumerator);
					_g_object_unref0 (fileinfo);
					goto __catch0_g_error;
				}
				_tmp4_ = _tmp1_;
				_tmp1_ = NULL;
				_g_object_unref0 (fileinfo);
				fileinfo = _tmp4_;
				_tmp5_ = fileinfo;
				if (!(_tmp5_ != NULL)) {
					_g_object_unref0 (_tmp1_);
					break;
				}
				{
					GFileInfo* _tmp6_;
					const gchar* _tmp7_;
					GFile* _tmp8_;
					GFile* _tmp9_;
					_tmp6_ = fileinfo;
					_tmp7_ = g_file_info_get_name (_tmp6_);
					_tmp8_ = g_file_get_child (dir, _tmp7_);
					_tmp9_ = _tmp8_;
					g_file_delete (_tmp9_, NULL, &_inner_error0_);
					_g_object_unref0 (_tmp9_);
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						goto __catch1_g_error;
					}
				}
				goto __finally1;
				__catch1_g_error:
				{
					GFileInfo* _tmp10_;
					const gchar* _tmp11_;
					GFile* _tmp12_;
					GFile* _tmp13_;
					g_clear_error (&_inner_error0_);
					_tmp10_ = fileinfo;
					_tmp11_ = g_file_info_get_name (_tmp10_);
					_tmp12_ = g_file_get_child (dir, _tmp11_);
					_tmp13_ = _tmp12_;
					font_manager_remove_directory (_tmp13_, recursive);
					_g_object_unref0 (_tmp13_);
				}
				__finally1:
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_g_object_unref0 (_tmp1_);
					_g_object_unref0 (enumerator);
					_g_object_unref0 (fileinfo);
					goto __catch0_g_error;
				}
				_g_object_unref0 (_tmp1_);
			}
			_g_object_unref0 (enumerator);
			_g_object_unref0 (fileinfo);
		}
		g_file_delete (dir, NULL, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		result = TRUE;
		return result;
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp14_;
		const gchar* _tmp15_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp14_ = e;
		_tmp15_ = _tmp14_->message;
		g_warning ("Utils.vala:283: %s", _tmp15_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp16_ = FALSE;
		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 _tmp16_;
	}
	result = FALSE;
	return result;
}

static void
font_manager_copy_files_data_free (gpointer _data)
{
	FontManagerCopyFilesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->filelist);
	_g_object_unref0 (_data_->destination);
	g_slice_free (FontManagerCopyFilesData, _data_);
}

void
font_manager_copy_files (FontManagerStringSet* filelist,
                         GFile* destination,
                         gboolean show_progress,
                         GAsyncReadyCallback _callback_,
                         gpointer _user_data_)
{
	FontManagerCopyFilesData* _data_;
	FontManagerStringSet* _tmp0_;
	GFile* _tmp1_;
	g_return_if_fail (filelist != NULL);
	g_return_if_fail (destination != NULL);
	_data_ = g_slice_new0 (FontManagerCopyFilesData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, font_manager_copy_files_data_free);
	_tmp0_ = _g_object_ref0 (filelist);
	_g_object_unref0 (_data_->filelist);
	_data_->filelist = _tmp0_;
	_tmp1_ = _g_object_ref0 (destination);
	_g_object_unref0 (_data_->destination);
	_data_->destination = _tmp1_;
	_data_->show_progress = show_progress;
	font_manager_copy_files_co (_data_);
}

void
font_manager_copy_files_finish (GAsyncResult* _res_)
{
	FontManagerCopyFilesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static gboolean
_font_manager_copy_files_co_gsource_func (gpointer self)
{
	gboolean result;
	result = font_manager_copy_files_co (self);
	return result;
}

static gboolean
font_manager_copy_files_co (FontManagerCopyFilesData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_vala_assert (g_file_query_file_type (_data_->destination, G_FILE_QUERY_INFO_NONE, NULL) == G_FILE_TYPE_DIRECTORY, "destination.query_file_type(FileQueryInfoFlags.NONE) == FileType.DIRECTORY");
	g_object_get (_data_->filelist, "size", &_data_->_tmp0_, NULL);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->total = _data_->_tmp1_;
	_data_->processed = (guint) 0;
	_data_->progress = NULL;
	if (_data_->show_progress) {
		_data_->_tmp2_ = font_manager_get_default_application ();
		_data_->_tmp3_ = _data_->_tmp2_;
		_data_->_tmp4_ = font_manager_application_get_main_window (_data_->_tmp3_);
		_data_->_tmp5_ = _data_->_tmp4_;
		_data_->_tmp6_ = _g_object_ref0 ((GtkWindow*) _data_->_tmp5_);
		_data_->_tmp7_ = _data_->_tmp6_;
		_g_object_unref0 (_data_->_tmp3_);
		_data_->parent = _data_->_tmp7_;
		_data_->_tmp8_ = _data_->parent;
		_data_->_tmp9_ = font_manager_progress_dialog_new (_data_->_tmp8_, _ ("Copying files…"));
		g_object_ref_sink (_data_->_tmp9_);
		_g_object_unref0 (_data_->progress);
		_data_->progress = _data_->_tmp9_;
		_data_->_tmp10_ = _data_->progress;
		gtk_window_present ((GtkWindow*) _data_->_tmp10_);
		_g_object_unref0 (_data_->parent);
	}
	{
		_data_->_filepath_list = _data_->filelist;
		_data_->_tmp11_ = _data_->_filepath_list;
		g_object_get (_data_->_tmp11_, "size", &_data_->_tmp12_, NULL);
		_data_->_tmp13_ = _data_->_tmp12_;
		_data_->_filepath_size = _data_->_tmp13_;
		_data_->_filepath_index = -1;
		while (TRUE) {
			_data_->_filepath_index = _data_->_filepath_index + 1;
			_data_->_tmp14_ = _data_->_filepath_index;
			_data_->_tmp15_ = _data_->_filepath_size;
			if (!(((guint) _data_->_tmp14_) < _data_->_tmp15_)) {
				break;
			}
			_data_->_tmp16_ = _data_->_filepath_list;
			_data_->_tmp17_ = font_manager_string_set_get (_data_->_tmp16_, (guint) _data_->_filepath_index);
			_data_->_tmp18_ = g_strdup (_data_->_tmp17_);
			_data_->filepath = _data_->_tmp18_;
			_data_->_tmp19_ = _data_->filepath;
			_data_->_tmp20_ = g_file_new_for_path (_data_->_tmp19_);
			_data_->original = _data_->_tmp20_;
			_data_->_tmp21_ = _data_->original;
			_data_->_tmp22_ = g_file_get_basename (_data_->_tmp21_);
			_data_->filename = _data_->_tmp22_;
			_data_->_tmp23_ = g_file_get_path (_data_->destination);
			_data_->_tmp24_ = _data_->_tmp23_;
			_data_->_tmp25_ = _data_->filename;
			_data_->_tmp26_ = g_build_filename (_data_->_tmp24_, _data_->_tmp25_, NULL);
			_data_->_tmp27_ = _data_->_tmp26_;
			_g_free0 (_data_->_tmp24_);
			_data_->path = _data_->_tmp27_;
			_data_->_tmp28_ = _data_->path;
			_data_->_tmp29_ = g_file_new_for_path (_data_->_tmp28_);
			_data_->copy = _data_->_tmp29_;
			{
				_data_->flags = (G_FILE_COPY_OVERWRITE | G_FILE_COPY_ALL_METADATA) | G_FILE_COPY_TARGET_DEFAULT_PERMS;
				_data_->_tmp30_ = _data_->original;
				_data_->_tmp31_ = _data_->copy;
				g_file_copy (_data_->_tmp30_, _data_->_tmp31_, _data_->flags, NULL, NULL, NULL, &_data_->_inner_error0_);
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					goto __catch0_g_error;
				}
			}
			goto __finally0;
			__catch0_g_error:
			{
				_data_->e = _data_->_inner_error0_;
				_data_->_inner_error0_ = NULL;
				_data_->_tmp32_ = _data_->e;
				_data_->_tmp33_ = _data_->_tmp32_->message;
				g_critical ("Utils.vala:309: %s", _data_->_tmp33_);
				_g_error_free0 (_data_->e);
			}
			__finally0:
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_object_unref0 (_data_->copy);
				_g_free0 (_data_->path);
				_g_free0 (_data_->filename);
				_g_object_unref0 (_data_->original);
				_g_free0 (_data_->filepath);
				_g_object_unref0 (_data_->progress);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
				g_clear_error (&_data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _font_manager_copy_files_co_gsource_func, _data_, NULL);
			_data_->_tmp34_ = _data_->progress;
			if (_data_->_tmp34_ != NULL) {
				_data_->_tmp35_ = _data_->filename;
				_data_->processed = _data_->processed + 1;
				_data_->_tmp36_ = _data_->processed;
				_data_->_tmp37_ = _data_->total;
				_data_->_tmp38_ = font_manager_progress_data_new (_data_->_tmp35_, _data_->_tmp36_, _data_->_tmp37_);
				_data_->progress_data = _data_->_tmp38_;
				_data_->_tmp39_ = _data_->progress;
				_data_->_tmp40_ = _data_->progress_data;
				font_manager_progress_dialog_update (_data_->_tmp39_, _data_->_tmp40_);
				_g_object_unref0 (_data_->progress_data);
			}
			_data_->_state_ = 1;
			return FALSE;
			_state_1:
			;
			_g_object_unref0 (_data_->copy);
			_g_free0 (_data_->path);
			_g_free0 (_data_->filename);
			_g_object_unref0 (_data_->original);
			_g_free0 (_data_->filepath);
		}
	}
	_data_->_tmp41_ = _data_->progress;
	if (_data_->_tmp41_ != NULL) {
		_data_->_tmp42_ = _data_->progress;
		gtk_window_destroy ((GtkWindow*) _data_->_tmp42_);
	}
	_g_object_unref0 (_data_->progress);
	_data_->progress = NULL;
	_g_object_unref0 (_data_->progress);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

gboolean
font_manager_copy_directory (GFile* source,
                             GFile* destination,
                             GFileCopyFlags flags)
{
	gboolean _result_ = FALSE;
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (source != NULL, FALSE);
	g_return_val_if_fail (destination != NULL, FALSE);
	g_return_val_if_fail (g_file_query_exists (source, NULL), FALSE);
	g_return_val_if_fail (g_file_query_file_type (source, G_FILE_QUERY_INFO_NONE, NULL) == G_FILE_TYPE_DIRECTORY, FALSE);
	_result_ = TRUE;
	{
		GFileEnumerator* enumerator = NULL;
		GFileEnumerator* _tmp0_;
		GFileInfo* fileinfo = NULL;
		GFileEnumerator* _tmp1_;
		GFileInfo* _tmp2_;
		if (!g_file_query_exists (destination, NULL)) {
			g_file_make_directory_with_parents (destination, NULL, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		}
		_tmp0_ = g_file_enumerate_children (source, G_FILE_ATTRIBUTE_STANDARD_NAME, G_FILE_QUERY_INFO_NONE, NULL, &_inner_error0_);
		enumerator = _tmp0_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp1_ = enumerator;
		_tmp2_ = g_file_enumerator_next_file (_tmp1_, NULL, &_inner_error0_);
		fileinfo = _tmp2_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (enumerator);
			goto __catch0_g_error;
		}
		while (TRUE) {
			gboolean _tmp3_ = FALSE;
			GFileType source_type = 0;
			GFileInfo* _tmp5_;
			gchar* name = NULL;
			GFileInfo* _tmp6_;
			const gchar* _tmp7_;
			gchar* _tmp8_;
			GFileInfo* _tmp37_ = NULL;
			GFileEnumerator* _tmp38_;
			GFileInfo* _tmp39_;
			GFileInfo* _tmp40_;
			if (_result_) {
				GFileInfo* _tmp4_;
				_tmp4_ = fileinfo;
				_tmp3_ = _tmp4_ != NULL;
			} else {
				_tmp3_ = FALSE;
			}
			if (!_tmp3_) {
				break;
			}
			_tmp5_ = fileinfo;
			source_type = g_file_info_get_file_type (_tmp5_);
			_tmp6_ = fileinfo;
			_tmp7_ = g_file_info_get_name (_tmp6_);
			_tmp8_ = g_strdup (_tmp7_);
			name = _tmp8_;
			if (source_type == G_FILE_TYPE_DIRECTORY) {
				gchar* source_path = NULL;
				gchar* _tmp9_;
				gchar* destination_path = NULL;
				gchar* _tmp10_;
				GFile* s = NULL;
				const gchar* _tmp11_;
				const gchar* _tmp12_;
				gchar* _tmp13_;
				gchar* _tmp14_;
				GFile* _tmp15_;
				GFile* _tmp16_;
				GFile* d = NULL;
				const gchar* _tmp17_;
				const gchar* _tmp18_;
				gchar* _tmp19_;
				gchar* _tmp20_;
				GFile* _tmp21_;
				GFile* _tmp22_;
				GFile* _tmp23_;
				GFile* _tmp24_;
				_tmp9_ = g_file_get_path (source);
				source_path = _tmp9_;
				_tmp10_ = g_file_get_path (destination);
				destination_path = _tmp10_;
				_tmp11_ = source_path;
				_tmp12_ = name;
				_tmp13_ = g_build_filename (_tmp11_, _tmp12_, NULL);
				_tmp14_ = _tmp13_;
				_tmp15_ = g_file_new_for_path (_tmp14_);
				_tmp16_ = _tmp15_;
				_g_free0 (_tmp14_);
				s = _tmp16_;
				_tmp17_ = destination_path;
				_tmp18_ = name;
				_tmp19_ = g_build_filename (_tmp17_, _tmp18_, NULL);
				_tmp20_ = _tmp19_;
				_tmp21_ = g_file_new_for_path (_tmp20_);
				_tmp22_ = _tmp21_;
				_g_free0 (_tmp20_);
				d = _tmp22_;
				_tmp23_ = s;
				_tmp24_ = d;
				_result_ = font_manager_copy_directory (_tmp23_, _tmp24_, flags);
				_g_object_unref0 (d);
				_g_object_unref0 (s);
				_g_free0 (destination_path);
				_g_free0 (source_path);
			} else {
				if (source_type == G_FILE_TYPE_REGULAR) {
					GFile* original = NULL;
					const gchar* _tmp25_;
					GFile* _tmp26_;
					gchar* outp = NULL;
					gchar* _tmp27_;
					gchar* _tmp28_;
					const gchar* _tmp29_;
					gchar* _tmp30_;
					gchar* _tmp31_;
					GFile* dest = NULL;
					const gchar* _tmp32_;
					GFile* _tmp33_;
					gboolean _tmp34_ = FALSE;
					GFile* _tmp35_;
					GFile* _tmp36_;
					_tmp25_ = name;
					_tmp26_ = g_file_get_child (source, _tmp25_);
					original = _tmp26_;
					_tmp27_ = g_file_get_path (destination);
					_tmp28_ = _tmp27_;
					_tmp29_ = name;
					_tmp30_ = g_build_filename (_tmp28_, _tmp29_, NULL);
					_tmp31_ = _tmp30_;
					_g_free0 (_tmp28_);
					outp = _tmp31_;
					_tmp32_ = outp;
					_tmp33_ = g_file_new_for_path (_tmp32_);
					dest = _tmp33_;
					_tmp35_ = original;
					_tmp36_ = dest;
					_tmp34_ = g_file_copy (_tmp35_, _tmp36_, flags, NULL, NULL, NULL, &_inner_error0_);
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						_g_object_unref0 (dest);
						_g_free0 (outp);
						_g_object_unref0 (original);
						_g_free0 (name);
						_g_object_unref0 (fileinfo);
						_g_object_unref0 (enumerator);
						goto __catch0_g_error;
					}
					_result_ = _tmp34_;
					_g_object_unref0 (dest);
					_g_free0 (outp);
					_g_object_unref0 (original);
				}
			}
			_tmp38_ = enumerator;
			_tmp39_ = g_file_enumerator_next_file (_tmp38_, NULL, &_inner_error0_);
			_tmp37_ = _tmp39_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_free0 (name);
				_g_object_unref0 (fileinfo);
				_g_object_unref0 (enumerator);
				goto __catch0_g_error;
			}
			_tmp40_ = _tmp37_;
			_tmp37_ = NULL;
			_g_object_unref0 (fileinfo);
			fileinfo = _tmp40_;
			_g_object_unref0 (_tmp37_);
			_g_free0 (name);
		}
		_g_object_unref0 (fileinfo);
		_g_object_unref0 (enumerator);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp41_;
		const gchar* _tmp42_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp41_ = e;
		_tmp42_ = _tmp41_->message;
		g_critical ("Utils.vala:352: %s", _tmp42_);
		_result_ = FALSE;
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp43_ = FALSE;
		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 _tmp43_;
	}
	result = _result_;
	return result;
}

gint64
font_manager_get_filelist_file_size (FontManagerStringSet* filelist)
{
	gint64 total = 0LL;
	GError* _inner_error0_ = NULL;
	gint64 result;
	g_return_val_if_fail (filelist != NULL, 0LL);
	total = (gint64) 0;
	{
		FontManagerStringSet* _path_list = NULL;
		guint _path_size = 0U;
		FontManagerStringSet* _tmp0_;
		guint _tmp1_;
		guint _tmp2_;
		gint _path_index = 0;
		_path_list = filelist;
		_tmp0_ = _path_list;
		g_object_get (_tmp0_, "size", &_tmp1_, NULL);
		_tmp2_ = _tmp1_;
		_path_size = _tmp2_;
		_path_index = -1;
		while (TRUE) {
			gint _tmp3_;
			guint _tmp4_;
			gchar* path = NULL;
			FontManagerStringSet* _tmp5_;
			const gchar* _tmp6_;
			gchar* _tmp7_;
			_path_index = _path_index + 1;
			_tmp3_ = _path_index;
			_tmp4_ = _path_size;
			if (!(((guint) _tmp3_) < _tmp4_)) {
				break;
			}
			_tmp5_ = _path_list;
			_tmp6_ = font_manager_string_set_get (_tmp5_, (guint) _path_index);
			_tmp7_ = g_strdup (_tmp6_);
			path = _tmp7_;
			{
				GFile* file = NULL;
				const gchar* _tmp8_;
				GFile* _tmp9_;
				GFileInfo* info = NULL;
				GFile* _tmp10_;
				GFileInfo* _tmp11_;
				GFileInfo* _tmp12_;
				_tmp8_ = path;
				_tmp9_ = g_file_new_for_path (_tmp8_);
				file = _tmp9_;
				_tmp10_ = file;
				_tmp11_ = g_file_query_info (_tmp10_, G_FILE_ATTRIBUTE_STANDARD_SIZE, G_FILE_QUERY_INFO_NONE, NULL, &_inner_error0_);
				info = _tmp11_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_g_object_unref0 (file);
					goto __catch0_g_error;
				}
				_tmp12_ = info;
				total += g_file_info_get_size (_tmp12_);
				_g_object_unref0 (info);
				_g_object_unref0 (file);
			}
			goto __finally0;
			__catch0_g_error:
			{
				GError* e = NULL;
				GError* _tmp13_;
				const gchar* _tmp14_;
				e = _inner_error0_;
				_inner_error0_ = NULL;
				_tmp13_ = e;
				_tmp14_ = _tmp13_->message;
				g_critical ("Utils.vala:366: %s", _tmp14_);
				_g_error_free0 (e);
			}
			__finally0:
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				gint64 _tmp15_ = -1LL;
				_g_free0 (path);
				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 _tmp15_;
			}
			_g_free0 (path);
		}
	}
	result = total;
	return result;
}

FontManagerStringSet*
font_manager_get_command_line_input (GVariantDict* options)
{
	GVariant* argv = NULL;
	const GVariantType* _tmp0_;
	GVariant* _tmp1_;
	GVariant* _tmp2_;
	const gchar** list = NULL;
	GVariant* _tmp3_;
	gsize _tmp4_ = 0;
	const gchar** _tmp5_;
	gint list_length1;
	gint _list_size_;
	const gchar** _tmp6_;
	gint _tmp6__length1;
	FontManagerStringSet* input = NULL;
	FontManagerStringSet* _tmp7_;
	const gchar** _tmp8_;
	gint _tmp8__length1;
	FontManagerStringSet* result;
	g_return_val_if_fail (options != NULL, NULL);
	_tmp0_ = G_VARIANT_TYPE_BYTESTRING_ARRAY;
	_tmp1_ = g_variant_dict_lookup_value (options, "", _tmp0_);
	argv = _tmp1_;
	_tmp2_ = argv;
	if (_tmp2_ == NULL) {
		result = NULL;
		_g_variant_unref0 (argv);
		return result;
	}
	_tmp3_ = argv;
	_tmp5_ = g_variant_get_bytestring_array (_tmp3_, &_tmp4_);
	list = _tmp5_;
	list_length1 = _tmp4_;
	_list_size_ = list_length1;
	_tmp6_ = list;
	_tmp6__length1 = list_length1;
	if (_tmp6__length1 == 0) {
		result = NULL;
		list = (g_free (list), NULL);
		_g_variant_unref0 (argv);
		return result;
	}
	_tmp7_ = font_manager_string_set_new ();
	input = _tmp7_;
	_tmp8_ = list;
	_tmp8__length1 = list_length1;
	{
		const gchar** str_collection = NULL;
		gint str_collection_length1 = 0;
		gint _str_collection_size_ = 0;
		gint str_it = 0;
		str_collection = _tmp8_;
		str_collection_length1 = _tmp8__length1;
		for (str_it = 0; str_it < str_collection_length1; str_it = str_it + 1) {
			const gchar* str = NULL;
			str = str_collection[str_it];
			{
				FontManagerStringSet* _tmp9_;
				const gchar* _tmp10_;
				_tmp9_ = input;
				_tmp10_ = str;
				font_manager_string_set_add (_tmp9_, _tmp10_);
			}
		}
	}
	result = input;
	list = (g_free (list), NULL);
	_g_variant_unref0 (argv);
	return result;
}

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

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

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

