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

/*
 * Copyright 2019 elementary, Inc (https://elementary.io)
 *           2011-2015 Tom Beckmann
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301 USA
 */
/*
 * docs taken from unity indicator-session's
 * src/backend-dbus/org.gnome.SessionManager.EndSessionDialog.xml
 */

#include "session.h"
#include <glib-object.h>
#include <glib.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
#include <float.h>
#include <math.h>
#include <granite.h>
#include <gdk/gdk.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

enum  {
	SESSION_WIDGETS_END_SESSION_DIALOG_0_PROPERTY,
	SESSION_WIDGETS_END_SESSION_DIALOG_DIALOG_TYPE_PROPERTY,
	SESSION_WIDGETS_END_SESSION_DIALOG_NUM_PROPERTIES
};
static GParamSpec* session_widgets_end_session_dialog_properties[SESSION_WIDGETS_END_SESSION_DIALOG_NUM_PROPERTIES];
typedef struct _Block3Data Block3Data;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	SESSION_WIDGETS_END_SESSION_DIALOG_REBOOT_SIGNAL,
	SESSION_WIDGETS_END_SESSION_DIALOG_SHUTDOWN_SIGNAL,
	SESSION_WIDGETS_END_SESSION_DIALOG_LOGOUT_SIGNAL,
	SESSION_WIDGETS_END_SESSION_DIALOG_CANCELLED_SIGNAL,
	SESSION_WIDGETS_END_SESSION_DIALOG_NUM_SIGNALS
};
static guint session_widgets_end_session_dialog_signals[SESSION_WIDGETS_END_SESSION_DIALOG_NUM_SIGNALS] = {0};

struct _SessionWidgetsEndSessionDialogPrivate {
	SessionWidgetsEndSessionDialogType _dialog_type;
};

struct _Block3Data {
	int _ref_count_;
	SessionWidgetsEndSessionDialog* self;
	GSimpleAction* cancel_action;
};

static gint SessionWidgetsEndSessionDialog_private_offset;
static gpointer session_widgets_end_session_dialog_parent_class = NULL;

static GObject * session_widgets_end_session_dialog_constructor (GType type,
                                                          guint n_construct_properties,
                                                          GObjectConstructParam * construct_properties);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
static void _session_widgets_end_session_dialog____lambda9_ (SessionWidgetsEndSessionDialog* self);
static void __session_widgets_end_session_dialog____lambda9__gtk_button_clicked (GtkButton* _sender,
                                                                          gpointer self);
static void _session_widgets_end_session_dialog___lambda10_ (SessionWidgetsEndSessionDialog* self);
static void __session_widgets_end_session_dialog___lambda10__g_simple_action_activate (GSimpleAction* _sender,
                                                                                GVariant* parameter,
                                                                                gpointer self);
static void _session_widgets_end_session_dialog___lambda11_ (Block3Data* _data3_);
static void __session_widgets_end_session_dialog___lambda11__gtk_button_clicked (GtkButton* _sender,
                                                                          gpointer self);
static gboolean _session_widgets_end_session_dialog___lambda12_ (Block3Data* _data3_,
                                                          GdkEventKey* event);
static gboolean __session_widgets_end_session_dialog___lambda12__gtk_widget_key_press_event (GtkWidget* _sender,
                                                                                      GdkEventKey* event,
                                                                                      gpointer self);
static void _session_widgets_end_session_dialog___lambda13_ (SessionWidgetsEndSessionDialog* self);
static void __session_widgets_end_session_dialog___lambda13__gtk_button_clicked (GtkButton* _sender,
                                                                          gpointer self);
static void session_widgets_end_session_dialog_finalize (GObject * obj);
static GType session_widgets_end_session_dialog_get_type_once (void);
static void _vala_session_widgets_end_session_dialog_get_property (GObject * object,
                                                            guint property_id,
                                                            GValue * value,
                                                            GParamSpec * pspec);
static void _vala_session_widgets_end_session_dialog_set_property (GObject * object,
                                                            guint property_id,
                                                            const GValue * value,
                                                            GParamSpec * pspec);

static GType
session_widgets_end_session_dialog_type_get_type_once (void)
{
	static const GEnumValue values[] = {{SESSION_WIDGETS_END_SESSION_DIALOG_TYPE_LOGOUT, "SESSION_WIDGETS_END_SESSION_DIALOG_TYPE_LOGOUT", "logout"}, {SESSION_WIDGETS_END_SESSION_DIALOG_TYPE_SHUTDOWN, "SESSION_WIDGETS_END_SESSION_DIALOG_TYPE_SHUTDOWN", "shutdown"}, {SESSION_WIDGETS_END_SESSION_DIALOG_TYPE_RESTART, "SESSION_WIDGETS_END_SESSION_DIALOG_TYPE_RESTART", "restart"}, {0, NULL, NULL}};
	GType session_widgets_end_session_dialog_type_type_id;
	session_widgets_end_session_dialog_type_type_id = g_enum_register_static ("SessionWidgetsEndSessionDialogType", values);
	return session_widgets_end_session_dialog_type_type_id;
}

GType
session_widgets_end_session_dialog_type_get_type (void)
{
	static volatile gsize session_widgets_end_session_dialog_type_type_id__once = 0;
	if (g_once_init_enter (&session_widgets_end_session_dialog_type_type_id__once)) {
		GType session_widgets_end_session_dialog_type_type_id;
		session_widgets_end_session_dialog_type_type_id = session_widgets_end_session_dialog_type_get_type_once ();
		g_once_init_leave (&session_widgets_end_session_dialog_type_type_id__once, session_widgets_end_session_dialog_type_type_id);
	}
	return session_widgets_end_session_dialog_type_type_id__once;
}

static inline gpointer
session_widgets_end_session_dialog_get_instance_private (SessionWidgetsEndSessionDialog* self)
{
	return G_STRUCT_MEMBER_P (self, SessionWidgetsEndSessionDialog_private_offset);
}

SessionWidgetsEndSessionDialog*
session_widgets_end_session_dialog_construct (GType object_type,
                                              SessionWidgetsEndSessionDialogType type)
{
	SessionWidgetsEndSessionDialog * self = NULL;
	self = (SessionWidgetsEndSessionDialog*) g_object_new (object_type, "dialog-type", type, NULL);
	return self;
}

SessionWidgetsEndSessionDialog*
session_widgets_end_session_dialog_new (SessionWidgetsEndSessionDialogType type)
{
	return session_widgets_end_session_dialog_construct (SESSION_WIDGETS_TYPE_END_SESSION_DIALOG, type);
}

SessionWidgetsEndSessionDialogType
session_widgets_end_session_dialog_get_dialog_type (SessionWidgetsEndSessionDialog* self)
{
	SessionWidgetsEndSessionDialogType result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_dialog_type;
	return result;
}

static void
session_widgets_end_session_dialog_set_dialog_type (SessionWidgetsEndSessionDialog* self,
                                                    SessionWidgetsEndSessionDialogType value)
{
	SessionWidgetsEndSessionDialogType old_value;
	g_return_if_fail (self != NULL);
	old_value = session_widgets_end_session_dialog_get_dialog_type (self);
	if (old_value != value) {
		self->priv->_dialog_type = value;
		g_object_notify_by_pspec ((GObject *) self, session_widgets_end_session_dialog_properties[SESSION_WIDGETS_END_SESSION_DIALOG_DIALOG_TYPE_PROPERTY]);
	}
}

static Block3Data*
block3_data_ref (Block3Data* _data3_)
{
	g_atomic_int_inc (&_data3_->_ref_count_);
	return _data3_;
}

static void
block3_data_unref (void * _userdata_)
{
	Block3Data* _data3_;
	_data3_ = (Block3Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
		SessionWidgetsEndSessionDialog* self;
		self = _data3_->self;
		_g_object_unref0 (_data3_->cancel_action);
		_g_object_unref0 (self);
		g_slice_free (Block3Data, _data3_);
	}
}

static void
_session_widgets_end_session_dialog____lambda9_ (SessionWidgetsEndSessionDialog* self)
{
	g_signal_emit (self, session_widgets_end_session_dialog_signals[SESSION_WIDGETS_END_SESSION_DIALOG_REBOOT_SIGNAL], 0);
	gtk_widget_destroy ((GtkWidget*) self);
}

static void
__session_widgets_end_session_dialog____lambda9__gtk_button_clicked (GtkButton* _sender,
                                                                     gpointer self)
{
	_session_widgets_end_session_dialog____lambda9_ ((SessionWidgetsEndSessionDialog*) self);
}

static void
_session_widgets_end_session_dialog___lambda10_ (SessionWidgetsEndSessionDialog* self)
{
	g_signal_emit (self, session_widgets_end_session_dialog_signals[SESSION_WIDGETS_END_SESSION_DIALOG_CANCELLED_SIGNAL], 0);
	gtk_widget_destroy ((GtkWidget*) self);
}

static void
__session_widgets_end_session_dialog___lambda10__g_simple_action_activate (GSimpleAction* _sender,
                                                                           GVariant* parameter,
                                                                           gpointer self)
{
	_session_widgets_end_session_dialog___lambda10_ ((SessionWidgetsEndSessionDialog*) self);
}

static void
_session_widgets_end_session_dialog___lambda11_ (Block3Data* _data3_)
{
	SessionWidgetsEndSessionDialog* self;
	GSimpleAction* _tmp0_;
	self = _data3_->self;
	_tmp0_ = _data3_->cancel_action;
	g_signal_emit_by_name (_tmp0_, "activate", NULL);
}

static void
__session_widgets_end_session_dialog___lambda11__gtk_button_clicked (GtkButton* _sender,
                                                                     gpointer self)
{
	_session_widgets_end_session_dialog___lambda11_ (self);
}

static gboolean
_session_widgets_end_session_dialog___lambda12_ (Block3Data* _data3_,
                                                 GdkEventKey* event)
{
	SessionWidgetsEndSessionDialog* self;
	const gchar* _tmp0_;
	gboolean result;
	self = _data3_->self;
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = gdk_keyval_name (event->keyval);
	if (g_strcmp0 (_tmp0_, "Escape") == 0) {
		GSimpleAction* _tmp1_;
		_tmp1_ = _data3_->cancel_action;
		g_signal_emit_by_name (_tmp1_, "activate", NULL);
	}
	result = GDK_EVENT_PROPAGATE;
	return result;
}

static gboolean
__session_widgets_end_session_dialog___lambda12__gtk_widget_key_press_event (GtkWidget* _sender,
                                                                             GdkEventKey* event,
                                                                             gpointer self)
{
	gboolean result;
	result = _session_widgets_end_session_dialog___lambda12_ (self, event);
	return result;
}

static void
_session_widgets_end_session_dialog___lambda13_ (SessionWidgetsEndSessionDialog* self)
{
	gboolean _tmp0_ = FALSE;
	SessionWidgetsEndSessionDialogType _tmp1_;
	_tmp1_ = self->priv->_dialog_type;
	if (_tmp1_ == SESSION_WIDGETS_END_SESSION_DIALOG_TYPE_RESTART) {
		_tmp0_ = TRUE;
	} else {
		SessionWidgetsEndSessionDialogType _tmp2_;
		_tmp2_ = self->priv->_dialog_type;
		_tmp0_ = _tmp2_ == SESSION_WIDGETS_END_SESSION_DIALOG_TYPE_SHUTDOWN;
	}
	if (_tmp0_) {
		g_signal_emit (self, session_widgets_end_session_dialog_signals[SESSION_WIDGETS_END_SESSION_DIALOG_SHUTDOWN_SIGNAL], 0);
	} else {
		g_signal_emit (self, session_widgets_end_session_dialog_signals[SESSION_WIDGETS_END_SESSION_DIALOG_LOGOUT_SIGNAL], 0);
	}
	gtk_widget_destroy ((GtkWidget*) self);
}

static void
__session_widgets_end_session_dialog___lambda13__gtk_button_clicked (GtkButton* _sender,
                                                                     gpointer self)
{
	_session_widgets_end_session_dialog___lambda13_ ((SessionWidgetsEndSessionDialog*) self);
}

static GObject *
session_widgets_end_session_dialog_constructor (GType type,
                                                guint n_construct_properties,
                                                GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SessionWidgetsEndSessionDialog * self;
	Block3Data* _data3_;
	gchar* icon_name = NULL;
	gchar* heading_text = NULL;
	gchar* button_text = NULL;
	gchar* content_text = NULL;
	SessionWidgetsEndSessionDialogType _tmp0_;
	GtkImage* image = NULL;
	const gchar* _tmp9_;
	GtkImage* _tmp10_ = NULL;
	GtkLabel* primary_label = NULL;
	const gchar* _tmp11_;
	GtkLabel* _tmp12_ = NULL;
	GtkLabel* _tmp13_;
	GtkStyleContext* _tmp14_;
	GtkLabel* secondary_label = NULL;
	const gchar* _tmp15_;
	GtkLabel* _tmp16_ = NULL;
	GtkButton* cancel = NULL;
	GtkButton* _tmp17_;
	GtkButton* confirm = NULL;
	const gchar* _tmp18_;
	GtkButton* _tmp19_;
	GtkButton* _tmp20_;
	GtkStyleContext* _tmp21_;
	GtkButtonBox* action_area = NULL;
	GtkButtonBox* _tmp22_ = NULL;
	SessionWidgetsEndSessionDialogType _tmp23_;
	GtkButtonBox* _tmp28_;
	GtkButton* _tmp29_;
	GtkButtonBox* _tmp30_;
	GtkButton* _tmp31_;
	GtkGrid* grid = NULL;
	GtkGrid* _tmp32_ = NULL;
	GtkGrid* _tmp33_;
	GtkImage* _tmp34_;
	GtkGrid* _tmp35_;
	GtkLabel* _tmp36_;
	GtkGrid* _tmp37_;
	GtkLabel* _tmp38_;
	GtkGrid* _tmp39_;
	GtkButtonBox* _tmp40_;
	GtkGrid* _tmp41_;
	GtkButton* _tmp42_;
	GSimpleAction* _tmp43_;
	GSimpleAction* _tmp44_;
	GtkButton* _tmp45_;
	GtkButton* _tmp46_;
	parent_class = G_OBJECT_CLASS (session_widgets_end_session_dialog_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SESSION_WIDGETS_TYPE_END_SESSION_DIALOG, SessionWidgetsEndSessionDialog);
	_data3_ = g_slice_new0 (Block3Data);
	_data3_->_ref_count_ = 1;
	_data3_->self = g_object_ref (self);
	_tmp0_ = self->priv->_dialog_type;
	switch (_tmp0_) {
		case SESSION_WIDGETS_END_SESSION_DIALOG_TYPE_LOGOUT:
		{
			gchar* _tmp1_;
			gchar* _tmp2_;
			gchar* _tmp3_;
			gchar* _tmp4_;
			_tmp1_ = g_strdup ("system-log-out");
			_g_free0 (icon_name);
			icon_name = _tmp1_;
			_tmp2_ = g_strdup (_ ("Are you sure you want to Log Out?"));
			_g_free0 (heading_text);
			heading_text = _tmp2_;
			_tmp3_ = g_strdup (_ ("This will close all open applications."));
			_g_free0 (content_text);
			content_text = _tmp3_;
			_tmp4_ = g_strdup (_ ("Log Out"));
			_g_free0 (button_text);
			button_text = _tmp4_;
			break;
		}
		case SESSION_WIDGETS_END_SESSION_DIALOG_TYPE_SHUTDOWN:
		case SESSION_WIDGETS_END_SESSION_DIALOG_TYPE_RESTART:
		{
			gchar* _tmp5_;
			gchar* _tmp6_;
			gchar* _tmp7_;
			gchar* _tmp8_;
			_tmp5_ = g_strdup ("system-shutdown");
			_g_free0 (icon_name);
			icon_name = _tmp5_;
			_tmp6_ = g_strdup (_ ("Are you sure you want to Shut Down?"));
			_g_free0 (heading_text);
			heading_text = _tmp6_;
			_tmp7_ = g_strdup (_ ("This will close all open applications and turn off this device."));
			_g_free0 (content_text);
			content_text = _tmp7_;
			_tmp8_ = g_strdup (_ ("Shut Down"));
			_g_free0 (button_text);
			button_text = _tmp8_;
			break;
		}
		default:
		{
			g_warn_if_reached ();
			break;
		}
	}
	_tmp9_ = icon_name;
	_tmp10_ = (GtkImage*) gtk_image_new_from_icon_name (_tmp9_, (GtkIconSize) GTK_ICON_SIZE_DIALOG);
	gtk_widget_set_valign ((GtkWidget*) _tmp10_, GTK_ALIGN_START);
	g_object_ref_sink (_tmp10_);
	image = _tmp10_;
	_tmp11_ = heading_text;
	_tmp12_ = (GtkLabel*) gtk_label_new (_tmp11_);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp12_, TRUE);
	gtk_label_set_max_width_chars (_tmp12_, 50);
	g_object_set (_tmp12_, "wrap", TRUE, NULL);
	gtk_label_set_xalign (_tmp12_, (gfloat) 0);
	g_object_ref_sink (_tmp12_);
	primary_label = _tmp12_;
	_tmp13_ = primary_label;
	_tmp14_ = gtk_widget_get_style_context ((GtkWidget*) _tmp13_);
	gtk_style_context_add_class (_tmp14_, GRANITE_STYLE_CLASS_PRIMARY_LABEL);
	_tmp15_ = content_text;
	_tmp16_ = (GtkLabel*) gtk_label_new (_tmp15_);
	gtk_label_set_max_width_chars (_tmp16_, 50);
	g_object_set (_tmp16_, "wrap", TRUE, NULL);
	gtk_label_set_xalign (_tmp16_, (gfloat) 0);
	g_object_ref_sink (_tmp16_);
	secondary_label = _tmp16_;
	_tmp17_ = (GtkButton*) gtk_button_new_with_label (_ ("Cancel"));
	g_object_ref_sink (_tmp17_);
	cancel = _tmp17_;
	_tmp18_ = button_text;
	_tmp19_ = (GtkButton*) gtk_button_new_with_label (_tmp18_);
	g_object_ref_sink (_tmp19_);
	confirm = _tmp19_;
	_tmp20_ = confirm;
	_tmp21_ = gtk_widget_get_style_context ((GtkWidget*) _tmp20_);
	gtk_style_context_add_class (_tmp21_, GTK_STYLE_CLASS_DESTRUCTIVE_ACTION);
	_tmp22_ = (GtkButtonBox*) gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
	g_object_set (_tmp22_, "layout-style", GTK_BUTTONBOX_END, NULL);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp22_, 16);
	gtk_box_set_spacing ((GtkBox*) _tmp22_, 6);
	g_object_ref_sink (_tmp22_);
	action_area = _tmp22_;
	_tmp23_ = self->priv->_dialog_type;
	if (_tmp23_ == SESSION_WIDGETS_END_SESSION_DIALOG_TYPE_RESTART) {
		GtkButton* confirm_restart = NULL;
		GtkButton* _tmp24_;
		GtkButton* _tmp25_;
		GtkButtonBox* _tmp26_;
		GtkButton* _tmp27_;
		_tmp24_ = (GtkButton*) gtk_button_new_with_label (_ ("Restart"));
		g_object_ref_sink (_tmp24_);
		confirm_restart = _tmp24_;
		_tmp25_ = confirm_restart;
		g_signal_connect_object (_tmp25_, "clicked", (GCallback) __session_widgets_end_session_dialog____lambda9__gtk_button_clicked, self, 0);
		_tmp26_ = action_area;
		_tmp27_ = confirm_restart;
		gtk_container_add ((GtkContainer*) _tmp26_, (GtkWidget*) _tmp27_);
		_g_object_unref0 (confirm_restart);
	}
	_tmp28_ = action_area;
	_tmp29_ = cancel;
	gtk_container_add ((GtkContainer*) _tmp28_, (GtkWidget*) _tmp29_);
	_tmp30_ = action_area;
	_tmp31_ = confirm;
	gtk_container_add ((GtkContainer*) _tmp30_, (GtkWidget*) _tmp31_);
	_tmp32_ = (GtkGrid*) gtk_grid_new ();
	gtk_grid_set_column_spacing (_tmp32_, 12);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp32_, 12);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp32_, 12);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp32_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp32_, 12);
	g_object_ref_sink (_tmp32_);
	grid = _tmp32_;
	_tmp33_ = grid;
	_tmp34_ = image;
	gtk_grid_attach (_tmp33_, (GtkWidget*) _tmp34_, 0, 0, 1, 2);
	_tmp35_ = grid;
	_tmp36_ = primary_label;
	gtk_grid_attach (_tmp35_, (GtkWidget*) _tmp36_, 1, 0, 1, 1);
	_tmp37_ = grid;
	_tmp38_ = secondary_label;
	gtk_grid_attach (_tmp37_, (GtkWidget*) _tmp38_, 1, 1, 1, 1);
	_tmp39_ = grid;
	_tmp40_ = action_area;
	gtk_grid_attach (_tmp39_, (GtkWidget*) _tmp40_, 0, 2, 2, 1);
	gtk_window_set_deletable ((GtkWindow*) self, FALSE);
	gtk_window_set_resizable ((GtkWindow*) self, FALSE);
	gtk_window_set_skip_taskbar_hint ((GtkWindow*) self, TRUE);
	gtk_window_set_skip_pager_hint ((GtkWindow*) self, TRUE);
	gtk_window_set_type_hint ((GtkWindow*) self, GDK_WINDOW_TYPE_HINT_DIALOG);
	gtk_window_set_keep_above ((GtkWindow*) self, TRUE);
	g_object_set ((GtkWindow*) self, "window-position", GTK_WIN_POS_CENTER, NULL);
	gtk_window_stick ((GtkWindow*) self);
	_tmp41_ = grid;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp41_);
	_tmp42_ = cancel;
	gtk_widget_grab_focus ((GtkWidget*) _tmp42_);
	_tmp43_ = g_simple_action_new ("cancel", NULL);
	_data3_->cancel_action = _tmp43_;
	_tmp44_ = _data3_->cancel_action;
	g_signal_connect_object (_tmp44_, "activate", (GCallback) __session_widgets_end_session_dialog___lambda10__g_simple_action_activate, self, 0);
	_tmp45_ = cancel;
	g_signal_connect_data (_tmp45_, "clicked", (GCallback) __session_widgets_end_session_dialog___lambda11__gtk_button_clicked, block3_data_ref (_data3_), (GClosureNotify) block3_data_unref, 0);
	g_signal_connect_data ((GtkWidget*) self, "key-press-event", (GCallback) __session_widgets_end_session_dialog___lambda12__gtk_widget_key_press_event, block3_data_ref (_data3_), (GClosureNotify) block3_data_unref, 0);
	_tmp46_ = confirm;
	g_signal_connect_object (_tmp46_, "clicked", (GCallback) __session_widgets_end_session_dialog___lambda13__gtk_button_clicked, self, 0);
	_g_object_unref0 (grid);
	_g_object_unref0 (action_area);
	_g_object_unref0 (confirm);
	_g_object_unref0 (cancel);
	_g_object_unref0 (secondary_label);
	_g_object_unref0 (primary_label);
	_g_object_unref0 (image);
	_g_free0 (content_text);
	_g_free0 (button_text);
	_g_free0 (heading_text);
	_g_free0 (icon_name);
	block3_data_unref (_data3_);
	_data3_ = NULL;
	return obj;
}

static void
session_widgets_end_session_dialog_class_init (SessionWidgetsEndSessionDialogClass * klass,
                                               gpointer klass_data)
{
	session_widgets_end_session_dialog_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SessionWidgetsEndSessionDialog_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_session_widgets_end_session_dialog_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_session_widgets_end_session_dialog_set_property;
	G_OBJECT_CLASS (klass)->constructor = session_widgets_end_session_dialog_constructor;
	G_OBJECT_CLASS (klass)->finalize = session_widgets_end_session_dialog_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SESSION_WIDGETS_END_SESSION_DIALOG_DIALOG_TYPE_PROPERTY, session_widgets_end_session_dialog_properties[SESSION_WIDGETS_END_SESSION_DIALOG_DIALOG_TYPE_PROPERTY] = g_param_spec_enum ("dialog-type", "dialog-type", "dialog-type", SESSION_WIDGETS_TYPE_END_SESSION_DIALOG_TYPE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	session_widgets_end_session_dialog_signals[SESSION_WIDGETS_END_SESSION_DIALOG_REBOOT_SIGNAL] = g_signal_new ("reboot", SESSION_WIDGETS_TYPE_END_SESSION_DIALOG, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	session_widgets_end_session_dialog_signals[SESSION_WIDGETS_END_SESSION_DIALOG_SHUTDOWN_SIGNAL] = g_signal_new ("shutdown", SESSION_WIDGETS_TYPE_END_SESSION_DIALOG, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	session_widgets_end_session_dialog_signals[SESSION_WIDGETS_END_SESSION_DIALOG_LOGOUT_SIGNAL] = g_signal_new ("logout", SESSION_WIDGETS_TYPE_END_SESSION_DIALOG, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	session_widgets_end_session_dialog_signals[SESSION_WIDGETS_END_SESSION_DIALOG_CANCELLED_SIGNAL] = g_signal_new ("cancelled", SESSION_WIDGETS_TYPE_END_SESSION_DIALOG, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
session_widgets_end_session_dialog_instance_init (SessionWidgetsEndSessionDialog * self,
                                                  gpointer klass)
{
	self->priv = session_widgets_end_session_dialog_get_instance_private (self);
}

static void
session_widgets_end_session_dialog_finalize (GObject * obj)
{
	SessionWidgetsEndSessionDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SESSION_WIDGETS_TYPE_END_SESSION_DIALOG, SessionWidgetsEndSessionDialog);
	G_OBJECT_CLASS (session_widgets_end_session_dialog_parent_class)->finalize (obj);
}

static GType
session_widgets_end_session_dialog_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SessionWidgetsEndSessionDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) session_widgets_end_session_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SessionWidgetsEndSessionDialog), 0, (GInstanceInitFunc) session_widgets_end_session_dialog_instance_init, NULL };
	GType session_widgets_end_session_dialog_type_id;
	session_widgets_end_session_dialog_type_id = g_type_register_static (hdy_window_get_type (), "SessionWidgetsEndSessionDialog", &g_define_type_info, 0);
	SessionWidgetsEndSessionDialog_private_offset = g_type_add_instance_private (session_widgets_end_session_dialog_type_id, sizeof (SessionWidgetsEndSessionDialogPrivate));
	return session_widgets_end_session_dialog_type_id;
}

GType
session_widgets_end_session_dialog_get_type (void)
{
	static volatile gsize session_widgets_end_session_dialog_type_id__once = 0;
	if (g_once_init_enter (&session_widgets_end_session_dialog_type_id__once)) {
		GType session_widgets_end_session_dialog_type_id;
		session_widgets_end_session_dialog_type_id = session_widgets_end_session_dialog_get_type_once ();
		g_once_init_leave (&session_widgets_end_session_dialog_type_id__once, session_widgets_end_session_dialog_type_id);
	}
	return session_widgets_end_session_dialog_type_id__once;
}

static void
_vala_session_widgets_end_session_dialog_get_property (GObject * object,
                                                       guint property_id,
                                                       GValue * value,
                                                       GParamSpec * pspec)
{
	SessionWidgetsEndSessionDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SESSION_WIDGETS_TYPE_END_SESSION_DIALOG, SessionWidgetsEndSessionDialog);
	switch (property_id) {
		case SESSION_WIDGETS_END_SESSION_DIALOG_DIALOG_TYPE_PROPERTY:
		g_value_set_enum (value, session_widgets_end_session_dialog_get_dialog_type (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_session_widgets_end_session_dialog_set_property (GObject * object,
                                                       guint property_id,
                                                       const GValue * value,
                                                       GParamSpec * pspec)
{
	SessionWidgetsEndSessionDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SESSION_WIDGETS_TYPE_END_SESSION_DIALOG, SessionWidgetsEndSessionDialog);
	switch (property_id) {
		case SESSION_WIDGETS_END_SESSION_DIALOG_DIALOG_TYPE_PROPERTY:
		session_widgets_end_session_dialog_set_dialog_type (self, g_value_get_enum (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

