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

/*
 * Copyright (C) 2010 Michal Hruby <michal.mhr@gmail.com>
 * Copyright (C) 2010 Alberto Aldegheri <albyrock87+dev@gmail.com>
 *
 * 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/>.
 *
 * Authored by Alberto Aldegheri <albyrock87+dev@gmail.com>
 *
 */

#include <synapse-core.h>
#include <glib-object.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <glib.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 SYNAPSE_GUI_TYPE_CATEGORY_CONFIG (synapse_gui_category_config_get_type ())
#define SYNAPSE_GUI_CATEGORY_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SYNAPSE_GUI_TYPE_CATEGORY_CONFIG, SynapseGuiCategoryConfig))
#define SYNAPSE_GUI_CATEGORY_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SYNAPSE_GUI_TYPE_CATEGORY_CONFIG, SynapseGuiCategoryConfigClass))
#define SYNAPSE_GUI_IS_CATEGORY_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SYNAPSE_GUI_TYPE_CATEGORY_CONFIG))
#define SYNAPSE_GUI_IS_CATEGORY_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SYNAPSE_GUI_TYPE_CATEGORY_CONFIG))
#define SYNAPSE_GUI_CATEGORY_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SYNAPSE_GUI_TYPE_CATEGORY_CONFIG, SynapseGuiCategoryConfigClass))

typedef struct _SynapseGuiCategoryConfig SynapseGuiCategoryConfig;
typedef struct _SynapseGuiCategoryConfigClass SynapseGuiCategoryConfigClass;
typedef struct _SynapseGuiCategoryConfigPrivate SynapseGuiCategoryConfigPrivate;

#define SYNAPSE_GUI_CATEGORY_CONFIG_TYPE_CATEGORY (synapse_gui_category_config_category_get_type ())
#define SYNAPSE_GUI_CATEGORY_CONFIG_CATEGORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SYNAPSE_GUI_CATEGORY_CONFIG_TYPE_CATEGORY, SynapseGuiCategoryConfigCategory))
#define SYNAPSE_GUI_CATEGORY_CONFIG_CATEGORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SYNAPSE_GUI_CATEGORY_CONFIG_TYPE_CATEGORY, SynapseGuiCategoryConfigCategoryClass))
#define SYNAPSE_GUI_CATEGORY_CONFIG_IS_CATEGORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SYNAPSE_GUI_CATEGORY_CONFIG_TYPE_CATEGORY))
#define SYNAPSE_GUI_CATEGORY_CONFIG_IS_CATEGORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SYNAPSE_GUI_CATEGORY_CONFIG_TYPE_CATEGORY))
#define SYNAPSE_GUI_CATEGORY_CONFIG_CATEGORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SYNAPSE_GUI_CATEGORY_CONFIG_TYPE_CATEGORY, SynapseGuiCategoryConfigCategoryClass))

typedef struct _SynapseGuiCategoryConfigCategory SynapseGuiCategoryConfigCategory;
typedef struct _SynapseGuiCategoryConfigCategoryClass SynapseGuiCategoryConfigCategoryClass;
enum  {
	SYNAPSE_GUI_CATEGORY_CONFIG_0_PROPERTY,
	SYNAPSE_GUI_CATEGORY_CONFIG_LIST_PROPERTY,
	SYNAPSE_GUI_CATEGORY_CONFIG_DEFAULT_CATEGORY_INDEX_PROPERTY,
	SYNAPSE_GUI_CATEGORY_CONFIG_CATEGORIES_PROPERTY,
	SYNAPSE_GUI_CATEGORY_CONFIG_LABELS_PROPERTY,
	SYNAPSE_GUI_CATEGORY_CONFIG_NUM_PROPERTIES
};
static GParamSpec* synapse_gui_category_config_properties[SYNAPSE_GUI_CATEGORY_CONFIG_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _SynapseGuiCategoryConfigCategoryPrivate SynapseGuiCategoryConfigCategoryPrivate;
enum  {
	SYNAPSE_GUI_CATEGORY_CONFIG_CATEGORY_0_PROPERTY,
	SYNAPSE_GUI_CATEGORY_CONFIG_CATEGORY_NAME_PROPERTY,
	SYNAPSE_GUI_CATEGORY_CONFIG_CATEGORY_FLAGS_PROPERTY,
	SYNAPSE_GUI_CATEGORY_CONFIG_CATEGORY_NUM_PROPERTIES
};
static GParamSpec* synapse_gui_category_config_category_properties[SYNAPSE_GUI_CATEGORY_CONFIG_CATEGORY_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))

struct _SynapseGuiCategoryConfig {
	SynapseConfigObject parent_instance;
	SynapseGuiCategoryConfigPrivate * priv;
	GeeMap* _labels;
};

struct _SynapseGuiCategoryConfigClass {
	SynapseConfigObjectClass parent_class;
};

struct _SynapseGuiCategoryConfigPrivate {
	gchar** _list;
	gint _list_length1;
	gint __list_size_;
	gint _default_category_index;
	GeeList* _categories;
};

struct _SynapseGuiCategoryConfigCategory {
	GObject parent_instance;
	SynapseGuiCategoryConfigCategoryPrivate * priv;
};

struct _SynapseGuiCategoryConfigCategoryClass {
	GObjectClass parent_class;
};

struct _SynapseGuiCategoryConfigCategoryPrivate {
	gchar* _name;
	SynapseQueryFlags _flags;
};

static gint SynapseGuiCategoryConfig_private_offset;
static gpointer synapse_gui_category_config_parent_class = NULL;
static gint SynapseGuiCategoryConfigCategory_private_offset;
static gpointer synapse_gui_category_config_category_parent_class = NULL;

VALA_EXTERN GType synapse_gui_category_config_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SynapseGuiCategoryConfig, g_object_unref)
VALA_EXTERN GType synapse_gui_category_config_category_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SynapseGuiCategoryConfigCategory, g_object_unref)
VALA_EXTERN gchar* synapse_gui_category_config_category_name_query_to_string (const gchar* name,
                                                                  SynapseQueryFlags flags);
static void synapse_gui_category_config_init_labels (SynapseGuiCategoryConfig* self);
VALA_EXTERN void synapse_gui_category_config_update_categories (SynapseGuiCategoryConfig* self);
VALA_EXTERN gchar** synapse_gui_category_config_get_list (SynapseGuiCategoryConfig* self,
                                              gint* result_length1);
VALA_EXTERN SynapseGuiCategoryConfigCategory* synapse_gui_category_config_category_new_from_string (const gchar* key);
VALA_EXTERN SynapseGuiCategoryConfigCategory* synapse_gui_category_config_category_construct_from_string (GType object_type,
                                                                                              const gchar* key);
VALA_EXTERN void synapse_gui_category_config_set_list (SynapseGuiCategoryConfig* self,
                                           gchar** value,
                                           gint value_length1);
VALA_EXTERN gint synapse_gui_category_config_get_default_category_index (SynapseGuiCategoryConfig* self);
VALA_EXTERN void synapse_gui_category_config_set_default_category_index (SynapseGuiCategoryConfig* self,
                                                             gint value);
VALA_EXTERN SynapseGuiCategoryConfig* synapse_gui_category_config_new (void);
VALA_EXTERN SynapseGuiCategoryConfig* synapse_gui_category_config_construct (GType object_type);
static gchar** _vala_array_dup1 (gchar** self,
                          gssize length);
VALA_EXTERN GeeList* synapse_gui_category_config_get_categories (SynapseGuiCategoryConfig* self);
VALA_EXTERN GeeMap* synapse_gui_category_config_get_labels (SynapseGuiCategoryConfig* self);
VALA_EXTERN SynapseGuiCategoryConfigCategory* synapse_gui_category_config_category_new (const gchar* name,
                                                                            SynapseQueryFlags flags);
VALA_EXTERN SynapseGuiCategoryConfigCategory* synapse_gui_category_config_category_construct (GType object_type,
                                                                                  const gchar* name,
                                                                                  SynapseQueryFlags flags);
VALA_EXTERN void synapse_gui_category_config_category_set_name (SynapseGuiCategoryConfigCategory* self,
                                                    const gchar* value);
VALA_EXTERN void synapse_gui_category_config_category_set_flags (SynapseGuiCategoryConfigCategory* self,
                                                     SynapseQueryFlags value);
VALA_EXTERN gchar* synapse_gui_category_config_category_to_string (SynapseGuiCategoryConfigCategory* self);
VALA_EXTERN const gchar* synapse_gui_category_config_category_get_name (SynapseGuiCategoryConfigCategory* self);
VALA_EXTERN SynapseQueryFlags synapse_gui_category_config_category_get_flags (SynapseGuiCategoryConfigCategory* self);
static void synapse_gui_category_config_category_finalize (GObject * obj);
static GType synapse_gui_category_config_category_get_type_once (void);
static void _vala_synapse_gui_category_config_category_get_property (GObject * object,
                                                              guint property_id,
                                                              GValue * value,
                                                              GParamSpec * pspec);
static void _vala_synapse_gui_category_config_category_set_property (GObject * object,
                                                              guint property_id,
                                                              const GValue * value,
                                                              GParamSpec * pspec);
static GObject * synapse_gui_category_config_constructor (GType type,
                                                   guint n_construct_properties,
                                                   GObjectConstructParam * construct_properties);
static void synapse_gui_category_config_finalize (GObject * obj);
static GType synapse_gui_category_config_get_type_once (void);
static void _vala_synapse_gui_category_config_get_property (GObject * object,
                                                     guint property_id,
                                                     GValue * value,
                                                     GParamSpec * pspec);
static void _vala_synapse_gui_category_config_set_property (GObject * object,
                                                     guint property_id,
                                                     const GValue * value,
                                                     GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);

static inline gpointer
synapse_gui_category_config_get_instance_private (SynapseGuiCategoryConfig* self)
{
	return G_STRUCT_MEMBER_P (self, SynapseGuiCategoryConfig_private_offset);
}

static void
synapse_gui_category_config_init_labels (SynapseGuiCategoryConfig* self)
{
	GeeMap* _tmp0_;
	GeeMap* _tmp1_;
	GeeMap* _tmp2_;
	GeeMap* _tmp3_;
	GeeMap* _tmp4_;
	GeeMap* _tmp5_;
	GeeMap* _tmp6_;
	GeeMap* _tmp7_;
	GeeMap* _tmp8_;
	GeeMap* _tmp9_;
#line 105 "category.vala"
	g_return_if_fail (self != NULL);
#line 109 "category.vala"
	_tmp0_ = self->_labels;
#line 109 "category.vala"
	gee_map_set (_tmp0_, (gpointer) ((gintptr) SYNAPSE_QUERY_FLAGS_INCLUDE_REMOTE), _ ("Include remote content"));
#line 110 "category.vala"
	_tmp1_ = self->_labels;
#line 110 "category.vala"
	gee_map_set (_tmp1_, (gpointer) ((gintptr) SYNAPSE_QUERY_FLAGS_ACTIONS), _ ("Actions"));
#line 111 "category.vala"
	_tmp2_ = self->_labels;
#line 111 "category.vala"
	gee_map_set (_tmp2_, (gpointer) ((gintptr) SYNAPSE_QUERY_FLAGS_PLACES), _ ("Places"));
#line 112 "category.vala"
	_tmp3_ = self->_labels;
#line 112 "category.vala"
	gee_map_set (_tmp3_, (gpointer) ((gintptr) SYNAPSE_QUERY_FLAGS_AUDIO), _ ("Audio"));
#line 113 "category.vala"
	_tmp4_ = self->_labels;
#line 113 "category.vala"
	gee_map_set (_tmp4_, (gpointer) ((gintptr) SYNAPSE_QUERY_FLAGS_APPLICATIONS), _ ("Applications"));
#line 114 "category.vala"
	_tmp5_ = self->_labels;
#line 114 "category.vala"
	gee_map_set (_tmp5_, (gpointer) ((gintptr) SYNAPSE_QUERY_FLAGS_DOCUMENTS), _ ("Documents"));
#line 115 "category.vala"
	_tmp6_ = self->_labels;
#line 115 "category.vala"
	gee_map_set (_tmp6_, (gpointer) ((gintptr) SYNAPSE_QUERY_FLAGS_IMAGES), _ ("Images"));
#line 116 "category.vala"
	_tmp7_ = self->_labels;
#line 116 "category.vala"
	gee_map_set (_tmp7_, (gpointer) ((gintptr) SYNAPSE_QUERY_FLAGS_VIDEO), _ ("Video"));
#line 117 "category.vala"
	_tmp8_ = self->_labels;
#line 117 "category.vala"
	gee_map_set (_tmp8_, (gpointer) ((gintptr) SYNAPSE_QUERY_FLAGS_INTERNET), _ ("Internet"));
#line 119 "category.vala"
	_tmp9_ = self->_labels;
#line 119 "category.vala"
	gee_map_set (_tmp9_, (gpointer) ((gintptr) SYNAPSE_QUERY_FLAGS_UNCATEGORIZED), _ ("Uncategorized"));
#line 258 "category.c"
}

void
synapse_gui_category_config_update_categories (SynapseGuiCategoryConfig* self)
{
	GeeList* _tmp0_;
	gchar** _tmp1_;
	gint _tmp1__length1;
	gint _tmp2_ = 0;
	gchar** _tmp3_;
	gint _tmp3__length1;
	GeeList* _tmp8_;
	gint _tmp9_;
	gint _tmp10_;
	gint _tmp14_;
	GeeList* _tmp15_;
	gint _tmp16_;
	gint _tmp17_;
#line 122 "category.vala"
	g_return_if_fail (self != NULL);
#line 124 "category.vala"
	_tmp0_ = self->priv->_categories;
#line 124 "category.vala"
	gee_collection_clear ((GeeCollection*) _tmp0_);
#line 125 "category.vala"
	_tmp1_ = synapse_gui_category_config_get_list (self, &_tmp2_);
#line 125 "category.vala"
	_tmp1__length1 = _tmp2_;
#line 125 "category.vala"
	_tmp3_ = _tmp1_;
#line 125 "category.vala"
	_tmp3__length1 = _tmp1__length1;
#line 291 "category.c"
	{
		gchar** s_collection = NULL;
		gint s_collection_length1 = 0;
		gint _s_collection_size_ = 0;
		gint s_it = 0;
#line 125 "category.vala"
		s_collection = _tmp3_;
#line 125 "category.vala"
		s_collection_length1 = _tmp3__length1;
#line 125 "category.vala"
		for (s_it = 0; s_it < s_collection_length1; s_it = s_it + 1) {
#line 303 "category.c"
			const gchar* s = NULL;
#line 125 "category.vala"
			s = s_collection[s_it];
#line 307 "category.c"
			{
				GeeList* _tmp4_;
				const gchar* _tmp5_;
				SynapseGuiCategoryConfigCategory* _tmp6_;
				SynapseGuiCategoryConfigCategory* _tmp7_;
#line 127 "category.vala"
				_tmp4_ = self->priv->_categories;
#line 127 "category.vala"
				_tmp5_ = s;
#line 127 "category.vala"
				_tmp6_ = synapse_gui_category_config_category_new_from_string (_tmp5_);
#line 127 "category.vala"
				_tmp7_ = _tmp6_;
#line 127 "category.vala"
				gee_collection_add ((GeeCollection*) _tmp4_, _tmp7_);
#line 127 "category.vala"
				_g_object_unref0 (_tmp7_);
#line 325 "category.c"
			}
		}
	}
#line 129 "category.vala"
	_tmp8_ = self->priv->_categories;
#line 129 "category.vala"
	_tmp9_ = gee_collection_get_size ((GeeCollection*) _tmp8_);
#line 129 "category.vala"
	_tmp10_ = _tmp9_;
#line 129 "category.vala"
	if (_tmp10_ < 1) {
#line 337 "category.c"
		gchar* _tmp11_;
		gchar** _tmp12_;
		gchar** _tmp13_;
		gint _tmp13__length1;
#line 132 "category.vala"
		_tmp11_ = synapse_gui_category_config_category_name_query_to_string (_ ("All"), SYNAPSE_QUERY_FLAGS_ALL);
#line 132 "category.vala"
		_tmp12_ = g_new0 (gchar*, 1 + 1);
#line 132 "category.vala"
		_tmp12_[0] = _tmp11_;
#line 132 "category.vala"
		_tmp13_ = _tmp12_;
#line 132 "category.vala"
		_tmp13__length1 = 1;
#line 132 "category.vala"
		synapse_gui_category_config_set_list (self, _tmp13_, 1);
#line 132 "category.vala"
		_tmp13_ = (_vala_array_free (_tmp13_, _tmp13__length1, (GDestroyNotify) g_free), NULL);
#line 135 "category.vala"
		synapse_gui_category_config_update_categories (self);
#line 136 "category.vala"
		return;
#line 360 "category.c"
	}
#line 138 "category.vala"
	_tmp14_ = self->priv->_default_category_index;
#line 138 "category.vala"
	_tmp15_ = self->priv->_categories;
#line 138 "category.vala"
	_tmp16_ = gee_collection_get_size ((GeeCollection*) _tmp15_);
#line 138 "category.vala"
	_tmp17_ = _tmp16_;
#line 138 "category.vala"
	if (_tmp14_ >= _tmp17_) {
#line 372 "category.c"
		GeeList* _tmp18_;
		gint _tmp19_;
		gint _tmp20_;
#line 140 "category.vala"
		_tmp18_ = self->priv->_categories;
#line 140 "category.vala"
		_tmp19_ = gee_collection_get_size ((GeeCollection*) _tmp18_);
#line 140 "category.vala"
		_tmp20_ = _tmp19_;
#line 140 "category.vala"
		synapse_gui_category_config_set_default_category_index (self, _tmp20_ / 2);
#line 384 "category.c"
	}
}

SynapseGuiCategoryConfig*
synapse_gui_category_config_construct (GType object_type)
{
	SynapseGuiCategoryConfig * self = NULL;
#line 24 "category.vala"
	self = (SynapseGuiCategoryConfig*) synapse_config_object_construct (object_type);
#line 24 "category.vala"
	return self;
#line 396 "category.c"
}

SynapseGuiCategoryConfig*
synapse_gui_category_config_new (void)
{
#line 24 "category.vala"
	return synapse_gui_category_config_construct (SYNAPSE_GUI_TYPE_CATEGORY_CONFIG);
#line 404 "category.c"
}

gchar**
synapse_gui_category_config_get_list (SynapseGuiCategoryConfig* self,
                                      gint* result_length1)
{
	gchar** result;
	gchar** _tmp0_;
	gint _tmp0__length1;
	gchar** _tmp1_;
	gint _tmp1__length1;
#line 65 "category.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 65 "category.vala"
	_tmp0_ = self->priv->_list;
#line 65 "category.vala"
	_tmp0__length1 = self->priv->_list_length1;
#line 65 "category.vala"
	_tmp1_ = _tmp0_;
#line 65 "category.vala"
	_tmp1__length1 = _tmp0__length1;
#line 65 "category.vala"
	if (result_length1) {
#line 65 "category.vala"
		*result_length1 = _tmp1__length1;
#line 430 "category.c"
	}
#line 65 "category.vala"
	result = _tmp1_;
#line 65 "category.vala"
	return result;
#line 436 "category.c"
}

static gchar**
_vala_array_dup1 (gchar** self,
                  gssize length)
{
#line 65 "category.vala"
	if (length >= 0) {
#line 445 "category.c"
		gchar** result;
		gssize i;
#line 65 "category.vala"
		result = g_new0 (gchar*, length + 1);
#line 65 "category.vala"
		for (i = 0; i < length; i++) {
#line 452 "category.c"
			gchar* _tmp0_;
#line 65 "category.vala"
			_tmp0_ = g_strdup (self[i]);
#line 65 "category.vala"
			result[i] = _tmp0_;
#line 458 "category.c"
		}
#line 65 "category.vala"
		return result;
#line 462 "category.c"
	}
#line 65 "category.vala"
	return NULL;
#line 466 "category.c"
}

void
synapse_gui_category_config_set_list (SynapseGuiCategoryConfig* self,
                                      gchar** value,
                                      gint value_length1)
{
	gchar** old_value;
	gint old_value_length;
#line 65 "category.vala"
	g_return_if_fail (self != NULL);
#line 65 "category.vala"
	old_value = synapse_gui_category_config_get_list (self, &old_value_length);
#line 65 "category.vala"
	if (old_value != value) {
#line 482 "category.c"
		gchar** _tmp0_;
		gint _tmp0__length1;
#line 65 "category.vala"
		_tmp0_ = (value != NULL) ? _vala_array_dup1 (value, value_length1) : value;
#line 65 "category.vala"
		_tmp0__length1 = value_length1;
#line 65 "category.vala"
		self->priv->_list = (_vala_array_free (self->priv->_list, self->priv->_list_length1, (GDestroyNotify) g_free), NULL);
#line 65 "category.vala"
		self->priv->_list = _tmp0_;
#line 65 "category.vala"
		self->priv->_list_length1 = _tmp0__length1;
#line 65 "category.vala"
		self->priv->__list_size_ = self->priv->_list_length1;
#line 65 "category.vala"
		g_object_notify_by_pspec ((GObject *) self, synapse_gui_category_config_properties[SYNAPSE_GUI_CATEGORY_CONFIG_LIST_PROPERTY]);
#line 499 "category.c"
	}
}

gint
synapse_gui_category_config_get_default_category_index (SynapseGuiCategoryConfig* self)
{
	gint result;
#line 80 "category.vala"
	g_return_val_if_fail (self != NULL, 0);
#line 80 "category.vala"
	result = self->priv->_default_category_index;
#line 80 "category.vala"
	return result;
#line 513 "category.c"
}

void
synapse_gui_category_config_set_default_category_index (SynapseGuiCategoryConfig* self,
                                                        gint value)
{
	gint old_value;
#line 80 "category.vala"
	g_return_if_fail (self != NULL);
#line 80 "category.vala"
	old_value = synapse_gui_category_config_get_default_category_index (self);
#line 80 "category.vala"
	if (old_value != value) {
#line 80 "category.vala"
		self->priv->_default_category_index = value;
#line 80 "category.vala"
		g_object_notify_by_pspec ((GObject *) self, synapse_gui_category_config_properties[SYNAPSE_GUI_CATEGORY_CONFIG_DEFAULT_CATEGORY_INDEX_PROPERTY]);
#line 531 "category.c"
	}
}

GeeList*
synapse_gui_category_config_get_categories (SynapseGuiCategoryConfig* self)
{
	GeeList* result;
	GeeList* _tmp0_;
#line 84 "category.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 85 "category.vala"
	_tmp0_ = self->priv->_categories;
#line 85 "category.vala"
	result = _tmp0_;
#line 85 "category.vala"
	return result;
#line 548 "category.c"
}

GeeMap*
synapse_gui_category_config_get_labels (SynapseGuiCategoryConfig* self)
{
	GeeMap* result;
	GeeMap* _tmp0_;
#line 90 "category.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 91 "category.vala"
	_tmp0_ = self->_labels;
#line 91 "category.vala"
	result = _tmp0_;
#line 91 "category.vala"
	return result;
#line 564 "category.c"
}

static inline gpointer
synapse_gui_category_config_category_get_instance_private (SynapseGuiCategoryConfigCategory* self)
{
	return G_STRUCT_MEMBER_P (self, SynapseGuiCategoryConfigCategory_private_offset);
}

SynapseGuiCategoryConfigCategory*
synapse_gui_category_config_category_construct (GType object_type,
                                                const gchar* name,
                                                SynapseQueryFlags flags)
{
	SynapseGuiCategoryConfigCategory * self = NULL;
#line 32 "category.vala"
	g_return_val_if_fail (name != NULL, NULL);
#line 32 "category.vala"
	self = (SynapseGuiCategoryConfigCategory*) g_object_new (object_type, NULL);
#line 34 "category.vala"
	synapse_gui_category_config_category_set_name (self, name);
#line 35 "category.vala"
	synapse_gui_category_config_category_set_flags (self, flags);
#line 32 "category.vala"
	return self;
#line 589 "category.c"
}

SynapseGuiCategoryConfigCategory*
synapse_gui_category_config_category_new (const gchar* name,
                                          SynapseQueryFlags flags)
{
#line 32 "category.vala"
	return synapse_gui_category_config_category_construct (SYNAPSE_GUI_CATEGORY_CONFIG_TYPE_CATEGORY, name, flags);
#line 598 "category.c"
}

static guint64
uint64_parse (const gchar* str,
              guint _base)
{
	guint64 result;
#line 839 "glib-2.0.vapi"
	g_return_val_if_fail (str != NULL, 0ULL);
#line 840 "glib-2.0.vapi"
	result = g_ascii_strtoull (str, NULL, _base);
#line 840 "glib-2.0.vapi"
	return result;
#line 612 "category.c"
}

SynapseGuiCategoryConfigCategory*
synapse_gui_category_config_category_construct_from_string (GType object_type,
                                                            const gchar* key)
{
	SynapseGuiCategoryConfigCategory * self = NULL;
	gchar** nameflags = NULL;
	gchar** _tmp0_;
	gchar** _tmp1_;
	gint nameflags_length1;
	gint _nameflags_size_;
	gchar** _tmp2_;
	gint _tmp2__length1;
#line 38 "category.vala"
	g_return_val_if_fail (key != NULL, NULL);
#line 38 "category.vala"
	self = (SynapseGuiCategoryConfigCategory*) g_object_new (object_type, NULL);
#line 40 "category.vala"
	_tmp1_ = _tmp0_ = g_strsplit (key, "@", 2);
#line 40 "category.vala"
	nameflags = _tmp1_;
#line 40 "category.vala"
	nameflags_length1 = _vala_array_length (_tmp0_);
#line 40 "category.vala"
	_nameflags_size_ = nameflags_length1;
#line 41 "category.vala"
	_tmp2_ = nameflags;
#line 41 "category.vala"
	_tmp2__length1 = nameflags_length1;
#line 41 "category.vala"
	if (_tmp2__length1 == 2) {
#line 645 "category.c"
		gchar** _tmp3_;
		gint _tmp3__length1;
		const gchar* _tmp4_;
		gchar** _tmp5_;
		gint _tmp5__length1;
		const gchar* _tmp6_;
#line 43 "category.vala"
		_tmp3_ = nameflags;
#line 43 "category.vala"
		_tmp3__length1 = nameflags_length1;
#line 43 "category.vala"
		_tmp4_ = _tmp3_[0];
#line 43 "category.vala"
		synapse_gui_category_config_category_set_name (self, _tmp4_);
#line 44 "category.vala"
		_tmp5_ = nameflags;
#line 44 "category.vala"
		_tmp5__length1 = nameflags_length1;
#line 44 "category.vala"
		_tmp6_ = _tmp5_[1];
#line 44 "category.vala"
		synapse_gui_category_config_category_set_flags (self, (SynapseQueryFlags) uint64_parse (_tmp6_, (guint) 0));
#line 668 "category.c"
	} else {
		gchar** _tmp7_;
		gint _tmp7__length1;
#line 46 "category.vala"
		_tmp7_ = nameflags;
#line 46 "category.vala"
		_tmp7__length1 = nameflags_length1;
#line 46 "category.vala"
		if (_tmp7__length1 == 1) {
#line 678 "category.c"
			gchar** _tmp8_;
			gint _tmp8__length1;
			const gchar* _tmp9_;
#line 48 "category.vala"
			_tmp8_ = nameflags;
#line 48 "category.vala"
			_tmp8__length1 = nameflags_length1;
#line 48 "category.vala"
			_tmp9_ = _tmp8_[0];
#line 48 "category.vala"
			synapse_gui_category_config_category_set_name (self, _tmp9_);
#line 49 "category.vala"
			synapse_gui_category_config_category_set_flags (self, SYNAPSE_QUERY_FLAGS_ALL);
#line 692 "category.c"
		}
	}
#line 38 "category.vala"
	nameflags = (_vala_array_free (nameflags, nameflags_length1, (GDestroyNotify) g_free), NULL);
#line 38 "category.vala"
	return self;
#line 699 "category.c"
}

SynapseGuiCategoryConfigCategory*
synapse_gui_category_config_category_new_from_string (const gchar* key)
{
#line 38 "category.vala"
	return synapse_gui_category_config_category_construct_from_string (SYNAPSE_GUI_CATEGORY_CONFIG_TYPE_CATEGORY, key);
#line 707 "category.c"
}

gchar*
synapse_gui_category_config_category_name_query_to_string (const gchar* name,
                                                           SynapseQueryFlags flags)
{
	gchar* _tmp0_;
	gchar* result;
#line 54 "category.vala"
	g_return_val_if_fail (name != NULL, NULL);
#line 56 "category.vala"
	_tmp0_ = g_strdup_printf ("%s@%u", name, (guint) flags);
#line 56 "category.vala"
	result = _tmp0_;
#line 56 "category.vala"
	return result;
#line 724 "category.c"
}

gchar*
synapse_gui_category_config_category_to_string (SynapseGuiCategoryConfigCategory* self)
{
	const gchar* _tmp0_;
	SynapseQueryFlags _tmp1_;
	gchar* _tmp2_;
	gchar* result;
#line 59 "category.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 60 "category.vala"
	_tmp0_ = self->priv->_name;
#line 60 "category.vala"
	_tmp1_ = self->priv->_flags;
#line 60 "category.vala"
	_tmp2_ = g_strdup_printf ("%s@%u", _tmp0_, (guint) _tmp1_);
#line 60 "category.vala"
	result = _tmp2_;
#line 60 "category.vala"
	return result;
#line 746 "category.c"
}

const gchar*
synapse_gui_category_config_category_get_name (SynapseGuiCategoryConfigCategory* self)
{
	const gchar* result;
	const gchar* _tmp0_;
#line 29 "category.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 29 "category.vala"
	_tmp0_ = self->priv->_name;
#line 29 "category.vala"
	result = _tmp0_;
#line 29 "category.vala"
	return result;
#line 762 "category.c"
}

void
synapse_gui_category_config_category_set_name (SynapseGuiCategoryConfigCategory* self,
                                               const gchar* value)
{
	gchar* old_value;
#line 29 "category.vala"
	g_return_if_fail (self != NULL);
#line 29 "category.vala"
	old_value = synapse_gui_category_config_category_get_name (self);
#line 29 "category.vala"
	if (g_strcmp0 (value, old_value) != 0) {
#line 776 "category.c"
		gchar* _tmp0_;
#line 29 "category.vala"
		_tmp0_ = g_strdup (value);
#line 29 "category.vala"
		_g_free0 (self->priv->_name);
#line 29 "category.vala"
		self->priv->_name = _tmp0_;
#line 29 "category.vala"
		g_object_notify_by_pspec ((GObject *) self, synapse_gui_category_config_category_properties[SYNAPSE_GUI_CATEGORY_CONFIG_CATEGORY_NAME_PROPERTY]);
#line 786 "category.c"
	}
}

SynapseQueryFlags
synapse_gui_category_config_category_get_flags (SynapseGuiCategoryConfigCategory* self)
{
	SynapseQueryFlags result;
#line 30 "category.vala"
	g_return_val_if_fail (self != NULL, 0U);
#line 30 "category.vala"
	result = self->priv->_flags;
#line 30 "category.vala"
	return result;
#line 800 "category.c"
}

void
synapse_gui_category_config_category_set_flags (SynapseGuiCategoryConfigCategory* self,
                                                SynapseQueryFlags value)
{
	SynapseQueryFlags old_value;
#line 30 "category.vala"
	g_return_if_fail (self != NULL);
#line 30 "category.vala"
	old_value = synapse_gui_category_config_category_get_flags (self);
#line 30 "category.vala"
	if (old_value != value) {
#line 30 "category.vala"
		self->priv->_flags = value;
#line 30 "category.vala"
		g_object_notify_by_pspec ((GObject *) self, synapse_gui_category_config_category_properties[SYNAPSE_GUI_CATEGORY_CONFIG_CATEGORY_FLAGS_PROPERTY]);
#line 818 "category.c"
	}
}

static void
synapse_gui_category_config_category_class_init (SynapseGuiCategoryConfigCategoryClass * klass,
                                                 gpointer klass_data)
{
#line 27 "category.vala"
	synapse_gui_category_config_category_parent_class = g_type_class_peek_parent (klass);
#line 27 "category.vala"
	g_type_class_adjust_private_offset (klass, &SynapseGuiCategoryConfigCategory_private_offset);
#line 27 "category.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_synapse_gui_category_config_category_get_property;
#line 27 "category.vala"
	G_OBJECT_CLASS (klass)->set_property = _vala_synapse_gui_category_config_category_set_property;
#line 27 "category.vala"
	G_OBJECT_CLASS (klass)->finalize = synapse_gui_category_config_category_finalize;
#line 27 "category.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), SYNAPSE_GUI_CATEGORY_CONFIG_CATEGORY_NAME_PROPERTY, synapse_gui_category_config_category_properties[SYNAPSE_GUI_CATEGORY_CONFIG_CATEGORY_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
#line 27 "category.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), SYNAPSE_GUI_CATEGORY_CONFIG_CATEGORY_FLAGS_PROPERTY, synapse_gui_category_config_category_properties[SYNAPSE_GUI_CATEGORY_CONFIG_CATEGORY_FLAGS_PROPERTY] = g_param_spec_flags ("flags", "flags", "flags", SYNAPSE_TYPE_QUERY_FLAGS, SYNAPSE_QUERY_FLAGS_ALL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
#line 840 "category.c"
}

static void
synapse_gui_category_config_category_instance_init (SynapseGuiCategoryConfigCategory * self,
                                                    gpointer klass)
{
	gchar* _tmp0_;
#line 27 "category.vala"
	self->priv = synapse_gui_category_config_category_get_instance_private (self);
#line 29 "category.vala"
	_tmp0_ = g_strdup (_ ("All"));
#line 29 "category.vala"
	self->priv->_name = _tmp0_;
#line 30 "category.vala"
	self->priv->_flags = SYNAPSE_QUERY_FLAGS_ALL;
#line 856 "category.c"
}

static void
synapse_gui_category_config_category_finalize (GObject * obj)
{
	SynapseGuiCategoryConfigCategory * self;
#line 27 "category.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SYNAPSE_GUI_CATEGORY_CONFIG_TYPE_CATEGORY, SynapseGuiCategoryConfigCategory);
#line 29 "category.vala"
	_g_free0 (self->priv->_name);
#line 27 "category.vala"
	G_OBJECT_CLASS (synapse_gui_category_config_category_parent_class)->finalize (obj);
#line 869 "category.c"
}

static GType
synapse_gui_category_config_category_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SynapseGuiCategoryConfigCategoryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) synapse_gui_category_config_category_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SynapseGuiCategoryConfigCategory), 0, (GInstanceInitFunc) synapse_gui_category_config_category_instance_init, NULL };
	GType synapse_gui_category_config_category_type_id;
	synapse_gui_category_config_category_type_id = g_type_register_static (G_TYPE_OBJECT, "SynapseGuiCategoryConfigCategory", &g_define_type_info, 0);
	SynapseGuiCategoryConfigCategory_private_offset = g_type_add_instance_private (synapse_gui_category_config_category_type_id, sizeof (SynapseGuiCategoryConfigCategoryPrivate));
	return synapse_gui_category_config_category_type_id;
}

GType
synapse_gui_category_config_category_get_type (void)
{
	static volatile gsize synapse_gui_category_config_category_type_id__once = 0;
	if (g_once_init_enter (&synapse_gui_category_config_category_type_id__once)) {
		GType synapse_gui_category_config_category_type_id;
		synapse_gui_category_config_category_type_id = synapse_gui_category_config_category_get_type_once ();
		g_once_init_leave (&synapse_gui_category_config_category_type_id__once, synapse_gui_category_config_category_type_id);
	}
	return synapse_gui_category_config_category_type_id__once;
}

static void
_vala_synapse_gui_category_config_category_get_property (GObject * object,
                                                         guint property_id,
                                                         GValue * value,
                                                         GParamSpec * pspec)
{
	SynapseGuiCategoryConfigCategory * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SYNAPSE_GUI_CATEGORY_CONFIG_TYPE_CATEGORY, SynapseGuiCategoryConfigCategory);
#line 27 "category.vala"
	switch (property_id) {
#line 27 "category.vala"
		case SYNAPSE_GUI_CATEGORY_CONFIG_CATEGORY_NAME_PROPERTY:
#line 27 "category.vala"
		g_value_set_string (value, synapse_gui_category_config_category_get_name (self));
#line 27 "category.vala"
		break;
#line 27 "category.vala"
		case SYNAPSE_GUI_CATEGORY_CONFIG_CATEGORY_FLAGS_PROPERTY:
#line 27 "category.vala"
		g_value_set_flags (value, synapse_gui_category_config_category_get_flags (self));
#line 27 "category.vala"
		break;
#line 916 "category.c"
		default:
#line 27 "category.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 27 "category.vala"
		break;
#line 922 "category.c"
	}
}

static void
_vala_synapse_gui_category_config_category_set_property (GObject * object,
                                                         guint property_id,
                                                         const GValue * value,
                                                         GParamSpec * pspec)
{
	SynapseGuiCategoryConfigCategory * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SYNAPSE_GUI_CATEGORY_CONFIG_TYPE_CATEGORY, SynapseGuiCategoryConfigCategory);
#line 27 "category.vala"
	switch (property_id) {
#line 27 "category.vala"
		case SYNAPSE_GUI_CATEGORY_CONFIG_CATEGORY_NAME_PROPERTY:
#line 27 "category.vala"
		synapse_gui_category_config_category_set_name (self, g_value_get_string (value));
#line 27 "category.vala"
		break;
#line 27 "category.vala"
		case SYNAPSE_GUI_CATEGORY_CONFIG_CATEGORY_FLAGS_PROPERTY:
#line 27 "category.vala"
		synapse_gui_category_config_category_set_flags (self, g_value_get_flags (value));
#line 27 "category.vala"
		break;
#line 948 "category.c"
		default:
#line 27 "category.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 27 "category.vala"
		break;
#line 954 "category.c"
	}
}

static GObject *
synapse_gui_category_config_constructor (GType type,
                                         guint n_construct_properties,
                                         GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SynapseGuiCategoryConfig * self;
	GeeArrayList* _tmp0_;
	GeeHashMap* _tmp1_;
#line 97 "category.vala"
	parent_class = G_OBJECT_CLASS (synapse_gui_category_config_parent_class);
#line 97 "category.vala"
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
#line 97 "category.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SYNAPSE_GUI_TYPE_CATEGORY_CONFIG, SynapseGuiCategoryConfig);
#line 99 "category.vala"
	_tmp0_ = gee_array_list_new (SYNAPSE_GUI_CATEGORY_CONFIG_TYPE_CATEGORY, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
#line 99 "category.vala"
	_g_object_unref0 (self->priv->_categories);
#line 99 "category.vala"
	self->priv->_categories = (GeeList*) _tmp0_;
#line 100 "category.vala"
	_tmp1_ = gee_hash_map_new (SYNAPSE_TYPE_QUERY_FLAGS, NULL, NULL, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
#line 100 "category.vala"
	_g_object_unref0 (self->_labels);
#line 100 "category.vala"
	self->_labels = (GeeMap*) _tmp1_;
#line 101 "category.vala"
	synapse_gui_category_config_init_labels (self);
#line 102 "category.vala"
	synapse_gui_category_config_update_categories (self);
#line 97 "category.vala"
	return obj;
#line 992 "category.c"
}

static void
synapse_gui_category_config_class_init (SynapseGuiCategoryConfigClass * klass,
                                        gpointer klass_data)
{
#line 24 "category.vala"
	synapse_gui_category_config_parent_class = g_type_class_peek_parent (klass);
#line 24 "category.vala"
	g_type_class_adjust_private_offset (klass, &SynapseGuiCategoryConfig_private_offset);
#line 24 "category.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_synapse_gui_category_config_get_property;
#line 24 "category.vala"
	G_OBJECT_CLASS (klass)->set_property = _vala_synapse_gui_category_config_set_property;
#line 24 "category.vala"
	G_OBJECT_CLASS (klass)->constructor = synapse_gui_category_config_constructor;
#line 24 "category.vala"
	G_OBJECT_CLASS (klass)->finalize = synapse_gui_category_config_finalize;
#line 24 "category.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), SYNAPSE_GUI_CATEGORY_CONFIG_LIST_PROPERTY, synapse_gui_category_config_properties[SYNAPSE_GUI_CATEGORY_CONFIG_LIST_PROPERTY] = g_param_spec_boxed ("list", "list", "list", G_TYPE_STRV, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
#line 24 "category.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), SYNAPSE_GUI_CATEGORY_CONFIG_DEFAULT_CATEGORY_INDEX_PROPERTY, synapse_gui_category_config_properties[SYNAPSE_GUI_CATEGORY_CONFIG_DEFAULT_CATEGORY_INDEX_PROPERTY] = g_param_spec_int ("default-category-index", "default-category-index", "default-category-index", G_MININT, G_MAXINT, 3, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
#line 24 "category.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), SYNAPSE_GUI_CATEGORY_CONFIG_CATEGORIES_PROPERTY, synapse_gui_category_config_properties[SYNAPSE_GUI_CATEGORY_CONFIG_CATEGORIES_PROPERTY] = g_param_spec_object ("categories", "categories", "categories", GEE_TYPE_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
#line 24 "category.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), SYNAPSE_GUI_CATEGORY_CONFIG_LABELS_PROPERTY, synapse_gui_category_config_properties[SYNAPSE_GUI_CATEGORY_CONFIG_LABELS_PROPERTY] = g_param_spec_object ("labels", "labels", "labels", GEE_TYPE_MAP, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
#line 1019 "category.c"
}

static void
synapse_gui_category_config_instance_init (SynapseGuiCategoryConfig * self,
                                           gpointer klass)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar** _tmp10_;
#line 24 "category.vala"
	self->priv = synapse_gui_category_config_get_instance_private (self);
#line 64 "category.vala"
	_tmp0_ = synapse_gui_category_config_category_name_query_to_string (_ ("Actions"), SYNAPSE_QUERY_FLAGS_ACTIONS);
#line 64 "category.vala"
	_tmp1_ = synapse_gui_category_config_category_name_query_to_string (_ ("Audio"), SYNAPSE_QUERY_FLAGS_AUDIO);
#line 64 "category.vala"
	_tmp2_ = synapse_gui_category_config_category_name_query_to_string (_ ("Applications"), SYNAPSE_QUERY_FLAGS_APPLICATIONS);
#line 64 "category.vala"
	_tmp3_ = synapse_gui_category_config_category_name_query_to_string (_ ("All"), SYNAPSE_QUERY_FLAGS_ALL);
#line 64 "category.vala"
	_tmp4_ = synapse_gui_category_config_category_name_query_to_string (_ ("Places"), SYNAPSE_QUERY_FLAGS_PLACES);
#line 64 "category.vala"
	_tmp5_ = synapse_gui_category_config_category_name_query_to_string (_ ("Documents"), SYNAPSE_QUERY_FLAGS_DOCUMENTS);
#line 64 "category.vala"
	_tmp6_ = synapse_gui_category_config_category_name_query_to_string (_ ("Images"), SYNAPSE_QUERY_FLAGS_IMAGES);
#line 64 "category.vala"
	_tmp7_ = synapse_gui_category_config_category_name_query_to_string (_ ("Video"), SYNAPSE_QUERY_FLAGS_VIDEO);
#line 64 "category.vala"
	_tmp8_ = synapse_gui_category_config_category_name_query_to_string (_ ("Contacts"), SYNAPSE_QUERY_FLAGS_CONTACTS);
#line 64 "category.vala"
	_tmp9_ = synapse_gui_category_config_category_name_query_to_string (_ ("Internet"), SYNAPSE_QUERY_FLAGS_INTERNET | SYNAPSE_QUERY_FLAGS_INCLUDE_REMOTE);
#line 64 "category.vala"
	_tmp10_ = g_new0 (gchar*, 10 + 1);
#line 64 "category.vala"
	_tmp10_[0] = _tmp0_;
#line 64 "category.vala"
	_tmp10_[1] = _tmp1_;
#line 64 "category.vala"
	_tmp10_[2] = _tmp2_;
#line 64 "category.vala"
	_tmp10_[3] = _tmp3_;
#line 64 "category.vala"
	_tmp10_[4] = _tmp4_;
#line 64 "category.vala"
	_tmp10_[5] = _tmp5_;
#line 64 "category.vala"
	_tmp10_[6] = _tmp6_;
#line 64 "category.vala"
	_tmp10_[7] = _tmp7_;
#line 64 "category.vala"
	_tmp10_[8] = _tmp8_;
#line 64 "category.vala"
	_tmp10_[9] = _tmp9_;
#line 64 "category.vala"
	self->priv->_list = _tmp10_;
#line 64 "category.vala"
	self->priv->_list_length1 = 10;
#line 64 "category.vala"
	self->priv->__list_size_ = self->priv->_list_length1;
#line 79 "category.vala"
	self->priv->_default_category_index = 3;
#line 1089 "category.c"
}

static void
synapse_gui_category_config_finalize (GObject * obj)
{
	SynapseGuiCategoryConfig * self;
#line 24 "category.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SYNAPSE_GUI_TYPE_CATEGORY_CONFIG, SynapseGuiCategoryConfig);
#line 64 "category.vala"
	self->priv->_list = (_vala_array_free (self->priv->_list, self->priv->_list_length1, (GDestroyNotify) g_free), NULL);
#line 95 "category.vala"
	_g_object_unref0 (self->_labels);
#line 96 "category.vala"
	_g_object_unref0 (self->priv->_categories);
#line 24 "category.vala"
	G_OBJECT_CLASS (synapse_gui_category_config_parent_class)->finalize (obj);
#line 1106 "category.c"
}

static GType
synapse_gui_category_config_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SynapseGuiCategoryConfigClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) synapse_gui_category_config_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SynapseGuiCategoryConfig), 0, (GInstanceInitFunc) synapse_gui_category_config_instance_init, NULL };
	GType synapse_gui_category_config_type_id;
	synapse_gui_category_config_type_id = g_type_register_static (SYNAPSE_TYPE_CONFIG_OBJECT, "SynapseGuiCategoryConfig", &g_define_type_info, 0);
	SynapseGuiCategoryConfig_private_offset = g_type_add_instance_private (synapse_gui_category_config_type_id, sizeof (SynapseGuiCategoryConfigPrivate));
	return synapse_gui_category_config_type_id;
}

GType
synapse_gui_category_config_get_type (void)
{
	static volatile gsize synapse_gui_category_config_type_id__once = 0;
	if (g_once_init_enter (&synapse_gui_category_config_type_id__once)) {
		GType synapse_gui_category_config_type_id;
		synapse_gui_category_config_type_id = synapse_gui_category_config_get_type_once ();
		g_once_init_leave (&synapse_gui_category_config_type_id__once, synapse_gui_category_config_type_id);
	}
	return synapse_gui_category_config_type_id__once;
}

static void
_vala_synapse_gui_category_config_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec)
{
	SynapseGuiCategoryConfig * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SYNAPSE_GUI_TYPE_CATEGORY_CONFIG, SynapseGuiCategoryConfig);
#line 24 "category.vala"
	switch (property_id) {
#line 24 "category.vala"
		case SYNAPSE_GUI_CATEGORY_CONFIG_LIST_PROPERTY:
#line 1143 "category.c"
		{
			int length;
#line 24 "category.vala"
			g_value_set_boxed (value, synapse_gui_category_config_get_list (self, &length));
#line 1148 "category.c"
		}
#line 24 "category.vala"
		break;
#line 24 "category.vala"
		case SYNAPSE_GUI_CATEGORY_CONFIG_DEFAULT_CATEGORY_INDEX_PROPERTY:
#line 24 "category.vala"
		g_value_set_int (value, synapse_gui_category_config_get_default_category_index (self));
#line 24 "category.vala"
		break;
#line 24 "category.vala"
		case SYNAPSE_GUI_CATEGORY_CONFIG_CATEGORIES_PROPERTY:
#line 24 "category.vala"
		g_value_set_object (value, synapse_gui_category_config_get_categories (self));
#line 24 "category.vala"
		break;
#line 24 "category.vala"
		case SYNAPSE_GUI_CATEGORY_CONFIG_LABELS_PROPERTY:
#line 24 "category.vala"
		g_value_set_object (value, synapse_gui_category_config_get_labels (self));
#line 24 "category.vala"
		break;
#line 1170 "category.c"
		default:
#line 24 "category.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 24 "category.vala"
		break;
#line 1176 "category.c"
	}
}

static void
_vala_synapse_gui_category_config_set_property (GObject * object,
                                                guint property_id,
                                                const GValue * value,
                                                GParamSpec * pspec)
{
	SynapseGuiCategoryConfig * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SYNAPSE_GUI_TYPE_CATEGORY_CONFIG, SynapseGuiCategoryConfig);
#line 24 "category.vala"
	switch (property_id) {
#line 24 "category.vala"
		case SYNAPSE_GUI_CATEGORY_CONFIG_LIST_PROPERTY:
#line 1192 "category.c"
		{
			gpointer boxed;
#line 24 "category.vala"
			boxed = g_value_get_boxed (value);
#line 24 "category.vala"
			synapse_gui_category_config_set_list (self, boxed, (boxed == NULL) ? 0 : g_strv_length (boxed));
#line 1199 "category.c"
		}
#line 24 "category.vala"
		break;
#line 24 "category.vala"
		case SYNAPSE_GUI_CATEGORY_CONFIG_DEFAULT_CATEGORY_INDEX_PROPERTY:
#line 24 "category.vala"
		synapse_gui_category_config_set_default_category_index (self, g_value_get_int (value));
#line 24 "category.vala"
		break;
#line 1209 "category.c"
		default:
#line 24 "category.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 24 "category.vala"
		break;
#line 1215 "category.c"
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
#line 24 "synapse-main.vala"
	if ((array != NULL) && (destroy_func != NULL)) {
#line 1226 "category.c"
		gssize i;
#line 24 "synapse-main.vala"
		for (i = 0; i < array_length; i = i + 1) {
#line 24 "synapse-main.vala"
			if (((gpointer*) array)[i] != NULL) {
#line 24 "synapse-main.vala"
				destroy_func (((gpointer*) array)[i]);
#line 1234 "category.c"
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
#line 24 "synapse-main.vala"
	_vala_array_destroy (array, array_length, destroy_func);
#line 24 "synapse-main.vala"
	g_free (array);
#line 1249 "category.c"
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
#line 24 "synapse-main.vala"
	if (array) {
#line 24 "synapse-main.vala"
		while (((gpointer*) array)[length]) {
#line 24 "synapse-main.vala"
			length++;
#line 1263 "category.c"
		}
	}
#line 24 "synapse-main.vala"
	return length;
#line 1268 "category.c"
}

