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

#include <adwaita.h>
#include <glib-object.h>
#include <gtk/gtk.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 SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_CLOSE_BUTTON (sway_notification_center_notification_close_button_get_type ())
#define SWAY_NOTIFICATION_CENTER_NOTIFICATION_CLOSE_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_CLOSE_BUTTON, SwayNotificationCenterNotificationCloseButton))
#define SWAY_NOTIFICATION_CENTER_NOTIFICATION_CLOSE_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_CLOSE_BUTTON, SwayNotificationCenterNotificationCloseButtonClass))
#define SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_CLOSE_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_CLOSE_BUTTON))
#define SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_CLOSE_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_CLOSE_BUTTON))
#define SWAY_NOTIFICATION_CENTER_NOTIFICATION_CLOSE_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_CLOSE_BUTTON, SwayNotificationCenterNotificationCloseButtonClass))

typedef struct _SwayNotificationCenterNotificationCloseButton SwayNotificationCenterNotificationCloseButton;
typedef struct _SwayNotificationCenterNotificationCloseButtonClass SwayNotificationCenterNotificationCloseButtonClass;
typedef struct _SwayNotificationCenterNotificationCloseButtonPrivate SwayNotificationCenterNotificationCloseButtonPrivate;
enum  {
	SWAY_NOTIFICATION_CENTER_NOTIFICATION_CLOSE_BUTTON_0_PROPERTY,
	SWAY_NOTIFICATION_CENTER_NOTIFICATION_CLOSE_BUTTON_NUM_PROPERTIES
};
static GParamSpec* sway_notification_center_notification_close_button_properties[SWAY_NOTIFICATION_CENTER_NOTIFICATION_CLOSE_BUTTON_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
enum  {
	SWAY_NOTIFICATION_CENTER_NOTIFICATION_CLOSE_BUTTON_CLICKED_SIGNAL,
	SWAY_NOTIFICATION_CENTER_NOTIFICATION_CLOSE_BUTTON_NUM_SIGNALS
};
static guint sway_notification_center_notification_close_button_signals[SWAY_NOTIFICATION_CENTER_NOTIFICATION_CLOSE_BUTTON_NUM_SIGNALS] = {0};

struct _SwayNotificationCenterNotificationCloseButton {
	AdwBin parent_instance;
	SwayNotificationCenterNotificationCloseButtonPrivate * priv;
};

struct _SwayNotificationCenterNotificationCloseButtonClass {
	AdwBinClass parent_class;
};

struct _SwayNotificationCenterNotificationCloseButtonPrivate {
	GtkRevealer* revealer;
	GtkButton* button;
};

static gint SwayNotificationCenterNotificationCloseButton_private_offset;
static gpointer sway_notification_center_notification_close_button_parent_class = NULL;

VALA_EXTERN GType sway_notification_center_notification_close_button_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SwayNotificationCenterNotificationCloseButton, g_object_unref)
static void sway_notification_center_notification_close_button_click_cb (SwayNotificationCenterNotificationCloseButton* self);
VALA_EXTERN void sway_notification_center_notification_close_button_set_reveal (SwayNotificationCenterNotificationCloseButton* self,
                                                                    gboolean state);
VALA_EXTERN void sway_notification_center_notification_close_button_set_transition_duration (SwayNotificationCenterNotificationCloseButton* self,
                                                                                 guint duration);
VALA_EXTERN SwayNotificationCenterNotificationCloseButton* sway_notification_center_notification_close_button_new (void);
VALA_EXTERN SwayNotificationCenterNotificationCloseButton* sway_notification_center_notification_close_button_construct (GType object_type);
static GObject * sway_notification_center_notification_close_button_constructor (GType type,
                                                                          guint n_construct_properties,
                                                                          GObjectConstructParam * construct_properties);
static void _sway_notification_center_notification_close_button___lambda12_ (SwayNotificationCenterNotificationCloseButton* self);
static void __sway_notification_center_notification_close_button___lambda12__g_object_notify (GObject* _sender,
                                                                                       GParamSpec* pspec,
                                                                                       gpointer self);
static void _sway_notification_center_notification_close_button_click_cb_gtk_button_clicked (GtkButton* _sender,
                                                                                      gpointer self);
static void sway_notification_center_notification_close_button_finalize (GObject * obj);
static GType sway_notification_center_notification_close_button_get_type_once (void);

static inline gpointer
sway_notification_center_notification_close_button_get_instance_private (SwayNotificationCenterNotificationCloseButton* self)
{
	return G_STRUCT_MEMBER_P (self, SwayNotificationCenterNotificationCloseButton_private_offset);
}

static void
sway_notification_center_notification_close_button_click_cb (SwayNotificationCenterNotificationCloseButton* self)
{
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_CLOSE_BUTTON (self));
	g_signal_emit (self, sway_notification_center_notification_close_button_signals[SWAY_NOTIFICATION_CENTER_NOTIFICATION_CLOSE_BUTTON_CLICKED_SIGNAL], 0);
}

void
sway_notification_center_notification_close_button_set_reveal (SwayNotificationCenterNotificationCloseButton* self,
                                                               gboolean state)
{
	GtkRevealer* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	GtkRevealer* _tmp3_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_CLOSE_BUTTON (self));
	_tmp0_ = self->priv->revealer;
	_tmp1_ = gtk_revealer_get_reveal_child (_tmp0_);
	_tmp2_ = _tmp1_;
	if (state == _tmp2_) {
		gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), state);
		return;
	}
	if (state) {
		gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), TRUE);
	}
	_tmp3_ = self->priv->revealer;
	gtk_revealer_set_reveal_child (_tmp3_, state);
}

void
sway_notification_center_notification_close_button_set_transition_duration (SwayNotificationCenterNotificationCloseButton* self,
                                                                            guint duration)
{
	GtkRevealer* _tmp0_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_CLOSE_BUTTON (self));
	_tmp0_ = self->priv->revealer;
	gtk_revealer_set_transition_duration (_tmp0_, duration);
}

SwayNotificationCenterNotificationCloseButton*
sway_notification_center_notification_close_button_construct (GType object_type)
{
	SwayNotificationCenterNotificationCloseButton * self = NULL;
	self = (SwayNotificationCenterNotificationCloseButton*) g_object_new (object_type, NULL);
	return self;
}

SwayNotificationCenterNotificationCloseButton*
sway_notification_center_notification_close_button_new (void)
{
	return sway_notification_center_notification_close_button_construct (SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_CLOSE_BUTTON);
}

static void
_sway_notification_center_notification_close_button___lambda12_ (SwayNotificationCenterNotificationCloseButton* self)
{
	GtkRevealer* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	_tmp0_ = self->priv->revealer;
	_tmp1_ = gtk_revealer_get_reveal_child (_tmp0_);
	_tmp2_ = _tmp1_;
	gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), _tmp2_);
}

static void
__sway_notification_center_notification_close_button___lambda12__g_object_notify (GObject* _sender,
                                                                                  GParamSpec* pspec,
                                                                                  gpointer self)
{
	_sway_notification_center_notification_close_button___lambda12_ ((SwayNotificationCenterNotificationCloseButton*) self);
}

static void
_sway_notification_center_notification_close_button_click_cb_gtk_button_clicked (GtkButton* _sender,
                                                                                 gpointer self)
{
	sway_notification_center_notification_close_button_click_cb ((SwayNotificationCenterNotificationCloseButton*) self);
}

static GObject *
sway_notification_center_notification_close_button_constructor (GType type,
                                                                guint n_construct_properties,
                                                                GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SwayNotificationCenterNotificationCloseButton * self;
	GtkRevealer* _tmp0_ = NULL;
	GtkRevealer* _tmp1_;
	GtkRevealer* _tmp2_;
	GtkButton* _tmp3_ = NULL;
	GtkButton* _tmp4_;
	GtkButton* _tmp5_;
	GtkButton* _tmp6_;
	GtkRevealer* _tmp7_;
	GtkButton* _tmp8_;
	parent_class = G_OBJECT_CLASS (sway_notification_center_notification_close_button_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_CLOSE_BUTTON, SwayNotificationCenterNotificationCloseButton);
	gtk_widget_set_valign (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_START);
	gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_END);
	_tmp0_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_transition_type (_tmp0_, GTK_REVEALER_TRANSITION_TYPE_CROSSFADE);
	gtk_revealer_set_reveal_child (_tmp0_, FALSE);
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->revealer);
	self->priv->revealer = _tmp0_;
	_tmp1_ = self->priv->revealer;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, G_TYPE_OBJECT, GObject), "notify::child-revealed", (GCallback) __sway_notification_center_notification_close_button___lambda12__g_object_notify, self, 0);
	_tmp2_ = self->priv->revealer;
	adw_bin_set_child (G_TYPE_CHECK_INSTANCE_CAST (self, adw_bin_get_type (), AdwBin), G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_widget_get_type (), GtkWidget));
	_tmp3_ = (GtkButton*) gtk_button_new_from_icon_name ("swaync-close-symbolic");
	gtk_button_set_has_frame (_tmp3_, FALSE);
	gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_CENTER);
	gtk_widget_set_valign (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp3_);
	_g_object_unref0 (self->priv->button);
	self->priv->button = _tmp3_;
	_tmp4_ = self->priv->button;
	gtk_widget_add_css_class (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_widget_get_type (), GtkWidget), "close-button");
	_tmp5_ = self->priv->button;
	gtk_widget_add_css_class (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_widget_get_type (), GtkWidget), "circular");
	_tmp6_ = self->priv->button;
	g_signal_connect_object (_tmp6_, "clicked", (GCallback) _sway_notification_center_notification_close_button_click_cb_gtk_button_clicked, self, 0);
	_tmp7_ = self->priv->revealer;
	_tmp8_ = self->priv->button;
	gtk_revealer_set_child (_tmp7_, G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_widget_get_type (), GtkWidget));
	return obj;
}

static void
sway_notification_center_notification_close_button_class_init (SwayNotificationCenterNotificationCloseButtonClass * klass,
                                                               gpointer klass_data)
{
	sway_notification_center_notification_close_button_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SwayNotificationCenterNotificationCloseButton_private_offset);
	G_OBJECT_CLASS (klass)->constructor = sway_notification_center_notification_close_button_constructor;
	G_OBJECT_CLASS (klass)->finalize = sway_notification_center_notification_close_button_finalize;
	sway_notification_center_notification_close_button_signals[SWAY_NOTIFICATION_CENTER_NOTIFICATION_CLOSE_BUTTON_CLICKED_SIGNAL] = g_signal_new ("clicked", SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_CLOSE_BUTTON, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
sway_notification_center_notification_close_button_instance_init (SwayNotificationCenterNotificationCloseButton * self,
                                                                  gpointer klass)
{
	self->priv = sway_notification_center_notification_close_button_get_instance_private (self);
}

static void
sway_notification_center_notification_close_button_finalize (GObject * obj)
{
	SwayNotificationCenterNotificationCloseButton * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_CLOSE_BUTTON, SwayNotificationCenterNotificationCloseButton);
	_g_object_unref0 (self->priv->revealer);
	_g_object_unref0 (self->priv->button);
	G_OBJECT_CLASS (sway_notification_center_notification_close_button_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
sway_notification_center_notification_close_button_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SwayNotificationCenterNotificationCloseButtonClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sway_notification_center_notification_close_button_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SwayNotificationCenterNotificationCloseButton), 0, (GInstanceInitFunc) sway_notification_center_notification_close_button_instance_init, NULL };
	GType sway_notification_center_notification_close_button_type_id;
	sway_notification_center_notification_close_button_type_id = g_type_register_static (adw_bin_get_type (), "SwayNotificationCenterNotificationCloseButton", &g_define_type_info, 0);
	SwayNotificationCenterNotificationCloseButton_private_offset = g_type_add_instance_private (sway_notification_center_notification_close_button_type_id, sizeof (SwayNotificationCenterNotificationCloseButtonPrivate));
	return sway_notification_center_notification_close_button_type_id;
}

GType
sway_notification_center_notification_close_button_get_type (void)
{
	static gsize sway_notification_center_notification_close_button_type_id__once = 0;
	if (g_once_init_enter (&sway_notification_center_notification_close_button_type_id__once)) {
		GType sway_notification_center_notification_close_button_type_id;
		sway_notification_center_notification_close_button_type_id = sway_notification_center_notification_close_button_get_type_once ();
		g_once_init_leave (&sway_notification_center_notification_close_button_type_id__once, sway_notification_center_notification_close_button_type_id);
	}
	return sway_notification_center_notification_close_button_type_id__once;
}

