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

/*
 * Copyright 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"
#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_OVERLAY_BAR_VIEW (overlay_bar_view_get_type ())
#define OVERLAY_BAR_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_OVERLAY_BAR_VIEW, OverlayBarView))
#define OVERLAY_BAR_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_OVERLAY_BAR_VIEW, OverlayBarViewClass))
#define IS_OVERLAY_BAR_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_OVERLAY_BAR_VIEW))
#define IS_OVERLAY_BAR_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_OVERLAY_BAR_VIEW))
#define OVERLAY_BAR_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_OVERLAY_BAR_VIEW, OverlayBarViewClass))

typedef struct _OverlayBarView OverlayBarView;
typedef struct _OverlayBarViewClass OverlayBarViewClass;
typedef struct _OverlayBarViewPrivate OverlayBarViewPrivate;
enum  {
	OVERLAY_BAR_VIEW_0_PROPERTY,
	OVERLAY_BAR_VIEW_NUM_PROPERTIES
};
static GParamSpec* overlay_bar_view_properties[OVERLAY_BAR_VIEW_NUM_PROPERTIES];
typedef struct _Block10Data Block10Data;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _OverlayBarView {
	GtkOverlay parent_instance;
	OverlayBarViewPrivate * priv;
};

struct _OverlayBarViewClass {
	GtkOverlayClass parent_class;
};

struct _Block10Data {
	int _ref_count_;
	OverlayBarView* self;
	GtkToggleButton* button;
	GraniteWidgetsOverlayBar* overlaybar;
};

static gpointer overlay_bar_view_parent_class = NULL;

VALA_EXTERN GType overlay_bar_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OverlayBarView, g_object_unref)
VALA_EXTERN OverlayBarView* overlay_bar_view_new (void);
VALA_EXTERN OverlayBarView* overlay_bar_view_construct (GType object_type);
static GObject * overlay_bar_view_constructor (GType type,
                                        guint n_construct_properties,
                                        GObjectConstructParam * construct_properties);
static Block10Data* block10_data_ref (Block10Data* _data10_);
static void block10_data_unref (void * _userdata_);
static void _overlay_bar_view___lambda12_ (Block10Data* _data10_);
static void __overlay_bar_view___lambda12__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                               gpointer self);
static GType overlay_bar_view_get_type_once (void);

OverlayBarView*
overlay_bar_view_construct (GType object_type)
{
	OverlayBarView * self = NULL;
	self = (OverlayBarView*) g_object_new (object_type, NULL);
	return self;
}

OverlayBarView*
overlay_bar_view_new (void)
{
	return overlay_bar_view_construct (TYPE_OVERLAY_BAR_VIEW);
}

static Block10Data*
block10_data_ref (Block10Data* _data10_)
{
	g_atomic_int_inc (&_data10_->_ref_count_);
	return _data10_;
}

static void
block10_data_unref (void * _userdata_)
{
	Block10Data* _data10_;
	_data10_ = (Block10Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data10_->_ref_count_)) {
		OverlayBarView* self;
		self = _data10_->self;
		_g_object_unref0 (_data10_->overlaybar);
		_g_object_unref0 (_data10_->button);
		_g_object_unref0 (self);
		g_slice_free (Block10Data, _data10_);
	}
}

static void
_overlay_bar_view___lambda12_ (Block10Data* _data10_)
{
	OverlayBarView* self;
	GraniteWidgetsOverlayBar* _tmp0_;
	GtkToggleButton* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	self = _data10_->self;
	_tmp0_ = _data10_->overlaybar;
	_tmp1_ = _data10_->button;
	_tmp2_ = gtk_toggle_button_get_active (_tmp1_);
	_tmp3_ = _tmp2_;
	granite_widgets_overlay_bar_set_active (_tmp0_, _tmp3_);
}

static void
__overlay_bar_view___lambda12__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                          gpointer self)
{
	_overlay_bar_view___lambda12_ (self);
}

static GObject *
overlay_bar_view_constructor (GType type,
                              guint n_construct_properties,
                              GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	OverlayBarView * self;
	Block10Data* _data10_;
	GtkToggleButton* _tmp0_;
	GtkGrid* grid = NULL;
	GtkGrid* _tmp1_;
	GtkGrid* _tmp2_;
	GtkGrid* _tmp3_;
	GtkGrid* _tmp4_;
	GtkToggleButton* _tmp5_;
	GraniteWidgetsOverlayBar* _tmp6_;
	GraniteWidgetsOverlayBar* _tmp7_;
	GtkGrid* _tmp8_;
	GtkToggleButton* _tmp9_;
	parent_class = G_OBJECT_CLASS (overlay_bar_view_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_OVERLAY_BAR_VIEW, OverlayBarView);
	_data10_ = g_slice_new0 (Block10Data);
	_data10_->_ref_count_ = 1;
	_data10_->self = g_object_ref (self);
	_tmp0_ = (GtkToggleButton*) gtk_toggle_button_new_with_label ("Show Spinner");
	g_object_ref_sink (_tmp0_);
	_data10_->button = _tmp0_;
	_tmp1_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp1_);
	grid = _tmp1_;
	_tmp2_ = grid;
	gtk_widget_set_halign ((GtkWidget*) _tmp2_, GTK_ALIGN_CENTER);
	_tmp3_ = grid;
	gtk_widget_set_valign ((GtkWidget*) _tmp3_, GTK_ALIGN_CENTER);
	_tmp4_ = grid;
	_tmp5_ = _data10_->button;
	gtk_container_add ((GtkContainer*) _tmp4_, (GtkWidget*) _tmp5_);
	_tmp6_ = granite_widgets_overlay_bar_new ((GtkOverlay*) self);
	g_object_ref_sink (_tmp6_);
	_data10_->overlaybar = _tmp6_;
	_tmp7_ = _data10_->overlaybar;
	granite_widgets_overlay_bar_set_label (_tmp7_, "Hover the OverlayBar to change its position");
	_tmp8_ = grid;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp8_);
	_tmp9_ = _data10_->button;
	g_signal_connect_data (_tmp9_, "toggled", (GCallback) __overlay_bar_view___lambda12__gtk_toggle_button_toggled, block10_data_ref (_data10_), (GClosureNotify) block10_data_unref, 0);
	_g_object_unref0 (grid);
	block10_data_unref (_data10_);
	_data10_ = NULL;
	return obj;
}

static void
overlay_bar_view_class_init (OverlayBarViewClass * klass,
                             gpointer klass_data)
{
	overlay_bar_view_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->constructor = overlay_bar_view_constructor;
}

static void
overlay_bar_view_instance_init (OverlayBarView * self,
                                gpointer klass)
{
}

static GType
overlay_bar_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (OverlayBarViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) overlay_bar_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (OverlayBarView), 0, (GInstanceInitFunc) overlay_bar_view_instance_init, NULL };
	GType overlay_bar_view_type_id;
	overlay_bar_view_type_id = g_type_register_static (gtk_overlay_get_type (), "OverlayBarView", &g_define_type_info, 0);
	return overlay_bar_view_type_id;
}

GType
overlay_bar_view_get_type (void)
{
	static volatile gsize overlay_bar_view_type_id__once = 0;
	if (g_once_init_enter (&overlay_bar_view_type_id__once)) {
		GType overlay_bar_view_type_id;
		overlay_bar_view_type_id = overlay_bar_view_get_type_once ();
		g_once_init_leave (&overlay_bar_view_type_id__once, overlay_bar_view_type_id);
	}
	return overlay_bar_view_type_id__once;
}

