/* sidebar.c generated by valac 0.17.7, 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 <gio/gio.h>
#include <float.h>
#include <math.h>
#include <cairo.h>
#include <libcommon.h>
#include <gdk-pixbuf/gdk-pixbuf.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 _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#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;
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_SEARCHBAR (boxes_searchbar_get_type ())
#define BOXES_SEARCHBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_SEARCHBAR, BoxesSearchbar))
#define BOXES_SEARCHBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_SEARCHBAR, BoxesSearchbarClass))
#define BOXES_IS_SEARCHBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_SEARCHBAR))
#define BOXES_IS_SEARCHBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_SEARCHBAR))
#define BOXES_SEARCHBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_SEARCHBAR, BoxesSearchbarClass))

typedef struct _BoxesSearchbar BoxesSearchbar;
typedef struct _BoxesSearchbarClass BoxesSearchbarClass;

#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_REVEALER (boxes_revealer_get_type ())
#define BOXES_REVEALER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_REVEALER, BoxesRevealer))
#define BOXES_REVEALER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_REVEALER, BoxesRevealerClass))
#define BOXES_IS_REVEALER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_REVEALER))
#define BOXES_IS_REVEALER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_REVEALER))
#define BOXES_REVEALER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_REVEALER, BoxesRevealerClass))

typedef struct _BoxesRevealer BoxesRevealer;
typedef struct _BoxesRevealerClass BoxesRevealerClass;

#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 BOXES_TYPE_COLLECTION_FILTER (boxes_collection_filter_get_type ())
#define BOXES_COLLECTION_FILTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_COLLECTION_FILTER, BoxesCollectionFilter))
#define BOXES_COLLECTION_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_COLLECTION_FILTER, BoxesCollectionFilterClass))
#define BOXES_IS_COLLECTION_FILTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_COLLECTION_FILTER))
#define BOXES_IS_COLLECTION_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_COLLECTION_FILTER))
#define BOXES_COLLECTION_FILTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_COLLECTION_FILTER, BoxesCollectionFilterClass))

typedef struct _BoxesCollectionFilter BoxesCollectionFilter;
typedef struct _BoxesCollectionFilterClass BoxesCollectionFilterClass;

#define BOXES_TYPE_COLLECTION_VIEW (boxes_collection_view_get_type ())
#define BOXES_COLLECTION_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_COLLECTION_VIEW, BoxesCollectionView))
#define BOXES_COLLECTION_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_COLLECTION_VIEW, BoxesCollectionViewClass))
#define BOXES_IS_COLLECTION_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_COLLECTION_VIEW))
#define BOXES_IS_COLLECTION_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_COLLECTION_VIEW))
#define BOXES_COLLECTION_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_COLLECTION_VIEW, BoxesCollectionViewClass))

typedef struct _BoxesCollectionView BoxesCollectionView;
typedef struct _BoxesCollectionViewClass BoxesCollectionViewClass;
#define _cairo_pattern_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_pattern_destroy (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_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;
};

struct _BoxesSidebarClass {
	BoxesUIClass parent_class;
};

struct _BoxesSidebarPrivate {
	guint width;
	ClutterActor* bin_actor;
	GtkClutterActor* gtk_actor;
};

struct _BoxesApp {
	BoxesUI parent_instance;
	BoxesAppPrivate * priv;
	GtkApplicationWindow* window;
	GtkNotebook* notebook;
	GtkClutterEmbed* embed;
	ClutterStage* stage;
	ClutterBinLayout* stage_bin;
	ClutterActor* overlay_bin_actor;
	ClutterBinLayout* overlay_bin;
	BoxesCollectionItem* current_item;
	BoxesSearchbar* searchbar;
	BoxesTopbar* topbar;
	BoxesNotificationbar* notificationbar;
	BoxesRevealer* sidebar_revealer;
	BoxesRevealer* searchbar_revealer;
	BoxesSidebar* sidebar;
	BoxesSelectionbar* selectionbar;
	guint duration;
	GSettings* settings;
	BoxesWizard* wizard;
	BoxesProperties* properties;
	BoxesDisplayPage* display_page;
	BoxesCollection* collection;
	BoxesCollectionFilter* filter;
	GSimpleAction* action_properties;
	GSimpleAction* action_fullscreen;
	GSimpleAction* action_shutdown;
	BoxesCollectionView* view;
};

struct _BoxesAppClass {
	BoxesUIClass parent_class;
};


static gpointer boxes_sidebar_parent_class = NULL;
extern BoxesApp* boxes_app_app;

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;
#define BOXES_SIDEBAR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_SIDEBAR, BoxesSidebarPrivate))
enum  {
	BOXES_SIDEBAR_DUMMY_PROPERTY,
	BOXES_SIDEBAR_ACTOR
};
#define BOXES_SIDEBAR_shadow_width 7
BoxesSidebar* boxes_sidebar_new (void);
BoxesSidebar* boxes_sidebar_construct (GType object_type);
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);
GType boxes_app_get_type (void) G_GNUC_CONST;
GType boxes_collection_item_get_type (void) G_GNUC_CONST;
GType boxes_searchbar_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_revealer_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;
GType boxes_collection_filter_get_type (void) G_GNUC_CONST;
GType boxes_collection_view_get_type (void) G_GNUC_CONST;
void boxes_revealer_unreveal (BoxesRevealer* self);
void boxes_revealer_reveal (BoxesRevealer* self);
static gboolean __lambda44_ (BoxesSidebar* self, cairo_t* cr, gint w, gint h);
static gboolean ___lambda44__clutter_canvas_draw (ClutterCanvas* _sender, cairo_t* cr, gint width, gint height, gpointer self);
static void boxes_sidebar_finalize (GObject* obj);
ClutterActor* boxes_ui_get_actor (BoxesUI* self);
static void _vala_boxes_sidebar_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);


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;
}


BoxesSidebar* boxes_sidebar_construct (GType object_type) {
	BoxesSidebar * self = NULL;
	self = (BoxesSidebar*) boxes_ui_construct (object_type);
	self->priv->width = (guint) 200;
	boxes_sidebar_setup_sidebar (self);
	return self;
}


BoxesSidebar* boxes_sidebar_new (void) {
	return boxes_sidebar_construct (BOXES_TYPE_SIDEBAR);
}


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:
		{
			BoxesApp* _tmp2_;
			BoxesRevealer* _tmp3_;
			_tmp2_ = boxes_app_app;
			_tmp3_ = _tmp2_->sidebar_revealer;
			boxes_revealer_unreveal (_tmp3_);
			break;
		}
		default:
		{
			BoxesApp* _tmp4_;
			BoxesRevealer* _tmp5_;
			_tmp4_ = boxes_app_app;
			_tmp5_ = _tmp4_->sidebar_revealer;
			boxes_revealer_unreveal (_tmp5_);
			break;
		}
		case BOXES_UI_STATE_WIZARD:
		case BOXES_UI_STATE_PROPERTIES:
		{
			BoxesApp* _tmp6_;
			BoxesRevealer* _tmp7_;
			BoxesSidebarPage _tmp8_ = 0;
			BoxesUIState _tmp9_;
			BoxesUIState _tmp10_;
			GtkNotebook* _tmp11_;
			BoxesSidebarPage _tmp12_;
			_tmp6_ = boxes_app_app;
			_tmp7_ = _tmp6_->sidebar_revealer;
			boxes_revealer_reveal (_tmp7_);
			_tmp9_ = boxes_ui_get_ui_state ((BoxesUI*) self);
			_tmp10_ = _tmp9_;
			if (_tmp10_ == BOXES_UI_STATE_WIZARD) {
				_tmp8_ = BOXES_SIDEBAR_PAGE_WIZARD;
			} else {
				_tmp8_ = BOXES_SIDEBAR_PAGE_PROPERTIES;
			}
			_tmp11_ = self->notebook;
			_tmp12_ = _tmp8_;
			g_object_set (_tmp11_, "page", (gint) _tmp12_, NULL);
			break;
		}
	}
}


static gboolean __lambda44_ (BoxesSidebar* self, cairo_t* cr, gint w, gint h) {
	gboolean result = FALSE;
	gint _tmp0_;
	cairo_pattern_t* _tmp1_;
	cairo_pattern_t* p;
	cairo_t* _tmp2_;
	cairo_t* _tmp3_;
	cairo_t* _tmp4_;
	gint _tmp5_;
	gint _tmp6_;
	cairo_t* _tmp7_;
	g_return_val_if_fail (cr != NULL, FALSE);
	_tmp0_ = w;
	_tmp1_ = cairo_pattern_create_linear ((gdouble) 0, (gdouble) 0, (gdouble) _tmp0_, (gdouble) 0);
	p = _tmp1_;
	cairo_pattern_add_color_stop_rgba (p, (gdouble) 0, (gdouble) 0, (gdouble) 0, (gdouble) 0, 0.4);
	cairo_pattern_add_color_stop_rgba (p, 0.7, (gdouble) 0, (gdouble) 0, (gdouble) 0, 0.0);
	_tmp2_ = cr;
	cairo_set_source (_tmp2_, p);
	_tmp3_ = cr;
	cairo_set_operator (_tmp3_, CAIRO_OPERATOR_SOURCE);
	_tmp4_ = cr;
	_tmp5_ = w;
	_tmp6_ = h;
	cairo_rectangle (_tmp4_, (gdouble) 0, (gdouble) 0, (gdouble) _tmp5_, (gdouble) _tmp6_);
	_tmp7_ = cr;
	cairo_fill (_tmp7_);
	result = TRUE;
	_cairo_pattern_destroy0 (p);
	return result;
}


static gboolean ___lambda44__clutter_canvas_draw (ClutterCanvas* _sender, cairo_t* cr, gint width, gint height, gpointer self) {
	gboolean result;
	result = __lambda44_ (self, cr, width, height);
	return result;
}


static void boxes_sidebar_setup_sidebar (BoxesSidebar* self) {
	ClutterActor* _tmp0_;
	ClutterBinLayout* _tmp1_;
	ClutterBinLayout* bin;
	ClutterActor* _tmp2_;
	ClutterBinLayout* _tmp3_;
	ClutterActor* _tmp4_;
	ClutterActor* _tmp5_;
	ClutterActor* shadow;
	ClutterActor* _tmp6_;
	ClutterCanvas* _tmp7_;
	ClutterCanvas* canvas;
	ClutterCanvas* _tmp8_;
	ClutterCanvas* _tmp9_;
	ClutterActor* _tmp10_;
	ClutterCanvas* _tmp11_;
	ClutterActor* _tmp12_;
	ClutterActor* _tmp13_;
	ClutterBinLayout* _tmp14_;
	ClutterActor* _tmp15_;
	GtkClutterTexture* _tmp16_;
	GtkClutterTexture* background;
	GtkClutterTexture* _tmp17_;
	GtkClutterTexture* _tmp24_;
	GtkClutterTexture* _tmp25_;
	ClutterBinLayout* _tmp26_;
	GtkClutterTexture* _tmp27_;
	GtkNotebook* _tmp28_;
	GtkNotebook* _tmp29_;
	GtkClutterActor* _tmp30_;
	GtkClutterActor* _tmp31_;
	GtkWidget* _tmp32_ = NULL;
	GtkStyleContext* _tmp33_ = NULL;
	GtkClutterActor* _tmp34_;
	ClutterActor* _tmp35_;
	GtkClutterActor* _tmp36_;
	GtkNotebook* _tmp37_;
	GtkStyleContext* _tmp38_ = NULL;
	GtkNotebook* _tmp39_;
	GtkStyleContext* _tmp40_ = NULL;
	GtkNotebook* _tmp41_;
	guint _tmp42_;
	GtkNotebook* _tmp43_;
	GtkVBox* _tmp44_;
	GtkVBox* vbox;
	GtkNotebook* _tmp45_;
	GtkVBox* _tmp46_;
	GtkVBox* _tmp47_;
	GtkVBox* _tmp48_;
	GtkNotebook* _tmp49_;
	GtkVBox* _tmp50_;
	GtkVBox* _tmp51_;
	GtkNotebook* _tmp52_;
	GtkVBox* _tmp53_;
	GtkNotebook* _tmp54_;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = clutter_actor_new ();
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->bin_actor);
	self->priv->bin_actor = _tmp0_;
	_tmp1_ = (ClutterBinLayout*) clutter_bin_layout_new (CLUTTER_BIN_ALIGNMENT_FILL, CLUTTER_BIN_ALIGNMENT_FILL);
	g_object_ref_sink (_tmp1_);
	bin = _tmp1_;
	_tmp2_ = self->priv->bin_actor;
	_tmp3_ = bin;
	clutter_actor_set_layout_manager (_tmp2_, (ClutterLayoutManager*) _tmp3_);
	_tmp4_ = self->priv->bin_actor;
	clutter_actor_set_name (_tmp4_, "sidebar-bin");
	_tmp5_ = clutter_actor_new ();
	g_object_ref_sink (_tmp5_);
	shadow = _tmp5_;
	_tmp6_ = shadow;
	clutter_actor_set_width (_tmp6_, (gfloat) BOXES_SIDEBAR_shadow_width);
	_tmp7_ = clutter_canvas_new ();
	canvas = _tmp7_;
	_tmp8_ = canvas;
	g_signal_connect_object (_tmp8_, "draw", (GCallback) ___lambda44__clutter_canvas_draw, self, 0);
	_tmp9_ = canvas;
	clutter_canvas_set_size (_tmp9_, BOXES_SIDEBAR_shadow_width, 1);
	_tmp10_ = shadow;
	_tmp11_ = canvas;
	clutter_actor_set_content (_tmp10_, (ClutterContent*) _tmp11_);
	_tmp12_ = shadow;
	clutter_actor_set_content_gravity (_tmp12_, CLUTTER_CONTENT_GRAVITY_RESIZE_FILL);
	_tmp13_ = shadow;
	clutter_actor_set_content_scaling_filters (_tmp13_, CLUTTER_SCALING_FILTER_NEAREST, CLUTTER_SCALING_FILTER_NEAREST);
	_tmp14_ = bin;
	_tmp15_ = shadow;
	clutter_bin_layout_add (_tmp14_, _tmp15_, CLUTTER_BIN_ALIGNMENT_END, CLUTTER_BIN_ALIGNMENT_FILL);
	_tmp16_ = (GtkClutterTexture*) gtk_clutter_texture_new ();
	g_object_ref_sink (_tmp16_);
	background = _tmp16_;
	_tmp17_ = background;
	clutter_actor_set_name ((ClutterActor*) _tmp17_, "sidebar-background");
	{
		gchar* _tmp18_ = NULL;
		gchar* _tmp19_;
		GdkPixbuf* _tmp20_;
		GdkPixbuf* _tmp21_;
		GdkPixbuf* pixbuf;
		GtkClutterTexture* _tmp22_;
		GdkPixbuf* _tmp23_;
		_tmp18_ = boxes_get_style ("assets/boxes-gray.png");
		_tmp19_ = _tmp18_;
		_tmp20_ = gdk_pixbuf_new_from_file (_tmp19_, &_inner_error_);
		_tmp21_ = _tmp20_;
		_g_free0 (_tmp19_);
		pixbuf = _tmp21_;
		if (_inner_error_ != NULL) {
			goto __catch49_g_error;
		}
		_tmp22_ = background;
		_tmp23_ = pixbuf;
		gtk_clutter_texture_set_from_pixbuf (_tmp22_, _tmp23_, &_inner_error_);
		if (_inner_error_ != NULL) {
			_g_object_unref0 (pixbuf);
			goto __catch49_g_error;
		}
		_g_object_unref0 (pixbuf);
	}
	goto __finally49;
	__catch49_g_error:
	{
		GError* e = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		_g_error_free0 (e);
	}
	__finally49:
	if (_inner_error_ != NULL) {
		_g_object_unref0 (background);
		_g_object_unref0 (canvas);
		_g_object_unref0 (shadow);
		_g_object_unref0 (bin);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
	_tmp24_ = background;
	clutter_texture_set_repeat ((ClutterTexture*) _tmp24_, TRUE, TRUE);
	_tmp25_ = background;
	clutter_actor_set_margin_right ((ClutterActor*) _tmp25_, (gfloat) BOXES_SIDEBAR_shadow_width);
	_tmp26_ = bin;
	_tmp27_ = background;
	clutter_bin_layout_add (_tmp26_, (ClutterActor*) _tmp27_, CLUTTER_BIN_ALIGNMENT_FILL, CLUTTER_BIN_ALIGNMENT_FILL);
	_tmp28_ = (GtkNotebook*) gtk_notebook_new ();
	g_object_ref_sink (_tmp28_);
	_g_object_unref0 (self->notebook);
	self->notebook = _tmp28_;
	_tmp29_ = self->notebook;
	_tmp30_ = (GtkClutterActor*) gtk_clutter_actor_new_with_contents ((GtkWidget*) _tmp29_);
	g_object_ref_sink (_tmp30_);
	_g_object_unref0 (self->priv->gtk_actor);
	self->priv->gtk_actor = _tmp30_;
	_tmp31_ = self->priv->gtk_actor;
	_tmp32_ = gtk_clutter_actor_get_widget (_tmp31_);
	_tmp33_ = gtk_widget_get_style_context (_tmp32_);
	gtk_style_context_add_class (_tmp33_, "boxes-bg");
	_tmp34_ = self->priv->gtk_actor;
	clutter_actor_set_name ((ClutterActor*) _tmp34_, "sidebar");
	_tmp35_ = self->priv->bin_actor;
	_tmp36_ = self->priv->gtk_actor;
	clutter_actor_add_child (_tmp35_, (ClutterActor*) _tmp36_);
	_tmp37_ = self->notebook;
	_tmp38_ = gtk_widget_get_style_context ((GtkWidget*) _tmp37_);
	gtk_style_context_add_class (_tmp38_, GTK_STYLE_CLASS_SIDEBAR);
	_tmp39_ = self->notebook;
	_tmp40_ = gtk_widget_get_style_context ((GtkWidget*) _tmp39_);
	gtk_style_context_add_class (_tmp40_, "boxes-bg");
	_tmp41_ = self->notebook;
	_tmp42_ = self->priv->width;
	gtk_widget_set_size_request ((GtkWidget*) _tmp41_, (gint) _tmp42_, 100);
	_tmp43_ = self->notebook;
	gtk_notebook_set_show_tabs (_tmp43_, FALSE);
	_tmp44_ = (GtkVBox*) gtk_vbox_new (FALSE, 0);
	g_object_ref_sink (_tmp44_);
	vbox = _tmp44_;
	_tmp45_ = self->notebook;
	_tmp46_ = vbox;
	gtk_notebook_append_page (_tmp45_, (GtkWidget*) _tmp46_, NULL);
	_tmp47_ = (GtkVBox*) gtk_vbox_new (FALSE, 0);
	g_object_ref_sink (_tmp47_);
	_g_object_unref0 (vbox);
	vbox = _tmp47_;
	_tmp48_ = vbox;
	gtk_widget_set_margin_top ((GtkWidget*) _tmp48_, 20);
	_tmp49_ = self->notebook;
	_tmp50_ = vbox;
	gtk_notebook_append_page (_tmp49_, (GtkWidget*) _tmp50_, NULL);
	_tmp51_ = (GtkVBox*) gtk_vbox_new (FALSE, 10);
	g_object_ref_sink (_tmp51_);
	_g_object_unref0 (vbox);
	vbox = _tmp51_;
	_tmp52_ = self->notebook;
	_tmp53_ = vbox;
	gtk_notebook_append_page (_tmp52_, (GtkWidget*) _tmp53_, NULL);
	_tmp54_ = self->notebook;
	gtk_widget_show_all ((GtkWidget*) _tmp54_);
	_g_object_unref0 (vbox);
	_g_object_unref0 (background);
	_g_object_unref0 (canvas);
	_g_object_unref0 (shadow);
	_g_object_unref0 (bin);
}


static ClutterActor* boxes_sidebar_real_get_actor (BoxesUI* base) {
	ClutterActor* result;
	BoxesSidebar* self;
	ClutterActor* _tmp0_;
	self = (BoxesSidebar*) base;
	_tmp0_ = self->priv->bin_actor;
	result = _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 = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_SIDEBAR, BoxesSidebar);
	_g_object_unref0 (self->notebook);
	_g_object_unref0 (self->priv->bin_actor);
	_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 = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_SIDEBAR, BoxesSidebar);
	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;
	}
}



