/* sidebar.c generated by valac 0.16.0.2-f2187, the Vala compiler
 * generated from sidebar.vala, do not modify */

/* This file is part of GNOME Boxes. License: LGPLv2+*/

#include <glib.h>
#include <glib-object.h>
#include <clutter/clutter.h>
#include <gtk/gtk.h>
#include <clutter-gtk/clutter-gtk.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include <float.h>
#include <math.h>


#define BOXES_TYPE_SIDEBAR_PAGE (boxes_sidebar_page_get_type ())

#define BOXES_TYPE_UI (boxes_ui_get_type ())
#define BOXES_UI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_UI, BoxesUI))
#define BOXES_UI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_UI, BoxesUIClass))
#define BOXES_IS_UI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_UI))
#define BOXES_IS_UI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_UI))
#define BOXES_UI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_UI, BoxesUIClass))

typedef struct _BoxesUI BoxesUI;
typedef struct _BoxesUIClass BoxesUIClass;
typedef struct _BoxesUIPrivate BoxesUIPrivate;

#define BOXES_TYPE_UI_STATE (boxes_ui_state_get_type ())

#define BOXES_TYPE_SIDEBAR (boxes_sidebar_get_type ())
#define BOXES_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_SIDEBAR, BoxesSidebar))
#define BOXES_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_SIDEBAR, BoxesSidebarClass))
#define BOXES_IS_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_SIDEBAR))
#define BOXES_IS_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_SIDEBAR))
#define BOXES_SIDEBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_SIDEBAR, BoxesSidebarClass))

typedef struct _BoxesSidebar BoxesSidebar;
typedef struct _BoxesSidebarClass BoxesSidebarClass;
typedef struct _BoxesSidebarPrivate BoxesSidebarPrivate;

#define BOXES_TYPE_CATEGORY (boxes_category_get_type ())
#define BOXES_CATEGORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_CATEGORY, BoxesCategory))
#define BOXES_CATEGORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_CATEGORY, BoxesCategoryClass))
#define BOXES_IS_CATEGORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_CATEGORY))
#define BOXES_IS_CATEGORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_CATEGORY))
#define BOXES_CATEGORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_CATEGORY, BoxesCategoryClass))

typedef struct _BoxesCategory BoxesCategory;
typedef struct _BoxesCategoryClass BoxesCategoryClass;

#define BOXES_TYPE_APP (boxes_app_get_type ())
#define BOXES_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_APP, BoxesApp))
#define BOXES_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_APP, BoxesAppClass))
#define BOXES_IS_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_APP))
#define BOXES_IS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_APP))
#define BOXES_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_APP, BoxesAppClass))

typedef struct _BoxesApp BoxesApp;
typedef struct _BoxesAppClass BoxesAppClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _BoxesCategoryPrivate BoxesCategoryPrivate;

#define BOXES_CATEGORY_TYPE_KIND (boxes_category_kind_get_type ())
typedef struct _BoxesAppPrivate BoxesAppPrivate;

#define BOXES_TYPE_COLLECTION_ITEM (boxes_collection_item_get_type ())
#define BOXES_COLLECTION_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_COLLECTION_ITEM, BoxesCollectionItem))
#define BOXES_COLLECTION_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_COLLECTION_ITEM, BoxesCollectionItemClass))
#define BOXES_IS_COLLECTION_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_COLLECTION_ITEM))
#define BOXES_IS_COLLECTION_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_COLLECTION_ITEM))
#define BOXES_COLLECTION_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_COLLECTION_ITEM, BoxesCollectionItemClass))

typedef struct _BoxesCollectionItem BoxesCollectionItem;
typedef struct _BoxesCollectionItemClass BoxesCollectionItemClass;

#define BOXES_TYPE_TOPBAR (boxes_topbar_get_type ())
#define BOXES_TOPBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_TOPBAR, BoxesTopbar))
#define BOXES_TOPBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_TOPBAR, BoxesTopbarClass))
#define BOXES_IS_TOPBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_TOPBAR))
#define BOXES_IS_TOPBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_TOPBAR))
#define BOXES_TOPBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_TOPBAR, BoxesTopbarClass))

typedef struct _BoxesTopbar BoxesTopbar;
typedef struct _BoxesTopbarClass BoxesTopbarClass;

#define BOXES_TYPE_NOTIFICATIONBAR (boxes_notificationbar_get_type ())
#define BOXES_NOTIFICATIONBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_NOTIFICATIONBAR, BoxesNotificationbar))
#define BOXES_NOTIFICATIONBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_NOTIFICATIONBAR, BoxesNotificationbarClass))
#define BOXES_IS_NOTIFICATIONBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_NOTIFICATIONBAR))
#define BOXES_IS_NOTIFICATIONBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_NOTIFICATIONBAR))
#define BOXES_NOTIFICATIONBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_NOTIFICATIONBAR, BoxesNotificationbarClass))

typedef struct _BoxesNotificationbar BoxesNotificationbar;
typedef struct _BoxesNotificationbarClass BoxesNotificationbarClass;

#define BOXES_TYPE_SELECTIONBAR (boxes_selectionbar_get_type ())
#define BOXES_SELECTIONBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_SELECTIONBAR, BoxesSelectionbar))
#define BOXES_SELECTIONBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_SELECTIONBAR, BoxesSelectionbarClass))
#define BOXES_IS_SELECTIONBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_SELECTIONBAR))
#define BOXES_IS_SELECTIONBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_SELECTIONBAR))
#define BOXES_SELECTIONBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_SELECTIONBAR, BoxesSelectionbarClass))

typedef struct _BoxesSelectionbar BoxesSelectionbar;
typedef struct _BoxesSelectionbarClass BoxesSelectionbarClass;

#define BOXES_TYPE_WIZARD (boxes_wizard_get_type ())
#define BOXES_WIZARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_WIZARD, BoxesWizard))
#define BOXES_WIZARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_WIZARD, BoxesWizardClass))
#define BOXES_IS_WIZARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_WIZARD))
#define BOXES_IS_WIZARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_WIZARD))
#define BOXES_WIZARD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_WIZARD, BoxesWizardClass))

typedef struct _BoxesWizard BoxesWizard;
typedef struct _BoxesWizardClass BoxesWizardClass;

#define BOXES_TYPE_PROPERTIES (boxes_properties_get_type ())
#define BOXES_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_PROPERTIES, BoxesProperties))
#define BOXES_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_PROPERTIES, BoxesPropertiesClass))
#define BOXES_IS_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_PROPERTIES))
#define BOXES_IS_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_PROPERTIES))
#define BOXES_PROPERTIES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_PROPERTIES, BoxesPropertiesClass))

typedef struct _BoxesProperties BoxesProperties;
typedef struct _BoxesPropertiesClass BoxesPropertiesClass;

#define BOXES_TYPE_DISPLAY_PAGE (boxes_display_page_get_type ())
#define BOXES_DISPLAY_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_DISPLAY_PAGE, BoxesDisplayPage))
#define BOXES_DISPLAY_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_DISPLAY_PAGE, BoxesDisplayPageClass))
#define BOXES_IS_DISPLAY_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_DISPLAY_PAGE))
#define BOXES_IS_DISPLAY_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_DISPLAY_PAGE))
#define BOXES_DISPLAY_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_DISPLAY_PAGE, BoxesDisplayPageClass))

typedef struct _BoxesDisplayPage BoxesDisplayPage;
typedef struct _BoxesDisplayPageClass BoxesDisplayPageClass;

#define BOXES_TYPE_COLLECTION (boxes_collection_get_type ())
#define BOXES_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_COLLECTION, BoxesCollection))
#define BOXES_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_COLLECTION, BoxesCollectionClass))
#define BOXES_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_COLLECTION))
#define BOXES_IS_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_COLLECTION))
#define BOXES_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_COLLECTION, BoxesCollectionClass))

typedef struct _BoxesCollection BoxesCollection;
typedef struct _BoxesCollectionClass BoxesCollectionClass;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _gtk_tree_path_free0(var) ((var == NULL) ? NULL : (var = (gtk_tree_path_free (var), NULL)))

typedef enum  {
	BOXES_SIDEBAR_PAGE_COLLECTION,
	BOXES_SIDEBAR_PAGE_WIZARD,
	BOXES_SIDEBAR_PAGE_PROPERTIES
} BoxesSidebarPage;

typedef enum  {
	BOXES_UI_STATE_NONE,
	BOXES_UI_STATE_COLLECTION,
	BOXES_UI_STATE_CREDS,
	BOXES_UI_STATE_DISPLAY,
	BOXES_UI_STATE_SETTINGS,
	BOXES_UI_STATE_WIZARD,
	BOXES_UI_STATE_PROPERTIES
} BoxesUIState;

struct _BoxesUI {
	GObject parent_instance;
	BoxesUIPrivate * priv;
	BoxesUIState previous_ui_state;
};

struct _BoxesUIClass {
	GObjectClass parent_class;
	void (*ui_state_changed) (BoxesUI* self);
	ClutterActor* (*get_actor) (BoxesUI* self);
};

struct _BoxesSidebar {
	BoxesUI parent_instance;
	BoxesSidebarPrivate * priv;
	GtkNotebook* notebook;
	GtkTreeView* default_tree_view;
	GtkTreeView* user_tree_view;
	BoxesCategory* category;
};

struct _BoxesSidebarClass {
	BoxesUIClass parent_class;
};

struct _BoxesSidebarPrivate {
	BoxesApp* app;
	guint width;
	GtkClutterActor* gtk_actor;
};

typedef enum  {
	BOXES_CATEGORY_KIND_USER,
	BOXES_CATEGORY_KIND_NEW,
	BOXES_CATEGORY_KIND_FAVORITES,
	BOXES_CATEGORY_KIND_PRIVATE,
	BOXES_CATEGORY_KIND_SHARED
} BoxesCategoryKind;

struct _BoxesCategory {
	GObject parent_instance;
	BoxesCategoryPrivate * priv;
	gchar* name;
	BoxesCategoryKind kind;
};

struct _BoxesCategoryClass {
	GObjectClass parent_class;
};

struct _BoxesApp {
	BoxesUI parent_instance;
	BoxesAppPrivate * priv;
	GtkApplicationWindow* window;
	GtkNotebook* notebook;
	GtkClutterEmbed* embed;
	ClutterStage* stage;
	ClutterState* state;
	ClutterBox* box;
	BoxesCollectionItem* current_item;
	BoxesTopbar* topbar;
	BoxesNotificationbar* notificationbar;
	BoxesSidebar* sidebar;
	BoxesSelectionbar* selectionbar;
	guint duration;
	GSettings* settings;
	BoxesWizard* wizard;
	BoxesProperties* properties;
	BoxesDisplayPage* display_page;
	BoxesCollection* collection;
	GSimpleAction* action_properties;
	GSimpleAction* action_fullscreen;
};

struct _BoxesAppClass {
	BoxesUIClass parent_class;
};


static gpointer boxes_sidebar_parent_class = NULL;

GType boxes_sidebar_page_get_type (void) G_GNUC_CONST;
GType boxes_ui_get_type (void) G_GNUC_CONST;
GType boxes_ui_state_get_type (void) G_GNUC_CONST;
GType boxes_sidebar_get_type (void) G_GNUC_CONST;
GType boxes_category_get_type (void) G_GNUC_CONST;
GType boxes_app_get_type (void) G_GNUC_CONST;
#define BOXES_SIDEBAR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_SIDEBAR, BoxesSidebarPrivate))
enum  {
	BOXES_SIDEBAR_DUMMY_PROPERTY,
	BOXES_SIDEBAR_ACTOR
};
static gboolean boxes_sidebar_selection_func (BoxesSidebar* self, GtkTreeSelection* selection, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected);
BoxesSidebar* boxes_sidebar_new (BoxesApp* app);
BoxesSidebar* boxes_sidebar_construct (GType object_type, BoxesApp* app);
BoxesUI* boxes_ui_construct (GType object_type);
static void boxes_sidebar_setup_sidebar (BoxesSidebar* self);
static void boxes_sidebar_real_ui_state_changed (BoxesUI* base);
BoxesUIState boxes_ui_get_ui_state (BoxesUI* self);
void boxes_actor_pin (ClutterActor* actor);
ClutterActor* boxes_ui_get_actor (BoxesUI* self);
static void boxes_sidebar_list_append (BoxesSidebar* self, GtkListStore* listmodel, BoxesCategory* category, const gchar* icon, guint height, gboolean sensitive);
GType boxes_category_kind_get_type (void) G_GNUC_CONST;
static GtkTreeView* boxes_sidebar_make_tree_view (BoxesSidebar* self);
static gboolean _boxes_sidebar_selection_func_gtk_tree_selection_func (GtkTreeSelection* selection, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected, gpointer self);
void boxes_tree_view_activate_on_single_click (GtkTreeView* tree_view, gboolean should_activate);
static void __lambda94_ (BoxesSidebar* self, GtkTreeView* treeview, GtkTreePath* path, GtkTreeViewColumn* column);
void boxes_app_set_category (BoxesApp* self, BoxesCategory* category);
static void ___lambda94__gtk_tree_view_row_activated (GtkTreeView* _sender, GtkTreePath* path, GtkTreeViewColumn* column, gpointer self);
static void boxes_sidebar_update_user_tree (BoxesSidebar* self);
GType boxes_collection_item_get_type (void) G_GNUC_CONST;
GType boxes_topbar_get_type (void) G_GNUC_CONST;
GType boxes_notificationbar_get_type (void) G_GNUC_CONST;
GType boxes_selectionbar_get_type (void) G_GNUC_CONST;
GType boxes_wizard_get_type (void) G_GNUC_CONST;
GType boxes_properties_get_type (void) G_GNUC_CONST;
GType boxes_display_page_get_type (void) G_GNUC_CONST;
GType boxes_collection_get_type (void) G_GNUC_CONST;
BoxesCategory* boxes_category_new (const gchar* name, BoxesCategoryKind kind);
BoxesCategory* boxes_category_construct (GType object_type, const gchar* name, BoxesCategoryKind kind);
static void __lambda95_ (BoxesSidebar* self);
void boxes_ui_set_ui_state (BoxesUI* self, BoxesUIState value);
static void ___lambda95__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void boxes_sidebar_finalize (GObject* obj);
static void _vala_boxes_sidebar_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static gint _vala_array_length (gpointer array);


GType boxes_sidebar_page_get_type (void) {
	static volatile gsize boxes_sidebar_page_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_sidebar_page_type_id__volatile)) {
		static const GEnumValue values[] = {{BOXES_SIDEBAR_PAGE_COLLECTION, "BOXES_SIDEBAR_PAGE_COLLECTION", "collection"}, {BOXES_SIDEBAR_PAGE_WIZARD, "BOXES_SIDEBAR_PAGE_WIZARD", "wizard"}, {BOXES_SIDEBAR_PAGE_PROPERTIES, "BOXES_SIDEBAR_PAGE_PROPERTIES", "properties"}, {0, NULL, NULL}};
		GType boxes_sidebar_page_type_id;
		boxes_sidebar_page_type_id = g_enum_register_static ("BoxesSidebarPage", values);
		g_once_init_leave (&boxes_sidebar_page_type_id__volatile, boxes_sidebar_page_type_id);
	}
	return boxes_sidebar_page_type_id__volatile;
}


static gboolean boxes_sidebar_selection_func (BoxesSidebar* self, GtkTreeSelection* selection, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected) {
	gboolean result = FALSE;
	GtkTreeIter iter = {0};
	gboolean selectable = FALSE;
	GtkTreeModel* _tmp0_;
	GtkTreePath* _tmp1_;
	GtkTreeIter _tmp2_ = {0};
	GtkTreeModel* _tmp3_;
	GtkTreeIter _tmp4_;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (selection != NULL, FALSE);
	g_return_val_if_fail (model != NULL, FALSE);
	g_return_val_if_fail (path != NULL, FALSE);
	_tmp0_ = model;
	_tmp1_ = path;
	gtk_tree_model_get_iter (_tmp0_, &_tmp2_, _tmp1_);
	iter = _tmp2_;
	_tmp3_ = model;
	_tmp4_ = iter;
	gtk_tree_model_get (_tmp3_, &_tmp4_, 2, &selectable, -1);
	result = selectable;
	return result;
}


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


BoxesSidebar* boxes_sidebar_construct (GType object_type, BoxesApp* app) {
	BoxesSidebar * self = NULL;
	BoxesApp* _tmp0_;
	BoxesApp* _tmp1_;
	g_return_val_if_fail (app != NULL, NULL);
	self = (BoxesSidebar*) boxes_ui_construct (object_type);
	_tmp0_ = app;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->app);
	self->priv->app = _tmp1_;
	self->priv->width = (guint) 200;
	boxes_sidebar_setup_sidebar (self);
	return self;
}


BoxesSidebar* boxes_sidebar_new (BoxesApp* app) {
	return boxes_sidebar_construct (BOXES_TYPE_SIDEBAR, app);
}


static void boxes_sidebar_real_ui_state_changed (BoxesUI* base) {
	BoxesSidebar * self;
	BoxesUIState _tmp0_;
	BoxesUIState _tmp1_;
	self = (BoxesSidebar*) base;
	_tmp0_ = boxes_ui_get_ui_state ((BoxesUI*) self);
	_tmp1_ = _tmp0_;
	switch (_tmp1_) {
		case BOXES_UI_STATE_COLLECTION:
		{
			GtkNotebook* _tmp2_;
			_tmp2_ = self->notebook;
			g_object_set (_tmp2_, "page", (gint) BOXES_SIDEBAR_PAGE_COLLECTION, NULL);
			break;
		}
		case BOXES_UI_STATE_DISPLAY:
		{
			ClutterActor* _tmp3_;
			ClutterActor* _tmp4_;
			_tmp3_ = boxes_ui_get_actor ((BoxesUI*) self);
			_tmp4_ = _tmp3_;
			boxes_actor_pin (_tmp4_);
			break;
		}
		case BOXES_UI_STATE_WIZARD:
		case BOXES_UI_STATE_PROPERTIES:
		{
			BoxesSidebarPage _tmp5_ = 0;
			BoxesUIState _tmp6_;
			BoxesUIState _tmp7_;
			GtkNotebook* _tmp8_;
			BoxesSidebarPage _tmp9_;
			_tmp6_ = boxes_ui_get_ui_state ((BoxesUI*) self);
			_tmp7_ = _tmp6_;
			if (_tmp7_ == BOXES_UI_STATE_WIZARD) {
				_tmp5_ = BOXES_SIDEBAR_PAGE_WIZARD;
			} else {
				_tmp5_ = BOXES_SIDEBAR_PAGE_PROPERTIES;
			}
			_tmp8_ = self->notebook;
			_tmp9_ = _tmp5_;
			g_object_set (_tmp8_, "page", (gint) _tmp9_, NULL);
			break;
		}
		default:
		break;
	}
}


static void boxes_sidebar_list_append (BoxesSidebar* self, GtkListStore* listmodel, BoxesCategory* category, const gchar* icon, guint height, gboolean sensitive) {
	GtkTreeIter iter = {0};
	GtkListStore* _tmp0_;
	GtkTreeIter _tmp1_ = {0};
	GtkListStore* _tmp2_;
	GtkTreeIter _tmp3_;
	BoxesCategory* _tmp4_;
	const gchar* _tmp5_;
	GtkListStore* _tmp6_;
	GtkTreeIter _tmp7_;
	guint _tmp8_;
	GtkListStore* _tmp9_;
	GtkTreeIter _tmp10_;
	gboolean _tmp11_;
	GtkListStore* _tmp12_;
	GtkTreeIter _tmp13_;
	const gchar* _tmp14_;
	GtkListStore* _tmp15_;
	GtkTreeIter _tmp16_;
	BoxesCategory* _tmp17_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (listmodel != NULL);
	g_return_if_fail (category != NULL);
	_tmp0_ = listmodel;
	gtk_list_store_append (_tmp0_, &_tmp1_);
	iter = _tmp1_;
	_tmp2_ = listmodel;
	_tmp3_ = iter;
	_tmp4_ = category;
	_tmp5_ = _tmp4_->name;
	gtk_list_store_set (_tmp2_, &_tmp3_, 0, _tmp5_, -1);
	_tmp6_ = listmodel;
	_tmp7_ = iter;
	_tmp8_ = height;
	gtk_list_store_set (_tmp6_, &_tmp7_, 1, _tmp8_, -1);
	_tmp9_ = listmodel;
	_tmp10_ = iter;
	_tmp11_ = sensitive;
	gtk_list_store_set (_tmp9_, &_tmp10_, 2, _tmp11_, -1);
	_tmp12_ = listmodel;
	_tmp13_ = iter;
	_tmp14_ = icon;
	gtk_list_store_set (_tmp12_, &_tmp13_, 3, _tmp14_, -1);
	_tmp15_ = listmodel;
	_tmp16_ = iter;
	_tmp17_ = category;
	gtk_list_store_set (_tmp15_, &_tmp16_, 4, _tmp17_, -1);
}


static gboolean _boxes_sidebar_selection_func_gtk_tree_selection_func (GtkTreeSelection* selection, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected, gpointer self) {
	gboolean result;
	result = boxes_sidebar_selection_func (self, selection, model, path, path_currently_selected);
	return result;
}


static void __lambda94_ (BoxesSidebar* self, GtkTreeView* treeview, GtkTreePath* path, GtkTreeViewColumn* column) {
	GtkTreeIter iter = {0};
	BoxesCategory* category = NULL;
	GtkTreeView* _tmp0_;
	GtkTreeModel* _tmp1_ = NULL;
	GtkTreeModel* _tmp2_;
	GtkTreeModel* model;
	gboolean selectable = FALSE;
	GtkTreeModel* _tmp3_;
	GtkTreePath* _tmp4_;
	GtkTreeIter _tmp5_ = {0};
	GtkTreeModel* _tmp6_;
	GtkTreeIter _tmp7_;
	GtkTreeModel* _tmp8_;
	GtkTreeIter _tmp9_;
	gboolean _tmp10_;
	GtkTreeView* _tmp15_ = NULL;
	GtkTreeView* _tmp16_;
	GtkTreeView* _tmp17_;
	GtkTreeView* _tmp20_;
	GtkTreeSelection* _tmp21_ = NULL;
	g_return_if_fail (treeview != NULL);
	g_return_if_fail (path != NULL);
	g_return_if_fail (column != NULL);
	_tmp0_ = treeview;
	_tmp1_ = gtk_tree_view_get_model (_tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	model = _tmp2_;
	_tmp3_ = model;
	_tmp4_ = path;
	gtk_tree_model_get_iter (_tmp3_, &_tmp5_, _tmp4_);
	iter = _tmp5_;
	_tmp6_ = model;
	_tmp7_ = iter;
	gtk_tree_model_get (_tmp6_, &_tmp7_, 4, &category, -1);
	_tmp8_ = model;
	_tmp9_ = iter;
	gtk_tree_model_get (_tmp8_, &_tmp9_, 2, &selectable, -1);
	_tmp10_ = selectable;
	if (_tmp10_) {
		BoxesCategory* _tmp11_;
		BoxesCategory* _tmp12_;
		BoxesApp* _tmp13_;
		BoxesCategory* _tmp14_;
		_tmp11_ = category;
		_tmp12_ = _g_object_ref0 (_tmp11_);
		_g_object_unref0 (self->category);
		self->category = _tmp12_;
		_tmp13_ = self->priv->app;
		_tmp14_ = category;
		boxes_app_set_category (_tmp13_, _tmp14_);
	}
	_tmp16_ = treeview;
	_tmp17_ = self->default_tree_view;
	if (_tmp16_ == _tmp17_) {
		GtkTreeView* _tmp18_;
		_tmp18_ = self->user_tree_view;
		_tmp15_ = _tmp18_;
	} else {
		GtkTreeView* _tmp19_;
		_tmp19_ = self->default_tree_view;
		_tmp15_ = _tmp19_;
	}
	_tmp20_ = _tmp15_;
	_tmp21_ = gtk_tree_view_get_selection (_tmp20_);
	gtk_tree_selection_unselect_all (_tmp21_);
	_g_object_unref0 (model);
	_g_object_unref0 (category);
}


static void ___lambda94__gtk_tree_view_row_activated (GtkTreeView* _sender, GtkTreePath* path, GtkTreeViewColumn* column, gpointer self) {
	__lambda94_ (self, _sender, path, column);
}


static GtkTreeView* boxes_sidebar_make_tree_view (BoxesSidebar* self) {
	GtkTreeView* result = NULL;
	GtkTreeView* _tmp0_;
	GtkTreeView* _tmp1_;
	GtkTreeView* tree_view;
	GtkTreeSelection* _tmp2_ = NULL;
	GtkTreeSelection* _tmp3_;
	GtkTreeSelection* selection;
	GtkListStore* _tmp4_;
	GtkListStore* listmodel;
	GtkCellRendererPixbuf* _tmp5_;
	GtkCellRendererPixbuf* _tmp6_;
	GtkCellRendererPixbuf* pixbuf_renderer;
	GtkCellRendererText* _tmp7_;
	GtkCellRendererText* _tmp8_;
	GtkCellRendererText* renderer;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = (GtkTreeView*) gtk_tree_view_new ();
	_tmp1_ = g_object_ref_sink (_tmp0_);
	tree_view = _tmp1_;
	_tmp2_ = gtk_tree_view_get_selection (tree_view);
	_tmp3_ = _g_object_ref0 (_tmp2_);
	selection = _tmp3_;
	gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
	gtk_tree_selection_set_select_function (selection, _boxes_sidebar_selection_func_gtk_tree_selection_func, g_object_ref (self), g_object_unref);
	boxes_tree_view_activate_on_single_click (tree_view, TRUE);
	g_signal_connect_object (tree_view, "row-activated", (GCallback) ___lambda94__gtk_tree_view_row_activated, self, 0);
	_tmp4_ = gtk_list_store_new (5, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_BOOLEAN, G_TYPE_STRING, BOXES_TYPE_CATEGORY);
	listmodel = _tmp4_;
	gtk_tree_view_set_model (tree_view, (GtkTreeModel*) listmodel);
	gtk_tree_view_set_headers_visible (tree_view, FALSE);
	_tmp5_ = (GtkCellRendererPixbuf*) gtk_cell_renderer_pixbuf_new ();
	_tmp6_ = g_object_ref_sink (_tmp5_);
	pixbuf_renderer = _tmp6_;
	g_object_set ((GtkCellRenderer*) pixbuf_renderer, "xpad", (guint) 5, NULL);
	gtk_tree_view_insert_column_with_attributes (tree_view, -1, "", (GtkCellRenderer*) pixbuf_renderer, "icon-name", 3, NULL);
	_tmp7_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	_tmp8_ = g_object_ref_sink (_tmp7_);
	renderer = _tmp8_;
	gtk_tree_view_insert_column_with_attributes (tree_view, -1, "", (GtkCellRenderer*) renderer, "text", 0, "height", 1, "sensitive", 2, NULL);
	result = tree_view;
	_g_object_unref0 (renderer);
	_g_object_unref0 (pixbuf_renderer);
	_g_object_unref0 (listmodel);
	_g_object_unref0 (selection);
	return result;
}


static void boxes_sidebar_update_user_tree (BoxesSidebar* self) {
	GtkTreeView* _tmp0_;
	GtkTreeModel* _tmp1_ = NULL;
	GtkListStore* _tmp2_;
	GtkListStore* listmodel;
	GtkListStore* _tmp3_;
	BoxesApp* _tmp4_;
	GSettings* _tmp5_;
	gchar** _tmp6_;
	gchar** _tmp7_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->user_tree_view;
	_tmp1_ = gtk_tree_view_get_model (_tmp0_);
	_tmp2_ = _g_object_ref0 (GTK_IS_LIST_STORE (_tmp1_) ? ((GtkListStore*) _tmp1_) : NULL);
	listmodel = _tmp2_;
	_tmp3_ = listmodel;
	gtk_list_store_clear (_tmp3_);
	_tmp4_ = self->priv->app;
	_tmp5_ = _tmp4_->settings;
	_tmp7_ = _tmp6_ = g_settings_get_strv (_tmp5_, "collections");
	{
		gchar** collection_collection = NULL;
		gint collection_collection_length1 = 0;
		gint _collection_collection_size_ = 0;
		gint collection_it = 0;
		collection_collection = _tmp7_;
		collection_collection_length1 = _vala_array_length (_tmp6_);
		for (collection_it = 0; collection_it < _vala_array_length (_tmp6_); collection_it = collection_it + 1) {
			gchar* _tmp8_;
			gchar* collection = NULL;
			_tmp8_ = g_strdup (collection_collection[collection_it]);
			collection = _tmp8_;
			{
				GtkListStore* _tmp9_;
				const gchar* _tmp10_;
				const gchar* _tmp11_ = NULL;
				BoxesCategory* _tmp12_;
				BoxesCategory* _tmp13_;
				_tmp9_ = listmodel;
				_tmp10_ = collection;
				_tmp11_ = _ (_tmp10_);
				_tmp12_ = boxes_category_new (_tmp11_, BOXES_CATEGORY_KIND_USER);
				_tmp13_ = _tmp12_;
				boxes_sidebar_list_append (self, _tmp9_, _tmp13_, NULL, (guint) 0, TRUE);
				_g_object_unref0 (_tmp13_);
				_g_free0 (collection);
			}
		}
		collection_collection = (_vala_array_free (collection_collection, collection_collection_length1, (GDestroyNotify) g_free), NULL);
	}
	_g_object_unref0 (listmodel);
}


static void __lambda95_ (BoxesSidebar* self) {
	BoxesApp* _tmp0_;
	_tmp0_ = self->priv->app;
	boxes_ui_set_ui_state ((BoxesUI*) _tmp0_, BOXES_UI_STATE_WIZARD);
}


static void ___lambda95__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda95_ (self);
}


static void boxes_sidebar_setup_sidebar (BoxesSidebar* self) {
	GtkNotebook* _tmp0_;
	GtkNotebook* _tmp1_;
	GtkNotebook* _tmp2_;
	GtkClutterActor* _tmp3_;
	GtkClutterActor* _tmp4_;
	GtkNotebook* _tmp5_;
	GtkStyleContext* _tmp6_ = NULL;
	GtkNotebook* _tmp7_;
	guint _tmp8_;
	GtkNotebook* _tmp9_;
	GtkVBox* _tmp10_;
	GtkVBox* _tmp11_;
	GtkVBox* vbox;
	GtkNotebook* _tmp12_;
	GtkVBox* _tmp13_;
	GtkTreeView* _tmp14_ = NULL;
	GtkVBox* _tmp15_;
	GtkTreeView* _tmp16_;
	GtkTreeView* _tmp17_;
	GtkTreeModel* _tmp18_ = NULL;
	GtkListStore* _tmp19_;
	GtkListStore* listmodel;
	const gchar* _tmp20_ = NULL;
	BoxesCategory* _tmp21_;
	BoxesCategory* _tmp22_;
	const gchar* _tmp23_ = NULL;
	BoxesCategory* _tmp24_;
	BoxesCategory* _tmp25_;
	const gchar* _tmp26_ = NULL;
	BoxesCategory* _tmp27_;
	BoxesCategory* _tmp28_;
	const gchar* _tmp29_ = NULL;
	BoxesCategory* _tmp30_;
	BoxesCategory* _tmp31_;
	GtkTreeView* _tmp32_;
	GtkTreeSelection* _tmp33_ = NULL;
	GtkTreePath* _tmp34_;
	GtkTreePath* _tmp35_;
	const gchar* _tmp36_ = NULL;
	GtkLabel* _tmp37_;
	GtkLabel* _tmp38_;
	GtkLabel* label;
	GtkEventBox* _tmp39_;
	GtkEventBox* _tmp40_;
	GtkEventBox* labelw;
	GtkVBox* _tmp41_;
	GtkTreeView* _tmp42_ = NULL;
	GtkVBox* _tmp43_;
	GtkTreeView* _tmp44_;
	const gchar* _tmp45_ = NULL;
	GtkButton* _tmp46_;
	GtkButton* _tmp47_;
	GtkButton* create;
	GtkVBox* _tmp48_;
	GtkVBox* _tmp49_;
	GtkVBox* _tmp50_;
	GtkVBox* _tmp51_;
	GtkNotebook* _tmp52_;
	GtkVBox* _tmp53_;
	GtkVBox* _tmp54_;
	GtkVBox* _tmp55_;
	GtkNotebook* _tmp56_;
	GtkVBox* _tmp57_;
	GtkNotebook* _tmp58_;
	BoxesApp* _tmp59_;
	ClutterState* _tmp60_;
	GtkClutterActor* _tmp61_;
	guint _tmp62_;
	GValue _tmp63_ = {0};
	g_return_if_fail (self != NULL);
	_tmp0_ = (GtkNotebook*) gtk_notebook_new ();
	_tmp1_ = g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->notebook);
	self->notebook = _tmp1_;
	_tmp2_ = self->notebook;
	_tmp3_ = (GtkClutterActor*) gtk_clutter_actor_new_with_contents ((GtkWidget*) _tmp2_);
	_tmp4_ = g_object_ref_sink (_tmp3_);
	_g_object_unref0 (self->priv->gtk_actor);
	self->priv->gtk_actor = _tmp4_;
	_tmp5_ = self->notebook;
	_tmp6_ = gtk_widget_get_style_context ((GtkWidget*) _tmp5_);
	gtk_style_context_add_class (_tmp6_, "boxes-sidebar-bg");
	_tmp7_ = self->notebook;
	_tmp8_ = self->priv->width;
	gtk_widget_set_size_request ((GtkWidget*) _tmp7_, (gint) _tmp8_, 100);
	_tmp9_ = self->notebook;
	gtk_notebook_set_show_tabs (_tmp9_, FALSE);
	_tmp10_ = (GtkVBox*) gtk_vbox_new (FALSE, 0);
	_tmp11_ = g_object_ref_sink (_tmp10_);
	vbox = _tmp11_;
	_tmp12_ = self->notebook;
	_tmp13_ = vbox;
	gtk_notebook_append_page (_tmp12_, (GtkWidget*) _tmp13_, NULL);
	_tmp14_ = boxes_sidebar_make_tree_view (self);
	_g_object_unref0 (self->default_tree_view);
	self->default_tree_view = _tmp14_;
	_tmp15_ = vbox;
	_tmp16_ = self->default_tree_view;
	gtk_box_pack_start ((GtkBox*) _tmp15_, (GtkWidget*) _tmp16_, FALSE, FALSE, (guint) 0);
	_tmp17_ = self->default_tree_view;
	_tmp18_ = gtk_tree_view_get_model (_tmp17_);
	_tmp19_ = _g_object_ref0 (GTK_IS_LIST_STORE (_tmp18_) ? ((GtkListStore*) _tmp18_) : NULL);
	listmodel = _tmp19_;
	_tmp20_ = _ ("New and Recent");
	_tmp21_ = boxes_category_new (_tmp20_, BOXES_CATEGORY_KIND_NEW);
	_g_object_unref0 (self->category);
	self->category = _tmp21_;
	_tmp22_ = self->category;
	boxes_sidebar_list_append (self, listmodel, _tmp22_, NULL, (guint) 0, TRUE);
	_tmp23_ = _ ("Favorites");
	_tmp24_ = boxes_category_new (_tmp23_, BOXES_CATEGORY_KIND_FAVORITES);
	_tmp25_ = _tmp24_;
	boxes_sidebar_list_append (self, listmodel, _tmp25_, "emblem-favorite-symbolic", (guint) 0, TRUE);
	_g_object_unref0 (_tmp25_);
	_tmp26_ = _ ("Private");
	_tmp27_ = boxes_category_new (_tmp26_, BOXES_CATEGORY_KIND_PRIVATE);
	_tmp28_ = _tmp27_;
	boxes_sidebar_list_append (self, listmodel, _tmp28_, "channel-secure-symbolic", (guint) 0, TRUE);
	_g_object_unref0 (_tmp28_);
	_tmp29_ = _ ("Shared with you");
	_tmp30_ = boxes_category_new (_tmp29_, BOXES_CATEGORY_KIND_SHARED);
	_tmp31_ = _tmp30_;
	boxes_sidebar_list_append (self, listmodel, _tmp31_, "emblem-shared-symbolic", (guint) 0, TRUE);
	_g_object_unref0 (_tmp31_);
	_tmp32_ = self->default_tree_view;
	_tmp33_ = gtk_tree_view_get_selection (_tmp32_);
	_tmp34_ = gtk_tree_path_new_from_string ("0");
	_tmp35_ = _tmp34_;
	gtk_tree_selection_select_path (_tmp33_, _tmp35_);
	_gtk_tree_path_free0 (_tmp35_);
	_tmp36_ = _ ("Collections");
	_tmp37_ = (GtkLabel*) gtk_label_new (_tmp36_);
	_tmp38_ = g_object_ref_sink (_tmp37_);
	label = _tmp38_;
	gtk_widget_set_name ((GtkWidget*) label, "CollectionLabel");
	g_object_set ((GtkMisc*) label, "xalign", 0.0f, NULL);
	g_object_set ((GtkWidget*) label, "margin", 10, NULL);
	gtk_widget_set_margin_top ((GtkWidget*) label, 20);
	_tmp39_ = (GtkEventBox*) gtk_event_box_new ();
	_tmp40_ = g_object_ref_sink (_tmp39_);
	labelw = _tmp40_;
	gtk_event_box_set_visible_window (labelw, TRUE);
	gtk_container_add ((GtkContainer*) labelw, (GtkWidget*) label);
	_tmp41_ = vbox;
	gtk_box_pack_start ((GtkBox*) _tmp41_, (GtkWidget*) labelw, FALSE, FALSE, (guint) 0);
	_tmp42_ = boxes_sidebar_make_tree_view (self);
	_g_object_unref0 (self->user_tree_view);
	self->user_tree_view = _tmp42_;
	_tmp43_ = vbox;
	_tmp44_ = self->user_tree_view;
	gtk_box_pack_start ((GtkBox*) _tmp43_, (GtkWidget*) _tmp44_, TRUE, TRUE, (guint) 0);
	boxes_sidebar_update_user_tree (self);
	_tmp45_ = _ ("Create");
	_tmp46_ = (GtkButton*) gtk_button_new_with_label (_tmp45_);
	_tmp47_ = g_object_ref_sink (_tmp46_);
	create = _tmp47_;
	g_object_set ((GtkWidget*) create, "margin", 5, NULL);
	_tmp48_ = vbox;
	gtk_box_pack_end ((GtkBox*) _tmp48_, (GtkWidget*) create, FALSE, FALSE, (guint) 0);
	gtk_widget_show ((GtkWidget*) create);
	g_signal_connect_object (create, "clicked", (GCallback) ___lambda95__gtk_button_clicked, self, 0);
	_tmp49_ = (GtkVBox*) gtk_vbox_new (FALSE, 0);
	_tmp50_ = g_object_ref_sink (_tmp49_);
	_g_object_unref0 (vbox);
	vbox = _tmp50_;
	_tmp51_ = vbox;
	gtk_widget_set_margin_top ((GtkWidget*) _tmp51_, 20);
	_tmp52_ = self->notebook;
	_tmp53_ = vbox;
	gtk_notebook_append_page (_tmp52_, (GtkWidget*) _tmp53_, NULL);
	_tmp54_ = (GtkVBox*) gtk_vbox_new (FALSE, 10);
	_tmp55_ = g_object_ref_sink (_tmp54_);
	_g_object_unref0 (vbox);
	vbox = _tmp55_;
	_tmp56_ = self->notebook;
	_tmp57_ = vbox;
	gtk_notebook_append_page (_tmp56_, (GtkWidget*) _tmp57_, NULL);
	_tmp58_ = self->notebook;
	gtk_widget_show_all ((GtkWidget*) _tmp58_);
	_tmp59_ = self->priv->app;
	_tmp60_ = _tmp59_->state;
	_tmp61_ = self->priv->gtk_actor;
	_tmp62_ = self->priv->width;
	g_value_init (&_tmp63_, G_TYPE_FLOAT);
	g_value_set_float (&_tmp63_, -((gfloat) _tmp62_));
	clutter_state_set_key (_tmp60_, NULL, "display", (GObject*) _tmp61_, "x", (guint) CLUTTER_EASE_OUT_QUAD, &_tmp63_, (gdouble) 0, (gdouble) 0);
	G_IS_VALUE (&_tmp63_) ? (g_value_unset (&_tmp63_), NULL) : NULL;
	_g_object_unref0 (create);
	_g_object_unref0 (labelw);
	_g_object_unref0 (label);
	_g_object_unref0 (listmodel);
	_g_object_unref0 (vbox);
}


static ClutterActor* boxes_sidebar_real_get_actor (BoxesUI* base) {
	ClutterActor* result;
	BoxesSidebar* self;
	GtkClutterActor* _tmp0_;
	self = (BoxesSidebar*) base;
	_tmp0_ = self->priv->gtk_actor;
	result = (ClutterActor*) _tmp0_;
	return result;
}


static void boxes_sidebar_class_init (BoxesSidebarClass * klass) {
	boxes_sidebar_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (BoxesSidebarPrivate));
	BOXES_UI_CLASS (klass)->ui_state_changed = boxes_sidebar_real_ui_state_changed;
	BOXES_UI_CLASS (klass)->get_actor = boxes_sidebar_real_get_actor;
	G_OBJECT_CLASS (klass)->get_property = _vala_boxes_sidebar_get_property;
	G_OBJECT_CLASS (klass)->finalize = boxes_sidebar_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_SIDEBAR_ACTOR, g_param_spec_object ("actor", "actor", "actor", clutter_actor_get_type (), G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
}


static void boxes_sidebar_instance_init (BoxesSidebar * self) {
	self->priv = BOXES_SIDEBAR_GET_PRIVATE (self);
}


static void boxes_sidebar_finalize (GObject* obj) {
	BoxesSidebar * self;
	self = BOXES_SIDEBAR (obj);
	_g_object_unref0 (self->notebook);
	_g_object_unref0 (self->default_tree_view);
	_g_object_unref0 (self->user_tree_view);
	_g_object_unref0 (self->category);
	_g_object_unref0 (self->priv->app);
	_g_object_unref0 (self->priv->gtk_actor);
	G_OBJECT_CLASS (boxes_sidebar_parent_class)->finalize (obj);
}


GType boxes_sidebar_get_type (void) {
	static volatile gsize boxes_sidebar_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_sidebar_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BoxesSidebarClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_sidebar_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesSidebar), 0, (GInstanceInitFunc) boxes_sidebar_instance_init, NULL };
		GType boxes_sidebar_type_id;
		boxes_sidebar_type_id = g_type_register_static (BOXES_TYPE_UI, "BoxesSidebar", &g_define_type_info, 0);
		g_once_init_leave (&boxes_sidebar_type_id__volatile, boxes_sidebar_type_id);
	}
	return boxes_sidebar_type_id__volatile;
}


static void _vala_boxes_sidebar_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	BoxesSidebar * self;
	self = BOXES_SIDEBAR (object);
	switch (property_id) {
		case BOXES_SIDEBAR_ACTOR:
		g_value_set_object (value, boxes_ui_get_actor ((BoxesUI*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


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


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


static gint _vala_array_length (gpointer array) {
	int length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}



