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

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

#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 TYPE_LOGIN_MANAGER (login_manager_get_type ())
#define LOGIN_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LOGIN_MANAGER, LoginManager))
#define IS_LOGIN_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LOGIN_MANAGER))
#define LOGIN_MANAGER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_LOGIN_MANAGER, LoginManagerIface))

typedef struct _LoginManager LoginManager;
typedef struct _LoginManagerIface LoginManagerIface;

#define TYPE_LOGIN_MANAGER_PROXY (login_manager_proxy_get_type ())
enum  {
	LOGIN_MANAGER_PREPARE_FOR_SLEEP_SIGNAL,
	LOGIN_MANAGER_NUM_SIGNALS
};
static guint login_manager_signals[LOGIN_MANAGER_NUM_SIGNALS] = {0};
typedef GDBusProxy LoginManagerProxy;
typedef GDBusProxyClass LoginManagerProxyClass;

#define GREETER_TYPE_DATE_TIME_WIDGET (greeter_date_time_widget_get_type ())
#define GREETER_DATE_TIME_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GREETER_TYPE_DATE_TIME_WIDGET, GreeterDateTimeWidget))
#define GREETER_DATE_TIME_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GREETER_TYPE_DATE_TIME_WIDGET, GreeterDateTimeWidgetClass))
#define GREETER_IS_DATE_TIME_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GREETER_TYPE_DATE_TIME_WIDGET))
#define GREETER_IS_DATE_TIME_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GREETER_TYPE_DATE_TIME_WIDGET))
#define GREETER_DATE_TIME_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GREETER_TYPE_DATE_TIME_WIDGET, GreeterDateTimeWidgetClass))

typedef struct _GreeterDateTimeWidget GreeterDateTimeWidget;
typedef struct _GreeterDateTimeWidgetClass GreeterDateTimeWidgetClass;
typedef struct _GreeterDateTimeWidgetPrivate GreeterDateTimeWidgetPrivate;
enum  {
	GREETER_DATE_TIME_WIDGET_0_PROPERTY,
	GREETER_DATE_TIME_WIDGET_IS_24H_PROPERTY,
	GREETER_DATE_TIME_WIDGET_NUM_PROPERTIES
};
static GParamSpec* greeter_date_time_widget_properties[GREETER_DATE_TIME_WIDGET_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _GreeterDateTimeWidgetSetupForSleepData GreeterDateTimeWidgetSetupForSleepData;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))

struct _LoginManagerIface {
	GTypeInterface parent_iface;
};

struct _GreeterDateTimeWidget {
	GtkRevealer parent_instance;
	GreeterDateTimeWidgetPrivate * priv;
};

struct _GreeterDateTimeWidgetClass {
	GtkRevealerClass parent_class;
};

struct _GreeterDateTimeWidgetPrivate {
	gboolean _is_24h;
	GtkLabel* time_label;
	GtkLabel* date_label;
	guint timeout_id;
	LoginManager* login_manager;
};

struct _GreeterDateTimeWidgetSetupForSleepData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GreeterDateTimeWidget* self;
	LoginManager* _tmp0_;
	LoginManager* _tmp1_;
	LoginManager* _tmp2_;
	LoginManager* _tmp3_;
	GError* e;
	GError* _tmp4_;
	const gchar* _tmp5_;
	GError* _inner_error0_;
};

static gint GreeterDateTimeWidget_private_offset;
static gpointer greeter_date_time_widget_parent_class = NULL;

VALA_EXTERN GType login_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LoginManager, g_object_unref)
VALA_EXTERN GType login_manager_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint login_manager_register_object (void* object,
                                     GDBusConnection* connection,
                                     const gchar* path,
                                     GError** error);
static GType login_manager_get_type_once (void);
static void login_manager_proxy_g_signal (GDBusProxy* proxy,
                                   const gchar* sender_name,
                                   const gchar* signal_name,
                                   GVariant* parameters);
static void _dbus_handle_login_manager_prepare_for_sleep (LoginManager* self,
                                                   GVariant* parameters);
static void login_manager_proxy_login_manager_interface_init (LoginManagerIface* iface);
static void login_manager_dbus_interface_method_call (GDBusConnection* connection,
                                               const gchar* sender,
                                               const gchar* object_path,
                                               const gchar* interface_name,
                                               const gchar* method_name,
                                               GVariant* parameters,
                                               GDBusMethodInvocation* invocation,
                                               gpointer user_data);
static GVariant* login_manager_dbus_interface_get_property (GDBusConnection* connection,
                                                     const gchar* sender,
                                                     const gchar* object_path,
                                                     const gchar* interface_name,
                                                     const gchar* property_name,
                                                     GError** error,
                                                     gpointer user_data);
static gboolean login_manager_dbus_interface_set_property (GDBusConnection* connection,
                                                    const gchar* sender,
                                                    const gchar* object_path,
                                                    const gchar* interface_name,
                                                    const gchar* property_name,
                                                    GVariant* value,
                                                    GError** error,
                                                    gpointer user_data);
static void _dbus_login_manager_prepare_for_sleep (GObject* _sender,
                                            gboolean start,
                                            gpointer* _data);
static void _login_manager_unregister_object (gpointer user_data);
VALA_EXTERN GType greeter_date_time_widget_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GreeterDateTimeWidget, g_object_unref)
static void greeter_date_time_widget_setup_for_sleep_data_free (gpointer _data);
static void greeter_date_time_widget_setup_for_sleep (GreeterDateTimeWidget* self,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_);
static void greeter_date_time_widget_setup_for_sleep_finish (GreeterDateTimeWidget* self,
                                                      GAsyncResult* _res_);
static gboolean greeter_date_time_widget_setup_for_sleep_co (GreeterDateTimeWidgetSetupForSleepData* _data_);
static void greeter_date_time_widget_setup_for_sleep_ready (GObject* source_object,
                                                     GAsyncResult* _res_,
                                                     gpointer _user_data_);
static void ___lambda22_ (GreeterDateTimeWidget* self,
                   gboolean start);
static gboolean greeter_date_time_widget_update_labels (GreeterDateTimeWidget* self);
static void ____lambda22__login_manager_prepare_for_sleep (LoginManager* _sender,
                                                    gboolean start,
                                                    gpointer self);
VALA_EXTERN gboolean greeter_date_time_widget_get_is_24h (GreeterDateTimeWidget* self);
static gboolean _greeter_date_time_widget_update_labels_gsource_func (gpointer self);
VALA_EXTERN GreeterDateTimeWidget* greeter_date_time_widget_new (void);
VALA_EXTERN GreeterDateTimeWidget* greeter_date_time_widget_construct (GType object_type);
VALA_EXTERN void greeter_date_time_widget_set_is_24h (GreeterDateTimeWidget* self,
                                          gboolean value);
static GObject * greeter_date_time_widget_constructor (GType type,
                                                guint n_construct_properties,
                                                GObjectConstructParam * construct_properties);
static void _greeter_date_time_widget___lambda23_ (GreeterDateTimeWidget* self);
static void __greeter_date_time_widget___lambda23__g_object_notify (GObject* _sender,
                                                             GParamSpec* pspec,
                                                             gpointer self);
static void greeter_date_time_widget_finalize (GObject * obj);
static GType greeter_date_time_widget_get_type_once (void);
static void _vala_greeter_date_time_widget_get_property (GObject * object,
                                                  guint property_id,
                                                  GValue * value,
                                                  GParamSpec * pspec);
static void _vala_greeter_date_time_widget_set_property (GObject * object,
                                                  guint property_id,
                                                  const GValue * value,
                                                  GParamSpec * pspec);

static const GDBusMethodInfo * const _login_manager_dbus_method_info[] = {NULL};
static const GDBusArgInfo _login_manager_dbus_arg_info_prepare_for_sleep_start = {-1, "start", "b", NULL};
static const GDBusArgInfo * const _login_manager_dbus_arg_info_prepare_for_sleep[] = {&_login_manager_dbus_arg_info_prepare_for_sleep_start, NULL};
static const GDBusSignalInfo _login_manager_dbus_signal_info_prepare_for_sleep = {-1, "PrepareForSleep", (GDBusArgInfo **) (&_login_manager_dbus_arg_info_prepare_for_sleep), NULL};
static const GDBusSignalInfo * const _login_manager_dbus_signal_info[] = {&_login_manager_dbus_signal_info_prepare_for_sleep, NULL};
static const GDBusPropertyInfo * const _login_manager_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _login_manager_dbus_interface_info = {-1, "org.freedesktop.login1.Manager", (GDBusMethodInfo **) (&_login_manager_dbus_method_info), (GDBusSignalInfo **) (&_login_manager_dbus_signal_info), (GDBusPropertyInfo **) (&_login_manager_dbus_property_info), NULL};
static const GDBusInterfaceVTable _login_manager_dbus_interface_vtable = {login_manager_dbus_interface_method_call, login_manager_dbus_interface_get_property, login_manager_dbus_interface_set_property};

static void
login_manager_default_init (LoginManagerIface * iface,
                            gpointer iface_data)
{
	login_manager_signals[LOGIN_MANAGER_PREPARE_FOR_SLEEP_SIGNAL] = g_signal_new ("prepare-for-sleep", TYPE_LOGIN_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
}

static GType
login_manager_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (LoginManagerIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) login_manager_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType login_manager_type_id;
	login_manager_type_id = g_type_register_static (G_TYPE_INTERFACE, "LoginManager", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (login_manager_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (login_manager_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) login_manager_proxy_get_type);
	g_type_set_qdata (login_manager_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.freedesktop.login1.Manager");
	g_type_set_qdata (login_manager_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_login_manager_dbus_interface_info));
	g_type_set_qdata (login_manager_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) login_manager_register_object);
	return login_manager_type_id;
}

GType
login_manager_get_type (void)
{
	static volatile gsize login_manager_type_id__once = 0;
	if (g_once_init_enter (&login_manager_type_id__once)) {
		GType login_manager_type_id;
		login_manager_type_id = login_manager_get_type_once ();
		g_once_init_leave (&login_manager_type_id__once, login_manager_type_id);
	}
	return login_manager_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (LoginManagerProxy, login_manager_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (TYPE_LOGIN_MANAGER, login_manager_proxy_login_manager_interface_init) )
static void
login_manager_proxy_class_init (LoginManagerProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = login_manager_proxy_g_signal;
}

static void
_dbus_handle_login_manager_prepare_for_sleep (LoginManager* self,
                                              GVariant* parameters)
{
	GVariantIter _arguments_iter;
	gboolean start = FALSE;
	GVariant* _tmp50_;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp50_ = g_variant_iter_next_value (&_arguments_iter);
	start = g_variant_get_boolean (_tmp50_);
	g_variant_unref (_tmp50_);
	g_signal_emit_by_name (self, "prepare-for-sleep", start);
}

static void
login_manager_proxy_g_signal (GDBusProxy* proxy,
                              const gchar* sender_name,
                              const gchar* signal_name,
                              GVariant* parameters)
{
	if (strcmp (signal_name, "PrepareForSleep") == 0) {
		_dbus_handle_login_manager_prepare_for_sleep ((LoginManager*) proxy, parameters);
	}
}

static void
login_manager_proxy_init (LoginManagerProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_login_manager_dbus_interface_info));
}

static void
login_manager_proxy_login_manager_interface_init (LoginManagerIface* iface)
{
}

static void
login_manager_dbus_interface_method_call (GDBusConnection* connection,
                                          const gchar* sender,
                                          const gchar* object_path,
                                          const gchar* interface_name,
                                          const gchar* method_name,
                                          GVariant* parameters,
                                          GDBusMethodInvocation* invocation,
                                          gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	g_object_unref (invocation);
}

static GVariant*
login_manager_dbus_interface_get_property (GDBusConnection* connection,
                                           const gchar* sender,
                                           const gchar* object_path,
                                           const gchar* interface_name,
                                           const gchar* property_name,
                                           GError** error,
                                           gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	return NULL;
}

static gboolean
login_manager_dbus_interface_set_property (GDBusConnection* connection,
                                           const gchar* sender,
                                           const gchar* object_path,
                                           const gchar* interface_name,
                                           const gchar* property_name,
                                           GVariant* value,
                                           GError** error,
                                           gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	return FALSE;
}

static void
_dbus_login_manager_prepare_for_sleep (GObject* _sender,
                                       gboolean start,
                                       gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_boolean (start));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.freedesktop.login1.Manager", "PrepareForSleep", _arguments, NULL);
}

guint
login_manager_register_object (gpointer object,
                               GDBusConnection* connection,
                               const gchar* path,
                               GError** error)
{
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = g_object_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_login_manager_dbus_interface_info), &_login_manager_dbus_interface_vtable, data, _login_manager_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "prepare-for-sleep", (GCallback) _dbus_login_manager_prepare_for_sleep, data);
	return result;
}

static void
_login_manager_unregister_object (gpointer user_data)
{
	gpointer* data;
	data = user_data;
	g_signal_handlers_disconnect_by_func (data[0], _dbus_login_manager_prepare_for_sleep, data);
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}

static inline gpointer
greeter_date_time_widget_get_instance_private (GreeterDateTimeWidget* self)
{
	return G_STRUCT_MEMBER_P (self, GreeterDateTimeWidget_private_offset);
}

static void
greeter_date_time_widget_setup_for_sleep_data_free (gpointer _data)
{
	GreeterDateTimeWidgetSetupForSleepData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (GreeterDateTimeWidgetSetupForSleepData, _data_);
}

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

static void
greeter_date_time_widget_setup_for_sleep (GreeterDateTimeWidget* self,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_)
{
	GreeterDateTimeWidgetSetupForSleepData* _data_;
	GreeterDateTimeWidget* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (GreeterDateTimeWidgetSetupForSleepData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, greeter_date_time_widget_setup_for_sleep_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	greeter_date_time_widget_setup_for_sleep_co (_data_);
}

static void
greeter_date_time_widget_setup_for_sleep_finish (GreeterDateTimeWidget* self,
                                                 GAsyncResult* _res_)
{
	GreeterDateTimeWidgetSetupForSleepData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
greeter_date_time_widget_setup_for_sleep_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_)
{
	GreeterDateTimeWidgetSetupForSleepData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	greeter_date_time_widget_setup_for_sleep_co (_data_);
}

static void
___lambda22_ (GreeterDateTimeWidget* self,
              gboolean start)
{
	if (!start) {
		g_source_remove (self->priv->timeout_id);
		greeter_date_time_widget_update_labels (self);
	}
}

static void
____lambda22__login_manager_prepare_for_sleep (LoginManager* _sender,
                                               gboolean start,
                                               gpointer self)
{
	___lambda22_ ((GreeterDateTimeWidget*) self, start);
}

static gboolean
greeter_date_time_widget_setup_for_sleep_co (GreeterDateTimeWidgetSetupForSleepData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_state_ = 1;
		g_async_initable_new_async (TYPE_LOGIN_MANAGER_PROXY, 0, NULL, greeter_date_time_widget_setup_for_sleep_ready, _data_, "g-flags", 0, "g-name", "org.freedesktop.login1", "g-bus-type", G_BUS_TYPE_SYSTEM, "g-object-path", "/org/freedesktop/login1", "g-interface-name", "org.freedesktop.login1.Manager", NULL);
		return FALSE;
		_state_1:
		_data_->_tmp1_ = (LoginManager*) g_async_initable_new_finish ((GAsyncInitable *) _data_->_source_object_, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp0_ = (LoginManager*) _data_->_tmp1_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == G_IO_ERROR) {
				goto __catch0_g_io_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp2_ = _data_->_tmp0_;
		_data_->_tmp0_ = NULL;
		_g_object_unref0 (_data_->self->priv->login_manager);
		_data_->self->priv->login_manager = _data_->_tmp2_;
		_data_->_tmp3_ = _data_->self->priv->login_manager;
		g_signal_connect_object (_data_->_tmp3_, "prepare-for-sleep", (GCallback) ____lambda22__login_manager_prepare_for_sleep, _data_->self, 0);
		_g_object_unref0 (_data_->_tmp0_);
	}
	goto __finally0;
	__catch0_g_io_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp4_ = _data_->e;
		_data_->_tmp5_ = _data_->_tmp4_->message;
		g_warning ("DateTimeWidget.vala:67: %s", _data_->_tmp5_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static gboolean
_greeter_date_time_widget_update_labels_gsource_func (gpointer self)
{
	gboolean result;
	result = greeter_date_time_widget_update_labels ((GreeterDateTimeWidget*) self);
	return result;
}

static gboolean
greeter_date_time_widget_update_labels (GreeterDateTimeWidget* self)
{
	GDateTime* now = NULL;
	GDateTime* _tmp0_;
	GtkLabel* _tmp1_;
	gboolean _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	GtkLabel* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gint delta = 0;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = g_date_time_new_now_local ();
	now = _tmp0_;
	_tmp1_ = self->priv->time_label;
	_tmp2_ = self->priv->_is_24h;
	_tmp3_ = granite_date_time_get_default_time_format (!_tmp2_, FALSE);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_date_time_format (now, _tmp4_);
	_tmp6_ = _tmp5_;
	gtk_label_set_label (_tmp1_, _tmp6_);
	_g_free0 (_tmp6_);
	_g_free0 (_tmp4_);
	_tmp7_ = self->priv->date_label;
	_tmp8_ = granite_date_time_get_default_date_format (TRUE, TRUE, FALSE);
	_tmp9_ = _tmp8_;
	_tmp10_ = g_date_time_format (now, _tmp9_);
	_tmp11_ = _tmp10_;
	gtk_label_set_label (_tmp7_, _tmp11_);
	_g_free0 (_tmp11_);
	_g_free0 (_tmp9_);
	delta = 60 - g_date_time_get_second (now);
	self->priv->timeout_id = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) delta, _greeter_date_time_widget_update_labels_gsource_func, g_object_ref (self), g_object_unref);
	result = G_SOURCE_REMOVE;
	_g_date_time_unref0 (now);
	return result;
}

GreeterDateTimeWidget*
greeter_date_time_widget_construct (GType object_type)
{
	GreeterDateTimeWidget * self = NULL;
	self = (GreeterDateTimeWidget*) g_object_new (object_type, NULL);
	return self;
}

GreeterDateTimeWidget*
greeter_date_time_widget_new (void)
{
	return greeter_date_time_widget_construct (GREETER_TYPE_DATE_TIME_WIDGET);
}

gboolean
greeter_date_time_widget_get_is_24h (GreeterDateTimeWidget* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_24h;
	return result;
}

void
greeter_date_time_widget_set_is_24h (GreeterDateTimeWidget* self,
                                     gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = greeter_date_time_widget_get_is_24h (self);
	if (old_value != value) {
		self->priv->_is_24h = value;
		g_object_notify_by_pspec ((GObject *) self, greeter_date_time_widget_properties[GREETER_DATE_TIME_WIDGET_IS_24H_PROPERTY]);
	}
}

static void
_greeter_date_time_widget___lambda23_ (GreeterDateTimeWidget* self)
{
	g_source_remove (self->priv->timeout_id);
	greeter_date_time_widget_update_labels (self);
}

static void
__greeter_date_time_widget___lambda23__g_object_notify (GObject* _sender,
                                                        GParamSpec* pspec,
                                                        gpointer self)
{
	_greeter_date_time_widget___lambda23_ ((GreeterDateTimeWidget*) self);
}

static GObject *
greeter_date_time_widget_constructor (GType type,
                                      guint n_construct_properties,
                                      GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GreeterDateTimeWidget * self;
	GtkCssProvider* css_provider = NULL;
	GtkCssProvider* _tmp0_;
	GtkCssProvider* _tmp1_;
	GtkLabel* _tmp2_;
	GtkStyleContext* time_label_style_context = NULL;
	GtkLabel* _tmp3_;
	GtkStyleContext* _tmp4_;
	GtkStyleContext* _tmp5_;
	GtkStyleContext* _tmp6_;
	GtkStyleContext* _tmp7_;
	GtkCssProvider* _tmp8_;
	GtkLabel* _tmp9_;
	GtkStyleContext* date_label_style_context = NULL;
	GtkLabel* _tmp10_;
	GtkStyleContext* _tmp11_;
	GtkStyleContext* _tmp12_;
	GtkStyleContext* _tmp13_;
	GtkStyleContext* _tmp14_;
	GtkCssProvider* _tmp15_;
	GtkGrid* grid = NULL;
	GtkGrid* _tmp16_ = NULL;
	GtkGrid* _tmp17_;
	GtkLabel* _tmp18_;
	GtkGrid* _tmp19_;
	GtkLabel* _tmp20_;
	GtkGrid* _tmp21_;
	parent_class = G_OBJECT_CLASS (greeter_date_time_widget_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GREETER_TYPE_DATE_TIME_WIDGET, GreeterDateTimeWidget);
	_tmp0_ = gtk_css_provider_new ();
	css_provider = _tmp0_;
	_tmp1_ = css_provider;
	gtk_css_provider_load_from_resource (_tmp1_, "/io/elementary/greeter/DateTime.css");
	_tmp2_ = (GtkLabel*) gtk_label_new (NULL);
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->time_label);
	self->priv->time_label = _tmp2_;
	_tmp3_ = self->priv->time_label;
	_tmp4_ = gtk_widget_get_style_context ((GtkWidget*) _tmp3_);
	time_label_style_context = _tmp4_;
	_tmp5_ = time_label_style_context;
	gtk_style_context_add_class (_tmp5_, GRANITE_STYLE_CLASS_H2_LABEL);
	_tmp6_ = time_label_style_context;
	gtk_style_context_add_class (_tmp6_, "time");
	_tmp7_ = time_label_style_context;
	_tmp8_ = css_provider;
	gtk_style_context_add_provider (_tmp7_, (GtkStyleProvider*) _tmp8_, (guint) GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
	_tmp9_ = (GtkLabel*) gtk_label_new (NULL);
	g_object_ref_sink (_tmp9_);
	_g_object_unref0 (self->priv->date_label);
	self->priv->date_label = _tmp9_;
	_tmp10_ = self->priv->date_label;
	_tmp11_ = gtk_widget_get_style_context ((GtkWidget*) _tmp10_);
	date_label_style_context = _tmp11_;
	_tmp12_ = date_label_style_context;
	gtk_style_context_add_class (_tmp12_, GRANITE_STYLE_CLASS_H2_LABEL);
	_tmp13_ = date_label_style_context;
	gtk_style_context_add_class (_tmp13_, "date");
	_tmp14_ = date_label_style_context;
	_tmp15_ = css_provider;
	gtk_style_context_add_provider (_tmp14_, (GtkStyleProvider*) _tmp15_, (guint) GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
	_tmp16_ = (GtkGrid*) gtk_grid_new ();
	gtk_orientable_set_orientation ((GtkOrientable*) _tmp16_, GTK_ORIENTATION_VERTICAL);
	g_object_ref_sink (_tmp16_);
	grid = _tmp16_;
	_tmp17_ = grid;
	_tmp18_ = self->priv->time_label;
	gtk_container_add ((GtkContainer*) _tmp17_, (GtkWidget*) _tmp18_);
	_tmp19_ = grid;
	_tmp20_ = self->priv->date_label;
	gtk_container_add ((GtkContainer*) _tmp19_, (GtkWidget*) _tmp20_);
	gtk_revealer_set_transition_type ((GtkRevealer*) self, GTK_REVEALER_TRANSITION_TYPE_CROSSFADE);
	_tmp21_ = grid;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp21_);
	greeter_date_time_widget_update_labels (self);
	g_signal_connect_object ((GObject*) self, "notify::is-24h", (GCallback) __greeter_date_time_widget___lambda23__g_object_notify, self, 0);
	greeter_date_time_widget_setup_for_sleep (self, NULL, NULL);
	_g_object_unref0 (grid);
	_g_object_unref0 (css_provider);
	return obj;
}

static void
greeter_date_time_widget_class_init (GreeterDateTimeWidgetClass * klass,
                                     gpointer klass_data)
{
	greeter_date_time_widget_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GreeterDateTimeWidget_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_greeter_date_time_widget_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_greeter_date_time_widget_set_property;
	G_OBJECT_CLASS (klass)->constructor = greeter_date_time_widget_constructor;
	G_OBJECT_CLASS (klass)->finalize = greeter_date_time_widget_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GREETER_DATE_TIME_WIDGET_IS_24H_PROPERTY, greeter_date_time_widget_properties[GREETER_DATE_TIME_WIDGET_IS_24H_PROPERTY] = g_param_spec_boolean ("is-24h", "is-24h", "is-24h", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
greeter_date_time_widget_instance_init (GreeterDateTimeWidget * self,
                                        gpointer klass)
{
	self->priv = greeter_date_time_widget_get_instance_private (self);
	self->priv->_is_24h = TRUE;
	self->priv->timeout_id = 0U;
}

static void
greeter_date_time_widget_finalize (GObject * obj)
{
	GreeterDateTimeWidget * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GREETER_TYPE_DATE_TIME_WIDGET, GreeterDateTimeWidget);
	_g_object_unref0 (self->priv->time_label);
	_g_object_unref0 (self->priv->date_label);
	_g_object_unref0 (self->priv->login_manager);
	G_OBJECT_CLASS (greeter_date_time_widget_parent_class)->finalize (obj);
}

static GType
greeter_date_time_widget_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GreeterDateTimeWidgetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) greeter_date_time_widget_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GreeterDateTimeWidget), 0, (GInstanceInitFunc) greeter_date_time_widget_instance_init, NULL };
	GType greeter_date_time_widget_type_id;
	greeter_date_time_widget_type_id = g_type_register_static (gtk_revealer_get_type (), "GreeterDateTimeWidget", &g_define_type_info, 0);
	GreeterDateTimeWidget_private_offset = g_type_add_instance_private (greeter_date_time_widget_type_id, sizeof (GreeterDateTimeWidgetPrivate));
	return greeter_date_time_widget_type_id;
}

GType
greeter_date_time_widget_get_type (void)
{
	static volatile gsize greeter_date_time_widget_type_id__once = 0;
	if (g_once_init_enter (&greeter_date_time_widget_type_id__once)) {
		GType greeter_date_time_widget_type_id;
		greeter_date_time_widget_type_id = greeter_date_time_widget_get_type_once ();
		g_once_init_leave (&greeter_date_time_widget_type_id__once, greeter_date_time_widget_type_id);
	}
	return greeter_date_time_widget_type_id__once;
}

static void
_vala_greeter_date_time_widget_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec)
{
	GreeterDateTimeWidget * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GREETER_TYPE_DATE_TIME_WIDGET, GreeterDateTimeWidget);
	switch (property_id) {
		case GREETER_DATE_TIME_WIDGET_IS_24H_PROPERTY:
		g_value_set_boolean (value, greeter_date_time_widget_get_is_24h (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_greeter_date_time_widget_set_property (GObject * object,
                                             guint property_id,
                                             const GValue * value,
                                             GParamSpec * pspec)
{
	GreeterDateTimeWidget * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GREETER_TYPE_DATE_TIME_WIDGET, GreeterDateTimeWidget);
	switch (property_id) {
		case GREETER_DATE_TIME_WIDGET_IS_24H_PROPERTY:
		greeter_date_time_widget_set_is_24h (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

