/* collection-toolbar.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from collection-toolbar.vala, do not modify */

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

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

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define BOXES_TYPE_COLLECTION_TOOLBAR (boxes_collection_toolbar_get_type ())
#define BOXES_COLLECTION_TOOLBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_COLLECTION_TOOLBAR, BoxesCollectionToolbar))
#define BOXES_COLLECTION_TOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_COLLECTION_TOOLBAR, BoxesCollectionToolbarClass))
#define BOXES_IS_COLLECTION_TOOLBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_COLLECTION_TOOLBAR))
#define BOXES_IS_COLLECTION_TOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_COLLECTION_TOOLBAR))
#define BOXES_COLLECTION_TOOLBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_COLLECTION_TOOLBAR, BoxesCollectionToolbarClass))

typedef struct _BoxesCollectionToolbar BoxesCollectionToolbar;
typedef struct _BoxesCollectionToolbarClass BoxesCollectionToolbarClass;
typedef struct _BoxesCollectionToolbarPrivate BoxesCollectionToolbarPrivate;

#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_COLLECTION_TOOLBAR_0_PROPERTY,
	BOXES_COLLECTION_TOOLBAR_NUM_PROPERTIES
};
static GParamSpec* boxes_collection_toolbar_properties[BOXES_COLLECTION_TOOLBAR_NUM_PROPERTIES];
typedef void (*GSimpleActionActivateCallback) (GSimpleAction* action, GVariant* parameter, gpointer user_data);
#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_SHARED_FOLDERS_MANAGER (boxes_shared_folders_manager_get_type ())
#define BOXES_SHARED_FOLDERS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_SHARED_FOLDERS_MANAGER, BoxesSharedFoldersManager))
#define BOXES_SHARED_FOLDERS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_SHARED_FOLDERS_MANAGER, BoxesSharedFoldersManagerClass))
#define BOXES_IS_SHARED_FOLDERS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_SHARED_FOLDERS_MANAGER))
#define BOXES_IS_SHARED_FOLDERS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_SHARED_FOLDERS_MANAGER))
#define BOXES_SHARED_FOLDERS_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_SHARED_FOLDERS_MANAGER, BoxesSharedFoldersManagerClass))

typedef struct _BoxesSharedFoldersManager BoxesSharedFoldersManager;
typedef struct _BoxesSharedFoldersManagerClass BoxesSharedFoldersManagerClass;

#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;
typedef enum  {
	BOXES_APP_WINDOW_VIEW_TYPE_ICON = 1,
	BOXES_APP_WINDOW_VIEW_TYPE_LIST = 2
} BoxesAppWindowViewType;

#define BOXES_APP_WINDOW_TYPE_VIEW_TYPE (boxes_app_window_view_type_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_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;
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,
	BOXES_UI_STATE_TROUBLESHOOT
} BoxesUIState;

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

#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_TOAST_OVERLAY (boxes_toast_overlay_get_type ())
#define BOXES_TOAST_OVERLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_TOAST_OVERLAY, BoxesToastOverlay))
#define BOXES_TOAST_OVERLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_TOAST_OVERLAY, BoxesToastOverlayClass))
#define BOXES_IS_TOAST_OVERLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_TOAST_OVERLAY))
#define BOXES_IS_TOAST_OVERLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_TOAST_OVERLAY))
#define BOXES_TOAST_OVERLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_TOAST_OVERLAY, BoxesToastOverlayClass))

typedef struct _BoxesToastOverlay BoxesToastOverlay;
typedef struct _BoxesToastOverlayClass BoxesToastOverlayClass;

#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_TROUBLESHOOT_VIEW (boxes_troubleshoot_view_get_type ())
#define BOXES_TROUBLESHOOT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_TROUBLESHOOT_VIEW, BoxesTroubleshootView))
#define BOXES_TROUBLESHOOT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_TROUBLESHOOT_VIEW, BoxesTroubleshootViewClass))
#define BOXES_IS_TROUBLESHOOT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_TROUBLESHOOT_VIEW))
#define BOXES_IS_TROUBLESHOOT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_TROUBLESHOOT_VIEW))
#define BOXES_TROUBLESHOOT_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_TROUBLESHOOT_VIEW, BoxesTroubleshootViewClass))

typedef struct _BoxesTroubleshootView BoxesTroubleshootView;
typedef struct _BoxesTroubleshootViewClass BoxesTroubleshootViewClass;

#define BOXES_TYPE_DOWNLOADS_HUB (boxes_downloads_hub_get_type ())
#define BOXES_DOWNLOADS_HUB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_DOWNLOADS_HUB, BoxesDownloadsHub))
#define BOXES_DOWNLOADS_HUB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_DOWNLOADS_HUB, BoxesDownloadsHubClass))
#define BOXES_IS_DOWNLOADS_HUB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_DOWNLOADS_HUB))
#define BOXES_IS_DOWNLOADS_HUB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_DOWNLOADS_HUB))
#define BOXES_DOWNLOADS_HUB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_DOWNLOADS_HUB, BoxesDownloadsHubClass))

typedef struct _BoxesDownloadsHub BoxesDownloadsHub;
typedef struct _BoxesDownloadsHubClass BoxesDownloadsHubClass;

#define BOXES_TYPE_MEDIA_MANAGER (boxes_media_manager_get_type ())
#define BOXES_MEDIA_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_MEDIA_MANAGER, BoxesMediaManager))
#define BOXES_MEDIA_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_MEDIA_MANAGER, BoxesMediaManagerClass))
#define BOXES_IS_MEDIA_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_MEDIA_MANAGER))
#define BOXES_IS_MEDIA_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_MEDIA_MANAGER))
#define BOXES_MEDIA_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_MEDIA_MANAGER, BoxesMediaManagerClass))

typedef struct _BoxesMediaManager BoxesMediaManager;
typedef struct _BoxesMediaManagerClass BoxesMediaManagerClass;

#define BOXES_TYPE_ASSISTANT (boxes_assistant_get_type ())
#define BOXES_ASSISTANT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_ASSISTANT, BoxesAssistant))
#define BOXES_ASSISTANT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_ASSISTANT, BoxesAssistantClass))
#define BOXES_IS_ASSISTANT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_ASSISTANT))
#define BOXES_IS_ASSISTANT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_ASSISTANT))
#define BOXES_ASSISTANT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_ASSISTANT, BoxesAssistantClass))

typedef struct _BoxesAssistant BoxesAssistant;
typedef struct _BoxesAssistantClass BoxesAssistantClass;
#define _g_free0(var) (var = (g_free (var), NULL))

#define BOXES_TYPE_OS_DOWNLOADER (boxes_os_downloader_get_type ())
#define BOXES_OS_DOWNLOADER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_OS_DOWNLOADER, BoxesOsDownloader))
#define BOXES_OS_DOWNLOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_OS_DOWNLOADER, BoxesOsDownloaderClass))
#define BOXES_IS_OS_DOWNLOADER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_OS_DOWNLOADER))
#define BOXES_IS_OS_DOWNLOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_OS_DOWNLOADER))
#define BOXES_OS_DOWNLOADER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_OS_DOWNLOADER, BoxesOsDownloaderClass))

typedef struct _BoxesOsDownloader BoxesOsDownloader;
typedef struct _BoxesOsDownloaderClass BoxesOsDownloaderClass;

struct _BoxesCollectionToolbar {
	HdyHeaderBar parent_instance;
	BoxesCollectionToolbarPrivate * priv;
	GtkMenuButton* hamburger_btn;
};

struct _BoxesCollectionToolbarClass {
	HdyHeaderBarClass parent_class;
};

struct _BoxesCollectionToolbarPrivate {
	GtkButton* search_btn;
	GtkButton* list_btn;
	GtkButton* grid_btn;
	GtkButton* back_btn;
	GtkButton* new_btn;
	GtkPopover* new_vm_popover;
	GtkMenuButton* downloads_hub_btn;
	BoxesAppWindow* window;
};

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

struct _BoxesAppClass {
	GtkApplicationClass parent_class;
};

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 {
	HdyApplicationWindow parent_instance;
	BoxesAppWindowPrivate * priv;
	BoxesSearchbar* searchbar;
	BoxesTopbar* topbar;
	BoxesToastOverlay* toast_overlay;
	BoxesDisplayPage* display_page;
	HdyStatusPage* empty_boxes;
	BoxesTroubleshootView* troubleshoot_view;
	GtkStack* below_bin;
	GSettings* settings;
};

struct _BoxesAppWindowClass {
	HdyApplicationWindowClass parent_class;
};

static gint BoxesCollectionToolbar_private_offset;
static gpointer boxes_collection_toolbar_parent_class = NULL;
VALA_EXTERN BoxesApp* boxes_app_app;

VALA_EXTERN GType boxes_collection_toolbar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesCollectionToolbar, g_object_unref)
VALA_EXTERN GType boxes_app_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesAppWindow, g_object_unref)
static void boxes_collection_toolbar_open_filechooser (BoxesCollectionToolbar* self);
static void _boxes_collection_toolbar_open_filechooser_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                  GVariant* parameter,
                                                                                  gpointer self);
static void boxes_collection_toolbar_open_downloads_dialog (BoxesCollectionToolbar* self);
static void _boxes_collection_toolbar_open_downloads_dialog_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                       GVariant* parameter,
                                                                                       gpointer self);
VALA_EXTERN void boxes_collection_toolbar_setup_ui (BoxesCollectionToolbar* self,
                                        BoxesAppWindow* window);
static void boxes_collection_toolbar_update_search_btn (BoxesCollectionToolbar* self);
VALA_EXTERN GType boxes_app_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesApp, g_object_unref)
VALA_EXTERN GType boxes_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesCollection, g_object_unref)
VALA_EXTERN GType boxes_shared_folders_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesSharedFoldersManager, g_object_unref)
VALA_EXTERN GType boxes_collection_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesCollectionItem, g_object_unref)
static void _boxes_collection_toolbar_update_search_btn_boxes_collection_item_added (BoxesCollection* _sender,
                                                                              BoxesCollectionItem* item,
                                                                              gpointer self);
static void _boxes_collection_toolbar_update_search_btn_boxes_collection_item_removed (BoxesCollection* _sender,
                                                                                BoxesCollectionItem* item,
                                                                                gpointer self);
VALA_EXTERN GType boxes_app_window_view_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType boxes_ui_state_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType boxes_ui_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesUI, g_object_unref)
VALA_EXTERN GType boxes_searchbar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesSearchbar, g_object_unref)
VALA_EXTERN GType boxes_topbar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesTopbar, g_object_unref)
VALA_EXTERN GType boxes_toast_overlay_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesToastOverlay, g_object_unref)
VALA_EXTERN GType boxes_display_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesDisplayPage, g_object_unref)
VALA_EXTERN GType boxes_troubleshoot_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesTroubleshootView, g_object_unref)
static void boxes_collection_toolbar_update_view_type (BoxesCollectionToolbar* self,
                                                BoxesAppWindowViewType view_type);
static void boxes_collection_toolbar_ui_state_changed (BoxesCollectionToolbar* self);
static void _boxes_collection_toolbar_ui_state_changed_g_object_notify (GObject* _sender,
                                                                 GParamSpec* pspec,
                                                                 gpointer self);
VALA_EXTERN GType boxes_downloads_hub_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesDownloadsHub, g_object_unref)
VALA_EXTERN BoxesDownloadsHub* boxes_downloads_hub_get_default (void);
VALA_EXTERN GType boxes_media_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesMediaManager, g_object_unref)
VALA_EXTERN BoxesMediaManager* boxes_media_manager_get_default (void);
VALA_EXTERN GtkFileFilter* boxes_media_manager_get_content_types_filter (BoxesMediaManager* self);
VALA_EXTERN BoxesAssistant* boxes_assistant_new (BoxesAppWindow* app_window,
                                     const gchar* path);
VALA_EXTERN BoxesAssistant* boxes_assistant_construct (GType object_type,
                                           BoxesAppWindow* app_window,
                                           const gchar* path);
VALA_EXTERN GType boxes_assistant_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesAssistant, g_object_unref)
static void _boxes_collection_toolbar_open_filechooser_hdy_action_row_activated (HdyActionRow* _sender,
                                                                          gpointer self);
VALA_EXTERN BoxesOsDownloader* boxes_os_downloader_new (BoxesAppWindow* window);
VALA_EXTERN BoxesOsDownloader* boxes_os_downloader_construct (GType object_type,
                                                  BoxesAppWindow* window);
VALA_EXTERN GType boxes_os_downloader_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesOsDownloader, g_object_unref)
static void _boxes_collection_toolbar_open_downloads_dialog_hdy_action_row_activated (HdyActionRow* _sender,
                                                                               gpointer self);
VALA_EXTERN void boxes_collection_toolbar_click_back_button (BoxesCollectionToolbar* self);
VALA_EXTERN void boxes_collection_toolbar_click_search_button (BoxesCollectionToolbar* self);
static void boxes_collection_toolbar_on_back_btn_clicked (BoxesCollectionToolbar* self);
VALA_EXTERN void boxes_ui_set_state (BoxesUI* self,
                         BoxesUIState new_state);
static void _boxes_collection_toolbar_on_back_btn_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                       gpointer self);
static void boxes_collection_toolbar_on_list_btn_clicked (BoxesCollectionToolbar* self);
static void _boxes_collection_toolbar_on_list_btn_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                       gpointer self);
static void boxes_collection_toolbar_on_grid_btn_clicked (BoxesCollectionToolbar* self);
static void _boxes_collection_toolbar_on_grid_btn_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                       gpointer self);
VALA_EXTERN guint boxes_collection_get_length (BoxesCollection* self);
VALA_EXTERN void boxes_app_window_set_view_type (BoxesAppWindow* self,
                                     BoxesAppWindowViewType value);
VALA_EXTERN BoxesUIState boxes_ui_get_ui_state (BoxesUI* self);
VALA_EXTERN BoxesAppWindowViewType boxes_app_window_get_view_type (BoxesAppWindow* self);
VALA_EXTERN BoxesAppWindow* boxes_app_get_main_window (BoxesApp* self);
VALA_EXTERN BoxesCollectionToolbar* boxes_collection_toolbar_new (void);
VALA_EXTERN BoxesCollectionToolbar* boxes_collection_toolbar_construct (GType object_type);
static void boxes_collection_toolbar_finalize (GObject * obj);
static GType boxes_collection_toolbar_get_type_once (void);

static const GActionEntry BOXES_COLLECTION_TOOLBAR_action_entries[2] = {{"open-filechooser", _boxes_collection_toolbar_open_filechooser_gsimple_action_activate_callback}, {"open-downloads-dialog", _boxes_collection_toolbar_open_downloads_dialog_gsimple_action_activate_callback}};

static inline gpointer
boxes_collection_toolbar_get_instance_private (BoxesCollectionToolbar* self)
{
	return G_STRUCT_MEMBER_P (self, BoxesCollectionToolbar_private_offset);
}

static void
_boxes_collection_toolbar_open_filechooser_gsimple_action_activate_callback (GSimpleAction* action,
                                                                             GVariant* parameter,
                                                                             gpointer self)
{
	boxes_collection_toolbar_open_filechooser ((BoxesCollectionToolbar*) self);
}

static void
_boxes_collection_toolbar_open_downloads_dialog_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                  GVariant* parameter,
                                                                                  gpointer self)
{
	boxes_collection_toolbar_open_downloads_dialog ((BoxesCollectionToolbar*) self);
}

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

static void
_boxes_collection_toolbar_update_search_btn_boxes_collection_item_added (BoxesCollection* _sender,
                                                                         BoxesCollectionItem* item,
                                                                         gpointer self)
{
	boxes_collection_toolbar_update_search_btn ((BoxesCollectionToolbar*) self);
}

static void
_boxes_collection_toolbar_update_search_btn_boxes_collection_item_removed (BoxesCollection* _sender,
                                                                           BoxesCollectionItem* item,
                                                                           gpointer self)
{
	boxes_collection_toolbar_update_search_btn ((BoxesCollectionToolbar*) self);
}

static void
_boxes_collection_toolbar_ui_state_changed_g_object_notify (GObject* _sender,
                                                            GParamSpec* pspec,
                                                            gpointer self)
{
	boxes_collection_toolbar_ui_state_changed ((BoxesCollectionToolbar*) self);
}

void
boxes_collection_toolbar_setup_ui (BoxesCollectionToolbar* self,
                                   BoxesAppWindow* window)
{
	BoxesAppWindow* _tmp0_;
	BoxesApp* _tmp1_;
	BoxesCollection* _tmp2_;
	BoxesApp* _tmp3_;
	BoxesCollection* _tmp4_;
	BoxesAppWindowViewType view_type = 0;
	GSettings* _tmp5_;
	GtkButton* _tmp6_;
	BoxesSearchbar* _tmp7_;
	BoxesApp* _tmp8_;
	GtkBuilder* builder = NULL;
	GtkBuilder* _tmp9_;
	GMenuModel* menu = NULL;
	GObject* _tmp10_;
	GMenuModel* _tmp11_;
	GtkMenuButton* _tmp12_;
	GtkMenuButton* _tmp13_;
	GtkPopover* _tmp14_;
	GtkPopover* _tmp15_;
	GtkMenuButton* _tmp16_;
	BoxesDownloadsHub* _tmp17_;
	BoxesDownloadsHub* _tmp18_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (window != NULL);
	_tmp0_ = _g_object_ref0 (window);
	_g_object_unref0 (self->priv->window);
	self->priv->window = _tmp0_;
	boxes_collection_toolbar_update_search_btn (self);
	_tmp1_ = boxes_app_app;
	_tmp2_ = _tmp1_->collection;
	g_signal_connect_object (_tmp2_, "item-added", (GCallback) _boxes_collection_toolbar_update_search_btn_boxes_collection_item_added, self, 0);
	_tmp3_ = boxes_app_app;
	_tmp4_ = _tmp3_->collection;
	g_signal_connect_object (_tmp4_, "item-removed", (GCallback) _boxes_collection_toolbar_update_search_btn_boxes_collection_item_removed, self, 0);
	_tmp5_ = window->settings;
	view_type = (BoxesAppWindowViewType) g_settings_get_enum (_tmp5_, "view");
	boxes_collection_toolbar_update_view_type (self, view_type);
	_tmp6_ = self->priv->search_btn;
	_tmp7_ = window->searchbar;
	g_object_bind_property_with_closures ((GObject*) _tmp6_, "active", (GObject*) _tmp7_, "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)));
	g_signal_connect_object ((GObject*) window, "notify::ui-state", (GCallback) _boxes_collection_toolbar_ui_state_changed_g_object_notify, self, 0);
	_tmp8_ = boxes_app_app;
	g_signal_connect_object ((GObject*) _tmp8_, "notify::main-window", (GCallback) _boxes_collection_toolbar_ui_state_changed_g_object_notify, self, 0);
	_tmp9_ = gtk_builder_new_from_resource ("/org/gnome/Boxes/ui/menus.ui");
	builder = _tmp9_;
	_tmp10_ = gtk_builder_get_object (builder, "app-menu");
	_tmp11_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, g_menu_model_get_type (), GMenuModel));
	menu = _tmp11_;
	_tmp12_ = self->hamburger_btn;
	_tmp13_ = self->hamburger_btn;
	_tmp14_ = (GtkPopover*) gtk_popover_new_from_model ((GtkWidget*) _tmp13_, menu);
	g_object_ref_sink (_tmp14_);
	_tmp15_ = _tmp14_;
	gtk_menu_button_set_popover (_tmp12_, _tmp15_);
	_g_object_unref0 (_tmp15_);
	_tmp16_ = self->priv->downloads_hub_btn;
	_tmp17_ = boxes_downloads_hub_get_default ();
	_tmp18_ = _tmp17_;
	gtk_menu_button_set_popover (_tmp16_, (GtkPopover*) _tmp18_);
	_g_object_unref0 (_tmp18_);
	_g_object_unref0 (menu);
	_g_object_unref0 (builder);
}

static void
boxes_collection_toolbar_open_filechooser (BoxesCollectionToolbar* self)
{
	GtkFileChooserNative* file_chooser = NULL;
	BoxesAppWindow* _tmp0_;
	GtkFileChooserNative* _tmp1_;
	GtkFileChooserNative* _tmp2_;
	BoxesMediaManager* _tmp3_;
	BoxesMediaManager* _tmp4_;
	GtkFileFilter* _tmp5_;
	GtkFileFilter* _tmp6_;
	GtkFileChooserNative* _tmp7_;
	GtkPopover* _tmp14_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->window;
	_tmp1_ = gtk_file_chooser_native_new (_ ("Select a device or OS media file"), (GtkWindow*) _tmp0_, GTK_FILE_CHOOSER_ACTION_OPEN, _ ("Open"), _ ("Cancel"));
	file_chooser = _tmp1_;
	_tmp2_ = file_chooser;
	_tmp3_ = boxes_media_manager_get_default ();
	_tmp4_ = _tmp3_;
	_tmp5_ = boxes_media_manager_get_content_types_filter (_tmp4_);
	_tmp6_ = _tmp5_;
	gtk_file_chooser_set_filter ((GtkFileChooser*) _tmp2_, _tmp6_);
	_g_object_unref0 (_tmp4_);
	_tmp7_ = file_chooser;
	if (gtk_native_dialog_run ((GtkNativeDialog*) _tmp7_) == ((gint) GTK_RESPONSE_ACCEPT)) {
		BoxesAppWindow* _tmp8_;
		GtkFileChooserNative* _tmp9_;
		gchar* _tmp10_;
		gchar* _tmp11_;
		BoxesAssistant* _tmp12_;
		BoxesAssistant* _tmp13_;
		_tmp8_ = self->priv->window;
		_tmp9_ = file_chooser;
		_tmp10_ = gtk_file_chooser_get_filename ((GtkFileChooser*) _tmp9_);
		_tmp11_ = _tmp10_;
		_tmp12_ = boxes_assistant_new (_tmp8_, _tmp11_);
		g_object_ref_sink (_tmp12_);
		_tmp13_ = _tmp12_;
		gtk_window_present ((GtkWindow*) _tmp13_);
		_g_object_unref0 (_tmp13_);
		_g_free0 (_tmp11_);
	}
	_tmp14_ = self->priv->new_vm_popover;
	gtk_popover_popdown (_tmp14_);
	_g_object_unref0 (file_chooser);
}

static void
_boxes_collection_toolbar_open_filechooser_hdy_action_row_activated (HdyActionRow* _sender,
                                                                     gpointer self)
{
	boxes_collection_toolbar_open_filechooser ((BoxesCollectionToolbar*) self);
}

static void
boxes_collection_toolbar_open_downloads_dialog (BoxesCollectionToolbar* self)
{
	BoxesAppWindow* _tmp0_;
	BoxesOsDownloader* _tmp1_;
	BoxesOsDownloader* _tmp2_;
	GtkPopover* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->window;
	_tmp1_ = boxes_os_downloader_new (_tmp0_);
	g_object_ref_sink (_tmp1_);
	_tmp2_ = _tmp1_;
	gtk_window_present ((GtkWindow*) _tmp2_);
	_g_object_unref0 (_tmp2_);
	_tmp3_ = self->priv->new_vm_popover;
	gtk_popover_popdown (_tmp3_);
}

static void
_boxes_collection_toolbar_open_downloads_dialog_hdy_action_row_activated (HdyActionRow* _sender,
                                                                          gpointer self)
{
	boxes_collection_toolbar_open_downloads_dialog ((BoxesCollectionToolbar*) self);
}

void
boxes_collection_toolbar_click_back_button (BoxesCollectionToolbar* self)
{
	GtkButton* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->back_btn;
	gtk_button_clicked (_tmp0_);
}

void
boxes_collection_toolbar_click_search_button (BoxesCollectionToolbar* self)
{
	GtkButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->search_btn;
	_tmp1_ = gtk_widget_get_sensitive ((GtkWidget*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		GtkButton* _tmp3_;
		_tmp3_ = self->priv->search_btn;
		gtk_button_clicked (_tmp3_);
	}
}

static void
boxes_collection_toolbar_on_back_btn_clicked (BoxesCollectionToolbar* self)
{
	BoxesAppWindow* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->window;
	boxes_ui_set_state ((BoxesUI*) _tmp0_, BOXES_UI_STATE_COLLECTION);
}

static void
_boxes_collection_toolbar_on_back_btn_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                  gpointer self)
{
	boxes_collection_toolbar_on_back_btn_clicked ((BoxesCollectionToolbar*) self);
}

static void
boxes_collection_toolbar_on_list_btn_clicked (BoxesCollectionToolbar* self)
{
	g_return_if_fail (self != NULL);
	boxes_collection_toolbar_update_view_type (self, BOXES_APP_WINDOW_VIEW_TYPE_LIST);
}

static void
_boxes_collection_toolbar_on_list_btn_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                  gpointer self)
{
	boxes_collection_toolbar_on_list_btn_clicked ((BoxesCollectionToolbar*) self);
}

static void
boxes_collection_toolbar_on_grid_btn_clicked (BoxesCollectionToolbar* self)
{
	g_return_if_fail (self != NULL);
	boxes_collection_toolbar_update_view_type (self, BOXES_APP_WINDOW_VIEW_TYPE_ICON);
}

static void
_boxes_collection_toolbar_on_grid_btn_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                  gpointer self)
{
	boxes_collection_toolbar_on_grid_btn_clicked ((BoxesCollectionToolbar*) self);
}

static void
boxes_collection_toolbar_update_search_btn (BoxesCollectionToolbar* self)
{
	GtkButton* _tmp0_;
	BoxesApp* _tmp1_;
	BoxesCollection* _tmp2_;
	guint _tmp3_;
	guint _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->search_btn;
	_tmp1_ = boxes_app_app;
	_tmp2_ = _tmp1_->collection;
	_tmp3_ = boxes_collection_get_length (_tmp2_);
	_tmp4_ = _tmp3_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp0_, _tmp4_ != ((guint) 0));
}

static void
boxes_collection_toolbar_update_view_type (BoxesCollectionToolbar* self,
                                           BoxesAppWindowViewType view_type)
{
	BoxesAppWindow* _tmp0_;
	BoxesAppWindow* _tmp1_;
	GSettings* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->window;
	boxes_app_window_set_view_type (_tmp0_, view_type);
	_tmp1_ = self->priv->window;
	_tmp2_ = _tmp1_->settings;
	g_settings_set_enum (_tmp2_, "view", (gint) view_type);
	boxes_collection_toolbar_ui_state_changed (self);
}

static void
boxes_collection_toolbar_ui_state_changed (BoxesCollectionToolbar* self)
{
	BoxesAppWindow* _tmp0_;
	BoxesUIState _tmp1_;
	BoxesUIState _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->window;
	_tmp1_ = boxes_ui_get_ui_state ((BoxesUI*) _tmp0_);
	_tmp2_ = _tmp1_;
	switch (_tmp2_) {
		case BOXES_UI_STATE_COLLECTION:
		{
			GtkButton* _tmp3_;
			GtkButton* _tmp4_;
			GtkButton* _tmp5_;
			GtkButton* _tmp6_;
			BoxesAppWindow* _tmp7_;
			BoxesAppWindowViewType _tmp8_;
			BoxesAppWindowViewType _tmp9_;
			GtkButton* _tmp10_;
			BoxesAppWindow* _tmp11_;
			BoxesAppWindowViewType _tmp12_;
			BoxesAppWindowViewType _tmp13_;
			_tmp3_ = self->priv->back_btn;
			gtk_widget_hide ((GtkWidget*) _tmp3_);
			_tmp4_ = self->priv->search_btn;
			gtk_widget_show ((GtkWidget*) _tmp4_);
			_tmp5_ = self->priv->new_btn;
			gtk_widget_show ((GtkWidget*) _tmp5_);
			_tmp6_ = self->priv->grid_btn;
			_tmp7_ = self->priv->window;
			_tmp8_ = boxes_app_window_get_view_type (_tmp7_);
			_tmp9_ = _tmp8_;
			gtk_widget_set_visible ((GtkWidget*) _tmp6_, _tmp9_ != BOXES_APP_WINDOW_VIEW_TYPE_ICON);
			_tmp10_ = self->priv->list_btn;
			_tmp11_ = self->priv->window;
			_tmp12_ = boxes_app_window_get_view_type (_tmp11_);
			_tmp13_ = _tmp12_;
			gtk_widget_set_visible ((GtkWidget*) _tmp10_, _tmp13_ != BOXES_APP_WINDOW_VIEW_TYPE_LIST);
			break;
		}
		case BOXES_UI_STATE_CREDS:
		{
			GtkButton* _tmp14_;
			GtkButton* _tmp15_;
			BoxesAppWindow* _tmp16_;
			BoxesApp* _tmp17_;
			BoxesAppWindow* _tmp18_;
			BoxesAppWindow* _tmp19_;
			GtkButton* _tmp20_;
			GtkButton* _tmp21_;
			GtkButton* _tmp22_;
			_tmp14_ = self->priv->new_btn;
			gtk_widget_hide ((GtkWidget*) _tmp14_);
			_tmp15_ = self->priv->back_btn;
			_tmp16_ = self->priv->window;
			_tmp17_ = boxes_app_app;
			_tmp18_ = boxes_app_get_main_window (_tmp17_);
			_tmp19_ = _tmp18_;
			gtk_widget_set_visible ((GtkWidget*) _tmp15_, _tmp16_ == _tmp19_);
			_tmp20_ = self->priv->search_btn;
			gtk_widget_hide ((GtkWidget*) _tmp20_);
			_tmp21_ = self->priv->grid_btn;
			gtk_widget_hide ((GtkWidget*) _tmp21_);
			_tmp22_ = self->priv->list_btn;
			gtk_widget_hide ((GtkWidget*) _tmp22_);
			break;
		}
		default:
		{
			break;
		}
	}
}

BoxesCollectionToolbar*
boxes_collection_toolbar_construct (GType object_type)
{
	BoxesCollectionToolbar * self = NULL;
	self = (BoxesCollectionToolbar*) g_object_new (object_type, NULL);
	return self;
}

BoxesCollectionToolbar*
boxes_collection_toolbar_new (void)
{
	return boxes_collection_toolbar_construct (BOXES_TYPE_COLLECTION_TOOLBAR);
}

static void
boxes_collection_toolbar_class_init (BoxesCollectionToolbarClass * klass,
                                     gpointer klass_data)
{
	boxes_collection_toolbar_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BoxesCollectionToolbar_private_offset);
	G_OBJECT_CLASS (klass)->finalize = boxes_collection_toolbar_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Boxes/ui/collection-toolbar.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "search_btn", FALSE, BoxesCollectionToolbar_private_offset + G_STRUCT_OFFSET (BoxesCollectionToolbarPrivate, search_btn));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "list_btn", FALSE, BoxesCollectionToolbar_private_offset + G_STRUCT_OFFSET (BoxesCollectionToolbarPrivate, list_btn));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "grid_btn", FALSE, BoxesCollectionToolbar_private_offset + G_STRUCT_OFFSET (BoxesCollectionToolbarPrivate, grid_btn));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "back_btn", FALSE, BoxesCollectionToolbar_private_offset + G_STRUCT_OFFSET (BoxesCollectionToolbarPrivate, back_btn));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "new_btn", FALSE, BoxesCollectionToolbar_private_offset + G_STRUCT_OFFSET (BoxesCollectionToolbarPrivate, new_btn));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "new_vm_popover", FALSE, BoxesCollectionToolbar_private_offset + G_STRUCT_OFFSET (BoxesCollectionToolbarPrivate, new_vm_popover));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "downloads_hub_btn", FALSE, BoxesCollectionToolbar_private_offset + G_STRUCT_OFFSET (BoxesCollectionToolbarPrivate, downloads_hub_btn));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "hamburger_btn", FALSE, G_STRUCT_OFFSET (BoxesCollectionToolbar, hamburger_btn));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "open_filechooser", G_CALLBACK(_boxes_collection_toolbar_open_filechooser_hdy_action_row_activated));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "open_downloads_dialog", G_CALLBACK(_boxes_collection_toolbar_open_downloads_dialog_hdy_action_row_activated));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_back_btn_clicked", G_CALLBACK(_boxes_collection_toolbar_on_back_btn_clicked_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_list_btn_clicked", G_CALLBACK(_boxes_collection_toolbar_on_list_btn_clicked_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_grid_btn_clicked", G_CALLBACK(_boxes_collection_toolbar_on_grid_btn_clicked_gtk_button_clicked));
}

static void
boxes_collection_toolbar_instance_init (BoxesCollectionToolbar * self,
                                        gpointer klass)
{
	self->priv = boxes_collection_toolbar_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
boxes_collection_toolbar_finalize (GObject * obj)
{
	BoxesCollectionToolbar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_COLLECTION_TOOLBAR, BoxesCollectionToolbar);
	_g_object_unref0 (self->priv->window);
	G_OBJECT_CLASS (boxes_collection_toolbar_parent_class)->finalize (obj);
}

static GType
boxes_collection_toolbar_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BoxesCollectionToolbarClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_collection_toolbar_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesCollectionToolbar), 0, (GInstanceInitFunc) boxes_collection_toolbar_instance_init, NULL };
	GType boxes_collection_toolbar_type_id;
	boxes_collection_toolbar_type_id = g_type_register_static (hdy_header_bar_get_type (), "BoxesCollectionToolbar", &g_define_type_info, 0);
	BoxesCollectionToolbar_private_offset = g_type_add_instance_private (boxes_collection_toolbar_type_id, sizeof (BoxesCollectionToolbarPrivate));
	return boxes_collection_toolbar_type_id;
}

GType
boxes_collection_toolbar_get_type (void)
{
	static volatile gsize boxes_collection_toolbar_type_id__once = 0;
	if (g_once_init_enter (&boxes_collection_toolbar_type_id__once)) {
		GType boxes_collection_toolbar_type_id;
		boxes_collection_toolbar_type_id = boxes_collection_toolbar_get_type_once ();
		g_once_init_leave (&boxes_collection_toolbar_type_id__once, boxes_collection_toolbar_type_id);
	}
	return boxes_collection_toolbar_type_id__once;
}

