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

/*
* Copyright (c) 2016-2019 elementary, Inc. (https://elementary.io)
*
* 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 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
*/

#include <gtk/gtk.h>
#include <glib-object.h>
#include "switchboard.h"
#include <gee.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <granite-7.h>
#include <gio/gio.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 SWITCHBOARD_TYPE_CATEGORY (switchboard_category_get_type ())
#define SWITCHBOARD_CATEGORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWITCHBOARD_TYPE_CATEGORY, SwitchboardCategory))
#define SWITCHBOARD_CATEGORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWITCHBOARD_TYPE_CATEGORY, SwitchboardCategoryClass))
#define SWITCHBOARD_IS_CATEGORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWITCHBOARD_TYPE_CATEGORY))
#define SWITCHBOARD_IS_CATEGORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWITCHBOARD_TYPE_CATEGORY))
#define SWITCHBOARD_CATEGORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWITCHBOARD_TYPE_CATEGORY, SwitchboardCategoryClass))

typedef struct _SwitchboardCategory SwitchboardCategory;
typedef struct _SwitchboardCategoryClass SwitchboardCategoryClass;
typedef struct _SwitchboardCategoryPrivate SwitchboardCategoryPrivate;
enum  {
	SWITCHBOARD_CATEGORY_0_PROPERTY,
	SWITCHBOARD_CATEGORY_CATEGORY_PROPERTY,
	SWITCHBOARD_CATEGORY_NUM_PROPERTIES
};
static GParamSpec* switchboard_category_properties[SWITCHBOARD_CATEGORY_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define SWITCHBOARD_TYPE_CATEGORY_ICON (switchboard_category_icon_get_type ())
#define SWITCHBOARD_CATEGORY_ICON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWITCHBOARD_TYPE_CATEGORY_ICON, SwitchboardCategoryIcon))
#define SWITCHBOARD_CATEGORY_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWITCHBOARD_TYPE_CATEGORY_ICON, SwitchboardCategoryIconClass))
#define SWITCHBOARD_IS_CATEGORY_ICON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWITCHBOARD_TYPE_CATEGORY_ICON))
#define SWITCHBOARD_IS_CATEGORY_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWITCHBOARD_TYPE_CATEGORY_ICON))
#define SWITCHBOARD_CATEGORY_ICON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWITCHBOARD_TYPE_CATEGORY_ICON, SwitchboardCategoryIconClass))

typedef struct _SwitchboardCategoryIcon SwitchboardCategoryIcon;
typedef struct _SwitchboardCategoryIconClass SwitchboardCategoryIconClass;
#define _g_free0(var) (var = (g_free (var), NULL))

#define SWITCHBOARD_TYPE_SWITCHBOARD_APP (switchboard_switchboard_app_get_type ())
#define SWITCHBOARD_SWITCHBOARD_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWITCHBOARD_TYPE_SWITCHBOARD_APP, SwitchboardSwitchboardApp))
#define SWITCHBOARD_SWITCHBOARD_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWITCHBOARD_TYPE_SWITCHBOARD_APP, SwitchboardSwitchboardAppClass))
#define SWITCHBOARD_IS_SWITCHBOARD_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWITCHBOARD_TYPE_SWITCHBOARD_APP))
#define SWITCHBOARD_IS_SWITCHBOARD_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWITCHBOARD_TYPE_SWITCHBOARD_APP))
#define SWITCHBOARD_SWITCHBOARD_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWITCHBOARD_TYPE_SWITCHBOARD_APP, SwitchboardSwitchboardAppClass))

typedef struct _SwitchboardSwitchboardApp SwitchboardSwitchboardApp;
typedef struct _SwitchboardSwitchboardAppClass SwitchboardSwitchboardAppClass;

struct _SwitchboardCategory {
	GtkGrid parent_instance;
	SwitchboardCategoryPrivate * priv;
};

struct _SwitchboardCategoryClass {
	GtkGridClass parent_class;
};

struct _SwitchboardCategoryPrivate {
	SwitchboardPlugCategory _category;
	GtkFlowBox* flowbox;
};

static gint SwitchboardCategory_private_offset;
static gpointer switchboard_category_parent_class = NULL;

VALA_EXTERN GType switchboard_category_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SwitchboardCategory, g_object_unref)
VALA_EXTERN SwitchboardCategory* switchboard_category_new (SwitchboardPlugCategory category);
VALA_EXTERN SwitchboardCategory* switchboard_category_construct (GType object_type,
                                                     SwitchboardPlugCategory category);
VALA_EXTERN GeeArrayList* switchboard_category_get_plugs (SwitchboardCategory* self);
VALA_EXTERN GType switchboard_category_icon_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SwitchboardCategoryIcon, g_object_unref)
VALA_EXTERN SwitchboardPlug* switchboard_category_icon_get_plug (SwitchboardCategoryIcon* self);
VALA_EXTERN void switchboard_category_add (SwitchboardCategory* self,
                               GtkWidget* widget);
VALA_EXTERN gboolean switchboard_category_has_child (SwitchboardCategory* self);
static gint switchboard_category_plug_sort_func (SwitchboardCategory* self,
                                          GtkFlowBoxChild* child_a,
                                          GtkFlowBoxChild* child_b);
VALA_EXTERN SwitchboardPlugCategory switchboard_category_get_category (SwitchboardCategory* self);
static void switchboard_category_set_category (SwitchboardCategory* self,
                                        SwitchboardPlugCategory value);
static GObject * switchboard_category_constructor (GType type,
                                            guint n_construct_properties,
                                            GObjectConstructParam * construct_properties);
VALA_EXTERN gchar* switchboard_category_view_get_category_name (SwitchboardPlugCategory category);
static void _switchboard_category___lambda7_ (SwitchboardCategory* self,
                                       GtkFlowBoxChild* child);
VALA_EXTERN GType switchboard_switchboard_app_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SwitchboardSwitchboardApp, g_object_unref)
VALA_EXTERN void switchboard_switchboard_app_load_plug (SwitchboardSwitchboardApp* self,
                                            SwitchboardPlug* plug);
static void __switchboard_category___lambda7__gtk_flow_box_child_activated (GtkFlowBox* _sender,
                                                                     GtkFlowBoxChild* child,
                                                                     gpointer self);
static gint _switchboard_category_plug_sort_func_gtk_flow_box_sort_func (GtkFlowBoxChild* child1,
                                                                  GtkFlowBoxChild* child2,
                                                                  gpointer self);
static void switchboard_category_finalize (GObject * obj);
static GType switchboard_category_get_type_once (void);
static void _vala_switchboard_category_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec);
static void _vala_switchboard_category_set_property (GObject * object,
                                              guint property_id,
                                              const GValue * value,
                                              GParamSpec * pspec);

static inline gpointer
switchboard_category_get_instance_private (SwitchboardCategory* self)
{
	return G_STRUCT_MEMBER_P (self, SwitchboardCategory_private_offset);
}

SwitchboardCategory*
switchboard_category_construct (GType object_type,
                                SwitchboardPlugCategory category)
{
	SwitchboardCategory * self = NULL;
	self = (SwitchboardCategory*) g_object_new (object_type, "category", category, NULL);
	return self;
}

SwitchboardCategory*
switchboard_category_new (SwitchboardPlugCategory category)
{
	return switchboard_category_construct (SWITCHBOARD_TYPE_CATEGORY, category);
}

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

GeeArrayList*
switchboard_category_get_plugs (SwitchboardCategory* self)
{
	GeeArrayList* plugs = NULL;
	GeeArrayList* _tmp0_;
	GtkWidget* child = NULL;
	GtkFlowBox* _tmp1_;
	GtkWidget* _tmp2_;
	GtkWidget* _tmp3_;
	GeeArrayList* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = gee_array_list_new (SWITCHBOARD_TYPE_PLUG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	plugs = _tmp0_;
	_tmp1_ = self->priv->flowbox;
	_tmp2_ = gtk_widget_get_first_child ((GtkWidget*) _tmp1_);
	_tmp3_ = _g_object_ref0 (_tmp2_);
	child = _tmp3_;
	while (TRUE) {
		GtkWidget* _tmp4_;
		GeeArrayList* _tmp5_;
		GtkWidget* _tmp6_;
		SwitchboardPlug* _tmp7_;
		SwitchboardPlug* _tmp8_;
		GtkWidget* _tmp9_;
		GtkWidget* _tmp10_;
		GtkWidget* _tmp11_;
		_tmp4_ = child;
		if (!(_tmp4_ != NULL)) {
			break;
		}
		_tmp5_ = plugs;
		_tmp6_ = child;
		_tmp7_ = switchboard_category_icon_get_plug (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, SWITCHBOARD_TYPE_CATEGORY_ICON, SwitchboardCategoryIcon));
		_tmp8_ = _tmp7_;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp5_, _tmp8_);
		_tmp9_ = child;
		_tmp10_ = gtk_widget_get_next_sibling (_tmp9_);
		_tmp11_ = _g_object_ref0 (_tmp10_);
		_g_object_unref0 (child);
		child = _tmp11_;
	}
	result = plugs;
	_g_object_unref0 (child);
	return result;
}

void
switchboard_category_add (SwitchboardCategory* self,
                          GtkWidget* widget)
{
	GtkFlowBox* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (widget != NULL);
	_tmp0_ = self->priv->flowbox;
	gtk_flow_box_append (_tmp0_, widget);
}

gboolean
switchboard_category_has_child (SwitchboardCategory* self)
{
	GtkWidget* child = NULL;
	GtkFlowBox* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->flowbox;
	_tmp1_ = gtk_widget_get_first_child ((GtkWidget*) _tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	child = _tmp2_;
	while (TRUE) {
		GtkWidget* _tmp3_;
		GtkWidget* _tmp4_;
		GtkWidget* _tmp5_;
		GtkWidget* _tmp6_;
		GtkWidget* _tmp7_;
		_tmp3_ = child;
		if (!(_tmp3_ != NULL)) {
			break;
		}
		_tmp4_ = child;
		if (gtk_widget_get_child_visible (_tmp4_)) {
			gtk_widget_show ((GtkWidget*) self);
			result = TRUE;
			_g_object_unref0 (child);
			return result;
		}
		_tmp5_ = child;
		_tmp6_ = gtk_widget_get_next_sibling (_tmp5_);
		_tmp7_ = _g_object_ref0 (_tmp6_);
		_g_object_unref0 (child);
		child = _tmp7_;
	}
	gtk_widget_hide ((GtkWidget*) self);
	result = FALSE;
	_g_object_unref0 (child);
	return result;
}

static gint
switchboard_category_plug_sort_func (SwitchboardCategory* self,
                                     GtkFlowBoxChild* child_a,
                                     GtkFlowBoxChild* child_b)
{
	gchar* plug_name_a = NULL;
	SwitchboardPlug* _tmp0_;
	SwitchboardPlug* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* plug_name_b = NULL;
	SwitchboardPlug* _tmp5_;
	SwitchboardPlug* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	GCompareFunc _tmp10_;
	gint result;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (child_a != NULL, 0);
	g_return_val_if_fail (child_b != NULL, 0);
	_tmp0_ = switchboard_category_icon_get_plug (G_TYPE_CHECK_INSTANCE_CAST (child_a, SWITCHBOARD_TYPE_CATEGORY_ICON, SwitchboardCategoryIcon));
	_tmp1_ = _tmp0_;
	_tmp2_ = switchboard_plug_get_display_name (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_strdup (_tmp3_);
	plug_name_a = _tmp4_;
	_tmp5_ = switchboard_category_icon_get_plug (G_TYPE_CHECK_INSTANCE_CAST (child_b, SWITCHBOARD_TYPE_CATEGORY_ICON, SwitchboardCategoryIcon));
	_tmp6_ = _tmp5_;
	_tmp7_ = switchboard_plug_get_display_name (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = g_strdup (_tmp8_);
	plug_name_b = _tmp9_;
	_tmp10_ = ((GCompareFunc) g_strcmp0);
	result = _tmp10_ (plug_name_a, plug_name_b);
	_g_free0 (plug_name_b);
	_g_free0 (plug_name_a);
	return result;
}

SwitchboardPlugCategory
switchboard_category_get_category (SwitchboardCategory* self)
{
	SwitchboardPlugCategory result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_category;
	return result;
}

static void
switchboard_category_set_category (SwitchboardCategory* self,
                                   SwitchboardPlugCategory value)
{
	SwitchboardPlugCategory old_value;
	g_return_if_fail (self != NULL);
	old_value = switchboard_category_get_category (self);
	if (old_value != value) {
		self->priv->_category = value;
		g_object_notify_by_pspec ((GObject *) self, switchboard_category_properties[SWITCHBOARD_CATEGORY_CATEGORY_PROPERTY]);
	}
}

static void
_switchboard_category___lambda7_ (SwitchboardCategory* self,
                                  GtkFlowBoxChild* child)
{
	GApplication* _tmp0_;
	SwitchboardPlug* _tmp1_;
	SwitchboardPlug* _tmp2_;
	g_return_if_fail (child != NULL);
	_tmp0_ = g_application_get_default ();
	_tmp1_ = switchboard_category_icon_get_plug (G_TYPE_CHECK_INSTANCE_CAST (child, SWITCHBOARD_TYPE_CATEGORY_ICON, SwitchboardCategoryIcon));
	_tmp2_ = _tmp1_;
	switchboard_switchboard_app_load_plug (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SWITCHBOARD_TYPE_SWITCHBOARD_APP, SwitchboardSwitchboardApp), _tmp2_);
}

static void
__switchboard_category___lambda7__gtk_flow_box_child_activated (GtkFlowBox* _sender,
                                                                GtkFlowBoxChild* child,
                                                                gpointer self)
{
	_switchboard_category___lambda7_ ((SwitchboardCategory*) self, child);
}

static gint
_switchboard_category_plug_sort_func_gtk_flow_box_sort_func (GtkFlowBoxChild* child1,
                                                             GtkFlowBoxChild* child2,
                                                             gpointer self)
{
	gint result;
	result = switchboard_category_plug_sort_func ((SwitchboardCategory*) self, child1, child2);
	return result;
}

static GObject *
switchboard_category_constructor (GType type,
                                  guint n_construct_properties,
                                  GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SwitchboardCategory * self;
	GraniteHeaderLabel* category_label = NULL;
	SwitchboardPlugCategory _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	GraniteHeaderLabel* _tmp3_;
	GraniteHeaderLabel* _tmp4_;
	GtkFlowBox* _tmp5_ = NULL;
	GraniteHeaderLabel* _tmp6_;
	GtkFlowBox* _tmp7_;
	GtkFlowBox* _tmp8_;
	GtkFlowBox* _tmp9_;
	parent_class = G_OBJECT_CLASS (switchboard_category_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SWITCHBOARD_TYPE_CATEGORY, SwitchboardCategory);
	_tmp0_ = self->priv->_category;
	_tmp1_ = switchboard_category_view_get_category_name (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = granite_header_label_new (_tmp2_);
	g_object_ref_sink (_tmp3_);
	_tmp4_ = _tmp3_;
	_g_free0 (_tmp2_);
	category_label = _tmp4_;
	_tmp5_ = (GtkFlowBox*) gtk_flow_box_new ();
	gtk_flow_box_set_activate_on_single_click (_tmp5_, TRUE);
	gtk_flow_box_set_column_spacing (_tmp5_, (guint) 12);
	gtk_flow_box_set_row_spacing (_tmp5_, (guint) 12);
	gtk_flow_box_set_homogeneous (_tmp5_, TRUE);
	gtk_flow_box_set_max_children_per_line (_tmp5_, (guint) 5);
	gtk_flow_box_set_selection_mode (_tmp5_, GTK_SELECTION_NONE);
	g_object_ref_sink (_tmp5_);
	_g_object_unref0 (self->priv->flowbox);
	self->priv->flowbox = _tmp5_;
	gtk_widget_set_valign ((GtkWidget*) self, GTK_ALIGN_START);
	gtk_grid_set_column_spacing ((GtkGrid*) self, 3);
	gtk_grid_set_row_spacing ((GtkGrid*) self, 6);
	_tmp6_ = category_label;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp6_, 0, 0, 1, 1);
	_tmp7_ = self->priv->flowbox;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp7_, 0, 1, 2, 1);
	_tmp8_ = self->priv->flowbox;
	g_signal_connect_object (_tmp8_, "child-activated", (GCallback) __switchboard_category___lambda7__gtk_flow_box_child_activated, self, 0);
	_tmp9_ = self->priv->flowbox;
	gtk_flow_box_set_sort_func (_tmp9_, _switchboard_category_plug_sort_func_gtk_flow_box_sort_func, g_object_ref (self), g_object_unref);
	_g_object_unref0 (category_label);
	return obj;
}

static void
switchboard_category_class_init (SwitchboardCategoryClass * klass,
                                 gpointer klass_data)
{
	switchboard_category_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SwitchboardCategory_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_switchboard_category_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_switchboard_category_set_property;
	G_OBJECT_CLASS (klass)->constructor = switchboard_category_constructor;
	G_OBJECT_CLASS (klass)->finalize = switchboard_category_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SWITCHBOARD_CATEGORY_CATEGORY_PROPERTY, switchboard_category_properties[SWITCHBOARD_CATEGORY_CATEGORY_PROPERTY] = g_param_spec_enum ("category", "category", "category", SWITCHBOARD_PLUG_TYPE_CATEGORY, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
switchboard_category_instance_init (SwitchboardCategory * self,
                                    gpointer klass)
{
	self->priv = switchboard_category_get_instance_private (self);
}

static void
switchboard_category_finalize (GObject * obj)
{
	SwitchboardCategory * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SWITCHBOARD_TYPE_CATEGORY, SwitchboardCategory);
	_g_object_unref0 (self->priv->flowbox);
	G_OBJECT_CLASS (switchboard_category_parent_class)->finalize (obj);
}

static GType
switchboard_category_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SwitchboardCategoryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) switchboard_category_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SwitchboardCategory), 0, (GInstanceInitFunc) switchboard_category_instance_init, NULL };
	GType switchboard_category_type_id;
	switchboard_category_type_id = g_type_register_static (gtk_grid_get_type (), "SwitchboardCategory", &g_define_type_info, 0);
	SwitchboardCategory_private_offset = g_type_add_instance_private (switchboard_category_type_id, sizeof (SwitchboardCategoryPrivate));
	return switchboard_category_type_id;
}

GType
switchboard_category_get_type (void)
{
	static volatile gsize switchboard_category_type_id__once = 0;
	if (g_once_init_enter (&switchboard_category_type_id__once)) {
		GType switchboard_category_type_id;
		switchboard_category_type_id = switchboard_category_get_type_once ();
		g_once_init_leave (&switchboard_category_type_id__once, switchboard_category_type_id);
	}
	return switchboard_category_type_id__once;
}

static void
_vala_switchboard_category_get_property (GObject * object,
                                         guint property_id,
                                         GValue * value,
                                         GParamSpec * pspec)
{
	SwitchboardCategory * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SWITCHBOARD_TYPE_CATEGORY, SwitchboardCategory);
	switch (property_id) {
		case SWITCHBOARD_CATEGORY_CATEGORY_PROPERTY:
		g_value_set_enum (value, switchboard_category_get_category (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_switchboard_category_set_property (GObject * object,
                                         guint property_id,
                                         const GValue * value,
                                         GParamSpec * pspec)
{
	SwitchboardCategory * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SWITCHBOARD_TYPE_CATEGORY, SwitchboardCategory);
	switch (property_id) {
		case SWITCHBOARD_CATEGORY_CATEGORY_PROPERTY:
		switchboard_category_set_category (self, g_value_get_enum (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

