/* sidebar.c generated by valac 0.17.1.6-d284, 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 <stdlib.h>
#include <string.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_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 _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;
	BoxesTopbar* topbar;
	BoxesNotificationbar* notificationbar;
	BoxesRevealer* sidebar_revealer;
	BoxesRevealer* topbar_revealer;
	BoxesSidebar* sidebar;
	BoxesSelectionbar* selectionbar;
	guint duration;
	GSettings* settings;
	BoxesWizard* wizard;
	BoxesProperties* properties;
	BoxesDisplayPage* display_page;
	BoxesCollection* collection;
	GSimpleAction* action_properties;
	GSimpleAction* action_fullscreen;
	GSimpleAction* action_shutdown;
};

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_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;
void boxes_revealer_unreveal (BoxesRevealer* self);
void boxes_revealer_reveal (BoxesRevealer* self);
static gboolean __lambda39_ (BoxesSidebar* self, cairo_t* cr, gint w, gint h);
static gboolean ___lambda39__clutter_canvas_draw (ClutterCanvas* _sender, cairo_t* cr, gint width, gint height, gpointer self);
gchar* boxes_get_style (const gchar* file_name);
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 __lambda39_ (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 ___lambda39__clutter_canvas_draw (ClutterCanvas* _sender, cairo_t* cr, gint width, gint height, gpointer self) {
	gboolean result;
	result = __lambda39_ (self, cr, width, height);
	return result;
}


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



