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

#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gtk/gtk.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

typedef enum  {
	SWAY_NOTIFICATION_CENTER_WIDGETS_MENU_TYPE_BUTTONS,
	SWAY_NOTIFICATION_CENTER_WIDGETS_MENU_TYPE_MENU
} SwayNotificationCenterWidgetsMenuType;

#define SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_MENU_TYPE (sway_notification_center_widgets_menu_type_get_type ())
typedef enum  {
	SWAY_NOTIFICATION_CENTER_WIDGETS_POSITION_LEFT,
	SWAY_NOTIFICATION_CENTER_WIDGETS_POSITION_RIGHT
} SwayNotificationCenterWidgetsPosition;

#define SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_POSITION (sway_notification_center_widgets_position_get_type ())

#define SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_CONFIG_OBJECT (sway_notification_center_widgets_config_object_get_type ())
typedef struct _SwayNotificationCenterWidgetsConfigObject SwayNotificationCenterWidgetsConfigObject;

#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 _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#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_MENUBAR (sway_notification_center_widgets_menubar_get_type ())
#define SWAY_NOTIFICATION_CENTER_WIDGETS_MENUBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_MENUBAR, SwayNotificationCenterWidgetsMenubar))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_MENUBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_MENUBAR, SwayNotificationCenterWidgetsMenubarClass))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_IS_MENUBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_MENUBAR))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_IS_MENUBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_MENUBAR))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_MENUBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_MENUBAR, SwayNotificationCenterWidgetsMenubarClass))

typedef struct _SwayNotificationCenterWidgetsMenubar SwayNotificationCenterWidgetsMenubar;
typedef struct _SwayNotificationCenterWidgetsMenubarClass SwayNotificationCenterWidgetsMenubarClass;
typedef struct _SwayNotificationCenterWidgetsMenubarPrivate SwayNotificationCenterWidgetsMenubarPrivate;

#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_MENUBAR_0_PROPERTY,
	SWAY_NOTIFICATION_CENTER_WIDGETS_MENUBAR_WIDGET_NAME_PROPERTY,
	SWAY_NOTIFICATION_CENTER_WIDGETS_MENUBAR_NUM_PROPERTIES
};
static GParamSpec* sway_notification_center_widgets_menubar_properties[SWAY_NOTIFICATION_CENTER_WIDGETS_MENUBAR_NUM_PROPERTIES];
#define _sway_notification_center_widgets_config_object_free0(var) ((var == NULL) ? NULL : (var = (sway_notification_center_widgets_config_object_free (var), NULL)))
#define _json_object_unref0(var) ((var == NULL) ? NULL : (var = (json_object_unref (var), NULL)))
typedef struct _Block21Data Block21Data;
typedef struct _Block22Data Block22Data;
typedef struct _Block23Data Block23Data;
#define _json_array_unref0(var) ((var == NULL) ? NULL : (var = (json_array_unref (var), NULL)))

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

struct _SwayNotificationCenterWidgetsConfigObject {
	gchar* name;
	SwayNotificationCenterWidgetsMenuType* type;
	gchar* label;
	SwayNotificationCenterWidgetsPosition* position;
	SwayNotificationCenterWidgetsAction* actions;
	gint actions_length1;
	GtkRevealer* revealer;
	gint animation_duration;
	GtkRevealerTransitionType animation_type;
};

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 _SwayNotificationCenterWidgetsMenubar {
	SwayNotificationCenterWidgetsBaseWidget parent_instance;
	SwayNotificationCenterWidgetsMenubarPrivate * priv;
};

struct _SwayNotificationCenterWidgetsMenubarClass {
	SwayNotificationCenterWidgetsBaseWidgetClass parent_class;
};

struct _SwayNotificationCenterWidgetsMenubarPrivate {
	GtkBox* left_container;
	GtkBox* right_container;
	GList* menu_objects;
	GList* toggle_buttons;
};

struct _Block21Data {
	int _ref_count_;
	SwayNotificationCenterWidgetsMenubar* self;
	SwayNotificationCenterWidgetsAction a;
};

struct _Block22Data {
	int _ref_count_;
	SwayNotificationCenterWidgetsMenubar* self;
	GtkRevealer* r;
};

struct _Block23Data {
	int _ref_count_;
	Block22Data * _data22_;
	SwayNotificationCenterWidgetsAction a;
};

static gint SwayNotificationCenterWidgetsMenubar_private_offset;
static gpointer sway_notification_center_widgets_menubar_parent_class = NULL;

VALA_EXTERN GType sway_notification_center_widgets_menu_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType sway_notification_center_widgets_position_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType sway_notification_center_widgets_config_object_get_type (void) G_GNUC_CONST ;
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 SwayNotificationCenterWidgetsConfigObject* sway_notification_center_widgets_config_object_dup (const SwayNotificationCenterWidgetsConfigObject* self);
VALA_EXTERN void sway_notification_center_widgets_config_object_free (SwayNotificationCenterWidgetsConfigObject* self);
VALA_EXTERN void sway_notification_center_widgets_config_object_copy (const SwayNotificationCenterWidgetsConfigObject* self,
                                                          SwayNotificationCenterWidgetsConfigObject* dest);
VALA_EXTERN void sway_notification_center_widgets_config_object_destroy (SwayNotificationCenterWidgetsConfigObject* self);
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (SwayNotificationCenterWidgetsConfigObject, sway_notification_center_widgets_config_object_destroy)
static void _vala_SwayNotificationCenterWidgetsAction_array_free (SwayNotificationCenterWidgetsAction * array,
                                                           gssize array_length);
static SwayNotificationCenterWidgetsMenuType* _sway_notification_center_widgets_menu_type_dup (SwayNotificationCenterWidgetsMenuType* self);
static SwayNotificationCenterWidgetsPosition* _sway_notification_center_widgets_position_dup (SwayNotificationCenterWidgetsPosition* self);
static SwayNotificationCenterWidgetsAction* _vala_array_dup4 (SwayNotificationCenterWidgetsAction* self,
                                                       gssize length);
static SwayNotificationCenterWidgetsBaseWidgetButtonType* _sway_notification_center_widgets_base_widget_button_type_dup (SwayNotificationCenterWidgetsBaseWidgetButtonType* self);
static gboolean* _bool_dup (gboolean* self);
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_menubar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SwayNotificationCenterWidgetsMenubar, g_object_unref)
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 _sway_notification_center_widgets_config_object_free0_ (gpointer var);
static inline void _g_list_free__sway_notification_center_widgets_config_object_free0_ (GList* self);
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
VALA_EXTERN SwayNotificationCenterWidgetsMenubar* sway_notification_center_widgets_menubar_new (const gchar* suffix);
VALA_EXTERN SwayNotificationCenterWidgetsMenubar* sway_notification_center_widgets_menubar_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 void sway_notification_center_widgets_menubar_parse_config_objects (SwayNotificationCenterWidgetsMenubar* self,
                                                                    JsonObject* config);
static void sway_notification_center_widgets_menubar_add_menu (SwayNotificationCenterWidgetsMenubar* self,
                                                        SwayNotificationCenterWidgetsConfigObject** obj);
static Block21Data* block21_data_ref (Block21Data* _data21_);
static void block21_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 ______lambda65_ (Block21Data* _data21_);
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 _______lambda65__gtk_button_clicked (GtkButton* _sender,
                                          gpointer self);
static Block22Data* block22_data_ref (Block22Data* _data22_);
static void block22_data_unref (void * _userdata_);
static void ___lambda66_ (Block22Data* _data22_);
static void ____lambda66__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static Block23Data* block23_data_ref (Block23Data* _data23_);
static void block23_data_unref (void * _userdata_);
static void ______lambda67_ (Block23Data* _data23_);
static void _______lambda67__gtk_button_clicked (GtkButton* _sender,
                                          gpointer self);
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);
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);
static SwayNotificationCenterWidgetsAction* _vala_array_dup5 (SwayNotificationCenterWidgetsAction* self,
                                                       gssize length);
static void sway_notification_center_widgets_menubar_real_on_cc_visibility_change (SwayNotificationCenterWidgetsBaseWidget* base,
                                                                            gboolean val);
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_menubar_finalize (GObject * obj);
static GType sway_notification_center_widgets_menubar_get_type_once (void);
static void _vala_sway_notification_center_widgets_menubar_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 gssize _vala_array_length (gpointer array);

 G_GNUC_NO_INLINE static GType
sway_notification_center_widgets_menu_type_get_type_once (void)
{
	static const GEnumValue values[] = {{SWAY_NOTIFICATION_CENTER_WIDGETS_MENU_TYPE_BUTTONS, "SWAY_NOTIFICATION_CENTER_WIDGETS_MENU_TYPE_BUTTONS", "buttons"}, {SWAY_NOTIFICATION_CENTER_WIDGETS_MENU_TYPE_MENU, "SWAY_NOTIFICATION_CENTER_WIDGETS_MENU_TYPE_MENU", "menu"}, {0, NULL, NULL}};
	GType sway_notification_center_widgets_menu_type_type_id;
	sway_notification_center_widgets_menu_type_type_id = g_enum_register_static ("SwayNotificationCenterWidgetsMenuType", values);
	return sway_notification_center_widgets_menu_type_type_id;
}

GType
sway_notification_center_widgets_menu_type_get_type (void)
{
	static gsize sway_notification_center_widgets_menu_type_type_id__once = 0;
	if (g_once_init_enter (&sway_notification_center_widgets_menu_type_type_id__once)) {
		GType sway_notification_center_widgets_menu_type_type_id;
		sway_notification_center_widgets_menu_type_type_id = sway_notification_center_widgets_menu_type_get_type_once ();
		g_once_init_leave (&sway_notification_center_widgets_menu_type_type_id__once, sway_notification_center_widgets_menu_type_type_id);
	}
	return sway_notification_center_widgets_menu_type_type_id__once;
}

 G_GNUC_NO_INLINE static GType
sway_notification_center_widgets_position_get_type_once (void)
{
	static const GEnumValue values[] = {{SWAY_NOTIFICATION_CENTER_WIDGETS_POSITION_LEFT, "SWAY_NOTIFICATION_CENTER_WIDGETS_POSITION_LEFT", "left"}, {SWAY_NOTIFICATION_CENTER_WIDGETS_POSITION_RIGHT, "SWAY_NOTIFICATION_CENTER_WIDGETS_POSITION_RIGHT", "right"}, {0, NULL, NULL}};
	GType sway_notification_center_widgets_position_type_id;
	sway_notification_center_widgets_position_type_id = g_enum_register_static ("SwayNotificationCenterWidgetsPosition", values);
	return sway_notification_center_widgets_position_type_id;
}

GType
sway_notification_center_widgets_position_get_type (void)
{
	static gsize sway_notification_center_widgets_position_type_id__once = 0;
	if (g_once_init_enter (&sway_notification_center_widgets_position_type_id__once)) {
		GType sway_notification_center_widgets_position_type_id;
		sway_notification_center_widgets_position_type_id = sway_notification_center_widgets_position_get_type_once ();
		g_once_init_leave (&sway_notification_center_widgets_position_type_id__once, sway_notification_center_widgets_position_type_id);
	}
	return sway_notification_center_widgets_position_type_id__once;
}

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 SwayNotificationCenterWidgetsMenuType*
_sway_notification_center_widgets_menu_type_dup (SwayNotificationCenterWidgetsMenuType* self)
{
	SwayNotificationCenterWidgetsMenuType* dup;
	dup = g_new0 (SwayNotificationCenterWidgetsMenuType, 1);
	memcpy (dup, self, sizeof (SwayNotificationCenterWidgetsMenuType));
	return dup;
}

static gpointer
__sway_notification_center_widgets_menu_type_dup0 (gpointer self)
{
	return self ? _sway_notification_center_widgets_menu_type_dup (self) : NULL;
}

static SwayNotificationCenterWidgetsPosition*
_sway_notification_center_widgets_position_dup (SwayNotificationCenterWidgetsPosition* self)
{
	SwayNotificationCenterWidgetsPosition* dup;
	dup = g_new0 (SwayNotificationCenterWidgetsPosition, 1);
	memcpy (dup, self, sizeof (SwayNotificationCenterWidgetsPosition));
	return dup;
}

static gpointer
__sway_notification_center_widgets_position_dup0 (gpointer self)
{
	return self ? _sway_notification_center_widgets_position_dup (self) : NULL;
}

static SwayNotificationCenterWidgetsAction*
_vala_array_dup4 (SwayNotificationCenterWidgetsAction* self,
                  gssize length)
{
	if (length > 0) {
		SwayNotificationCenterWidgetsAction* result;
		gssize i;
		result = g_new0 (SwayNotificationCenterWidgetsAction, length);
		for (i = 0; i < length; i++) {
			SwayNotificationCenterWidgetsAction _tmp0_;
			SwayNotificationCenterWidgetsAction _tmp1_ = {0};
			_tmp0_ = self[i];
			sway_notification_center_widgets_action_copy (&_tmp0_, &_tmp1_);
			result[i] = _tmp1_;
		}
		return result;
	}
	return NULL;
}

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

void
sway_notification_center_widgets_config_object_copy (const SwayNotificationCenterWidgetsConfigObject* self,
                                                     SwayNotificationCenterWidgetsConfigObject* dest)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	SwayNotificationCenterWidgetsMenuType* _tmp2_;
	SwayNotificationCenterWidgetsMenuType* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	SwayNotificationCenterWidgetsPosition* _tmp6_;
	SwayNotificationCenterWidgetsPosition* _tmp7_;
	SwayNotificationCenterWidgetsAction* _tmp8_;
	gint _tmp8__length1;
	SwayNotificationCenterWidgetsAction* _tmp9_;
	gint _tmp9__length1;
	GtkRevealer* _tmp10_;
	GtkRevealer* _tmp11_;
	_tmp0_ = (*self).name;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 ((*dest).name);
	(*dest).name = _tmp1_;
	_tmp2_ = (*self).type;
	_tmp3_ = __sway_notification_center_widgets_menu_type_dup0 (_tmp2_);
	_g_free0 ((*dest).type);
	(*dest).type = _tmp3_;
	_tmp4_ = (*self).label;
	_tmp5_ = g_strdup (_tmp4_);
	_g_free0 ((*dest).label);
	(*dest).label = _tmp5_;
	_tmp6_ = (*self).position;
	_tmp7_ = __sway_notification_center_widgets_position_dup0 (_tmp6_);
	_g_free0 ((*dest).position);
	(*dest).position = _tmp7_;
	_tmp8_ = (*self).actions;
	_tmp8__length1 = (*self).actions_length1;
	_tmp9_ = (_tmp8_ != NULL) ? _vala_array_dup4 (_tmp8_, _tmp8__length1) : _tmp8_;
	_tmp9__length1 = _tmp8__length1;
	(*dest).actions = (_vala_SwayNotificationCenterWidgetsAction_array_free ((*dest).actions, (*dest).actions_length1), NULL);
	(*dest).actions = _tmp9_;
	(*dest).actions_length1 = _tmp9__length1;
	_tmp10_ = (*self).revealer;
	_tmp11_ = _g_object_ref0 (_tmp10_);
	_g_object_unref0 ((*dest).revealer);
	(*dest).revealer = _tmp11_;
	(*dest).animation_duration = (*self).animation_duration;
	(*dest).animation_type = (*self).animation_type;
}

void
sway_notification_center_widgets_config_object_destroy (SwayNotificationCenterWidgetsConfigObject* self)
{
	_g_free0 ((*self).name);
	_g_free0 ((*self).type);
	_g_free0 ((*self).label);
	_g_free0 ((*self).position);
	(*self).actions = (_vala_SwayNotificationCenterWidgetsAction_array_free ((*self).actions, (*self).actions_length1), NULL);
	_g_object_unref0 ((*self).revealer);
}

SwayNotificationCenterWidgetsConfigObject*
sway_notification_center_widgets_config_object_dup (const SwayNotificationCenterWidgetsConfigObject* self)
{
	SwayNotificationCenterWidgetsConfigObject* dup;
	dup = g_new0 (SwayNotificationCenterWidgetsConfigObject, 1);
	sway_notification_center_widgets_config_object_copy (self, dup);
	return dup;
}

void
sway_notification_center_widgets_config_object_free (SwayNotificationCenterWidgetsConfigObject* self)
{
	sway_notification_center_widgets_config_object_destroy (self);
	g_free (self);
}

 G_GNUC_NO_INLINE static GType
sway_notification_center_widgets_config_object_get_type_once (void)
{
	GType sway_notification_center_widgets_config_object_type_id;
	sway_notification_center_widgets_config_object_type_id = g_boxed_type_register_static ("SwayNotificationCenterWidgetsConfigObject", (GBoxedCopyFunc) sway_notification_center_widgets_config_object_dup, (GBoxedFreeFunc) sway_notification_center_widgets_config_object_free);
	return sway_notification_center_widgets_config_object_type_id;
}

GType
sway_notification_center_widgets_config_object_get_type (void)
{
	static gsize sway_notification_center_widgets_config_object_type_id__once = 0;
	if (g_once_init_enter (&sway_notification_center_widgets_config_object_type_id__once)) {
		GType sway_notification_center_widgets_config_object_type_id;
		sway_notification_center_widgets_config_object_type_id = sway_notification_center_widgets_config_object_get_type_once ();
		g_once_init_leave (&sway_notification_center_widgets_config_object_type_id__once, sway_notification_center_widgets_config_object_type_id);
	}
	return sway_notification_center_widgets_config_object_type_id__once;
}

static SwayNotificationCenterWidgetsBaseWidgetButtonType*
_sway_notification_center_widgets_base_widget_button_type_dup (SwayNotificationCenterWidgetsBaseWidgetButtonType* self)
{
	SwayNotificationCenterWidgetsBaseWidgetButtonType* dup;
	dup = g_new0 (SwayNotificationCenterWidgetsBaseWidgetButtonType, 1);
	memcpy (dup, self, sizeof (SwayNotificationCenterWidgetsBaseWidgetButtonType));
	return dup;
}

static gpointer
__sway_notification_center_widgets_base_widget_button_type_dup0 (gpointer self)
{
	return self ? _sway_notification_center_widgets_base_widget_button_type_dup (self) : NULL;
}

static gboolean*
_bool_dup (gboolean* self)
{
	gboolean* dup;
	dup = g_new0 (gboolean, 1);
	memcpy (dup, self, sizeof (gboolean));
	return dup;
}

static gpointer
__bool_dup0 (gpointer self)
{
	return self ? _bool_dup (self) : NULL;
}

void
sway_notification_center_widgets_action_copy (const SwayNotificationCenterWidgetsAction* self,
                                              SwayNotificationCenterWidgetsAction* dest)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	SwayNotificationCenterWidgetsBaseWidgetButtonType* _tmp4_;
	SwayNotificationCenterWidgetsBaseWidgetButtonType* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gboolean* _tmp8_;
	gboolean* _tmp9_;
	_tmp0_ = (*self).label;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 ((*dest).label);
	(*dest).label = _tmp1_;
	_tmp2_ = (*self).command;
	_tmp3_ = g_strdup (_tmp2_);
	_g_free0 ((*dest).command);
	(*dest).command = _tmp3_;
	_tmp4_ = (*self).type;
	_tmp5_ = __sway_notification_center_widgets_base_widget_button_type_dup0 (_tmp4_);
	_g_free0 ((*dest).type);
	(*dest).type = _tmp5_;
	_tmp6_ = (*self).update_command;
	_tmp7_ = g_strdup (_tmp6_);
	_g_free0 ((*dest).update_command);
	(*dest).update_command = _tmp7_;
	_tmp8_ = (*self).active;
	_tmp9_ = __bool_dup0 (_tmp8_);
	_g_free0 ((*dest).active);
	(*dest).active = _tmp9_;
}

void
sway_notification_center_widgets_action_destroy (SwayNotificationCenterWidgetsAction* self)
{
	_g_free0 ((*self).label);
	_g_free0 ((*self).command);
	_g_free0 ((*self).type);
	_g_free0 ((*self).update_command);
	_g_free0 ((*self).active);
}

SwayNotificationCenterWidgetsAction*
sway_notification_center_widgets_action_dup (const SwayNotificationCenterWidgetsAction* self)
{
	SwayNotificationCenterWidgetsAction* dup;
	dup = g_new0 (SwayNotificationCenterWidgetsAction, 1);
	sway_notification_center_widgets_action_copy (self, dup);
	return dup;
}

void
sway_notification_center_widgets_action_free (SwayNotificationCenterWidgetsAction* self)
{
	sway_notification_center_widgets_action_destroy (self);
	g_free (self);
}

 G_GNUC_NO_INLINE static GType
sway_notification_center_widgets_action_get_type_once (void)
{
	GType sway_notification_center_widgets_action_type_id;
	sway_notification_center_widgets_action_type_id = g_boxed_type_register_static ("SwayNotificationCenterWidgetsAction", (GBoxedCopyFunc) sway_notification_center_widgets_action_dup, (GBoxedFreeFunc) sway_notification_center_widgets_action_free);
	return sway_notification_center_widgets_action_type_id;
}

GType
sway_notification_center_widgets_action_get_type (void)
{
	static gsize sway_notification_center_widgets_action_type_id__once = 0;
	if (g_once_init_enter (&sway_notification_center_widgets_action_type_id__once)) {
		GType sway_notification_center_widgets_action_type_id;
		sway_notification_center_widgets_action_type_id = sway_notification_center_widgets_action_get_type_once ();
		g_once_init_leave (&sway_notification_center_widgets_action_type_id__once, sway_notification_center_widgets_action_type_id);
	}
	return sway_notification_center_widgets_action_type_id__once;
}

static inline gpointer
sway_notification_center_widgets_menubar_get_instance_private (SwayNotificationCenterWidgetsMenubar* self)
{
	return G_STRUCT_MEMBER_P (self, SwayNotificationCenterWidgetsMenubar_private_offset);
}

static void
_sway_notification_center_widgets_config_object_free0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (sway_notification_center_widgets_config_object_free (var), NULL));
}

static inline void
_g_list_free__sway_notification_center_widgets_config_object_free0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) _sway_notification_center_widgets_config_object_free0_);
}

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 gpointer
_sway_notification_center_widgets_config_object_dup0 (gpointer self)
{
	return self ? sway_notification_center_widgets_config_object_dup (self) : NULL;
}

SwayNotificationCenterWidgetsMenubar*
sway_notification_center_widgets_menubar_construct (GType object_type,
                                                    const gchar* suffix)
{
	SwayNotificationCenterWidgetsMenubar * self = NULL;
	JsonObject* config = NULL;
	JsonObject* _tmp0_;
	JsonObject* _tmp1_;
	GtkBox* topbar_container = NULL;
	GtkBox* _tmp3_;
	GtkBox* _tmp4_;
	GtkBox* _tmp5_;
	GtkBox* _tmp6_ = NULL;
	GtkBox* _tmp7_;
	GtkBox* _tmp8_;
	GtkBox* _tmp9_;
	GtkBox* _tmp10_;
	GtkBox* _tmp11_ = NULL;
	GtkBox* _tmp12_;
	GtkBox* _tmp13_;
	GtkBox* _tmp14_;
	GtkBox* _tmp15_;
	GList* _tmp21_;
	g_return_val_if_fail (suffix != NULL, NULL);
	self = (SwayNotificationCenterWidgetsMenubar*) sway_notification_center_widgets_base_widget_construct (object_type, suffix);
	gtk_orientable_set_orientation (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_orientable_get_type (), GtkOrientable), GTK_ORIENTATION_VERTICAL);
	gtk_widget_set_hexpand (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), TRUE);
	_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) {
		JsonObject* _tmp2_;
		_tmp2_ = config;
		sway_notification_center_widgets_menubar_parse_config_objects (self, _tmp2_);
	}
	_tmp3_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	if (_tmp3_) {
		g_object_set_data ((GObject *) _tmp3_, "vala-creation-function", "SwayNotificationCenter.Widgets.Menubar.new");
	}
	g_object_ref_sink (_tmp3_);
	topbar_container = _tmp3_;
	_tmp4_ = topbar_container;
	gtk_widget_add_css_class (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_widget_get_type (), GtkWidget), "menu-button-bar");
	_tmp5_ = topbar_container;
	gtk_box_append (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_box_get_type (), GtkBox), G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_widget_get_type (), GtkWidget));
	_tmp6_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	gtk_widget_set_overflow (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_widget_get_type (), GtkWidget), GTK_OVERFLOW_HIDDEN);
	gtk_widget_set_hexpand (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_widget_get_type (), GtkWidget), TRUE);
	gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_START);
	g_object_ref_sink (_tmp6_);
	_g_object_unref0 (self->priv->left_container);
	self->priv->left_container = _tmp6_;
	_tmp7_ = self->priv->left_container;
	gtk_widget_add_css_class (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, gtk_widget_get_type (), GtkWidget), "widget-menubar-container");
	_tmp8_ = self->priv->left_container;
	gtk_widget_add_css_class (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_widget_get_type (), GtkWidget), "start");
	_tmp9_ = topbar_container;
	_tmp10_ = self->priv->left_container;
	gtk_box_append (_tmp9_, G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, gtk_widget_get_type (), GtkWidget));
	_tmp11_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	gtk_widget_set_overflow (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, gtk_widget_get_type (), GtkWidget), GTK_OVERFLOW_HIDDEN);
	gtk_widget_set_hexpand (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, gtk_widget_get_type (), GtkWidget), TRUE);
	gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_END);
	g_object_ref_sink (_tmp11_);
	_g_object_unref0 (self->priv->right_container);
	self->priv->right_container = _tmp11_;
	_tmp12_ = self->priv->right_container;
	gtk_widget_add_css_class (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, gtk_widget_get_type (), GtkWidget), "widget-menubar-container");
	_tmp13_ = self->priv->right_container;
	gtk_widget_add_css_class (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_widget_get_type (), GtkWidget), "end");
	_tmp14_ = topbar_container;
	_tmp15_ = self->priv->right_container;
	gtk_box_append (_tmp14_, G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, gtk_widget_get_type (), GtkWidget));
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp16_ = FALSE;
			_tmp16_ = TRUE;
			while (TRUE) {
				GList* _tmp18_;
				SwayNotificationCenterWidgetsConfigObject* obj = NULL;
				GList* _tmp19_;
				gconstpointer _tmp20_;
				if (!_tmp16_) {
					gint _tmp17_;
					_tmp17_ = i;
					i = _tmp17_ + 1;
				}
				_tmp16_ = FALSE;
				_tmp18_ = self->priv->menu_objects;
				if (!(((guint) i) < g_list_length (_tmp18_))) {
					break;
				}
				_tmp19_ = self->priv->menu_objects;
				_tmp20_ = g_list_nth_data (_tmp19_, (guint) i);
				obj = (SwayNotificationCenterWidgetsConfigObject*) _tmp20_;
				sway_notification_center_widgets_menubar_add_menu (self, &obj);
			}
		}
	}
	_tmp21_ = self->priv->menu_objects;
	{
		GList* obj_collection = NULL;
		GList* obj_it = NULL;
		obj_collection = _tmp21_;
		for (obj_it = obj_collection; obj_it != NULL; obj_it = obj_it->next) {
			SwayNotificationCenterWidgetsConfigObject* _tmp22_;
			SwayNotificationCenterWidgetsConfigObject* obj = NULL;
			_tmp22_ = _sway_notification_center_widgets_config_object_dup0 ((SwayNotificationCenterWidgetsConfigObject*) obj_it->data);
			obj = _tmp22_;
			{
				GtkRevealer* _tmp23_ = NULL;
				SwayNotificationCenterWidgetsConfigObject* _tmp24_;
				GtkRevealer* _tmp25_;
				_tmp24_ = obj;
				_tmp25_ = (*_tmp24_).revealer;
				_tmp23_ = _tmp25_;
				if (_tmp23_ != NULL) {
					gtk_revealer_set_reveal_child (_tmp23_, FALSE);
				}
				_sway_notification_center_widgets_config_object_free0 (obj);
			}
		}
	}
	_g_object_unref0 (topbar_container);
	_json_object_unref0 (config);
	return self;
}

SwayNotificationCenterWidgetsMenubar*
sway_notification_center_widgets_menubar_new (const gchar* suffix)
{
	return sway_notification_center_widgets_menubar_construct (SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_MENUBAR, suffix);
}

static Block21Data*
block21_data_ref (Block21Data* _data21_)
{
	g_atomic_int_inc (&_data21_->_ref_count_);
	return _data21_;
}

static void
block21_data_unref (void * _userdata_)
{
	Block21Data* _data21_;
	_data21_ = (Block21Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data21_->_ref_count_)) {
		SwayNotificationCenterWidgetsMenubar* self;
		self = _data21_->self;
		sway_notification_center_widgets_action_destroy (&_data21_->a);
		_g_object_unref0 (self);
		g_slice_free (Block21Data, _data21_);
	}
}

static void
______lambda65_ (Block21Data* _data21_)
{
	SwayNotificationCenterWidgetsMenubar* self;
	SwayNotificationCenterWidgetsAction _tmp0_;
	const gchar* _tmp1_;
	gchar** _tmp2_;
	gchar** _tmp3_;
	gint _tmp3__length1;
	self = _data21_->self;
	_tmp0_ = _data21_->a;
	_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
_______lambda65__gtk_button_clicked (GtkButton* _sender,
                                     gpointer self)
{
	______lambda65_ (self);
}

static Block22Data*
block22_data_ref (Block22Data* _data22_)
{
	g_atomic_int_inc (&_data22_->_ref_count_);
	return _data22_;
}

static void
block22_data_unref (void * _userdata_)
{
	Block22Data* _data22_;
	_data22_ = (Block22Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data22_->_ref_count_)) {
		SwayNotificationCenterWidgetsMenubar* self;
		self = _data22_->self;
		_g_object_unref0 (_data22_->r);
		_g_object_unref0 (self);
		g_slice_free (Block22Data, _data22_);
	}
}

static void
___lambda66_ (Block22Data* _data22_)
{
	SwayNotificationCenterWidgetsMenubar* self;
	gboolean visible = FALSE;
	GtkRevealer* _tmp0_;
	GList* _tmp1_;
	GtkRevealer* _tmp6_;
	self = _data22_->self;
	_tmp0_ = _data22_->r;
	visible = !gtk_revealer_get_reveal_child (_tmp0_);
	_tmp1_ = self->priv->menu_objects;
	{
		GList* o_collection = NULL;
		GList* o_it = NULL;
		o_collection = _tmp1_;
		for (o_it = o_collection; o_it != NULL; o_it = o_it->next) {
			SwayNotificationCenterWidgetsConfigObject* _tmp2_;
			SwayNotificationCenterWidgetsConfigObject* o = NULL;
			_tmp2_ = _sway_notification_center_widgets_config_object_dup0 ((SwayNotificationCenterWidgetsConfigObject*) o_it->data);
			o = _tmp2_;
			{
				GtkRevealer* _tmp3_ = NULL;
				SwayNotificationCenterWidgetsConfigObject* _tmp4_;
				GtkRevealer* _tmp5_;
				_tmp4_ = o;
				_tmp5_ = (*_tmp4_).revealer;
				_tmp3_ = _tmp5_;
				if (_tmp3_ != NULL) {
					gtk_revealer_set_reveal_child (_tmp3_, FALSE);
				}
				_sway_notification_center_widgets_config_object_free0 (o);
			}
		}
	}
	_tmp6_ = _data22_->r;
	gtk_revealer_set_reveal_child (_tmp6_, visible);
}

static void
____lambda66__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	___lambda66_ (self);
}

static Block23Data*
block23_data_ref (Block23Data* _data23_)
{
	g_atomic_int_inc (&_data23_->_ref_count_);
	return _data23_;
}

static void
block23_data_unref (void * _userdata_)
{
	Block23Data* _data23_;
	_data23_ = (Block23Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data23_->_ref_count_)) {
		SwayNotificationCenterWidgetsMenubar* self;
		self = _data23_->_data22_->self;
		sway_notification_center_widgets_action_destroy (&_data23_->a);
		block22_data_unref (_data23_->_data22_);
		_data23_->_data22_ = NULL;
		g_slice_free (Block23Data, _data23_);
	}
}

static void
______lambda67_ (Block23Data* _data23_)
{
	Block22Data* _data22_;
	SwayNotificationCenterWidgetsMenubar* self;
	SwayNotificationCenterWidgetsAction _tmp0_;
	const gchar* _tmp1_;
	gchar** _tmp2_;
	gchar** _tmp3_;
	gint _tmp3__length1;
	_data22_ = _data23_->_data22_;
	self = _data22_->self;
	_tmp0_ = _data23_->a;
	_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
_______lambda67__gtk_button_clicked (GtkButton* _sender,
                                     gpointer self)
{
	______lambda67_ (self);
}

static void
sway_notification_center_widgets_menubar_add_menu (SwayNotificationCenterWidgetsMenubar* self,
                                                   SwayNotificationCenterWidgetsConfigObject** obj)
{
	SwayNotificationCenterWidgetsMenuType* _tmp0_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_MENUBAR (self));
	_tmp0_ = (*(*obj)).type;
	switch (*_tmp0_) {
		case SWAY_NOTIFICATION_CENTER_WIDGETS_MENU_TYPE_BUTTONS:
		{
			GtkBox* container = NULL;
			GtkBox* _tmp1_;
			const gchar* _tmp2_;
			SwayNotificationCenterWidgetsAction* _tmp5_;
			gint _tmp5__length1;
			SwayNotificationCenterWidgetsPosition* _tmp29_;
			_tmp1_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
			if (_tmp1_) {
				g_object_set_data ((GObject *) _tmp1_, "vala-creation-function", "SwayNotificationCenter.Widgets.Menubar.add_menu");
			}
			g_object_ref_sink (_tmp1_);
			container = _tmp1_;
			_tmp2_ = (*(*obj)).name;
			if (_tmp2_ != NULL) {
				GtkBox* _tmp3_;
				const gchar* _tmp4_;
				_tmp3_ = container;
				_tmp4_ = (*(*obj)).name;
				gtk_widget_add_css_class (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_widget_get_type (), GtkWidget), _tmp4_);
			}
			_tmp5_ = (*(*obj)).actions;
			_tmp5__length1 = (*(*obj)).actions_length1;
			{
				SwayNotificationCenterWidgetsAction* a_collection = NULL;
				gint a_collection_length1 = 0;
				gint _a_collection_size_ = 0;
				gint a_it = 0;
				a_collection = _tmp5_;
				a_collection_length1 = _tmp5__length1;
				for (a_it = 0; a_it < a_collection_length1; a_it = a_it + 1) {
					SwayNotificationCenterWidgetsAction _tmp6_;
					SwayNotificationCenterWidgetsAction _tmp7_ = {0};
					SwayNotificationCenterWidgetsAction a = {0};
					_tmp6_ = a_collection[a_it];
					sway_notification_center_widgets_action_copy (&_tmp6_, &_tmp7_);
					a = _tmp7_;
					{
						Block21Data* _data21_;
						SwayNotificationCenterWidgetsAction _tmp8_;
						SwayNotificationCenterWidgetsBaseWidgetButtonType* _tmp9_;
						_data21_ = g_slice_new0 (Block21Data);
						_data21_->_ref_count_ = 1;
						_data21_->self = g_object_ref (self);
						_data21_->a = a;
						_tmp8_ = _data21_->a;
						_tmp9_ = _tmp8_.type;
						switch (*_tmp9_) {
							case SWAY_NOTIFICATION_CENTER_WIDGETS_BASE_WIDGET_BUTTON_TYPE_TOGGLE:
							{
								SwayNotificationCenterWidgetsToggleButton* tb = NULL;
								SwayNotificationCenterWidgetsAction _tmp10_;
								const gchar* _tmp11_;
								SwayNotificationCenterWidgetsAction _tmp12_;
								const gchar* _tmp13_;
								SwayNotificationCenterWidgetsAction _tmp14_;
								const gchar* _tmp15_;
								SwayNotificationCenterWidgetsAction _tmp16_;
								gboolean* _tmp17_;
								SwayNotificationCenterWidgetsToggleButton* _tmp18_;
								GtkBox* _tmp19_;
								SwayNotificationCenterWidgetsToggleButton* _tmp20_;
								SwayNotificationCenterWidgetsToggleButton* _tmp21_;
								SwayNotificationCenterWidgetsToggleButton* _tmp22_;
								_tmp10_ = _data21_->a;
								_tmp11_ = _tmp10_.label;
								_tmp12_ = _data21_->a;
								_tmp13_ = _tmp12_.command;
								_tmp14_ = _data21_->a;
								_tmp15_ = _tmp14_.update_command;
								_tmp16_ = _data21_->a;
								_tmp17_ = _tmp16_.active;
								_tmp18_ = sway_notification_center_widgets_toggle_button_new (_tmp11_, _tmp13_, _tmp15_, *_tmp17_);
								if (_tmp18_) {
									g_object_set_data ((GObject *) _tmp18_, "vala-creation-function", "SwayNotificationCenter.Widgets.Menubar.add_menu");
								}
								g_object_ref_sink (_tmp18_);
								tb = _tmp18_;
								_tmp19_ = container;
								_tmp20_ = tb;
								gtk_box_append (_tmp19_, G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, gtk_widget_get_type (), GtkWidget));
								_tmp21_ = tb;
								_tmp22_ = _g_object_ref0 (_tmp21_);
								self->priv->toggle_buttons = g_list_append (self->priv->toggle_buttons, _tmp22_);
								_g_object_unref0 (tb);
								break;
							}
							default:
							{
								GtkButton* b = NULL;
								SwayNotificationCenterWidgetsAction _tmp23_;
								const gchar* _tmp24_;
								GtkButton* _tmp25_;
								GtkButton* _tmp26_;
								GtkBox* _tmp27_;
								GtkButton* _tmp28_;
								_tmp23_ = _data21_->a;
								_tmp24_ = _tmp23_.label;
								_tmp25_ = (GtkButton*) gtk_button_new_with_label (_tmp24_);
								if (_tmp25_) {
									g_object_set_data ((GObject *) _tmp25_, "vala-creation-function", "SwayNotificationCenter.Widgets.Menubar.add_menu");
								}
								g_object_ref_sink (_tmp25_);
								b = _tmp25_;
								_tmp26_ = b;
								g_signal_connect_data (_tmp26_, "clicked", (GCallback) _______lambda65__gtk_button_clicked, block21_data_ref (_data21_), (GClosureNotify) block21_data_unref, 0);
								_tmp27_ = container;
								_tmp28_ = b;
								gtk_box_append (_tmp27_, G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, gtk_widget_get_type (), GtkWidget));
								_g_object_unref0 (b);
								break;
							}
						}
						block21_data_unref (_data21_);
						_data21_ = NULL;
					}
				}
			}
			_tmp29_ = (*(*obj)).position;
			switch (*_tmp29_) {
				case SWAY_NOTIFICATION_CENTER_WIDGETS_POSITION_LEFT:
				{
					GtkBox* _tmp30_;
					GtkBox* _tmp31_;
					_tmp30_ = self->priv->left_container;
					_tmp31_ = container;
					gtk_box_append (_tmp30_, G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, gtk_widget_get_type (), GtkWidget));
					break;
				}
				case SWAY_NOTIFICATION_CENTER_WIDGETS_POSITION_RIGHT:
				{
					GtkBox* _tmp32_;
					GtkBox* _tmp33_;
					_tmp32_ = self->priv->right_container;
					_tmp33_ = container;
					gtk_box_append (_tmp32_, G_TYPE_CHECK_INSTANCE_CAST (_tmp33_, gtk_widget_get_type (), GtkWidget));
					break;
				}
				default:
				break;
			}
			_g_object_unref0 (container);
			break;
		}
		case SWAY_NOTIFICATION_CENTER_WIDGETS_MENU_TYPE_MENU:
		{
			Block22Data* _data22_;
			GtkToggleButton* show_button = NULL;
			const gchar* _tmp34_;
			GtkToggleButton* _tmp35_;
			GtkBox* menu = NULL;
			GtkBox* _tmp36_;
			const gchar* _tmp37_;
			GtkRevealer* _tmp40_;
			GtkRevealer* _tmp41_;
			GtkBox* _tmp42_;
			GtkRevealer* _tmp43_;
			GtkRevealer* _tmp44_;
			GtkRevealer* _tmp45_;
			GtkRevealer* _tmp46_;
			GtkRevealer* _tmp47_;
			GtkToggleButton* _tmp48_;
			GtkToggleButton* _tmp49_;
			SwayNotificationCenterWidgetsAction* _tmp50_;
			gint _tmp50__length1;
			SwayNotificationCenterWidgetsPosition* _tmp76_;
			GtkRevealer* _tmp81_;
			_data22_ = g_slice_new0 (Block22Data);
			_data22_->_ref_count_ = 1;
			_data22_->self = g_object_ref (self);
			_tmp34_ = (*(*obj)).label;
			_tmp35_ = (GtkToggleButton*) gtk_toggle_button_new_with_label (_tmp34_);
			if (_tmp35_) {
				g_object_set_data ((GObject *) _tmp35_, "vala-creation-function", "SwayNotificationCenter.Widgets.Menubar.add_menu");
			}
			g_object_ref_sink (_tmp35_);
			show_button = _tmp35_;
			_tmp36_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
			if (_tmp36_) {
				g_object_set_data ((GObject *) _tmp36_, "vala-creation-function", "SwayNotificationCenter.Widgets.Menubar.add_menu");
			}
			g_object_ref_sink (_tmp36_);
			menu = _tmp36_;
			_tmp37_ = (*(*obj)).name;
			if (_tmp37_ != NULL) {
				GtkBox* _tmp38_;
				const gchar* _tmp39_;
				_tmp38_ = menu;
				_tmp39_ = (*(*obj)).name;
				gtk_widget_add_css_class (G_TYPE_CHECK_INSTANCE_CAST (_tmp38_, gtk_widget_get_type (), GtkWidget), _tmp39_);
			}
			_tmp40_ = (GtkRevealer*) gtk_revealer_new ();
			if (_tmp40_) {
				g_object_set_data ((GObject *) _tmp40_, "vala-creation-function", "SwayNotificationCenter.Widgets.Menubar.add_menu");
			}
			g_object_ref_sink (_tmp40_);
			_data22_->r = _tmp40_;
			_tmp41_ = _data22_->r;
			_tmp42_ = menu;
			gtk_revealer_set_child (_tmp41_, G_TYPE_CHECK_INSTANCE_CAST (_tmp42_, gtk_widget_get_type (), GtkWidget));
			_tmp43_ = _data22_->r;
			gtk_revealer_set_transition_duration (_tmp43_, (guint) (*(*obj)).animation_duration);
			_tmp44_ = _data22_->r;
			gtk_revealer_set_transition_type (_tmp44_, (*(*obj)).animation_type);
			_tmp45_ = _data22_->r;
			_tmp46_ = _g_object_ref0 (_tmp45_);
			_g_object_unref0 ((*(*obj)).revealer);
			(*(*obj)).revealer = _tmp46_;
			_tmp47_ = _data22_->r;
			_tmp48_ = show_button;
			g_object_bind_property_with_closures (G_TYPE_CHECK_INSTANCE_CAST (_tmp47_, G_TYPE_OBJECT, GObject), "child-revealed", G_TYPE_CHECK_INSTANCE_CAST (_tmp48_, G_TYPE_OBJECT, GObject), "active", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
			_tmp49_ = show_button;
			g_signal_connect_data (G_TYPE_CHECK_INSTANCE_CAST (_tmp49_, gtk_button_get_type (), GtkButton), "clicked", (GCallback) ____lambda66__gtk_button_clicked, block22_data_ref (_data22_), (GClosureNotify) block22_data_unref, 0);
			_tmp50_ = (*(*obj)).actions;
			_tmp50__length1 = (*(*obj)).actions_length1;
			{
				SwayNotificationCenterWidgetsAction* a_collection = NULL;
				gint a_collection_length1 = 0;
				gint _a_collection_size_ = 0;
				gint a_it = 0;
				a_collection = _tmp50_;
				a_collection_length1 = _tmp50__length1;
				for (a_it = 0; a_it < a_collection_length1; a_it = a_it + 1) {
					SwayNotificationCenterWidgetsAction _tmp51_;
					SwayNotificationCenterWidgetsAction _tmp52_ = {0};
					SwayNotificationCenterWidgetsAction a = {0};
					_tmp51_ = a_collection[a_it];
					sway_notification_center_widgets_action_copy (&_tmp51_, &_tmp52_);
					a = _tmp52_;
					{
						Block23Data* _data23_;
						SwayNotificationCenterWidgetsAction _tmp53_;
						SwayNotificationCenterWidgetsBaseWidgetButtonType* _tmp54_;
						_data23_ = g_slice_new0 (Block23Data);
						_data23_->_ref_count_ = 1;
						_data23_->_data22_ = block22_data_ref (_data22_);
						_data23_->a = a;
						_tmp53_ = _data23_->a;
						_tmp54_ = _tmp53_.type;
						switch (*_tmp54_) {
							case SWAY_NOTIFICATION_CENTER_WIDGETS_BASE_WIDGET_BUTTON_TYPE_TOGGLE:
							{
								SwayNotificationCenterWidgetsToggleButton* tb = NULL;
								SwayNotificationCenterWidgetsAction _tmp55_;
								const gchar* _tmp56_;
								SwayNotificationCenterWidgetsAction _tmp57_;
								const gchar* _tmp58_;
								SwayNotificationCenterWidgetsAction _tmp59_;
								const gchar* _tmp60_;
								SwayNotificationCenterWidgetsAction _tmp61_;
								gboolean* _tmp62_;
								SwayNotificationCenterWidgetsToggleButton* _tmp63_;
								SwayNotificationCenterWidgetsToggleButton* _tmp64_;
								GtkBox* _tmp65_;
								SwayNotificationCenterWidgetsToggleButton* _tmp66_;
								SwayNotificationCenterWidgetsToggleButton* _tmp67_;
								SwayNotificationCenterWidgetsToggleButton* _tmp68_;
								_tmp55_ = _data23_->a;
								_tmp56_ = _tmp55_.label;
								_tmp57_ = _data23_->a;
								_tmp58_ = _tmp57_.command;
								_tmp59_ = _data23_->a;
								_tmp60_ = _tmp59_.update_command;
								_tmp61_ = _data23_->a;
								_tmp62_ = _tmp61_.active;
								_tmp63_ = sway_notification_center_widgets_toggle_button_new (_tmp56_, _tmp58_, _tmp60_, *_tmp62_);
								if (_tmp63_) {
									g_object_set_data ((GObject *) _tmp63_, "vala-creation-function", "SwayNotificationCenter.Widgets.Menubar.add_menu");
								}
								g_object_ref_sink (_tmp63_);
								tb = _tmp63_;
								_tmp64_ = tb;
								gtk_widget_set_hexpand (G_TYPE_CHECK_INSTANCE_CAST (_tmp64_, gtk_widget_get_type (), GtkWidget), TRUE);
								_tmp65_ = menu;
								_tmp66_ = tb;
								gtk_box_append (_tmp65_, G_TYPE_CHECK_INSTANCE_CAST (_tmp66_, gtk_widget_get_type (), GtkWidget));
								_tmp67_ = tb;
								_tmp68_ = _g_object_ref0 (_tmp67_);
								self->priv->toggle_buttons = g_list_append (self->priv->toggle_buttons, _tmp68_);
								_g_object_unref0 (tb);
								break;
							}
							default:
							{
								GtkButton* b = NULL;
								SwayNotificationCenterWidgetsAction _tmp69_;
								const gchar* _tmp70_;
								GtkButton* _tmp71_;
								GtkButton* _tmp72_;
								GtkButton* _tmp73_;
								GtkBox* _tmp74_;
								GtkButton* _tmp75_;
								_tmp69_ = _data23_->a;
								_tmp70_ = _tmp69_.label;
								_tmp71_ = (GtkButton*) gtk_button_new_with_label (_tmp70_);
								if (_tmp71_) {
									g_object_set_data ((GObject *) _tmp71_, "vala-creation-function", "SwayNotificationCenter.Widgets.Menubar.add_menu");
								}
								g_object_ref_sink (_tmp71_);
								b = _tmp71_;
								_tmp72_ = b;
								gtk_widget_set_hexpand (G_TYPE_CHECK_INSTANCE_CAST (_tmp72_, gtk_widget_get_type (), GtkWidget), TRUE);
								_tmp73_ = b;
								g_signal_connect_data (_tmp73_, "clicked", (GCallback) _______lambda67__gtk_button_clicked, block23_data_ref (_data23_), (GClosureNotify) block23_data_unref, 0);
								_tmp74_ = menu;
								_tmp75_ = b;
								gtk_box_append (_tmp74_, G_TYPE_CHECK_INSTANCE_CAST (_tmp75_, gtk_widget_get_type (), GtkWidget));
								_g_object_unref0 (b);
								break;
							}
						}
						block23_data_unref (_data23_);
						_data23_ = NULL;
					}
				}
			}
			_tmp76_ = (*(*obj)).position;
			switch (*_tmp76_) {
				case SWAY_NOTIFICATION_CENTER_WIDGETS_POSITION_RIGHT:
				{
					GtkBox* _tmp77_;
					GtkToggleButton* _tmp78_;
					_tmp77_ = self->priv->right_container;
					_tmp78_ = show_button;
					gtk_box_append (_tmp77_, G_TYPE_CHECK_INSTANCE_CAST (_tmp78_, gtk_widget_get_type (), GtkWidget));
					break;
				}
				case SWAY_NOTIFICATION_CENTER_WIDGETS_POSITION_LEFT:
				{
					GtkBox* _tmp79_;
					GtkToggleButton* _tmp80_;
					_tmp79_ = self->priv->left_container;
					_tmp80_ = show_button;
					gtk_box_append (_tmp79_, G_TYPE_CHECK_INSTANCE_CAST (_tmp80_, gtk_widget_get_type (), GtkWidget));
					break;
				}
				default:
				break;
			}
			_tmp81_ = _data22_->r;
			gtk_box_append (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_box_get_type (), GtkBox), G_TYPE_CHECK_INSTANCE_CAST (_tmp81_, gtk_widget_get_type (), GtkWidget));
			_g_object_unref0 (menu);
			_g_object_unref0 (show_button);
			block22_data_unref (_data22_);
			_data22_ = NULL;
			break;
		}
		default:
		break;
	}
}

static gpointer
_json_object_ref0 (gpointer self)
{
	return self ? json_object_ref (self) : NULL;
}

static SwayNotificationCenterWidgetsAction*
_vala_array_dup5 (SwayNotificationCenterWidgetsAction* self,
                  gssize length)
{
	if (length > 0) {
		SwayNotificationCenterWidgetsAction* result;
		gssize i;
		result = g_new0 (SwayNotificationCenterWidgetsAction, length);
		for (i = 0; i < length; i++) {
			SwayNotificationCenterWidgetsAction _tmp0_;
			SwayNotificationCenterWidgetsAction _tmp1_ = {0};
			_tmp0_ = self[i];
			sway_notification_center_widgets_action_copy (&_tmp0_, &_tmp1_);
			result[i] = _tmp1_;
		}
		return result;
	}
	return NULL;
}

void
sway_notification_center_widgets_menubar_parse_config_objects (SwayNotificationCenterWidgetsMenubar* self,
                                                               JsonObject* config)
{
	GList* elements = NULL;
	GList* _tmp0_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_MENUBAR (self));
	g_return_if_fail (config != NULL);
	_tmp0_ = json_object_get_members (config);
	elements = _tmp0_;
	(self->priv->menu_objects == NULL) ? NULL : (self->priv->menu_objects = (_g_list_free__sway_notification_center_widgets_config_object_free0_ (self->priv->menu_objects), NULL));
	self->priv->menu_objects = NULL;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				GList* _tmp3_;
				gchar* e = NULL;
				GList* _tmp4_;
				gconstpointer _tmp5_;
				gchar* _tmp6_;
				JsonObject* obj = NULL;
				const gchar* _tmp7_;
				JsonObject* _tmp8_;
				JsonObject* _tmp9_;
				JsonObject* _tmp10_;
				gchar** key = NULL;
				const gchar* _tmp11_;
				gchar** _tmp12_;
				gchar** _tmp13_;
				gint key_length1;
				gint _key_size_;
				gchar* t = NULL;
				gchar** _tmp14_;
				gint _tmp14__length1;
				const gchar* _tmp15_;
				gchar* _tmp16_;
				SwayNotificationCenterWidgetsMenuType type = 0;
				const gchar* _tmp17_;
				gchar* name = NULL;
				gchar** _tmp19_;
				gint _tmp19__length1;
				const gchar* _tmp20_;
				gchar* _tmp21_;
				gchar* p = NULL;
				JsonObject* _tmp22_;
				gpointer _tmp23_;
				SwayNotificationCenterWidgetsPosition pos = 0;
				gboolean _tmp24_ = FALSE;
				const gchar* _tmp25_;
				JsonArray* actions = NULL;
				JsonObject* _tmp28_;
				JsonArray* _tmp29_;
				JsonArray* _tmp30_;
				gchar* label = NULL;
				JsonObject* _tmp31_;
				gpointer _tmp32_;
				const gchar* _tmp33_;
				gint duration = 0;
				JsonObject* _tmp35_;
				gpointer _tmp36_;
				gchar* animation_type = NULL;
				JsonObject* _tmp37_;
				gpointer _tmp38_;
				const gchar* _tmp39_;
				GtkRevealerTransitionType revealer_type = 0;
				const gchar* _tmp41_;
				const gchar* _tmp42_;
				GQuark _tmp44_ = 0U;
				static GQuark _tmp43_label0 = 0;
				static GQuark _tmp43_label1 = 0;
				SwayNotificationCenterWidgetsAction* actions_list = NULL;
				JsonArray* _tmp45_;
				gint _tmp46_ = 0;
				SwayNotificationCenterWidgetsAction* _tmp47_;
				gint actions_list_length1;
				gint _actions_list_size_;
				const gchar* _tmp48_;
				gchar* _tmp49_;
				SwayNotificationCenterWidgetsMenuType* _tmp50_;
				const gchar* _tmp51_;
				gchar* _tmp52_;
				SwayNotificationCenterWidgetsPosition* _tmp53_;
				SwayNotificationCenterWidgetsAction* _tmp54_;
				gint _tmp54__length1;
				SwayNotificationCenterWidgetsAction* _tmp55_;
				gint _tmp55__length1;
				SwayNotificationCenterWidgetsConfigObject _tmp56_ = {0};
				SwayNotificationCenterWidgetsConfigObject _tmp57_;
				SwayNotificationCenterWidgetsConfigObject* _tmp58_;
				if (!_tmp1_) {
					gint _tmp2_;
					_tmp2_ = i;
					i = _tmp2_ + 1;
				}
				_tmp1_ = FALSE;
				_tmp3_ = elements;
				if (!(((guint) i) < g_list_length (_tmp3_))) {
					break;
				}
				_tmp4_ = elements;
				_tmp5_ = g_list_nth_data (_tmp4_, (guint) i);
				_tmp6_ = g_strdup ((const gchar*) _tmp5_);
				e = _tmp6_;
				_tmp7_ = e;
				_tmp8_ = json_object_get_object_member (config, _tmp7_);
				_tmp9_ = _json_object_ref0 (_tmp8_);
				obj = _tmp9_;
				_tmp10_ = obj;
				if (_tmp10_ == NULL) {
					_json_object_unref0 (obj);
					_g_free0 (e);
					continue;
				}
				_tmp11_ = e;
				_tmp13_ = _tmp12_ = g_strsplit (_tmp11_, "#", 0);
				key = _tmp13_;
				key_length1 = _vala_array_length (_tmp12_);
				_key_size_ = key_length1;
				_tmp14_ = key;
				_tmp14__length1 = key_length1;
				_tmp15_ = _tmp14_[0];
				_tmp16_ = g_strdup (_tmp15_);
				t = _tmp16_;
				type = SWAY_NOTIFICATION_CENTER_WIDGETS_MENU_TYPE_BUTTONS;
				_tmp17_ = t;
				if (g_strcmp0 (_tmp17_, "buttons") == 0) {
					type = SWAY_NOTIFICATION_CENTER_WIDGETS_MENU_TYPE_BUTTONS;
				} else {
					const gchar* _tmp18_;
					_tmp18_ = t;
					if (g_strcmp0 (_tmp18_, "menu") == 0) {
						type = SWAY_NOTIFICATION_CENTER_WIDGETS_MENU_TYPE_MENU;
					} else {
						g_info ("menubar.vala:198: %s", "Invalid type for menu-object - valid options: " "'menu' || 'buttons' using default");
					}
				}
				_tmp19_ = key;
				_tmp19__length1 = key_length1;
				_tmp20_ = _tmp19_[1];
				_tmp21_ = g_strdup (_tmp20_);
				name = _tmp21_;
				_tmp22_ = obj;
				_tmp23_ = sway_notification_center_widgets_base_widget_get_prop (G_TYPE_CHECK_INSTANCE_CAST (self, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET, SwayNotificationCenterWidgetsBaseWidget), G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp22_, "position", NULL);
				p = (gchar*) _tmp23_;
				_tmp25_ = p;
				if (g_strcmp0 (_tmp25_, "left") != 0) {
					const gchar* _tmp26_;
					_tmp26_ = p;
					_tmp24_ = g_strcmp0 (_tmp26_, "right") != 0;
				} else {
					_tmp24_ = FALSE;
				}
				if (_tmp24_) {
					pos = SWAY_NOTIFICATION_CENTER_WIDGETS_POSITION_RIGHT;
					g_info ("menubar.vala:208: No position for menu-object given using default");
				} else {
					const gchar* _tmp27_;
					_tmp27_ = p;
					if (g_strcmp0 (_tmp27_, "right") == 0) {
						pos = SWAY_NOTIFICATION_CENTER_WIDGETS_POSITION_RIGHT;
					} else {
						pos = SWAY_NOTIFICATION_CENTER_WIDGETS_POSITION_LEFT;
					}
				}
				_tmp28_ = obj;
				_tmp29_ = sway_notification_center_widgets_base_widget_get_prop_array (G_TYPE_CHECK_INSTANCE_CAST (self, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET, SwayNotificationCenterWidgetsBaseWidget), _tmp28_, "actions");
				actions = _tmp29_;
				_tmp30_ = actions;
				if (_tmp30_ == NULL) {
					g_info ("menubar.vala:217: Error parsing actions for menu-object");
				}
				_tmp31_ = obj;
				_tmp32_ = sway_notification_center_widgets_base_widget_get_prop (G_TYPE_CHECK_INSTANCE_CAST (self, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET, SwayNotificationCenterWidgetsBaseWidget), G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp31_, "label", NULL);
				label = (gchar*) _tmp32_;
				_tmp33_ = label;
				if (_tmp33_ == NULL) {
					gchar* _tmp34_;
					_tmp34_ = g_strdup ("Menu");
					_g_free0 (label);
					label = _tmp34_;
					g_info ("menubar.vala:223: No label for menu-object given using default");
				}
				_tmp35_ = obj;
				_tmp36_ = 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, _tmp35_, "animation-duration", NULL);
				duration = MAX (0, (gint) ((gintptr) _tmp36_));
				if (duration == 0) {
					duration = 250;
				}
				_tmp37_ = obj;
				_tmp38_ = sway_notification_center_widgets_base_widget_get_prop (G_TYPE_CHECK_INSTANCE_CAST (self, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET, SwayNotificationCenterWidgetsBaseWidget), G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp37_, "animation-type", NULL);
				animation_type = (gchar*) _tmp38_;
				_tmp39_ = animation_type;
				if (_tmp39_ == NULL) {
					gchar* _tmp40_;
					_tmp40_ = g_strdup ("slide_down");
					_g_free0 (animation_type);
					animation_type = _tmp40_;
					g_info ("menubar.vala:234: No animation-type for menu-object given using defaul" \
"t");
				}
				_tmp41_ = animation_type;
				_tmp42_ = _tmp41_;
				_tmp44_ = (NULL == _tmp42_) ? 0 : g_quark_from_string (_tmp42_);
				if (_tmp44_ == ((0 != _tmp43_label0) ? _tmp43_label0 : (_tmp43_label0 = g_quark_from_static_string ("slide_up")))) {
					switch (0) {
						default:
						{
							revealer_type = GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP;
							break;
						}
					}
				} else if (_tmp44_ == ((0 != _tmp43_label1) ? _tmp43_label1 : (_tmp43_label1 = g_quark_from_static_string ("slide_down")))) {
					switch (0) {
						default:
						{
							revealer_type = GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN;
							break;
						}
					}
				} else {
					switch (0) {
						default:
						{
							revealer_type = GTK_REVEALER_TRANSITION_TYPE_NONE;
							break;
						}
					}
				}
				_tmp45_ = actions;
				_tmp47_ = sway_notification_center_widgets_base_widget_parse_actions (G_TYPE_CHECK_INSTANCE_CAST (self, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET, SwayNotificationCenterWidgetsBaseWidget), _tmp45_, &_tmp46_);
				actions_list = _tmp47_;
				actions_list_length1 = _tmp46_;
				_actions_list_size_ = actions_list_length1;
				_tmp48_ = name;
				_tmp49_ = g_strdup (_tmp48_);
				_tmp50_ = __sway_notification_center_widgets_menu_type_dup0 (&type);
				_tmp51_ = label;
				_tmp52_ = g_strdup (_tmp51_);
				_tmp53_ = __sway_notification_center_widgets_position_dup0 (&pos);
				_tmp54_ = actions_list;
				_tmp54__length1 = actions_list_length1;
				_tmp55_ = (_tmp54_ != NULL) ? _vala_array_dup5 (_tmp54_, _tmp54__length1) : _tmp54_;
				_tmp55__length1 = _tmp54__length1;
				memset (&_tmp56_, 0, sizeof (SwayNotificationCenterWidgetsConfigObject));
				_g_free0 (_tmp56_.name);
				_tmp56_.name = _tmp49_;
				_g_free0 (_tmp56_.type);
				_tmp56_.type = _tmp50_;
				_g_free0 (_tmp56_.label);
				_tmp56_.label = _tmp52_;
				_g_free0 (_tmp56_.position);
				_tmp56_.position = _tmp53_;
				_tmp56_.actions = (_vala_SwayNotificationCenterWidgetsAction_array_free (_tmp56_.actions, _tmp56_.actions_length1), NULL);
				_tmp56_.actions = _tmp55_;
				_tmp56_.actions_length1 = _tmp55__length1;
				_g_object_unref0 (_tmp56_.revealer);
				_tmp56_.revealer = NULL;
				_tmp56_.animation_duration = duration;
				_tmp56_.animation_type = revealer_type;
				_tmp57_ = _tmp56_;
				_tmp58_ = _sway_notification_center_widgets_config_object_dup0 (&_tmp57_);
				self->priv->menu_objects = g_list_append (self->priv->menu_objects, _tmp58_);
				sway_notification_center_widgets_config_object_destroy (&_tmp57_);
				actions_list = (_vala_SwayNotificationCenterWidgetsAction_array_free (actions_list, actions_list_length1), NULL);
				_g_free0 (animation_type);
				_g_free0 (label);
				_json_array_unref0 (actions);
				_g_free0 (p);
				_g_free0 (name);
				_g_free0 (t);
				key = (_vala_array_free (key, key_length1, (GDestroyNotify) g_free), NULL);
				_json_object_unref0 (obj);
				_g_free0 (e);
			}
		}
	}
	(elements == NULL) ? NULL : (elements = (g_list_free (elements), NULL));
}

static void
sway_notification_center_widgets_menubar_real_on_cc_visibility_change (SwayNotificationCenterWidgetsBaseWidget* base,
                                                                       gboolean val)
{
	SwayNotificationCenterWidgetsMenubar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_MENUBAR, SwayNotificationCenterWidgetsMenubar);
	if (!val) {
		GList* _tmp0_;
		_tmp0_ = self->priv->menu_objects;
		{
			GList* obj_collection = NULL;
			GList* obj_it = NULL;
			obj_collection = _tmp0_;
			for (obj_it = obj_collection; obj_it != NULL; obj_it = obj_it->next) {
				SwayNotificationCenterWidgetsConfigObject* _tmp1_;
				SwayNotificationCenterWidgetsConfigObject* obj = NULL;
				_tmp1_ = _sway_notification_center_widgets_config_object_dup0 ((SwayNotificationCenterWidgetsConfigObject*) obj_it->data);
				obj = _tmp1_;
				{
					GtkRevealer* _tmp2_ = NULL;
					SwayNotificationCenterWidgetsConfigObject* _tmp3_;
					GtkRevealer* _tmp4_;
					_tmp3_ = obj;
					_tmp4_ = (*_tmp3_).revealer;
					_tmp2_ = _tmp4_;
					if (_tmp2_ != NULL) {
						gtk_revealer_set_reveal_child (_tmp2_, FALSE);
					}
					_sway_notification_center_widgets_config_object_free0 (obj);
				}
			}
		}
	} else {
		GList* _tmp5_;
		_tmp5_ = self->priv->toggle_buttons;
		{
			GList* tb_collection = NULL;
			GList* tb_it = NULL;
			tb_collection = _tmp5_;
			for (tb_it = tb_collection; tb_it != NULL; tb_it = tb_it->next) {
				SwayNotificationCenterWidgetsToggleButton* _tmp6_;
				SwayNotificationCenterWidgetsToggleButton* tb = NULL;
				_tmp6_ = _g_object_ref0 ((SwayNotificationCenterWidgetsToggleButton*) tb_it->data);
				tb = _tmp6_;
				{
					SwayNotificationCenterWidgetsToggleButton* _tmp7_;
					_tmp7_ = tb;
					sway_notification_center_widgets_toggle_button_on_update (_tmp7_, NULL, NULL);
					_g_object_unref0 (tb);
				}
			}
		}
	}
}

static const gchar*
sway_notification_center_widgets_menubar_real_get_widget_name (SwayNotificationCenterWidgetsBaseWidget* base)
{
	const gchar* result;
	SwayNotificationCenterWidgetsMenubar* self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_MENUBAR, SwayNotificationCenterWidgetsMenubar);
	result = "menubar";
	return result;
}

static void
sway_notification_center_widgets_menubar_class_init (SwayNotificationCenterWidgetsMenubarClass * klass,
                                                     gpointer klass_data)
{
	sway_notification_center_widgets_menubar_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SwayNotificationCenterWidgetsMenubar_private_offset);
	((SwayNotificationCenterWidgetsBaseWidgetClass *) klass)->on_cc_visibility_change = (void (*) (SwayNotificationCenterWidgetsBaseWidget*, gboolean)) sway_notification_center_widgets_menubar_real_on_cc_visibility_change;
	SWAY_NOTIFICATION_CENTER_WIDGETS_BASE_WIDGET_CLASS (klass)->get_widget_name = (const gchar* (*) (SwayNotificationCenterWidgetsBaseWidget*)) sway_notification_center_widgets_menubar_real_get_widget_name;
	G_OBJECT_CLASS (klass)->get_property = _vala_sway_notification_center_widgets_menubar_get_property;
	G_OBJECT_CLASS (klass)->finalize = sway_notification_center_widgets_menubar_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SWAY_NOTIFICATION_CENTER_WIDGETS_MENUBAR_WIDGET_NAME_PROPERTY, sway_notification_center_widgets_menubar_properties[SWAY_NOTIFICATION_CENTER_WIDGETS_MENUBAR_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_menubar_instance_init (SwayNotificationCenterWidgetsMenubar * self,
                                                        gpointer klass)
{
	self->priv = sway_notification_center_widgets_menubar_get_instance_private (self);
}

static void
sway_notification_center_widgets_menubar_finalize (GObject * obj)
{
	SwayNotificationCenterWidgetsMenubar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_MENUBAR, SwayNotificationCenterWidgetsMenubar);
	_g_object_unref0 (self->priv->left_container);
	_g_object_unref0 (self->priv->right_container);
	(self->priv->menu_objects == NULL) ? NULL : (self->priv->menu_objects = (_g_list_free__sway_notification_center_widgets_config_object_free0_ (self->priv->menu_objects), 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_menubar_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
sway_notification_center_widgets_menubar_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SwayNotificationCenterWidgetsMenubarClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sway_notification_center_widgets_menubar_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SwayNotificationCenterWidgetsMenubar), 0, (GInstanceInitFunc) sway_notification_center_widgets_menubar_instance_init, NULL };
	GType sway_notification_center_widgets_menubar_type_id;
	sway_notification_center_widgets_menubar_type_id = g_type_register_static (SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET, "SwayNotificationCenterWidgetsMenubar", &g_define_type_info, 0);
	SwayNotificationCenterWidgetsMenubar_private_offset = g_type_add_instance_private (sway_notification_center_widgets_menubar_type_id, sizeof (SwayNotificationCenterWidgetsMenubarPrivate));
	return sway_notification_center_widgets_menubar_type_id;
}

GType
sway_notification_center_widgets_menubar_get_type (void)
{
	static gsize sway_notification_center_widgets_menubar_type_id__once = 0;
	if (g_once_init_enter (&sway_notification_center_widgets_menubar_type_id__once)) {
		GType sway_notification_center_widgets_menubar_type_id;
		sway_notification_center_widgets_menubar_type_id = sway_notification_center_widgets_menubar_get_type_once ();
		g_once_init_leave (&sway_notification_center_widgets_menubar_type_id__once, sway_notification_center_widgets_menubar_type_id);
	}
	return sway_notification_center_widgets_menubar_type_id__once;
}

static void
_vala_sway_notification_center_widgets_menubar_get_property (GObject * object,
                                                             guint property_id,
                                                             GValue * value,
                                                             GParamSpec * pspec)
{
	SwayNotificationCenterWidgetsMenubar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_MENUBAR, SwayNotificationCenterWidgetsMenubar);
	switch (property_id) {
		case SWAY_NOTIFICATION_CENTER_WIDGETS_MENUBAR_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);
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

