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

/* welcome-page.vala
 *
 * Copyright 2022 Vojtěch Perník
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <adwaita.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gtk/gtk.h>

#define WG_CONSTANTS_APP_ID "app.drey.Blurble"
#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 WG_TYPE_WELCOME_PAGE (wg_welcome_page_get_type ())
#define WG_WELCOME_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WG_TYPE_WELCOME_PAGE, WGWelcomePage))
#define WG_WELCOME_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WG_TYPE_WELCOME_PAGE, WGWelcomePageClass))
#define WG_IS_WELCOME_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WG_TYPE_WELCOME_PAGE))
#define WG_IS_WELCOME_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WG_TYPE_WELCOME_PAGE))
#define WG_WELCOME_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WG_TYPE_WELCOME_PAGE, WGWelcomePageClass))

typedef struct _WGWelcomePage WGWelcomePage;
typedef struct _WGWelcomePageClass WGWelcomePageClass;
typedef struct _WGWelcomePagePrivate WGWelcomePagePrivate;
enum  {
	WG_WELCOME_PAGE_0_PROPERTY,
	WG_WELCOME_PAGE_ICON_NAME_PROPERTY,
	WG_WELCOME_PAGE_NUM_PROPERTIES
};
static GParamSpec* wg_welcome_page_properties[WG_WELCOME_PAGE_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	WG_WELCOME_PAGE_PLAY_SIGNAL,
	WG_WELCOME_PAGE_NUM_SIGNALS
};
static guint wg_welcome_page_signals[WG_WELCOME_PAGE_NUM_SIGNALS] = {0};

struct _WGWelcomePage {
	AdwBin parent_instance;
	WGWelcomePagePrivate * priv;
};

struct _WGWelcomePageClass {
	AdwBinClass parent_class;
};

struct _WGWelcomePagePrivate {
	gchar* _icon_name;
	GtkButton* play_button;
};

static gint WGWelcomePage_private_offset;
static gpointer wg_welcome_page_parent_class = NULL;

VALA_EXTERN GType wg_welcome_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WGWelcomePage, g_object_unref)
VALA_EXTERN WGWelcomePage* wg_welcome_page_new (void);
VALA_EXTERN WGWelcomePage* wg_welcome_page_construct (GType object_type);
VALA_EXTERN const gchar* wg_welcome_page_get_icon_name (WGWelcomePage* self);
static void wg_welcome_page_set_icon_name (WGWelcomePage* self,
                                    const gchar* value);
static GObject * wg_welcome_page_constructor (GType type,
                                       guint n_construct_properties,
                                       GObjectConstructParam * construct_properties);
static void _wg_welcome_page___lambda5_ (WGWelcomePage* self);
static void __wg_welcome_page___lambda5__gtk_button_clicked (GtkButton* _sender,
                                                      gpointer self);
static void wg_welcome_page_finalize (GObject * obj);
static GType wg_welcome_page_get_type_once (void);
static void _vala_wg_welcome_page_get_property (GObject * object,
                                         guint property_id,
                                         GValue * value,
                                         GParamSpec * pspec);
static void _vala_wg_welcome_page_set_property (GObject * object,
                                         guint property_id,
                                         const GValue * value,
                                         GParamSpec * pspec);

static inline gpointer
wg_welcome_page_get_instance_private (WGWelcomePage* self)
{
	return G_STRUCT_MEMBER_P (self, WGWelcomePage_private_offset);
}

WGWelcomePage*
wg_welcome_page_construct (GType object_type)
{
	WGWelcomePage * self = NULL;
	self = (WGWelcomePage*) g_object_new (object_type, NULL);
	return self;
}

WGWelcomePage*
wg_welcome_page_new (void)
{
	return wg_welcome_page_construct (WG_TYPE_WELCOME_PAGE);
}

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

static void
wg_welcome_page_set_icon_name (WGWelcomePage* self,
                               const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = wg_welcome_page_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, wg_welcome_page_properties[WG_WELCOME_PAGE_ICON_NAME_PROPERTY]);
	}
}

static void
_wg_welcome_page___lambda5_ (WGWelcomePage* self)
{
	g_signal_emit (self, wg_welcome_page_signals[WG_WELCOME_PAGE_PLAY_SIGNAL], 0);
}

static void
__wg_welcome_page___lambda5__gtk_button_clicked (GtkButton* _sender,
                                                 gpointer self)
{
	_wg_welcome_page___lambda5_ ((WGWelcomePage*) self);
}

static GObject *
wg_welcome_page_constructor (GType type,
                             guint n_construct_properties,
                             GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	WGWelcomePage * self;
	GtkButton* _tmp0_;
	parent_class = G_OBJECT_CLASS (wg_welcome_page_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WG_TYPE_WELCOME_PAGE, WGWelcomePage);
	_tmp0_ = self->priv->play_button;
	g_signal_connect_object (_tmp0_, "clicked", (GCallback) __wg_welcome_page___lambda5__gtk_button_clicked, self, 0);
	return obj;
}

static void
wg_welcome_page_class_init (WGWelcomePageClass * klass,
                            gpointer klass_data)
{
	wg_welcome_page_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &WGWelcomePage_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_wg_welcome_page_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_wg_welcome_page_set_property;
	G_OBJECT_CLASS (klass)->constructor = wg_welcome_page_constructor;
	G_OBJECT_CLASS (klass)->finalize = wg_welcome_page_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), WG_WELCOME_PAGE_ICON_NAME_PROPERTY, wg_welcome_page_properties[WG_WELCOME_PAGE_ICON_NAME_PROPERTY] = g_param_spec_string ("icon-name", "icon-name", "icon-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/app/drey/Blurble/welcome-page.ui");
	wg_welcome_page_signals[WG_WELCOME_PAGE_PLAY_SIGNAL] = g_signal_new ("play", WG_TYPE_WELCOME_PAGE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "play_button", FALSE, WGWelcomePage_private_offset + G_STRUCT_OFFSET (WGWelcomePagePrivate, play_button));
}

static void
wg_welcome_page_instance_init (WGWelcomePage * self,
                               gpointer klass)
{
	gchar* _tmp0_;
	self->priv = wg_welcome_page_get_instance_private (self);
	_tmp0_ = g_strdup (WG_CONSTANTS_APP_ID);
	self->priv->_icon_name = _tmp0_;
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
wg_welcome_page_finalize (GObject * obj)
{
	WGWelcomePage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WG_TYPE_WELCOME_PAGE, WGWelcomePage);
	_g_free0 (self->priv->_icon_name);
	G_OBJECT_CLASS (wg_welcome_page_parent_class)->finalize (obj);
}

static GType
wg_welcome_page_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (WGWelcomePageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) wg_welcome_page_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WGWelcomePage), 0, (GInstanceInitFunc) wg_welcome_page_instance_init, NULL };
	GType wg_welcome_page_type_id;
	wg_welcome_page_type_id = g_type_register_static (adw_bin_get_type (), "WGWelcomePage", &g_define_type_info, 0);
	WGWelcomePage_private_offset = g_type_add_instance_private (wg_welcome_page_type_id, sizeof (WGWelcomePagePrivate));
	return wg_welcome_page_type_id;
}

GType
wg_welcome_page_get_type (void)
{
	static volatile gsize wg_welcome_page_type_id__once = 0;
	if (g_once_init_enter (&wg_welcome_page_type_id__once)) {
		GType wg_welcome_page_type_id;
		wg_welcome_page_type_id = wg_welcome_page_get_type_once ();
		g_once_init_leave (&wg_welcome_page_type_id__once, wg_welcome_page_type_id);
	}
	return wg_welcome_page_type_id__once;
}

static void
_vala_wg_welcome_page_get_property (GObject * object,
                                    guint property_id,
                                    GValue * value,
                                    GParamSpec * pspec)
{
	WGWelcomePage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WG_TYPE_WELCOME_PAGE, WGWelcomePage);
	switch (property_id) {
		case WG_WELCOME_PAGE_ICON_NAME_PROPERTY:
		g_value_set_string (value, wg_welcome_page_get_icon_name (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_wg_welcome_page_set_property (GObject * object,
                                    guint property_id,
                                    const GValue * value,
                                    GParamSpec * pspec)
{
	WGWelcomePage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WG_TYPE_WELCOME_PAGE, WGWelcomePage);
	switch (property_id) {
		case WG_WELCOME_PAGE_ICON_NAME_PROPERTY:
		wg_welcome_page_set_icon_name (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

