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

#include <gtk/gtk.h>
#include <glib-object.h>
#include <adwaita.h>
#include <glib.h>
#include <glib/gi18n-lib.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_DEFAULT_TOOL_BUTTON (proton_plus_widgets_default_tool_button_get_type ())
#define PROTON_PLUS_WIDGETS_DEFAULT_TOOL_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_TYPE_DEFAULT_TOOL_BUTTON, ProtonPlusWidgetsDefaultToolButton))
#define PROTON_PLUS_WIDGETS_DEFAULT_TOOL_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_TYPE_DEFAULT_TOOL_BUTTON, ProtonPlusWidgetsDefaultToolButtonClass))
#define PROTON_PLUS_WIDGETS_IS_DEFAULT_TOOL_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_TYPE_DEFAULT_TOOL_BUTTON))
#define PROTON_PLUS_WIDGETS_IS_DEFAULT_TOOL_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_TYPE_DEFAULT_TOOL_BUTTON))
#define PROTON_PLUS_WIDGETS_DEFAULT_TOOL_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_TYPE_DEFAULT_TOOL_BUTTON, ProtonPlusWidgetsDefaultToolButtonClass))

typedef struct _ProtonPlusWidgetsDefaultToolButton ProtonPlusWidgetsDefaultToolButton;
typedef struct _ProtonPlusWidgetsDefaultToolButtonClass ProtonPlusWidgetsDefaultToolButtonClass;
typedef struct _ProtonPlusWidgetsDefaultToolButtonPrivate ProtonPlusWidgetsDefaultToolButtonPrivate;

#define PROTON_PLUS_MODELS_TYPE_LAUNCHER (proton_plus_models_launcher_get_type ())
#define PROTON_PLUS_MODELS_LAUNCHER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_MODELS_TYPE_LAUNCHER, ProtonPlusModelsLauncher))
#define PROTON_PLUS_MODELS_LAUNCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_MODELS_TYPE_LAUNCHER, ProtonPlusModelsLauncherClass))
#define PROTON_PLUS_MODELS_IS_LAUNCHER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_MODELS_TYPE_LAUNCHER))
#define PROTON_PLUS_MODELS_IS_LAUNCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_MODELS_TYPE_LAUNCHER))
#define PROTON_PLUS_MODELS_LAUNCHER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_MODELS_TYPE_LAUNCHER, ProtonPlusModelsLauncherClass))

typedef struct _ProtonPlusModelsLauncher ProtonPlusModelsLauncher;
typedef struct _ProtonPlusModelsLauncherClass ProtonPlusModelsLauncherClass;

#define PROTON_PLUS_MODELS_LAUNCHERS_TYPE_STEAM (proton_plus_models_launchers_steam_get_type ())
#define PROTON_PLUS_MODELS_LAUNCHERS_STEAM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_MODELS_LAUNCHERS_TYPE_STEAM, ProtonPlusModelsLaunchersSteam))
#define PROTON_PLUS_MODELS_LAUNCHERS_STEAM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_MODELS_LAUNCHERS_TYPE_STEAM, ProtonPlusModelsLaunchersSteamClass))
#define PROTON_PLUS_MODELS_LAUNCHERS_IS_STEAM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_MODELS_LAUNCHERS_TYPE_STEAM))
#define PROTON_PLUS_MODELS_LAUNCHERS_IS_STEAM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_MODELS_LAUNCHERS_TYPE_STEAM))
#define PROTON_PLUS_MODELS_LAUNCHERS_STEAM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_MODELS_LAUNCHERS_TYPE_STEAM, ProtonPlusModelsLaunchersSteamClass))

typedef struct _ProtonPlusModelsLaunchersSteam ProtonPlusModelsLaunchersSteam;
typedef struct _ProtonPlusModelsLaunchersSteamClass ProtonPlusModelsLaunchersSteamClass;
enum  {
	PROTON_PLUS_WIDGETS_DEFAULT_TOOL_BUTTON_0_PROPERTY,
	PROTON_PLUS_WIDGETS_DEFAULT_TOOL_BUTTON_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_default_tool_button_properties[PROTON_PLUS_WIDGETS_DEFAULT_TOOL_BUTTON_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
enum  {
	PROTON_PLUS_WIDGETS_DEFAULT_TOOL_BUTTON_DEFAULT_TOOL_REQUESTED_SIGNAL,
	PROTON_PLUS_WIDGETS_DEFAULT_TOOL_BUTTON_NUM_SIGNALS
};
static guint proton_plus_widgets_default_tool_button_signals[PROTON_PLUS_WIDGETS_DEFAULT_TOOL_BUTTON_NUM_SIGNALS] = {0};

struct _ProtonPlusWidgetsDefaultToolButton {
	GtkButton parent_instance;
	ProtonPlusWidgetsDefaultToolButtonPrivate * priv;
};

struct _ProtonPlusWidgetsDefaultToolButtonClass {
	GtkButtonClass parent_class;
};

struct _ProtonPlusWidgetsDefaultToolButtonPrivate {
	AdwButtonContent* _default_tool_button_content;
	ProtonPlusModelsLaunchersSteam* _launcher;
};

static gint ProtonPlusWidgetsDefaultToolButton_private_offset;
static gpointer proton_plus_widgets_default_tool_button_parent_class = NULL;

VALA_EXTERN GType proton_plus_widgets_default_tool_button_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusWidgetsDefaultToolButton, g_object_unref)
VALA_EXTERN GType proton_plus_models_launcher_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusModelsLauncher, g_object_unref)
VALA_EXTERN GType proton_plus_models_launchers_steam_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusModelsLaunchersSteam, g_object_unref)
VALA_EXTERN void proton_plus_widgets_default_tool_button_load (ProtonPlusWidgetsDefaultToolButton* self,
                                                   ProtonPlusModelsLaunchersSteam* launcher);
static void proton_plus_widgets_default_tool_button_set_launcher (ProtonPlusWidgetsDefaultToolButton* self,
                                                           ProtonPlusModelsLaunchersSteam* value);
static void proton_plus_widgets_default_tool_button_default_tool_button_clicked (ProtonPlusWidgetsDefaultToolButton* self);
static ProtonPlusModelsLaunchersSteam* proton_plus_widgets_default_tool_button_get_launcher (ProtonPlusWidgetsDefaultToolButton* self);
VALA_EXTERN ProtonPlusWidgetsDefaultToolButton* proton_plus_widgets_default_tool_button_new (void);
VALA_EXTERN ProtonPlusWidgetsDefaultToolButton* proton_plus_widgets_default_tool_button_construct (GType object_type);
static AdwButtonContent* proton_plus_widgets_default_tool_button_get_default_tool_button_content (ProtonPlusWidgetsDefaultToolButton* self);
static void proton_plus_widgets_default_tool_button_set_default_tool_button_content (ProtonPlusWidgetsDefaultToolButton* self,
                                                                              AdwButtonContent* value);
static GObject * proton_plus_widgets_default_tool_button_constructor (GType type,
                                                               guint n_construct_properties,
                                                               GObjectConstructParam * construct_properties);
static void _proton_plus_widgets_default_tool_button_default_tool_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                              gpointer self);
static void proton_plus_widgets_default_tool_button_finalize (GObject * obj);
static GType proton_plus_widgets_default_tool_button_get_type_once (void);
static void _vala_proton_plus_widgets_default_tool_button_get_property (GObject * object,
                                                                 guint property_id,
                                                                 GValue * value,
                                                                 GParamSpec * pspec);
static void _vala_proton_plus_widgets_default_tool_button_set_property (GObject * object,
                                                                 guint property_id,
                                                                 const GValue * value,
                                                                 GParamSpec * pspec);

static inline gpointer
proton_plus_widgets_default_tool_button_get_instance_private (ProtonPlusWidgetsDefaultToolButton* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsDefaultToolButton_private_offset);
}

void
proton_plus_widgets_default_tool_button_load (ProtonPlusWidgetsDefaultToolButton* self,
                                              ProtonPlusModelsLaunchersSteam* launcher)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (launcher != NULL);
	proton_plus_widgets_default_tool_button_set_launcher (self, launcher);
}

static void
proton_plus_widgets_default_tool_button_default_tool_button_clicked (ProtonPlusWidgetsDefaultToolButton* self)
{
	ProtonPlusModelsLaunchersSteam* _tmp0_;
	ProtonPlusModelsLaunchersSteam* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_launcher;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->_launcher;
	g_signal_emit (self, proton_plus_widgets_default_tool_button_signals[PROTON_PLUS_WIDGETS_DEFAULT_TOOL_BUTTON_DEFAULT_TOOL_REQUESTED_SIGNAL], 0, _tmp1_);
}

ProtonPlusWidgetsDefaultToolButton*
proton_plus_widgets_default_tool_button_construct (GType object_type)
{
	ProtonPlusWidgetsDefaultToolButton * self = NULL;
	self = (ProtonPlusWidgetsDefaultToolButton*) g_object_new (object_type, NULL);
	return self;
}

ProtonPlusWidgetsDefaultToolButton*
proton_plus_widgets_default_tool_button_new (void)
{
	return proton_plus_widgets_default_tool_button_construct (PROTON_PLUS_WIDGETS_TYPE_DEFAULT_TOOL_BUTTON);
}

static AdwButtonContent*
proton_plus_widgets_default_tool_button_get_default_tool_button_content (ProtonPlusWidgetsDefaultToolButton* self)
{
	AdwButtonContent* result;
	AdwButtonContent* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_default_tool_button_content;
	result = _tmp0_;
	return result;
}

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

static void
proton_plus_widgets_default_tool_button_set_default_tool_button_content (ProtonPlusWidgetsDefaultToolButton* self,
                                                                         AdwButtonContent* value)
{
	AdwButtonContent* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_default_tool_button_content);
	self->priv->_default_tool_button_content = _tmp0_;
}

static ProtonPlusModelsLaunchersSteam*
proton_plus_widgets_default_tool_button_get_launcher (ProtonPlusWidgetsDefaultToolButton* self)
{
	ProtonPlusModelsLaunchersSteam* result;
	ProtonPlusModelsLaunchersSteam* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_launcher;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_default_tool_button_set_launcher (ProtonPlusWidgetsDefaultToolButton* self,
                                                      ProtonPlusModelsLaunchersSteam* value)
{
	ProtonPlusModelsLaunchersSteam* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_launcher);
	self->priv->_launcher = _tmp0_;
}

static void
_proton_plus_widgets_default_tool_button_default_tool_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                         gpointer self)
{
	proton_plus_widgets_default_tool_button_default_tool_button_clicked ((ProtonPlusWidgetsDefaultToolButton*) self);
}

static GObject *
proton_plus_widgets_default_tool_button_constructor (GType type,
                                                     guint n_construct_properties,
                                                     GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ProtonPlusWidgetsDefaultToolButton * self;
	AdwButtonContent* _tmp0_;
	AdwButtonContent* _tmp1_;
	AdwButtonContent* _tmp2_;
	AdwButtonContent* _tmp3_;
	AdwButtonContent* _tmp4_;
	parent_class = G_OBJECT_CLASS (proton_plus_widgets_default_tool_button_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_TYPE_DEFAULT_TOOL_BUTTON, ProtonPlusWidgetsDefaultToolButton);
	_tmp0_ = (AdwButtonContent*) adw_button_content_new ();
	g_object_ref_sink (_tmp0_);
	_tmp1_ = _tmp0_;
	proton_plus_widgets_default_tool_button_set_default_tool_button_content (self, _tmp1_);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = self->priv->_default_tool_button_content;
	adw_button_content_set_label (_tmp2_, _ ("Set the default compatibility tool"));
	_tmp3_ = self->priv->_default_tool_button_content;
	adw_button_content_set_icon_name (_tmp3_, "carambola-symbolic");
	g_signal_connect_object ((GtkButton*) self, "clicked", (GCallback) _proton_plus_widgets_default_tool_button_default_tool_button_clicked_gtk_button_clicked, self, 0);
	gtk_button_set_icon_name ((GtkButton*) self, "dots-symbolic");
	gtk_widget_set_tooltip_text ((GtkWidget*) self, _ ("Set the default compatibility tool"));
	_tmp4_ = self->priv->_default_tool_button_content;
	gtk_button_set_child ((GtkButton*) self, (GtkWidget*) _tmp4_);
	gtk_widget_add_css_class ((GtkWidget*) self, "flat");
	return obj;
}

static void
proton_plus_widgets_default_tool_button_class_init (ProtonPlusWidgetsDefaultToolButtonClass * klass,
                                                    gpointer klass_data)
{
	proton_plus_widgets_default_tool_button_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsDefaultToolButton_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_widgets_default_tool_button_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_widgets_default_tool_button_set_property;
	G_OBJECT_CLASS (klass)->constructor = proton_plus_widgets_default_tool_button_constructor;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_default_tool_button_finalize;
	proton_plus_widgets_default_tool_button_signals[PROTON_PLUS_WIDGETS_DEFAULT_TOOL_BUTTON_DEFAULT_TOOL_REQUESTED_SIGNAL] = g_signal_new ("default-tool-requested", PROTON_PLUS_WIDGETS_TYPE_DEFAULT_TOOL_BUTTON, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, PROTON_PLUS_MODELS_LAUNCHERS_TYPE_STEAM);
}

static void
proton_plus_widgets_default_tool_button_instance_init (ProtonPlusWidgetsDefaultToolButton * self,
                                                       gpointer klass)
{
	self->priv = proton_plus_widgets_default_tool_button_get_instance_private (self);
}

static void
proton_plus_widgets_default_tool_button_finalize (GObject * obj)
{
	ProtonPlusWidgetsDefaultToolButton * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_TYPE_DEFAULT_TOOL_BUTTON, ProtonPlusWidgetsDefaultToolButton);
	_g_object_unref0 (self->priv->_default_tool_button_content);
	_g_object_unref0 (self->priv->_launcher);
	G_OBJECT_CLASS (proton_plus_widgets_default_tool_button_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_default_tool_button_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsDefaultToolButtonClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_default_tool_button_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsDefaultToolButton), 0, (GInstanceInitFunc) proton_plus_widgets_default_tool_button_instance_init, NULL };
	GType proton_plus_widgets_default_tool_button_type_id;
	proton_plus_widgets_default_tool_button_type_id = g_type_register_static (gtk_button_get_type (), "ProtonPlusWidgetsDefaultToolButton", &g_define_type_info, 0);
	ProtonPlusWidgetsDefaultToolButton_private_offset = g_type_add_instance_private (proton_plus_widgets_default_tool_button_type_id, sizeof (ProtonPlusWidgetsDefaultToolButtonPrivate));
	return proton_plus_widgets_default_tool_button_type_id;
}

GType
proton_plus_widgets_default_tool_button_get_type (void)
{
	static volatile gsize proton_plus_widgets_default_tool_button_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_default_tool_button_type_id__once)) {
		GType proton_plus_widgets_default_tool_button_type_id;
		proton_plus_widgets_default_tool_button_type_id = proton_plus_widgets_default_tool_button_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_default_tool_button_type_id__once, proton_plus_widgets_default_tool_button_type_id);
	}
	return proton_plus_widgets_default_tool_button_type_id__once;
}

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

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

