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

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

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


#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;
typedef struct _BoxesSelectionbarPrivate BoxesSelectionbarPrivate;

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

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

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

#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_MACHINE (boxes_machine_get_type ())
#define BOXES_MACHINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_MACHINE, BoxesMachine))
#define BOXES_MACHINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_MACHINE, BoxesMachineClass))
#define BOXES_IS_MACHINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_MACHINE))
#define BOXES_IS_MACHINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_MACHINE))
#define BOXES_MACHINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_MACHINE, BoxesMachineClass))

typedef struct _BoxesMachine BoxesMachine;
typedef struct _BoxesMachineClass BoxesMachineClass;
typedef struct _BoxesUIPrivate BoxesUIPrivate;

#define BOXES_TYPE_UI_STATE (boxes_ui_state_get_type ())
typedef struct _BoxesCollectionItemPrivate BoxesCollectionItemPrivate;

#define BOXES_TYPE_IPROPERTIES_PROVIDER (boxes_iproperties_provider_get_type ())
#define BOXES_IPROPERTIES_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_IPROPERTIES_PROVIDER, BoxesIPropertiesProvider))
#define BOXES_IS_IPROPERTIES_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_IPROPERTIES_PROVIDER))
#define BOXES_IPROPERTIES_PROVIDER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), BOXES_TYPE_IPROPERTIES_PROVIDER, BoxesIPropertiesProviderIface))

typedef struct _BoxesIPropertiesProvider BoxesIPropertiesProvider;
typedef struct _BoxesIPropertiesProviderIface BoxesIPropertiesProviderIface;

#define BOXES_TYPE_PROPERTIES_PAGE (boxes_properties_page_get_type ())

#define BOXES_TYPE_PAIR (boxes_pair_get_type ())
#define BOXES_PAIR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_PAIR, BoxesPair))
#define BOXES_PAIR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_PAIR, BoxesPairClass))
#define BOXES_IS_PAIR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_PAIR))
#define BOXES_IS_PAIR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_PAIR))
#define BOXES_PAIR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_PAIR, BoxesPairClass))

typedef struct _BoxesPair BoxesPair;
typedef struct _BoxesPairClass BoxesPairClass;
typedef struct _BoxesMachinePrivate BoxesMachinePrivate;

#define BOXES_TYPE_MACHINE_ACTOR (boxes_machine_actor_get_type ())
#define BOXES_MACHINE_ACTOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_MACHINE_ACTOR, BoxesMachineActor))
#define BOXES_MACHINE_ACTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_MACHINE_ACTOR, BoxesMachineActorClass))
#define BOXES_IS_MACHINE_ACTOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_MACHINE_ACTOR))
#define BOXES_IS_MACHINE_ACTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_MACHINE_ACTOR))
#define BOXES_MACHINE_ACTOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_MACHINE_ACTOR, BoxesMachineActorClass))

typedef struct _BoxesMachineActor BoxesMachineActor;
typedef struct _BoxesMachineActorClass BoxesMachineActorClass;

#define BOXES_TYPE_COLLECTION_SOURCE (boxes_collection_source_get_type ())
#define BOXES_COLLECTION_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_COLLECTION_SOURCE, BoxesCollectionSource))
#define BOXES_COLLECTION_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_COLLECTION_SOURCE, BoxesCollectionSourceClass))
#define BOXES_IS_COLLECTION_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_COLLECTION_SOURCE))
#define BOXES_IS_COLLECTION_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_COLLECTION_SOURCE))
#define BOXES_COLLECTION_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_COLLECTION_SOURCE, BoxesCollectionSourceClass))

typedef struct _BoxesCollectionSource BoxesCollectionSource;
typedef struct _BoxesCollectionSourceClass BoxesCollectionSourceClass;

#define BOXES_TYPE_DISPLAY_CONFIG (boxes_display_config_get_type ())
#define BOXES_DISPLAY_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_DISPLAY_CONFIG, BoxesDisplayConfig))
#define BOXES_DISPLAY_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_DISPLAY_CONFIG, BoxesDisplayConfigClass))
#define BOXES_IS_DISPLAY_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_DISPLAY_CONFIG))
#define BOXES_IS_DISPLAY_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_DISPLAY_CONFIG))
#define BOXES_DISPLAY_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_DISPLAY_CONFIG, BoxesDisplayConfigClass))

typedef struct _BoxesDisplayConfig BoxesDisplayConfig;
typedef struct _BoxesDisplayConfigClass BoxesDisplayConfigClass;
#define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))
typedef struct _BoxesAppPrivate BoxesAppPrivate;

#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_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_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;

struct _BoxesSelectionbar {
	GObject parent_instance;
	BoxesSelectionbarPrivate * priv;
};

struct _BoxesSelectionbarClass {
	GObjectClass parent_class;
};

struct _BoxesSelectionbarPrivate {
	BoxesApp* app;
	GtkClutterActor* gtk_actor;
	GtkToolbar* toolbar;
	GtkToggleToolButton* favorite_btn;
	GtkToggleToolButton* remove_btn;
};

struct _Block24Data {
	int _ref_count_;
	BoxesSelectionbar * self;
	BoxesApp* app;
};

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 _BoxesCollectionItem {
	BoxesUI parent_instance;
	BoxesCollectionItemPrivate * priv;
};

struct _BoxesCollectionItemClass {
	BoxesUIClass parent_class;
};

typedef enum  {
	BOXES_PROPERTIES_PAGE_LOGIN,
	BOXES_PROPERTIES_PAGE_SYSTEM,
	BOXES_PROPERTIES_PAGE_DISPLAY,
	BOXES_PROPERTIES_PAGE_DEVICES,
	BOXES_PROPERTIES_PAGE_LAST
} BoxesPropertiesPage;

struct _BoxesIPropertiesProviderIface {
	GTypeInterface parent_iface;
	GList* (*get_properties) (BoxesIPropertiesProvider* self, BoxesPropertiesPage page);
};

struct _BoxesMachine {
	BoxesCollectionItem parent_instance;
	BoxesMachinePrivate * priv;
	BoxesApp* app;
	BoxesMachineActor* machine_actor;
	BoxesCollectionSource* source;
	BoxesDisplayConfig* config;
	gboolean deleted;
};

struct _BoxesMachineClass {
	BoxesCollectionItemClass parent_class;
	gchar* (*get_screenshot_filename) (BoxesMachine* self, const gchar* ext);
	void (*take_screenshot) (BoxesMachine* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	gboolean (*take_screenshot_finish) (BoxesMachine* self, GAsyncResult* _res_, GError** error);
	GList* (*get_properties) (BoxesMachine* self, BoxesPropertiesPage page);
	gchar* (*get_screenshot_prefix) (BoxesMachine* self);
	void (*connect_display) (BoxesMachine* self);
	void (*disconnect_display) (BoxesMachine* self);
	void (*delete) (BoxesMachine* self, gboolean by_user);
};

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

struct _BoxesAppClass {
	BoxesUIClass parent_class;
};


static gpointer boxes_selectionbar_parent_class = NULL;

GType boxes_selectionbar_get_type (void) G_GNUC_CONST;
GType boxes_ui_get_type (void) G_GNUC_CONST;
GType boxes_app_get_type (void) G_GNUC_CONST;
#define BOXES_SELECTIONBAR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_SELECTIONBAR, BoxesSelectionbarPrivate))
enum  {
	BOXES_SELECTIONBAR_DUMMY_PROPERTY,
	BOXES_SELECTIONBAR_ACTOR
};
#define BOXES_SELECTIONBAR_spacing 60.0f
BoxesSelectionbar* boxes_selectionbar_new (BoxesApp* app);
BoxesSelectionbar* boxes_selectionbar_construct (GType object_type, BoxesApp* app);
static Block24Data* block24_data_ref (Block24Data* _data24_);
static void block24_data_unref (void * _userdata_);
static void __lambda105_ (Block24Data* _data24_);
GType boxes_collection_item_get_type (void) G_GNUC_CONST;
GList* boxes_app_get_selected_items (BoxesApp* self);
GType boxes_machine_get_type (void) G_GNUC_CONST;
GType boxes_ui_state_get_type (void) G_GNUC_CONST;
GType boxes_properties_page_get_type (void) G_GNUC_CONST;
gpointer boxes_pair_ref (gpointer instance);
void boxes_pair_unref (gpointer instance);
GParamSpec* boxes_param_spec_pair (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void boxes_value_set_pair (GValue* value, gpointer v_object);
void boxes_value_take_pair (GValue* value, gpointer v_object);
gpointer boxes_value_get_pair (const GValue* value);
GType boxes_pair_get_type (void) G_GNUC_CONST;
GType boxes_iproperties_provider_get_type (void) G_GNUC_CONST;
GType boxes_machine_actor_get_type (void) G_GNUC_CONST;
GType boxes_collection_source_get_type (void) G_GNUC_CONST;
GType boxes_display_config_get_type (void) G_GNUC_CONST;
void boxes_display_config_add_category (BoxesDisplayConfig* self, const gchar* category);
static void _g_object_unref0_ (gpointer var);
static void _g_list_free__g_object_unref0_ (GList* self);
static void ___lambda105__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self);
static void __lambda106_ (Block24Data* _data24_);
void boxes_app_remove_selected_items (BoxesApp* self);
static void ___lambda106__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self);
ClutterActor* boxes_selectionbar_get_actor (BoxesSelectionbar* self);
static void __lambda109_ (BoxesSelectionbar* self);
static void boxes_selectionbar_update_visible (BoxesSelectionbar* self);
static void ___lambda109__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void __lambda111_ (BoxesSelectionbar* self);
static void ___lambda111__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
GType boxes_topbar_get_type (void) G_GNUC_CONST;
GType boxes_notificationbar_get_type (void) G_GNUC_CONST;
GType boxes_sidebar_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;
gboolean boxes_app_get_selection_mode (BoxesApp* self);
static void boxes_selectionbar_set_visible (BoxesSelectionbar* self, gboolean value);
static void boxes_selectionbar_show (BoxesSelectionbar* self);
static void boxes_selectionbar_hide (BoxesSelectionbar* self);
static void __lambda110_ (BoxesSelectionbar* self);
static void ___lambda110__clutter_animation_completed (ClutterAnimation* _sender, gpointer self);
static void boxes_selectionbar_finalize (GObject* obj);
static void _vala_boxes_selectionbar_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_boxes_selectionbar_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


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


static Block24Data* block24_data_ref (Block24Data* _data24_) {
	g_atomic_int_inc (&_data24_->_ref_count_);
	return _data24_;
}


static void block24_data_unref (void * _userdata_) {
	Block24Data* _data24_;
	_data24_ = (Block24Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data24_->_ref_count_)) {
		BoxesSelectionbar * self;
		self = _data24_->self;
		_g_object_unref0 (_data24_->app);
		_g_object_unref0 (self);
		g_slice_free (Block24Data, _data24_);
	}
}


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 __lambda105_ (Block24Data* _data24_) {
	BoxesSelectionbar * self;
	BoxesApp* _tmp0_;
	GList* _tmp1_;
	GList* _tmp2_;
	self = _data24_->self;
	_tmp0_ = _data24_->app;
	_tmp1_ = boxes_app_get_selected_items (_tmp0_);
	_tmp2_ = _tmp1_;
	{
		GList* item_collection = NULL;
		GList* item_it = NULL;
		item_collection = _tmp2_;
		for (item_it = item_collection; item_it != NULL; item_it = item_it->next) {
			BoxesCollectionItem* _tmp3_;
			BoxesCollectionItem* item = NULL;
			_tmp3_ = _g_object_ref0 ((BoxesCollectionItem*) item_it->data);
			item = _tmp3_;
			{
				BoxesCollectionItem* _tmp4_;
				BoxesMachine* _tmp5_;
				BoxesMachine* machine;
				BoxesMachine* _tmp6_;
				_tmp4_ = item;
				_tmp5_ = _g_object_ref0 (BOXES_IS_MACHINE (_tmp4_) ? ((BoxesMachine*) _tmp4_) : NULL);
				machine = _tmp5_;
				_tmp6_ = machine;
				if (_tmp6_ != NULL) {
					BoxesMachine* _tmp7_;
					BoxesDisplayConfig* _tmp8_;
					_tmp7_ = machine;
					_tmp8_ = _tmp7_->config;
					boxes_display_config_add_category (_tmp8_, "favourite");
				}
				_g_object_unref0 (machine);
				_g_object_unref0 (item);
			}
		}
		__g_list_free__g_object_unref0_0 (item_collection);
	}
}


static void ___lambda105__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self) {
	__lambda105_ (self);
}


static void __lambda106_ (Block24Data* _data24_) {
	BoxesSelectionbar * self;
	BoxesApp* _tmp0_;
	self = _data24_->self;
	_tmp0_ = _data24_->app;
	boxes_app_remove_selected_items (_tmp0_);
}


static void ___lambda106__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self) {
	__lambda106_ (self);
}


static void __lambda109_ (BoxesSelectionbar* self) {
	boxes_selectionbar_update_visible (self);
}


static void ___lambda109__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda109_ (self);
}


static void __lambda111_ (BoxesSelectionbar* self) {
	boxes_selectionbar_update_visible (self);
}


static void ___lambda111__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda111_ (self);
}


BoxesSelectionbar* boxes_selectionbar_construct (GType object_type, BoxesApp* app) {
	BoxesSelectionbar * self = NULL;
	Block24Data* _data24_;
	BoxesApp* _tmp0_;
	BoxesApp* _tmp1_;
	BoxesApp* _tmp2_;
	BoxesApp* _tmp3_;
	GtkToolbar* _tmp4_;
	GtkToolbar* _tmp5_;
	GtkToolbar* _tmp6_;
	GtkToolbar* _tmp7_;
	GtkToolbar* _tmp8_;
	GtkClutterActor* _tmp9_;
	GtkClutterActor* _tmp10_;
	GtkClutterActor* _tmp11_;
	GtkClutterActor* _tmp12_;
	GtkWidget* _tmp13_ = NULL;
	GtkStyleContext* _tmp14_ = NULL;
	GtkToggleToolButton* _tmp15_;
	GtkToggleToolButton* _tmp16_;
	GtkToolbar* _tmp17_;
	GtkToggleToolButton* _tmp18_;
	GtkToggleToolButton* _tmp19_;
	GtkToggleToolButton* _tmp20_;
	GtkSeparatorToolItem* _tmp21_;
	GtkSeparatorToolItem* _tmp22_;
	GtkSeparatorToolItem* separator;
	GtkToolbar* _tmp23_;
	GtkToggleToolButton* _tmp24_;
	GtkToggleToolButton* _tmp25_;
	GtkToolbar* _tmp26_;
	GtkToggleToolButton* _tmp27_;
	GtkToggleToolButton* _tmp28_;
	GtkToggleToolButton* _tmp29_;
	GtkToolbar* _tmp30_;
	ClutterActor* _tmp31_;
	ClutterActor* _tmp32_;
	ClutterActor* _tmp33_;
	ClutterActor* _tmp34_;
	BoxesApp* _tmp35_;
	BoxesApp* _tmp36_;
	BoxesApp* _tmp37_;
	ClutterStage* _tmp38_;
	ClutterActor* _tmp39_;
	ClutterActor* _tmp40_;
	g_return_val_if_fail (app != NULL, NULL);
	_data24_ = g_slice_new0 (Block24Data);
	_data24_->_ref_count_ = 1;
	_tmp0_ = app;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_data24_->app = _tmp1_;
	self = (BoxesSelectionbar*) g_object_new (object_type, NULL);
	_data24_->self = g_object_ref (self);
	_tmp2_ = _data24_->app;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_g_object_unref0 (self->priv->app);
	self->priv->app = _tmp3_;
	_tmp4_ = (GtkToolbar*) gtk_toolbar_new ();
	_tmp5_ = g_object_ref_sink (_tmp4_);
	_g_object_unref0 (self->priv->toolbar);
	self->priv->toolbar = _tmp5_;
	_tmp6_ = self->priv->toolbar;
	gtk_toolbar_set_show_arrow (_tmp6_, FALSE);
	_tmp7_ = self->priv->toolbar;
	gtk_toolbar_set_icon_size (_tmp7_, (gint) GTK_ICON_SIZE_LARGE_TOOLBAR);
	_tmp8_ = self->priv->toolbar;
	_tmp9_ = (GtkClutterActor*) gtk_clutter_actor_new_with_contents ((GtkWidget*) _tmp8_);
	_tmp10_ = g_object_ref_sink (_tmp9_);
	_g_object_unref0 (self->priv->gtk_actor);
	self->priv->gtk_actor = _tmp10_;
	_tmp11_ = self->priv->gtk_actor;
	clutter_actor_set_opacity ((ClutterActor*) _tmp11_, (guint) 0);
	_tmp12_ = self->priv->gtk_actor;
	_tmp13_ = gtk_clutter_actor_get_widget (_tmp12_);
	_tmp14_ = gtk_widget_get_style_context (_tmp13_);
	gtk_style_context_add_class (_tmp14_, "osd");
	_tmp15_ = (GtkToggleToolButton*) gtk_toggle_tool_button_new ();
	_tmp16_ = g_object_ref_sink (_tmp15_);
	_g_object_unref0 (self->priv->favorite_btn);
	self->priv->favorite_btn = _tmp16_;
	_tmp17_ = self->priv->toolbar;
	_tmp18_ = self->priv->favorite_btn;
	gtk_toolbar_insert (_tmp17_, (GtkToolItem*) _tmp18_, 0);
	_tmp19_ = self->priv->favorite_btn;
	gtk_tool_button_set_icon_name ((GtkToolButton*) _tmp19_, "emblem-favorite-symbolic");
	_tmp20_ = self->priv->favorite_btn;
	g_signal_connect_data ((GtkToolButton*) _tmp20_, "clicked", (GCallback) ___lambda105__gtk_tool_button_clicked, block24_data_ref (_data24_), (GClosureNotify) block24_data_unref, 0);
	_tmp21_ = (GtkSeparatorToolItem*) gtk_separator_tool_item_new ();
	_tmp22_ = g_object_ref_sink (_tmp21_);
	separator = _tmp22_;
	_tmp23_ = self->priv->toolbar;
	gtk_toolbar_insert (_tmp23_, (GtkToolItem*) separator, 1);
	_tmp24_ = (GtkToggleToolButton*) gtk_toggle_tool_button_new ();
	_tmp25_ = g_object_ref_sink (_tmp24_);
	_g_object_unref0 (self->priv->remove_btn);
	self->priv->remove_btn = _tmp25_;
	_tmp26_ = self->priv->toolbar;
	_tmp27_ = self->priv->remove_btn;
	gtk_toolbar_insert (_tmp26_, (GtkToolItem*) _tmp27_, 2);
	_tmp28_ = self->priv->remove_btn;
	gtk_tool_button_set_icon_name ((GtkToolButton*) _tmp28_, "edit-delete-symbolic");
	_tmp29_ = self->priv->remove_btn;
	g_signal_connect_data ((GtkToolButton*) _tmp29_, "clicked", (GCallback) ___lambda106__gtk_tool_button_clicked, block24_data_ref (_data24_), (GClosureNotify) block24_data_unref, 0);
	_tmp30_ = self->priv->toolbar;
	gtk_widget_show_all ((GtkWidget*) _tmp30_);
	_tmp31_ = boxes_selectionbar_get_actor (self);
	_tmp32_ = _tmp31_;
	clutter_actor_set_reactive (_tmp32_, TRUE);
	_tmp33_ = boxes_selectionbar_get_actor (self);
	_tmp34_ = _tmp33_;
	clutter_actor_hide (_tmp34_);
	_tmp35_ = _data24_->app;
	g_signal_connect_object ((GObject*) _tmp35_, "notify::selection-mode", (GCallback) ___lambda109__g_object_notify, self, 0);
	_tmp36_ = _data24_->app;
	g_signal_connect_object ((GObject*) _tmp36_, "notify::selected-items", (GCallback) ___lambda111__g_object_notify, self, 0);
	_tmp37_ = _data24_->app;
	_tmp38_ = _tmp37_->stage;
	_tmp39_ = boxes_selectionbar_get_actor (self);
	_tmp40_ = _tmp39_;
	clutter_container_add ((ClutterContainer*) _tmp38_, _tmp40_, NULL);
	_g_object_unref0 (separator);
	block24_data_unref (_data24_);
	_data24_ = NULL;
	return self;
}


BoxesSelectionbar* boxes_selectionbar_new (BoxesApp* app) {
	return boxes_selectionbar_construct (BOXES_TYPE_SELECTIONBAR, app);
}


static void boxes_selectionbar_update_visible (BoxesSelectionbar* self) {
	BoxesApp* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->app;
	_tmp1_ = boxes_app_get_selection_mode (_tmp0_);
	_tmp2_ = _tmp1_;
	if (!_tmp2_) {
		boxes_selectionbar_set_visible (self, FALSE);
	} else {
		BoxesApp* _tmp3_;
		GList* _tmp4_;
		GList* _tmp5_;
		GList* _tmp6_;
		guint _tmp7_ = 0U;
		_tmp3_ = self->priv->app;
		_tmp4_ = boxes_app_get_selected_items (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = _tmp5_;
		_tmp7_ = g_list_length (_tmp6_);
		boxes_selectionbar_set_visible (self, _tmp7_ > ((guint) 0));
		__g_list_free__g_object_unref0_0 (_tmp6_);
	}
}


static void boxes_selectionbar_show (BoxesSelectionbar* self) {
	ClutterActor* _tmp0_;
	ClutterActor* _tmp1_;
	ClutterActor* _tmp2_;
	ClutterActor* _tmp3_;
	ClutterActor* _tmp4_;
	ClutterActor* _tmp5_;
	BoxesApp* _tmp6_;
	guint _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = boxes_selectionbar_get_actor (self);
	_tmp1_ = _tmp0_;
	clutter_actor_show (_tmp1_);
	_tmp2_ = boxes_selectionbar_get_actor (self);
	_tmp3_ = _tmp2_;
	clutter_actor_queue_redraw (_tmp3_);
	_tmp4_ = boxes_selectionbar_get_actor (self);
	_tmp5_ = _tmp4_;
	_tmp6_ = self->priv->app;
	_tmp7_ = _tmp6_->duration;
	clutter_actor_animate (_tmp5_, (gulong) CLUTTER_LINEAR, _tmp7_, "opacity", 255, NULL);
}


static void __lambda110_ (BoxesSelectionbar* self) {
	ClutterActor* _tmp0_;
	ClutterActor* _tmp1_;
	_tmp0_ = boxes_selectionbar_get_actor (self);
	_tmp1_ = _tmp0_;
	clutter_actor_hide (_tmp1_);
}


static void ___lambda110__clutter_animation_completed (ClutterAnimation* _sender, gpointer self) {
	__lambda110_ (self);
}


static void boxes_selectionbar_hide (BoxesSelectionbar* self) {
	ClutterActor* _tmp0_;
	ClutterActor* _tmp1_;
	BoxesApp* _tmp2_;
	guint _tmp3_;
	ClutterAnimation* _tmp4_ = NULL;
	ClutterAnimation* _tmp5_;
	ClutterAnimation* anim;
	g_return_if_fail (self != NULL);
	_tmp0_ = boxes_selectionbar_get_actor (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->app;
	_tmp3_ = _tmp2_->duration;
	_tmp4_ = clutter_actor_animate (_tmp1_, (gulong) CLUTTER_LINEAR, _tmp3_, "opacity", 0, NULL);
	_tmp5_ = _g_object_ref0 (_tmp4_);
	anim = _tmp5_;
	g_signal_connect_object (anim, "completed", (GCallback) ___lambda110__clutter_animation_completed, self, 0);
	_g_object_unref0 (anim);
}


ClutterActor* boxes_selectionbar_get_actor (BoxesSelectionbar* self) {
	ClutterActor* result;
	GtkClutterActor* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->gtk_actor;
	result = (ClutterActor*) _tmp0_;
	return result;
}


static void boxes_selectionbar_set_visible (BoxesSelectionbar* self, gboolean value) {
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	if (_tmp0_) {
		boxes_selectionbar_show (self);
	} else {
		boxes_selectionbar_hide (self);
	}
}


static void boxes_selectionbar_class_init (BoxesSelectionbarClass * klass) {
	boxes_selectionbar_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (BoxesSelectionbarPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_boxes_selectionbar_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_boxes_selectionbar_set_property;
	G_OBJECT_CLASS (klass)->finalize = boxes_selectionbar_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_SELECTIONBAR_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_selectionbar_instance_init (BoxesSelectionbar * self) {
	self->priv = BOXES_SELECTIONBAR_GET_PRIVATE (self);
}


static void boxes_selectionbar_finalize (GObject* obj) {
	BoxesSelectionbar * self;
	self = BOXES_SELECTIONBAR (obj);
	_g_object_unref0 (self->priv->app);
	_g_object_unref0 (self->priv->gtk_actor);
	_g_object_unref0 (self->priv->toolbar);
	_g_object_unref0 (self->priv->favorite_btn);
	_g_object_unref0 (self->priv->remove_btn);
	G_OBJECT_CLASS (boxes_selectionbar_parent_class)->finalize (obj);
}


GType boxes_selectionbar_get_type (void) {
	static volatile gsize boxes_selectionbar_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_selectionbar_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BoxesSelectionbarClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_selectionbar_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesSelectionbar), 0, (GInstanceInitFunc) boxes_selectionbar_instance_init, NULL };
		GType boxes_selectionbar_type_id;
		boxes_selectionbar_type_id = g_type_register_static (G_TYPE_OBJECT, "BoxesSelectionbar", &g_define_type_info, 0);
		g_once_init_leave (&boxes_selectionbar_type_id__volatile, boxes_selectionbar_type_id);
	}
	return boxes_selectionbar_type_id__volatile;
}


static void _vala_boxes_selectionbar_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	BoxesSelectionbar * self;
	self = BOXES_SELECTIONBAR (object);
	switch (property_id) {
		case BOXES_SELECTIONBAR_ACTOR:
		g_value_set_object (value, boxes_selectionbar_get_actor (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_boxes_selectionbar_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	BoxesSelectionbar * self;
	self = BOXES_SELECTIONBAR (object);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}



