/* topbar.c generated by valac 0.17.5.2-8558, the Vala compiler
 * generated from topbar.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 <libgd/gd.h>
#include <glib/gi18n-lib.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>


#define BOXES_TYPE_TOPBAR_PAGE (boxes_topbar_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_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;
typedef struct _BoxesTopbarPrivate BoxesTopbarPrivate;
#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_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_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;

#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;
typedef struct _BoxesCollectionPrivate BoxesCollectionPrivate;
#define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

typedef enum  {
	BOXES_TOPBAR_PAGE_COLLECTION,
	BOXES_TOPBAR_PAGE_SELECTION,
	BOXES_TOPBAR_PAGE_WIZARD,
	BOXES_TOPBAR_PAGE_PROPERTIES
} BoxesTopbarPage;

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 _BoxesTopbar {
	BoxesUI parent_instance;
	BoxesTopbarPrivate * priv;
	GtkNotebook* notebook;
};

struct _BoxesTopbarClass {
	BoxesUIClass parent_class;
};

struct _BoxesTopbarPrivate {
	GtkClutterActor* gtk_actor;
	GtkSpinner* spinner;
	GtkToggleButton* search_btn;
	GtkButton* select_btn;
	GtkButton* cancel_btn;
	GtkButton* spinner_btn;
	GtkButton* back_btn;
	GtkButton* new_btn;
	GdMainToolbar* selection_toolbar;
	GdMainToolbar* collection_toolbar;
};

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

struct _BoxesCollection {
	GObject parent_instance;
	BoxesCollectionPrivate * priv;
	GPtrArray* items;
};

struct _BoxesCollectionClass {
	GObjectClass parent_class;
};


static gpointer boxes_topbar_parent_class = NULL;
extern BoxesApp* boxes_app_app;

GType boxes_topbar_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_topbar_get_type (void) G_GNUC_CONST;
#define BOXES_TOPBAR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_TOPBAR, BoxesTopbarPrivate))
enum  {
	BOXES_TOPBAR_DUMMY_PROPERTY,
	BOXES_TOPBAR_ACTOR
};
BoxesTopbar* boxes_topbar_new (void);
BoxesTopbar* boxes_topbar_construct (GType object_type);
BoxesUI* boxes_ui_construct (GType object_type);
static void boxes_topbar_setup_topbar (BoxesTopbar* self);
GType boxes_app_get_type (void) G_GNUC_CONST;
static void __lambda41_ (BoxesTopbar* self);
static void boxes_topbar_update_selection_label (BoxesTopbar* self);
static void ___lambda41__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void __lambda34_ (BoxesTopbar* self, GtkButton* button);
void boxes_ui_set_ui_state (BoxesUI* self, BoxesUIState value);
static void ___lambda34__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void __lambda35_ (BoxesTopbar* self, GtkButton* button);
static void ___lambda35__gtk_button_clicked (GtkButton* _sender, gpointer self);
GType boxes_collection_item_get_type (void) G_GNUC_CONST;
GType boxes_searchbar_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_sidebar_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;
static void __lambda36_ (BoxesTopbar* self);
gboolean boxes_searchbar_get_visible (BoxesSearchbar* self);
static void ___lambda36__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void boxes_topbar_update_search_btn (BoxesTopbar* self);
static void _boxes_topbar_update_search_btn_boxes_collection_item_added (BoxesCollection* _sender, BoxesCollectionItem* item, gpointer self);
static void _boxes_topbar_update_search_btn_boxes_collection_item_removed (BoxesCollection* _sender, BoxesCollectionItem* item, gpointer self);
static void __lambda37_ (BoxesTopbar* self);
void boxes_app_set_selection_mode (BoxesApp* self, gboolean value);
static void ___lambda37__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void __lambda38_ (BoxesTopbar* self);
gboolean boxes_app_get_selection_mode (BoxesApp* self);
static void ___lambda38__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void boxes_topbar_update_select_btn (BoxesTopbar* self);
static void _boxes_topbar_update_select_btn_boxes_collection_item_added (BoxesCollection* _sender, BoxesCollectionItem* item, gpointer self);
static void _boxes_topbar_update_select_btn_boxes_collection_item_removed (BoxesCollection* _sender, BoxesCollectionItem* item, gpointer self);
static void __lambda40_ (BoxesTopbar* self);
static void ___lambda40__gtk_button_clicked (GtkButton* _sender, gpointer self);
void boxes_topbar_set_status (BoxesTopbar* self, const gchar* text);
GList* boxes_app_get_selected_items (BoxesApp* self);
static void _g_object_unref0_ (gpointer var);
static void _g_list_free__g_object_unref0_ (GList* self);
static void boxes_topbar_real_ui_state_changed (BoxesUI* base);
BoxesUIState boxes_ui_get_ui_state (BoxesUI* self);
static void boxes_topbar_finalize (GObject* obj);
ClutterActor* boxes_ui_get_actor (BoxesUI* self);
static void _vala_boxes_topbar_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);


GType boxes_topbar_page_get_type (void) {
	static volatile gsize boxes_topbar_page_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_topbar_page_type_id__volatile)) {
		static const GEnumValue values[] = {{BOXES_TOPBAR_PAGE_COLLECTION, "BOXES_TOPBAR_PAGE_COLLECTION", "collection"}, {BOXES_TOPBAR_PAGE_SELECTION, "BOXES_TOPBAR_PAGE_SELECTION", "selection"}, {BOXES_TOPBAR_PAGE_WIZARD, "BOXES_TOPBAR_PAGE_WIZARD", "wizard"}, {BOXES_TOPBAR_PAGE_PROPERTIES, "BOXES_TOPBAR_PAGE_PROPERTIES", "properties"}, {0, NULL, NULL}};
		GType boxes_topbar_page_type_id;
		boxes_topbar_page_type_id = g_enum_register_static ("BoxesTopbarPage", values);
		g_once_init_leave (&boxes_topbar_page_type_id__volatile, boxes_topbar_page_type_id);
	}
	return boxes_topbar_page_type_id__volatile;
}


static void __lambda41_ (BoxesTopbar* self) {
	boxes_topbar_update_selection_label (self);
}


static void ___lambda41__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda41_ (self);
}


BoxesTopbar* boxes_topbar_construct (GType object_type) {
	BoxesTopbar * self = NULL;
	BoxesApp* _tmp0_;
	self = (BoxesTopbar*) boxes_ui_construct (object_type);
	boxes_topbar_setup_topbar (self);
	_tmp0_ = boxes_app_app;
	g_signal_connect_object ((GObject*) _tmp0_, "notify::selected-items", (GCallback) ___lambda41__g_object_notify, self, 0);
	return self;
}


BoxesTopbar* boxes_topbar_new (void) {
	return boxes_topbar_construct (BOXES_TYPE_TOPBAR);
}


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


static void __lambda34_ (BoxesTopbar* self, GtkButton* button) {
	BoxesApp* _tmp0_;
	g_return_if_fail (button != NULL);
	_tmp0_ = boxes_app_app;
	boxes_ui_set_ui_state ((BoxesUI*) _tmp0_, BOXES_UI_STATE_WIZARD);
}


static void ___lambda34__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda34_ (self, _sender);
}


static void __lambda35_ (BoxesTopbar* self, GtkButton* button) {
	BoxesApp* _tmp0_;
	g_return_if_fail (button != NULL);
	_tmp0_ = boxes_app_app;
	boxes_ui_set_ui_state ((BoxesUI*) _tmp0_, BOXES_UI_STATE_COLLECTION);
}


static void ___lambda35__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda35_ (self, _sender);
}


static void __lambda36_ (BoxesTopbar* self) {
	GtkToggleButton* _tmp0_;
	BoxesApp* _tmp1_;
	BoxesSearchbar* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	_tmp0_ = self->priv->search_btn;
	_tmp1_ = boxes_app_app;
	_tmp2_ = _tmp1_->searchbar;
	_tmp3_ = boxes_searchbar_get_visible (_tmp2_);
	_tmp4_ = _tmp3_;
	gtk_toggle_button_set_active (_tmp0_, _tmp4_);
}


static void ___lambda36__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda36_ (self);
}


static void _boxes_topbar_update_search_btn_boxes_collection_item_added (BoxesCollection* _sender, BoxesCollectionItem* item, gpointer self) {
	boxes_topbar_update_search_btn (self);
}


static void _boxes_topbar_update_search_btn_boxes_collection_item_removed (BoxesCollection* _sender, BoxesCollectionItem* item, gpointer self) {
	boxes_topbar_update_search_btn (self);
}


static void __lambda37_ (BoxesTopbar* self) {
	BoxesApp* _tmp0_;
	_tmp0_ = boxes_app_app;
	boxes_app_set_selection_mode (_tmp0_, TRUE);
}


static void ___lambda37__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda37_ (self);
}


static void __lambda38_ (BoxesTopbar* self) {
	gint _tmp0_ = 0;
	BoxesApp* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	GtkNotebook* _tmp5_;
	gint _tmp6_;
	_tmp1_ = boxes_app_app;
	_tmp2_ = boxes_app_get_selection_mode (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_) {
		_tmp0_ = (gint) BOXES_TOPBAR_PAGE_SELECTION;
	} else {
		GtkNotebook* _tmp4_;
		_tmp4_ = self->notebook;
		g_object_set (_tmp4_, "page", (gint) BOXES_TOPBAR_PAGE_COLLECTION, NULL);
		_tmp0_ = (gint) BOXES_TOPBAR_PAGE_COLLECTION;
	}
	_tmp5_ = self->notebook;
	_tmp6_ = _tmp0_;
	g_object_set (_tmp5_, "page", _tmp6_, NULL);
}


static void ___lambda38__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda38_ (self);
}


static void _boxes_topbar_update_select_btn_boxes_collection_item_added (BoxesCollection* _sender, BoxesCollectionItem* item, gpointer self) {
	boxes_topbar_update_select_btn (self);
}


static void _boxes_topbar_update_select_btn_boxes_collection_item_removed (BoxesCollection* _sender, BoxesCollectionItem* item, gpointer self) {
	boxes_topbar_update_select_btn (self);
}


static void __lambda40_ (BoxesTopbar* self) {
	BoxesApp* _tmp0_;
	_tmp0_ = boxes_app_app;
	boxes_app_set_selection_mode (_tmp0_, FALSE);
}


static void ___lambda40__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda40_ (self);
}


static void boxes_topbar_setup_topbar (BoxesTopbar* self) {
	GtkNotebook* _tmp0_;
	GtkNotebook* _tmp1_;
	GtkClutterActor* _tmp2_;
	GtkClutterActor* _tmp3_;
	GtkHBox* _tmp4_;
	GtkHBox* hbox;
	GtkNotebook* _tmp5_;
	GtkHBox* _tmp6_;
	GdMainToolbar* _tmp7_;
	GdMainToolbar* toolbar;
	GdMainToolbar* _tmp8_;
	GtkStyleContext* _tmp9_ = NULL;
	GtkHBox* _tmp10_;
	const gchar* _tmp11_ = NULL;
	GtkWidget* _tmp12_ = NULL;
	GtkButton* _tmp13_;
	GtkButton* _tmp14_;
	GtkButton* _tmp15_;
	GtkWidget* _tmp16_ = NULL;
	GtkButton* _tmp17_;
	GtkButton* _tmp18_;
	GtkSpinner* _tmp19_;
	GtkWidget* _tmp20_ = NULL;
	GtkButton* _tmp21_;
	GtkButton* _tmp22_;
	GtkSpinner* _tmp23_;
	GtkWidget* _tmp24_ = NULL;
	GtkToggleButton* _tmp25_;
	GtkToggleButton* _tmp26_;
	BoxesApp* _tmp27_;
	BoxesSearchbar* _tmp28_;
	BoxesApp* _tmp29_;
	BoxesApp* _tmp30_;
	BoxesCollection* _tmp31_;
	BoxesApp* _tmp32_;
	BoxesCollection* _tmp33_;
	GtkWidget* _tmp34_ = NULL;
	GtkButton* _tmp35_;
	GtkButton* _tmp36_;
	BoxesApp* _tmp37_;
	BoxesApp* _tmp38_;
	BoxesCollection* _tmp39_;
	BoxesApp* _tmp40_;
	BoxesCollection* _tmp41_;
	GtkHBox* _tmp42_;
	GtkNotebook* _tmp43_;
	GtkHBox* _tmp44_;
	GdMainToolbar* _tmp45_;
	GdMainToolbar* _tmp46_;
	GtkStyleContext* _tmp47_ = NULL;
	GtkHBox* _tmp48_;
	GdMainToolbar* _tmp49_;
	GdMainToolbar* _tmp50_;
	const gchar* _tmp51_ = NULL;
	GtkWidget* _tmp52_ = NULL;
	GtkButton* _tmp53_;
	GtkButton* _tmp54_;
	GtkButton* _tmp55_;
	GtkHBox* _tmp56_;
	GtkNotebook* _tmp57_;
	GtkHBox* _tmp58_;
	GtkHBox* _tmp59_;
	GtkNotebook* _tmp60_;
	GtkHBox* _tmp61_;
	GtkNotebook* _tmp62_;
	GtkNotebook* _tmp63_;
	g_return_if_fail (self != NULL);
	_tmp0_ = (GtkNotebook*) gtk_notebook_new ();
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->notebook);
	self->notebook = _tmp0_;
	_tmp1_ = self->notebook;
	_tmp2_ = (GtkClutterActor*) gtk_clutter_actor_new_with_contents ((GtkWidget*) _tmp1_);
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->gtk_actor);
	self->priv->gtk_actor = _tmp2_;
	_tmp3_ = self->priv->gtk_actor;
	clutter_actor_set_name ((ClutterActor*) _tmp3_, "topbar");
	_tmp4_ = (GtkHBox*) gtk_hbox_new (FALSE, 0);
	g_object_ref_sink (_tmp4_);
	hbox = _tmp4_;
	_tmp5_ = self->notebook;
	_tmp6_ = hbox;
	gtk_notebook_append_page (_tmp5_, (GtkWidget*) _tmp6_, NULL);
	_tmp7_ = (GdMainToolbar*) gd_main_toolbar_new ();
	g_object_ref_sink (_tmp7_);
	toolbar = _tmp7_;
	_tmp8_ = _g_object_ref0 (toolbar);
	_g_object_unref0 (self->priv->collection_toolbar);
	self->priv->collection_toolbar = _tmp8_;
	_tmp9_ = gtk_widget_get_style_context ((GtkWidget*) toolbar);
	gtk_style_context_add_class (_tmp9_, GTK_STYLE_CLASS_MENUBAR);
	_tmp10_ = hbox;
	gtk_box_pack_start ((GtkBox*) _tmp10_, (GtkWidget*) toolbar, TRUE, TRUE, (guint) 0);
	_tmp11_ = _ ("New");
	_tmp12_ = gd_main_toolbar_add_button (toolbar, NULL, _tmp11_, TRUE);
	_tmp13_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp12_, GTK_TYPE_BUTTON) ? ((GtkButton*) _tmp12_) : NULL);
	_g_object_unref0 (self->priv->new_btn);
	self->priv->new_btn = _tmp13_;
	_tmp14_ = self->priv->new_btn;
	gtk_widget_set_size_request ((GtkWidget*) _tmp14_, 70, -1);
	_tmp15_ = self->priv->new_btn;
	g_signal_connect_object (_tmp15_, "clicked", (GCallback) ___lambda34__gtk_button_clicked, self, 0);
	_tmp16_ = gd_main_toolbar_add_button (toolbar, "go-previous-symbolic", NULL, TRUE);
	_tmp17_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp16_, GTK_TYPE_BUTTON) ? ((GtkButton*) _tmp16_) : NULL);
	_g_object_unref0 (self->priv->back_btn);
	self->priv->back_btn = _tmp17_;
	_tmp18_ = self->priv->back_btn;
	g_signal_connect_object (_tmp18_, "clicked", (GCallback) ___lambda35__gtk_button_clicked, self, 0);
	_tmp19_ = (GtkSpinner*) gtk_spinner_new ();
	g_object_ref_sink (_tmp19_);
	_g_object_unref0 (self->priv->spinner);
	self->priv->spinner = _tmp19_;
	_tmp20_ = gd_main_toolbar_add_button (toolbar, NULL, NULL, FALSE);
	_tmp21_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp20_, GTK_TYPE_BUTTON) ? ((GtkButton*) _tmp20_) : NULL);
	_g_object_unref0 (self->priv->spinner_btn);
	self->priv->spinner_btn = _tmp21_;
	_tmp22_ = self->priv->spinner_btn;
	_tmp23_ = self->priv->spinner;
	gtk_container_add ((GtkContainer*) _tmp22_, (GtkWidget*) _tmp23_);
	_tmp24_ = gd_main_toolbar_add_toggle (toolbar, "edit-find-symbolic", NULL, FALSE);
	_tmp25_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp24_, GTK_TYPE_TOGGLE_BUTTON) ? ((GtkToggleButton*) _tmp24_) : NULL);
	_g_object_unref0 (self->priv->search_btn);
	self->priv->search_btn = _tmp25_;
	_tmp26_ = self->priv->search_btn;
	_tmp27_ = boxes_app_app;
	_tmp28_ = _tmp27_->searchbar;
	g_object_bind_property_with_closures ((GObject*) _tmp26_, "active", (GObject*) _tmp28_, "visible", G_BINDING_BIDIRECTIONAL, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, NULL)));
	_tmp29_ = boxes_app_app;
	g_signal_connect_object ((GObject*) _tmp29_, "notify::search-visible", (GCallback) ___lambda36__g_object_notify, self, 0);
	boxes_topbar_update_search_btn (self);
	_tmp30_ = boxes_app_app;
	_tmp31_ = _tmp30_->collection;
	g_signal_connect_object (_tmp31_, "item-added", (GCallback) _boxes_topbar_update_search_btn_boxes_collection_item_added, self, 0);
	_tmp32_ = boxes_app_app;
	_tmp33_ = _tmp32_->collection;
	g_signal_connect_object (_tmp33_, "item-removed", (GCallback) _boxes_topbar_update_search_btn_boxes_collection_item_removed, self, 0);
	_tmp34_ = gd_main_toolbar_add_button (toolbar, "emblem-default-symbolic", NULL, FALSE);
	_tmp35_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp34_, GTK_TYPE_BUTTON) ? ((GtkButton*) _tmp34_) : NULL);
	_g_object_unref0 (self->priv->select_btn);
	self->priv->select_btn = _tmp35_;
	_tmp36_ = self->priv->select_btn;
	g_signal_connect_object (_tmp36_, "clicked", (GCallback) ___lambda37__gtk_button_clicked, self, 0);
	_tmp37_ = boxes_app_app;
	g_signal_connect_object ((GObject*) _tmp37_, "notify::selection-mode", (GCallback) ___lambda38__g_object_notify, self, 0);
	boxes_topbar_update_select_btn (self);
	_tmp38_ = boxes_app_app;
	_tmp39_ = _tmp38_->collection;
	g_signal_connect_object (_tmp39_, "item-added", (GCallback) _boxes_topbar_update_select_btn_boxes_collection_item_added, self, 0);
	_tmp40_ = boxes_app_app;
	_tmp41_ = _tmp40_->collection;
	g_signal_connect_object (_tmp41_, "item-removed", (GCallback) _boxes_topbar_update_select_btn_boxes_collection_item_removed, self, 0);
	_tmp42_ = (GtkHBox*) gtk_hbox_new (FALSE, 0);
	g_object_ref_sink (_tmp42_);
	_g_object_unref0 (hbox);
	hbox = _tmp42_;
	_tmp43_ = self->notebook;
	_tmp44_ = hbox;
	gtk_notebook_append_page (_tmp43_, (GtkWidget*) _tmp44_, NULL);
	_tmp45_ = (GdMainToolbar*) gd_main_toolbar_new ();
	g_object_ref_sink (_tmp45_);
	_g_object_unref0 (self->priv->selection_toolbar);
	self->priv->selection_toolbar = _tmp45_;
	_tmp46_ = self->priv->selection_toolbar;
	_tmp47_ = gtk_widget_get_style_context ((GtkWidget*) _tmp46_);
	gtk_style_context_add_class (_tmp47_, GTK_STYLE_CLASS_MENUBAR);
	_tmp48_ = hbox;
	_tmp49_ = self->priv->selection_toolbar;
	gtk_box_pack_start ((GtkBox*) _tmp48_, (GtkWidget*) _tmp49_, TRUE, TRUE, (guint) 0);
	boxes_topbar_update_selection_label (self);
	_tmp50_ = self->priv->selection_toolbar;
	_tmp51_ = _ ("_Cancel");
	_tmp52_ = gd_main_toolbar_add_button (_tmp50_, NULL, _tmp51_, FALSE);
	_tmp53_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp52_, GTK_TYPE_BUTTON) ? ((GtkButton*) _tmp52_) : NULL);
	_g_object_unref0 (self->priv->cancel_btn);
	self->priv->cancel_btn = _tmp53_;
	_tmp54_ = self->priv->cancel_btn;
	gtk_button_set_use_stock (_tmp54_, TRUE);
	_tmp55_ = self->priv->cancel_btn;
	g_signal_connect_object (_tmp55_, "clicked", (GCallback) ___lambda40__gtk_button_clicked, self, 0);
	_tmp56_ = (GtkHBox*) gtk_hbox_new (FALSE, 0);
	g_object_ref_sink (_tmp56_);
	_g_object_unref0 (hbox);
	hbox = _tmp56_;
	_tmp57_ = self->notebook;
	_tmp58_ = hbox;
	gtk_notebook_append_page (_tmp57_, (GtkWidget*) _tmp58_, NULL);
	_tmp59_ = (GtkHBox*) gtk_hbox_new (FALSE, 0);
	g_object_ref_sink (_tmp59_);
	_g_object_unref0 (hbox);
	hbox = _tmp59_;
	_tmp60_ = self->notebook;
	_tmp61_ = hbox;
	gtk_notebook_append_page (_tmp60_, (GtkWidget*) _tmp61_, NULL);
	_tmp62_ = self->notebook;
	gtk_notebook_set_show_tabs (_tmp62_, FALSE);
	_tmp63_ = self->notebook;
	gtk_widget_show_all ((GtkWidget*) _tmp63_);
	_g_object_unref0 (toolbar);
	_g_object_unref0 (hbox);
}


static gint g_ptr_array_get_length (GPtrArray* self) {
	gint result;
	guint _tmp0_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->len;
	result = (gint) _tmp0_;
	return result;
}


static void g_ptr_array_set_length (GPtrArray* self, gint value) {
	gint _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	g_ptr_array_set_size (self, _tmp0_);
}


static void boxes_topbar_update_search_btn (BoxesTopbar* self) {
	GtkToggleButton* _tmp0_;
	BoxesApp* _tmp1_;
	BoxesCollection* _tmp2_;
	GPtrArray* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->search_btn;
	_tmp1_ = boxes_app_app;
	_tmp2_ = _tmp1_->collection;
	_tmp3_ = _tmp2_->items;
	_tmp4_ = g_ptr_array_get_length (_tmp3_);
	_tmp5_ = _tmp4_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp0_, _tmp5_ != 0);
}


static void boxes_topbar_update_select_btn (BoxesTopbar* self) {
	GtkButton* _tmp0_;
	BoxesApp* _tmp1_;
	BoxesCollection* _tmp2_;
	GPtrArray* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->select_btn;
	_tmp1_ = boxes_app_app;
	_tmp2_ = _tmp1_->collection;
	_tmp3_ = _tmp2_->items;
	_tmp4_ = g_ptr_array_get_length (_tmp3_);
	_tmp5_ = _tmp4_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp0_, _tmp5_ != 0);
}


void boxes_topbar_set_status (BoxesTopbar* self, const gchar* text) {
	GdMainToolbar* _tmp0_;
	const gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->collection_toolbar;
	_tmp1_ = text;
	gd_main_toolbar_set_labels (_tmp0_, _tmp1_, NULL);
}


static void _g_object_unref0_ (gpointer var) {
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}


static void _g_list_free__g_object_unref0_ (GList* self) {
	g_list_foreach (self, (GFunc) _g_object_unref0_, NULL);
	g_list_free (self);
}


static void boxes_topbar_update_selection_label (BoxesTopbar* self) {
	BoxesApp* _tmp0_;
	GList* _tmp1_;
	GList* _tmp2_;
	GList* _tmp3_;
	guint _tmp4_ = 0U;
	guint _tmp5_;
	guint items;
	guint _tmp6_;
	g_return_if_fail (self != NULL);
	_tmp0_ = boxes_app_app;
	_tmp1_ = boxes_app_get_selected_items (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp4_ = g_list_length (_tmp3_);
	_tmp5_ = _tmp4_;
	__g_list_free__g_object_unref0_0 (_tmp3_);
	items = _tmp5_;
	_tmp6_ = items;
	if (_tmp6_ > ((guint) 0)) {
		GdMainToolbar* _tmp7_;
		guint _tmp8_;
		const gchar* _tmp9_ = NULL;
		guint _tmp10_;
		gchar* _tmp11_ = NULL;
		gchar* _tmp12_;
		_tmp7_ = self->priv->selection_toolbar;
		_tmp8_ = items;
		_tmp9_ = ngettext ("%d selected", "%d selected", (gulong) _tmp8_);
		_tmp10_ = items;
		_tmp11_ = g_strdup_printf (_tmp9_, _tmp10_);
		_tmp12_ = _tmp11_;
		gd_main_toolbar_set_labels (_tmp7_, _tmp12_, NULL);
		_g_free0 (_tmp12_);
	} else {
		GdMainToolbar* _tmp13_;
		const gchar* _tmp14_ = NULL;
		_tmp13_ = self->priv->selection_toolbar;
		_tmp14_ = _ ("Click on items to select them");
		gd_main_toolbar_set_labels (_tmp13_, NULL, _tmp14_);
	}
}


static void boxes_topbar_real_ui_state_changed (BoxesUI* base) {
	BoxesTopbar * self;
	BoxesUIState _tmp0_;
	BoxesUIState _tmp1_;
	self = (BoxesTopbar*) base;
	_tmp0_ = boxes_ui_get_ui_state ((BoxesUI*) self);
	_tmp1_ = _tmp0_;
	switch (_tmp1_) {
		case BOXES_UI_STATE_COLLECTION:
		{
			GtkNotebook* _tmp2_;
			GtkButton* _tmp3_;
			GtkButton* _tmp4_;
			GtkButton* _tmp5_;
			GtkToggleButton* _tmp6_;
			GtkButton* _tmp7_;
			boxes_topbar_set_status (self, NULL);
			_tmp2_ = self->notebook;
			g_object_set (_tmp2_, "page", (gint) BOXES_TOPBAR_PAGE_COLLECTION, NULL);
			_tmp3_ = self->priv->back_btn;
			gtk_widget_hide ((GtkWidget*) _tmp3_);
			_tmp4_ = self->priv->spinner_btn;
			gtk_widget_hide ((GtkWidget*) _tmp4_);
			_tmp5_ = self->priv->select_btn;
			gtk_widget_show ((GtkWidget*) _tmp5_);
			_tmp6_ = self->priv->search_btn;
			gtk_widget_show ((GtkWidget*) _tmp6_);
			_tmp7_ = self->priv->new_btn;
			gtk_widget_show ((GtkWidget*) _tmp7_);
			break;
		}
		case BOXES_UI_STATE_CREDS:
		{
			GtkButton* _tmp8_;
			GtkButton* _tmp9_;
			GtkButton* _tmp10_;
			GtkButton* _tmp11_;
			GtkToggleButton* _tmp12_;
			_tmp8_ = self->priv->new_btn;
			gtk_widget_hide ((GtkWidget*) _tmp8_);
			_tmp9_ = self->priv->back_btn;
			gtk_widget_show ((GtkWidget*) _tmp9_);
			_tmp10_ = self->priv->spinner_btn;
			gtk_widget_show ((GtkWidget*) _tmp10_);
			_tmp11_ = self->priv->select_btn;
			gtk_widget_hide ((GtkWidget*) _tmp11_);
			_tmp12_ = self->priv->search_btn;
			gtk_widget_hide ((GtkWidget*) _tmp12_);
			break;
		}
		case BOXES_UI_STATE_DISPLAY:
		{
			break;
		}
		case BOXES_UI_STATE_PROPERTIES:
		{
			GtkNotebook* _tmp13_;
			_tmp13_ = self->notebook;
			g_object_set (_tmp13_, "page", (gint) BOXES_TOPBAR_PAGE_PROPERTIES, NULL);
			break;
		}
		case BOXES_UI_STATE_WIZARD:
		{
			GtkNotebook* _tmp14_;
			_tmp14_ = self->notebook;
			g_object_set (_tmp14_, "page", (gint) BOXES_TOPBAR_PAGE_WIZARD, NULL);
			break;
		}
		default:
		{
			break;
		}
	}
}


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


static void boxes_topbar_class_init (BoxesTopbarClass * klass) {
	boxes_topbar_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (BoxesTopbarPrivate));
	BOXES_UI_CLASS (klass)->ui_state_changed = boxes_topbar_real_ui_state_changed;
	BOXES_UI_CLASS (klass)->get_actor = boxes_topbar_real_get_actor;
	G_OBJECT_CLASS (klass)->get_property = _vala_boxes_topbar_get_property;
	G_OBJECT_CLASS (klass)->finalize = boxes_topbar_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_TOPBAR_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_topbar_instance_init (BoxesTopbar * self) {
	self->priv = BOXES_TOPBAR_GET_PRIVATE (self);
}


static void boxes_topbar_finalize (GObject* obj) {
	BoxesTopbar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_TOPBAR, BoxesTopbar);
	_g_object_unref0 (self->priv->gtk_actor);
	_g_object_unref0 (self->notebook);
	_g_object_unref0 (self->priv->spinner);
	_g_object_unref0 (self->priv->search_btn);
	_g_object_unref0 (self->priv->select_btn);
	_g_object_unref0 (self->priv->cancel_btn);
	_g_object_unref0 (self->priv->spinner_btn);
	_g_object_unref0 (self->priv->back_btn);
	_g_object_unref0 (self->priv->new_btn);
	_g_object_unref0 (self->priv->selection_toolbar);
	_g_object_unref0 (self->priv->collection_toolbar);
	G_OBJECT_CLASS (boxes_topbar_parent_class)->finalize (obj);
}


GType boxes_topbar_get_type (void) {
	static volatile gsize boxes_topbar_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_topbar_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BoxesTopbarClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_topbar_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesTopbar), 0, (GInstanceInitFunc) boxes_topbar_instance_init, NULL };
		GType boxes_topbar_type_id;
		boxes_topbar_type_id = g_type_register_static (BOXES_TYPE_UI, "BoxesTopbar", &g_define_type_info, 0);
		g_once_init_leave (&boxes_topbar_type_id__volatile, boxes_topbar_type_id);
	}
	return boxes_topbar_type_id__volatile;
}


static void _vala_boxes_topbar_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	BoxesTopbar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_TOPBAR, BoxesTopbar);
	switch (property_id) {
		case BOXES_TOPBAR_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;
	}
}



