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

#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <json-glib/json-glib.h>
#include <gio/gio.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_WIDGETS_TYPE_BASE_WIDGET (sway_notification_center_widgets_base_widget_get_type ())
#define SWAY_NOTIFICATION_CENTER_WIDGETS_BASE_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET, SwayNotificationCenterWidgetsBaseWidget))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_BASE_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET, SwayNotificationCenterWidgetsBaseWidgetClass))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_IS_BASE_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_IS_BASE_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_BASE_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET, SwayNotificationCenterWidgetsBaseWidgetClass))

typedef struct _SwayNotificationCenterWidgetsBaseWidget SwayNotificationCenterWidgetsBaseWidget;
typedef struct _SwayNotificationCenterWidgetsBaseWidgetClass SwayNotificationCenterWidgetsBaseWidgetClass;
typedef struct _SwayNotificationCenterWidgetsBaseWidgetPrivate SwayNotificationCenterWidgetsBaseWidgetPrivate;

#define SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BUTTONS_GRID (sway_notification_center_widgets_buttons_grid_get_type ())
#define SWAY_NOTIFICATION_CENTER_WIDGETS_BUTTONS_GRID(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BUTTONS_GRID, SwayNotificationCenterWidgetsButtonsGrid))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_BUTTONS_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BUTTONS_GRID, SwayNotificationCenterWidgetsButtonsGridClass))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_IS_BUTTONS_GRID(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BUTTONS_GRID))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_IS_BUTTONS_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BUTTONS_GRID))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_BUTTONS_GRID_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BUTTONS_GRID, SwayNotificationCenterWidgetsButtonsGridClass))

typedef struct _SwayNotificationCenterWidgetsButtonsGrid SwayNotificationCenterWidgetsButtonsGrid;
typedef struct _SwayNotificationCenterWidgetsButtonsGridClass SwayNotificationCenterWidgetsButtonsGridClass;
typedef struct _SwayNotificationCenterWidgetsButtonsGridPrivate SwayNotificationCenterWidgetsButtonsGridPrivate;

#define SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_ACTION (sway_notification_center_widgets_action_get_type ())
typedef struct _SwayNotificationCenterWidgetsAction SwayNotificationCenterWidgetsAction;
typedef enum  {
	SWAY_NOTIFICATION_CENTER_WIDGETS_BASE_WIDGET_BUTTON_TYPE_TOGGLE,
	SWAY_NOTIFICATION_CENTER_WIDGETS_BASE_WIDGET_BUTTON_TYPE_NORMAL
} SwayNotificationCenterWidgetsBaseWidgetButtonType;

#define SWAY_NOTIFICATION_CENTER_WIDGETS_BASE_WIDGET_TYPE_BUTTON_TYPE (sway_notification_center_widgets_base_widget_button_type_get_type ())

#define SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_TOGGLE_BUTTON (sway_notification_center_widgets_toggle_button_get_type ())
#define SWAY_NOTIFICATION_CENTER_WIDGETS_TOGGLE_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_TOGGLE_BUTTON, SwayNotificationCenterWidgetsToggleButton))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_TOGGLE_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_TOGGLE_BUTTON, SwayNotificationCenterWidgetsToggleButtonClass))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_IS_TOGGLE_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_TOGGLE_BUTTON))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_IS_TOGGLE_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_TOGGLE_BUTTON))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_TOGGLE_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_TOGGLE_BUTTON, SwayNotificationCenterWidgetsToggleButtonClass))

typedef struct _SwayNotificationCenterWidgetsToggleButton SwayNotificationCenterWidgetsToggleButton;
typedef struct _SwayNotificationCenterWidgetsToggleButtonClass SwayNotificationCenterWidgetsToggleButtonClass;
enum  {
	SWAY_NOTIFICATION_CENTER_WIDGETS_BUTTONS_GRID_0_PROPERTY,
	SWAY_NOTIFICATION_CENTER_WIDGETS_BUTTONS_GRID_WIDGET_NAME_PROPERTY,
	SWAY_NOTIFICATION_CENTER_WIDGETS_BUTTONS_GRID_NUM_PROPERTIES
};
static GParamSpec* sway_notification_center_widgets_buttons_grid_properties[SWAY_NOTIFICATION_CENTER_WIDGETS_BUTTONS_GRID_NUM_PROPERTIES];
#define _json_array_unref0(var) ((var == NULL) ? NULL : (var = (json_array_unref (var), NULL)))
typedef struct _Block24Data Block24Data;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _json_object_unref0(var) ((var == NULL) ? NULL : (var = (json_object_unref (var), NULL)))

struct _SwayNotificationCenterWidgetsBaseWidget {
	GtkBox parent_instance;
	SwayNotificationCenterWidgetsBaseWidgetPrivate * priv;
};

struct _SwayNotificationCenterWidgetsBaseWidgetClass {
	GtkBoxClass parent_class;
	void (*on_cc_visibility_change) (SwayNotificationCenterWidgetsBaseWidget* self, gboolean value);
	const gchar* (*get_widget_name) (SwayNotificationCenterWidgetsBaseWidget* self);
};

struct _SwayNotificationCenterWidgetsButtonsGrid {
	SwayNotificationCenterWidgetsBaseWidget parent_instance;
	SwayNotificationCenterWidgetsButtonsGridPrivate * priv;
};

struct _SwayNotificationCenterWidgetsButtonsGridClass {
	SwayNotificationCenterWidgetsBaseWidgetClass parent_class;
};

struct _SwayNotificationCenterWidgetsAction {
	gchar* label;
	gchar* command;
	SwayNotificationCenterWidgetsBaseWidgetButtonType* type;
	gchar* update_command;
	gboolean* active;
};

struct _SwayNotificationCenterWidgetsButtonsGridPrivate {
	SwayNotificationCenterWidgetsAction* actions;
	gint actions_length1;
	gint _actions_size_;
	gint buttons_per_row;
	GList* toggle_buttons;
};

struct _Block24Data {
	int _ref_count_;
	SwayNotificationCenterWidgetsButtonsGrid* self;
	SwayNotificationCenterWidgetsAction act;
};

static gint SwayNotificationCenterWidgetsButtonsGrid_private_offset;
static gpointer sway_notification_center_widgets_buttons_grid_parent_class = NULL;

VALA_EXTERN GType sway_notification_center_widgets_base_widget_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SwayNotificationCenterWidgetsBaseWidget, g_object_unref)
VALA_EXTERN GType sway_notification_center_widgets_buttons_grid_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SwayNotificationCenterWidgetsButtonsGrid, g_object_unref)
VALA_EXTERN GType sway_notification_center_widgets_action_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType sway_notification_center_widgets_base_widget_button_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN SwayNotificationCenterWidgetsAction* sway_notification_center_widgets_action_dup (const SwayNotificationCenterWidgetsAction* self);
VALA_EXTERN void sway_notification_center_widgets_action_free (SwayNotificationCenterWidgetsAction* self);
VALA_EXTERN void sway_notification_center_widgets_action_copy (const SwayNotificationCenterWidgetsAction* self,
                                                   SwayNotificationCenterWidgetsAction* dest);
VALA_EXTERN void sway_notification_center_widgets_action_destroy (SwayNotificationCenterWidgetsAction* self);
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (SwayNotificationCenterWidgetsAction, sway_notification_center_widgets_action_destroy)
VALA_EXTERN GType sway_notification_center_widgets_toggle_button_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SwayNotificationCenterWidgetsToggleButton, g_object_unref)
VALA_EXTERN void sway_notification_center_widgets_base_widget_on_cc_visibility_change (SwayNotificationCenterWidgetsBaseWidget* self,
                                                                           gboolean value);
VALA_EXTERN const gchar* sway_notification_center_widgets_base_widget_get_widget_name (SwayNotificationCenterWidgetsBaseWidget* self);
static void _vala_SwayNotificationCenterWidgetsAction_array_free (SwayNotificationCenterWidgetsAction * array,
                                                           gssize array_length);
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
VALA_EXTERN SwayNotificationCenterWidgetsButtonsGrid* sway_notification_center_widgets_buttons_grid_new (const gchar* suffix);
VALA_EXTERN SwayNotificationCenterWidgetsButtonsGrid* sway_notification_center_widgets_buttons_grid_construct (GType object_type,
                                                                                                   const gchar* suffix);
VALA_EXTERN SwayNotificationCenterWidgetsBaseWidget* sway_notification_center_widgets_base_widget_construct (GType object_type,
                                                                                                 const gchar* suffix);
VALA_EXTERN JsonObject* sway_notification_center_widgets_base_widget_get_config (SwayNotificationCenterWidgetsBaseWidget* self,
                                                                     GtkWidget* widget);
VALA_EXTERN JsonArray* sway_notification_center_widgets_base_widget_get_prop_array (SwayNotificationCenterWidgetsBaseWidget* self,
                                                                        JsonObject* config,
                                                                        const gchar* value_key);
VALA_EXTERN SwayNotificationCenterWidgetsAction* sway_notification_center_widgets_base_widget_parse_actions (SwayNotificationCenterWidgetsBaseWidget* self,
                                                                                                 JsonArray* actions,
                                                                                                 gint* result_length1);
VALA_EXTERN gpointer sway_notification_center_widgets_base_widget_get_prop (SwayNotificationCenterWidgetsBaseWidget* self,
                                                                GType t_type,
                                                                GBoxedCopyFunc t_dup_func,
                                                                GDestroyNotify t_destroy_func,
                                                                JsonObject* config,
                                                                const gchar* value_key,
                                                                gboolean* found);
static Block24Data* block24_data_ref (Block24Data* _data24_);
static void block24_data_unref (void * _userdata_);
VALA_EXTERN SwayNotificationCenterWidgetsToggleButton* sway_notification_center_widgets_toggle_button_new (const gchar* label,
                                                                                               const gchar* command,
                                                                                               const gchar* update_command,
                                                                                               gboolean active);
VALA_EXTERN SwayNotificationCenterWidgetsToggleButton* sway_notification_center_widgets_toggle_button_construct (GType object_type,
                                                                                                     const gchar* label,
                                                                                                     const gchar* command,
                                                                                                     const gchar* update_command,
                                                                                                     gboolean active);
static void _____lambda68_ (Block24Data* _data24_);
VALA_EXTERN void sway_notification_center_widgets_base_widget_execute_command (SwayNotificationCenterWidgetsBaseWidget* self,
                                                                   const gchar* cmd,
                                                                   gchar** env_additions,
                                                                   gint env_additions_length1,
                                                                   GAsyncReadyCallback _callback_,
                                                                   gpointer _user_data_);
VALA_EXTERN void sway_notification_center_widgets_base_widget_execute_command_finish (SwayNotificationCenterWidgetsBaseWidget* self,
                                                                          GAsyncResult* _res_);
static void ______lambda68__gtk_button_clicked (GtkButton* _sender,
                                         gpointer self);
static void sway_notification_center_widgets_buttons_grid_real_on_cc_visibility_change (SwayNotificationCenterWidgetsBaseWidget* base,
                                                                                 gboolean value);
VALA_EXTERN void sway_notification_center_widgets_toggle_button_on_update (SwayNotificationCenterWidgetsToggleButton* self,
                                                               GAsyncReadyCallback _callback_,
                                                               gpointer _user_data_);
VALA_EXTERN void sway_notification_center_widgets_toggle_button_on_update_finish (SwayNotificationCenterWidgetsToggleButton* self,
                                                                      GAsyncResult* _res_);
static void sway_notification_center_widgets_buttons_grid_finalize (GObject * obj);
static GType sway_notification_center_widgets_buttons_grid_get_type_once (void);
static void _vala_sway_notification_center_widgets_buttons_grid_get_property (GObject * object,
                                                                       guint property_id,
                                                                       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
sway_notification_center_widgets_buttons_grid_get_instance_private (SwayNotificationCenterWidgetsButtonsGrid* self)
{
	return G_STRUCT_MEMBER_P (self, SwayNotificationCenterWidgetsButtonsGrid_private_offset);
}

static void
_vala_SwayNotificationCenterWidgetsAction_array_free (SwayNotificationCenterWidgetsAction * array,
                                                      gssize array_length)
{
	if (array != NULL) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			sway_notification_center_widgets_action_destroy (&array[i]);
		}
	}
	g_free (array);
}

static void
_g_object_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}

static inline void
_g_list_free__g_object_unref0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) _g_object_unref0_);
}

static Block24Data*
block24_data_ref (Block24Data* _data24_)
{
	g_atomic_int_inc (&_data24_->_ref_count_);
	return _data24_;
}

static void
block24_data_unref (void * _userdata_)
{
	Block24Data* _data24_;
	_data24_ = (Block24Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data24_->_ref_count_)) {
		SwayNotificationCenterWidgetsButtonsGrid* self;
		self = _data24_->self;
		sway_notification_center_widgets_action_destroy (&_data24_->act);
		_g_object_unref0 (self);
		g_slice_free (Block24Data, _data24_);
	}
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static void
_____lambda68_ (Block24Data* _data24_)
{
	SwayNotificationCenterWidgetsButtonsGrid* self;
	SwayNotificationCenterWidgetsAction _tmp0_;
	const gchar* _tmp1_;
	gchar** _tmp2_;
	gchar** _tmp3_;
	gint _tmp3__length1;
	self = _data24_->self;
	_tmp0_ = _data24_->act;
	_tmp1_ = _tmp0_.command;
	_tmp2_ = g_new0 (gchar*, 0 + 1);
	_tmp3_ = _tmp2_;
	_tmp3__length1 = 0;
	sway_notification_center_widgets_base_widget_execute_command (G_TYPE_CHECK_INSTANCE_CAST (self, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET, SwayNotificationCenterWidgetsBaseWidget), _tmp1_, _tmp3_, (gint) 0, NULL, NULL);
	_tmp3_ = (_vala_array_free (_tmp3_, _tmp3__length1, (GDestroyNotify) g_free), NULL);
}

static void
______lambda68__gtk_button_clicked (GtkButton* _sender,
                                    gpointer self)
{
	_____lambda68_ (self);
}

SwayNotificationCenterWidgetsButtonsGrid*
sway_notification_center_widgets_buttons_grid_construct (GType object_type,
                                                         const gchar* suffix)
{
	SwayNotificationCenterWidgetsButtonsGrid * self = NULL;
	JsonObject* config = NULL;
	JsonObject* _tmp0_;
	JsonObject* _tmp1_;
	GtkFlowBox* container = NULL;
	GtkFlowBox* _tmp11_;
	GtkFlowBox* _tmp12_;
	GtkFlowBox* _tmp13_;
	GtkFlowBox* _tmp14_;
	GtkFlowBox* _tmp15_;
	SwayNotificationCenterWidgetsAction* _tmp16_;
	gint _tmp16__length1;
	g_return_val_if_fail (suffix != NULL, NULL);
	self = (SwayNotificationCenterWidgetsButtonsGrid*) sway_notification_center_widgets_base_widget_construct (object_type, suffix);
	_tmp0_ = sway_notification_center_widgets_base_widget_get_config (G_TYPE_CHECK_INSTANCE_CAST (self, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET, SwayNotificationCenterWidgetsBaseWidget), G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	config = _tmp0_;
	_tmp1_ = config;
	if (_tmp1_ != NULL) {
		JsonArray* a = NULL;
		JsonObject* _tmp2_;
		JsonArray* _tmp3_;
		JsonArray* _tmp4_;
		gboolean bpr_found = FALSE;
		gint bpr = 0;
		JsonObject* _tmp8_;
		gboolean _tmp9_ = FALSE;
		gpointer _tmp10_;
		_tmp2_ = config;
		_tmp3_ = sway_notification_center_widgets_base_widget_get_prop_array (G_TYPE_CHECK_INSTANCE_CAST (self, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET, SwayNotificationCenterWidgetsBaseWidget), _tmp2_, "actions");
		a = _tmp3_;
		_tmp4_ = a;
		if (_tmp4_ != NULL) {
			JsonArray* _tmp5_;
			gint _tmp6_ = 0;
			SwayNotificationCenterWidgetsAction* _tmp7_;
			_tmp5_ = a;
			_tmp7_ = sway_notification_center_widgets_base_widget_parse_actions (G_TYPE_CHECK_INSTANCE_CAST (self, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET, SwayNotificationCenterWidgetsBaseWidget), _tmp5_, &_tmp6_);
			self->priv->actions = (_vala_SwayNotificationCenterWidgetsAction_array_free (self->priv->actions, self->priv->actions_length1), NULL);
			self->priv->actions = _tmp7_;
			self->priv->actions_length1 = _tmp6_;
			self->priv->_actions_size_ = self->priv->actions_length1;
		}
		bpr_found = FALSE;
		_tmp8_ = config;
		_tmp10_ = sway_notification_center_widgets_base_widget_get_prop (G_TYPE_CHECK_INSTANCE_CAST (self, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET, SwayNotificationCenterWidgetsBaseWidget), G_TYPE_INT, NULL, NULL, _tmp8_, "buttons-per-row", &_tmp9_);
		bpr_found = _tmp9_;
		bpr = (gint) ((gintptr) _tmp10_);
		if (bpr_found) {
			self->priv->buttons_per_row = bpr;
		}
		_json_array_unref0 (a);
	}
	_tmp11_ = (GtkFlowBox*) gtk_flow_box_new ();
	if (_tmp11_) {
		g_object_set_data ((GObject *) _tmp11_, "vala-creation-function", "SwayNotificationCenter.Widgets.ButtonsGrid.new");
	}
	g_object_ref_sink (_tmp11_);
	container = _tmp11_;
	_tmp12_ = container;
	gtk_flow_box_set_max_children_per_line (_tmp12_, (guint) self->priv->buttons_per_row);
	_tmp13_ = container;
	gtk_flow_box_set_selection_mode (_tmp13_, GTK_SELECTION_NONE);
	_tmp14_ = container;
	gtk_widget_set_hexpand (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, gtk_widget_get_type (), GtkWidget), TRUE);
	_tmp15_ = container;
	gtk_box_append (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_box_get_type (), GtkBox), G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, gtk_widget_get_type (), GtkWidget));
	_tmp16_ = self->priv->actions;
	_tmp16__length1 = self->priv->actions_length1;
	{
		SwayNotificationCenterWidgetsAction* act_collection = NULL;
		gint act_collection_length1 = 0;
		gint _act_collection_size_ = 0;
		gint act_it = 0;
		act_collection = _tmp16_;
		act_collection_length1 = _tmp16__length1;
		for (act_it = 0; act_it < act_collection_length1; act_it = act_it + 1) {
			SwayNotificationCenterWidgetsAction _tmp17_;
			SwayNotificationCenterWidgetsAction _tmp18_ = {0};
			SwayNotificationCenterWidgetsAction act = {0};
			_tmp17_ = act_collection[act_it];
			sway_notification_center_widgets_action_copy (&_tmp17_, &_tmp18_);
			act = _tmp18_;
			{
				Block24Data* _data24_;
				SwayNotificationCenterWidgetsAction _tmp19_;
				SwayNotificationCenterWidgetsBaseWidgetButtonType* _tmp20_;
				_data24_ = g_slice_new0 (Block24Data);
				_data24_->_ref_count_ = 1;
				_data24_->self = g_object_ref (self);
				_data24_->act = act;
				_tmp19_ = _data24_->act;
				_tmp20_ = _tmp19_.type;
				switch (*_tmp20_) {
					case SWAY_NOTIFICATION_CENTER_WIDGETS_BASE_WIDGET_BUTTON_TYPE_TOGGLE:
					{
						SwayNotificationCenterWidgetsToggleButton* tb = NULL;
						SwayNotificationCenterWidgetsAction _tmp21_;
						const gchar* _tmp22_;
						SwayNotificationCenterWidgetsAction _tmp23_;
						const gchar* _tmp24_;
						SwayNotificationCenterWidgetsAction _tmp25_;
						const gchar* _tmp26_;
						SwayNotificationCenterWidgetsAction _tmp27_;
						gboolean* _tmp28_;
						SwayNotificationCenterWidgetsToggleButton* _tmp29_;
						GtkFlowBox* _tmp30_;
						SwayNotificationCenterWidgetsToggleButton* _tmp31_;
						SwayNotificationCenterWidgetsToggleButton* _tmp32_;
						SwayNotificationCenterWidgetsToggleButton* _tmp33_;
						_tmp21_ = _data24_->act;
						_tmp22_ = _tmp21_.label;
						_tmp23_ = _data24_->act;
						_tmp24_ = _tmp23_.command;
						_tmp25_ = _data24_->act;
						_tmp26_ = _tmp25_.update_command;
						_tmp27_ = _data24_->act;
						_tmp28_ = _tmp27_.active;
						_tmp29_ = sway_notification_center_widgets_toggle_button_new (_tmp22_, _tmp24_, _tmp26_, *_tmp28_);
						if (_tmp29_) {
							g_object_set_data ((GObject *) _tmp29_, "vala-creation-function", "SwayNotificationCenter.Widgets.ButtonsGrid.new");
						}
						g_object_ref_sink (_tmp29_);
						tb = _tmp29_;
						_tmp30_ = container;
						_tmp31_ = tb;
						gtk_flow_box_insert (_tmp30_, G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, gtk_widget_get_type (), GtkWidget), -1);
						_tmp32_ = tb;
						_tmp33_ = _g_object_ref0 (_tmp32_);
						self->priv->toggle_buttons = g_list_append (self->priv->toggle_buttons, _tmp33_);
						_g_object_unref0 (tb);
						break;
					}
					default:
					{
						GtkButton* b = NULL;
						SwayNotificationCenterWidgetsAction _tmp34_;
						const gchar* _tmp35_;
						GtkButton* _tmp36_;
						GtkButton* _tmp37_;
						GtkFlowBox* _tmp38_;
						GtkButton* _tmp39_;
						_tmp34_ = _data24_->act;
						_tmp35_ = _tmp34_.label;
						_tmp36_ = (GtkButton*) gtk_button_new_with_label (_tmp35_);
						if (_tmp36_) {
							g_object_set_data ((GObject *) _tmp36_, "vala-creation-function", "SwayNotificationCenter.Widgets.ButtonsGrid.new");
						}
						g_object_ref_sink (_tmp36_);
						b = _tmp36_;
						_tmp37_ = b;
						g_signal_connect_data (_tmp37_, "clicked", (GCallback) ______lambda68__gtk_button_clicked, block24_data_ref (_data24_), (GClosureNotify) block24_data_unref, 0);
						_tmp38_ = container;
						_tmp39_ = b;
						gtk_flow_box_insert (_tmp38_, G_TYPE_CHECK_INSTANCE_CAST (_tmp39_, gtk_widget_get_type (), GtkWidget), -1);
						_g_object_unref0 (b);
						break;
					}
				}
				block24_data_unref (_data24_);
				_data24_ = NULL;
			}
		}
	}
	_g_object_unref0 (container);
	_json_object_unref0 (config);
	return self;
}

SwayNotificationCenterWidgetsButtonsGrid*
sway_notification_center_widgets_buttons_grid_new (const gchar* suffix)
{
	return sway_notification_center_widgets_buttons_grid_construct (SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BUTTONS_GRID, suffix);
}

static void
sway_notification_center_widgets_buttons_grid_real_on_cc_visibility_change (SwayNotificationCenterWidgetsBaseWidget* base,
                                                                            gboolean value)
{
	SwayNotificationCenterWidgetsButtonsGrid * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BUTTONS_GRID, SwayNotificationCenterWidgetsButtonsGrid);
	if (value) {
		GList* _tmp0_;
		_tmp0_ = self->priv->toggle_buttons;
		{
			GList* tb_collection = NULL;
			GList* tb_it = NULL;
			tb_collection = _tmp0_;
			for (tb_it = tb_collection; tb_it != NULL; tb_it = tb_it->next) {
				SwayNotificationCenterWidgetsToggleButton* _tmp1_;
				SwayNotificationCenterWidgetsToggleButton* tb = NULL;
				_tmp1_ = _g_object_ref0 ((SwayNotificationCenterWidgetsToggleButton*) tb_it->data);
				tb = _tmp1_;
				{
					SwayNotificationCenterWidgetsToggleButton* _tmp2_;
					_tmp2_ = tb;
					sway_notification_center_widgets_toggle_button_on_update (_tmp2_, NULL, NULL);
					_g_object_unref0 (tb);
				}
			}
		}
	}
}

static const gchar*
sway_notification_center_widgets_buttons_grid_real_get_widget_name (SwayNotificationCenterWidgetsBaseWidget* base)
{
	const gchar* result;
	SwayNotificationCenterWidgetsButtonsGrid* self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BUTTONS_GRID, SwayNotificationCenterWidgetsButtonsGrid);
	result = "buttons-grid";
	return result;
}

static void
sway_notification_center_widgets_buttons_grid_class_init (SwayNotificationCenterWidgetsButtonsGridClass * klass,
                                                          gpointer klass_data)
{
	sway_notification_center_widgets_buttons_grid_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SwayNotificationCenterWidgetsButtonsGrid_private_offset);
	((SwayNotificationCenterWidgetsBaseWidgetClass *) klass)->on_cc_visibility_change = (void (*) (SwayNotificationCenterWidgetsBaseWidget*, gboolean)) sway_notification_center_widgets_buttons_grid_real_on_cc_visibility_change;
	SWAY_NOTIFICATION_CENTER_WIDGETS_BASE_WIDGET_CLASS (klass)->get_widget_name = (const gchar* (*) (SwayNotificationCenterWidgetsBaseWidget*)) sway_notification_center_widgets_buttons_grid_real_get_widget_name;
	G_OBJECT_CLASS (klass)->get_property = _vala_sway_notification_center_widgets_buttons_grid_get_property;
	G_OBJECT_CLASS (klass)->finalize = sway_notification_center_widgets_buttons_grid_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SWAY_NOTIFICATION_CENTER_WIDGETS_BUTTONS_GRID_WIDGET_NAME_PROPERTY, sway_notification_center_widgets_buttons_grid_properties[SWAY_NOTIFICATION_CENTER_WIDGETS_BUTTONS_GRID_WIDGET_NAME_PROPERTY] = g_param_spec_string ("widget-name", "widget-name", "widget-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
sway_notification_center_widgets_buttons_grid_instance_init (SwayNotificationCenterWidgetsButtonsGrid * self,
                                                             gpointer klass)
{
	self->priv = sway_notification_center_widgets_buttons_grid_get_instance_private (self);
	self->priv->buttons_per_row = 7;
}

static void
sway_notification_center_widgets_buttons_grid_finalize (GObject * obj)
{
	SwayNotificationCenterWidgetsButtonsGrid * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BUTTONS_GRID, SwayNotificationCenterWidgetsButtonsGrid);
	self->priv->actions = (_vala_SwayNotificationCenterWidgetsAction_array_free (self->priv->actions, self->priv->actions_length1), NULL);
	(self->priv->toggle_buttons == NULL) ? NULL : (self->priv->toggle_buttons = (_g_list_free__g_object_unref0_ (self->priv->toggle_buttons), NULL));
	G_OBJECT_CLASS (sway_notification_center_widgets_buttons_grid_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
sway_notification_center_widgets_buttons_grid_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SwayNotificationCenterWidgetsButtonsGridClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sway_notification_center_widgets_buttons_grid_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SwayNotificationCenterWidgetsButtonsGrid), 0, (GInstanceInitFunc) sway_notification_center_widgets_buttons_grid_instance_init, NULL };
	GType sway_notification_center_widgets_buttons_grid_type_id;
	sway_notification_center_widgets_buttons_grid_type_id = g_type_register_static (SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET, "SwayNotificationCenterWidgetsButtonsGrid", &g_define_type_info, 0);
	SwayNotificationCenterWidgetsButtonsGrid_private_offset = g_type_add_instance_private (sway_notification_center_widgets_buttons_grid_type_id, sizeof (SwayNotificationCenterWidgetsButtonsGridPrivate));
	return sway_notification_center_widgets_buttons_grid_type_id;
}

GType
sway_notification_center_widgets_buttons_grid_get_type (void)
{
	static gsize sway_notification_center_widgets_buttons_grid_type_id__once = 0;
	if (g_once_init_enter (&sway_notification_center_widgets_buttons_grid_type_id__once)) {
		GType sway_notification_center_widgets_buttons_grid_type_id;
		sway_notification_center_widgets_buttons_grid_type_id = sway_notification_center_widgets_buttons_grid_get_type_once ();
		g_once_init_leave (&sway_notification_center_widgets_buttons_grid_type_id__once, sway_notification_center_widgets_buttons_grid_type_id);
	}
	return sway_notification_center_widgets_buttons_grid_type_id__once;
}

static void
_vala_sway_notification_center_widgets_buttons_grid_get_property (GObject * object,
                                                                  guint property_id,
                                                                  GValue * value,
                                                                  GParamSpec * pspec)
{
	SwayNotificationCenterWidgetsButtonsGrid * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BUTTONS_GRID, SwayNotificationCenterWidgetsButtonsGrid);
	switch (property_id) {
		case SWAY_NOTIFICATION_CENTER_WIDGETS_BUTTONS_GRID_WIDGET_NAME_PROPERTY:
		g_value_set_string (value, sway_notification_center_widgets_base_widget_get_widget_name (G_TYPE_CHECK_INSTANCE_CAST (self, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET, SwayNotificationCenterWidgetsBaseWidget)));
		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);
}

