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

/*
 * Copyright 2024 elementary, Inc. (https://elementary.io)
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

#include <gtk/gtk.h>
#include <glib-object.h>
#include <granite.h>
#include <glib.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define GALA_DAEMON_TYPE_WINDOW_MENU (gala_daemon_window_menu_get_type ())
#define GALA_DAEMON_WINDOW_MENU(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_DAEMON_TYPE_WINDOW_MENU, GalaDaemonWindowMenu))
#define GALA_DAEMON_WINDOW_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GALA_DAEMON_TYPE_WINDOW_MENU, GalaDaemonWindowMenuClass))
#define GALA_DAEMON_IS_WINDOW_MENU(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_DAEMON_TYPE_WINDOW_MENU))
#define GALA_DAEMON_IS_WINDOW_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GALA_DAEMON_TYPE_WINDOW_MENU))
#define GALA_DAEMON_WINDOW_MENU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GALA_DAEMON_TYPE_WINDOW_MENU, GalaDaemonWindowMenuClass))

typedef struct _GalaDaemonWindowMenu GalaDaemonWindowMenu;
typedef struct _GalaDaemonWindowMenuClass GalaDaemonWindowMenuClass;
typedef struct _GalaDaemonWindowMenuPrivate GalaDaemonWindowMenuPrivate;
enum  {
	GALA_DAEMON_WINDOW_MENU_0_PROPERTY,
	GALA_DAEMON_WINDOW_MENU_NUM_PROPERTIES
};
static GParamSpec* gala_daemon_window_menu_properties[GALA_DAEMON_WINDOW_MENU_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef enum  {
	GALA_WINDOW_FLAGS_NONE = 0,
	GALA_WINDOW_FLAGS_CAN_HIDE = 1 << 0,
	GALA_WINDOW_FLAGS_CAN_MAXIMIZE = 1 << 1,
	GALA_WINDOW_FLAGS_IS_MAXIMIZED = 1 << 2,
	GALA_WINDOW_FLAGS_ALLOWS_MOVE = 1 << 3,
	GALA_WINDOW_FLAGS_ALLOWS_RESIZE = 1 << 4,
	GALA_WINDOW_FLAGS_ALWAYS_ON_TOP = 1 << 5,
	GALA_WINDOW_FLAGS_ON_ALL_WORKSPACES = 1 << 6,
	GALA_WINDOW_FLAGS_CAN_CLOSE = 1 << 7,
	GALA_WINDOW_FLAGS_IS_TILED = 1 << 8,
	GALA_WINDOW_FLAGS_ALLOWS_MOVE_LEFT = 1 << 9,
	GALA_WINDOW_FLAGS_ALLOWS_MOVE_RIGHT = 1 << 10
} GalaWindowFlags;

#define GALA_TYPE_WINDOW_FLAGS (gala_window_flags_get_type ())
typedef enum  {
	GALA_ACTION_TYPE_NONE = 0,
	GALA_ACTION_TYPE_SHOW_MULTITASKING_VIEW,
	GALA_ACTION_TYPE_MAXIMIZE_CURRENT,
	GALA_ACTION_TYPE_HIDE_CURRENT,
	GALA_ACTION_TYPE_OPEN_LAUNCHER,
	GALA_ACTION_TYPE_CUSTOM_COMMAND,
	GALA_ACTION_TYPE_WINDOW_OVERVIEW,
	GALA_ACTION_TYPE_WINDOW_OVERVIEW_ALL,
	GALA_ACTION_TYPE_SWITCH_TO_WORKSPACE_PREVIOUS,
	GALA_ACTION_TYPE_SWITCH_TO_WORKSPACE_NEXT,
	GALA_ACTION_TYPE_SWITCH_TO_WORKSPACE_LAST,
	GALA_ACTION_TYPE_START_MOVE_CURRENT,
	GALA_ACTION_TYPE_START_RESIZE_CURRENT,
	GALA_ACTION_TYPE_TOGGLE_ALWAYS_ON_TOP_CURRENT,
	GALA_ACTION_TYPE_TOGGLE_ALWAYS_ON_VISIBLE_WORKSPACE_CURRENT,
	GALA_ACTION_TYPE_MOVE_CURRENT_WORKSPACE_LEFT,
	GALA_ACTION_TYPE_MOVE_CURRENT_WORKSPACE_RIGHT,
	GALA_ACTION_TYPE_CLOSE_CURRENT,
	GALA_ACTION_TYPE_SCREENSHOT_CURRENT
} GalaActionType;

#define GALA_TYPE_ACTION_TYPE (gala_action_type_get_type ())
enum  {
	GALA_DAEMON_WINDOW_MENU_PERFORM_ACTION_SIGNAL,
	GALA_DAEMON_WINDOW_MENU_NUM_SIGNALS
};
static guint gala_daemon_window_menu_signals[GALA_DAEMON_WINDOW_MENU_NUM_SIGNALS] = {0};

struct _GalaDaemonWindowMenu {
	GtkMenu parent_instance;
	GalaDaemonWindowMenuPrivate * priv;
};

struct _GalaDaemonWindowMenuClass {
	GtkMenuClass parent_class;
};

struct _GalaDaemonWindowMenuPrivate {
	GraniteAccelLabel* always_on_top_accellabel;
	GraniteAccelLabel* close_accellabel;
	GraniteAccelLabel* minimize_accellabel;
	GraniteAccelLabel* move_accellabel;
	GraniteAccelLabel* move_left_accellabel;
	GraniteAccelLabel* move_right_accellabel;
	GraniteAccelLabel* on_visible_workspace_accellabel;
	GraniteAccelLabel* resize_accellabel;
	GraniteAccelLabel* screenshot_accellabel;
	GtkMenuItem* minimize;
	GtkMenuItem* maximize;
	GtkMenuItem* move;
	GtkMenuItem* resize;
	GtkCheckMenuItem* always_on_top;
	GtkCheckMenuItem* on_visible_workspace;
	GtkMenuItem* move_left;
	GtkMenuItem* move_right;
	GtkMenuItem* close;
	GtkMenuItem* screenshot;
	gulong always_on_top_sid;
	gulong on_visible_workspace_sid;
};

static gint GalaDaemonWindowMenu_private_offset;
static gpointer gala_daemon_window_menu_parent_class = NULL;
static GSettings* gala_daemon_window_menu_gala_keybind_settings;
static GSettings* gala_daemon_window_menu_gala_keybind_settings = NULL;
static GSettings* gala_daemon_window_menu_keybind_settings;
static GSettings* gala_daemon_window_menu_keybind_settings = NULL;

VALA_EXTERN GType gala_daemon_window_menu_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GalaDaemonWindowMenu, g_object_unref)
VALA_EXTERN GType gala_window_flags_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void gala_daemon_window_menu_update (GalaDaemonWindowMenu* self,
                                     GalaWindowFlags flags);
VALA_EXTERN GalaDaemonWindowMenu* gala_daemon_window_menu_new (void);
VALA_EXTERN GalaDaemonWindowMenu* gala_daemon_window_menu_construct (GType object_type);
VALA_EXTERN GType gala_action_type_get_type (void) G_GNUC_CONST ;
static GObject * gala_daemon_window_menu_constructor (GType type,
                                               guint n_construct_properties,
                                               GObjectConstructParam * construct_properties);
static void _gala_daemon_window_menu___lambda5_ (GalaDaemonWindowMenu* self);
static void __gala_daemon_window_menu___lambda5__gtk_menu_item_activate (GtkMenuItem* _sender,
                                                                  gpointer self);
static void _gala_daemon_window_menu___lambda6_ (GalaDaemonWindowMenu* self);
static void __gala_daemon_window_menu___lambda6__gtk_menu_item_activate (GtkMenuItem* _sender,
                                                                  gpointer self);
static void _gala_daemon_window_menu___lambda7_ (GalaDaemonWindowMenu* self);
static void __gala_daemon_window_menu___lambda7__gtk_menu_item_activate (GtkMenuItem* _sender,
                                                                  gpointer self);
static void _gala_daemon_window_menu___lambda8_ (GalaDaemonWindowMenu* self);
static void __gala_daemon_window_menu___lambda8__gtk_menu_item_activate (GtkMenuItem* _sender,
                                                                  gpointer self);
static void _gala_daemon_window_menu___lambda9_ (GalaDaemonWindowMenu* self);
static void __gala_daemon_window_menu___lambda9__gtk_menu_item_activate (GtkMenuItem* _sender,
                                                                  gpointer self);
static void _gala_daemon_window_menu___lambda10_ (GalaDaemonWindowMenu* self);
static void __gala_daemon_window_menu___lambda10__gtk_menu_item_activate (GtkMenuItem* _sender,
                                                                   gpointer self);
static void _gala_daemon_window_menu___lambda11_ (GalaDaemonWindowMenu* self);
static void __gala_daemon_window_menu___lambda11__gtk_menu_item_activate (GtkMenuItem* _sender,
                                                                   gpointer self);
static void _gala_daemon_window_menu___lambda12_ (GalaDaemonWindowMenu* self);
static void __gala_daemon_window_menu___lambda12__gtk_menu_item_activate (GtkMenuItem* _sender,
                                                                   gpointer self);
static void _gala_daemon_window_menu___lambda13_ (GalaDaemonWindowMenu* self);
static void __gala_daemon_window_menu___lambda13__gtk_menu_item_activate (GtkMenuItem* _sender,
                                                                   gpointer self);
static void _gala_daemon_window_menu___lambda14_ (GalaDaemonWindowMenu* self);
static void __gala_daemon_window_menu___lambda14__gtk_menu_item_activate (GtkMenuItem* _sender,
                                                                   gpointer self);
static void gala_daemon_window_menu_finalize (GObject * obj);
static GType gala_daemon_window_menu_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);

static inline gpointer
gala_daemon_window_menu_get_instance_private (GalaDaemonWindowMenu* self)
{
	return G_STRUCT_MEMBER_P (self, GalaDaemonWindowMenu_private_offset);
}

void
gala_daemon_window_menu_update (GalaDaemonWindowMenu* self,
                                GalaWindowFlags flags)
{
	GtkMenuItem* _tmp0_;
	GtkMenuItem* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	GtkMenuItem* _tmp10_;
	GtkMenuItem* _tmp11_;
	gboolean _tmp12_;
	gboolean _tmp13_;
	GtkMenuItem* _tmp26_;
	GtkMenuItem* _tmp27_;
	gboolean _tmp28_;
	gboolean _tmp29_;
	GtkMenuItem* _tmp36_;
	GtkMenuItem* _tmp37_;
	gboolean _tmp38_;
	gboolean _tmp39_;
	GtkCheckMenuItem* _tmp46_;
	GtkCheckMenuItem* _tmp47_;
	GtkCheckMenuItem* _tmp48_;
	GraniteAccelLabel* _tmp49_;
	GSettings* _tmp50_;
	gchar** _tmp51_;
	gchar** _tmp52_;
	gchar** _tmp53_;
	gint _tmp53__length1;
	const gchar* _tmp54_;
	GtkCheckMenuItem* _tmp55_;
	GraniteAccelLabel* _tmp56_;
	GSettings* _tmp57_;
	gchar** _tmp58_;
	gchar** _tmp59_;
	gchar** _tmp60_;
	gint _tmp60__length1;
	const gchar* _tmp61_;
	GtkCheckMenuItem* _tmp62_;
	GtkCheckMenuItem* _tmp63_;
	gboolean _tmp64_ = FALSE;
	GtkCheckMenuItem* _tmp65_;
	gboolean _tmp66_;
	gboolean _tmp67_;
	GtkMenuItem* _tmp68_;
	GtkMenuItem* _tmp69_;
	gboolean _tmp70_;
	gboolean _tmp71_;
	gboolean _tmp78_ = FALSE;
	GtkCheckMenuItem* _tmp79_;
	gboolean _tmp80_;
	gboolean _tmp81_;
	GtkMenuItem* _tmp82_;
	GtkMenuItem* _tmp83_;
	gboolean _tmp84_;
	gboolean _tmp85_;
	GraniteAccelLabel* _tmp92_;
	GSettings* _tmp93_;
	gchar** _tmp94_;
	gchar** _tmp95_;
	gchar** _tmp96_;
	gint _tmp96__length1;
	const gchar* _tmp97_;
	GtkMenuItem* _tmp98_;
	GtkMenuItem* _tmp99_;
	gboolean _tmp100_;
	gboolean _tmp101_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->minimize;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, (flags & GALA_WINDOW_FLAGS_CAN_HIDE) == GALA_WINDOW_FLAGS_CAN_HIDE);
	_tmp1_ = self->priv->minimize;
	_tmp2_ = gtk_widget_get_visible ((GtkWidget*) _tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_) {
		GraniteAccelLabel* _tmp4_;
		GSettings* _tmp5_;
		gchar** _tmp6_;
		gchar** _tmp7_;
		gchar** _tmp8_;
		gint _tmp8__length1;
		const gchar* _tmp9_;
		_tmp4_ = self->priv->minimize_accellabel;
		_tmp5_ = gala_daemon_window_menu_keybind_settings;
		_tmp7_ = _tmp6_ = g_settings_get_strv (_tmp5_, "minimize");
		_tmp8_ = _tmp7_;
		_tmp8__length1 = _vala_array_length (_tmp6_);
		_tmp9_ = _tmp8_[0];
		granite_accel_label_set_accel_string (_tmp4_, _tmp9_);
		_tmp8_ = (_vala_array_free (_tmp8_, _tmp8__length1, (GDestroyNotify) g_free), NULL);
	}
	_tmp10_ = self->priv->maximize;
	gtk_widget_set_visible ((GtkWidget*) _tmp10_, (flags & GALA_WINDOW_FLAGS_CAN_MAXIMIZE) == GALA_WINDOW_FLAGS_CAN_MAXIMIZE);
	_tmp11_ = self->priv->maximize;
	_tmp12_ = gtk_widget_get_visible ((GtkWidget*) _tmp11_);
	_tmp13_ = _tmp12_;
	if (_tmp13_) {
		const gchar* maximize_label = NULL;
		GtkMenuItem* _tmp15_;
		GtkWidget* _tmp16_;
		GtkMenuItem* _tmp17_;
		const gchar* _tmp18_;
		GSettings* _tmp19_;
		gchar** _tmp20_;
		gchar** _tmp21_;
		gchar** _tmp22_;
		gint _tmp22__length1;
		const gchar* _tmp23_;
		GraniteAccelLabel* _tmp24_;
		GraniteAccelLabel* _tmp25_;
		if ((flags & GALA_WINDOW_FLAGS_IS_MAXIMIZED) == GALA_WINDOW_FLAGS_IS_MAXIMIZED) {
			const gchar* _tmp14_ = NULL;
			if ((flags & GALA_WINDOW_FLAGS_IS_TILED) == GALA_WINDOW_FLAGS_IS_TILED) {
				_tmp14_ = _ ("Untile");
			} else {
				_tmp14_ = _ ("Unmaximize");
			}
			maximize_label = _tmp14_;
		} else {
			maximize_label = _ ("Maximize");
		}
		_tmp15_ = self->priv->maximize;
		_tmp16_ = gtk_bin_get_child ((GtkBin*) _tmp15_);
		gtk_widget_destroy (_tmp16_);
		_tmp17_ = self->priv->maximize;
		_tmp18_ = maximize_label;
		_tmp19_ = gala_daemon_window_menu_keybind_settings;
		_tmp21_ = _tmp20_ = g_settings_get_strv (_tmp19_, "toggle-maximized");
		_tmp22_ = _tmp21_;
		_tmp22__length1 = _vala_array_length (_tmp20_);
		_tmp23_ = _tmp22_[0];
		_tmp24_ = granite_accel_label_new (_tmp18_, _tmp23_);
		g_object_ref_sink (_tmp24_);
		_tmp25_ = _tmp24_;
		gtk_container_add ((GtkContainer*) _tmp17_, (GtkWidget*) _tmp25_);
		_g_object_unref0 (_tmp25_);
		_tmp22_ = (_vala_array_free (_tmp22_, _tmp22__length1, (GDestroyNotify) g_free), NULL);
	}
	_tmp26_ = self->priv->move;
	gtk_widget_set_visible ((GtkWidget*) _tmp26_, (flags & GALA_WINDOW_FLAGS_ALLOWS_MOVE) == GALA_WINDOW_FLAGS_ALLOWS_MOVE);
	_tmp27_ = self->priv->move;
	_tmp28_ = gtk_widget_get_visible ((GtkWidget*) _tmp27_);
	_tmp29_ = _tmp28_;
	if (_tmp29_) {
		GraniteAccelLabel* _tmp30_;
		GSettings* _tmp31_;
		gchar** _tmp32_;
		gchar** _tmp33_;
		gchar** _tmp34_;
		gint _tmp34__length1;
		const gchar* _tmp35_;
		_tmp30_ = self->priv->move_accellabel;
		_tmp31_ = gala_daemon_window_menu_keybind_settings;
		_tmp33_ = _tmp32_ = g_settings_get_strv (_tmp31_, "begin-move");
		_tmp34_ = _tmp33_;
		_tmp34__length1 = _vala_array_length (_tmp32_);
		_tmp35_ = _tmp34_[0];
		granite_accel_label_set_accel_string (_tmp30_, _tmp35_);
		_tmp34_ = (_vala_array_free (_tmp34_, _tmp34__length1, (GDestroyNotify) g_free), NULL);
	}
	_tmp36_ = self->priv->resize;
	gtk_widget_set_visible ((GtkWidget*) _tmp36_, (flags & GALA_WINDOW_FLAGS_ALLOWS_RESIZE) == GALA_WINDOW_FLAGS_ALLOWS_RESIZE);
	_tmp37_ = self->priv->resize;
	_tmp38_ = gtk_widget_get_visible ((GtkWidget*) _tmp37_);
	_tmp39_ = _tmp38_;
	if (_tmp39_) {
		GraniteAccelLabel* _tmp40_;
		GSettings* _tmp41_;
		gchar** _tmp42_;
		gchar** _tmp43_;
		gchar** _tmp44_;
		gint _tmp44__length1;
		const gchar* _tmp45_;
		_tmp40_ = self->priv->resize_accellabel;
		_tmp41_ = gala_daemon_window_menu_keybind_settings;
		_tmp43_ = _tmp42_ = g_settings_get_strv (_tmp41_, "begin-resize");
		_tmp44_ = _tmp43_;
		_tmp44__length1 = _vala_array_length (_tmp42_);
		_tmp45_ = _tmp44_[0];
		granite_accel_label_set_accel_string (_tmp40_, _tmp45_);
		_tmp44_ = (_vala_array_free (_tmp44_, _tmp44__length1, (GDestroyNotify) g_free), NULL);
	}
	_tmp46_ = self->priv->always_on_top;
	g_signal_handler_block (_tmp46_, self->priv->always_on_top_sid);
	_tmp47_ = self->priv->on_visible_workspace;
	g_signal_handler_block (_tmp47_, self->priv->on_visible_workspace_sid);
	_tmp48_ = self->priv->always_on_top;
	gtk_check_menu_item_set_active (_tmp48_, (flags & GALA_WINDOW_FLAGS_ALWAYS_ON_TOP) == GALA_WINDOW_FLAGS_ALWAYS_ON_TOP);
	_tmp49_ = self->priv->always_on_top_accellabel;
	_tmp50_ = gala_daemon_window_menu_keybind_settings;
	_tmp52_ = _tmp51_ = g_settings_get_strv (_tmp50_, "always-on-top");
	_tmp53_ = _tmp52_;
	_tmp53__length1 = _vala_array_length (_tmp51_);
	_tmp54_ = _tmp53_[0];
	granite_accel_label_set_accel_string (_tmp49_, _tmp54_);
	_tmp53_ = (_vala_array_free (_tmp53_, _tmp53__length1, (GDestroyNotify) g_free), NULL);
	_tmp55_ = self->priv->on_visible_workspace;
	gtk_check_menu_item_set_active (_tmp55_, (flags & GALA_WINDOW_FLAGS_ON_ALL_WORKSPACES) == GALA_WINDOW_FLAGS_ON_ALL_WORKSPACES);
	_tmp56_ = self->priv->on_visible_workspace_accellabel;
	_tmp57_ = gala_daemon_window_menu_keybind_settings;
	_tmp59_ = _tmp58_ = g_settings_get_strv (_tmp57_, "toggle-on-all-workspaces");
	_tmp60_ = _tmp59_;
	_tmp60__length1 = _vala_array_length (_tmp58_);
	_tmp61_ = _tmp60_[0];
	granite_accel_label_set_accel_string (_tmp56_, _tmp61_);
	_tmp60_ = (_vala_array_free (_tmp60_, _tmp60__length1, (GDestroyNotify) g_free), NULL);
	_tmp62_ = self->priv->always_on_top;
	g_signal_handler_unblock (_tmp62_, self->priv->always_on_top_sid);
	_tmp63_ = self->priv->on_visible_workspace;
	g_signal_handler_unblock (_tmp63_, self->priv->on_visible_workspace_sid);
	_tmp65_ = self->priv->on_visible_workspace;
	_tmp66_ = gtk_check_menu_item_get_active (_tmp65_);
	_tmp67_ = _tmp66_;
	if (!_tmp67_) {
		_tmp64_ = (flags & GALA_WINDOW_FLAGS_ALLOWS_MOVE_RIGHT) == GALA_WINDOW_FLAGS_ALLOWS_MOVE_RIGHT;
	} else {
		_tmp64_ = FALSE;
	}
	_tmp68_ = self->priv->move_right;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp68_, _tmp64_);
	_tmp69_ = self->priv->move_right;
	_tmp70_ = gtk_widget_get_sensitive ((GtkWidget*) _tmp69_);
	_tmp71_ = _tmp70_;
	if (_tmp71_) {
		GraniteAccelLabel* _tmp72_;
		GSettings* _tmp73_;
		gchar** _tmp74_;
		gchar** _tmp75_;
		gchar** _tmp76_;
		gint _tmp76__length1;
		const gchar* _tmp77_;
		_tmp72_ = self->priv->move_right_accellabel;
		_tmp73_ = gala_daemon_window_menu_keybind_settings;
		_tmp75_ = _tmp74_ = g_settings_get_strv (_tmp73_, "move-to-workspace-right");
		_tmp76_ = _tmp75_;
		_tmp76__length1 = _vala_array_length (_tmp74_);
		_tmp77_ = _tmp76_[0];
		granite_accel_label_set_accel_string (_tmp72_, _tmp77_);
		_tmp76_ = (_vala_array_free (_tmp76_, _tmp76__length1, (GDestroyNotify) g_free), NULL);
	}
	_tmp79_ = self->priv->on_visible_workspace;
	_tmp80_ = gtk_check_menu_item_get_active (_tmp79_);
	_tmp81_ = _tmp80_;
	if (!_tmp81_) {
		_tmp78_ = (flags & GALA_WINDOW_FLAGS_ALLOWS_MOVE_LEFT) == GALA_WINDOW_FLAGS_ALLOWS_MOVE_LEFT;
	} else {
		_tmp78_ = FALSE;
	}
	_tmp82_ = self->priv->move_left;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp82_, _tmp78_);
	_tmp83_ = self->priv->move_left;
	_tmp84_ = gtk_widget_get_sensitive ((GtkWidget*) _tmp83_);
	_tmp85_ = _tmp84_;
	if (_tmp85_) {
		GraniteAccelLabel* _tmp86_;
		GSettings* _tmp87_;
		gchar** _tmp88_;
		gchar** _tmp89_;
		gchar** _tmp90_;
		gint _tmp90__length1;
		const gchar* _tmp91_;
		_tmp86_ = self->priv->move_left_accellabel;
		_tmp87_ = gala_daemon_window_menu_keybind_settings;
		_tmp89_ = _tmp88_ = g_settings_get_strv (_tmp87_, "move-to-workspace-left");
		_tmp90_ = _tmp89_;
		_tmp90__length1 = _vala_array_length (_tmp88_);
		_tmp91_ = _tmp90_[0];
		granite_accel_label_set_accel_string (_tmp86_, _tmp91_);
		_tmp90_ = (_vala_array_free (_tmp90_, _tmp90__length1, (GDestroyNotify) g_free), NULL);
	}
	_tmp92_ = self->priv->screenshot_accellabel;
	_tmp93_ = gala_daemon_window_menu_gala_keybind_settings;
	_tmp95_ = _tmp94_ = g_settings_get_strv (_tmp93_, "window-screenshot");
	_tmp96_ = _tmp95_;
	_tmp96__length1 = _vala_array_length (_tmp94_);
	_tmp97_ = _tmp96_[0];
	granite_accel_label_set_accel_string (_tmp92_, _tmp97_);
	_tmp96_ = (_vala_array_free (_tmp96_, _tmp96__length1, (GDestroyNotify) g_free), NULL);
	_tmp98_ = self->priv->close;
	gtk_widget_set_visible ((GtkWidget*) _tmp98_, (flags & GALA_WINDOW_FLAGS_CAN_CLOSE) == GALA_WINDOW_FLAGS_CAN_CLOSE);
	_tmp99_ = self->priv->close;
	_tmp100_ = gtk_widget_get_visible ((GtkWidget*) _tmp99_);
	_tmp101_ = _tmp100_;
	if (_tmp101_) {
		GraniteAccelLabel* _tmp102_;
		GSettings* _tmp103_;
		gchar** _tmp104_;
		gchar** _tmp105_;
		gchar** _tmp106_;
		gint _tmp106__length1;
		const gchar* _tmp107_;
		_tmp102_ = self->priv->close_accellabel;
		_tmp103_ = gala_daemon_window_menu_keybind_settings;
		_tmp105_ = _tmp104_ = g_settings_get_strv (_tmp103_, "close");
		_tmp106_ = _tmp105_;
		_tmp106__length1 = _vala_array_length (_tmp104_);
		_tmp107_ = _tmp106_[0];
		granite_accel_label_set_accel_string (_tmp102_, _tmp107_);
		_tmp106_ = (_vala_array_free (_tmp106_, _tmp106__length1, (GDestroyNotify) g_free), NULL);
	}
}

GalaDaemonWindowMenu*
gala_daemon_window_menu_construct (GType object_type)
{
	GalaDaemonWindowMenu * self = NULL;
	self = (GalaDaemonWindowMenu*) g_object_new (object_type, NULL);
	return self;
}

GalaDaemonWindowMenu*
gala_daemon_window_menu_new (void)
{
	return gala_daemon_window_menu_construct (GALA_DAEMON_TYPE_WINDOW_MENU);
}

static void
_gala_daemon_window_menu___lambda5_ (GalaDaemonWindowMenu* self)
{
	g_signal_emit (self, gala_daemon_window_menu_signals[GALA_DAEMON_WINDOW_MENU_PERFORM_ACTION_SIGNAL], 0, GALA_ACTION_TYPE_HIDE_CURRENT);
}

static void
__gala_daemon_window_menu___lambda5__gtk_menu_item_activate (GtkMenuItem* _sender,
                                                             gpointer self)
{
	_gala_daemon_window_menu___lambda5_ ((GalaDaemonWindowMenu*) self);
}

static void
_gala_daemon_window_menu___lambda6_ (GalaDaemonWindowMenu* self)
{
	g_signal_emit (self, gala_daemon_window_menu_signals[GALA_DAEMON_WINDOW_MENU_PERFORM_ACTION_SIGNAL], 0, GALA_ACTION_TYPE_MAXIMIZE_CURRENT);
}

static void
__gala_daemon_window_menu___lambda6__gtk_menu_item_activate (GtkMenuItem* _sender,
                                                             gpointer self)
{
	_gala_daemon_window_menu___lambda6_ ((GalaDaemonWindowMenu*) self);
}

static void
_gala_daemon_window_menu___lambda7_ (GalaDaemonWindowMenu* self)
{
	g_signal_emit (self, gala_daemon_window_menu_signals[GALA_DAEMON_WINDOW_MENU_PERFORM_ACTION_SIGNAL], 0, GALA_ACTION_TYPE_START_MOVE_CURRENT);
}

static void
__gala_daemon_window_menu___lambda7__gtk_menu_item_activate (GtkMenuItem* _sender,
                                                             gpointer self)
{
	_gala_daemon_window_menu___lambda7_ ((GalaDaemonWindowMenu*) self);
}

static void
_gala_daemon_window_menu___lambda8_ (GalaDaemonWindowMenu* self)
{
	g_signal_emit (self, gala_daemon_window_menu_signals[GALA_DAEMON_WINDOW_MENU_PERFORM_ACTION_SIGNAL], 0, GALA_ACTION_TYPE_START_RESIZE_CURRENT);
}

static void
__gala_daemon_window_menu___lambda8__gtk_menu_item_activate (GtkMenuItem* _sender,
                                                             gpointer self)
{
	_gala_daemon_window_menu___lambda8_ ((GalaDaemonWindowMenu*) self);
}

static void
_gala_daemon_window_menu___lambda9_ (GalaDaemonWindowMenu* self)
{
	g_signal_emit (self, gala_daemon_window_menu_signals[GALA_DAEMON_WINDOW_MENU_PERFORM_ACTION_SIGNAL], 0, GALA_ACTION_TYPE_TOGGLE_ALWAYS_ON_TOP_CURRENT);
}

static void
__gala_daemon_window_menu___lambda9__gtk_menu_item_activate (GtkMenuItem* _sender,
                                                             gpointer self)
{
	_gala_daemon_window_menu___lambda9_ ((GalaDaemonWindowMenu*) self);
}

static void
_gala_daemon_window_menu___lambda10_ (GalaDaemonWindowMenu* self)
{
	g_signal_emit (self, gala_daemon_window_menu_signals[GALA_DAEMON_WINDOW_MENU_PERFORM_ACTION_SIGNAL], 0, GALA_ACTION_TYPE_TOGGLE_ALWAYS_ON_VISIBLE_WORKSPACE_CURRENT);
}

static void
__gala_daemon_window_menu___lambda10__gtk_menu_item_activate (GtkMenuItem* _sender,
                                                              gpointer self)
{
	_gala_daemon_window_menu___lambda10_ ((GalaDaemonWindowMenu*) self);
}

static void
_gala_daemon_window_menu___lambda11_ (GalaDaemonWindowMenu* self)
{
	g_signal_emit (self, gala_daemon_window_menu_signals[GALA_DAEMON_WINDOW_MENU_PERFORM_ACTION_SIGNAL], 0, GALA_ACTION_TYPE_MOVE_CURRENT_WORKSPACE_LEFT);
}

static void
__gala_daemon_window_menu___lambda11__gtk_menu_item_activate (GtkMenuItem* _sender,
                                                              gpointer self)
{
	_gala_daemon_window_menu___lambda11_ ((GalaDaemonWindowMenu*) self);
}

static void
_gala_daemon_window_menu___lambda12_ (GalaDaemonWindowMenu* self)
{
	g_signal_emit (self, gala_daemon_window_menu_signals[GALA_DAEMON_WINDOW_MENU_PERFORM_ACTION_SIGNAL], 0, GALA_ACTION_TYPE_MOVE_CURRENT_WORKSPACE_RIGHT);
}

static void
__gala_daemon_window_menu___lambda12__gtk_menu_item_activate (GtkMenuItem* _sender,
                                                              gpointer self)
{
	_gala_daemon_window_menu___lambda12_ ((GalaDaemonWindowMenu*) self);
}

static void
_gala_daemon_window_menu___lambda13_ (GalaDaemonWindowMenu* self)
{
	g_signal_emit (self, gala_daemon_window_menu_signals[GALA_DAEMON_WINDOW_MENU_PERFORM_ACTION_SIGNAL], 0, GALA_ACTION_TYPE_SCREENSHOT_CURRENT);
}

static void
__gala_daemon_window_menu___lambda13__gtk_menu_item_activate (GtkMenuItem* _sender,
                                                              gpointer self)
{
	_gala_daemon_window_menu___lambda13_ ((GalaDaemonWindowMenu*) self);
}

static void
_gala_daemon_window_menu___lambda14_ (GalaDaemonWindowMenu* self)
{
	g_signal_emit (self, gala_daemon_window_menu_signals[GALA_DAEMON_WINDOW_MENU_PERFORM_ACTION_SIGNAL], 0, GALA_ACTION_TYPE_CLOSE_CURRENT);
}

static void
__gala_daemon_window_menu___lambda14__gtk_menu_item_activate (GtkMenuItem* _sender,
                                                              gpointer self)
{
	_gala_daemon_window_menu___lambda14_ ((GalaDaemonWindowMenu*) self);
}

static GObject *
gala_daemon_window_menu_constructor (GType type,
                                     guint n_construct_properties,
                                     GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GalaDaemonWindowMenu * self;
	GraniteAccelLabel* _tmp0_;
	GtkMenuItem* _tmp1_;
	GtkMenuItem* _tmp2_;
	GraniteAccelLabel* _tmp3_;
	GtkMenuItem* _tmp4_;
	GtkMenuItem* _tmp5_;
	GtkMenuItem* _tmp6_;
	GraniteAccelLabel* _tmp7_;
	GtkMenuItem* _tmp8_;
	GtkMenuItem* _tmp9_;
	GraniteAccelLabel* _tmp10_;
	GtkMenuItem* _tmp11_;
	GraniteAccelLabel* _tmp12_;
	GtkMenuItem* _tmp13_;
	GtkMenuItem* _tmp14_;
	GraniteAccelLabel* _tmp15_;
	GtkMenuItem* _tmp16_;
	GraniteAccelLabel* _tmp17_;
	GtkCheckMenuItem* _tmp18_;
	GtkCheckMenuItem* _tmp19_;
	GraniteAccelLabel* _tmp20_;
	GtkCheckMenuItem* _tmp21_;
	gulong _tmp22_;
	GraniteAccelLabel* _tmp23_;
	GtkCheckMenuItem* _tmp24_;
	GtkCheckMenuItem* _tmp25_;
	GraniteAccelLabel* _tmp26_;
	GtkCheckMenuItem* _tmp27_;
	gulong _tmp28_;
	GraniteAccelLabel* _tmp29_;
	GtkMenuItem* _tmp30_;
	GtkMenuItem* _tmp31_;
	GraniteAccelLabel* _tmp32_;
	GtkMenuItem* _tmp33_;
	GraniteAccelLabel* _tmp34_;
	GtkMenuItem* _tmp35_;
	GtkMenuItem* _tmp36_;
	GraniteAccelLabel* _tmp37_;
	GtkMenuItem* _tmp38_;
	GraniteAccelLabel* _tmp39_;
	GtkMenuItem* _tmp40_;
	GtkMenuItem* _tmp41_;
	GraniteAccelLabel* _tmp42_;
	GtkMenuItem* _tmp43_;
	GraniteAccelLabel* _tmp44_;
	GtkMenuItem* _tmp45_;
	GtkMenuItem* _tmp46_;
	GraniteAccelLabel* _tmp47_;
	GtkMenuItem* _tmp48_;
	GtkMenuItem* _tmp49_;
	GtkSeparatorMenuItem* _tmp50_;
	GtkSeparatorMenuItem* _tmp51_;
	GtkCheckMenuItem* _tmp52_;
	GtkCheckMenuItem* _tmp53_;
	GtkMenuItem* _tmp54_;
	GtkMenuItem* _tmp55_;
	GtkSeparatorMenuItem* _tmp56_;
	GtkSeparatorMenuItem* _tmp57_;
	GtkMenuItem* _tmp58_;
	GtkMenuItem* _tmp59_;
	GtkMenuItem* _tmp60_;
	GtkSeparatorMenuItem* _tmp61_;
	GtkSeparatorMenuItem* _tmp62_;
	GtkMenuItem* _tmp63_;
	GtkMenuItem* _tmp64_;
	parent_class = G_OBJECT_CLASS (gala_daemon_window_menu_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GALA_DAEMON_TYPE_WINDOW_MENU, GalaDaemonWindowMenu);
	_tmp0_ = granite_accel_label_new (_ ("Hide"), NULL);
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->minimize_accellabel);
	self->priv->minimize_accellabel = _tmp0_;
	_tmp1_ = (GtkMenuItem*) gtk_menu_item_new ();
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->minimize);
	self->priv->minimize = _tmp1_;
	_tmp2_ = self->priv->minimize;
	_tmp3_ = self->priv->minimize_accellabel;
	gtk_container_add ((GtkContainer*) _tmp2_, (GtkWidget*) _tmp3_);
	_tmp4_ = self->priv->minimize;
	g_signal_connect_object (_tmp4_, "activate", (GCallback) __gala_daemon_window_menu___lambda5__gtk_menu_item_activate, self, 0);
	_tmp5_ = (GtkMenuItem*) gtk_menu_item_new ();
	g_object_ref_sink (_tmp5_);
	_g_object_unref0 (self->priv->maximize);
	self->priv->maximize = _tmp5_;
	_tmp6_ = self->priv->maximize;
	g_signal_connect_object (_tmp6_, "activate", (GCallback) __gala_daemon_window_menu___lambda6__gtk_menu_item_activate, self, 0);
	_tmp7_ = granite_accel_label_new (_ ("Move"), NULL);
	g_object_ref_sink (_tmp7_);
	_g_object_unref0 (self->priv->move_accellabel);
	self->priv->move_accellabel = _tmp7_;
	_tmp8_ = (GtkMenuItem*) gtk_menu_item_new ();
	g_object_ref_sink (_tmp8_);
	_g_object_unref0 (self->priv->move);
	self->priv->move = _tmp8_;
	_tmp9_ = self->priv->move;
	_tmp10_ = self->priv->move_accellabel;
	gtk_container_add ((GtkContainer*) _tmp9_, (GtkWidget*) _tmp10_);
	_tmp11_ = self->priv->move;
	g_signal_connect_object (_tmp11_, "activate", (GCallback) __gala_daemon_window_menu___lambda7__gtk_menu_item_activate, self, 0);
	_tmp12_ = granite_accel_label_new (_ ("Resize"), NULL);
	g_object_ref_sink (_tmp12_);
	_g_object_unref0 (self->priv->resize_accellabel);
	self->priv->resize_accellabel = _tmp12_;
	_tmp13_ = (GtkMenuItem*) gtk_menu_item_new ();
	g_object_ref_sink (_tmp13_);
	_g_object_unref0 (self->priv->resize);
	self->priv->resize = _tmp13_;
	_tmp14_ = self->priv->resize;
	_tmp15_ = self->priv->resize_accellabel;
	gtk_container_add ((GtkContainer*) _tmp14_, (GtkWidget*) _tmp15_);
	_tmp16_ = self->priv->resize;
	g_signal_connect_object (_tmp16_, "activate", (GCallback) __gala_daemon_window_menu___lambda8__gtk_menu_item_activate, self, 0);
	_tmp17_ = granite_accel_label_new (_ ("Always on Top"), NULL);
	g_object_ref_sink (_tmp17_);
	_g_object_unref0 (self->priv->always_on_top_accellabel);
	self->priv->always_on_top_accellabel = _tmp17_;
	_tmp18_ = (GtkCheckMenuItem*) gtk_check_menu_item_new ();
	g_object_ref_sink (_tmp18_);
	_g_object_unref0 (self->priv->always_on_top);
	self->priv->always_on_top = _tmp18_;
	_tmp19_ = self->priv->always_on_top;
	_tmp20_ = self->priv->always_on_top_accellabel;
	gtk_container_add ((GtkContainer*) _tmp19_, (GtkWidget*) _tmp20_);
	_tmp21_ = self->priv->always_on_top;
	_tmp22_ = g_signal_connect_object ((GtkMenuItem*) _tmp21_, "activate", (GCallback) __gala_daemon_window_menu___lambda9__gtk_menu_item_activate, self, 0);
	self->priv->always_on_top_sid = _tmp22_;
	_tmp23_ = granite_accel_label_new (_ ("Always on Visible Workspace"), NULL);
	g_object_ref_sink (_tmp23_);
	_g_object_unref0 (self->priv->on_visible_workspace_accellabel);
	self->priv->on_visible_workspace_accellabel = _tmp23_;
	_tmp24_ = (GtkCheckMenuItem*) gtk_check_menu_item_new ();
	g_object_ref_sink (_tmp24_);
	_g_object_unref0 (self->priv->on_visible_workspace);
	self->priv->on_visible_workspace = _tmp24_;
	_tmp25_ = self->priv->on_visible_workspace;
	_tmp26_ = self->priv->on_visible_workspace_accellabel;
	gtk_container_add ((GtkContainer*) _tmp25_, (GtkWidget*) _tmp26_);
	_tmp27_ = self->priv->on_visible_workspace;
	_tmp28_ = g_signal_connect_object ((GtkMenuItem*) _tmp27_, "activate", (GCallback) __gala_daemon_window_menu___lambda10__gtk_menu_item_activate, self, 0);
	self->priv->on_visible_workspace_sid = _tmp28_;
	_tmp29_ = granite_accel_label_new (_ ("Move to Workspace Left"), NULL);
	g_object_ref_sink (_tmp29_);
	_g_object_unref0 (self->priv->move_left_accellabel);
	self->priv->move_left_accellabel = _tmp29_;
	_tmp30_ = (GtkMenuItem*) gtk_menu_item_new ();
	g_object_ref_sink (_tmp30_);
	_g_object_unref0 (self->priv->move_left);
	self->priv->move_left = _tmp30_;
	_tmp31_ = self->priv->move_left;
	_tmp32_ = self->priv->move_left_accellabel;
	gtk_container_add ((GtkContainer*) _tmp31_, (GtkWidget*) _tmp32_);
	_tmp33_ = self->priv->move_left;
	g_signal_connect_object (_tmp33_, "activate", (GCallback) __gala_daemon_window_menu___lambda11__gtk_menu_item_activate, self, 0);
	_tmp34_ = granite_accel_label_new (_ ("Move to Workspace Right"), NULL);
	g_object_ref_sink (_tmp34_);
	_g_object_unref0 (self->priv->move_right_accellabel);
	self->priv->move_right_accellabel = _tmp34_;
	_tmp35_ = (GtkMenuItem*) gtk_menu_item_new ();
	g_object_ref_sink (_tmp35_);
	_g_object_unref0 (self->priv->move_right);
	self->priv->move_right = _tmp35_;
	_tmp36_ = self->priv->move_right;
	_tmp37_ = self->priv->move_right_accellabel;
	gtk_container_add ((GtkContainer*) _tmp36_, (GtkWidget*) _tmp37_);
	_tmp38_ = self->priv->move_right;
	g_signal_connect_object (_tmp38_, "activate", (GCallback) __gala_daemon_window_menu___lambda12__gtk_menu_item_activate, self, 0);
	_tmp39_ = granite_accel_label_new (_ ("Take Screenshot"), NULL);
	g_object_ref_sink (_tmp39_);
	_g_object_unref0 (self->priv->screenshot_accellabel);
	self->priv->screenshot_accellabel = _tmp39_;
	_tmp40_ = (GtkMenuItem*) gtk_menu_item_new ();
	g_object_ref_sink (_tmp40_);
	_g_object_unref0 (self->priv->screenshot);
	self->priv->screenshot = _tmp40_;
	_tmp41_ = self->priv->screenshot;
	_tmp42_ = self->priv->screenshot_accellabel;
	gtk_container_add ((GtkContainer*) _tmp41_, (GtkWidget*) _tmp42_);
	_tmp43_ = self->priv->screenshot;
	g_signal_connect_object (_tmp43_, "activate", (GCallback) __gala_daemon_window_menu___lambda13__gtk_menu_item_activate, self, 0);
	_tmp44_ = granite_accel_label_new (_ ("Close"), NULL);
	g_object_ref_sink (_tmp44_);
	_g_object_unref0 (self->priv->close_accellabel);
	self->priv->close_accellabel = _tmp44_;
	_tmp45_ = (GtkMenuItem*) gtk_menu_item_new ();
	g_object_ref_sink (_tmp45_);
	_g_object_unref0 (self->priv->close);
	self->priv->close = _tmp45_;
	_tmp46_ = self->priv->close;
	_tmp47_ = self->priv->close_accellabel;
	gtk_container_add ((GtkContainer*) _tmp46_, (GtkWidget*) _tmp47_);
	_tmp48_ = self->priv->close;
	g_signal_connect_object (_tmp48_, "activate", (GCallback) __gala_daemon_window_menu___lambda14__gtk_menu_item_activate, self, 0);
	_tmp49_ = self->priv->screenshot;
	gtk_menu_shell_append ((GtkMenuShell*) self, _tmp49_);
	_tmp50_ = (GtkSeparatorMenuItem*) gtk_separator_menu_item_new ();
	g_object_ref_sink (_tmp50_);
	_tmp51_ = _tmp50_;
	gtk_menu_shell_append ((GtkMenuShell*) self, (GtkMenuItem*) _tmp51_);
	_g_object_unref0 (_tmp51_);
	_tmp52_ = self->priv->always_on_top;
	gtk_menu_shell_append ((GtkMenuShell*) self, (GtkMenuItem*) _tmp52_);
	_tmp53_ = self->priv->on_visible_workspace;
	gtk_menu_shell_append ((GtkMenuShell*) self, (GtkMenuItem*) _tmp53_);
	_tmp54_ = self->priv->move_left;
	gtk_menu_shell_append ((GtkMenuShell*) self, _tmp54_);
	_tmp55_ = self->priv->move_right;
	gtk_menu_shell_append ((GtkMenuShell*) self, _tmp55_);
	_tmp56_ = (GtkSeparatorMenuItem*) gtk_separator_menu_item_new ();
	g_object_ref_sink (_tmp56_);
	_tmp57_ = _tmp56_;
	gtk_menu_shell_append ((GtkMenuShell*) self, (GtkMenuItem*) _tmp57_);
	_g_object_unref0 (_tmp57_);
	_tmp58_ = self->priv->move;
	gtk_menu_shell_append ((GtkMenuShell*) self, _tmp58_);
	_tmp59_ = self->priv->resize;
	gtk_menu_shell_append ((GtkMenuShell*) self, _tmp59_);
	_tmp60_ = self->priv->maximize;
	gtk_menu_shell_append ((GtkMenuShell*) self, _tmp60_);
	_tmp61_ = (GtkSeparatorMenuItem*) gtk_separator_menu_item_new ();
	g_object_ref_sink (_tmp61_);
	_tmp62_ = _tmp61_;
	gtk_menu_shell_append ((GtkMenuShell*) self, (GtkMenuItem*) _tmp62_);
	_g_object_unref0 (_tmp62_);
	_tmp63_ = self->priv->minimize;
	gtk_menu_shell_append ((GtkMenuShell*) self, _tmp63_);
	_tmp64_ = self->priv->close;
	gtk_menu_shell_append ((GtkMenuShell*) self, _tmp64_);
	return obj;
}

static void
gala_daemon_window_menu_class_init (GalaDaemonWindowMenuClass * klass,
                                    gpointer klass_data)
{
	GSettings* _tmp0_;
	GSettings* _tmp1_;
	gala_daemon_window_menu_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GalaDaemonWindowMenu_private_offset);
	G_OBJECT_CLASS (klass)->constructor = gala_daemon_window_menu_constructor;
	G_OBJECT_CLASS (klass)->finalize = gala_daemon_window_menu_finalize;
	gala_daemon_window_menu_signals[GALA_DAEMON_WINDOW_MENU_PERFORM_ACTION_SIGNAL] = g_signal_new ("perform-action", GALA_DAEMON_TYPE_WINDOW_MENU, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__ENUM, G_TYPE_NONE, 1, GALA_TYPE_ACTION_TYPE);
	_tmp0_ = g_settings_new ("io.elementary.desktop.wm.keybindings");
	gala_daemon_window_menu_gala_keybind_settings = _tmp0_;
	_tmp1_ = g_settings_new ("org.gnome.desktop.wm.keybindings");
	gala_daemon_window_menu_keybind_settings = _tmp1_;
}

static void
gala_daemon_window_menu_instance_init (GalaDaemonWindowMenu * self,
                                       gpointer klass)
{
	self->priv = gala_daemon_window_menu_get_instance_private (self);
	self->priv->always_on_top_sid = (gulong) 0U;
	self->priv->on_visible_workspace_sid = (gulong) 0U;
}

static void
gala_daemon_window_menu_finalize (GObject * obj)
{
	GalaDaemonWindowMenu * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GALA_DAEMON_TYPE_WINDOW_MENU, GalaDaemonWindowMenu);
	_g_object_unref0 (self->priv->always_on_top_accellabel);
	_g_object_unref0 (self->priv->close_accellabel);
	_g_object_unref0 (self->priv->minimize_accellabel);
	_g_object_unref0 (self->priv->move_accellabel);
	_g_object_unref0 (self->priv->move_left_accellabel);
	_g_object_unref0 (self->priv->move_right_accellabel);
	_g_object_unref0 (self->priv->on_visible_workspace_accellabel);
	_g_object_unref0 (self->priv->resize_accellabel);
	_g_object_unref0 (self->priv->screenshot_accellabel);
	_g_object_unref0 (self->priv->minimize);
	_g_object_unref0 (self->priv->maximize);
	_g_object_unref0 (self->priv->move);
	_g_object_unref0 (self->priv->resize);
	_g_object_unref0 (self->priv->always_on_top);
	_g_object_unref0 (self->priv->on_visible_workspace);
	_g_object_unref0 (self->priv->move_left);
	_g_object_unref0 (self->priv->move_right);
	_g_object_unref0 (self->priv->close);
	_g_object_unref0 (self->priv->screenshot);
	G_OBJECT_CLASS (gala_daemon_window_menu_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
gala_daemon_window_menu_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GalaDaemonWindowMenuClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gala_daemon_window_menu_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GalaDaemonWindowMenu), 0, (GInstanceInitFunc) gala_daemon_window_menu_instance_init, NULL };
	GType gala_daemon_window_menu_type_id;
	gala_daemon_window_menu_type_id = g_type_register_static (gtk_menu_get_type (), "GalaDaemonWindowMenu", &g_define_type_info, 0);
	GalaDaemonWindowMenu_private_offset = g_type_add_instance_private (gala_daemon_window_menu_type_id, sizeof (GalaDaemonWindowMenuPrivate));
	return gala_daemon_window_menu_type_id;
}

GType
gala_daemon_window_menu_get_type (void)
{
	static gsize gala_daemon_window_menu_type_id__once = 0;
	if (g_once_init_enter (&gala_daemon_window_menu_type_id__once)) {
		GType gala_daemon_window_menu_type_id;
		gala_daemon_window_menu_type_id = gala_daemon_window_menu_get_type_once ();
		g_once_init_leave (&gala_daemon_window_menu_type_id__once, gala_daemon_window_menu_type_id);
	}
	return gala_daemon_window_menu_type_id__once;
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

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

