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

/*
 * Copyright 2011-2017 elementary, Inc. (https://elementary.io)
 * SPDX-License-Identifier: LGPL-3.0-or-later
 */

#include <gtk/gtk.h>
#include <glib-object.h>
#include "granite.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_ALERT_VIEW_VIEW (alert_view_view_get_type ())
#define ALERT_VIEW_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ALERT_VIEW_VIEW, AlertViewView))
#define ALERT_VIEW_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ALERT_VIEW_VIEW, AlertViewViewClass))
#define IS_ALERT_VIEW_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ALERT_VIEW_VIEW))
#define IS_ALERT_VIEW_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ALERT_VIEW_VIEW))
#define ALERT_VIEW_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ALERT_VIEW_VIEW, AlertViewViewClass))

typedef struct _AlertViewView AlertViewView;
typedef struct _AlertViewViewClass AlertViewViewClass;
typedef struct _AlertViewViewPrivate AlertViewViewPrivate;
enum  {
	ALERT_VIEW_VIEW_0_PROPERTY,
	ALERT_VIEW_VIEW_NUM_PROPERTIES
};
static GParamSpec* alert_view_view_properties[ALERT_VIEW_VIEW_NUM_PROPERTIES];
typedef struct _Block2Data Block2Data;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _AlertViewView {
	GtkGrid parent_instance;
	AlertViewViewPrivate * priv;
};

struct _AlertViewViewClass {
	GtkGridClass parent_class;
};

struct _Block2Data {
	int _ref_count_;
	AlertViewView* self;
	GraniteWidgetsAlertView* alert;
};

static gpointer alert_view_view_parent_class = NULL;

VALA_EXTERN GType alert_view_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AlertViewView, g_object_unref)
VALA_EXTERN AlertViewView* alert_view_view_new (void);
VALA_EXTERN AlertViewView* alert_view_view_construct (GType object_type);
static GObject * alert_view_view_constructor (GType type,
                                       guint n_construct_properties,
                                       GObjectConstructParam * construct_properties);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static void _alert_view_view___lambda4_ (Block2Data* _data2_);
static void __alert_view_view___lambda4__granite_widgets_alert_view_action_activated (GraniteWidgetsAlertView* _sender,
                                                                               gpointer self);
static GType alert_view_view_get_type_once (void);

AlertViewView*
alert_view_view_construct (GType object_type)
{
	AlertViewView * self = NULL;
	self = (AlertViewView*) g_object_new (object_type, NULL);
	return self;
}

AlertViewView*
alert_view_view_new (void)
{
	return alert_view_view_construct (TYPE_ALERT_VIEW_VIEW);
}

static Block2Data*
block2_data_ref (Block2Data* _data2_)
{
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}

static void
block2_data_unref (void * _userdata_)
{
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		AlertViewView* self;
		self = _data2_->self;
		_g_object_unref0 (_data2_->alert);
		_g_object_unref0 (self);
		g_slice_free (Block2Data, _data2_);
	}
}

static void
_alert_view_view___lambda4_ (Block2Data* _data2_)
{
	AlertViewView* self;
	GraniteWidgetsAlertView* _tmp0_;
	self = _data2_->self;
	_tmp0_ = _data2_->alert;
	granite_widgets_alert_view_hide_action (_tmp0_);
}

static void
__alert_view_view___lambda4__granite_widgets_alert_view_action_activated (GraniteWidgetsAlertView* _sender,
                                                                          gpointer self)
{
	_alert_view_view___lambda4_ (self);
}

static GObject *
alert_view_view_constructor (GType type,
                             guint n_construct_properties,
                             GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	AlertViewView * self;
	Block2Data* _data2_;
	GraniteWidgetsAlertView* _tmp0_;
	GraniteWidgetsAlertView* _tmp1_;
	GraniteWidgetsAlertView* _tmp2_;
	GraniteWidgetsAlertView* _tmp3_;
	parent_class = G_OBJECT_CLASS (alert_view_view_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_ALERT_VIEW_VIEW, AlertViewView);
	_data2_ = g_slice_new0 (Block2Data);
	_data2_->_ref_count_ = 1;
	_data2_->self = g_object_ref (self);
	_tmp0_ = granite_widgets_alert_view_new ("Nothing here", "Maybe you can enable <b>something</b> to hide it but <i>otherwise</i> " \
"it will stay here", "dialog-warning");
	g_object_ref_sink (_tmp0_);
	_data2_->alert = _tmp0_;
	_tmp1_ = _data2_->alert;
	granite_widgets_alert_view_show_action (_tmp1_, "Hide this button");
	_tmp2_ = _data2_->alert;
	g_signal_connect_data (_tmp2_, "action-activated", (GCallback) __alert_view_view___lambda4__granite_widgets_alert_view_action_activated, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
	_tmp3_ = _data2_->alert;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp3_);
	block2_data_unref (_data2_);
	_data2_ = NULL;
	return obj;
}

static void
alert_view_view_class_init (AlertViewViewClass * klass,
                            gpointer klass_data)
{
	alert_view_view_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->constructor = alert_view_view_constructor;
}

static void
alert_view_view_instance_init (AlertViewView * self,
                               gpointer klass)
{
}

static GType
alert_view_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (AlertViewViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) alert_view_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AlertViewView), 0, (GInstanceInitFunc) alert_view_view_instance_init, NULL };
	GType alert_view_view_type_id;
	alert_view_view_type_id = g_type_register_static (gtk_grid_get_type (), "AlertViewView", &g_define_type_info, 0);
	return alert_view_view_type_id;
}

GType
alert_view_view_get_type (void)
{
	static volatile gsize alert_view_view_type_id__once = 0;
	if (g_once_init_enter (&alert_view_view_type_id__once)) {
		GType alert_view_view_type_id;
		alert_view_view_type_id = alert_view_view_get_type_once ();
		g_once_init_leave (&alert_view_view_type_id__once, alert_view_view_type_id);
	}
	return alert_view_view_type_id__once;
}

