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

#include <gtk/gtk.h>
#include <glib-object.h>
#include <gdk/gdk.h>
#include <glib.h>
#include <stdlib.h>
#include <string.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 TUBA_WIDGETS_TYPE_BACKGROUND (tuba_widgets_background_get_type ())
#define TUBA_WIDGETS_BACKGROUND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_BACKGROUND, TubaWidgetsBackground))
#define TUBA_WIDGETS_BACKGROUND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_BACKGROUND, TubaWidgetsBackgroundClass))
#define TUBA_WIDGETS_IS_BACKGROUND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_BACKGROUND))
#define TUBA_WIDGETS_IS_BACKGROUND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_BACKGROUND))
#define TUBA_WIDGETS_BACKGROUND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_BACKGROUND, TubaWidgetsBackgroundClass))

typedef struct _TubaWidgetsBackground TubaWidgetsBackground;
typedef struct _TubaWidgetsBackgroundClass TubaWidgetsBackgroundClass;
typedef struct _TubaWidgetsBackgroundPrivate TubaWidgetsBackgroundPrivate;
enum  {
	TUBA_WIDGETS_BACKGROUND_0_PROPERTY,
	TUBA_WIDGETS_BACKGROUND_PAINTABLE_PROPERTY,
	TUBA_WIDGETS_BACKGROUND_ALTERNATIVE_TEXT_PROPERTY,
	TUBA_WIDGETS_BACKGROUND_NUM_PROPERTIES
};
static GParamSpec* tuba_widgets_background_properties[TUBA_WIDGETS_BACKGROUND_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _TubaWidgetsBackground {
	GtkButton parent_instance;
	TubaWidgetsBackgroundPrivate * priv;
};

struct _TubaWidgetsBackgroundClass {
	GtkButtonClass parent_class;
};

struct _TubaWidgetsBackgroundPrivate {
	GtkPicture* background;
};

static gint TubaWidgetsBackground_private_offset;
static gpointer tuba_widgets_background_parent_class = NULL;

VALA_EXTERN GType tuba_widgets_background_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsBackground, g_object_unref)
VALA_EXTERN TubaWidgetsBackground* tuba_widgets_background_new (void);
VALA_EXTERN TubaWidgetsBackground* tuba_widgets_background_construct (GType object_type);
VALA_EXTERN GdkPaintable* tuba_widgets_background_get_paintable (TubaWidgetsBackground* self);
VALA_EXTERN void tuba_widgets_background_set_paintable (TubaWidgetsBackground* self,
                                            GdkPaintable* value);
VALA_EXTERN const gchar* tuba_widgets_background_get_alternative_text (TubaWidgetsBackground* self);
VALA_EXTERN void tuba_widgets_background_set_alternative_text (TubaWidgetsBackground* self,
                                                   const gchar* value);
static GObject * tuba_widgets_background_constructor (GType type,
                                               guint n_construct_properties,
                                               GObjectConstructParam * construct_properties);
static void tuba_widgets_background_finalize (GObject * obj);
static GType tuba_widgets_background_get_type_once (void);
static void _vala_tuba_widgets_background_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec);
static void _vala_tuba_widgets_background_set_property (GObject * object,
                                                 guint property_id,
                                                 const GValue * value,
                                                 GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
tuba_widgets_background_get_instance_private (TubaWidgetsBackground* self)
{
	return G_STRUCT_MEMBER_P (self, TubaWidgetsBackground_private_offset);
}

TubaWidgetsBackground*
tuba_widgets_background_construct (GType object_type)
{
	TubaWidgetsBackground * self = NULL;
	self = (TubaWidgetsBackground*) g_object_new (object_type, NULL);
	return self;
}

TubaWidgetsBackground*
tuba_widgets_background_new (void)
{
	return tuba_widgets_background_construct (TUBA_WIDGETS_TYPE_BACKGROUND);
}

GdkPaintable*
tuba_widgets_background_get_paintable (TubaWidgetsBackground* self)
{
	GdkPaintable* result;
	GtkPicture* _tmp0_;
	GdkPaintable* _tmp1_;
	GdkPaintable* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->background;
	_tmp1_ = gtk_picture_get_paintable (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

void
tuba_widgets_background_set_paintable (TubaWidgetsBackground* self,
                                       GdkPaintable* value)
{
	GtkPicture* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->background;
	gtk_picture_set_paintable (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, tuba_widgets_background_properties[TUBA_WIDGETS_BACKGROUND_PAINTABLE_PROPERTY]);
}

const gchar*
tuba_widgets_background_get_alternative_text (TubaWidgetsBackground* self)
{
	const gchar* result;
	GtkPicture* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->background;
	_tmp1_ = gtk_picture_get_alternative_text (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

void
tuba_widgets_background_set_alternative_text (TubaWidgetsBackground* self,
                                              const gchar* value)
{
	GtkPicture* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->background;
	gtk_picture_set_alternative_text (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, tuba_widgets_background_properties[TUBA_WIDGETS_BACKGROUND_ALTERNATIVE_TEXT_PROPERTY]);
}

static GObject *
tuba_widgets_background_constructor (GType type,
                                     guint n_construct_properties,
                                     GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TubaWidgetsBackground * self;
	GtkPicture* _tmp0_ = NULL;
	GtkPicture* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar** _tmp6_;
	gchar** _tmp7_;
	gint _tmp7__length1;
	parent_class = G_OBJECT_CLASS (tuba_widgets_background_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_TYPE_BACKGROUND, TubaWidgetsBackground);
	_tmp0_ = (GtkPicture*) gtk_picture_new ();
	gtk_picture_set_content_fit (_tmp0_, GTK_CONTENT_FIT_COVER);
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->background);
	self->priv->background = _tmp0_;
	_tmp1_ = self->priv->background;
	gtk_button_set_child ((GtkButton*) self, (GtkWidget*) _tmp1_);
	_tmp2_ = g_strdup ("flat");
	_tmp3_ = g_strdup ("image-button");
	_tmp4_ = g_strdup ("ttl-flat-button");
	_tmp5_ = g_strdup ("header-image");
	_tmp6_ = g_new0 (gchar*, 4 + 1);
	_tmp6_[0] = _tmp2_;
	_tmp6_[1] = _tmp3_;
	_tmp6_[2] = _tmp4_;
	_tmp6_[3] = _tmp5_;
	_tmp7_ = _tmp6_;
	_tmp7__length1 = 4;
	gtk_widget_set_css_classes ((GtkWidget*) self, _tmp7_);
	_tmp7_ = (_vala_array_free (_tmp7_, _tmp7__length1, (GDestroyNotify) g_free), NULL);
	return obj;
}

static void
tuba_widgets_background_class_init (TubaWidgetsBackgroundClass * klass,
                                    gpointer klass_data)
{
	tuba_widgets_background_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaWidgetsBackground_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_widgets_background_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_widgets_background_set_property;
	G_OBJECT_CLASS (klass)->constructor = tuba_widgets_background_constructor;
	G_OBJECT_CLASS (klass)->finalize = tuba_widgets_background_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_BACKGROUND_PAINTABLE_PROPERTY, tuba_widgets_background_properties[TUBA_WIDGETS_BACKGROUND_PAINTABLE_PROPERTY] = g_param_spec_object ("paintable", "paintable", "paintable", gdk_paintable_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_BACKGROUND_ALTERNATIVE_TEXT_PROPERTY, tuba_widgets_background_properties[TUBA_WIDGETS_BACKGROUND_ALTERNATIVE_TEXT_PROPERTY] = g_param_spec_string ("alternative-text", "alternative-text", "alternative-text", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
tuba_widgets_background_instance_init (TubaWidgetsBackground * self,
                                       gpointer klass)
{
	self->priv = tuba_widgets_background_get_instance_private (self);
}

static void
tuba_widgets_background_finalize (GObject * obj)
{
	TubaWidgetsBackground * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_TYPE_BACKGROUND, TubaWidgetsBackground);
	_g_object_unref0 (self->priv->background);
	G_OBJECT_CLASS (tuba_widgets_background_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_widgets_background_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaWidgetsBackgroundClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_widgets_background_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaWidgetsBackground), 0, (GInstanceInitFunc) tuba_widgets_background_instance_init, NULL };
	GType tuba_widgets_background_type_id;
	tuba_widgets_background_type_id = g_type_register_static (gtk_button_get_type (), "TubaWidgetsBackground", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaWidgetsBackground_private_offset = g_type_add_instance_private (tuba_widgets_background_type_id, sizeof (TubaWidgetsBackgroundPrivate));
	return tuba_widgets_background_type_id;
}

GType
tuba_widgets_background_get_type (void)
{
	static GType tuba_widgets_background_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_widgets_background_type_id__once)) {
		GType tuba_widgets_background_type_id;
		tuba_widgets_background_type_id = tuba_widgets_background_get_type_once ();
		g_once_init_leave_pointer (&tuba_widgets_background_type_id__once, tuba_widgets_background_type_id);
	}
	return tuba_widgets_background_type_id__once;
}

static void
_vala_tuba_widgets_background_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec)
{
	TubaWidgetsBackground * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_WIDGETS_TYPE_BACKGROUND, TubaWidgetsBackground);
	switch (property_id) {
		case TUBA_WIDGETS_BACKGROUND_PAINTABLE_PROPERTY:
		g_value_set_object (value, tuba_widgets_background_get_paintable (self));
		break;
		case TUBA_WIDGETS_BACKGROUND_ALTERNATIVE_TEXT_PROPERTY:
		g_value_set_string (value, tuba_widgets_background_get_alternative_text (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_widgets_background_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec)
{
	TubaWidgetsBackground * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_WIDGETS_TYPE_BACKGROUND, TubaWidgetsBackground);
	switch (property_id) {
		case TUBA_WIDGETS_BACKGROUND_PAINTABLE_PROPERTY:
		tuba_widgets_background_set_paintable (self, g_value_get_object (value));
		break;
		case TUBA_WIDGETS_BACKGROUND_ALTERNATIVE_TEXT_PROPERTY:
		tuba_widgets_background_set_alternative_text (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

