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

#include <gtk/gtk.h>
#include <glib-object.h>
#include <adwaita.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.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_WIDGETS_TYPE_SHORTCUT_BUTTON (proton_plus_widgets_shortcut_button_get_type ())
#define PROTON_PLUS_WIDGETS_SHORTCUT_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_TYPE_SHORTCUT_BUTTON, ProtonPlusWidgetsShortcutButton))
#define PROTON_PLUS_WIDGETS_SHORTCUT_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_TYPE_SHORTCUT_BUTTON, ProtonPlusWidgetsShortcutButtonClass))
#define PROTON_PLUS_WIDGETS_IS_SHORTCUT_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_TYPE_SHORTCUT_BUTTON))
#define PROTON_PLUS_WIDGETS_IS_SHORTCUT_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_TYPE_SHORTCUT_BUTTON))
#define PROTON_PLUS_WIDGETS_SHORTCUT_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_TYPE_SHORTCUT_BUTTON, ProtonPlusWidgetsShortcutButtonClass))

typedef struct _ProtonPlusWidgetsShortcutButton ProtonPlusWidgetsShortcutButton;
typedef struct _ProtonPlusWidgetsShortcutButtonClass ProtonPlusWidgetsShortcutButtonClass;
typedef struct _ProtonPlusWidgetsShortcutButtonPrivate ProtonPlusWidgetsShortcutButtonPrivate;

#define PROTON_PLUS_MODELS_TYPE_STEAM_PROFILE (proton_plus_models_steam_profile_get_type ())
#define PROTON_PLUS_MODELS_STEAM_PROFILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_MODELS_TYPE_STEAM_PROFILE, ProtonPlusModelsSteamProfile))
#define PROTON_PLUS_MODELS_STEAM_PROFILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_MODELS_TYPE_STEAM_PROFILE, ProtonPlusModelsSteamProfileClass))
#define PROTON_PLUS_MODELS_IS_STEAM_PROFILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_MODELS_TYPE_STEAM_PROFILE))
#define PROTON_PLUS_MODELS_IS_STEAM_PROFILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_MODELS_TYPE_STEAM_PROFILE))
#define PROTON_PLUS_MODELS_STEAM_PROFILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_MODELS_TYPE_STEAM_PROFILE, ProtonPlusModelsSteamProfileClass))

typedef struct _ProtonPlusModelsSteamProfile ProtonPlusModelsSteamProfile;
typedef struct _ProtonPlusModelsSteamProfileClass ProtonPlusModelsSteamProfileClass;
enum  {
	PROTON_PLUS_WIDGETS_SHORTCUT_BUTTON_0_PROPERTY,
	PROTON_PLUS_WIDGETS_SHORTCUT_BUTTON_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_shortcut_button_properties[PROTON_PLUS_WIDGETS_SHORTCUT_BUTTON_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define PROTON_PLUS_VDF_TYPE_BINARY (proton_plus_vdf_binary_get_type ())
#define PROTON_PLUS_VDF_BINARY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_VDF_TYPE_BINARY, ProtonPlusVDFBinary))
#define PROTON_PLUS_VDF_BINARY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_VDF_TYPE_BINARY, ProtonPlusVDFBinaryClass))
#define PROTON_PLUS_VDF_IS_BINARY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_VDF_TYPE_BINARY))
#define PROTON_PLUS_VDF_IS_BINARY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_VDF_TYPE_BINARY))
#define PROTON_PLUS_VDF_BINARY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_VDF_TYPE_BINARY, ProtonPlusVDFBinaryClass))

typedef struct _ProtonPlusVDFBinary ProtonPlusVDFBinary;
typedef struct _ProtonPlusVDFBinaryClass ProtonPlusVDFBinaryClass;

#define PROTON_PLUS_VDF_TYPE_SHORTCUTS (proton_plus_vdf_shortcuts_get_type ())
#define PROTON_PLUS_VDF_SHORTCUTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_VDF_TYPE_SHORTCUTS, ProtonPlusVDFShortcuts))
#define PROTON_PLUS_VDF_SHORTCUTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_VDF_TYPE_SHORTCUTS, ProtonPlusVDFShortcutsClass))
#define PROTON_PLUS_VDF_IS_SHORTCUTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_VDF_TYPE_SHORTCUTS))
#define PROTON_PLUS_VDF_IS_SHORTCUTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_VDF_TYPE_SHORTCUTS))
#define PROTON_PLUS_VDF_SHORTCUTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_VDF_TYPE_SHORTCUTS, ProtonPlusVDFShortcutsClass))

typedef struct _ProtonPlusVDFShortcuts ProtonPlusVDFShortcuts;
typedef struct _ProtonPlusVDFShortcutsClass ProtonPlusVDFShortcutsClass;

#define PROTON_PLUS_WIDGETS_TYPE_ERROR_DIALOG (proton_plus_widgets_error_dialog_get_type ())
#define PROTON_PLUS_WIDGETS_ERROR_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_TYPE_ERROR_DIALOG, ProtonPlusWidgetsErrorDialog))
#define PROTON_PLUS_WIDGETS_ERROR_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_TYPE_ERROR_DIALOG, ProtonPlusWidgetsErrorDialogClass))
#define PROTON_PLUS_WIDGETS_IS_ERROR_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_TYPE_ERROR_DIALOG))
#define PROTON_PLUS_WIDGETS_IS_ERROR_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_TYPE_ERROR_DIALOG))
#define PROTON_PLUS_WIDGETS_ERROR_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_TYPE_ERROR_DIALOG, ProtonPlusWidgetsErrorDialogClass))

typedef struct _ProtonPlusWidgetsErrorDialog ProtonPlusWidgetsErrorDialog;
typedef struct _ProtonPlusWidgetsErrorDialogClass ProtonPlusWidgetsErrorDialogClass;

#define PROTON_PLUS_WIDGETS_TYPE_WINDOW (proton_plus_widgets_window_get_type ())
#define PROTON_PLUS_WIDGETS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_TYPE_WINDOW, ProtonPlusWidgetsWindow))
#define PROTON_PLUS_WIDGETS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_TYPE_WINDOW, ProtonPlusWidgetsWindowClass))
#define PROTON_PLUS_WIDGETS_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_TYPE_WINDOW))
#define PROTON_PLUS_WIDGETS_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_TYPE_WINDOW))
#define PROTON_PLUS_WIDGETS_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_TYPE_WINDOW, ProtonPlusWidgetsWindowClass))

typedef struct _ProtonPlusWidgetsWindow ProtonPlusWidgetsWindow;
typedef struct _ProtonPlusWidgetsWindowClass ProtonPlusWidgetsWindowClass;

struct _ProtonPlusWidgetsShortcutButton {
	GtkButton parent_instance;
	ProtonPlusWidgetsShortcutButtonPrivate * priv;
};

struct _ProtonPlusWidgetsShortcutButtonClass {
	GtkButtonClass parent_class;
};

struct _ProtonPlusWidgetsShortcutButtonPrivate {
	ProtonPlusModelsSteamProfile* _profile;
	AdwButtonContent* _shortcut_button_content;
};

static gint ProtonPlusWidgetsShortcutButton_private_offset;
static gpointer proton_plus_widgets_shortcut_button_parent_class = NULL;
VALA_EXTERN ProtonPlusWidgetsWindow* proton_plus_widgets_application_window;

VALA_EXTERN GType proton_plus_widgets_shortcut_button_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusWidgetsShortcutButton, g_object_unref)
VALA_EXTERN GType proton_plus_models_steam_profile_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusModelsSteamProfile, g_object_unref)
VALA_EXTERN void proton_plus_widgets_shortcut_button_load (ProtonPlusWidgetsShortcutButton* self,
                                               ProtonPlusModelsSteamProfile* profile);
static void proton_plus_widgets_shortcut_button_set_profile (ProtonPlusWidgetsShortcutButton* self,
                                                      ProtonPlusModelsSteamProfile* value);
static void proton_plus_widgets_shortcut_button_refresh (ProtonPlusWidgetsShortcutButton* self);
VALA_EXTERN void proton_plus_widgets_shortcut_button_reset (ProtonPlusWidgetsShortcutButton* self);
static AdwButtonContent* proton_plus_widgets_shortcut_button_get_shortcut_button_content (ProtonPlusWidgetsShortcutButton* self);
static ProtonPlusModelsSteamProfile* proton_plus_widgets_shortcut_button_get_profile (ProtonPlusWidgetsShortcutButton* self);
VALA_EXTERN gpointer proton_plus_vdf_binary_ref (gpointer instance);
VALA_EXTERN void proton_plus_vdf_binary_unref (gpointer instance);
VALA_EXTERN GParamSpec* proton_plus_vdf_param_spec_binary (const gchar* name,
                                               const gchar* nick,
                                               const gchar* blurb,
                                               GType object_type,
                                               GParamFlags flags);
VALA_EXTERN void proton_plus_vdf_value_set_binary (GValue* value,
                                       gpointer v_object);
VALA_EXTERN void proton_plus_vdf_value_take_binary (GValue* value,
                                        gpointer v_object);
VALA_EXTERN gpointer proton_plus_vdf_value_get_binary (const GValue* value);
VALA_EXTERN GType proton_plus_vdf_binary_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusVDFBinary, proton_plus_vdf_binary_unref)
VALA_EXTERN GType proton_plus_vdf_shortcuts_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusVDFShortcuts, proton_plus_vdf_binary_unref)
VALA_EXTERN ProtonPlusVDFShortcuts* proton_plus_models_steam_profile_get_shortcuts (ProtonPlusModelsSteamProfile* self);
VALA_EXTERN gboolean proton_plus_vdf_shortcuts_get_installed_status (ProtonPlusVDFShortcuts* self);
static void proton_plus_widgets_shortcut_button_shortcut_button_clicked (ProtonPlusWidgetsShortcutButton* self);
VALA_EXTERN gboolean proton_plus_vdf_shortcuts_uninstall (ProtonPlusVDFShortcuts* self);
VALA_EXTERN GType proton_plus_widgets_error_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusWidgetsErrorDialog, g_object_unref)
VALA_EXTERN ProtonPlusWidgetsErrorDialog* proton_plus_widgets_error_dialog_new (const gchar* heading,
                                                                    const gchar* body);
VALA_EXTERN ProtonPlusWidgetsErrorDialog* proton_plus_widgets_error_dialog_construct (GType object_type,
                                                                          const gchar* heading,
                                                                          const gchar* body);
VALA_EXTERN GType proton_plus_widgets_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusWidgetsWindow, g_object_unref)
VALA_EXTERN void proton_plus_vdf_shortcuts_install (ProtonPlusVDFShortcuts* self,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
VALA_EXTERN gboolean proton_plus_vdf_shortcuts_install_finish (ProtonPlusVDFShortcuts* self,
                                                   GAsyncResult* _res_);
static void ___lambda35_ (ProtonPlusWidgetsShortcutButton* self,
                   GObject* obj,
                   GAsyncResult* res);
static void ____lambda35__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
VALA_EXTERN ProtonPlusWidgetsShortcutButton* proton_plus_widgets_shortcut_button_new (void);
VALA_EXTERN ProtonPlusWidgetsShortcutButton* proton_plus_widgets_shortcut_button_construct (GType object_type);
static void proton_plus_widgets_shortcut_button_set_shortcut_button_content (ProtonPlusWidgetsShortcutButton* self,
                                                                      AdwButtonContent* value);
static GObject * proton_plus_widgets_shortcut_button_constructor (GType type,
                                                           guint n_construct_properties,
                                                           GObjectConstructParam * construct_properties);
static void _proton_plus_widgets_shortcut_button_shortcut_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                      gpointer self);
static void proton_plus_widgets_shortcut_button_finalize (GObject * obj);
static GType proton_plus_widgets_shortcut_button_get_type_once (void);
static void _vala_proton_plus_widgets_shortcut_button_get_property (GObject * object,
                                                             guint property_id,
                                                             GValue * value,
                                                             GParamSpec * pspec);
static void _vala_proton_plus_widgets_shortcut_button_set_property (GObject * object,
                                                             guint property_id,
                                                             const GValue * value,
                                                             GParamSpec * pspec);

static inline gpointer
proton_plus_widgets_shortcut_button_get_instance_private (ProtonPlusWidgetsShortcutButton* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsShortcutButton_private_offset);
}

void
proton_plus_widgets_shortcut_button_load (ProtonPlusWidgetsShortcutButton* self,
                                          ProtonPlusModelsSteamProfile* profile)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (profile != NULL);
	proton_plus_widgets_shortcut_button_set_profile (self, profile);
	proton_plus_widgets_shortcut_button_refresh (self);
}

void
proton_plus_widgets_shortcut_button_reset (ProtonPlusWidgetsShortcutButton* self)
{
	AdwButtonContent* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_shortcut_button_content;
	adw_button_content_set_label (_tmp0_, _ ("Create shortcut"));
}

static void
proton_plus_widgets_shortcut_button_refresh (ProtonPlusWidgetsShortcutButton* self)
{
	gboolean shortcut_installed = FALSE;
	ProtonPlusModelsSteamProfile* _tmp0_;
	ProtonPlusVDFShortcuts* _tmp1_;
	ProtonPlusVDFShortcuts* _tmp2_;
	const gchar* _tmp3_ = NULL;
	AdwButtonContent* _tmp4_;
	const gchar* _tmp5_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_profile;
	_tmp1_ = proton_plus_models_steam_profile_get_shortcuts (_tmp0_);
	_tmp2_ = _tmp1_;
	shortcut_installed = proton_plus_vdf_shortcuts_get_installed_status (_tmp2_);
	if (!shortcut_installed) {
		_tmp3_ = _ ("Create shortcut");
	} else {
		_tmp3_ = _ ("Delete shortcut");
	}
	_tmp4_ = self->priv->_shortcut_button_content;
	adw_button_content_set_label (_tmp4_, _tmp3_);
	if (!shortcut_installed) {
		_tmp5_ = _ ("Create a shortcut of ProtonPlus in Steam");
	} else {
		_tmp5_ = _ ("Delete the shortcut of ProtonPlus in Steam");
	}
	gtk_widget_set_tooltip_text ((GtkWidget*) self, _tmp5_);
}

static void
___lambda35_ (ProtonPlusWidgetsShortcutButton* self,
              GObject* obj,
              GAsyncResult* res)
{
	gboolean success = FALSE;
	ProtonPlusModelsSteamProfile* _tmp0_;
	ProtonPlusVDFShortcuts* _tmp1_;
	ProtonPlusVDFShortcuts* _tmp2_;
	g_return_if_fail (res != NULL);
	_tmp0_ = self->priv->_profile;
	_tmp1_ = proton_plus_models_steam_profile_get_shortcuts (_tmp0_);
	_tmp2_ = _tmp1_;
	success = proton_plus_vdf_shortcuts_install_finish (_tmp2_, res);
	if (!success) {
		ProtonPlusWidgetsErrorDialog* dialog = NULL;
		ProtonPlusWidgetsErrorDialog* _tmp3_;
		ProtonPlusWidgetsErrorDialog* _tmp4_;
		ProtonPlusWidgetsWindow* _tmp5_;
		_tmp3_ = proton_plus_widgets_error_dialog_new (_ ("Couldn't create the shortcut in Steam"), _ ("Please report this issue on GitHub."));
		g_object_ref_sink (_tmp3_);
		dialog = _tmp3_;
		_tmp4_ = dialog;
		_tmp5_ = proton_plus_widgets_application_window;
		adw_dialog_present ((AdwDialog*) _tmp4_, (GtkWidget*) _tmp5_);
		_g_object_unref0 (dialog);
	}
	proton_plus_widgets_shortcut_button_refresh (self);
}

static void
____lambda35__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	___lambda35_ ((ProtonPlusWidgetsShortcutButton*) self, source_object, res);
	g_object_unref (self);
}

static void
proton_plus_widgets_shortcut_button_shortcut_button_clicked (ProtonPlusWidgetsShortcutButton* self)
{
	gboolean installed = FALSE;
	ProtonPlusModelsSteamProfile* _tmp0_;
	ProtonPlusVDFShortcuts* _tmp1_;
	ProtonPlusVDFShortcuts* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_profile;
	_tmp1_ = proton_plus_models_steam_profile_get_shortcuts (_tmp0_);
	_tmp2_ = _tmp1_;
	installed = proton_plus_vdf_shortcuts_get_installed_status (_tmp2_);
	if (installed) {
		gboolean success = FALSE;
		ProtonPlusModelsSteamProfile* _tmp3_;
		ProtonPlusVDFShortcuts* _tmp4_;
		ProtonPlusVDFShortcuts* _tmp5_;
		_tmp3_ = self->priv->_profile;
		_tmp4_ = proton_plus_models_steam_profile_get_shortcuts (_tmp3_);
		_tmp5_ = _tmp4_;
		success = proton_plus_vdf_shortcuts_uninstall (_tmp5_);
		if (!success) {
			ProtonPlusWidgetsErrorDialog* dialog = NULL;
			ProtonPlusWidgetsErrorDialog* _tmp6_;
			ProtonPlusWidgetsErrorDialog* _tmp7_;
			ProtonPlusWidgetsWindow* _tmp8_;
			_tmp6_ = proton_plus_widgets_error_dialog_new (_ ("Couldn't delete the shortcut in Steam"), _ ("Please report this issue on GitHub."));
			g_object_ref_sink (_tmp6_);
			dialog = _tmp6_;
			_tmp7_ = dialog;
			_tmp8_ = proton_plus_widgets_application_window;
			adw_dialog_present ((AdwDialog*) _tmp7_, (GtkWidget*) _tmp8_);
			_g_object_unref0 (dialog);
		}
		proton_plus_widgets_shortcut_button_refresh (self);
	} else {
		ProtonPlusModelsSteamProfile* _tmp9_;
		ProtonPlusVDFShortcuts* _tmp10_;
		ProtonPlusVDFShortcuts* _tmp11_;
		_tmp9_ = self->priv->_profile;
		_tmp10_ = proton_plus_models_steam_profile_get_shortcuts (_tmp9_);
		_tmp11_ = _tmp10_;
		proton_plus_vdf_shortcuts_install (_tmp11_, ____lambda35__gasync_ready_callback, g_object_ref (self));
	}
}

ProtonPlusWidgetsShortcutButton*
proton_plus_widgets_shortcut_button_construct (GType object_type)
{
	ProtonPlusWidgetsShortcutButton * self = NULL;
	self = (ProtonPlusWidgetsShortcutButton*) g_object_new (object_type, NULL);
	return self;
}

ProtonPlusWidgetsShortcutButton*
proton_plus_widgets_shortcut_button_new (void)
{
	return proton_plus_widgets_shortcut_button_construct (PROTON_PLUS_WIDGETS_TYPE_SHORTCUT_BUTTON);
}

static ProtonPlusModelsSteamProfile*
proton_plus_widgets_shortcut_button_get_profile (ProtonPlusWidgetsShortcutButton* self)
{
	ProtonPlusModelsSteamProfile* result;
	ProtonPlusModelsSteamProfile* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_profile;
	result = _tmp0_;
	return result;
}

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

static void
proton_plus_widgets_shortcut_button_set_profile (ProtonPlusWidgetsShortcutButton* self,
                                                 ProtonPlusModelsSteamProfile* value)
{
	ProtonPlusModelsSteamProfile* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_profile);
	self->priv->_profile = _tmp0_;
}

static AdwButtonContent*
proton_plus_widgets_shortcut_button_get_shortcut_button_content (ProtonPlusWidgetsShortcutButton* self)
{
	AdwButtonContent* result;
	AdwButtonContent* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_shortcut_button_content;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_shortcut_button_set_shortcut_button_content (ProtonPlusWidgetsShortcutButton* self,
                                                                 AdwButtonContent* value)
{
	AdwButtonContent* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_shortcut_button_content);
	self->priv->_shortcut_button_content = _tmp0_;
}

static void
_proton_plus_widgets_shortcut_button_shortcut_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                 gpointer self)
{
	proton_plus_widgets_shortcut_button_shortcut_button_clicked ((ProtonPlusWidgetsShortcutButton*) self);
}

static GObject *
proton_plus_widgets_shortcut_button_constructor (GType type,
                                                 guint n_construct_properties,
                                                 GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ProtonPlusWidgetsShortcutButton * self;
	AdwButtonContent* _tmp0_;
	AdwButtonContent* _tmp1_;
	AdwButtonContent* _tmp2_;
	AdwButtonContent* _tmp3_;
	parent_class = G_OBJECT_CLASS (proton_plus_widgets_shortcut_button_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_TYPE_SHORTCUT_BUTTON, ProtonPlusWidgetsShortcutButton);
	_tmp0_ = (AdwButtonContent*) adw_button_content_new ();
	g_object_ref_sink (_tmp0_);
	_tmp1_ = _tmp0_;
	proton_plus_widgets_shortcut_button_set_shortcut_button_content (self, _tmp1_);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = self->priv->_shortcut_button_content;
	adw_button_content_set_icon_name (_tmp2_, "bookmark-symbolic");
	g_signal_connect_object ((GtkButton*) self, "clicked", (GCallback) _proton_plus_widgets_shortcut_button_shortcut_button_clicked_gtk_button_clicked, self, 0);
	gtk_widget_add_css_class ((GtkWidget*) self, "flat");
	_tmp3_ = self->priv->_shortcut_button_content;
	gtk_button_set_child ((GtkButton*) self, (GtkWidget*) _tmp3_);
	return obj;
}

static void
proton_plus_widgets_shortcut_button_class_init (ProtonPlusWidgetsShortcutButtonClass * klass,
                                                gpointer klass_data)
{
	proton_plus_widgets_shortcut_button_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsShortcutButton_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_widgets_shortcut_button_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_widgets_shortcut_button_set_property;
	G_OBJECT_CLASS (klass)->constructor = proton_plus_widgets_shortcut_button_constructor;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_shortcut_button_finalize;
}

static void
proton_plus_widgets_shortcut_button_instance_init (ProtonPlusWidgetsShortcutButton * self,
                                                   gpointer klass)
{
	self->priv = proton_plus_widgets_shortcut_button_get_instance_private (self);
}

static void
proton_plus_widgets_shortcut_button_finalize (GObject * obj)
{
	ProtonPlusWidgetsShortcutButton * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_TYPE_SHORTCUT_BUTTON, ProtonPlusWidgetsShortcutButton);
	_g_object_unref0 (self->priv->_profile);
	_g_object_unref0 (self->priv->_shortcut_button_content);
	G_OBJECT_CLASS (proton_plus_widgets_shortcut_button_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_shortcut_button_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsShortcutButtonClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_shortcut_button_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsShortcutButton), 0, (GInstanceInitFunc) proton_plus_widgets_shortcut_button_instance_init, NULL };
	GType proton_plus_widgets_shortcut_button_type_id;
	proton_plus_widgets_shortcut_button_type_id = g_type_register_static (gtk_button_get_type (), "ProtonPlusWidgetsShortcutButton", &g_define_type_info, 0);
	ProtonPlusWidgetsShortcutButton_private_offset = g_type_add_instance_private (proton_plus_widgets_shortcut_button_type_id, sizeof (ProtonPlusWidgetsShortcutButtonPrivate));
	return proton_plus_widgets_shortcut_button_type_id;
}

GType
proton_plus_widgets_shortcut_button_get_type (void)
{
	static volatile gsize proton_plus_widgets_shortcut_button_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_shortcut_button_type_id__once)) {
		GType proton_plus_widgets_shortcut_button_type_id;
		proton_plus_widgets_shortcut_button_type_id = proton_plus_widgets_shortcut_button_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_shortcut_button_type_id__once, proton_plus_widgets_shortcut_button_type_id);
	}
	return proton_plus_widgets_shortcut_button_type_id__once;
}

static void
_vala_proton_plus_widgets_shortcut_button_get_property (GObject * object,
                                                        guint property_id,
                                                        GValue * value,
                                                        GParamSpec * pspec)
{
	ProtonPlusWidgetsShortcutButton * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_TYPE_SHORTCUT_BUTTON, ProtonPlusWidgetsShortcutButton);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_widgets_shortcut_button_set_property (GObject * object,
                                                        guint property_id,
                                                        const GValue * value,
                                                        GParamSpec * pspec)
{
	ProtonPlusWidgetsShortcutButton * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_TYPE_SHORTCUT_BUTTON, ProtonPlusWidgetsShortcutButton);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

