/* release.c generated by valac 0.56.19, the Vala compiler
 * generated from release.vala, do not modify */

#include <glib-object.h>
#include <gio/gio.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <math.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 PROTON_PLUS_MODELS_TYPE_BASE_RELEASE (proton_plus_models_base_release_get_type ())
#define PROTON_PLUS_MODELS_BASE_RELEASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_MODELS_TYPE_BASE_RELEASE, ProtonPlusModelsBaseRelease))
#define PROTON_PLUS_MODELS_BASE_RELEASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_MODELS_TYPE_BASE_RELEASE, ProtonPlusModelsBaseReleaseClass))
#define PROTON_PLUS_MODELS_IS_BASE_RELEASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_MODELS_TYPE_BASE_RELEASE))
#define PROTON_PLUS_MODELS_IS_BASE_RELEASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_MODELS_TYPE_BASE_RELEASE))
#define PROTON_PLUS_MODELS_BASE_RELEASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_MODELS_TYPE_BASE_RELEASE, ProtonPlusModelsBaseReleaseClass))

typedef struct _ProtonPlusModelsBaseRelease ProtonPlusModelsBaseRelease;
typedef struct _ProtonPlusModelsBaseReleaseClass ProtonPlusModelsBaseReleaseClass;
typedef struct _ProtonPlusModelsBaseReleasePrivate ProtonPlusModelsBaseReleasePrivate;

#define PROTON_PLUS_MODELS_TYPE_PARAMETERS (proton_plus_models_parameters_get_type ())
#define PROTON_PLUS_MODELS_PARAMETERS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_MODELS_TYPE_PARAMETERS, ProtonPlusModelsParameters))
#define PROTON_PLUS_MODELS_PARAMETERS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_MODELS_TYPE_PARAMETERS, ProtonPlusModelsParametersClass))
#define PROTON_PLUS_MODELS_IS_PARAMETERS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_MODELS_TYPE_PARAMETERS))
#define PROTON_PLUS_MODELS_IS_PARAMETERS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_MODELS_TYPE_PARAMETERS))
#define PROTON_PLUS_MODELS_PARAMETERS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_MODELS_TYPE_PARAMETERS, ProtonPlusModelsParametersClass))

typedef struct _ProtonPlusModelsParameters ProtonPlusModelsParameters;
typedef struct _ProtonPlusModelsParametersClass ProtonPlusModelsParametersClass;

#define PROTON_PLUS_MODELS_TYPE_RUNNER (proton_plus_models_runner_get_type ())
#define PROTON_PLUS_MODELS_RUNNER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_MODELS_TYPE_RUNNER, ProtonPlusModelsRunner))
#define PROTON_PLUS_MODELS_RUNNER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_MODELS_TYPE_RUNNER, ProtonPlusModelsRunnerClass))
#define PROTON_PLUS_MODELS_IS_RUNNER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_MODELS_TYPE_RUNNER))
#define PROTON_PLUS_MODELS_IS_RUNNER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_MODELS_TYPE_RUNNER))
#define PROTON_PLUS_MODELS_RUNNER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_MODELS_TYPE_RUNNER, ProtonPlusModelsRunnerClass))

typedef struct _ProtonPlusModelsRunner ProtonPlusModelsRunner;
typedef struct _ProtonPlusModelsRunnerClass ProtonPlusModelsRunnerClass;
typedef enum  {
	PROTON_PLUS_MODELS_BASE_RELEASE_STATE_NOT_INSTALLED,
	PROTON_PLUS_MODELS_BASE_RELEASE_STATE_UPDATE_AVAILABLE,
	PROTON_PLUS_MODELS_BASE_RELEASE_STATE_UP_TO_DATE,
	PROTON_PLUS_MODELS_BASE_RELEASE_STATE_BUSY_INSTALLING,
	PROTON_PLUS_MODELS_BASE_RELEASE_STATE_BUSY_REMOVING,
	PROTON_PLUS_MODELS_BASE_RELEASE_STATE_BUSY_UPDATING
} ProtonPlusModelsBaseReleaseState;

#define PROTON_PLUS_MODELS_BASE_RELEASE_TYPE_STATE (proton_plus_models_base_release_state_get_type ())
typedef enum  {
	PROTON_PLUS_MODELS_BASE_RELEASE_STEP_NOTHING,
	PROTON_PLUS_MODELS_BASE_RELEASE_STEP_DOWNLOADING,
	PROTON_PLUS_MODELS_BASE_RELEASE_STEP_EXTRACTING,
	PROTON_PLUS_MODELS_BASE_RELEASE_STEP_MOVING,
	PROTON_PLUS_MODELS_BASE_RELEASE_STEP_REMOVING
} ProtonPlusModelsBaseReleaseStep;

#define PROTON_PLUS_MODELS_BASE_RELEASE_TYPE_STEP (proton_plus_models_base_release_step_get_type ())
enum  {
	PROTON_PLUS_MODELS_BASE_RELEASE_0_PROPERTY,
	PROTON_PLUS_MODELS_BASE_RELEASE_RUNNER_PROPERTY,
	PROTON_PLUS_MODELS_BASE_RELEASE_TITLE_PROPERTY,
	PROTON_PLUS_MODELS_BASE_RELEASE_DISPLAYED_TITLE_PROPERTY,
	PROTON_PLUS_MODELS_BASE_RELEASE_DESCRIPTION_PROPERTY,
	PROTON_PLUS_MODELS_BASE_RELEASE_RELEASE_DATE_PROPERTY,
	PROTON_PLUS_MODELS_BASE_RELEASE_DOWNLOAD_URL_PROPERTY,
	PROTON_PLUS_MODELS_BASE_RELEASE_PAGE_URL_PROPERTY,
	PROTON_PLUS_MODELS_BASE_RELEASE_CANCELED_PROPERTY,
	PROTON_PLUS_MODELS_BASE_RELEASE_PROGRESS_PROPERTY,
	PROTON_PLUS_MODELS_BASE_RELEASE_SPEED_KBPS_PROPERTY,
	PROTON_PLUS_MODELS_BASE_RELEASE_IS_PERCENT_PROPERTY,
	PROTON_PLUS_MODELS_BASE_RELEASE_IS_FINISHED_PROPERTY,
	PROTON_PLUS_MODELS_BASE_RELEASE_INSTALL_SUCCESS_PROPERTY,
	PROTON_PLUS_MODELS_BASE_RELEASE_ERROR_MESSAGE_PROPERTY,
	PROTON_PLUS_MODELS_BASE_RELEASE_STATE_PROPERTY,
	PROTON_PLUS_MODELS_BASE_RELEASE_STEP_PROPERTY,
	PROTON_PLUS_MODELS_BASE_RELEASE_NUM_PROPERTIES
};
static GParamSpec* proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define PROTON_PLUS_MODELS_TYPE_DOWNLOAD_MANAGER (proton_plus_models_download_manager_get_type ())
#define PROTON_PLUS_MODELS_DOWNLOAD_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_MODELS_TYPE_DOWNLOAD_MANAGER, ProtonPlusModelsDownloadManager))
#define PROTON_PLUS_MODELS_DOWNLOAD_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_MODELS_TYPE_DOWNLOAD_MANAGER, ProtonPlusModelsDownloadManagerClass))
#define PROTON_PLUS_MODELS_IS_DOWNLOAD_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_MODELS_TYPE_DOWNLOAD_MANAGER))
#define PROTON_PLUS_MODELS_IS_DOWNLOAD_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_MODELS_TYPE_DOWNLOAD_MANAGER))
#define PROTON_PLUS_MODELS_DOWNLOAD_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_MODELS_TYPE_DOWNLOAD_MANAGER, ProtonPlusModelsDownloadManagerClass))

typedef struct _ProtonPlusModelsDownloadManager ProtonPlusModelsDownloadManager;
typedef struct _ProtonPlusModelsDownloadManagerClass ProtonPlusModelsDownloadManagerClass;

#define PROTON_PLUS_MODELS_TYPE_RELEASE (proton_plus_models_release_get_type ())
#define PROTON_PLUS_MODELS_RELEASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_MODELS_TYPE_RELEASE, ProtonPlusModelsRelease))
#define PROTON_PLUS_MODELS_RELEASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_MODELS_TYPE_RELEASE, ProtonPlusModelsReleaseClass))
#define PROTON_PLUS_MODELS_IS_RELEASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_MODELS_TYPE_RELEASE))
#define PROTON_PLUS_MODELS_IS_RELEASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_MODELS_TYPE_RELEASE))
#define PROTON_PLUS_MODELS_RELEASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_MODELS_TYPE_RELEASE, ProtonPlusModelsReleaseClass))

typedef struct _ProtonPlusModelsRelease ProtonPlusModelsRelease;
typedef struct _ProtonPlusModelsReleaseClass ProtonPlusModelsReleaseClass;
typedef struct _ProtonPlusModelsReleasePrivate ProtonPlusModelsReleasePrivate;
enum  {
	PROTON_PLUS_MODELS_RELEASE_0_PROPERTY,
	PROTON_PLUS_MODELS_RELEASE_R_TYPE,
	PROTON_PLUS_MODELS_RELEASE_R_DUP_FUNC,
	PROTON_PLUS_MODELS_RELEASE_R_DESTROY_FUNC,
	PROTON_PLUS_MODELS_RELEASE_NUM_PROPERTIES
};
static GParamSpec* proton_plus_models_release_properties[PROTON_PLUS_MODELS_RELEASE_NUM_PROPERTIES];
typedef struct _ProtonPlusModelsReleaseInstallData ProtonPlusModelsReleaseInstallData;
typedef struct _ProtonPlusModelsReleaseRemoveData ProtonPlusModelsReleaseRemoveData;

struct _ProtonPlusModelsBaseRelease {
	GObject parent_instance;
	ProtonPlusModelsBaseReleasePrivate * priv;
};

struct _ProtonPlusModelsBaseReleaseClass {
	GObjectClass parent_class;
	void (*install) (ProtonPlusModelsBaseRelease* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	gboolean (*install_finish) (ProtonPlusModelsBaseRelease* self, GAsyncResult* _res_);
	void (*_start_install) (ProtonPlusModelsBaseRelease* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	gboolean (*_start_install_finish) (ProtonPlusModelsBaseRelease* self, GAsyncResult* _res_);
	void (*remove) (ProtonPlusModelsBaseRelease* self, ProtonPlusModelsParameters* parameters, GAsyncReadyCallback _callback_, gpointer _user_data_);
	gboolean (*remove_finish) (ProtonPlusModelsBaseRelease* self, GAsyncResult* _res_);
	void (*refresh_state) (ProtonPlusModelsBaseRelease* self);
};

struct _ProtonPlusModelsBaseReleasePrivate {
	ProtonPlusModelsRunner* _runner;
	gchar* _title;
	gchar* _displayed_title;
	gchar* _description;
	gchar* _release_date;
	gchar* _download_url;
	gchar* _page_url;
	gboolean _canceled;
	gchar* _progress;
	gdouble _speed_kbps;
	gdouble* _seconds_remaining;
	gboolean _is_percent;
	gboolean _is_finished;
	gboolean _install_success;
	gchar* _error_message;
	ProtonPlusModelsBaseReleaseState _state;
	ProtonPlusModelsBaseReleaseStep _step;
};

struct _ProtonPlusModelsRelease {
	ProtonPlusModelsBaseRelease parent_instance;
	ProtonPlusModelsReleasePrivate * priv;
};

struct _ProtonPlusModelsReleaseClass {
	ProtonPlusModelsBaseReleaseClass parent_class;
	void (*_start_remove) (ProtonPlusModelsRelease* self, gconstpointer parameters, GAsyncReadyCallback _callback_, gpointer _user_data_);
	gboolean (*_start_remove_finish) (ProtonPlusModelsRelease* self, GAsyncResult* _res_);
};

struct _ProtonPlusModelsReleasePrivate {
	GType r_type;
	GBoxedCopyFunc r_dup_func;
	GDestroyNotify r_destroy_func;
};

struct _ProtonPlusModelsReleaseInstallData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusModelsRelease* self;
	gboolean result;
	gboolean _tmp0_;
	ProtonPlusModelsBaseReleaseState _tmp1_;
	ProtonPlusModelsBaseReleaseState _tmp2_;
	ProtonPlusModelsDownloadManager* _tmp3_;
	ProtonPlusModelsDownloadManager* _tmp4_;
	gboolean busy_updating;
	ProtonPlusModelsBaseReleaseState _tmp5_;
	ProtonPlusModelsBaseReleaseState _tmp6_;
	ProtonPlusModelsDownloadManager* _tmp7_;
	ProtonPlusModelsDownloadManager* _tmp8_;
	gboolean success;
	ProtonPlusModelsDownloadManager* _tmp9_;
	ProtonPlusModelsDownloadManager* _tmp10_;
	ProtonPlusModelsDownloadManager* _tmp11_;
	ProtonPlusModelsDownloadManager* _tmp12_;
	ProtonPlusModelsParameters* _tmp13_;
	ProtonPlusModelsParameters* _tmp14_;
};

struct _ProtonPlusModelsReleaseRemoveData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusModelsRelease* self;
	ProtonPlusModelsParameters* parameters;
	gboolean result;
	gboolean _tmp0_;
	ProtonPlusModelsBaseReleaseState _tmp1_;
	ProtonPlusModelsBaseReleaseState _tmp2_;
	ProtonPlusModelsBaseReleaseState _tmp3_;
	ProtonPlusModelsBaseReleaseState _tmp4_;
	gboolean busy_updating_or_installing;
	gboolean remove_success;
};

static gint ProtonPlusModelsBaseRelease_private_offset;
static gpointer proton_plus_models_base_release_parent_class = NULL;
static gint ProtonPlusModelsRelease_private_offset;
static gpointer proton_plus_models_release_parent_class = NULL;

VALA_EXTERN GType proton_plus_models_base_release_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusModelsBaseRelease, g_object_unref)
VALA_EXTERN GType proton_plus_models_parameters_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusModelsParameters, g_object_unref)
VALA_EXTERN GType proton_plus_models_runner_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusModelsRunner, g_object_unref)
VALA_EXTERN GType proton_plus_models_base_release_state_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType proton_plus_models_base_release_step_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void proton_plus_models_base_release_refresh_state (ProtonPlusModelsBaseRelease* self);
VALA_EXTERN void proton_plus_models_base_release_install (ProtonPlusModelsBaseRelease* self,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_);
VALA_EXTERN gboolean proton_plus_models_base_release_install_finish (ProtonPlusModelsBaseRelease* self,
                                                         GAsyncResult* _res_);
VALA_EXTERN void _proton_plus_models_base_release_start_install (ProtonPlusModelsBaseRelease* self,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_);
VALA_EXTERN gboolean _proton_plus_models_base_release_start_install_finish (ProtonPlusModelsBaseRelease* self,
                                                                GAsyncResult* _res_);
VALA_EXTERN void proton_plus_models_base_release_remove (ProtonPlusModelsBaseRelease* self,
                                             ProtonPlusModelsParameters* parameters,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
VALA_EXTERN gboolean proton_plus_models_base_release_remove_finish (ProtonPlusModelsBaseRelease* self,
                                                        GAsyncResult* _res_);
static void proton_plus_models_base_release_real_refresh_state (ProtonPlusModelsBaseRelease* self);
VALA_EXTERN ProtonPlusModelsBaseRelease* proton_plus_models_base_release_construct (GType object_type);
VALA_EXTERN ProtonPlusModelsRunner* proton_plus_models_base_release_get_runner (ProtonPlusModelsBaseRelease* self);
VALA_EXTERN void proton_plus_models_base_release_set_runner (ProtonPlusModelsBaseRelease* self,
                                                 ProtonPlusModelsRunner* value);
VALA_EXTERN const gchar* proton_plus_models_base_release_get_title (ProtonPlusModelsBaseRelease* self);
VALA_EXTERN void proton_plus_models_base_release_set_title (ProtonPlusModelsBaseRelease* self,
                                                const gchar* value);
VALA_EXTERN const gchar* proton_plus_models_base_release_get_displayed_title (ProtonPlusModelsBaseRelease* self);
VALA_EXTERN void proton_plus_models_base_release_set_displayed_title (ProtonPlusModelsBaseRelease* self,
                                                          const gchar* value);
VALA_EXTERN const gchar* proton_plus_models_base_release_get_description (ProtonPlusModelsBaseRelease* self);
VALA_EXTERN void proton_plus_models_base_release_set_description (ProtonPlusModelsBaseRelease* self,
                                                      const gchar* value);
VALA_EXTERN const gchar* proton_plus_models_base_release_get_release_date (ProtonPlusModelsBaseRelease* self);
VALA_EXTERN void proton_plus_models_base_release_set_release_date (ProtonPlusModelsBaseRelease* self,
                                                       const gchar* value);
VALA_EXTERN const gchar* proton_plus_models_base_release_get_download_url (ProtonPlusModelsBaseRelease* self);
VALA_EXTERN void proton_plus_models_base_release_set_download_url (ProtonPlusModelsBaseRelease* self,
                                                       const gchar* value);
VALA_EXTERN const gchar* proton_plus_models_base_release_get_page_url (ProtonPlusModelsBaseRelease* self);
VALA_EXTERN void proton_plus_models_base_release_set_page_url (ProtonPlusModelsBaseRelease* self,
                                                   const gchar* value);
VALA_EXTERN gboolean proton_plus_models_base_release_get_canceled (ProtonPlusModelsBaseRelease* self);
VALA_EXTERN void proton_plus_models_base_release_set_canceled (ProtonPlusModelsBaseRelease* self,
                                                   gboolean value);
VALA_EXTERN const gchar* proton_plus_models_base_release_get_progress (ProtonPlusModelsBaseRelease* self);
VALA_EXTERN void proton_plus_models_base_release_set_progress (ProtonPlusModelsBaseRelease* self,
                                                   const gchar* value);
VALA_EXTERN gdouble proton_plus_models_base_release_get_speed_kbps (ProtonPlusModelsBaseRelease* self);
VALA_EXTERN void proton_plus_models_base_release_set_speed_kbps (ProtonPlusModelsBaseRelease* self,
                                                     gdouble value);
VALA_EXTERN gdouble* proton_plus_models_base_release_get_seconds_remaining (ProtonPlusModelsBaseRelease* self);
VALA_EXTERN void proton_plus_models_base_release_set_seconds_remaining (ProtonPlusModelsBaseRelease* self,
                                                            gdouble* value);
static gdouble* _double_dup (gdouble* self);
VALA_EXTERN gboolean proton_plus_models_base_release_get_is_percent (ProtonPlusModelsBaseRelease* self);
VALA_EXTERN void proton_plus_models_base_release_set_is_percent (ProtonPlusModelsBaseRelease* self,
                                                     gboolean value);
VALA_EXTERN gboolean proton_plus_models_base_release_get_is_finished (ProtonPlusModelsBaseRelease* self);
VALA_EXTERN void proton_plus_models_base_release_set_is_finished (ProtonPlusModelsBaseRelease* self,
                                                      gboolean value);
VALA_EXTERN gboolean proton_plus_models_base_release_get_install_success (ProtonPlusModelsBaseRelease* self);
VALA_EXTERN void proton_plus_models_base_release_set_install_success (ProtonPlusModelsBaseRelease* self,
                                                          gboolean value);
VALA_EXTERN const gchar* proton_plus_models_base_release_get_error_message (ProtonPlusModelsBaseRelease* self);
VALA_EXTERN void proton_plus_models_base_release_set_error_message (ProtonPlusModelsBaseRelease* self,
                                                        const gchar* value);
VALA_EXTERN ProtonPlusModelsBaseReleaseState proton_plus_models_base_release_get_state (ProtonPlusModelsBaseRelease* self);
VALA_EXTERN GType proton_plus_models_download_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusModelsDownloadManager, g_object_unref)
VALA_EXTERN ProtonPlusModelsDownloadManager* proton_plus_models_download_manager_get_instance (void);
VALA_EXTERN ProtonPlusModelsBaseRelease* proton_plus_models_download_manager_get_active_download (ProtonPlusModelsDownloadManager* self,
                                                                                      ProtonPlusModelsBaseRelease* release);
VALA_EXTERN void proton_plus_models_base_release_set_state (ProtonPlusModelsBaseRelease* self,
                                                ProtonPlusModelsBaseReleaseState value);
VALA_EXTERN ProtonPlusModelsBaseReleaseStep proton_plus_models_base_release_get_step (ProtonPlusModelsBaseRelease* self);
VALA_EXTERN void proton_plus_models_base_release_set_step (ProtonPlusModelsBaseRelease* self,
                                               ProtonPlusModelsBaseReleaseStep value);
static void proton_plus_models_base_release_finalize (GObject * obj);
static GType proton_plus_models_base_release_get_type_once (void);
static void _vala_proton_plus_models_base_release_get_property (GObject * object,
                                                         guint property_id,
                                                         GValue * value,
                                                         GParamSpec * pspec);
static void _vala_proton_plus_models_base_release_set_property (GObject * object,
                                                         guint property_id,
                                                         const GValue * value,
                                                         GParamSpec * pspec);
VALA_EXTERN GType proton_plus_models_release_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusModelsRelease, g_object_unref)
static void proton_plus_models_release_real_install_data_free (gpointer _data);
static void proton_plus_models_release_real_install (ProtonPlusModelsBaseRelease* base,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_);
static gboolean proton_plus_models_release_real_install_co (ProtonPlusModelsReleaseInstallData* _data_);
VALA_EXTERN gboolean proton_plus_models_download_manager_is_downloading (ProtonPlusModelsDownloadManager* self,
                                                             ProtonPlusModelsBaseRelease* release);
VALA_EXTERN void proton_plus_models_download_manager_add_download (ProtonPlusModelsDownloadManager* self,
                                                       ProtonPlusModelsBaseRelease* release);
static void proton_plus_models_release_install_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_);
VALA_EXTERN void proton_plus_models_download_manager_remove_download (ProtonPlusModelsDownloadManager* self,
                                                          ProtonPlusModelsBaseRelease* release);
VALA_EXTERN void proton_plus_models_download_manager_add_to_history (ProtonPlusModelsDownloadManager* self,
                                                         ProtonPlusModelsBaseRelease* release,
                                                         gboolean success);
VALA_EXTERN ProtonPlusModelsParameters* proton_plus_models_parameters_new (void);
VALA_EXTERN ProtonPlusModelsParameters* proton_plus_models_parameters_construct (GType object_type);
static void proton_plus_models_release_real_remove_data_free (gpointer _data);
static void proton_plus_models_release_real_remove (ProtonPlusModelsBaseRelease* base,
                                             ProtonPlusModelsParameters* parameters,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
static gboolean proton_plus_models_release_real_remove_co (ProtonPlusModelsReleaseRemoveData* _data_);
VALA_EXTERN void _proton_plus_models_release_start_remove (ProtonPlusModelsRelease* self,
                                               gconstpointer parameters,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_);
VALA_EXTERN gboolean _proton_plus_models_release_start_remove_finish (ProtonPlusModelsRelease* self,
                                                          GAsyncResult* _res_);
static void proton_plus_models_release_remove_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_);
VALA_EXTERN ProtonPlusModelsRelease* proton_plus_models_release_construct (GType object_type,
                                                               GType r_type,
                                                               GBoxedCopyFunc r_dup_func,
                                                               GDestroyNotify r_destroy_func);
static GType proton_plus_models_release_get_type_once (void);
static void _vala_proton_plus_models_release_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec);
static void _vala_proton_plus_models_release_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec);

static inline gpointer
proton_plus_models_base_release_get_instance_private (ProtonPlusModelsBaseRelease* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusModelsBaseRelease_private_offset);
}

static GType
proton_plus_models_base_release_step_get_type_once (void)
{
	static const GEnumValue values[] = {{PROTON_PLUS_MODELS_BASE_RELEASE_STEP_NOTHING, "PROTON_PLUS_MODELS_BASE_RELEASE_STEP_NOTHING", "nothing"}, {PROTON_PLUS_MODELS_BASE_RELEASE_STEP_DOWNLOADING, "PROTON_PLUS_MODELS_BASE_RELEASE_STEP_DOWNLOADING", "downloading"}, {PROTON_PLUS_MODELS_BASE_RELEASE_STEP_EXTRACTING, "PROTON_PLUS_MODELS_BASE_RELEASE_STEP_EXTRACTING", "extracting"}, {PROTON_PLUS_MODELS_BASE_RELEASE_STEP_MOVING, "PROTON_PLUS_MODELS_BASE_RELEASE_STEP_MOVING", "moving"}, {PROTON_PLUS_MODELS_BASE_RELEASE_STEP_REMOVING, "PROTON_PLUS_MODELS_BASE_RELEASE_STEP_REMOVING", "removing"}, {0, NULL, NULL}};
	GType proton_plus_models_base_release_step_type_id;
	proton_plus_models_base_release_step_type_id = g_enum_register_static ("ProtonPlusModelsBaseReleaseStep", values);
	return proton_plus_models_base_release_step_type_id;
}

GType
proton_plus_models_base_release_step_get_type (void)
{
	static volatile gsize proton_plus_models_base_release_step_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_models_base_release_step_type_id__once)) {
		GType proton_plus_models_base_release_step_type_id;
		proton_plus_models_base_release_step_type_id = proton_plus_models_base_release_step_get_type_once ();
		g_once_init_leave (&proton_plus_models_base_release_step_type_id__once, proton_plus_models_base_release_step_type_id);
	}
	return proton_plus_models_base_release_step_type_id__once;
}

static GType
proton_plus_models_base_release_state_get_type_once (void)
{
	static const GEnumValue values[] = {{PROTON_PLUS_MODELS_BASE_RELEASE_STATE_NOT_INSTALLED, "PROTON_PLUS_MODELS_BASE_RELEASE_STATE_NOT_INSTALLED", "not-installed"}, {PROTON_PLUS_MODELS_BASE_RELEASE_STATE_UPDATE_AVAILABLE, "PROTON_PLUS_MODELS_BASE_RELEASE_STATE_UPDATE_AVAILABLE", "update-available"}, {PROTON_PLUS_MODELS_BASE_RELEASE_STATE_UP_TO_DATE, "PROTON_PLUS_MODELS_BASE_RELEASE_STATE_UP_TO_DATE", "up-to-date"}, {PROTON_PLUS_MODELS_BASE_RELEASE_STATE_BUSY_INSTALLING, "PROTON_PLUS_MODELS_BASE_RELEASE_STATE_BUSY_INSTALLING", "busy-installing"}, {PROTON_PLUS_MODELS_BASE_RELEASE_STATE_BUSY_REMOVING, "PROTON_PLUS_MODELS_BASE_RELEASE_STATE_BUSY_REMOVING", "busy-removing"}, {PROTON_PLUS_MODELS_BASE_RELEASE_STATE_BUSY_UPDATING, "PROTON_PLUS_MODELS_BASE_RELEASE_STATE_BUSY_UPDATING", "busy-updating"}, {0, NULL, NULL}};
	GType proton_plus_models_base_release_state_type_id;
	proton_plus_models_base_release_state_type_id = g_enum_register_static ("ProtonPlusModelsBaseReleaseState", values);
	return proton_plus_models_base_release_state_type_id;
}

GType
proton_plus_models_base_release_state_get_type (void)
{
	static volatile gsize proton_plus_models_base_release_state_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_models_base_release_state_type_id__once)) {
		GType proton_plus_models_base_release_state_type_id;
		proton_plus_models_base_release_state_type_id = proton_plus_models_base_release_state_get_type_once ();
		g_once_init_leave (&proton_plus_models_base_release_state_type_id__once, proton_plus_models_base_release_state_type_id);
	}
	return proton_plus_models_base_release_state_type_id__once;
}

void
proton_plus_models_base_release_install (ProtonPlusModelsBaseRelease* self,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_)
{
	ProtonPlusModelsBaseReleaseClass* _klass_;
	_klass_ = PROTON_PLUS_MODELS_BASE_RELEASE_GET_CLASS (self);
	if (_klass_->install) {
		_klass_->install (self, _callback_, _user_data_);
	}
}

gboolean
proton_plus_models_base_release_install_finish (ProtonPlusModelsBaseRelease* self,
                                                GAsyncResult* _res_)
{
	ProtonPlusModelsBaseReleaseClass* _klass_;
	_klass_ = PROTON_PLUS_MODELS_BASE_RELEASE_GET_CLASS (self);
	if (_klass_->install_finish) {
		return _klass_->install_finish (self, _res_);
	}
	return FALSE;
}

void
_proton_plus_models_base_release_start_install (ProtonPlusModelsBaseRelease* self,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_)
{
	ProtonPlusModelsBaseReleaseClass* _klass_;
	_klass_ = PROTON_PLUS_MODELS_BASE_RELEASE_GET_CLASS (self);
	if (_klass_->_start_install) {
		_klass_->_start_install (self, _callback_, _user_data_);
	}
}

gboolean
_proton_plus_models_base_release_start_install_finish (ProtonPlusModelsBaseRelease* self,
                                                       GAsyncResult* _res_)
{
	ProtonPlusModelsBaseReleaseClass* _klass_;
	_klass_ = PROTON_PLUS_MODELS_BASE_RELEASE_GET_CLASS (self);
	if (_klass_->_start_install_finish) {
		return _klass_->_start_install_finish (self, _res_);
	}
	return FALSE;
}

void
proton_plus_models_base_release_remove (ProtonPlusModelsBaseRelease* self,
                                        ProtonPlusModelsParameters* parameters,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	ProtonPlusModelsBaseReleaseClass* _klass_;
	_klass_ = PROTON_PLUS_MODELS_BASE_RELEASE_GET_CLASS (self);
	if (_klass_->remove) {
		_klass_->remove (self, parameters, _callback_, _user_data_);
	}
}

gboolean
proton_plus_models_base_release_remove_finish (ProtonPlusModelsBaseRelease* self,
                                               GAsyncResult* _res_)
{
	ProtonPlusModelsBaseReleaseClass* _klass_;
	_klass_ = PROTON_PLUS_MODELS_BASE_RELEASE_GET_CLASS (self);
	if (_klass_->remove_finish) {
		return _klass_->remove_finish (self, _res_);
	}
	return FALSE;
}

static void
proton_plus_models_base_release_real_refresh_state (ProtonPlusModelsBaseRelease* self)
{
	g_critical ("Type `%s' does not implement abstract method `proton_plus_models_base_release_refresh_state'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}

void
proton_plus_models_base_release_refresh_state (ProtonPlusModelsBaseRelease* self)
{
	ProtonPlusModelsBaseReleaseClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = PROTON_PLUS_MODELS_BASE_RELEASE_GET_CLASS (self);
	if (_klass_->refresh_state) {
		_klass_->refresh_state (self);
	}
}

ProtonPlusModelsBaseRelease*
proton_plus_models_base_release_construct (GType object_type)
{
	ProtonPlusModelsBaseRelease * self = NULL;
	self = (ProtonPlusModelsBaseRelease*) g_object_new (object_type, NULL);
	return self;
}

ProtonPlusModelsRunner*
proton_plus_models_base_release_get_runner (ProtonPlusModelsBaseRelease* self)
{
	ProtonPlusModelsRunner* result;
	ProtonPlusModelsRunner* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_runner;
	result = _tmp0_;
	return result;
}

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

void
proton_plus_models_base_release_set_runner (ProtonPlusModelsBaseRelease* self,
                                            ProtonPlusModelsRunner* value)
{
	ProtonPlusModelsRunner* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_base_release_get_runner (self);
	if (old_value != value) {
		ProtonPlusModelsRunner* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_runner);
		self->priv->_runner = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_RUNNER_PROPERTY]);
	}
}

const gchar*
proton_plus_models_base_release_get_title (ProtonPlusModelsBaseRelease* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_title;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_base_release_set_title (ProtonPlusModelsBaseRelease* self,
                                           const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_base_release_get_title (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_title);
		self->priv->_title = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_TITLE_PROPERTY]);
	}
}

const gchar*
proton_plus_models_base_release_get_displayed_title (ProtonPlusModelsBaseRelease* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_displayed_title;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_base_release_set_displayed_title (ProtonPlusModelsBaseRelease* self,
                                                     const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_base_release_get_displayed_title (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_displayed_title);
		self->priv->_displayed_title = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_DISPLAYED_TITLE_PROPERTY]);
	}
}

const gchar*
proton_plus_models_base_release_get_description (ProtonPlusModelsBaseRelease* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_description;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_base_release_set_description (ProtonPlusModelsBaseRelease* self,
                                                 const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_base_release_get_description (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_description);
		self->priv->_description = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_DESCRIPTION_PROPERTY]);
	}
}

const gchar*
proton_plus_models_base_release_get_release_date (ProtonPlusModelsBaseRelease* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_release_date;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_base_release_set_release_date (ProtonPlusModelsBaseRelease* self,
                                                  const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_base_release_get_release_date (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_release_date);
		self->priv->_release_date = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_RELEASE_DATE_PROPERTY]);
	}
}

const gchar*
proton_plus_models_base_release_get_download_url (ProtonPlusModelsBaseRelease* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_download_url;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_base_release_set_download_url (ProtonPlusModelsBaseRelease* self,
                                                  const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_base_release_get_download_url (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_download_url);
		self->priv->_download_url = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_DOWNLOAD_URL_PROPERTY]);
	}
}

const gchar*
proton_plus_models_base_release_get_page_url (ProtonPlusModelsBaseRelease* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_page_url;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_base_release_set_page_url (ProtonPlusModelsBaseRelease* self,
                                              const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_base_release_get_page_url (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_page_url);
		self->priv->_page_url = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_PAGE_URL_PROPERTY]);
	}
}

gboolean
proton_plus_models_base_release_get_canceled (ProtonPlusModelsBaseRelease* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_canceled;
	return result;
}

void
proton_plus_models_base_release_set_canceled (ProtonPlusModelsBaseRelease* self,
                                              gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_base_release_get_canceled (self);
	if (old_value != value) {
		self->priv->_canceled = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_CANCELED_PROPERTY]);
	}
}

const gchar*
proton_plus_models_base_release_get_progress (ProtonPlusModelsBaseRelease* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_progress;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_base_release_set_progress (ProtonPlusModelsBaseRelease* self,
                                              const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_base_release_get_progress (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_progress);
		self->priv->_progress = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_PROGRESS_PROPERTY]);
	}
}

gdouble
proton_plus_models_base_release_get_speed_kbps (ProtonPlusModelsBaseRelease* self)
{
	gdouble result;
	g_return_val_if_fail (self != NULL, -1.0);
	result = self->priv->_speed_kbps;
	return result;
}

void
proton_plus_models_base_release_set_speed_kbps (ProtonPlusModelsBaseRelease* self,
                                                gdouble value)
{
	gdouble old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_base_release_get_speed_kbps (self);
	if (old_value != value) {
		self->priv->_speed_kbps = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_SPEED_KBPS_PROPERTY]);
	}
}

gdouble*
proton_plus_models_base_release_get_seconds_remaining (ProtonPlusModelsBaseRelease* self)
{
	gdouble* result;
	gdouble* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_seconds_remaining;
	result = _tmp0_;
	return result;
}

static gdouble*
_double_dup (gdouble* self)
{
	gdouble* dup;
	dup = g_new0 (gdouble, 1);
	memcpy (dup, self, sizeof (gdouble));
	return dup;
}

static gpointer
__double_dup0 (gpointer self)
{
	return self ? _double_dup (self) : NULL;
}

void
proton_plus_models_base_release_set_seconds_remaining (ProtonPlusModelsBaseRelease* self,
                                                       gdouble* value)
{
	gdouble* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = __double_dup0 (value);
	_g_free0 (self->priv->_seconds_remaining);
	self->priv->_seconds_remaining = _tmp0_;
}

gboolean
proton_plus_models_base_release_get_is_percent (ProtonPlusModelsBaseRelease* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_percent;
	return result;
}

void
proton_plus_models_base_release_set_is_percent (ProtonPlusModelsBaseRelease* self,
                                                gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_base_release_get_is_percent (self);
	if (old_value != value) {
		self->priv->_is_percent = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_IS_PERCENT_PROPERTY]);
	}
}

gboolean
proton_plus_models_base_release_get_is_finished (ProtonPlusModelsBaseRelease* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_finished;
	return result;
}

void
proton_plus_models_base_release_set_is_finished (ProtonPlusModelsBaseRelease* self,
                                                 gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_base_release_get_is_finished (self);
	if (old_value != value) {
		self->priv->_is_finished = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_IS_FINISHED_PROPERTY]);
	}
}

gboolean
proton_plus_models_base_release_get_install_success (ProtonPlusModelsBaseRelease* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_install_success;
	return result;
}

void
proton_plus_models_base_release_set_install_success (ProtonPlusModelsBaseRelease* self,
                                                     gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_base_release_get_install_success (self);
	if (old_value != value) {
		self->priv->_install_success = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_INSTALL_SUCCESS_PROPERTY]);
	}
}

const gchar*
proton_plus_models_base_release_get_error_message (ProtonPlusModelsBaseRelease* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_error_message;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_base_release_set_error_message (ProtonPlusModelsBaseRelease* self,
                                                   const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_base_release_get_error_message (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_error_message);
		self->priv->_error_message = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_ERROR_MESSAGE_PROPERTY]);
	}
}

ProtonPlusModelsBaseReleaseState
proton_plus_models_base_release_get_state (ProtonPlusModelsBaseRelease* self)
{
	ProtonPlusModelsBaseReleaseState result;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	g_return_val_if_fail (self != NULL, 0);
	if (self->priv->_state != PROTON_PLUS_MODELS_BASE_RELEASE_STATE_BUSY_INSTALLING) {
		_tmp1_ = self->priv->_state != PROTON_PLUS_MODELS_BASE_RELEASE_STATE_BUSY_REMOVING;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		_tmp0_ = self->priv->_state != PROTON_PLUS_MODELS_BASE_RELEASE_STATE_BUSY_UPDATING;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		ProtonPlusModelsBaseRelease* active_download = NULL;
		ProtonPlusModelsDownloadManager* _tmp2_;
		ProtonPlusModelsDownloadManager* _tmp3_;
		ProtonPlusModelsBaseRelease* _tmp4_;
		ProtonPlusModelsBaseRelease* _tmp5_;
		_tmp2_ = proton_plus_models_download_manager_get_instance ();
		_tmp3_ = _tmp2_;
		_tmp4_ = proton_plus_models_download_manager_get_active_download (_tmp3_, self);
		active_download = _tmp4_;
		_tmp5_ = active_download;
		if (_tmp5_ != NULL) {
			ProtonPlusModelsBaseRelease* _tmp6_;
			ProtonPlusModelsBaseReleaseState _tmp7_;
			ProtonPlusModelsBaseReleaseState _tmp8_;
			_tmp6_ = active_download;
			_tmp7_ = proton_plus_models_base_release_get_state (_tmp6_);
			_tmp8_ = _tmp7_;
			result = _tmp8_;
			_g_object_unref0 (active_download);
			return result;
		}
		_g_object_unref0 (active_download);
	}
	result = self->priv->_state;
	return result;
}

void
proton_plus_models_base_release_set_state (ProtonPlusModelsBaseRelease* self,
                                           ProtonPlusModelsBaseReleaseState value)
{
	g_return_if_fail (self != NULL);
	self->priv->_state = value;
	g_object_notify_by_pspec ((GObject *) self, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_STATE_PROPERTY]);
}

ProtonPlusModelsBaseReleaseStep
proton_plus_models_base_release_get_step (ProtonPlusModelsBaseRelease* self)
{
	ProtonPlusModelsBaseReleaseStep result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_step;
	return result;
}

void
proton_plus_models_base_release_set_step (ProtonPlusModelsBaseRelease* self,
                                          ProtonPlusModelsBaseReleaseStep value)
{
	ProtonPlusModelsBaseReleaseStep old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_base_release_get_step (self);
	if (old_value != value) {
		self->priv->_step = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_STEP_PROPERTY]);
	}
}

static void
proton_plus_models_base_release_class_init (ProtonPlusModelsBaseReleaseClass * klass,
                                            gpointer klass_data)
{
	proton_plus_models_base_release_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusModelsBaseRelease_private_offset);
	((ProtonPlusModelsBaseReleaseClass *) klass)->refresh_state = (void (*) (ProtonPlusModelsBaseRelease*)) proton_plus_models_base_release_real_refresh_state;
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_models_base_release_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_models_base_release_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_models_base_release_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_BASE_RELEASE_RUNNER_PROPERTY, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_RUNNER_PROPERTY] = g_param_spec_object ("runner", "runner", "runner", PROTON_PLUS_MODELS_TYPE_RUNNER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_BASE_RELEASE_TITLE_PROPERTY, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_TITLE_PROPERTY] = g_param_spec_string ("title", "title", "title", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_BASE_RELEASE_DISPLAYED_TITLE_PROPERTY, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_DISPLAYED_TITLE_PROPERTY] = g_param_spec_string ("displayed-title", "displayed-title", "displayed-title", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_BASE_RELEASE_DESCRIPTION_PROPERTY, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_DESCRIPTION_PROPERTY] = g_param_spec_string ("description", "description", "description", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_BASE_RELEASE_RELEASE_DATE_PROPERTY, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_RELEASE_DATE_PROPERTY] = g_param_spec_string ("release-date", "release-date", "release-date", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_BASE_RELEASE_DOWNLOAD_URL_PROPERTY, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_DOWNLOAD_URL_PROPERTY] = g_param_spec_string ("download-url", "download-url", "download-url", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_BASE_RELEASE_PAGE_URL_PROPERTY, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_PAGE_URL_PROPERTY] = g_param_spec_string ("page-url", "page-url", "page-url", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_BASE_RELEASE_CANCELED_PROPERTY, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_CANCELED_PROPERTY] = g_param_spec_boolean ("canceled", "canceled", "canceled", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_BASE_RELEASE_PROGRESS_PROPERTY, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_PROGRESS_PROPERTY] = g_param_spec_string ("progress", "progress", "progress", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_BASE_RELEASE_SPEED_KBPS_PROPERTY, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_SPEED_KBPS_PROPERTY] = g_param_spec_double ("speed-kbps", "speed-kbps", "speed-kbps", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_BASE_RELEASE_IS_PERCENT_PROPERTY, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_IS_PERCENT_PROPERTY] = g_param_spec_boolean ("is-percent", "is-percent", "is-percent", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_BASE_RELEASE_IS_FINISHED_PROPERTY, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_IS_FINISHED_PROPERTY] = g_param_spec_boolean ("is-finished", "is-finished", "is-finished", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_BASE_RELEASE_INSTALL_SUCCESS_PROPERTY, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_INSTALL_SUCCESS_PROPERTY] = g_param_spec_boolean ("install-success", "install-success", "install-success", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_BASE_RELEASE_ERROR_MESSAGE_PROPERTY, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_ERROR_MESSAGE_PROPERTY] = g_param_spec_string ("error-message", "error-message", "error-message", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_BASE_RELEASE_STATE_PROPERTY, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_STATE_PROPERTY] = g_param_spec_enum ("state", "state", "state", PROTON_PLUS_MODELS_BASE_RELEASE_TYPE_STATE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_BASE_RELEASE_STEP_PROPERTY, proton_plus_models_base_release_properties[PROTON_PLUS_MODELS_BASE_RELEASE_STEP_PROPERTY] = g_param_spec_enum ("step", "step", "step", PROTON_PLUS_MODELS_BASE_RELEASE_TYPE_STEP, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
proton_plus_models_base_release_instance_init (ProtonPlusModelsBaseRelease * self,
                                               gpointer klass)
{
	self->priv = proton_plus_models_base_release_get_instance_private (self);
	self->priv->_is_finished = FALSE;
	self->priv->_install_success = FALSE;
}

static void
proton_plus_models_base_release_finalize (GObject * obj)
{
	ProtonPlusModelsBaseRelease * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_MODELS_TYPE_BASE_RELEASE, ProtonPlusModelsBaseRelease);
	_g_object_unref0 (self->priv->_runner);
	_g_free0 (self->priv->_title);
	_g_free0 (self->priv->_displayed_title);
	_g_free0 (self->priv->_description);
	_g_free0 (self->priv->_release_date);
	_g_free0 (self->priv->_download_url);
	_g_free0 (self->priv->_page_url);
	_g_free0 (self->priv->_progress);
	_g_free0 (self->priv->_seconds_remaining);
	_g_free0 (self->priv->_error_message);
	G_OBJECT_CLASS (proton_plus_models_base_release_parent_class)->finalize (obj);
}

static GType
proton_plus_models_base_release_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusModelsBaseReleaseClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_models_base_release_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusModelsBaseRelease), 0, (GInstanceInitFunc) proton_plus_models_base_release_instance_init, NULL };
	GType proton_plus_models_base_release_type_id;
	proton_plus_models_base_release_type_id = g_type_register_static (G_TYPE_OBJECT, "ProtonPlusModelsBaseRelease", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	ProtonPlusModelsBaseRelease_private_offset = g_type_add_instance_private (proton_plus_models_base_release_type_id, sizeof (ProtonPlusModelsBaseReleasePrivate));
	return proton_plus_models_base_release_type_id;
}

GType
proton_plus_models_base_release_get_type (void)
{
	static volatile gsize proton_plus_models_base_release_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_models_base_release_type_id__once)) {
		GType proton_plus_models_base_release_type_id;
		proton_plus_models_base_release_type_id = proton_plus_models_base_release_get_type_once ();
		g_once_init_leave (&proton_plus_models_base_release_type_id__once, proton_plus_models_base_release_type_id);
	}
	return proton_plus_models_base_release_type_id__once;
}

static void
_vala_proton_plus_models_base_release_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec)
{
	ProtonPlusModelsBaseRelease * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_MODELS_TYPE_BASE_RELEASE, ProtonPlusModelsBaseRelease);
	switch (property_id) {
		case PROTON_PLUS_MODELS_BASE_RELEASE_RUNNER_PROPERTY:
		g_value_set_object (value, proton_plus_models_base_release_get_runner (self));
		break;
		case PROTON_PLUS_MODELS_BASE_RELEASE_TITLE_PROPERTY:
		g_value_set_string (value, proton_plus_models_base_release_get_title (self));
		break;
		case PROTON_PLUS_MODELS_BASE_RELEASE_DISPLAYED_TITLE_PROPERTY:
		g_value_set_string (value, proton_plus_models_base_release_get_displayed_title (self));
		break;
		case PROTON_PLUS_MODELS_BASE_RELEASE_DESCRIPTION_PROPERTY:
		g_value_set_string (value, proton_plus_models_base_release_get_description (self));
		break;
		case PROTON_PLUS_MODELS_BASE_RELEASE_RELEASE_DATE_PROPERTY:
		g_value_set_string (value, proton_plus_models_base_release_get_release_date (self));
		break;
		case PROTON_PLUS_MODELS_BASE_RELEASE_DOWNLOAD_URL_PROPERTY:
		g_value_set_string (value, proton_plus_models_base_release_get_download_url (self));
		break;
		case PROTON_PLUS_MODELS_BASE_RELEASE_PAGE_URL_PROPERTY:
		g_value_set_string (value, proton_plus_models_base_release_get_page_url (self));
		break;
		case PROTON_PLUS_MODELS_BASE_RELEASE_CANCELED_PROPERTY:
		g_value_set_boolean (value, proton_plus_models_base_release_get_canceled (self));
		break;
		case PROTON_PLUS_MODELS_BASE_RELEASE_PROGRESS_PROPERTY:
		g_value_set_string (value, proton_plus_models_base_release_get_progress (self));
		break;
		case PROTON_PLUS_MODELS_BASE_RELEASE_SPEED_KBPS_PROPERTY:
		g_value_set_double (value, proton_plus_models_base_release_get_speed_kbps (self));
		break;
		case PROTON_PLUS_MODELS_BASE_RELEASE_IS_PERCENT_PROPERTY:
		g_value_set_boolean (value, proton_plus_models_base_release_get_is_percent (self));
		break;
		case PROTON_PLUS_MODELS_BASE_RELEASE_IS_FINISHED_PROPERTY:
		g_value_set_boolean (value, proton_plus_models_base_release_get_is_finished (self));
		break;
		case PROTON_PLUS_MODELS_BASE_RELEASE_INSTALL_SUCCESS_PROPERTY:
		g_value_set_boolean (value, proton_plus_models_base_release_get_install_success (self));
		break;
		case PROTON_PLUS_MODELS_BASE_RELEASE_ERROR_MESSAGE_PROPERTY:
		g_value_set_string (value, proton_plus_models_base_release_get_error_message (self));
		break;
		case PROTON_PLUS_MODELS_BASE_RELEASE_STATE_PROPERTY:
		g_value_set_enum (value, proton_plus_models_base_release_get_state (self));
		break;
		case PROTON_PLUS_MODELS_BASE_RELEASE_STEP_PROPERTY:
		g_value_set_enum (value, proton_plus_models_base_release_get_step (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_models_base_release_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec)
{
	ProtonPlusModelsBaseRelease * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_MODELS_TYPE_BASE_RELEASE, ProtonPlusModelsBaseRelease);
	switch (property_id) {
		case PROTON_PLUS_MODELS_BASE_RELEASE_RUNNER_PROPERTY:
		proton_plus_models_base_release_set_runner (self, g_value_get_object (value));
		break;
		case PROTON_PLUS_MODELS_BASE_RELEASE_TITLE_PROPERTY:
		proton_plus_models_base_release_set_title (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_MODELS_BASE_RELEASE_DISPLAYED_TITLE_PROPERTY:
		proton_plus_models_base_release_set_displayed_title (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_MODELS_BASE_RELEASE_DESCRIPTION_PROPERTY:
		proton_plus_models_base_release_set_description (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_MODELS_BASE_RELEASE_RELEASE_DATE_PROPERTY:
		proton_plus_models_base_release_set_release_date (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_MODELS_BASE_RELEASE_DOWNLOAD_URL_PROPERTY:
		proton_plus_models_base_release_set_download_url (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_MODELS_BASE_RELEASE_PAGE_URL_PROPERTY:
		proton_plus_models_base_release_set_page_url (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_MODELS_BASE_RELEASE_CANCELED_PROPERTY:
		proton_plus_models_base_release_set_canceled (self, g_value_get_boolean (value));
		break;
		case PROTON_PLUS_MODELS_BASE_RELEASE_PROGRESS_PROPERTY:
		proton_plus_models_base_release_set_progress (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_MODELS_BASE_RELEASE_SPEED_KBPS_PROPERTY:
		proton_plus_models_base_release_set_speed_kbps (self, g_value_get_double (value));
		break;
		case PROTON_PLUS_MODELS_BASE_RELEASE_IS_PERCENT_PROPERTY:
		proton_plus_models_base_release_set_is_percent (self, g_value_get_boolean (value));
		break;
		case PROTON_PLUS_MODELS_BASE_RELEASE_IS_FINISHED_PROPERTY:
		proton_plus_models_base_release_set_is_finished (self, g_value_get_boolean (value));
		break;
		case PROTON_PLUS_MODELS_BASE_RELEASE_INSTALL_SUCCESS_PROPERTY:
		proton_plus_models_base_release_set_install_success (self, g_value_get_boolean (value));
		break;
		case PROTON_PLUS_MODELS_BASE_RELEASE_ERROR_MESSAGE_PROPERTY:
		proton_plus_models_base_release_set_error_message (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_MODELS_BASE_RELEASE_STATE_PROPERTY:
		proton_plus_models_base_release_set_state (self, g_value_get_enum (value));
		break;
		case PROTON_PLUS_MODELS_BASE_RELEASE_STEP_PROPERTY:
		proton_plus_models_base_release_set_step (self, g_value_get_enum (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
proton_plus_models_release_get_instance_private (ProtonPlusModelsRelease* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusModelsRelease_private_offset);
}

static void
proton_plus_models_release_real_install_data_free (gpointer _data)
{
	ProtonPlusModelsReleaseInstallData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (ProtonPlusModelsReleaseInstallData, _data_);
}

static void
proton_plus_models_release_real_install (ProtonPlusModelsBaseRelease* base,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_)
{
	ProtonPlusModelsRelease * self;
	ProtonPlusModelsReleaseInstallData* _data_;
	ProtonPlusModelsRelease* _tmp0_;
	self = (ProtonPlusModelsRelease*) base;
	_data_ = g_slice_new0 (ProtonPlusModelsReleaseInstallData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_models_release_real_install_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	proton_plus_models_release_real_install_co (_data_);
}

static gboolean
proton_plus_models_release_install_finish (ProtonPlusModelsBaseRelease* base,
                                           GAsyncResult* _res_)
{
	gboolean result;
	ProtonPlusModelsReleaseInstallData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
proton_plus_models_release_install_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_)
{
	ProtonPlusModelsReleaseInstallData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_models_release_real_install_co (_data_);
}

static gboolean
proton_plus_models_release_real_install_co (ProtonPlusModelsReleaseInstallData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = proton_plus_models_base_release_get_state ((ProtonPlusModelsBaseRelease*) _data_->self);
	_data_->_tmp2_ = _data_->_tmp1_;
	if (_data_->_tmp2_ != PROTON_PLUS_MODELS_BASE_RELEASE_STATE_BUSY_UPDATING) {
		_data_->_tmp3_ = proton_plus_models_download_manager_get_instance ();
		_data_->_tmp4_ = _data_->_tmp3_;
		_data_->_tmp0_ = proton_plus_models_download_manager_is_downloading (_data_->_tmp4_, (ProtonPlusModelsBaseRelease*) _data_->self);
	} else {
		_data_->_tmp0_ = FALSE;
	}
	if (_data_->_tmp0_) {
		_data_->result = FALSE;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	proton_plus_models_base_release_set_canceled ((ProtonPlusModelsBaseRelease*) _data_->self, FALSE);
	proton_plus_models_base_release_set_is_finished ((ProtonPlusModelsBaseRelease*) _data_->self, FALSE);
	proton_plus_models_base_release_set_install_success ((ProtonPlusModelsBaseRelease*) _data_->self, FALSE);
	proton_plus_models_base_release_set_progress ((ProtonPlusModelsBaseRelease*) _data_->self, NULL);
	proton_plus_models_base_release_set_speed_kbps ((ProtonPlusModelsBaseRelease*) _data_->self, 0.0);
	proton_plus_models_base_release_set_seconds_remaining ((ProtonPlusModelsBaseRelease*) _data_->self, NULL);
	proton_plus_models_base_release_set_is_percent ((ProtonPlusModelsBaseRelease*) _data_->self, FALSE);
	_data_->_tmp5_ = proton_plus_models_base_release_get_state ((ProtonPlusModelsBaseRelease*) _data_->self);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->busy_updating = _data_->_tmp6_ == PROTON_PLUS_MODELS_BASE_RELEASE_STATE_BUSY_UPDATING;
	if (!_data_->busy_updating) {
		proton_plus_models_base_release_set_state ((ProtonPlusModelsBaseRelease*) _data_->self, PROTON_PLUS_MODELS_BASE_RELEASE_STATE_BUSY_INSTALLING);
	}
	_data_->_tmp7_ = proton_plus_models_download_manager_get_instance ();
	_data_->_tmp8_ = _data_->_tmp7_;
	proton_plus_models_download_manager_add_download (_data_->_tmp8_, (ProtonPlusModelsBaseRelease*) _data_->self);
	_data_->_state_ = 1;
	_proton_plus_models_base_release_start_install ((ProtonPlusModelsBaseRelease*) _data_->self, proton_plus_models_release_install_ready, _data_);
	return FALSE;
	_state_1:
	_data_->success = _proton_plus_models_base_release_start_install_finish ((ProtonPlusModelsBaseRelease*) _data_->self, _data_->_res_);
	proton_plus_models_base_release_set_is_finished ((ProtonPlusModelsBaseRelease*) _data_->self, TRUE);
	proton_plus_models_base_release_set_install_success ((ProtonPlusModelsBaseRelease*) _data_->self, _data_->success);
	_data_->_tmp9_ = proton_plus_models_download_manager_get_instance ();
	_data_->_tmp10_ = _data_->_tmp9_;
	proton_plus_models_download_manager_remove_download (_data_->_tmp10_, (ProtonPlusModelsBaseRelease*) _data_->self);
	_data_->_tmp11_ = proton_plus_models_download_manager_get_instance ();
	_data_->_tmp12_ = _data_->_tmp11_;
	proton_plus_models_download_manager_add_to_history (_data_->_tmp12_, (ProtonPlusModelsBaseRelease*) _data_->self, _data_->success);
	if (!_data_->success) {
		_data_->_tmp13_ = proton_plus_models_parameters_new ();
		_data_->_tmp14_ = _data_->_tmp13_;
		_data_->_state_ = 2;
		proton_plus_models_base_release_remove ((ProtonPlusModelsBaseRelease*) _data_->self, _data_->_tmp14_, proton_plus_models_release_install_ready, _data_);
		return FALSE;
		_state_2:
		proton_plus_models_base_release_remove_finish ((ProtonPlusModelsBaseRelease*) _data_->self, _data_->_res_);
		_g_object_unref0 (_data_->_tmp14_);
	}
	if (!_data_->busy_updating) {
		proton_plus_models_base_release_refresh_state ((ProtonPlusModelsBaseRelease*) _data_->self);
	}
	_data_->result = _data_->success;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
proton_plus_models_release_real_remove_data_free (gpointer _data)
{
	ProtonPlusModelsReleaseRemoveData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->parameters);
	_g_object_unref0 (_data_->self);
	g_slice_free (ProtonPlusModelsReleaseRemoveData, _data_);
}

static void
proton_plus_models_release_real_remove (ProtonPlusModelsBaseRelease* base,
                                        ProtonPlusModelsParameters* parameters,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	ProtonPlusModelsRelease * self;
	ProtonPlusModelsReleaseRemoveData* _data_;
	ProtonPlusModelsRelease* _tmp0_;
	ProtonPlusModelsParameters* _tmp1_;
	g_return_if_fail (parameters != NULL);
	self = (ProtonPlusModelsRelease*) base;
	_data_ = g_slice_new0 (ProtonPlusModelsReleaseRemoveData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_models_release_real_remove_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (parameters);
	_g_object_unref0 (_data_->parameters);
	_data_->parameters = _tmp1_;
	proton_plus_models_release_real_remove_co (_data_);
}

static gboolean
proton_plus_models_release_remove_finish (ProtonPlusModelsBaseRelease* base,
                                          GAsyncResult* _res_)
{
	gboolean result;
	ProtonPlusModelsReleaseRemoveData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
proton_plus_models_release_remove_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_)
{
	ProtonPlusModelsReleaseRemoveData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_models_release_real_remove_co (_data_);
}

static gboolean
proton_plus_models_release_real_remove_co (ProtonPlusModelsReleaseRemoveData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = proton_plus_models_base_release_get_state ((ProtonPlusModelsBaseRelease*) _data_->self);
	_data_->_tmp2_ = _data_->_tmp1_;
	if (_data_->_tmp2_ == PROTON_PLUS_MODELS_BASE_RELEASE_STATE_BUSY_UPDATING) {
		_data_->_tmp0_ = TRUE;
	} else {
		_data_->_tmp3_ = proton_plus_models_base_release_get_state ((ProtonPlusModelsBaseRelease*) _data_->self);
		_data_->_tmp4_ = _data_->_tmp3_;
		_data_->_tmp0_ = _data_->_tmp4_ == PROTON_PLUS_MODELS_BASE_RELEASE_STATE_BUSY_INSTALLING;
	}
	_data_->busy_updating_or_installing = _data_->_tmp0_;
	if (!_data_->busy_updating_or_installing) {
		proton_plus_models_base_release_set_canceled ((ProtonPlusModelsBaseRelease*) _data_->self, FALSE);
		proton_plus_models_base_release_set_state ((ProtonPlusModelsBaseRelease*) _data_->self, PROTON_PLUS_MODELS_BASE_RELEASE_STATE_BUSY_REMOVING);
	}
	_data_->_state_ = 1;
	_proton_plus_models_release_start_remove (_data_->self, (gconstpointer) _data_->parameters, proton_plus_models_release_remove_ready, _data_);
	return FALSE;
	_state_1:
	_data_->remove_success = _proton_plus_models_release_start_remove_finish (_data_->self, _data_->_res_);
	if (!_data_->busy_updating_or_installing) {
		proton_plus_models_base_release_refresh_state ((ProtonPlusModelsBaseRelease*) _data_->self);
	}
	_data_->result = _data_->remove_success;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

void
_proton_plus_models_release_start_remove (ProtonPlusModelsRelease* self,
                                          gconstpointer parameters,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_)
{
	ProtonPlusModelsReleaseClass* _klass_;
	_klass_ = PROTON_PLUS_MODELS_RELEASE_GET_CLASS (self);
	if (_klass_->_start_remove) {
		_klass_->_start_remove (self, parameters, _callback_, _user_data_);
	}
}

gboolean
_proton_plus_models_release_start_remove_finish (ProtonPlusModelsRelease* self,
                                                 GAsyncResult* _res_)
{
	ProtonPlusModelsReleaseClass* _klass_;
	_klass_ = PROTON_PLUS_MODELS_RELEASE_GET_CLASS (self);
	if (_klass_->_start_remove_finish) {
		return _klass_->_start_remove_finish (self, _res_);
	}
	return FALSE;
}

ProtonPlusModelsRelease*
proton_plus_models_release_construct (GType object_type,
                                      GType r_type,
                                      GBoxedCopyFunc r_dup_func,
                                      GDestroyNotify r_destroy_func)
{
	ProtonPlusModelsRelease * self = NULL;
	self = (ProtonPlusModelsRelease*) proton_plus_models_base_release_construct (object_type);
	self->priv->r_type = r_type;
	self->priv->r_dup_func = r_dup_func;
	self->priv->r_destroy_func = r_destroy_func;
	return self;
}

static void
proton_plus_models_release_class_init (ProtonPlusModelsReleaseClass * klass,
                                       gpointer klass_data)
{
	proton_plus_models_release_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusModelsRelease_private_offset);
	((ProtonPlusModelsBaseReleaseClass *) klass)->install = (void (*) (ProtonPlusModelsBaseRelease*, GAsyncReadyCallback, gpointer)) proton_plus_models_release_real_install;
	((ProtonPlusModelsBaseReleaseClass *) klass)->install_finish = (gboolean (*) (ProtonPlusModelsBaseRelease*, GAsyncResult*)) proton_plus_models_release_install_finish;
	((ProtonPlusModelsBaseReleaseClass *) klass)->remove = (void (*) (ProtonPlusModelsBaseRelease*, ProtonPlusModelsParameters*, GAsyncReadyCallback, gpointer)) proton_plus_models_release_real_remove;
	((ProtonPlusModelsBaseReleaseClass *) klass)->remove_finish = (gboolean (*) (ProtonPlusModelsBaseRelease*, GAsyncResult*)) proton_plus_models_release_remove_finish;
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_models_release_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_models_release_set_property;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_RELEASE_R_TYPE, g_param_spec_gtype ("r-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_RELEASE_R_DUP_FUNC, g_param_spec_pointer ("r-dup-func", "dup func", "dup func", G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_RELEASE_R_DESTROY_FUNC, g_param_spec_pointer ("r-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
}

static void
proton_plus_models_release_instance_init (ProtonPlusModelsRelease * self,
                                          gpointer klass)
{
	self->priv = proton_plus_models_release_get_instance_private (self);
}

static GType
proton_plus_models_release_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusModelsReleaseClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_models_release_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusModelsRelease), 0, (GInstanceInitFunc) proton_plus_models_release_instance_init, NULL };
	GType proton_plus_models_release_type_id;
	proton_plus_models_release_type_id = g_type_register_static (PROTON_PLUS_MODELS_TYPE_BASE_RELEASE, "ProtonPlusModelsRelease", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	ProtonPlusModelsRelease_private_offset = g_type_add_instance_private (proton_plus_models_release_type_id, sizeof (ProtonPlusModelsReleasePrivate));
	return proton_plus_models_release_type_id;
}

GType
proton_plus_models_release_get_type (void)
{
	static volatile gsize proton_plus_models_release_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_models_release_type_id__once)) {
		GType proton_plus_models_release_type_id;
		proton_plus_models_release_type_id = proton_plus_models_release_get_type_once ();
		g_once_init_leave (&proton_plus_models_release_type_id__once, proton_plus_models_release_type_id);
	}
	return proton_plus_models_release_type_id__once;
}

static void
_vala_proton_plus_models_release_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec)
{
	ProtonPlusModelsRelease * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_MODELS_TYPE_RELEASE, ProtonPlusModelsRelease);
	switch (property_id) {
		case PROTON_PLUS_MODELS_RELEASE_R_TYPE:
		g_value_set_gtype (value, self->priv->r_type);
		break;
		case PROTON_PLUS_MODELS_RELEASE_R_DUP_FUNC:
		g_value_set_pointer (value, self->priv->r_dup_func);
		break;
		case PROTON_PLUS_MODELS_RELEASE_R_DESTROY_FUNC:
		g_value_set_pointer (value, self->priv->r_destroy_func);
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_models_release_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec)
{
	ProtonPlusModelsRelease * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_MODELS_TYPE_RELEASE, ProtonPlusModelsRelease);
	switch (property_id) {
		case PROTON_PLUS_MODELS_RELEASE_R_TYPE:
		self->priv->r_type = g_value_get_gtype (value);
		break;
		case PROTON_PLUS_MODELS_RELEASE_R_DUP_FUNC:
		self->priv->r_dup_func = g_value_get_pointer (value);
		break;
		case PROTON_PLUS_MODELS_RELEASE_R_DESTROY_FUNC:
		self->priv->r_destroy_func = g_value_get_pointer (value);
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

