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

/* Unsorted.vala
 *
 * Copyright (C) 2009-2024 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 <json-glib/json-glib.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gio/gio.h>
#include "font-manager.h"
#include <glib/gi18n-lib.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

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

typedef struct _FontManagerCacheable FontManagerCacheable;
typedef struct _FontManagerCacheableClass FontManagerCacheableClass;
typedef struct _FontManagerCacheablePrivate FontManagerCacheablePrivate;

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

typedef struct _FontManagerFontListFilter FontManagerFontListFilter;
typedef struct _FontManagerFontListFilterClass FontManagerFontListFilterClass;
typedef struct _FontManagerFontListFilterPrivate FontManagerFontListFilterPrivate;

#define FONT_MANAGER_TYPE_CATEGORY (font_manager_category_get_type ())
#define FONT_MANAGER_CATEGORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_CATEGORY, FontManagerCategory))
#define FONT_MANAGER_CATEGORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_CATEGORY, FontManagerCategoryClass))
#define FONT_MANAGER_IS_CATEGORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_CATEGORY))
#define FONT_MANAGER_IS_CATEGORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_CATEGORY))
#define FONT_MANAGER_CATEGORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_CATEGORY, FontManagerCategoryClass))

typedef struct _FontManagerCategory FontManagerCategory;
typedef struct _FontManagerCategoryClass FontManagerCategoryClass;
typedef struct _FontManagerCategoryPrivate FontManagerCategoryPrivate;

#define FONT_MANAGER_TYPE_UNSORTED (font_manager_unsorted_get_type ())
#define FONT_MANAGER_UNSORTED(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_UNSORTED, FontManagerUnsorted))
#define FONT_MANAGER_UNSORTED_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_UNSORTED, FontManagerUnsortedClass))
#define FONT_MANAGER_IS_UNSORTED(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_UNSORTED))
#define FONT_MANAGER_IS_UNSORTED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_UNSORTED))
#define FONT_MANAGER_UNSORTED_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_UNSORTED, FontManagerUnsortedClass))

typedef struct _FontManagerUnsorted FontManagerUnsorted;
typedef struct _FontManagerUnsortedClass FontManagerUnsortedClass;
typedef struct _FontManagerUnsortedPrivate FontManagerUnsortedPrivate;
enum  {
	FONT_MANAGER_UNSORTED_0_PROPERTY,
	FONT_MANAGER_UNSORTED_SORTED_PROPERTY,
	FONT_MANAGER_UNSORTED_SIZE_PROPERTY,
	FONT_MANAGER_UNSORTED_NUM_PROPERTIES
};
static GParamSpec* font_manager_unsorted_properties[FONT_MANAGER_UNSORTED_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef enum  {
	FONT_MANAGER_CATEGORY_INDEX_ALL,
	FONT_MANAGER_CATEGORY_INDEX_SYSTEM,
	FONT_MANAGER_CATEGORY_INDEX_USER,
	FONT_MANAGER_CATEGORY_INDEX_PANOSE,
	FONT_MANAGER_CATEGORY_INDEX_WIDTH,
	FONT_MANAGER_CATEGORY_INDEX_WEIGHT,
	FONT_MANAGER_CATEGORY_INDEX_SLANT,
	FONT_MANAGER_CATEGORY_INDEX_SPACING,
	FONT_MANAGER_CATEGORY_INDEX_LICENSE,
	FONT_MANAGER_CATEGORY_INDEX_VENDOR,
	FONT_MANAGER_CATEGORY_INDEX_FILETYPE,
	FONT_MANAGER_CATEGORY_INDEX_UNSORTED,
	FONT_MANAGER_CATEGORY_INDEX_DISABLED,
	FONT_MANAGER_CATEGORY_INDEX_LANGUAGE,
	FONT_MANAGER_CATEGORY_INDEX_N_CATEGORIES
} FontManagerCategoryIndex;

#define FONT_MANAGER_TYPE_CATEGORY_INDEX (font_manager_category_index_get_type ())
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _FontManagerUnsortedUpdateData FontManagerUnsortedUpdateData;
#define _g_free0(var) (var = (g_free (var), NULL))

struct _FontManagerCacheable {
	GObject parent_instance;
	FontManagerCacheablePrivate * priv;
};

struct _FontManagerCacheableClass {
	GObjectClass parent_class;
	gboolean (*deserialize_property) (FontManagerCacheable* self, const gchar* prop_name, GValue* val, GParamSpec* pspec, JsonNode* node);
	JsonNode* (*serialize_property) (FontManagerCacheable* self, const gchar* prop_name, GValue* val, GParamSpec* pspec);
};

struct _FontManagerFontListFilter {
	FontManagerCacheable parent_instance;
	FontManagerFontListFilterPrivate * priv;
};

struct _FontManagerFontListFilterClass {
	FontManagerCacheableClass parent_class;
	void (*update) (FontManagerFontListFilter* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*update_finish) (FontManagerFontListFilter* self, GAsyncResult* _res_);
	gboolean (*matches) (FontManagerFontListFilter* self, GObject* item);
	gchar* (*get_name) (FontManagerFontListFilter* self);
	void (*set_name) (FontManagerFontListFilter* self, const gchar* value);
	gchar* (*get_icon) (FontManagerFontListFilter* self);
	void (*set_icon) (FontManagerFontListFilter* self, const gchar* value);
	gchar* (*get_comment) (FontManagerFontListFilter* self);
	void (*set_comment) (FontManagerFontListFilter* self, const gchar* value);
	gint (*get_index) (FontManagerFontListFilter* self);
	void (*set_index) (FontManagerFontListFilter* self, gint value);
	gint (*get_size) (FontManagerFontListFilter* self);
	gint (*get_depth) (FontManagerFontListFilter* self);
	void (*set_depth) (FontManagerFontListFilter* self, gint value);
};

struct _FontManagerCategory {
	FontManagerFontListFilter parent_instance;
	FontManagerCategoryPrivate * priv;
};

struct _FontManagerCategoryClass {
	FontManagerFontListFilterClass parent_class;
};

struct _FontManagerUnsorted {
	FontManagerCategory parent_instance;
	FontManagerUnsortedPrivate * priv;
};

struct _FontManagerUnsortedClass {
	FontManagerCategoryClass parent_class;
};

struct _FontManagerUnsortedPrivate {
	FontManagerStringSet* _sorted;
};

struct _FontManagerUnsortedUpdateData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	FontManagerUnsorted* self;
	FontManagerStringSet* _tmp0_;
	FontManagerStringSet* _tmp1_;
	FontManagerStringSet* _tmp2_;
	FontManagerStringSet* _tmp3_;
	FontManagerDatabase* db;
	FontManagerDatabase* _tmp4_;
	FontManagerStringSet* _tmp5_;
	FontManagerStringSet* _tmp6_;
	FontManagerStringSet* _tmp7_;
	FontManagerStringSet* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	GError* e;
	GError* _tmp11_;
	const gchar* _tmp12_;
	GError* _inner_error0_;
};

static gint FontManagerUnsorted_private_offset;
static gpointer font_manager_unsorted_parent_class = NULL;

VALA_EXTERN GType font_manager_cacheable_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerCacheable, g_object_unref)
VALA_EXTERN GType font_manager_font_list_filter_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerFontListFilter, g_object_unref)
VALA_EXTERN GType font_manager_category_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerCategory, g_object_unref)
VALA_EXTERN GType font_manager_unsorted_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerUnsorted, g_object_unref)
VALA_EXTERN gboolean font_manager_font_list_filter_matches (FontManagerFontListFilter* self,
                                                GObject* item);
VALA_EXTERN gint font_manager_font_list_filter_get_size (FontManagerFontListFilter* self);
VALA_EXTERN FontManagerUnsorted* font_manager_unsorted_new (void);
VALA_EXTERN FontManagerUnsorted* font_manager_unsorted_construct (GType object_type);
VALA_EXTERN GType font_manager_category_index_get_type (void) G_GNUC_CONST ;
VALA_EXTERN FontManagerCategory* font_manager_category_new (const gchar* name,
                                                const gchar* comment,
                                                const gchar* icon,
                                                const gchar* sql,
                                                gint index);
VALA_EXTERN FontManagerCategory* font_manager_category_construct (GType object_type,
                                                      const gchar* name,
                                                      const gchar* comment,
                                                      const gchar* icon,
                                                      const gchar* sql,
                                                      gint index);
static void font_manager_unsorted_update_data_free (gpointer _data);
VALA_EXTERN void font_manager_unsorted_update (FontManagerUnsorted* self,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_);
VALA_EXTERN void font_manager_unsorted_update_finish (FontManagerUnsorted* self,
                                          GAsyncResult* _res_);
static gboolean font_manager_unsorted_update_co (FontManagerUnsortedUpdateData* _data_);
VALA_EXTERN FontManagerStringSet* font_manager_category_get_families (FontManagerCategory* self);
VALA_EXTERN FontManagerStringSet* font_manager_category_get_variations (FontManagerCategory* self);
VALA_EXTERN FontManagerDatabase* font_manager_database_proxy_get_default_db (void);
VALA_EXTERN const gchar* font_manager_category_get_sql (FontManagerCategory* self);
static gboolean font_manager_unsorted_real_matches (FontManagerFontListFilter* base,
                                             GObject* item);
VALA_EXTERN FontManagerStringSet* font_manager_unsorted_get_sorted (FontManagerUnsorted* self);
VALA_EXTERN void font_manager_unsorted_set_sorted (FontManagerUnsorted* self,
                                       FontManagerStringSet* value);
static void font_manager_unsorted_finalize (GObject * obj);
static GType font_manager_unsorted_get_type_once (void);
static void _vala_font_manager_unsorted_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec);
static void _vala_font_manager_unsorted_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
font_manager_unsorted_get_instance_private (FontManagerUnsorted* self)
{
	return G_STRUCT_MEMBER_P (self, FontManagerUnsorted_private_offset);
}

FontManagerUnsorted*
font_manager_unsorted_construct (GType object_type)
{
	FontManagerUnsorted * self = NULL;
	self = (FontManagerUnsorted*) font_manager_category_construct (object_type, _ ("Unsorted"), _ ("Fonts not present in any collection"), "dialog-question-symbolic", "SELECT DISTINCT family, description FROM Fonts", (gint) FONT_MANAGER_CATEGORY_INDEX_UNSORTED);
	return self;
}

FontManagerUnsorted*
font_manager_unsorted_new (void)
{
	return font_manager_unsorted_construct (FONT_MANAGER_TYPE_UNSORTED);
}

static void
font_manager_unsorted_update_data_free (gpointer _data)
{
	FontManagerUnsortedUpdateData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (FontManagerUnsortedUpdateData, _data_);
}

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

void
font_manager_unsorted_update (FontManagerUnsorted* self,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_)
{
	FontManagerUnsortedUpdateData* _data_;
	FontManagerUnsorted* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (FontManagerUnsortedUpdateData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, font_manager_unsorted_update_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	font_manager_unsorted_update_co (_data_);
}

void
font_manager_unsorted_update_finish (FontManagerUnsorted* self,
                                     GAsyncResult* _res_)
{
	FontManagerUnsortedUpdateData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static gboolean
font_manager_unsorted_update_co (FontManagerUnsortedUpdateData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = font_manager_category_get_families ((FontManagerCategory*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	font_manager_string_set_clear (_data_->_tmp1_);
	_data_->_tmp2_ = font_manager_category_get_variations ((FontManagerCategory*) _data_->self);
	_data_->_tmp3_ = _data_->_tmp2_;
	font_manager_string_set_clear (_data_->_tmp3_);
	{
		_data_->_tmp4_ = font_manager_database_proxy_get_default_db ();
		_data_->db = _data_->_tmp4_;
		_data_->_tmp5_ = font_manager_category_get_families ((FontManagerCategory*) _data_->self);
		_data_->_tmp6_ = _data_->_tmp5_;
		_data_->_tmp7_ = font_manager_category_get_variations ((FontManagerCategory*) _data_->self);
		_data_->_tmp8_ = _data_->_tmp7_;
		_data_->_tmp9_ = font_manager_category_get_sql ((FontManagerCategory*) _data_->self);
		_data_->_tmp10_ = _data_->_tmp9_;
		font_manager_get_matching_families_and_fonts (_data_->db, _data_->_tmp6_, _data_->_tmp8_, _data_->_tmp10_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->db);
			goto __catch0_g_error;
		}
		_g_object_unref0 (_data_->db);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp11_ = _data_->e;
		_data_->_tmp12_ = _data_->_tmp11_->message;
		g_warning ("Unsorted.vala:48: %s", _data_->_tmp12_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		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_signal_emit_by_name ((FontManagerCacheable*) _data_->self, "changed");
	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;
}

static gboolean
font_manager_unsorted_real_matches (FontManagerFontListFilter* base,
                                    GObject* item)
{
	FontManagerUnsorted * self;
	gboolean visible = FALSE;
	gboolean result;
	self = (FontManagerUnsorted*) base;
	visible = FALSE;
	if (G_TYPE_CHECK_INSTANCE_TYPE (item, font_manager_family_get_type ())) {
		FontManagerStringSet* _tmp0_;
		gchar* _tmp1_;
		gchar* _tmp2_;
		gchar* _tmp3_;
		_tmp0_ = self->priv->_sorted;
		g_object_get (G_TYPE_CHECK_INSTANCE_CAST (item, font_manager_family_get_type (), FontManagerFamily), "family", &_tmp1_, NULL);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		visible = !font_manager_string_set_contains (_tmp0_, _tmp3_);
		_g_free0 (_tmp3_);
	} else {
		if (G_TYPE_CHECK_INSTANCE_TYPE (item, font_manager_font_get_type ())) {
			FontManagerStringSet* _tmp4_;
			gchar* _tmp5_;
			gchar* _tmp6_;
			gchar* _tmp7_;
			_tmp4_ = self->priv->_sorted;
			g_object_get (G_TYPE_CHECK_INSTANCE_CAST (item, font_manager_font_get_type (), FontManagerFont), "family", &_tmp5_, NULL);
			_tmp6_ = _tmp5_;
			_tmp7_ = _tmp6_;
			visible = !font_manager_string_set_contains (_tmp4_, _tmp7_);
			_g_free0 (_tmp7_);
		}
	}
	result = visible;
	return result;
}

FontManagerStringSet*
font_manager_unsorted_get_sorted (FontManagerUnsorted* self)
{
	FontManagerStringSet* result;
	FontManagerStringSet* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_sorted;
	result = _tmp0_;
	return result;
}

void
font_manager_unsorted_set_sorted (FontManagerUnsorted* self,
                                  FontManagerStringSet* value)
{
	FontManagerStringSet* old_value;
	g_return_if_fail (self != NULL);
	old_value = font_manager_unsorted_get_sorted (self);
	if (old_value != value) {
		FontManagerStringSet* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_sorted);
		self->priv->_sorted = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, font_manager_unsorted_properties[FONT_MANAGER_UNSORTED_SORTED_PROPERTY]);
	}
}

static gint
font_manager_unsorted_real_get_size (FontManagerFontListFilter* base)
{
	gint result;
	FontManagerUnsorted* self;
	FontManagerStringSet* _tmp0_;
	FontManagerStringSet* _tmp1_;
	guint _tmp2_;
	guint _tmp3_;
	FontManagerStringSet* _tmp4_;
	guint _tmp5_;
	guint _tmp6_;
	self = (FontManagerUnsorted*) base;
	_tmp0_ = font_manager_category_get_families ((FontManagerCategory*) self);
	_tmp1_ = _tmp0_;
	g_object_get (_tmp1_, "size", &_tmp2_, NULL);
	_tmp3_ = _tmp2_;
	_tmp4_ = self->priv->_sorted;
	g_object_get (_tmp4_, "size", &_tmp5_, NULL);
	_tmp6_ = _tmp5_;
	result = (gint) (_tmp3_ - _tmp6_);
	return result;
}

static void
font_manager_unsorted_class_init (FontManagerUnsortedClass * klass,
                                  gpointer klass_data)
{
	font_manager_unsorted_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FontManagerUnsorted_private_offset);
	((FontManagerFontListFilterClass *) klass)->matches = (gboolean (*) (FontManagerFontListFilter*, GObject*)) font_manager_unsorted_real_matches;
	FONT_MANAGER_FONT_LIST_FILTER_CLASS (klass)->get_size = (gint (*) (FontManagerFontListFilter*)) font_manager_unsorted_real_get_size;
	G_OBJECT_CLASS (klass)->get_property = _vala_font_manager_unsorted_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_font_manager_unsorted_set_property;
	G_OBJECT_CLASS (klass)->finalize = font_manager_unsorted_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_UNSORTED_SORTED_PROPERTY, font_manager_unsorted_properties[FONT_MANAGER_UNSORTED_SORTED_PROPERTY] = g_param_spec_object ("sorted", "sorted", "sorted", font_manager_string_set_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_UNSORTED_SIZE_PROPERTY, font_manager_unsorted_properties[FONT_MANAGER_UNSORTED_SIZE_PROPERTY] = g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
font_manager_unsorted_instance_init (FontManagerUnsorted * self,
                                     gpointer klass)
{
	FontManagerStringSet* _tmp0_;
	self->priv = font_manager_unsorted_get_instance_private (self);
	_tmp0_ = font_manager_string_set_new ();
	self->priv->_sorted = _tmp0_;
}

static void
font_manager_unsorted_finalize (GObject * obj)
{
	FontManagerUnsorted * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FONT_MANAGER_TYPE_UNSORTED, FontManagerUnsorted);
	_g_object_unref0 (self->priv->_sorted);
	G_OBJECT_CLASS (font_manager_unsorted_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
font_manager_unsorted_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FontManagerUnsortedClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) font_manager_unsorted_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FontManagerUnsorted), 0, (GInstanceInitFunc) font_manager_unsorted_instance_init, NULL };
	GType font_manager_unsorted_type_id;
	font_manager_unsorted_type_id = g_type_register_static (FONT_MANAGER_TYPE_CATEGORY, "FontManagerUnsorted", &g_define_type_info, 0);
	FontManagerUnsorted_private_offset = g_type_add_instance_private (font_manager_unsorted_type_id, sizeof (FontManagerUnsortedPrivate));
	return font_manager_unsorted_type_id;
}

GType
font_manager_unsorted_get_type (void)
{
	static volatile gsize font_manager_unsorted_type_id__once = 0;
	if (g_once_init_enter (&font_manager_unsorted_type_id__once)) {
		GType font_manager_unsorted_type_id;
		font_manager_unsorted_type_id = font_manager_unsorted_get_type_once ();
		g_once_init_leave (&font_manager_unsorted_type_id__once, font_manager_unsorted_type_id);
	}
	return font_manager_unsorted_type_id__once;
}

static void
_vala_font_manager_unsorted_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec)
{
	FontManagerUnsorted * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FONT_MANAGER_TYPE_UNSORTED, FontManagerUnsorted);
	switch (property_id) {
		case FONT_MANAGER_UNSORTED_SORTED_PROPERTY:
		g_value_set_object (value, font_manager_unsorted_get_sorted (self));
		break;
		case FONT_MANAGER_UNSORTED_SIZE_PROPERTY:
		g_value_set_int (value, font_manager_font_list_filter_get_size ((FontManagerFontListFilter*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_font_manager_unsorted_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec)
{
	FontManagerUnsorted * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FONT_MANAGER_TYPE_UNSORTED, FontManagerUnsorted);
	switch (property_id) {
		case FONT_MANAGER_UNSORTED_SORTED_PROPERTY:
		font_manager_unsorted_set_sorted (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

