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

/*
 * Copyright 2018-2023 elementary, Inc. (https://elementary.io)
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

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

#define GREETER_BASE_CARD_ERROR_SHAKE_DURATION 450
#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 GREETER_TYPE_BASE_CARD (greeter_base_card_get_type ())
#define GREETER_BASE_CARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GREETER_TYPE_BASE_CARD, GreeterBaseCard))
#define GREETER_BASE_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GREETER_TYPE_BASE_CARD, GreeterBaseCardClass))
#define GREETER_IS_BASE_CARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GREETER_TYPE_BASE_CARD))
#define GREETER_IS_BASE_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GREETER_TYPE_BASE_CARD))
#define GREETER_BASE_CARD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GREETER_TYPE_BASE_CARD, GreeterBaseCardClass))

typedef struct _GreeterBaseCard GreeterBaseCard;
typedef struct _GreeterBaseCardClass GreeterBaseCardClass;
typedef struct _GreeterBaseCardPrivate GreeterBaseCardPrivate;

#define GREETER_TYPE_MANUAL_CARD (greeter_manual_card_get_type ())
#define GREETER_MANUAL_CARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GREETER_TYPE_MANUAL_CARD, GreeterManualCard))
#define GREETER_MANUAL_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GREETER_TYPE_MANUAL_CARD, GreeterManualCardClass))
#define GREETER_IS_MANUAL_CARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GREETER_TYPE_MANUAL_CARD))
#define GREETER_IS_MANUAL_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GREETER_TYPE_MANUAL_CARD))
#define GREETER_MANUAL_CARD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GREETER_TYPE_MANUAL_CARD, GreeterManualCardClass))

typedef struct _GreeterManualCard GreeterManualCard;
typedef struct _GreeterManualCardClass GreeterManualCardClass;
typedef struct _GreeterManualCardPrivate GreeterManualCardPrivate;

#define GREETER_TYPE_PASSWORD_ENTRY (greeter_password_entry_get_type ())
#define GREETER_PASSWORD_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GREETER_TYPE_PASSWORD_ENTRY, GreeterPasswordEntry))
#define GREETER_PASSWORD_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GREETER_TYPE_PASSWORD_ENTRY, GreeterPasswordEntryClass))
#define GREETER_IS_PASSWORD_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GREETER_TYPE_PASSWORD_ENTRY))
#define GREETER_IS_PASSWORD_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GREETER_TYPE_PASSWORD_ENTRY))
#define GREETER_PASSWORD_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GREETER_TYPE_PASSWORD_ENTRY, GreeterPasswordEntryClass))

typedef struct _GreeterPasswordEntry GreeterPasswordEntry;
typedef struct _GreeterPasswordEntryClass GreeterPasswordEntryClass;
enum  {
	GREETER_MANUAL_CARD_0_PROPERTY,
	GREETER_MANUAL_CARD_NUM_PROPERTIES
};
static GParamSpec* greeter_manual_card_properties[GREETER_MANUAL_CARD_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define GREETER_TYPE_CAPS_LOCK_REVEALER (greeter_caps_lock_revealer_get_type ())
#define GREETER_CAPS_LOCK_REVEALER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GREETER_TYPE_CAPS_LOCK_REVEALER, GreeterCapsLockRevealer))
#define GREETER_CAPS_LOCK_REVEALER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GREETER_TYPE_CAPS_LOCK_REVEALER, GreeterCapsLockRevealerClass))
#define GREETER_IS_CAPS_LOCK_REVEALER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GREETER_TYPE_CAPS_LOCK_REVEALER))
#define GREETER_IS_CAPS_LOCK_REVEALER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GREETER_TYPE_CAPS_LOCK_REVEALER))
#define GREETER_CAPS_LOCK_REVEALER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GREETER_TYPE_CAPS_LOCK_REVEALER, GreeterCapsLockRevealerClass))

typedef struct _GreeterCapsLockRevealer GreeterCapsLockRevealer;
typedef struct _GreeterCapsLockRevealerClass GreeterCapsLockRevealerClass;

#define GREETER_TYPE_SESSION_BUTTON (greeter_session_button_get_type ())
#define GREETER_SESSION_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GREETER_TYPE_SESSION_BUTTON, GreeterSessionButton))
#define GREETER_SESSION_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GREETER_TYPE_SESSION_BUTTON, GreeterSessionButtonClass))
#define GREETER_IS_SESSION_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GREETER_TYPE_SESSION_BUTTON))
#define GREETER_IS_SESSION_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GREETER_TYPE_SESSION_BUTTON))
#define GREETER_SESSION_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GREETER_TYPE_SESSION_BUTTON, GreeterSessionButtonClass))

typedef struct _GreeterSessionButton GreeterSessionButton;
typedef struct _GreeterSessionButtonClass GreeterSessionButtonClass;
enum  {
	GREETER_MANUAL_CARD_DO_CONNECT_USERNAME_SIGNAL,
	GREETER_MANUAL_CARD_NUM_SIGNALS
};
static guint greeter_manual_card_signals[GREETER_MANUAL_CARD_NUM_SIGNALS] = {0};

struct _GreeterBaseCard {
	GtkBin parent_instance;
	GreeterBaseCardPrivate * priv;
};

struct _GreeterBaseCardClass {
	GtkBinClass parent_class;
	void (*wrong_credentials) (GreeterBaseCard* self);
};

struct _GreeterManualCard {
	GreeterBaseCard parent_instance;
	GreeterManualCardPrivate * priv;
};

struct _GreeterManualCardClass {
	GreeterBaseCardClass parent_class;
};

struct _GreeterManualCardPrivate {
	GreeterPasswordEntry* password_entry;
	GtkEntry* username_entry;
	GtkBox* main_box;
};

static gint GreeterManualCard_private_offset;
static gpointer greeter_manual_card_parent_class = NULL;

VALA_EXTERN GType greeter_base_card_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GreeterBaseCard, g_object_unref)
VALA_EXTERN GType greeter_manual_card_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GreeterManualCard, g_object_unref)
VALA_EXTERN GType greeter_password_entry_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GreeterPasswordEntry, g_object_unref)
VALA_EXTERN void greeter_base_card_wrong_credentials (GreeterBaseCard* self);
static void greeter_manual_card_on_login (GreeterManualCard* self);
VALA_EXTERN gboolean greeter_base_card_get_connecting (GreeterBaseCard* self);
VALA_EXTERN void greeter_base_card_set_connecting (GreeterBaseCard* self,
                                       gboolean value);
static void greeter_manual_card_real_wrong_credentials (GreeterBaseCard* base);
static gboolean __lambda17_ (GreeterManualCard* self);
static gboolean ___lambda17__gsource_func (gpointer self);
VALA_EXTERN void greeter_manual_card_ask_password (GreeterManualCard* self);
VALA_EXTERN void greeter_manual_card_wrong_username (GreeterManualCard* self);
static gboolean __lambda18_ (GreeterManualCard* self);
static gboolean ___lambda18__gsource_func (gpointer self);
VALA_EXTERN GreeterManualCard* greeter_manual_card_new (void);
VALA_EXTERN GreeterManualCard* greeter_manual_card_construct (GType object_type);
VALA_EXTERN GreeterBaseCard* greeter_base_card_construct (GType object_type);
static GObject * greeter_manual_card_constructor (GType type,
                                           guint n_construct_properties,
                                           GObjectConstructParam * construct_properties);
VALA_EXTERN GreeterPasswordEntry* greeter_password_entry_new (void);
VALA_EXTERN GreeterPasswordEntry* greeter_password_entry_construct (GType object_type);
VALA_EXTERN GType greeter_caps_lock_revealer_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GreeterCapsLockRevealer, g_object_unref)
VALA_EXTERN GreeterCapsLockRevealer* greeter_caps_lock_revealer_new (void);
VALA_EXTERN GreeterCapsLockRevealer* greeter_caps_lock_revealer_construct (GType object_type);
VALA_EXTERN GType greeter_session_button_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GreeterSessionButton, g_object_unref)
VALA_EXTERN GreeterSessionButton* greeter_session_button_new (void);
VALA_EXTERN GreeterSessionButton* greeter_session_button_construct (GType object_type);
static gboolean _greeter_manual_card___lambda19_ (GreeterManualCard* self);
static gboolean __greeter_manual_card___lambda19__gtk_widget_focus_out_event (GtkWidget* _sender,
                                                                       GdkEventFocus* event,
                                                                       gpointer self);
static void _greeter_manual_card_on_login_gtk_entry_activate (GtkEntry* _sender,
                                                       gpointer self);
static void greeter_manual_card_finalize (GObject * obj);
static GType greeter_manual_card_get_type_once (void);

static inline gpointer
greeter_manual_card_get_instance_private (GreeterManualCard* self)
{
	return G_STRUCT_MEMBER_P (self, GreeterManualCard_private_offset);
}

static void
greeter_manual_card_on_login (GreeterManualCard* self)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	GreeterPasswordEntry* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = greeter_base_card_get_connecting ((GreeterBaseCard*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		return;
	}
	greeter_base_card_set_connecting ((GreeterBaseCard*) self, TRUE);
	_tmp2_ = self->priv->password_entry;
	_tmp3_ = gtk_entry_get_text ((GtkEntry*) _tmp2_);
	_tmp4_ = _tmp3_;
	g_signal_emit_by_name ((GreeterBaseCard*) self, "do-connect", _tmp4_);
}

static gboolean
__lambda17_ (GreeterManualCard* self)
{
	GtkEntry* _tmp0_;
	GtkStyleContext* _tmp1_;
	GreeterPasswordEntry* _tmp2_;
	GtkStyleContext* _tmp3_;
	GtkBox* _tmp4_;
	GtkStyleContext* _tmp5_;
	GtkEntry* _tmp6_;
	gboolean result;
	_tmp0_ = self->priv->username_entry;
	_tmp1_ = gtk_widget_get_style_context ((GtkWidget*) _tmp0_);
	gtk_style_context_remove_class (_tmp1_, GTK_STYLE_CLASS_ERROR);
	_tmp2_ = self->priv->password_entry;
	_tmp3_ = gtk_widget_get_style_context ((GtkWidget*) _tmp2_);
	gtk_style_context_remove_class (_tmp3_, GTK_STYLE_CLASS_ERROR);
	_tmp4_ = self->priv->main_box;
	_tmp5_ = gtk_widget_get_style_context ((GtkWidget*) _tmp4_);
	gtk_style_context_remove_class (_tmp5_, "shake");
	greeter_base_card_set_connecting ((GreeterBaseCard*) self, FALSE);
	_tmp6_ = self->priv->username_entry;
	gtk_entry_grab_focus_without_selecting (_tmp6_);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda17__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda17_ ((GreeterManualCard*) self);
	return result;
}

static void
greeter_manual_card_real_wrong_credentials (GreeterBaseCard* base)
{
	GreeterManualCard * self;
	GreeterPasswordEntry* _tmp0_;
	GtkEntry* _tmp1_;
	GtkStyleContext* _tmp2_;
	GreeterPasswordEntry* _tmp3_;
	GtkStyleContext* _tmp4_;
	GtkBox* _tmp5_;
	GtkStyleContext* _tmp6_;
	self = (GreeterManualCard*) base;
	_tmp0_ = self->priv->password_entry;
	gtk_entry_set_text ((GtkEntry*) _tmp0_, "");
	_tmp1_ = self->priv->username_entry;
	_tmp2_ = gtk_widget_get_style_context ((GtkWidget*) _tmp1_);
	gtk_style_context_add_class (_tmp2_, GTK_STYLE_CLASS_ERROR);
	_tmp3_ = self->priv->password_entry;
	_tmp4_ = gtk_widget_get_style_context ((GtkWidget*) _tmp3_);
	gtk_style_context_add_class (_tmp4_, GTK_STYLE_CLASS_ERROR);
	_tmp5_ = self->priv->main_box;
	_tmp6_ = gtk_widget_get_style_context ((GtkWidget*) _tmp5_);
	gtk_style_context_add_class (_tmp6_, "shake");
	g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) GREETER_BASE_CARD_ERROR_SHAKE_DURATION, ___lambda17__gsource_func, g_object_ref (self), g_object_unref);
}

void
greeter_manual_card_ask_password (GreeterManualCard* self)
{
	GreeterPasswordEntry* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->password_entry;
	gtk_entry_grab_focus_without_selecting ((GtkEntry*) _tmp0_);
}

static gboolean
__lambda18_ (GreeterManualCard* self)
{
	GtkEntry* _tmp0_;
	GtkStyleContext* _tmp1_;
	GtkBox* _tmp2_;
	GtkStyleContext* _tmp3_;
	gboolean result;
	_tmp0_ = self->priv->username_entry;
	_tmp1_ = gtk_widget_get_style_context ((GtkWidget*) _tmp0_);
	gtk_style_context_remove_class (_tmp1_, GTK_STYLE_CLASS_ERROR);
	_tmp2_ = self->priv->main_box;
	_tmp3_ = gtk_widget_get_style_context ((GtkWidget*) _tmp2_);
	gtk_style_context_remove_class (_tmp3_, "shake");
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda18__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda18_ ((GreeterManualCard*) self);
	return result;
}

void
greeter_manual_card_wrong_username (GreeterManualCard* self)
{
	GtkEntry* _tmp0_;
	GtkEntry* _tmp1_;
	GtkEntry* _tmp2_;
	GtkStyleContext* _tmp3_;
	GtkBox* _tmp4_;
	GtkStyleContext* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->username_entry;
	gtk_entry_grab_focus_without_selecting (_tmp0_);
	_tmp1_ = self->priv->username_entry;
	gtk_entry_set_text (_tmp1_, "");
	_tmp2_ = self->priv->username_entry;
	_tmp3_ = gtk_widget_get_style_context ((GtkWidget*) _tmp2_);
	gtk_style_context_add_class (_tmp3_, GTK_STYLE_CLASS_ERROR);
	_tmp4_ = self->priv->main_box;
	_tmp5_ = gtk_widget_get_style_context ((GtkWidget*) _tmp4_);
	gtk_style_context_add_class (_tmp5_, "shake");
	g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) GREETER_BASE_CARD_ERROR_SHAKE_DURATION, ___lambda18__gsource_func, g_object_ref (self), g_object_unref);
}

GreeterManualCard*
greeter_manual_card_construct (GType object_type)
{
	GreeterManualCard * self = NULL;
	self = (GreeterManualCard*) greeter_base_card_construct (object_type);
	return self;
}

GreeterManualCard*
greeter_manual_card_new (void)
{
	return greeter_manual_card_construct (GREETER_TYPE_MANUAL_CARD);
}

static gboolean
_greeter_manual_card___lambda19_ (GreeterManualCard* self)
{
	GtkEntry* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	_tmp0_ = self->priv->username_entry;
	_tmp1_ = gtk_entry_get_text (_tmp0_);
	_tmp2_ = _tmp1_;
	if (g_strcmp0 (_tmp2_, "") != 0) {
		GtkEntry* _tmp3_;
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		_tmp3_ = self->priv->username_entry;
		_tmp4_ = gtk_entry_get_text (_tmp3_);
		_tmp5_ = _tmp4_;
		g_signal_emit (self, greeter_manual_card_signals[GREETER_MANUAL_CARD_DO_CONNECT_USERNAME_SIGNAL], 0, _tmp5_);
	}
}

static gboolean
__greeter_manual_card___lambda19__gtk_widget_focus_out_event (GtkWidget* _sender,
                                                              GdkEventFocus* event,
                                                              gpointer self)
{
	gboolean result;
	result = _greeter_manual_card___lambda19_ ((GreeterManualCard*) self);
	return result;
}

static void
_greeter_manual_card_on_login_gtk_entry_activate (GtkEntry* _sender,
                                                  gpointer self)
{
	greeter_manual_card_on_login ((GreeterManualCard*) self);
}

static GObject *
greeter_manual_card_constructor (GType type,
                                 guint n_construct_properties,
                                 GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GreeterManualCard * self;
	GtkImage* icon = NULL;
	gchar* _tmp0_;
	GtkImage* _tmp1_ = NULL;
	GtkLabel* label = NULL;
	GtkLabel* _tmp2_ = NULL;
	GtkLabel* _tmp3_;
	GtkStyleContext* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	GtkEntry* _tmp7_ = NULL;
	GreeterPasswordEntry* _tmp8_;
	GreeterCapsLockRevealer* caps_lock_revealer = NULL;
	GreeterCapsLockRevealer* _tmp9_;
	GreeterSessionButton* session_button = NULL;
	GreeterSessionButton* _tmp10_;
	GtkGrid* form_grid = NULL;
	GtkGrid* _tmp11_ = NULL;
	GtkGrid* _tmp12_;
	GtkImage* _tmp13_;
	GtkGrid* _tmp14_;
	GtkLabel* _tmp15_;
	GtkGrid* _tmp16_;
	GtkEntry* _tmp17_;
	GtkGrid* _tmp18_;
	GreeterPasswordEntry* _tmp19_;
	GtkGrid* _tmp20_;
	GreeterSessionButton* _tmp21_;
	GtkGrid* _tmp22_;
	GreeterCapsLockRevealer* _tmp23_;
	GtkBox* _tmp24_ = NULL;
	GtkBox* _tmp25_;
	GtkGrid* _tmp26_;
	GtkBox* _tmp27_;
	GtkStyleContext* _tmp28_;
	GtkBox* _tmp29_;
	GtkStyleContext* _tmp30_;
	GtkBox* _tmp31_;
	GtkEntry* _tmp32_;
	GreeterPasswordEntry* _tmp33_;
	GtkEntry* _tmp34_;
	GreeterPasswordEntry* _tmp35_;
	parent_class = G_OBJECT_CLASS (greeter_manual_card_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GREETER_TYPE_MANUAL_CARD, GreeterManualCard);
	g_object_set ((GtkWidget*) self, "width-request", 350, NULL);
	_tmp0_ = g_strdup ("avatar-default");
	_tmp1_ = (GtkImage*) gtk_image_new ();
	g_object_set (_tmp1_, "icon-name", _tmp0_, NULL);
	_g_free0 (_tmp0_);
	gtk_image_set_pixel_size (_tmp1_, 64);
	g_object_ref_sink (_tmp1_);
	icon = _tmp1_;
	_tmp2_ = (GtkLabel*) gtk_label_new (_ ("Manual Login"));
	gtk_widget_set_hexpand ((GtkWidget*) _tmp2_, TRUE);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp2_, 16);
	g_object_ref_sink (_tmp2_);
	label = _tmp2_;
	_tmp3_ = label;
	_tmp4_ = gtk_widget_get_style_context ((GtkWidget*) _tmp3_);
	gtk_style_context_add_class (_tmp4_, GRANITE_STYLE_CLASS_H2_LABEL);
	_tmp5_ = g_strdup (_ ("Username"));
	_tmp6_ = g_strdup ("avatar-default-symbolic");
	_tmp7_ = (GtkEntry*) gtk_entry_new ();
	gtk_widget_set_hexpand ((GtkWidget*) _tmp7_, TRUE);
	gtk_entry_set_input_purpose (_tmp7_, GTK_INPUT_PURPOSE_FREE_FORM);
	gtk_entry_set_placeholder_text (_tmp7_, _tmp5_);
	_g_free0 (_tmp5_);
	g_object_set (_tmp7_, "primary-icon-name", _tmp6_, NULL);
	_g_free0 (_tmp6_);
	g_object_ref_sink (_tmp7_);
	_g_object_unref0 (self->priv->username_entry);
	self->priv->username_entry = _tmp7_;
	_tmp8_ = greeter_password_entry_new ();
	g_object_ref_sink (_tmp8_);
	_g_object_unref0 (self->priv->password_entry);
	self->priv->password_entry = _tmp8_;
	_tmp9_ = greeter_caps_lock_revealer_new ();
	g_object_ref_sink (_tmp9_);
	caps_lock_revealer = _tmp9_;
	_tmp10_ = greeter_session_button_new ();
	g_object_ref_sink (_tmp10_);
	session_button = _tmp10_;
	_tmp11_ = (GtkGrid*) gtk_grid_new ();
	gtk_grid_set_column_spacing (_tmp11_, 6);
	gtk_grid_set_row_spacing (_tmp11_, 12);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp11_, 24);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp11_, 24);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp11_, 24);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp11_, 24);
	g_object_ref_sink (_tmp11_);
	form_grid = _tmp11_;
	_tmp12_ = form_grid;
	_tmp13_ = icon;
	gtk_grid_attach (_tmp12_, (GtkWidget*) _tmp13_, 0, 0, 2, 1);
	_tmp14_ = form_grid;
	_tmp15_ = label;
	gtk_grid_attach (_tmp14_, (GtkWidget*) _tmp15_, 0, 1, 2, 1);
	_tmp16_ = form_grid;
	_tmp17_ = self->priv->username_entry;
	gtk_grid_attach (_tmp16_, (GtkWidget*) _tmp17_, 0, 2, 1, 1);
	_tmp18_ = form_grid;
	_tmp19_ = self->priv->password_entry;
	gtk_grid_attach (_tmp18_, (GtkWidget*) _tmp19_, 0, 3, 1, 1);
	_tmp20_ = form_grid;
	_tmp21_ = session_button;
	gtk_grid_attach (_tmp20_, (GtkWidget*) _tmp21_, 1, 2, 1, 2);
	_tmp22_ = form_grid;
	_tmp23_ = caps_lock_revealer;
	gtk_grid_attach (_tmp22_, (GtkWidget*) _tmp23_, 0, 4, 2, 1);
	_tmp24_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp24_, 12);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp24_, 12);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp24_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp24_, 12);
	g_object_ref_sink (_tmp24_);
	_g_object_unref0 (self->priv->main_box);
	self->priv->main_box = _tmp24_;
	_tmp25_ = self->priv->main_box;
	_tmp26_ = form_grid;
	gtk_container_add ((GtkContainer*) _tmp25_, (GtkWidget*) _tmp26_);
	_tmp27_ = self->priv->main_box;
	_tmp28_ = gtk_widget_get_style_context ((GtkWidget*) _tmp27_);
	gtk_style_context_add_class (_tmp28_, GRANITE_STYLE_CLASS_CARD);
	_tmp29_ = self->priv->main_box;
	_tmp30_ = gtk_widget_get_style_context ((GtkWidget*) _tmp29_);
	gtk_style_context_add_class (_tmp30_, GRANITE_STYLE_CLASS_ROUNDED);
	_tmp31_ = self->priv->main_box;
	g_object_set ((GtkContainer*) self, "child", (GtkWidget*) _tmp31_, NULL);
	_tmp32_ = self->priv->username_entry;
	g_object_bind_property_with_closures ((GObject*) self, "connecting", (GObject*) _tmp32_, "sensitive", G_BINDING_INVERT_BOOLEAN, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp33_ = self->priv->password_entry;
	g_object_bind_property_with_closures ((GObject*) self, "connecting", (GObject*) _tmp33_, "sensitive", G_BINDING_INVERT_BOOLEAN, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp34_ = self->priv->username_entry;
	g_signal_connect_object ((GtkWidget*) _tmp34_, "focus-out-event", (GCallback) __greeter_manual_card___lambda19__gtk_widget_focus_out_event, self, 0);
	_tmp35_ = self->priv->password_entry;
	g_signal_connect_object ((GtkEntry*) _tmp35_, "activate", (GCallback) _greeter_manual_card_on_login_gtk_entry_activate, self, 0);
	_g_object_unref0 (form_grid);
	_g_object_unref0 (session_button);
	_g_object_unref0 (caps_lock_revealer);
	_g_object_unref0 (label);
	_g_object_unref0 (icon);
	return obj;
}

static void
greeter_manual_card_class_init (GreeterManualCardClass * klass,
                                gpointer klass_data)
{
	greeter_manual_card_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GreeterManualCard_private_offset);
	((GreeterBaseCardClass *) klass)->wrong_credentials = (void (*) (GreeterBaseCard*)) greeter_manual_card_real_wrong_credentials;
	G_OBJECT_CLASS (klass)->constructor = greeter_manual_card_constructor;
	G_OBJECT_CLASS (klass)->finalize = greeter_manual_card_finalize;
	greeter_manual_card_signals[GREETER_MANUAL_CARD_DO_CONNECT_USERNAME_SIGNAL] = g_signal_new ("do-connect-username", GREETER_TYPE_MANUAL_CARD, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
}

static void
greeter_manual_card_instance_init (GreeterManualCard * self,
                                   gpointer klass)
{
	self->priv = greeter_manual_card_get_instance_private (self);
}

static void
greeter_manual_card_finalize (GObject * obj)
{
	GreeterManualCard * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GREETER_TYPE_MANUAL_CARD, GreeterManualCard);
	_g_object_unref0 (self->priv->password_entry);
	_g_object_unref0 (self->priv->username_entry);
	_g_object_unref0 (self->priv->main_box);
	G_OBJECT_CLASS (greeter_manual_card_parent_class)->finalize (obj);
}

static GType
greeter_manual_card_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GreeterManualCardClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) greeter_manual_card_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GreeterManualCard), 0, (GInstanceInitFunc) greeter_manual_card_instance_init, NULL };
	GType greeter_manual_card_type_id;
	greeter_manual_card_type_id = g_type_register_static (GREETER_TYPE_BASE_CARD, "GreeterManualCard", &g_define_type_info, 0);
	GreeterManualCard_private_offset = g_type_add_instance_private (greeter_manual_card_type_id, sizeof (GreeterManualCardPrivate));
	return greeter_manual_card_type_id;
}

GType
greeter_manual_card_get_type (void)
{
	static volatile gsize greeter_manual_card_type_id__once = 0;
	if (g_once_init_enter (&greeter_manual_card_type_id__once)) {
		GType greeter_manual_card_type_id;
		greeter_manual_card_type_id = greeter_manual_card_get_type_once ();
		g_once_init_leave (&greeter_manual_card_type_id__once, greeter_manual_card_type_id);
	}
	return greeter_manual_card_type_id__once;
}

