/* selection-toolbar.c generated by valac 0.37.1.4-3591e, the Vala compiler
 * generated from selection-toolbar.vala, do not modify */

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

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


#define BOXES_TYPE_SELECTION_TOOLBAR (boxes_selection_toolbar_get_type ())
#define BOXES_SELECTION_TOOLBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_SELECTION_TOOLBAR, BoxesSelectionToolbar))
#define BOXES_SELECTION_TOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_SELECTION_TOOLBAR, BoxesSelectionToolbarClass))
#define BOXES_IS_SELECTION_TOOLBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_SELECTION_TOOLBAR))
#define BOXES_IS_SELECTION_TOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_SELECTION_TOOLBAR))
#define BOXES_SELECTION_TOOLBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_SELECTION_TOOLBAR, BoxesSelectionToolbarClass))

typedef struct _BoxesSelectionToolbar BoxesSelectionToolbar;
typedef struct _BoxesSelectionToolbarClass BoxesSelectionToolbarClass;
typedef struct _BoxesSelectionToolbarPrivate BoxesSelectionToolbarPrivate;

#define BOXES_TYPE_APP_WINDOW (boxes_app_window_get_type ())
#define BOXES_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_APP_WINDOW, BoxesAppWindow))
#define BOXES_APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_APP_WINDOW, BoxesAppWindowClass))
#define BOXES_IS_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_APP_WINDOW))
#define BOXES_IS_APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_APP_WINDOW))
#define BOXES_APP_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_APP_WINDOW, BoxesAppWindowClass))

typedef struct _BoxesAppWindow BoxesAppWindow;
typedef struct _BoxesAppWindowClass BoxesAppWindowClass;
enum  {
	BOXES_SELECTION_TOOLBAR_DUMMY_PROPERTY,
	BOXES_SELECTION_TOOLBAR_LAST_PROPERTY
};
static GParamSpec* boxes_selection_toolbar_properties[BOXES_SELECTION_TOOLBAR_LAST_PROPERTY];
#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 (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_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_UI (boxes_ui_get_type ())
#define BOXES_UI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_UI, BoxesUI))
#define BOXES_IS_UI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_UI))
#define BOXES_UI_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), BOXES_TYPE_UI, BoxesUIIface))

typedef struct _BoxesUI BoxesUI;
typedef struct _BoxesUIIface BoxesUIIface;

#define BOXES_TYPE_UI_STATE (boxes_ui_state_get_type ())
typedef struct _BoxesAppWindowPrivate BoxesAppWindowPrivate;

#define BOXES_TYPE_WIZARD_WINDOW (boxes_wizard_window_get_type ())
#define BOXES_WIZARD_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_WIZARD_WINDOW, BoxesWizardWindow))
#define BOXES_WIZARD_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_WIZARD_WINDOW, BoxesWizardWindowClass))
#define BOXES_IS_WIZARD_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_WIZARD_WINDOW))
#define BOXES_IS_WIZARD_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_WIZARD_WINDOW))
#define BOXES_WIZARD_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_WIZARD_WINDOW, BoxesWizardWindowClass))

typedef struct _BoxesWizardWindow BoxesWizardWindow;
typedef struct _BoxesWizardWindowClass BoxesWizardWindowClass;

#define BOXES_TYPE_PROPERTIES_WINDOW (boxes_properties_window_get_type ())
#define BOXES_PROPERTIES_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_PROPERTIES_WINDOW, BoxesPropertiesWindow))
#define BOXES_PROPERTIES_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_PROPERTIES_WINDOW, BoxesPropertiesWindowClass))
#define BOXES_IS_PROPERTIES_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_PROPERTIES_WINDOW))
#define BOXES_IS_PROPERTIES_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_PROPERTIES_WINDOW))
#define BOXES_PROPERTIES_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_PROPERTIES_WINDOW, BoxesPropertiesWindowClass))

typedef struct _BoxesPropertiesWindow BoxesPropertiesWindow;
typedef struct _BoxesPropertiesWindowClass BoxesPropertiesWindowClass;

#define BOXES_TYPE_SEARCHBAR (boxes_searchbar_get_type ())
#define BOXES_SEARCHBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_SEARCHBAR, BoxesSearchbar))
#define BOXES_SEARCHBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_SEARCHBAR, BoxesSearchbarClass))
#define BOXES_IS_SEARCHBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_SEARCHBAR))
#define BOXES_IS_SEARCHBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_SEARCHBAR))
#define BOXES_SEARCHBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_SEARCHBAR, BoxesSearchbarClass))

typedef struct _BoxesSearchbar BoxesSearchbar;
typedef struct _BoxesSearchbarClass BoxesSearchbarClass;

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

typedef struct _BoxesTopbar BoxesTopbar;
typedef struct _BoxesTopbarClass BoxesTopbarClass;

#define BOXES_TYPE_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_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_EMPTY_BOXES (boxes_empty_boxes_get_type ())
#define BOXES_EMPTY_BOXES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_EMPTY_BOXES, BoxesEmptyBoxes))
#define BOXES_EMPTY_BOXES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_EMPTY_BOXES, BoxesEmptyBoxesClass))
#define BOXES_IS_EMPTY_BOXES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_EMPTY_BOXES))
#define BOXES_IS_EMPTY_BOXES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_EMPTY_BOXES))
#define BOXES_EMPTY_BOXES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_EMPTY_BOXES, BoxesEmptyBoxesClass))

typedef struct _BoxesEmptyBoxes BoxesEmptyBoxes;
typedef struct _BoxesEmptyBoxesClass BoxesEmptyBoxesClass;
#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 struct _BoxesCollectionPrivate BoxesCollectionPrivate;

struct _BoxesSelectionToolbar {
	GtkHeaderBar parent_instance;
	BoxesSelectionToolbarPrivate * priv;
};

struct _BoxesSelectionToolbarClass {
	GtkHeaderBarClass parent_class;
};

struct _BoxesSelectionToolbarPrivate {
	GtkButton* search_btn;
	GtkMenuButton* menu_button;
	GtkLabel* menu_button_label;
	BoxesAppWindow* window;
};

struct _BoxesApp {
	GtkApplication parent_instance;
	BoxesAppPrivate * priv;
	BoxesCollection* collection;
	BoxesAsyncLauncher* async_launcher;
};

struct _BoxesAppClass {
	GtkApplicationClass parent_class;
};

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

struct _BoxesUIIface {
	GTypeInterface parent_iface;
	BoxesUIState (*get_previous_ui_state) (BoxesUI* self);
	void (*set_previous_ui_state) (BoxesUI* self, BoxesUIState value);
	BoxesUIState (*get_ui_state) (BoxesUI* self);
	void (*set_ui_state) (BoxesUI* self, BoxesUIState value);
};

struct _BoxesAppWindow {
	GtkApplicationWindow parent_instance;
	BoxesAppWindowPrivate * priv;
	BoxesWizardWindow* wizard_window;
	BoxesPropertiesWindow* props_window;
	BoxesSearchbar* searchbar;
	BoxesTopbar* topbar;
	BoxesSelectionbar* selectionbar;
	BoxesDisplayPage* display_page;
	BoxesEmptyBoxes* empty_boxes;
	GtkStack* below_bin;
	GSettings* settings;
};

struct _BoxesAppWindowClass {
	GtkApplicationWindowClass parent_class;
};

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

struct _BoxesCollectionClass {
	GObjectClass parent_class;
};


static gpointer boxes_selection_toolbar_parent_class = NULL;
extern BoxesApp* boxes_app_app;

GType boxes_selection_toolbar_get_type (void) G_GNUC_CONST;
GType boxes_app_window_get_type (void) G_GNUC_CONST;
#define BOXES_SELECTION_TOOLBAR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_SELECTION_TOOLBAR, BoxesSelectionToolbarPrivate))
static void boxes_selection_toolbar_on_cancel_btn_clicked (BoxesSelectionToolbar* self);
void boxes_app_window_set_selection_mode (BoxesAppWindow* self, gboolean value);
static void _boxes_selection_toolbar_on_cancel_btn_clicked_gtk_button_clicked (GtkButton* _sender, gpointer self);
void boxes_selection_toolbar_setup_ui (BoxesSelectionToolbar* self, BoxesAppWindow* window);
static void boxes_selection_toolbar_update_selection_label (BoxesSelectionToolbar* self);
static void boxes_selection_toolbar_update_search_btn (BoxesSelectionToolbar* self);
GType boxes_app_get_type (void) G_GNUC_CONST;
GType boxes_collection_get_type (void) G_GNUC_CONST;
GType boxes_collection_item_get_type (void) G_GNUC_CONST;
static void _boxes_selection_toolbar_update_search_btn_boxes_collection_item_added (BoxesCollection* _sender, BoxesCollectionItem* item, gpointer self);
static void _boxes_selection_toolbar_update_search_btn_boxes_collection_item_removed (BoxesCollection* _sender, BoxesCollectionItem* item, gpointer self);
GType boxes_ui_state_get_type (void) G_GNUC_CONST;
GType boxes_ui_get_type (void) G_GNUC_CONST;
GType boxes_wizard_window_get_type (void) G_GNUC_CONST;
GType boxes_properties_window_get_type (void) G_GNUC_CONST;
GType boxes_searchbar_get_type (void) G_GNUC_CONST;
GType boxes_topbar_get_type (void) G_GNUC_CONST;
GType boxes_selectionbar_get_type (void) G_GNUC_CONST;
GType boxes_display_page_get_type (void) G_GNUC_CONST;
GType boxes_empty_boxes_get_type (void) G_GNUC_CONST;
GList* boxes_app_get_selected_items (BoxesApp* self);
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
BoxesSelectionToolbar* boxes_selection_toolbar_new (void);
BoxesSelectionToolbar* boxes_selection_toolbar_construct (GType object_type);
static GObject * boxes_selection_toolbar_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void _boxes_selection_toolbar___lambda182_ (BoxesSelectionToolbar* self);
static void __boxes_selection_toolbar___lambda182__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void boxes_selection_toolbar_finalize (GObject * obj);


static void boxes_selection_toolbar_on_cancel_btn_clicked (BoxesSelectionToolbar* self) {
	BoxesAppWindow* _tmp0_;
#line 16 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	g_return_if_fail (self != NULL);
#line 17 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_tmp0_ = self->priv->window;
#line 17 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	boxes_app_window_set_selection_mode (_tmp0_, FALSE);
#line 277 "selection-toolbar.c"
}


static void _boxes_selection_toolbar_on_cancel_btn_clicked_gtk_button_clicked (GtkButton* _sender, gpointer self) {
#line 5 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	boxes_selection_toolbar_on_cancel_btn_clicked ((BoxesSelectionToolbar*) self);
#line 284 "selection-toolbar.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 30 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	return self ? g_object_ref (self) : NULL;
#line 291 "selection-toolbar.c"
}


static void _boxes_selection_toolbar_update_search_btn_boxes_collection_item_added (BoxesCollection* _sender, BoxesCollectionItem* item, gpointer self) {
#line 35 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	boxes_selection_toolbar_update_search_btn ((BoxesSelectionToolbar*) self);
#line 298 "selection-toolbar.c"
}


static void _boxes_selection_toolbar_update_search_btn_boxes_collection_item_removed (BoxesCollection* _sender, BoxesCollectionItem* item, gpointer self) {
#line 36 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	boxes_selection_toolbar_update_search_btn ((BoxesSelectionToolbar*) self);
#line 305 "selection-toolbar.c"
}


void boxes_selection_toolbar_setup_ui (BoxesSelectionToolbar* self, BoxesAppWindow* window) {
	BoxesAppWindow* _tmp0_;
	BoxesAppWindow* _tmp1_;
	BoxesApp* _tmp2_;
	BoxesCollection* _tmp3_;
	BoxesApp* _tmp4_;
	BoxesCollection* _tmp5_;
	GtkButton* _tmp6_;
	BoxesAppWindow* _tmp7_;
	BoxesSearchbar* _tmp8_;
#line 29 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	g_return_if_fail (self != NULL);
#line 29 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	g_return_if_fail (window != NULL);
#line 30 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_tmp0_ = window;
#line 30 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 30 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_g_object_unref0 (self->priv->window);
#line 30 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	self->priv->window = _tmp1_;
#line 32 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	boxes_selection_toolbar_update_selection_label (self);
#line 34 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	boxes_selection_toolbar_update_search_btn (self);
#line 35 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_tmp2_ = boxes_app_app;
#line 35 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_tmp3_ = _tmp2_->collection;
#line 35 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	g_signal_connect_object (_tmp3_, "item-added", (GCallback) _boxes_selection_toolbar_update_search_btn_boxes_collection_item_added, self, 0);
#line 36 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_tmp4_ = boxes_app_app;
#line 36 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_tmp5_ = _tmp4_->collection;
#line 36 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	g_signal_connect_object (_tmp5_, "item-removed", (GCallback) _boxes_selection_toolbar_update_search_btn_boxes_collection_item_removed, self, 0);
#line 38 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_tmp6_ = self->priv->search_btn;
#line 38 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_tmp7_ = window;
#line 38 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_tmp8_ = _tmp7_->searchbar;
#line 38 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	g_object_bind_property_with_closures ((GObject*) _tmp6_, "active", (GObject*) _tmp8_, "search-mode-enabled", G_BINDING_BIDIRECTIONAL, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
#line 355 "selection-toolbar.c"
}


static void _g_object_unref0_ (gpointer var) {
#line 42 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
#line 362 "selection-toolbar.c"
}


static inline void _g_list_free__g_object_unref0_ (GList* self) {
#line 42 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	g_list_free_full (self, (GDestroyNotify) _g_object_unref0_);
#line 369 "selection-toolbar.c"
}


static void boxes_selection_toolbar_update_selection_label (BoxesSelectionToolbar* self) {
	guint items = 0U;
	BoxesApp* _tmp0_;
	GList* _tmp1_;
	GList* _tmp2_;
	GList* _tmp3_;
	guint _tmp4_;
	guint _tmp5_;
	guint _tmp6_;
#line 41 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	g_return_if_fail (self != NULL);
#line 42 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_tmp0_ = boxes_app_app;
#line 42 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_tmp1_ = boxes_app_get_selected_items (_tmp0_);
#line 42 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_tmp2_ = _tmp1_;
#line 42 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_tmp3_ = _tmp2_;
#line 42 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_tmp4_ = g_list_length (_tmp3_);
#line 42 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_tmp5_ = _tmp4_;
#line 42 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	__g_list_free__g_object_unref0_0 (_tmp3_);
#line 42 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	items = _tmp5_;
#line 43 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_tmp6_ = items;
#line 43 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	if (_tmp6_ > ((guint) 0)) {
#line 404 "selection-toolbar.c"
		GtkLabel* _tmp7_;
		guint _tmp8_;
		guint _tmp9_;
		gchar* _tmp10_;
		gchar* _tmp11_;
#line 46 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
		_tmp7_ = self->priv->menu_button_label;
#line 46 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
		_tmp8_ = items;
#line 46 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
		_tmp9_ = items;
#line 46 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
		_tmp10_ = g_strdup_printf (ngettext ("%u selected", "%u selected", (gulong) _tmp8_), _tmp9_);
#line 46 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
		_tmp11_ = _tmp10_;
#line 46 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
		gtk_label_set_label (_tmp7_, _tmp11_);
#line 46 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
		_g_free0 (_tmp11_);
#line 424 "selection-toolbar.c"
	} else {
		GtkLabel* _tmp12_;
#line 48 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
		_tmp12_ = self->priv->menu_button_label;
#line 48 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
		gtk_label_set_label (_tmp12_, _ ("(Click on items to select them)"));
#line 431 "selection-toolbar.c"
	}
}


static gint g_ptr_array_get_length (GPtrArray* self) {
	gint result;
	guint _tmp0_;
#line 4981 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, 0);
#line 4981 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp0_ = self->len;
#line 4981 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	result = (gint) _tmp0_;
#line 4981 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	return result;
#line 447 "selection-toolbar.c"
}


static void g_ptr_array_set_length (GPtrArray* self, gint value) {
	gint _tmp0_;
#line 4982 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	g_return_if_fail (self != NULL);
#line 4982 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp0_ = value;
#line 4982 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	g_ptr_array_set_size (self, _tmp0_);
#line 459 "selection-toolbar.c"
}


static void boxes_selection_toolbar_update_search_btn (BoxesSelectionToolbar* self) {
	GtkButton* _tmp0_;
	BoxesApp* _tmp1_;
	BoxesCollection* _tmp2_;
	GPtrArray* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
#line 52 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	g_return_if_fail (self != NULL);
#line 53 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_tmp0_ = self->priv->search_btn;
#line 53 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_tmp1_ = boxes_app_app;
#line 53 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_tmp2_ = _tmp1_->collection;
#line 53 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_tmp3_ = _tmp2_->items;
#line 53 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_tmp4_ = g_ptr_array_get_length (_tmp3_);
#line 53 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_tmp5_ = _tmp4_;
#line 53 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	gtk_widget_set_sensitive ((GtkWidget*) _tmp0_, _tmp5_ != 0);
#line 486 "selection-toolbar.c"
}


BoxesSelectionToolbar* boxes_selection_toolbar_construct (GType object_type) {
	BoxesSelectionToolbar * self = NULL;
#line 5 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	self = (BoxesSelectionToolbar*) g_object_new (object_type, NULL);
#line 5 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	return self;
#line 496 "selection-toolbar.c"
}


BoxesSelectionToolbar* boxes_selection_toolbar_new (void) {
#line 5 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	return boxes_selection_toolbar_construct (BOXES_TYPE_SELECTION_TOOLBAR);
#line 503 "selection-toolbar.c"
}


static void _boxes_selection_toolbar___lambda182_ (BoxesSelectionToolbar* self) {
#line 25 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	boxes_selection_toolbar_update_selection_label (self);
#line 510 "selection-toolbar.c"
}


static void __boxes_selection_toolbar___lambda182__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
#line 24 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_boxes_selection_toolbar___lambda182_ ((BoxesSelectionToolbar*) self);
#line 517 "selection-toolbar.c"
}


static GObject * boxes_selection_toolbar_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	BoxesSelectionToolbar * self;
	GtkMenuButton* _tmp0_;
	BoxesApp* _tmp1_;
#line 20 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	parent_class = G_OBJECT_CLASS (boxes_selection_toolbar_parent_class);
#line 20 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
#line 20 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_SELECTION_TOOLBAR, BoxesSelectionToolbar);
#line 22 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_tmp0_ = self->priv->menu_button;
#line 22 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	gtk_header_bar_set_custom_title ((GtkHeaderBar*) self, (GtkWidget*) _tmp0_);
#line 24 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_tmp1_ = boxes_app_app;
#line 24 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	g_signal_connect_object ((GObject*) _tmp1_, "notify::selected-items", (GCallback) __boxes_selection_toolbar___lambda182__g_object_notify, self, 0);
#line 20 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	return obj;
#line 543 "selection-toolbar.c"
}


static void boxes_selection_toolbar_class_init (BoxesSelectionToolbarClass * klass) {
	gint BoxesSelectionToolbar_private_offset;
#line 5 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	boxes_selection_toolbar_parent_class = g_type_class_peek_parent (klass);
#line 5 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	g_type_class_add_private (klass, sizeof (BoxesSelectionToolbarPrivate));
#line 5 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	G_OBJECT_CLASS (klass)->constructor = boxes_selection_toolbar_constructor;
#line 5 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	G_OBJECT_CLASS (klass)->finalize = boxes_selection_toolbar_finalize;
#line 5 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	BoxesSelectionToolbar_private_offset = g_type_class_get_instance_private_offset (klass);
#line 5 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Boxes/ui/selection-toolbar.ui");
#line 5 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "search_btn", FALSE, BoxesSelectionToolbar_private_offset + G_STRUCT_OFFSET (BoxesSelectionToolbarPrivate, search_btn));
#line 5 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "menu_button", FALSE, BoxesSelectionToolbar_private_offset + G_STRUCT_OFFSET (BoxesSelectionToolbarPrivate, menu_button));
#line 5 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "menu_button_label", FALSE, BoxesSelectionToolbar_private_offset + G_STRUCT_OFFSET (BoxesSelectionToolbarPrivate, menu_button_label));
#line 5 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_cancel_btn_clicked", G_CALLBACK(_boxes_selection_toolbar_on_cancel_btn_clicked_gtk_button_clicked));
#line 569 "selection-toolbar.c"
}


static void boxes_selection_toolbar_instance_init (BoxesSelectionToolbar * self) {
#line 5 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	self->priv = BOXES_SELECTION_TOOLBAR_GET_PRIVATE (self);
#line 5 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	gtk_widget_init_template (GTK_WIDGET (self));
#line 578 "selection-toolbar.c"
}


static void boxes_selection_toolbar_finalize (GObject * obj) {
	BoxesSelectionToolbar * self;
#line 5 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_SELECTION_TOOLBAR, BoxesSelectionToolbar);
#line 7 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_g_object_unref0 (self->priv->search_btn);
#line 9 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_g_object_unref0 (self->priv->menu_button);
#line 11 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_g_object_unref0 (self->priv->menu_button_label);
#line 13 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	_g_object_unref0 (self->priv->window);
#line 5 "/home/fborges/checkout/gnome-boxes/src/selection-toolbar.vala"
	G_OBJECT_CLASS (boxes_selection_toolbar_parent_class)->finalize (obj);
#line 596 "selection-toolbar.c"
}


GType boxes_selection_toolbar_get_type (void) {
	static volatile gsize boxes_selection_toolbar_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_selection_toolbar_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BoxesSelectionToolbarClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_selection_toolbar_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesSelectionToolbar), 0, (GInstanceInitFunc) boxes_selection_toolbar_instance_init, NULL };
		GType boxes_selection_toolbar_type_id;
		boxes_selection_toolbar_type_id = g_type_register_static (gtk_header_bar_get_type (), "BoxesSelectionToolbar", &g_define_type_info, 0);
		g_once_init_leave (&boxes_selection_toolbar_type_id__volatile, boxes_selection_toolbar_type_id);
	}
	return boxes_selection_toolbar_type_id__volatile;
}



