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

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

#include <gtk/gtk.h>
#include <glib-object.h>
#include <handy.h>
#include <gio/gio.h>
#include <glib.h>
#include <atk/atk.h>
#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include <string.h>
#include "common.h"
#include <gdk-pixbuf/gdk-pixbuf.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_ACTIONS_POPOVER (boxes_actions_popover_get_type ())
#define BOXES_ACTIONS_POPOVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_ACTIONS_POPOVER, BoxesActionsPopover))
#define BOXES_ACTIONS_POPOVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_ACTIONS_POPOVER, BoxesActionsPopoverClass))
#define BOXES_IS_ACTIONS_POPOVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_ACTIONS_POPOVER))
#define BOXES_IS_ACTIONS_POPOVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_ACTIONS_POPOVER))
#define BOXES_ACTIONS_POPOVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_ACTIONS_POPOVER, BoxesActionsPopoverClass))

typedef struct _BoxesActionsPopover BoxesActionsPopover;
typedef struct _BoxesActionsPopoverClass BoxesActionsPopoverClass;
typedef struct _BoxesActionsPopoverPrivate BoxesActionsPopoverPrivate;

#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_ACTIONS_POPOVER_0_PROPERTY,
	BOXES_ACTIONS_POPOVER_NUM_PROPERTIES
};
static GParamSpec* boxes_actions_popover_properties[BOXES_ACTIONS_POPOVER_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_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 _Block11Data Block11Data;

#define BOXES_TYPE_LIBVIRT_MACHINE (boxes_libvirt_machine_get_type ())
#define BOXES_LIBVIRT_MACHINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_LIBVIRT_MACHINE, BoxesLibvirtMachine))
#define BOXES_LIBVIRT_MACHINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_LIBVIRT_MACHINE, BoxesLibvirtMachineClass))
#define BOXES_IS_LIBVIRT_MACHINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_LIBVIRT_MACHINE))
#define BOXES_IS_LIBVIRT_MACHINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_LIBVIRT_MACHINE))
#define BOXES_LIBVIRT_MACHINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_LIBVIRT_MACHINE, BoxesLibvirtMachineClass))

typedef struct _BoxesLibvirtMachine BoxesLibvirtMachine;
typedef struct _BoxesLibvirtMachineClass BoxesLibvirtMachineClass;

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

#define BOXES_TYPE_DISPLAY (boxes_display_get_type ())
#define BOXES_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_DISPLAY, BoxesDisplay))
#define BOXES_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_DISPLAY, BoxesDisplayClass))
#define BOXES_IS_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_DISPLAY))
#define BOXES_IS_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_DISPLAY))
#define BOXES_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_DISPLAY, BoxesDisplayClass))

typedef struct _BoxesDisplay BoxesDisplay;
typedef struct _BoxesDisplayClass BoxesDisplayClass;

#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_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
typedef struct _Block13Data Block13Data;
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;
typedef void (*BoxesAppUndoNotifyCallback) (gpointer user_data);

#define BOXES_TYPE_PREFERENCES_WINDOW (boxes_preferences_window_get_type ())
#define BOXES_PREFERENCES_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_PREFERENCES_WINDOW, BoxesPreferencesWindow))
#define BOXES_PREFERENCES_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_PREFERENCES_WINDOW, BoxesPreferencesWindowClass))
#define BOXES_IS_PREFERENCES_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_PREFERENCES_WINDOW))
#define BOXES_IS_PREFERENCES_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_PREFERENCES_WINDOW))
#define BOXES_PREFERENCES_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_PREFERENCES_WINDOW, BoxesPreferencesWindowClass))

typedef struct _BoxesPreferencesWindow BoxesPreferencesWindow;
typedef struct _BoxesPreferencesWindowClass BoxesPreferencesWindowClass;

struct _BoxesActionsPopover {
	GtkPopover parent_instance;
	BoxesActionsPopoverPrivate * priv;
};

struct _BoxesActionsPopoverClass {
	GtkPopoverClass parent_class;
};

struct _BoxesActionsPopoverPrivate {
	BoxesAppWindow* window;
	GSimpleActionGroup* action_group;
};

struct _Block11Data {
	int _ref_count_;
	BoxesActionsPopover* self;
	BoxesMachine* machine;
};

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 _Block12Data {
	int _ref_count_;
	Block11Data * _data11_;
	GSimpleAction* action;
};

struct _Block13Data {
	int _ref_count_;
	BoxesActionsPopover* self;
	GtkStyleContext* ctx;
};

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 BoxesActionsPopover_private_offset;
static gpointer boxes_actions_popover_parent_class = NULL;
VALA_EXTERN BoxesApp* boxes_app_app;

VALA_EXTERN GType boxes_actions_popover_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesActionsPopover, 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_actions_popover_open_in_new_win_activated (BoxesActionsPopover* self);
static void _boxes_actions_popover_open_in_new_win_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                        GVariant* parameter,
                                                                                        gpointer self);
static void boxes_actions_popover_take_screenshot_activated (BoxesActionsPopover* self);
static void _boxes_actions_popover_take_screenshot_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                        GVariant* parameter,
                                                                                        gpointer self);
static void boxes_actions_popover_force_shutdown_activated (BoxesActionsPopover* self);
static void _boxes_actions_popover_force_shutdown_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                       GVariant* parameter,
                                                                                       gpointer self);
static void boxes_actions_popover_delete_activated (BoxesActionsPopover* self);
static void _boxes_actions_popover_delete_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                               GVariant* parameter,
                                                                               gpointer self);
static void boxes_actions_popover_clone_activated (BoxesActionsPopover* self);
static void _boxes_actions_popover_clone_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                              GVariant* parameter,
                                                                              gpointer self);
static void boxes_actions_popover_preferences_activated (BoxesActionsPopover* self);
static void _boxes_actions_popover_preferences_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                    GVariant* parameter,
                                                                                    gpointer self);
static void boxes_actions_popover_restart_activated (BoxesActionsPopover* self);
static void _boxes_actions_popover_restart_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                GVariant* parameter,
                                                                                gpointer self);
static void boxes_actions_popover_send_file_activated (BoxesActionsPopover* self);
static void _boxes_actions_popover_send_file_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                  GVariant* parameter,
                                                                                  gpointer self);
VALA_EXTERN BoxesActionsPopover* boxes_actions_popover_new (BoxesAppWindow* window);
VALA_EXTERN BoxesActionsPopover* boxes_actions_popover_construct (GType object_type,
                                                      BoxesAppWindow* window);
VALA_EXTERN GType boxes_collection_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesCollectionItem, g_object_unref)
VALA_EXTERN void boxes_actions_popover_update_for_item (BoxesActionsPopover* self,
                                            BoxesCollectionItem* item);
VALA_EXTERN GType boxes_machine_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesMachine, g_object_unref)
static Block11Data* block11_data_ref (Block11Data* _data11_);
static void block11_data_unref (void * _userdata_);
VALA_EXTERN GType boxes_libvirt_machine_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesLibvirtMachine, g_object_unref)
VALA_EXTERN gboolean boxes_libvirt_machine_get_importing (BoxesLibvirtMachine* self);
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 BoxesUIState boxes_ui_get_ui_state (BoxesUI* self);
static Block12Data* block12_data_ref (Block12Data* _data12_);
static void block12_data_unref (void * _userdata_);
VALA_EXTERN GType boxes_display_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesDisplay, g_object_unref)
VALA_EXTERN BoxesDisplay* boxes_machine_get_display (BoxesMachine* self);
VALA_EXTERN gboolean boxes_display_get_can_transfer_files (BoxesDisplay* self);
static void ___lambda62_ (Block12Data* _data12_);
static void ____lambda62__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
VALA_EXTERN gboolean boxes_machine_get_is_running (BoxesMachine* self);
VALA_EXTERN gboolean boxes_machine_get_can_clone (BoxesMachine* self);
VALA_EXTERN gboolean boxes_machine_get_can_delete (BoxesMachine* self);
VALA_EXTERN gboolean boxes_machine_get_can_restart (BoxesMachine* self);
VALA_EXTERN void boxes_app_window_set_current_item (BoxesAppWindow* self,
                                        BoxesCollectionItem* value);
VALA_EXTERN GType boxes_app_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesApp, g_object_unref)
VALA_EXTERN void boxes_app_open_in_new_window (BoxesApp* self,
                                   BoxesMachine* machine);
VALA_EXTERN BoxesCollectionItem* boxes_app_window_get_current_item (BoxesAppWindow* self);
static gchar* boxes_actions_popover_get_screenshot_filename (BoxesActionsPopover* self,
                                                      GError** error);
static Block13Data* block13_data_ref (Block13Data* _data13_);
static void block13_data_unref (void * _userdata_);
VALA_EXTERN GdkPixbuf* boxes_display_get_pixbuf (BoxesDisplay* self,
                                     gint n,
                                     GError** error);
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 gboolean __lambda66_ (Block13Data* _data13_);
static gboolean ___lambda66__gsource_func (gpointer self);
VALA_EXTERN void boxes_libvirt_machine_force_shutdown (BoxesLibvirtMachine* self);
VALA_EXTERN void boxes_machine_restart (BoxesMachine* self);
VALA_EXTERN void boxes_ui_set_state (BoxesUI* self,
                         BoxesUIState new_state);
VALA_EXTERN void boxes_app_delete_machines_undoable (BoxesApp* self,
                                         GList* items,
                                         const gchar* message,
                                         BoxesAppUndoNotifyCallback undo_notify_callback,
                                         gpointer undo_notify_callback_target,
                                         GDestroyNotify undo_notify_callback_target_destroy_notify);
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
VALA_EXTERN void boxes_machine_clone (BoxesMachine* self,
                          GAsyncReadyCallback _callback_,
                          gpointer _user_data_);
VALA_EXTERN void boxes_machine_clone_finish (BoxesMachine* self,
                                 GAsyncResult* _res_);
VALA_EXTERN void boxes_app_window_show_send_file (BoxesAppWindow* self);
VALA_EXTERN GType boxes_preferences_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesPreferencesWindow, g_object_unref)
VALA_EXTERN BoxesPreferencesWindow* boxes_preferences_window_new (void);
VALA_EXTERN BoxesPreferencesWindow* boxes_preferences_window_construct (GType object_type);
VALA_EXTERN void boxes_preferences_window_set_machine (BoxesPreferencesWindow* self,
                                           BoxesMachine* value);
static void boxes_actions_popover_finalize (GObject * obj);
static GType boxes_actions_popover_get_type_once (void);

static const GActionEntry BOXES_ACTIONS_POPOVER_action_entries[8] = {{"open-in-new-win", _boxes_actions_popover_open_in_new_win_activated_gsimple_action_activate_callback}, {"take_screenshot", _boxes_actions_popover_take_screenshot_activated_gsimple_action_activate_callback}, {"force_shutdown", _boxes_actions_popover_force_shutdown_activated_gsimple_action_activate_callback}, {"delete", _boxes_actions_popover_delete_activated_gsimple_action_activate_callback}, {"clone", _boxes_actions_popover_clone_activated_gsimple_action_activate_callback}, {"preferences", _boxes_actions_popover_preferences_activated_gsimple_action_activate_callback}, {"restart", _boxes_actions_popover_restart_activated_gsimple_action_activate_callback}, {"send_file", _boxes_actions_popover_send_file_activated_gsimple_action_activate_callback}};

static inline gpointer
boxes_actions_popover_get_instance_private (BoxesActionsPopover* self)
{
	return G_STRUCT_MEMBER_P (self, BoxesActionsPopover_private_offset);
}

static void
_boxes_actions_popover_open_in_new_win_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                   GVariant* parameter,
                                                                                   gpointer self)
{
	boxes_actions_popover_open_in_new_win_activated ((BoxesActionsPopover*) self);
}

static void
_boxes_actions_popover_take_screenshot_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                   GVariant* parameter,
                                                                                   gpointer self)
{
	boxes_actions_popover_take_screenshot_activated ((BoxesActionsPopover*) self);
}

static void
_boxes_actions_popover_force_shutdown_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                  GVariant* parameter,
                                                                                  gpointer self)
{
	boxes_actions_popover_force_shutdown_activated ((BoxesActionsPopover*) self);
}

static void
_boxes_actions_popover_delete_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                          GVariant* parameter,
                                                                          gpointer self)
{
	boxes_actions_popover_delete_activated ((BoxesActionsPopover*) self);
}

static void
_boxes_actions_popover_clone_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                         GVariant* parameter,
                                                                         gpointer self)
{
	boxes_actions_popover_clone_activated ((BoxesActionsPopover*) self);
}

static void
_boxes_actions_popover_preferences_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                               GVariant* parameter,
                                                                               gpointer self)
{
	boxes_actions_popover_preferences_activated ((BoxesActionsPopover*) self);
}

static void
_boxes_actions_popover_restart_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                           GVariant* parameter,
                                                                           gpointer self)
{
	boxes_actions_popover_restart_activated ((BoxesActionsPopover*) self);
}

static void
_boxes_actions_popover_send_file_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                             GVariant* parameter,
                                                                             gpointer self)
{
	boxes_actions_popover_send_file_activated ((BoxesActionsPopover*) self);
}

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

BoxesActionsPopover*
boxes_actions_popover_construct (GType object_type,
                                 BoxesAppWindow* window)
{
	BoxesActionsPopover * self = NULL;
	BoxesAppWindow* _tmp0_;
	GSimpleActionGroup* _tmp1_;
	GSimpleActionGroup* _tmp2_;
	GSimpleActionGroup* _tmp3_;
	AtkObject* a11y = NULL;
	AtkObject* _tmp4_;
	AtkObject* _tmp5_;
	g_return_val_if_fail (window != NULL, NULL);
	self = (BoxesActionsPopover*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (window);
	_g_object_unref0 (self->priv->window);
	self->priv->window = _tmp0_;
	_tmp1_ = g_simple_action_group_new ();
	_g_object_unref0 (self->priv->action_group);
	self->priv->action_group = _tmp1_;
	_tmp2_ = self->priv->action_group;
	g_action_map_add_action_entries ((GActionMap*) _tmp2_, BOXES_ACTIONS_POPOVER_action_entries, (gint) G_N_ELEMENTS (BOXES_ACTIONS_POPOVER_action_entries), self);
	_tmp3_ = self->priv->action_group;
	gtk_widget_insert_action_group ((GtkWidget*) self, "box", (GActionGroup*) _tmp3_);
	_tmp4_ = gtk_widget_get_accessible ((GtkWidget*) self);
	_tmp5_ = _g_object_ref0 (_tmp4_);
	a11y = _tmp5_;
	a11y->role = ATK_ROLE_POPUP_MENU;
	a11y->name = _ ("Box actions");
	_g_object_unref0 (a11y);
	return self;
}

BoxesActionsPopover*
boxes_actions_popover_new (BoxesAppWindow* window)
{
	return boxes_actions_popover_construct (BOXES_TYPE_ACTIONS_POPOVER, window);
}

static Block11Data*
block11_data_ref (Block11Data* _data11_)
{
	g_atomic_int_inc (&_data11_->_ref_count_);
	return _data11_;
}

static void
block11_data_unref (void * _userdata_)
{
	Block11Data* _data11_;
	_data11_ = (Block11Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data11_->_ref_count_)) {
		BoxesActionsPopover* self;
		self = _data11_->self;
		_g_object_unref0 (_data11_->machine);
		_g_object_unref0 (self);
		g_slice_free (Block11Data, _data11_);
	}
}

static Block12Data*
block12_data_ref (Block12Data* _data12_)
{
	g_atomic_int_inc (&_data12_->_ref_count_);
	return _data12_;
}

static void
block12_data_unref (void * _userdata_)
{
	Block12Data* _data12_;
	_data12_ = (Block12Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data12_->_ref_count_)) {
		BoxesActionsPopover* self;
		self = _data12_->_data11_->self;
		_g_object_unref0 (_data12_->action);
		block11_data_unref (_data12_->_data11_);
		_data12_->_data11_ = NULL;
		g_slice_free (Block12Data, _data12_);
	}
}

static void
___lambda62_ (Block12Data* _data12_)
{
	Block11Data* _data11_;
	BoxesActionsPopover* self;
	GSimpleAction* _tmp0_;
	BoxesMachine* _tmp1_;
	BoxesDisplay* _tmp2_;
	BoxesDisplay* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	_data11_ = _data12_->_data11_;
	self = _data11_->self;
	_tmp0_ = _data12_->action;
	_tmp1_ = _data11_->machine;
	_tmp2_ = boxes_machine_get_display (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = boxes_display_get_can_transfer_files (_tmp3_);
	_tmp5_ = _tmp4_;
	g_simple_action_set_enabled (_tmp0_, _tmp5_);
}

static void
____lambda62__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	___lambda62_ (self);
}

void
boxes_actions_popover_update_for_item (BoxesActionsPopover* self,
                                       BoxesCollectionItem* item)
{
	Block11Data* _data11_;
	BoxesMachine* _tmp0_;
	GMenu* menu = NULL;
	GMenu* _tmp1_;
	GMenu* section = NULL;
	GMenu* _tmp2_;
	BoxesLibvirtMachine* libvirt_machine = NULL;
	BoxesMachine* _tmp3_;
	BoxesLibvirtMachine* _tmp4_;
	gboolean _tmp5_ = FALSE;
	BoxesMachine* _tmp6_;
	gboolean importing = FALSE;
	BoxesAppWindow* _tmp10_;
	BoxesUIState _tmp11_;
	BoxesUIState _tmp12_;
	GMenu* _tmp32_;
	GMenu* _tmp33_;
	GMenu* _tmp34_;
	BoxesMachine* _tmp35_;
	BoxesAppWindow* _tmp44_;
	BoxesUIState _tmp45_;
	BoxesUIState _tmp46_;
	GMenu* _tmp76_;
	GMenu* _tmp77_;
	GMenu* _tmp78_;
	GMenu* _tmp79_;
	GMenu* _tmp80_;
	GMenu* _tmp81_;
	GSimpleAction* action = NULL;
	GSimpleActionGroup* _tmp82_;
	GAction* _tmp83_;
	GSimpleAction* _tmp84_;
	GMenu* _tmp85_;
	BoxesAppWindow* _tmp86_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	_data11_ = g_slice_new0 (Block11Data);
	_data11_->_ref_count_ = 1;
	_data11_->self = g_object_ref (self);
	g_return_if_fail (BOXES_IS_MACHINE (item));
	_tmp0_ = _g_object_ref0 (BOXES_IS_MACHINE (item) ? ((BoxesMachine*) item) : NULL);
	_data11_->machine = _tmp0_;
	_tmp1_ = g_menu_new ();
	menu = _tmp1_;
	_tmp2_ = g_menu_new ();
	section = _tmp2_;
	_tmp3_ = _data11_->machine;
	_tmp4_ = _g_object_ref0 (BOXES_IS_LIBVIRT_MACHINE (_tmp3_) ? ((BoxesLibvirtMachine*) _tmp3_) : NULL);
	libvirt_machine = _tmp4_;
	_tmp6_ = _data11_->machine;
	if (BOXES_IS_LIBVIRT_MACHINE (_tmp6_)) {
		BoxesLibvirtMachine* _tmp7_;
		gboolean _tmp8_;
		gboolean _tmp9_;
		_tmp7_ = libvirt_machine;
		_tmp8_ = boxes_libvirt_machine_get_importing (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp5_ = _tmp9_;
	} else {
		_tmp5_ = FALSE;
	}
	importing = _tmp5_;
	_tmp10_ = self->priv->window;
	_tmp11_ = boxes_ui_get_ui_state ((BoxesUI*) _tmp10_);
	_tmp12_ = _tmp11_;
	if (_tmp12_ != BOXES_UI_STATE_DISPLAY) {
		GMenu* _tmp13_;
		GSimpleAction* action = NULL;
		GSimpleActionGroup* _tmp14_;
		GAction* _tmp15_;
		GSimpleAction* _tmp16_;
		GSimpleAction* _tmp17_;
		_tmp13_ = section;
		g_menu_append (_tmp13_, _ ("Open in New Window"), "box.open-in-new-win");
		_tmp14_ = self->priv->action_group;
		_tmp15_ = g_action_map_lookup_action ((GActionMap*) _tmp14_, "open-in-new-win");
		_tmp16_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp15_) : NULL);
		action = _tmp16_;
		_tmp17_ = action;
		g_simple_action_set_enabled (_tmp17_, !importing);
		_g_object_unref0 (action);
	} else {
		Block12Data* _data12_;
		GMenu* _tmp18_;
		GSimpleActionGroup* _tmp19_;
		GAction* _tmp20_;
		GSimpleAction* _tmp21_;
		GSimpleAction* _tmp22_;
		BoxesMachine* _tmp23_;
		BoxesDisplay* _tmp24_;
		BoxesDisplay* _tmp25_;
		gboolean _tmp26_;
		gboolean _tmp27_;
		BoxesMachine* _tmp28_;
		BoxesDisplay* _tmp29_;
		BoxesDisplay* _tmp30_;
		GMenu* _tmp31_;
		_data12_ = g_slice_new0 (Block12Data);
		_data12_->_ref_count_ = 1;
		_data12_->_data11_ = block11_data_ref (_data11_);
		_tmp18_ = section;
		g_menu_append (_tmp18_, _ ("Send File…"), "box.send_file");
		_tmp19_ = self->priv->action_group;
		_tmp20_ = g_action_map_lookup_action ((GActionMap*) _tmp19_, "send_file");
		_tmp21_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp20_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp20_) : NULL);
		_data12_->action = _tmp21_;
		_tmp22_ = _data12_->action;
		_tmp23_ = _data11_->machine;
		_tmp24_ = boxes_machine_get_display (_tmp23_);
		_tmp25_ = _tmp24_;
		_tmp26_ = boxes_display_get_can_transfer_files (_tmp25_);
		_tmp27_ = _tmp26_;
		g_simple_action_set_enabled (_tmp22_, _tmp27_);
		_tmp28_ = _data11_->machine;
		_tmp29_ = boxes_machine_get_display (_tmp28_);
		_tmp30_ = _tmp29_;
		g_signal_connect_data ((GObject*) _tmp30_, "notify::is-guest-agent-connected", (GCallback) ____lambda62__g_object_notify, block12_data_ref (_data12_), (GClosureNotify) block12_data_unref, 0);
		_tmp31_ = section;
		g_menu_append (_tmp31_, _ ("Take Screenshot"), "box.take_screenshot");
		block12_data_unref (_data12_);
		_data12_ = NULL;
	}
	_tmp32_ = menu;
	_tmp33_ = section;
	g_menu_append_section (_tmp32_, NULL, (GMenuModel*) _tmp33_);
	_tmp34_ = g_menu_new ();
	_g_object_unref0 (section);
	section = _tmp34_;
	_tmp35_ = _data11_->machine;
	if (BOXES_IS_LIBVIRT_MACHINE (_tmp35_)) {
		GMenu* _tmp36_;
		GSimpleAction* action = NULL;
		GSimpleActionGroup* _tmp37_;
		GAction* _tmp38_;
		GSimpleAction* _tmp39_;
		GSimpleAction* _tmp40_;
		BoxesMachine* _tmp41_;
		gboolean _tmp42_;
		gboolean _tmp43_;
		_tmp36_ = section;
		g_menu_append (_tmp36_, _ ("Force Shutdown"), "box.force_shutdown");
		_tmp37_ = self->priv->action_group;
		_tmp38_ = g_action_map_lookup_action ((GActionMap*) _tmp37_, "force_shutdown");
		_tmp39_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp38_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp38_) : NULL);
		action = _tmp39_;
		_tmp40_ = action;
		_tmp41_ = _data11_->machine;
		_tmp42_ = boxes_machine_get_is_running (_tmp41_);
		_tmp43_ = _tmp42_;
		g_simple_action_set_enabled (_tmp40_, _tmp43_);
		_g_object_unref0 (action);
	}
	_tmp44_ = self->priv->window;
	_tmp45_ = boxes_ui_get_ui_state ((BoxesUI*) _tmp44_);
	_tmp46_ = _tmp45_;
	if (_tmp46_ != BOXES_UI_STATE_DISPLAY) {
		gboolean can_clone = FALSE;
		BoxesMachine* _tmp47_;
		gboolean _tmp48_;
		gboolean _tmp49_;
		BoxesMachine* _tmp50_;
		GMenu* _tmp55_;
		GSimpleAction* action = NULL;
		GSimpleActionGroup* _tmp56_;
		GAction* _tmp57_;
		GSimpleAction* _tmp58_;
		GSimpleAction* _tmp59_;
		GMenu* _tmp60_;
		GSimpleActionGroup* _tmp61_;
		GAction* _tmp62_;
		GSimpleAction* _tmp63_;
		GSimpleAction* _tmp64_;
		BoxesMachine* _tmp65_;
		gboolean _tmp66_;
		gboolean _tmp67_;
		_tmp47_ = _data11_->machine;
		_tmp48_ = boxes_machine_get_can_clone (_tmp47_);
		_tmp49_ = _tmp48_;
		can_clone = _tmp49_;
		_tmp50_ = _data11_->machine;
		if (BOXES_IS_LIBVIRT_MACHINE (_tmp50_)) {
			gboolean _tmp51_ = FALSE;
			if (can_clone) {
				BoxesMachine* _tmp52_;
				gboolean _tmp53_;
				gboolean _tmp54_;
				_tmp52_ = _data11_->machine;
				_tmp53_ = boxes_machine_get_is_running (_tmp52_);
				_tmp54_ = _tmp53_;
				_tmp51_ = !_tmp54_;
			} else {
				_tmp51_ = FALSE;
			}
			can_clone = _tmp51_;
		}
		_tmp55_ = section;
		g_menu_append (_tmp55_, _ ("Clone"), "box.clone");
		_tmp56_ = self->priv->action_group;
		_tmp57_ = g_action_map_lookup_action ((GActionMap*) _tmp56_, "clone");
		_tmp58_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp57_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp57_) : NULL);
		action = _tmp58_;
		_tmp59_ = action;
		g_simple_action_set_enabled (_tmp59_, can_clone);
		_tmp60_ = section;
		g_menu_append (_tmp60_, _ ("Delete"), "box.delete");
		_tmp61_ = self->priv->action_group;
		_tmp62_ = g_action_map_lookup_action ((GActionMap*) _tmp61_, "delete");
		_tmp63_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp62_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp62_) : NULL);
		_g_object_unref0 (action);
		action = _tmp63_;
		_tmp64_ = action;
		_tmp65_ = _data11_->machine;
		_tmp66_ = boxes_machine_get_can_delete (_tmp65_);
		_tmp67_ = _tmp66_;
		g_simple_action_set_enabled (_tmp64_, _tmp67_);
		_g_object_unref0 (action);
	} else {
		GMenu* _tmp68_;
		GSimpleAction* action = NULL;
		GSimpleActionGroup* _tmp69_;
		GAction* _tmp70_;
		GSimpleAction* _tmp71_;
		GSimpleAction* _tmp72_;
		BoxesMachine* _tmp73_;
		gboolean _tmp74_;
		gboolean _tmp75_;
		_tmp68_ = section;
		g_menu_append (_tmp68_, _ ("Restart"), "box.restart");
		_tmp69_ = self->priv->action_group;
		_tmp70_ = g_action_map_lookup_action ((GActionMap*) _tmp69_, "restart");
		_tmp71_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp70_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp70_) : NULL);
		action = _tmp71_;
		_tmp72_ = action;
		_tmp73_ = _data11_->machine;
		_tmp74_ = boxes_machine_get_can_restart (_tmp73_);
		_tmp75_ = _tmp74_;
		g_simple_action_set_enabled (_tmp72_, _tmp75_);
		_g_object_unref0 (action);
	}
	_tmp76_ = menu;
	_tmp77_ = section;
	g_menu_append_section (_tmp76_, NULL, (GMenuModel*) _tmp77_);
	_tmp78_ = g_menu_new ();
	_g_object_unref0 (section);
	section = _tmp78_;
	_tmp79_ = section;
	g_menu_append (_tmp79_, _ ("Preferences"), "box.preferences");
	_tmp80_ = menu;
	_tmp81_ = section;
	g_menu_append_section (_tmp80_, NULL, (GMenuModel*) _tmp81_);
	_tmp82_ = self->priv->action_group;
	_tmp83_ = g_action_map_lookup_action ((GActionMap*) _tmp82_, "preferences");
	_tmp84_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp83_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp83_) : NULL);
	action = _tmp84_;
	g_simple_action_set_enabled (action, !importing);
	_tmp85_ = menu;
	gtk_popover_bind_model ((GtkPopover*) self, (GMenuModel*) _tmp85_, NULL);
	_tmp86_ = self->priv->window;
	boxes_app_window_set_current_item (_tmp86_, item);
	_g_object_unref0 (action);
	_g_object_unref0 (libvirt_machine);
	_g_object_unref0 (section);
	_g_object_unref0 (menu);
	block11_data_unref (_data11_);
	_data11_ = NULL;
}

static void
boxes_actions_popover_open_in_new_win_activated (BoxesActionsPopover* self)
{
	BoxesApp* _tmp0_;
	BoxesAppWindow* _tmp1_;
	BoxesCollectionItem* _tmp2_;
	BoxesCollectionItem* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = boxes_app_app;
	_tmp1_ = self->priv->window;
	_tmp2_ = boxes_app_window_get_current_item (_tmp1_);
	_tmp3_ = _tmp2_;
	boxes_app_open_in_new_window (_tmp0_, BOXES_IS_MACHINE (_tmp3_) ? ((BoxesMachine*) _tmp3_) : NULL);
}

static gpointer
_g_error_copy0 (gpointer self)
{
	return self ? g_error_copy (self) : NULL;
}

static gchar*
boxes_actions_popover_get_screenshot_filename (BoxesActionsPopover* self,
                                               GError** error)
{
	gchar* dir_name = NULL;
	gchar* _tmp0_;
	gchar* path = NULL;
	gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	GFile* dir = NULL;
	const gchar* _tmp6_;
	GFile* _tmp7_;
	GDateTime* now = NULL;
	GDateTime* _tmp12_;
	gchar* timestamp = NULL;
	gchar* _tmp13_;
	gchar* filename = NULL;
	gchar* _tmp14_;
	GFile* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (_ ("Screenshots"));
	dir_name = _tmp0_;
	_tmp1_ = boxes_get_user_special_dir_with_fallback (G_USER_DIRECTORY_PICTURES);
	_tmp2_ = _tmp1_;
	_tmp3_ = dir_name;
	_tmp4_ = g_build_filename (_tmp2_, _tmp3_, NULL);
	_tmp5_ = _tmp4_;
	_g_free0 (_tmp2_);
	path = _tmp5_;
	_tmp6_ = path;
	_tmp7_ = g_file_new_for_path (_tmp6_);
	dir = _tmp7_;
	{
		GFile* _tmp8_;
		_tmp8_ = dir;
		g_file_make_directory_with_parents (_tmp8_, NULL, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		GError* _tmp9_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp9_ = _error_;
		if (!g_error_matches (_tmp9_, G_IO_ERROR, G_IO_ERROR_EXISTS)) {
			GError* _tmp10_;
			GError* _tmp11_;
			_tmp10_ = _error_;
			_tmp11_ = _g_error_copy0 (_tmp10_);
			_inner_error0_ = _tmp11_;
			_g_error_free0 (_error_);
			goto __finally0;
		}
		_g_error_free0 (_error_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		_g_object_unref0 (dir);
		_g_free0 (path);
		_g_free0 (dir_name);
		return NULL;
	}
	_tmp12_ = g_date_time_new_now_local ();
	now = _tmp12_;
	_tmp13_ = g_date_time_format (now, "%Y-%m-%d %H-%M-%S");
	timestamp = _tmp13_;
	_tmp14_ = g_strdup_printf (_ ("Screenshot from %s"), timestamp);
	filename = _tmp14_;
	_tmp15_ = dir;
	_tmp16_ = g_file_get_path (_tmp15_);
	_tmp17_ = _tmp16_;
	_tmp18_ = g_strconcat (filename, ".png", NULL);
	_tmp19_ = _tmp18_;
	_tmp20_ = g_build_filename (_tmp17_, _tmp19_, NULL);
	_tmp21_ = _tmp20_;
	_g_free0 (_tmp19_);
	_g_free0 (_tmp17_);
	result = _tmp21_;
	_g_free0 (filename);
	_g_free0 (timestamp);
	_g_date_time_unref0 (now);
	_g_object_unref0 (dir);
	_g_free0 (path);
	_g_free0 (dir_name);
	return result;
}

static Block13Data*
block13_data_ref (Block13Data* _data13_)
{
	g_atomic_int_inc (&_data13_->_ref_count_);
	return _data13_;
}

static void
block13_data_unref (void * _userdata_)
{
	Block13Data* _data13_;
	_data13_ = (Block13Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data13_->_ref_count_)) {
		BoxesActionsPopover* self;
		self = _data13_->self;
		_g_object_unref0 (_data13_->ctx);
		_g_object_unref0 (self);
		g_slice_free (Block13Data, _data13_);
	}
}

static gboolean
__lambda66_ (Block13Data* _data13_)
{
	BoxesActionsPopover* self;
	gboolean result;
	self = _data13_->self;
	gtk_style_context_remove_class (_data13_->ctx, "flash");
	result = FALSE;
	return result;
}

static gboolean
___lambda66__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda66_ (self);
	return result;
}

static void
boxes_actions_popover_take_screenshot_activated (BoxesActionsPopover* self)
{
	Block13Data* _data13_;
	BoxesMachine* machine = NULL;
	BoxesAppWindow* _tmp0_;
	BoxesCollectionItem* _tmp1_;
	BoxesCollectionItem* _tmp2_;
	BoxesMachine* _tmp3_;
	BoxesAppWindow* _tmp13_;
	GtkStack* _tmp14_;
	GtkStyleContext* _tmp15_;
	GtkStyleContext* _tmp16_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_data13_ = g_slice_new0 (Block13Data);
	_data13_->_ref_count_ = 1;
	_data13_->self = g_object_ref (self);
	_tmp0_ = self->priv->window;
	_tmp1_ = boxes_app_window_get_current_item (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (BOXES_IS_MACHINE (_tmp2_) ? ((BoxesMachine*) _tmp2_) : NULL);
	machine = _tmp3_;
	{
		GdkPixbuf* pixbuf = NULL;
		BoxesMachine* _tmp4_;
		BoxesDisplay* _tmp5_;
		BoxesDisplay* _tmp6_;
		GdkPixbuf* _tmp7_;
		gchar* _tmp8_ = NULL;
		gchar* _tmp9_;
		GdkPixbuf* _tmp10_;
		_tmp4_ = machine;
		_tmp5_ = boxes_machine_get_display (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = boxes_display_get_pixbuf (_tmp6_, 0, &_inner_error0_);
		pixbuf = _tmp7_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp9_ = boxes_actions_popover_get_screenshot_filename (self, &_inner_error0_);
		_tmp8_ = _tmp9_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (pixbuf);
			goto __catch0_g_error;
		}
		_tmp10_ = pixbuf;
		gdk_pixbuf_save (_tmp10_, _tmp8_, "png", &_inner_error0_, NULL);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_free0 (_tmp8_);
			_g_object_unref0 (pixbuf);
			goto __catch0_g_error;
		}
		_g_free0 (_tmp8_);
		_g_object_unref0 (pixbuf);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		GError* _tmp11_;
		const gchar* _tmp12_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp11_ = _error_;
		_tmp12_ = _tmp11_->message;
		g_warning ("actions-popover.vala:137: %s", _tmp12_);
		_g_error_free0 (_error_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (machine);
		block13_data_unref (_data13_);
		_data13_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_tmp13_ = self->priv->window;
	_tmp14_ = _tmp13_->below_bin;
	_tmp15_ = gtk_widget_get_style_context ((GtkWidget*) _tmp14_);
	_tmp16_ = _g_object_ref0 (_tmp15_);
	_data13_->ctx = _tmp16_;
	gtk_style_context_add_class (_data13_->ctx, "flash");
	g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 200, ___lambda66__gsource_func, block13_data_ref (_data13_), block13_data_unref);
	_g_object_unref0 (machine);
	block13_data_unref (_data13_);
	_data13_ = NULL;
}

static void
boxes_actions_popover_force_shutdown_activated (BoxesActionsPopover* self)
{
	BoxesLibvirtMachine* machine = NULL;
	BoxesAppWindow* _tmp0_;
	BoxesCollectionItem* _tmp1_;
	BoxesCollectionItem* _tmp2_;
	BoxesLibvirtMachine* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->window;
	_tmp1_ = boxes_app_window_get_current_item (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (BOXES_IS_LIBVIRT_MACHINE (_tmp2_) ? ((BoxesLibvirtMachine*) _tmp2_) : NULL);
	machine = _tmp3_;
	boxes_libvirt_machine_force_shutdown (machine);
	_g_object_unref0 (machine);
}

static void
boxes_actions_popover_restart_activated (BoxesActionsPopover* self)
{
	BoxesMachine* machine = NULL;
	BoxesAppWindow* _tmp0_;
	BoxesCollectionItem* _tmp1_;
	BoxesCollectionItem* _tmp2_;
	BoxesMachine* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->window;
	_tmp1_ = boxes_app_window_get_current_item (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (BOXES_IS_MACHINE (_tmp2_) ? ((BoxesMachine*) _tmp2_) : NULL);
	machine = _tmp3_;
	boxes_machine_restart (machine);
	_g_object_unref0 (machine);
}

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

static inline void
_g_list_free__g_object_unref0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) _g_object_unref0_);
}

static void
boxes_actions_popover_delete_activated (BoxesActionsPopover* self)
{
	BoxesAppWindow* _tmp0_;
	GList* items = NULL;
	BoxesAppWindow* _tmp1_;
	BoxesCollectionItem* _tmp2_;
	BoxesCollectionItem* _tmp3_;
	BoxesCollectionItem* _tmp4_;
	BoxesApp* _tmp5_;
	GList* _tmp6_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->window;
	boxes_ui_set_state ((BoxesUI*) _tmp0_, BOXES_UI_STATE_COLLECTION);
	items = NULL;
	_tmp1_ = self->priv->window;
	_tmp2_ = boxes_app_window_get_current_item (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	items = g_list_append (items, _tmp4_);
	_tmp5_ = boxes_app_app;
	_tmp6_ = items;
	items = NULL;
	boxes_app_delete_machines_undoable (_tmp5_, _tmp6_, NULL, NULL, NULL, NULL);
	(items == NULL) ? NULL : (items = (_g_list_free__g_object_unref0_ (items), NULL));
}

static void
boxes_actions_popover_clone_activated (BoxesActionsPopover* self)
{
	BoxesMachine* machine = NULL;
	BoxesAppWindow* _tmp0_;
	BoxesCollectionItem* _tmp1_;
	BoxesCollectionItem* _tmp2_;
	BoxesMachine* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->window;
	_tmp1_ = boxes_app_window_get_current_item (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (BOXES_IS_MACHINE (_tmp2_) ? ((BoxesMachine*) _tmp2_) : NULL);
	machine = _tmp3_;
	boxes_machine_clone (machine, NULL, NULL);
	_g_object_unref0 (machine);
}

static void
boxes_actions_popover_send_file_activated (BoxesActionsPopover* self)
{
	BoxesAppWindow* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->window;
	boxes_app_window_show_send_file (_tmp0_);
}

static void
boxes_actions_popover_preferences_activated (BoxesActionsPopover* self)
{
	BoxesMachine* machine = NULL;
	BoxesAppWindow* _tmp0_;
	BoxesCollectionItem* _tmp1_;
	BoxesCollectionItem* _tmp2_;
	BoxesMachine* _tmp3_;
	BoxesPreferencesWindow* preferences = NULL;
	BoxesMachine* _tmp4_;
	BoxesAppWindow* _tmp5_;
	GtkWindow* _tmp6_;
	BoxesPreferencesWindow* _tmp7_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->window;
	_tmp1_ = boxes_app_window_get_current_item (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (BOXES_IS_MACHINE (_tmp2_) ? ((BoxesMachine*) _tmp2_) : NULL);
	machine = _tmp3_;
	_tmp4_ = _g_object_ref0 (machine);
	_tmp5_ = self->priv->window;
	_tmp6_ = _g_object_ref0 ((GtkWindow*) _tmp5_);
	_tmp7_ = boxes_preferences_window_new ();
	boxes_preferences_window_set_machine (_tmp7_, _tmp4_);
	_g_object_unref0 (_tmp4_);
	gtk_window_set_transient_for ((GtkWindow*) _tmp7_, _tmp6_);
	_g_object_unref0 (_tmp6_);
	g_object_ref_sink (_tmp7_);
	preferences = _tmp7_;
	gtk_window_present ((GtkWindow*) preferences);
	_g_object_unref0 (preferences);
	_g_object_unref0 (machine);
}

static void
boxes_actions_popover_class_init (BoxesActionsPopoverClass * klass,
                                  gpointer klass_data)
{
	boxes_actions_popover_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BoxesActionsPopover_private_offset);
	G_OBJECT_CLASS (klass)->finalize = boxes_actions_popover_finalize;
}

static void
boxes_actions_popover_instance_init (BoxesActionsPopover * self,
                                     gpointer klass)
{
	self->priv = boxes_actions_popover_get_instance_private (self);
}

static void
boxes_actions_popover_finalize (GObject * obj)
{
	BoxesActionsPopover * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_ACTIONS_POPOVER, BoxesActionsPopover);
	_g_object_unref0 (self->priv->window);
	_g_object_unref0 (self->priv->action_group);
	G_OBJECT_CLASS (boxes_actions_popover_parent_class)->finalize (obj);
}

static GType
boxes_actions_popover_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BoxesActionsPopoverClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_actions_popover_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesActionsPopover), 0, (GInstanceInitFunc) boxes_actions_popover_instance_init, NULL };
	GType boxes_actions_popover_type_id;
	boxes_actions_popover_type_id = g_type_register_static (gtk_popover_get_type (), "BoxesActionsPopover", &g_define_type_info, 0);
	BoxesActionsPopover_private_offset = g_type_add_instance_private (boxes_actions_popover_type_id, sizeof (BoxesActionsPopoverPrivate));
	return boxes_actions_popover_type_id;
}

GType
boxes_actions_popover_get_type (void)
{
	static volatile gsize boxes_actions_popover_type_id__once = 0;
	if (g_once_init_enter (&boxes_actions_popover_type_id__once)) {
		GType boxes_actions_popover_type_id;
		boxes_actions_popover_type_id = boxes_actions_popover_get_type_once ();
		g_once_init_leave (&boxes_actions_popover_type_id__once, boxes_actions_popover_type_id);
	}
	return boxes_actions_popover_type_id__once;
}

