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

#include <adwaita.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <glib/gi18n-lib.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_ADMIN_TYPE_DOMAIN_ALLOW (tuba_widgets_admin_domain_allow_get_type ())
#define TUBA_WIDGETS_ADMIN_DOMAIN_ALLOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_ADMIN_TYPE_DOMAIN_ALLOW, TubaWidgetsAdminDomainAllow))
#define TUBA_WIDGETS_ADMIN_DOMAIN_ALLOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_ADMIN_TYPE_DOMAIN_ALLOW, TubaWidgetsAdminDomainAllowClass))
#define TUBA_WIDGETS_ADMIN_IS_DOMAIN_ALLOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_ADMIN_TYPE_DOMAIN_ALLOW))
#define TUBA_WIDGETS_ADMIN_IS_DOMAIN_ALLOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_ADMIN_TYPE_DOMAIN_ALLOW))
#define TUBA_WIDGETS_ADMIN_DOMAIN_ALLOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_ADMIN_TYPE_DOMAIN_ALLOW, TubaWidgetsAdminDomainAllowClass))

typedef struct _TubaWidgetsAdminDomainAllow TubaWidgetsAdminDomainAllow;
typedef struct _TubaWidgetsAdminDomainAllowClass TubaWidgetsAdminDomainAllowClass;
typedef struct _TubaWidgetsAdminDomainAllowPrivate TubaWidgetsAdminDomainAllowPrivate;
enum  {
	TUBA_WIDGETS_ADMIN_DOMAIN_ALLOW_0_PROPERTY,
	TUBA_WIDGETS_ADMIN_DOMAIN_ALLOW_NUM_PROPERTIES
};
static GParamSpec* tuba_widgets_admin_domain_allow_properties[TUBA_WIDGETS_ADMIN_DOMAIN_ALLOW_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))

#define TUBA_TYPE_ENTITY (tuba_entity_get_type ())
#define TUBA_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_ENTITY, TubaEntity))
#define TUBA_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_ENTITY, TubaEntityClass))
#define TUBA_IS_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_ENTITY))
#define TUBA_IS_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_ENTITY))
#define TUBA_ENTITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_ENTITY, TubaEntityClass))

typedef struct _TubaEntity TubaEntity;
typedef struct _TubaEntityClass TubaEntityClass;

#define TUBA_API_ADMIN_TYPE_DOMAIN_ALLOW (tuba_api_admin_domain_allow_get_type ())
#define TUBA_API_ADMIN_DOMAIN_ALLOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_ADMIN_TYPE_DOMAIN_ALLOW, TubaAPIAdminDomainAllow))
#define TUBA_API_ADMIN_DOMAIN_ALLOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_ADMIN_TYPE_DOMAIN_ALLOW, TubaAPIAdminDomainAllowClass))
#define TUBA_API_ADMIN_IS_DOMAIN_ALLOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_ADMIN_TYPE_DOMAIN_ALLOW))
#define TUBA_API_ADMIN_IS_DOMAIN_ALLOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_ADMIN_TYPE_DOMAIN_ALLOW))
#define TUBA_API_ADMIN_DOMAIN_ALLOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_ADMIN_TYPE_DOMAIN_ALLOW, TubaAPIAdminDomainAllowClass))

typedef struct _TubaAPIAdminDomainAllow TubaAPIAdminDomainAllow;
typedef struct _TubaAPIAdminDomainAllowClass TubaAPIAdminDomainAllowClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
enum  {
	TUBA_WIDGETS_ADMIN_DOMAIN_ALLOW_REMOVED_SIGNAL,
	TUBA_WIDGETS_ADMIN_DOMAIN_ALLOW_NUM_SIGNALS
};
static guint tuba_widgets_admin_domain_allow_signals[TUBA_WIDGETS_ADMIN_DOMAIN_ALLOW_NUM_SIGNALS] = {0};

struct _TubaWidgetsAdminDomainAllow {
	AdwActionRow parent_instance;
	TubaWidgetsAdminDomainAllowPrivate * priv;
};

struct _TubaWidgetsAdminDomainAllowClass {
	AdwActionRowClass parent_class;
};

struct _TubaWidgetsAdminDomainAllowPrivate {
	gchar* domain_allow_id;
};

static gint TubaWidgetsAdminDomainAllow_private_offset;
static gpointer tuba_widgets_admin_domain_allow_parent_class = NULL;

VALA_EXTERN GType tuba_widgets_admin_domain_allow_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsAdminDomainAllow, g_object_unref)
VALA_EXTERN GType tuba_entity_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaEntity, g_object_unref)
VALA_EXTERN GType tuba_api_admin_domain_allow_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAdminDomainAllow, g_object_unref)
VALA_EXTERN TubaWidgetsAdminDomainAllow* tuba_widgets_admin_domain_allow_new (TubaAPIAdminDomainAllow* domain_allow);
VALA_EXTERN TubaWidgetsAdminDomainAllow* tuba_widgets_admin_domain_allow_construct (GType object_type,
                                                                        TubaAPIAdminDomainAllow* domain_allow);
VALA_EXTERN const gchar* tuba_api_admin_domain_allow_get_id (TubaAPIAdminDomainAllow* self);
VALA_EXTERN const gchar* tuba_api_admin_domain_allow_get_domain (TubaAPIAdminDomainAllow* self);
VALA_EXTERN void tuba_widgets_admin_domain_allow_on_remove (TubaWidgetsAdminDomainAllow* self);
static void _tuba_widgets_admin_domain_allow_on_remove_gtk_button_clicked (GtkButton* _sender,
                                                                    gpointer self);
static void tuba_widgets_admin_domain_allow_finalize (GObject * obj);
static GType tuba_widgets_admin_domain_allow_get_type_once (void);
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_admin_domain_allow_get_instance_private (TubaWidgetsAdminDomainAllow* self)
{
	return G_STRUCT_MEMBER_P (self, TubaWidgetsAdminDomainAllow_private_offset);
}

static void
_tuba_widgets_admin_domain_allow_on_remove_gtk_button_clicked (GtkButton* _sender,
                                                               gpointer self)
{
	tuba_widgets_admin_domain_allow_on_remove ((TubaWidgetsAdminDomainAllow*) self);
}

TubaWidgetsAdminDomainAllow*
tuba_widgets_admin_domain_allow_construct (GType object_type,
                                           TubaAPIAdminDomainAllow* domain_allow)
{
	TubaWidgetsAdminDomainAllow * self = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	GtkButton* delete_button = NULL;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar** _tmp8_;
	gchar* _tmp9_;
	GtkButton* _tmp10_ = NULL;
	g_return_val_if_fail (domain_allow != NULL, NULL);
	self = (TubaWidgetsAdminDomainAllow*) g_object_new (object_type, NULL);
	_tmp0_ = tuba_api_admin_domain_allow_get_id (domain_allow);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_strdup (_tmp1_);
	_g_free0 (self->priv->domain_allow_id);
	self->priv->domain_allow_id = _tmp2_;
	_tmp3_ = tuba_api_admin_domain_allow_get_domain (domain_allow);
	_tmp4_ = _tmp3_;
	adw_preferences_row_set_title ((AdwPreferencesRow*) self, _tmp4_);
	_tmp5_ = g_strdup ("circular");
	_tmp6_ = g_strdup ("flat");
	_tmp7_ = g_strdup ("error");
	_tmp8_ = g_new0 (gchar*, 3 + 1);
	_tmp8_[0] = _tmp5_;
	_tmp8_[1] = _tmp6_;
	_tmp8_[2] = _tmp7_;
	_tmp9_ = g_strdup (_ ("Delete"));
	_tmp10_ = (GtkButton*) gtk_button_new_from_icon_name ("user-trash-symbolic");
	gtk_widget_set_css_classes ((GtkWidget*) _tmp10_, _tmp8_);
	_tmp8_ = (_vala_array_free (_tmp8_, 3, (GDestroyNotify) g_free), NULL);
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp10_, _tmp9_);
	_g_free0 (_tmp9_);
	gtk_widget_set_valign ((GtkWidget*) _tmp10_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp10_);
	delete_button = _tmp10_;
	g_signal_connect_object (delete_button, "clicked", (GCallback) _tuba_widgets_admin_domain_allow_on_remove_gtk_button_clicked, self, 0);
	adw_action_row_add_suffix ((AdwActionRow*) self, (GtkWidget*) delete_button);
	_g_object_unref0 (delete_button);
	return self;
}

TubaWidgetsAdminDomainAllow*
tuba_widgets_admin_domain_allow_new (TubaAPIAdminDomainAllow* domain_allow)
{
	return tuba_widgets_admin_domain_allow_construct (TUBA_WIDGETS_ADMIN_TYPE_DOMAIN_ALLOW, domain_allow);
}

void
tuba_widgets_admin_domain_allow_on_remove (TubaWidgetsAdminDomainAllow* self)
{
	const gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->domain_allow_id;
	g_signal_emit (self, tuba_widgets_admin_domain_allow_signals[TUBA_WIDGETS_ADMIN_DOMAIN_ALLOW_REMOVED_SIGNAL], 0, _tmp0_);
}

static void
tuba_widgets_admin_domain_allow_class_init (TubaWidgetsAdminDomainAllowClass * klass,
                                            gpointer klass_data)
{
	tuba_widgets_admin_domain_allow_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaWidgetsAdminDomainAllow_private_offset);
	G_OBJECT_CLASS (klass)->finalize = tuba_widgets_admin_domain_allow_finalize;
	tuba_widgets_admin_domain_allow_signals[TUBA_WIDGETS_ADMIN_DOMAIN_ALLOW_REMOVED_SIGNAL] = g_signal_new ("removed", TUBA_WIDGETS_ADMIN_TYPE_DOMAIN_ALLOW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
}

static void
tuba_widgets_admin_domain_allow_instance_init (TubaWidgetsAdminDomainAllow * self,
                                               gpointer klass)
{
	self->priv = tuba_widgets_admin_domain_allow_get_instance_private (self);
}

static void
tuba_widgets_admin_domain_allow_finalize (GObject * obj)
{
	TubaWidgetsAdminDomainAllow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_ADMIN_TYPE_DOMAIN_ALLOW, TubaWidgetsAdminDomainAllow);
	g_debug ("DomainAllow.vala:5: Destroying DomainAllow");
	_g_free0 (self->priv->domain_allow_id);
	G_OBJECT_CLASS (tuba_widgets_admin_domain_allow_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_widgets_admin_domain_allow_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaWidgetsAdminDomainAllowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_widgets_admin_domain_allow_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaWidgetsAdminDomainAllow), 0, (GInstanceInitFunc) tuba_widgets_admin_domain_allow_instance_init, NULL };
	GType tuba_widgets_admin_domain_allow_type_id;
	tuba_widgets_admin_domain_allow_type_id = g_type_register_static (adw_action_row_get_type (), "TubaWidgetsAdminDomainAllow", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaWidgetsAdminDomainAllow_private_offset = g_type_add_instance_private (tuba_widgets_admin_domain_allow_type_id, sizeof (TubaWidgetsAdminDomainAllowPrivate));
	return tuba_widgets_admin_domain_allow_type_id;
}

GType
tuba_widgets_admin_domain_allow_get_type (void)
{
	static GType tuba_widgets_admin_domain_allow_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_widgets_admin_domain_allow_type_id__once)) {
		GType tuba_widgets_admin_domain_allow_type_id;
		tuba_widgets_admin_domain_allow_type_id = tuba_widgets_admin_domain_allow_get_type_once ();
		g_once_init_leave_pointer (&tuba_widgets_admin_domain_allow_type_id__once, tuba_widgets_admin_domain_allow_type_id);
	}
	return tuba_widgets_admin_domain_allow_type_id__once;
}

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);
}

