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

#include <gtk/gtk.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.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 TUBA_WIDGETS_TYPE_VOTE_CHECK_BUTTON (tuba_widgets_vote_check_button_get_type ())
#define TUBA_WIDGETS_VOTE_CHECK_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_VOTE_CHECK_BUTTON, TubaWidgetsVoteCheckButton))
#define TUBA_WIDGETS_VOTE_CHECK_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_VOTE_CHECK_BUTTON, TubaWidgetsVoteCheckButtonClass))
#define TUBA_WIDGETS_IS_VOTE_CHECK_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_VOTE_CHECK_BUTTON))
#define TUBA_WIDGETS_IS_VOTE_CHECK_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_VOTE_CHECK_BUTTON))
#define TUBA_WIDGETS_VOTE_CHECK_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_VOTE_CHECK_BUTTON, TubaWidgetsVoteCheckButtonClass))

typedef struct _TubaWidgetsVoteCheckButton TubaWidgetsVoteCheckButton;
typedef struct _TubaWidgetsVoteCheckButtonClass TubaWidgetsVoteCheckButtonClass;
typedef struct _TubaWidgetsVoteCheckButtonPrivate TubaWidgetsVoteCheckButtonPrivate;
enum  {
	TUBA_WIDGETS_VOTE_CHECK_BUTTON_0_PROPERTY,
	TUBA_WIDGETS_VOTE_CHECK_BUTTON_POLL_TITLE_PROPERTY,
	TUBA_WIDGETS_VOTE_CHECK_BUTTON_NUM_PROPERTIES
};
static GParamSpec* tuba_widgets_vote_check_button_properties[TUBA_WIDGETS_VOTE_CHECK_BUTTON_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))

struct _TubaWidgetsVoteCheckButton {
	GtkCheckButton parent_instance;
	TubaWidgetsVoteCheckButtonPrivate * priv;
};

struct _TubaWidgetsVoteCheckButtonClass {
	GtkCheckButtonClass parent_class;
};

struct _TubaWidgetsVoteCheckButtonPrivate {
	gchar* _poll_title;
};

static gint TubaWidgetsVoteCheckButton_private_offset;
static gpointer tuba_widgets_vote_check_button_parent_class = NULL;

VALA_EXTERN GType tuba_widgets_vote_check_button_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsVoteCheckButton, g_object_unref)
VALA_EXTERN TubaWidgetsVoteCheckButton* tuba_widgets_vote_check_button_new (void);
VALA_EXTERN TubaWidgetsVoteCheckButton* tuba_widgets_vote_check_button_construct (GType object_type);
VALA_EXTERN const gchar* tuba_widgets_vote_check_button_get_poll_title (TubaWidgetsVoteCheckButton* self);
VALA_EXTERN void tuba_widgets_vote_check_button_set_poll_title (TubaWidgetsVoteCheckButton* self,
                                                    const gchar* value);
static GObject * tuba_widgets_vote_check_button_constructor (GType type,
                                                      guint n_construct_properties,
                                                      GObjectConstructParam * construct_properties);
static void tuba_widgets_vote_check_button_finalize (GObject * obj);
static GType tuba_widgets_vote_check_button_get_type_once (void);
static void _vala_tuba_widgets_vote_check_button_get_property (GObject * object,
                                                        guint property_id,
                                                        GValue * value,
                                                        GParamSpec * pspec);
static void _vala_tuba_widgets_vote_check_button_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_vote_check_button_get_instance_private (TubaWidgetsVoteCheckButton* self)
{
	return G_STRUCT_MEMBER_P (self, TubaWidgetsVoteCheckButton_private_offset);
}

TubaWidgetsVoteCheckButton*
tuba_widgets_vote_check_button_construct (GType object_type)
{
	TubaWidgetsVoteCheckButton * self = NULL;
	self = (TubaWidgetsVoteCheckButton*) g_object_new (object_type, NULL);
	return self;
}

TubaWidgetsVoteCheckButton*
tuba_widgets_vote_check_button_new (void)
{
	return tuba_widgets_vote_check_button_construct (TUBA_WIDGETS_TYPE_VOTE_CHECK_BUTTON);
}

const gchar*
tuba_widgets_vote_check_button_get_poll_title (TubaWidgetsVoteCheckButton* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_poll_title;
	result = _tmp0_;
	return result;
}

void
tuba_widgets_vote_check_button_set_poll_title (TubaWidgetsVoteCheckButton* self,
                                               const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_widgets_vote_check_button_get_poll_title (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_poll_title);
		self->priv->_poll_title = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_widgets_vote_check_button_properties[TUBA_WIDGETS_VOTE_CHECK_BUTTON_POLL_TITLE_PROPERTY]);
	}
}

static GObject *
tuba_widgets_vote_check_button_constructor (GType type,
                                            guint n_construct_properties,
                                            GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TubaWidgetsVoteCheckButton * self;
	gchar* _tmp0_;
	gchar** _tmp1_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	parent_class = G_OBJECT_CLASS (tuba_widgets_vote_check_button_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_TYPE_VOTE_CHECK_BUTTON, TubaWidgetsVoteCheckButton);
	gtk_widget_set_valign ((GtkWidget*) self, GTK_ALIGN_CENTER);
	_tmp0_ = g_strdup ("selection-mode");
	_tmp1_ = g_new0 (gchar*, 1 + 1);
	_tmp1_[0] = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp2__length1 = 1;
	gtk_widget_set_css_classes ((GtkWidget*) self, _tmp2_);
	_tmp2_ = (_vala_array_free (_tmp2_, _tmp2__length1, (GDestroyNotify) g_free), NULL);
	return obj;
}

static void
tuba_widgets_vote_check_button_class_init (TubaWidgetsVoteCheckButtonClass * klass,
                                           gpointer klass_data)
{
	tuba_widgets_vote_check_button_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaWidgetsVoteCheckButton_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_widgets_vote_check_button_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_widgets_vote_check_button_set_property;
	G_OBJECT_CLASS (klass)->constructor = tuba_widgets_vote_check_button_constructor;
	G_OBJECT_CLASS (klass)->finalize = tuba_widgets_vote_check_button_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_VOTE_CHECK_BUTTON_POLL_TITLE_PROPERTY, tuba_widgets_vote_check_button_properties[TUBA_WIDGETS_VOTE_CHECK_BUTTON_POLL_TITLE_PROPERTY] = g_param_spec_string ("poll-title", "poll-title", "poll-title", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
tuba_widgets_vote_check_button_instance_init (TubaWidgetsVoteCheckButton * self,
                                              gpointer klass)
{
	self->priv = tuba_widgets_vote_check_button_get_instance_private (self);
}

static void
tuba_widgets_vote_check_button_finalize (GObject * obj)
{
	TubaWidgetsVoteCheckButton * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_TYPE_VOTE_CHECK_BUTTON, TubaWidgetsVoteCheckButton);
	_g_free0 (self->priv->_poll_title);
	G_OBJECT_CLASS (tuba_widgets_vote_check_button_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_widgets_vote_check_button_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaWidgetsVoteCheckButtonClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_widgets_vote_check_button_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaWidgetsVoteCheckButton), 0, (GInstanceInitFunc) tuba_widgets_vote_check_button_instance_init, NULL };
	GType tuba_widgets_vote_check_button_type_id;
	tuba_widgets_vote_check_button_type_id = g_type_register_static (gtk_check_button_get_type (), "TubaWidgetsVoteCheckButton", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaWidgetsVoteCheckButton_private_offset = g_type_add_instance_private (tuba_widgets_vote_check_button_type_id, sizeof (TubaWidgetsVoteCheckButtonPrivate));
	return tuba_widgets_vote_check_button_type_id;
}

GType
tuba_widgets_vote_check_button_get_type (void)
{
	static GType tuba_widgets_vote_check_button_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_widgets_vote_check_button_type_id__once)) {
		GType tuba_widgets_vote_check_button_type_id;
		tuba_widgets_vote_check_button_type_id = tuba_widgets_vote_check_button_get_type_once ();
		g_once_init_leave_pointer (&tuba_widgets_vote_check_button_type_id__once, tuba_widgets_vote_check_button_type_id);
	}
	return tuba_widgets_vote_check_button_type_id__once;
}

static void
_vala_tuba_widgets_vote_check_button_get_property (GObject * object,
                                                   guint property_id,
                                                   GValue * value,
                                                   GParamSpec * pspec)
{
	TubaWidgetsVoteCheckButton * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_WIDGETS_TYPE_VOTE_CHECK_BUTTON, TubaWidgetsVoteCheckButton);
	switch (property_id) {
		case TUBA_WIDGETS_VOTE_CHECK_BUTTON_POLL_TITLE_PROPERTY:
		g_value_set_string (value, tuba_widgets_vote_check_button_get_poll_title (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_widgets_vote_check_button_set_property (GObject * object,
                                                   guint property_id,
                                                   const GValue * value,
                                                   GParamSpec * pspec)
{
	TubaWidgetsVoteCheckButton * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_WIDGETS_TYPE_VOTE_CHECK_BUTTON, TubaWidgetsVoteCheckButton);
	switch (property_id) {
		case TUBA_WIDGETS_VOTE_CHECK_BUTTON_POLL_TITLE_PROPERTY:
		tuba_widgets_vote_check_button_set_poll_title (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);
}

