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

/* -*- Mode: Vala; indent-tabs-mode: nil; tab-width: 2 -*-
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 * SPDX-FileCopyrightText: Michael Terry
 */

#include <adwaita.h>
#include <gtk/gtk.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.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 TYPE_HELP_BUTTON (help_button_get_type ())
#define HELP_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_HELP_BUTTON, HelpButton))
#define HELP_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_HELP_BUTTON, HelpButtonClass))
#define IS_HELP_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_HELP_BUTTON))
#define IS_HELP_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_HELP_BUTTON))
#define HELP_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_HELP_BUTTON, HelpButtonClass))

typedef struct _HelpButton HelpButton;
typedef struct _HelpButtonClass HelpButtonClass;
typedef struct _HelpButtonPrivate HelpButtonPrivate;
enum  {
	HELP_BUTTON_0_PROPERTY,
	HELP_BUTTON_ICON_NAME_PROPERTY,
	HELP_BUTTON_NUM_PROPERTIES
};
static GParamSpec* help_button_properties[HELP_BUTTON_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _HelpButton {
	AdwBin parent_instance;
	HelpButtonPrivate * priv;
};

struct _HelpButtonClass {
	AdwBinClass parent_class;
};

struct _HelpButtonPrivate {
	gchar* _icon_name;
	GtkBox* box;
};

static gint HelpButton_private_offset;
static gpointer help_button_parent_class = NULL;
static GtkBuildableIface * help_button_gtk_buildable_parent_iface = NULL;

VALA_EXTERN GType help_button_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (HelpButton, g_object_unref)
static void help_button_real_add_child (GtkBuildable* base,
                                 GtkBuilder* builder,
                                 GObject* child,
                                 const gchar* type);
VALA_EXTERN HelpButton* help_button_new (void);
VALA_EXTERN HelpButton* help_button_construct (GType object_type);
VALA_EXTERN const gchar* help_button_get_icon_name (HelpButton* self);
VALA_EXTERN void help_button_set_icon_name (HelpButton* self,
                                const gchar* value);
static void help_button_finalize (GObject * obj);
static GType help_button_get_type_once (void);
static void _vala_help_button_get_property (GObject * object,
                                     guint property_id,
                                     GValue * value,
                                     GParamSpec * pspec);
static void _vala_help_button_set_property (GObject * object,
                                     guint property_id,
                                     const GValue * value,
                                     GParamSpec * pspec);

static inline gpointer
help_button_get_instance_private (HelpButton* self)
{
	return G_STRUCT_MEMBER_P (self, HelpButton_private_offset);
}

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

static void
help_button_real_add_child (GtkBuildable* base,
                            GtkBuilder* builder,
                            GObject* child,
                            const gchar* type)
{
	HelpButton * self;
	GtkWidget* widget = NULL;
	GtkWidget* _tmp0_;
	gboolean _tmp1_ = FALSE;
	GtkBox* _tmp2_;
	self = (HelpButton*) base;
	g_return_if_fail (builder != NULL);
	g_return_if_fail (child != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (child, gtk_widget_get_type ()) ? ((GtkWidget*) child) : NULL);
	widget = _tmp0_;
	_tmp2_ = self->priv->box;
	if (_tmp2_ != NULL) {
		GtkWidget* _tmp3_;
		_tmp3_ = widget;
		_tmp1_ = _tmp3_ != NULL;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		GtkBox* _tmp4_;
		GtkWidget* _tmp5_;
		_tmp4_ = self->priv->box;
		_tmp5_ = widget;
		gtk_box_append (_tmp4_, _tmp5_);
	} else {
		help_button_gtk_buildable_parent_iface->add_child ((GtkBuildable*) G_TYPE_CHECK_INSTANCE_CAST (self, adw_bin_get_type (), AdwBin), builder, child, type);
	}
	_g_object_unref0 (widget);
}

HelpButton*
help_button_construct (GType object_type)
{
	HelpButton * self = NULL;
	self = (HelpButton*) g_object_new (object_type, NULL);
	return self;
}

HelpButton*
help_button_new (void)
{
	return help_button_construct (TYPE_HELP_BUTTON);
}

const gchar*
help_button_get_icon_name (HelpButton* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_icon_name;
	result = _tmp0_;
	return result;
}

void
help_button_set_icon_name (HelpButton* self,
                           const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = help_button_get_icon_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_icon_name);
		self->priv->_icon_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, help_button_properties[HELP_BUTTON_ICON_NAME_PROPERTY]);
	}
}

static void
help_button_class_init (HelpButtonClass * klass,
                        gpointer klass_data)
{
	help_button_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &HelpButton_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_help_button_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_help_button_set_property;
	G_OBJECT_CLASS (klass)->finalize = help_button_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), HELP_BUTTON_ICON_NAME_PROPERTY, help_button_properties[HELP_BUTTON_ICON_NAME_PROPERTY] = g_param_spec_string ("icon-name", "icon-name", "icon-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/DejaDup/HelpButton.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "box", FALSE, HelpButton_private_offset + G_STRUCT_OFFSET (HelpButtonPrivate, box));
}

static void
help_button_gtk_buildable_interface_init (GtkBuildableIface * iface,
                                          gpointer iface_data)
{
	help_button_gtk_buildable_parent_iface = g_type_interface_peek_parent (iface);
	iface->add_child = (void (*) (GtkBuildable*, GtkBuilder*, GObject*, const gchar*)) help_button_real_add_child;
}

static void
help_button_instance_init (HelpButton * self,
                           gpointer klass)
{
	gchar* _tmp0_;
	self->priv = help_button_get_instance_private (self);
	_tmp0_ = g_strdup ("info-outline-symbolic");
	self->priv->_icon_name = _tmp0_;
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
help_button_finalize (GObject * obj)
{
	HelpButton * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_HELP_BUTTON, HelpButton);
	_g_free0 (self->priv->_icon_name);
	G_OBJECT_CLASS (help_button_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
help_button_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (HelpButtonClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) help_button_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (HelpButton), 0, (GInstanceInitFunc) help_button_instance_init, NULL };
	static const GInterfaceInfo gtk_buildable_info = { (GInterfaceInitFunc) help_button_gtk_buildable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType help_button_type_id;
	help_button_type_id = g_type_register_static (adw_bin_get_type (), "HelpButton", &g_define_type_info, 0);
	g_type_add_interface_static (help_button_type_id, gtk_buildable_get_type (), &gtk_buildable_info);
	HelpButton_private_offset = g_type_add_instance_private (help_button_type_id, sizeof (HelpButtonPrivate));
	return help_button_type_id;
}

GType
help_button_get_type (void)
{
	static gsize help_button_type_id__once = 0;
	if (g_once_init_enter (&help_button_type_id__once)) {
		GType help_button_type_id;
		help_button_type_id = help_button_get_type_once ();
		g_once_init_leave (&help_button_type_id__once, help_button_type_id);
	}
	return help_button_type_id__once;
}

static void
_vala_help_button_get_property (GObject * object,
                                guint property_id,
                                GValue * value,
                                GParamSpec * pspec)
{
	HelpButton * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_HELP_BUTTON, HelpButton);
	switch (property_id) {
		case HELP_BUTTON_ICON_NAME_PROPERTY:
		g_value_set_string (value, help_button_get_icon_name (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_help_button_set_property (GObject * object,
                                guint property_id,
                                const GValue * value,
                                GParamSpec * pspec)
{
	HelpButton * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_HELP_BUTTON, HelpButton);
	switch (property_id) {
		case HELP_BUTTON_ICON_NAME_PROPERTY:
		help_button_set_icon_name (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

