/* libvirt-cloned-media.c generated by valac 0.36.1.38-6532, the Vala compiler
 * generated from libvirt-cloned-media.vala, do not modify */

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

#include <glib.h>
#include <glib-object.h>
#include <libvirt-gconfig/libvirt-gconfig.h>
#include <gio/gio.h>
#include <libcommon.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include <osinfo/osinfo.h>


#define BOXES_TYPE_INSTALLER_MEDIA (boxes_installer_media_get_type ())
#define BOXES_INSTALLER_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_INSTALLER_MEDIA, BoxesInstallerMedia))
#define BOXES_INSTALLER_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_INSTALLER_MEDIA, BoxesInstallerMediaClass))
#define BOXES_IS_INSTALLER_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_INSTALLER_MEDIA))
#define BOXES_IS_INSTALLER_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_INSTALLER_MEDIA))
#define BOXES_INSTALLER_MEDIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_INSTALLER_MEDIA, BoxesInstallerMediaClass))

typedef struct _BoxesInstallerMedia BoxesInstallerMedia;
typedef struct _BoxesInstallerMediaClass BoxesInstallerMediaClass;
typedef struct _BoxesInstallerMediaPrivate BoxesInstallerMediaPrivate;

#define BOXES_TYPE_VM_CREATOR (boxes_vm_creator_get_type ())
#define BOXES_VM_CREATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_VM_CREATOR, BoxesVMCreator))
#define BOXES_VM_CREATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_VM_CREATOR, BoxesVMCreatorClass))
#define BOXES_IS_VM_CREATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_VM_CREATOR))
#define BOXES_IS_VM_CREATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_VM_CREATOR))
#define BOXES_VM_CREATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_VM_CREATOR, BoxesVMCreatorClass))

typedef struct _BoxesVMCreator BoxesVMCreator;
typedef struct _BoxesVMCreatorClass BoxesVMCreatorClass;

#define BOXES_TYPE_INSTALLED_MEDIA (boxes_installed_media_get_type ())
#define BOXES_INSTALLED_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_INSTALLED_MEDIA, BoxesInstalledMedia))
#define BOXES_INSTALLED_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_INSTALLED_MEDIA, BoxesInstalledMediaClass))
#define BOXES_IS_INSTALLED_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_INSTALLED_MEDIA))
#define BOXES_IS_INSTALLED_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_INSTALLED_MEDIA))
#define BOXES_INSTALLED_MEDIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_INSTALLED_MEDIA, BoxesInstalledMediaClass))

typedef struct _BoxesInstalledMedia BoxesInstalledMedia;
typedef struct _BoxesInstalledMediaClass BoxesInstalledMediaClass;
typedef struct _BoxesInstalledMediaPrivate BoxesInstalledMediaPrivate;

#define BOXES_TYPE_LIBVIRT_MEDIA (boxes_libvirt_media_get_type ())
#define BOXES_LIBVIRT_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_LIBVIRT_MEDIA, BoxesLibvirtMedia))
#define BOXES_LIBVIRT_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_LIBVIRT_MEDIA, BoxesLibvirtMediaClass))
#define BOXES_IS_LIBVIRT_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_LIBVIRT_MEDIA))
#define BOXES_IS_LIBVIRT_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_LIBVIRT_MEDIA))
#define BOXES_LIBVIRT_MEDIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_LIBVIRT_MEDIA, BoxesLibvirtMediaClass))

typedef struct _BoxesLibvirtMedia BoxesLibvirtMedia;
typedef struct _BoxesLibvirtMediaClass BoxesLibvirtMediaClass;
typedef struct _BoxesLibvirtMediaPrivate BoxesLibvirtMediaPrivate;

#define BOXES_TYPE_LIBVIRT_CLONED_MEDIA (boxes_libvirt_cloned_media_get_type ())
#define BOXES_LIBVIRT_CLONED_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_LIBVIRT_CLONED_MEDIA, BoxesLibvirtClonedMedia))
#define BOXES_LIBVIRT_CLONED_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_LIBVIRT_CLONED_MEDIA, BoxesLibvirtClonedMediaClass))
#define BOXES_IS_LIBVIRT_CLONED_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_LIBVIRT_CLONED_MEDIA))
#define BOXES_IS_LIBVIRT_CLONED_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_LIBVIRT_CLONED_MEDIA))
#define BOXES_LIBVIRT_CLONED_MEDIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_LIBVIRT_CLONED_MEDIA, BoxesLibvirtClonedMediaClass))

typedef struct _BoxesLibvirtClonedMedia BoxesLibvirtClonedMedia;
typedef struct _BoxesLibvirtClonedMediaClass BoxesLibvirtClonedMediaClass;
typedef struct _BoxesLibvirtClonedMediaPrivate BoxesLibvirtClonedMediaPrivate;
enum  {
	BOXES_LIBVIRT_CLONED_MEDIA_DUMMY_PROPERTY,
	BOXES_LIBVIRT_CLONED_MEDIA_LAST_PROPERTY
};
static GParamSpec* boxes_libvirt_cloned_media_properties[BOXES_LIBVIRT_CLONED_MEDIA_LAST_PROPERTY];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define BOXES_TYPE_VM_IMPORTER (boxes_vm_importer_get_type ())
#define BOXES_VM_IMPORTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_VM_IMPORTER, BoxesVMImporter))
#define BOXES_VM_IMPORTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_VM_IMPORTER, BoxesVMImporterClass))
#define BOXES_IS_VM_IMPORTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_VM_IMPORTER))
#define BOXES_IS_VM_IMPORTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_VM_IMPORTER))
#define BOXES_VM_IMPORTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_VM_IMPORTER, BoxesVMImporterClass))

typedef struct _BoxesVMImporter BoxesVMImporter;
typedef struct _BoxesVMImporterClass BoxesVMImporterClass;

#define BOXES_TYPE_LIBVIRT_VM_IMPORTER (boxes_libvirt_vm_importer_get_type ())
#define BOXES_LIBVIRT_VM_IMPORTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_LIBVIRT_VM_IMPORTER, BoxesLibvirtVMImporter))
#define BOXES_LIBVIRT_VM_IMPORTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_LIBVIRT_VM_IMPORTER, BoxesLibvirtVMImporterClass))
#define BOXES_IS_LIBVIRT_VM_IMPORTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_LIBVIRT_VM_IMPORTER))
#define BOXES_IS_LIBVIRT_VM_IMPORTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_LIBVIRT_VM_IMPORTER))
#define BOXES_LIBVIRT_VM_IMPORTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_LIBVIRT_VM_IMPORTER, BoxesLibvirtVMImporterClass))

typedef struct _BoxesLibvirtVMImporter BoxesLibvirtVMImporter;
typedef struct _BoxesLibvirtVMImporterClass BoxesLibvirtVMImporterClass;

#define BOXES_TYPE_LIBVIRT_VM_CLONER (boxes_libvirt_vm_cloner_get_type ())
#define BOXES_LIBVIRT_VM_CLONER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_LIBVIRT_VM_CLONER, BoxesLibvirtVMCloner))
#define BOXES_LIBVIRT_VM_CLONER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_LIBVIRT_VM_CLONER, BoxesLibvirtVMClonerClass))
#define BOXES_IS_LIBVIRT_VM_CLONER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_LIBVIRT_VM_CLONER))
#define BOXES_IS_LIBVIRT_VM_CLONER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_LIBVIRT_VM_CLONER))
#define BOXES_LIBVIRT_VM_CLONER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_LIBVIRT_VM_CLONER, BoxesLibvirtVMClonerClass))

typedef struct _BoxesLibvirtVMCloner BoxesLibvirtVMCloner;
typedef struct _BoxesLibvirtVMClonerClass BoxesLibvirtVMClonerClass;

struct _BoxesInstallerMedia {
	GObject parent_instance;
	BoxesInstallerMediaPrivate * priv;
	OsinfoOs* os;
	OsinfoResources* resources;
	OsinfoMedia* os_media;
	gchar* label;
	gchar* device_file;
	gchar* mount_point;
	gboolean from_image;
};

struct _BoxesInstallerMediaClass {
	GObjectClass parent_class;
	void (*set_direct_boot_params) (BoxesInstallerMedia* self, GVirConfigDomainOs* os);
	void (*prepare) (BoxesInstallerMedia* self, BoxesActivityProgress* progress, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
	gboolean (*prepare_finish) (BoxesInstallerMedia* self, GAsyncResult* _res_);
	void (*prepare_for_installation) (BoxesInstallerMedia* self, const gchar* vm_name, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*prepare_for_installation_finish) (BoxesInstallerMedia* self, GAsyncResult* _res_);
	void (*prepare_to_continue_installation) (BoxesInstallerMedia* self, const gchar* vm_name);
	void (*clean_up) (BoxesInstallerMedia* self);
	void (*clean_up_preparation_cache) (BoxesInstallerMedia* self);
	void (*setup_domain_config) (BoxesInstallerMedia* self, GVirConfigDomain* domain);
	void (*setup_post_install_domain_config) (BoxesInstallerMedia* self, GVirConfigDomain* domain);
	void (*populate_setup_box) (BoxesInstallerMedia* self, GtkBox* setup_box);
	GList* (*get_vm_properties) (BoxesInstallerMedia* self);
	BoxesVMCreator* (*get_vm_creator) (BoxesInstallerMedia* self);
	OsinfoDeviceList* (*get_supported_devices) (BoxesInstallerMedia* self);
	guint64 (*get_installed_size) (BoxesInstallerMedia* self);
	gboolean (*get_need_user_input_for_vm_creation) (BoxesInstallerMedia* self);
	gboolean (*get_ready_to_create) (BoxesInstallerMedia* self);
	gboolean (*get_live) (BoxesInstallerMedia* self);
	gchar* (*get_architecture) (BoxesInstallerMedia* self);
};

struct _BoxesInstalledMedia {
	BoxesInstallerMedia parent_instance;
	BoxesInstalledMediaPrivate * priv;
};

struct _BoxesInstalledMediaClass {
	BoxesInstallerMediaClass parent_class;
};

struct _BoxesLibvirtMedia {
	BoxesInstalledMedia parent_instance;
	BoxesLibvirtMediaPrivate * priv;
};

struct _BoxesLibvirtMediaClass {
	BoxesInstalledMediaClass parent_class;
};

struct _BoxesLibvirtClonedMedia {
	BoxesLibvirtMedia parent_instance;
	BoxesLibvirtClonedMediaPrivate * priv;
};

struct _BoxesLibvirtClonedMediaClass {
	BoxesLibvirtMediaClass parent_class;
};


static gpointer boxes_libvirt_cloned_media_parent_class = NULL;

GType boxes_installer_media_get_type (void) G_GNUC_CONST;
gpointer boxes_vm_creator_ref (gpointer instance);
void boxes_vm_creator_unref (gpointer instance);
GParamSpec* boxes_param_spec_vm_creator (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void boxes_value_set_vm_creator (GValue* value, gpointer v_object);
void boxes_value_take_vm_creator (GValue* value, gpointer v_object);
gpointer boxes_value_get_vm_creator (const GValue* value);
GType boxes_vm_creator_get_type (void) G_GNUC_CONST;
GType boxes_installed_media_get_type (void) G_GNUC_CONST;
GType boxes_libvirt_media_get_type (void) G_GNUC_CONST;
GType boxes_libvirt_cloned_media_get_type (void) G_GNUC_CONST;
BoxesLibvirtClonedMedia* boxes_libvirt_cloned_media_new (const gchar* path, GVirConfigDomain* domain_config, GError** error);
BoxesLibvirtClonedMedia* boxes_libvirt_cloned_media_construct (GType object_type, const gchar* path, GVirConfigDomain* domain_config, GError** error);
BoxesLibvirtMedia* boxes_libvirt_media_new (const gchar* path, GVirConfigDomain* domain_config, gboolean known_qcow2, GError** error);
BoxesLibvirtMedia* boxes_libvirt_media_construct (GType object_type, const gchar* path, GVirConfigDomain* domain_config, gboolean known_qcow2, GError** error);
static BoxesVMCreator* boxes_libvirt_cloned_media_real_get_vm_creator (BoxesInstallerMedia* base);
BoxesLibvirtVMCloner* boxes_libvirt_vm_cloner_new (BoxesInstalledMedia* source_media);
BoxesLibvirtVMCloner* boxes_libvirt_vm_cloner_construct (GType object_type, BoxesInstalledMedia* source_media);
GType boxes_vm_importer_get_type (void) G_GNUC_CONST;
GType boxes_libvirt_vm_importer_get_type (void) G_GNUC_CONST;
GType boxes_libvirt_vm_cloner_get_type (void) G_GNUC_CONST;


BoxesLibvirtClonedMedia* boxes_libvirt_cloned_media_construct (GType object_type, const gchar* path, GVirConfigDomain* domain_config, GError** error) {
	BoxesLibvirtClonedMedia * self = NULL;
	const gchar* _tmp0_;
	GVirConfigDomain* _tmp1_;
	GError * _inner_error_ = NULL;
#line 4 "/home/fborges/checkout/gnome-boxes/src/libvirt-cloned-media.vala"
	g_return_val_if_fail (path != NULL, NULL);
#line 4 "/home/fborges/checkout/gnome-boxes/src/libvirt-cloned-media.vala"
	g_return_val_if_fail (domain_config != NULL, NULL);
#line 5 "/home/fborges/checkout/gnome-boxes/src/libvirt-cloned-media.vala"
	_tmp0_ = path;
#line 5 "/home/fborges/checkout/gnome-boxes/src/libvirt-cloned-media.vala"
	_tmp1_ = domain_config;
#line 5 "/home/fborges/checkout/gnome-boxes/src/libvirt-cloned-media.vala"
	self = (BoxesLibvirtClonedMedia*) boxes_libvirt_media_construct (object_type, _tmp0_, _tmp1_, TRUE, &_inner_error_);
#line 5 "/home/fborges/checkout/gnome-boxes/src/libvirt-cloned-media.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 5 "/home/fborges/checkout/gnome-boxes/src/libvirt-cloned-media.vala"
		g_propagate_error (error, _inner_error_);
#line 5 "/home/fborges/checkout/gnome-boxes/src/libvirt-cloned-media.vala"
		_g_object_unref0 (self);
#line 5 "/home/fborges/checkout/gnome-boxes/src/libvirt-cloned-media.vala"
		return NULL;
#line 219 "libvirt-cloned-media.c"
	}
#line 4 "/home/fborges/checkout/gnome-boxes/src/libvirt-cloned-media.vala"
	return self;
#line 223 "libvirt-cloned-media.c"
}


BoxesLibvirtClonedMedia* boxes_libvirt_cloned_media_new (const gchar* path, GVirConfigDomain* domain_config, GError** error) {
#line 4 "/home/fborges/checkout/gnome-boxes/src/libvirt-cloned-media.vala"
	return boxes_libvirt_cloned_media_construct (BOXES_TYPE_LIBVIRT_CLONED_MEDIA, path, domain_config, error);
#line 230 "libvirt-cloned-media.c"
}


static BoxesVMCreator* boxes_libvirt_cloned_media_real_get_vm_creator (BoxesInstallerMedia* base) {
	BoxesLibvirtClonedMedia * self;
	BoxesVMCreator* result = NULL;
	BoxesLibvirtVMCloner* _tmp0_;
#line 8 "/home/fborges/checkout/gnome-boxes/src/libvirt-cloned-media.vala"
	self = (BoxesLibvirtClonedMedia*) base;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-cloned-media.vala"
	_tmp0_ = boxes_libvirt_vm_cloner_new ((BoxesInstalledMedia*) self);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-cloned-media.vala"
	result = (BoxesVMCreator*) _tmp0_;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-cloned-media.vala"
	return result;
#line 246 "libvirt-cloned-media.c"
}


static void boxes_libvirt_cloned_media_class_init (BoxesLibvirtClonedMediaClass * klass) {
#line 3 "/home/fborges/checkout/gnome-boxes/src/libvirt-cloned-media.vala"
	boxes_libvirt_cloned_media_parent_class = g_type_class_peek_parent (klass);
#line 3 "/home/fborges/checkout/gnome-boxes/src/libvirt-cloned-media.vala"
	((BoxesInstallerMediaClass *) klass)->get_vm_creator = (BoxesVMCreator* (*) (BoxesInstallerMedia *)) boxes_libvirt_cloned_media_real_get_vm_creator;
#line 255 "libvirt-cloned-media.c"
}


static void boxes_libvirt_cloned_media_instance_init (BoxesLibvirtClonedMedia * self) {
}


GType boxes_libvirt_cloned_media_get_type (void) {
	static volatile gsize boxes_libvirt_cloned_media_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_libvirt_cloned_media_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BoxesLibvirtClonedMediaClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_libvirt_cloned_media_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesLibvirtClonedMedia), 0, (GInstanceInitFunc) boxes_libvirt_cloned_media_instance_init, NULL };
		GType boxes_libvirt_cloned_media_type_id;
		boxes_libvirt_cloned_media_type_id = g_type_register_static (BOXES_TYPE_LIBVIRT_MEDIA, "BoxesLibvirtClonedMedia", &g_define_type_info, 0);
		g_once_init_leave (&boxes_libvirt_cloned_media_type_id__volatile, boxes_libvirt_cloned_media_type_id);
	}
	return boxes_libvirt_cloned_media_type_id__volatile;
}



