/* contacts-contact-pane.c generated by valac 0.22.1, the Vala compiler
 * generated from contacts-contact-pane.vala, do not modify */

/* -*- Mode: vala; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 8 -*- */
/*
 * Copyright (C) 2011 Alexander Larsson <alexl@redhat.com>
 *
 * 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, see <http://www.gnu.org/licenses/>.
 */

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <folks/folks.h>
#include <float.h>
#include <math.h>
#include <gee.h>
#include <cairo.h>
#include <glib/gi18n-lib.h>
#include <pango/pango.h>
#include <gdk/gdk.h>


#define CONTACTS_TYPE_CONTACT (contacts_contact_get_type ())
#define CONTACTS_CONTACT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_CONTACT, ContactsContact))
#define CONTACTS_CONTACT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_CONTACT, ContactsContactClass))
#define CONTACTS_IS_CONTACT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_CONTACT))
#define CONTACTS_IS_CONTACT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_CONTACT))
#define CONTACTS_CONTACT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_CONTACT, ContactsContactClass))

typedef struct _ContactsContact ContactsContact;
typedef struct _ContactsContactClass ContactsContactClass;

#define CONTACTS_TYPE_CONTACT_FRAME (contacts_contact_frame_get_type ())
#define CONTACTS_CONTACT_FRAME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_CONTACT_FRAME, ContactsContactFrame))
#define CONTACTS_CONTACT_FRAME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_CONTACT_FRAME, ContactsContactFrameClass))
#define CONTACTS_IS_CONTACT_FRAME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_CONTACT_FRAME))
#define CONTACTS_IS_CONTACT_FRAME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_CONTACT_FRAME))
#define CONTACTS_CONTACT_FRAME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_CONTACT_FRAME, ContactsContactFrameClass))

typedef struct _ContactsContactFrame ContactsContactFrame;
typedef struct _ContactsContactFrameClass ContactsContactFrameClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block27Data Block27Data;

#define CONTACTS_TYPE_AVATAR_DIALOG (contacts_avatar_dialog_get_type ())
#define CONTACTS_AVATAR_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_AVATAR_DIALOG, ContactsAvatarDialog))
#define CONTACTS_AVATAR_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_AVATAR_DIALOG, ContactsAvatarDialogClass))
#define CONTACTS_IS_AVATAR_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_AVATAR_DIALOG))
#define CONTACTS_IS_AVATAR_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_AVATAR_DIALOG))
#define CONTACTS_AVATAR_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_AVATAR_DIALOG, ContactsAvatarDialogClass))

typedef struct _ContactsAvatarDialog ContactsAvatarDialog;
typedef struct _ContactsAvatarDialogClass ContactsAvatarDialogClass;

#define CONTACTS_TYPE_APP (contacts_app_get_type ())
#define CONTACTS_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_APP, ContactsApp))
#define CONTACTS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_APP, ContactsAppClass))
#define CONTACTS_IS_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_APP))
#define CONTACTS_IS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_APP))
#define CONTACTS_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_APP, ContactsAppClass))

typedef struct _ContactsApp ContactsApp;
typedef struct _ContactsAppClass ContactsAppClass;
typedef struct _ContactsContactPrivate ContactsContactPrivate;

#define CONTACTS_TYPE_STORE (contacts_store_get_type ())
#define CONTACTS_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_STORE, ContactsStore))
#define CONTACTS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_STORE, ContactsStoreClass))
#define CONTACTS_IS_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_STORE))
#define CONTACTS_IS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_STORE))
#define CONTACTS_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_STORE, ContactsStoreClass))

typedef struct _ContactsStore ContactsStore;
typedef struct _ContactsStoreClass ContactsStoreClass;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define TYPE_CENTER (center_get_type ())
#define CENTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CENTER, Center))
#define CENTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CENTER, CenterClass))
#define IS_CENTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CENTER))
#define IS_CENTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CENTER))
#define CENTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CENTER, CenterClass))

typedef struct _Center Center;
typedef struct _CenterClass CenterClass;
typedef struct _CenterPrivate CenterPrivate;

#define CONTACTS_TYPE_CONTACT_PANE (contacts_contact_pane_get_type ())
#define CONTACTS_CONTACT_PANE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_CONTACT_PANE, ContactsContactPane))
#define CONTACTS_CONTACT_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_CONTACT_PANE, ContactsContactPaneClass))
#define CONTACTS_IS_CONTACT_PANE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_CONTACT_PANE))
#define CONTACTS_IS_CONTACT_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_CONTACT_PANE))
#define CONTACTS_CONTACT_PANE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_CONTACT_PANE, ContactsContactPaneClass))

typedef struct _ContactsContactPane ContactsContactPane;
typedef struct _ContactsContactPaneClass ContactsContactPaneClass;
typedef struct _ContactsContactPanePrivate ContactsContactPanePrivate;

#define CONTACTS_TYPE_CONTACT_SHEET (contacts_contact_sheet_get_type ())
#define CONTACTS_CONTACT_SHEET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_CONTACT_SHEET, ContactsContactSheet))
#define CONTACTS_CONTACT_SHEET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_CONTACT_SHEET, ContactsContactSheetClass))
#define CONTACTS_IS_CONTACT_SHEET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_CONTACT_SHEET))
#define CONTACTS_IS_CONTACT_SHEET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_CONTACT_SHEET))
#define CONTACTS_CONTACT_SHEET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_CONTACT_SHEET, ContactsContactSheetClass))

typedef struct _ContactsContactSheet ContactsContactSheet;
typedef struct _ContactsContactSheetClass ContactsContactSheetClass;

#define CONTACTS_TYPE_CONTACT_EDITOR (contacts_contact_editor_get_type ())
#define CONTACTS_CONTACT_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_CONTACT_EDITOR, ContactsContactEditor))
#define CONTACTS_CONTACT_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_CONTACT_EDITOR, ContactsContactEditorClass))
#define CONTACTS_IS_CONTACT_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_CONTACT_EDITOR))
#define CONTACTS_IS_CONTACT_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_CONTACT_EDITOR))
#define CONTACTS_CONTACT_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_CONTACT_EDITOR, ContactsContactEditorClass))

typedef struct _ContactsContactEditor ContactsContactEditor;
typedef struct _ContactsContactEditorClass ContactsContactEditorClass;
typedef struct _Block28Data Block28Data;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block29Data Block29Data;

#define CONTACTS_TYPE_LINK_OPERATION (contacts_link_operation_get_type ())
#define CONTACTS_LINK_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_LINK_OPERATION, ContactsLinkOperation))
#define CONTACTS_LINK_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_LINK_OPERATION, ContactsLinkOperationClass))
#define CONTACTS_IS_LINK_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_LINK_OPERATION))
#define CONTACTS_IS_LINK_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_LINK_OPERATION))
#define CONTACTS_LINK_OPERATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_LINK_OPERATION, ContactsLinkOperationClass))

typedef struct _ContactsLinkOperation ContactsLinkOperation;
typedef struct _ContactsLinkOperationClass ContactsLinkOperationClass;

#define CONTACTS_TYPE_LINKED_ACCOUNTS_DIALOG (contacts_linked_accounts_dialog_get_type ())
#define CONTACTS_LINKED_ACCOUNTS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_LINKED_ACCOUNTS_DIALOG, ContactsLinkedAccountsDialog))
#define CONTACTS_LINKED_ACCOUNTS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_LINKED_ACCOUNTS_DIALOG, ContactsLinkedAccountsDialogClass))
#define CONTACTS_IS_LINKED_ACCOUNTS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_LINKED_ACCOUNTS_DIALOG))
#define CONTACTS_IS_LINKED_ACCOUNTS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_LINKED_ACCOUNTS_DIALOG))
#define CONTACTS_LINKED_ACCOUNTS_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_LINKED_ACCOUNTS_DIALOG, ContactsLinkedAccountsDialogClass))

typedef struct _ContactsLinkedAccountsDialog ContactsLinkedAccountsDialog;
typedef struct _ContactsLinkedAccountsDialogClass ContactsLinkedAccountsDialogClass;
typedef struct _ContactsLinkedAccountsDialogPrivate ContactsLinkedAccountsDialogPrivate;

#define CONTACTS_CONTACT_EDITOR_TYPE_PROPERTY_DATA (contacts_contact_editor_property_data_get_type ())
typedef struct _ContactsContactEditorPropertyData ContactsContactEditorPropertyData;

struct _Block27Data {
	int _ref_count_;
	ContactsContact* contact;
	ContactsContactFrame* image_frame;
};

struct _ContactsContact {
	GObject parent_instance;
	ContactsContactPrivate * priv;
	ContactsStore* store;
	gboolean is_main;
	FolksPresenceType presence_type;
	gchar* presence_message;
	gboolean is_phone;
	FolksIndividual* individual;
};

struct _ContactsContactClass {
	GObjectClass parent_class;
};

struct _Center {
	GtkBin parent_instance;
	CenterPrivate * priv;
};

struct _CenterClass {
	GtkBinClass parent_class;
};

struct _CenterPrivate {
	gint _max_width;
	gdouble _xalign;
};

struct _ContactsContactPane {
	GtkNotebook parent_instance;
	ContactsContactPanePrivate * priv;
	ContactsContact* contact;
	gboolean on_edit_mode;
	GtkGrid* suggestion_grid;
};

struct _ContactsContactPaneClass {
	GtkNotebookClass parent_class;
};

struct _ContactsContactPanePrivate {
	ContactsStore* contacts_store;
	GtkFrame* no_selection_frame;
	ContactsContactSheet* sheet;
	ContactsContactEditor* editor;
	GtkButton* linked_button;
	GtkButton* remove_button;
	GtkMenuItem* nickname_item;
	GtkMenuItem* birthday_item;
	GtkMenuItem* notes_item;
};

struct _Block28Data {
	int _ref_count_;
	ContactsContactPane * self;
	ContactsContact* c;
};

struct _Block29Data {
	int _ref_count_;
	Block28Data * _data28_;
	gchar* linked_contact;
};

struct _ContactsLinkedAccountsDialog {
	GtkDialog parent_instance;
	ContactsLinkedAccountsDialogPrivate * priv;
	gboolean any_unlinked;
};

struct _ContactsLinkedAccountsDialogClass {
	GtkDialogClass parent_class;
};

struct _ContactsContactEditorPropertyData {
	FolksPersona* persona;
	GValue value;
};

typedef enum  {
	CONTACT_ERROR_NOT_IMPLEMENTED,
	CONTACT_ERROR_NO_PRIMARY
} ContactError;
#define CONTACT_ERROR contact_error_quark ()

extern ContactsApp* contacts_app_app;
static gpointer center_parent_class = NULL;
static gpointer contacts_contact_pane_parent_class = NULL;

#define PROFILE_SIZE 96
GType contacts_contact_get_type (void) G_GNUC_CONST;
GType contacts_contact_frame_get_type (void) G_GNUC_CONST;
void contacts_change_avatar (ContactsContact* contact, ContactsContactFrame* image_frame);
static Block27Data* block27_data_ref (Block27Data* _data27_);
static void block27_data_unref (void * _userdata_);
GType contacts_avatar_dialog_get_type (void) G_GNUC_CONST;
ContactsAvatarDialog* contacts_avatar_dialog_new (ContactsContact* contact);
ContactsAvatarDialog* contacts_avatar_dialog_construct (GType object_type, ContactsContact* contact);
static void __lambda70_ (Block27Data* _data27_, GIcon* icon);
void contacts_contact_set_individual_property (ContactsContact* contact, const gchar* property_name, GValue* value, GAsyncReadyCallback _callback_, gpointer _user_data_);
FolksPersona* contacts_contact_set_individual_property_finish (GAsyncResult* _res_, GError** error);
static void __lambda71_ (Block27Data* _data27_, GObject* obj, GAsyncResult* _result_);
GType contacts_app_get_type (void) G_GNUC_CONST;
void contacts_app_show_message (ContactsApp* self, const gchar* message);
void contacts_contact_frame_set_image (ContactsContactFrame* self, FolksAvatarDetails* details, ContactsContact* contact);
GType contacts_store_get_type (void) G_GNUC_CONST;
static void ___lambda71__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static void ___lambda70__contacts_avatar_dialog_set_avatar (ContactsAvatarDialog* _sender, GIcon* avatar_icon, gpointer self);
GType center_get_type (void) G_GNUC_CONST;
#define CENTER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_CENTER, CenterPrivate))
enum  {
	CENTER_DUMMY_PROPERTY,
	CENTER_MAX_WIDTH,
	CENTER_XALIGN
};
Center* center_new (void);
Center* center_construct (GType object_type);
void center_set_xalign (Center* self, gdouble value);
static void center_real_get_preferred_height (GtkWidget* base, gint* minimum_height, gint* natural_height);
static void center_real_get_preferred_width (GtkWidget* base, gint* minimum_width, gint* natural_width);
static void center_real_size_allocate (GtkWidget* base, GtkAllocation* allocation);
gint center_get_max_width (Center* self);
gdouble center_get_xalign (Center* self);
void center_set_max_width (Center* self, gint value);
static void center_finalize (GObject* obj);
static void _vala_center_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_center_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
GType contacts_contact_pane_get_type (void) G_GNUC_CONST;
GType contacts_contact_sheet_get_type (void) G_GNUC_CONST;
GType contacts_contact_editor_get_type (void) G_GNUC_CONST;
#define CONTACTS_CONTACT_PANE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CONTACTS_TYPE_CONTACT_PANE, ContactsContactPanePrivate))
enum  {
	CONTACTS_CONTACT_PANE_DUMMY_PROPERTY
};
void contacts_contact_pane_update_sheet (ContactsContactPane* self, gboolean show_matches);
void contacts_contact_sheet_clear (ContactsContactSheet* self);
void contacts_contact_sheet_update (ContactsContactSheet* self, ContactsContact* c);
FolksIndividualAggregator* contacts_store_get_aggregator (ContactsStore* self);
ContactsContact* contacts_contact_from_individual (FolksIndividual* i);
gboolean contacts_contact_suggest_link_to (ContactsContact* self, ContactsContact* other);
void contacts_contact_pane_add_suggestion (ContactsContactPane* self, ContactsContact* c);
static Block28Data* block28_data_ref (Block28Data* _data28_);
static void block28_data_unref (void * _userdata_);
static gboolean __lambda74_ (ContactsContactPane* self, cairo_t* cr);
static gboolean ___lambda74__gtk_widget_draw (GtkWidget* _sender, cairo_t* cr, gpointer self);
#define CONTACTS_CONTACT_SMALL_AVATAR_SIZE 54
ContactsContactFrame* contacts_contact_frame_new (gint size, gboolean with_button);
ContactsContactFrame* contacts_contact_frame_construct (GType object_type, gint size, gboolean with_button);
void contacts_contact_keep_widget_uptodate (ContactsContact* self, GtkWidget* w, GtkCallback callback, void* callback_target, GDestroyNotify callback_target_destroy_notify);
static void __lambda75_ (Block28Data* _data28_, GtkWidget* w);
static void ___lambda75__gtk_callback (GtkWidget* widget, gpointer self);
const gchar* contacts_contact_get_display_name (ContactsContact* self);
gchar* contacts_contact_format_persona_stores (ContactsContact* self);
static void __lambda76_ (Block28Data* _data28_);
static Block29Data* block29_data_ref (Block29Data* _data29_);
static void block29_data_unref (void * _userdata_);
void contacts_link_contacts (ContactsContact* main, ContactsContact* other, GAsyncReadyCallback _callback_, gpointer _user_data_);
GType contacts_link_operation_get_type (void) G_GNUC_CONST;
ContactsLinkOperation* contacts_link_contacts_finish (GAsyncResult* _res_);
static void __lambda77_ (Block29Data* _data29_, GObject* obj, GAsyncResult* _result_);
static void ___lambda77__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static void ___lambda76__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void __lambda78_ (Block28Data* _data28_);
void contacts_store_add_no_suggest_link (ContactsStore* self, ContactsContact* a, ContactsContact* b);
static void ___lambda78__gtk_button_clicked (GtkButton* _sender, gpointer self);
void contacts_contact_pane_show_contact (ContactsContactPane* self, ContactsContact* new_contact, gboolean edit, gboolean show_matches);
static void contacts_contact_pane_personas_changed_cb (ContactsContactPane* self, ContactsContact* contact);
static void _contacts_contact_pane_personas_changed_cb_contacts_contact_personas_changed (ContactsContact* _sender, gpointer self);
static void contacts_contact_pane_contact_changed_cb (ContactsContactPane* self, ContactsContact* contact);
static void _contacts_contact_pane_contact_changed_cb_contacts_contact_changed (ContactsContact* _sender, gpointer self);
gboolean contacts_contact_can_remove_personas (ContactsContact* self);
static void contacts_contact_pane_show_no_selection_frame (ContactsContactPane* self);
ContactsContactPane* contacts_contact_pane_new (ContactsStore* contacts_store);
ContactsContactPane* contacts_contact_pane_construct (GType object_type, ContactsStore* contacts_store);
ContactsContactSheet* contacts_contact_sheet_new (void);
ContactsContactSheet* contacts_contact_sheet_construct (GType object_type);
static void __lambda79_ (ContactsContactPane* self);
static void ___lambda79__contacts_store_quiescent (ContactsStore* _sender, gpointer self);
ContactsContactEditor* contacts_contact_editor_new (void);
ContactsContactEditor* contacts_contact_editor_construct (GType object_type);
static void __lambda80_ (ContactsContactPane* self);
void contacts_contact_editor_add_new_row_for_property (ContactsContactEditor* self, FolksPersona* p, const gchar* prop_name, const gchar* type);
FolksPersona* contacts_contact_find_primary_persona (ContactsContact* self);
static void ___lambda80__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
static void __lambda81_ (ContactsContactPane* self);
static void ___lambda81__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
static void __lambda82_ (ContactsContactPane* self);
static void ___lambda82__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
static void __lambda83_ (ContactsContactPane* self);
static void ___lambda83__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
static void __lambda84_ (ContactsContactPane* self);
static void ___lambda84__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
static void __lambda85_ (ContactsContactPane* self);
static void ___lambda85__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
static void __lambda86_ (ContactsContactPane* self);
static void ___lambda86__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
static void __lambda87_ (ContactsContactPane* self);
static void ___lambda87__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
static void __lambda88_ (ContactsContactPane* self);
static void ___lambda88__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
static void __lambda89_ (ContactsContactPane* self);
static void ___lambda89__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
static void __lambda90_ (ContactsContactPane* self);
static void ___lambda90__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
static void contacts_contact_pane_linked_accounts (ContactsContactPane* self);
static void _contacts_contact_pane_linked_accounts_gtk_button_clicked (GtkButton* _sender, gpointer self);
static void contacts_contact_pane_delete_contact (ContactsContactPane* self);
static void _contacts_contact_pane_delete_contact_gtk_button_clicked (GtkButton* _sender, gpointer self);
GType contacts_linked_accounts_dialog_get_type (void) G_GNUC_CONST;
ContactsLinkedAccountsDialog* contacts_linked_accounts_dialog_new (ContactsContact* contact);
ContactsLinkedAccountsDialog* contacts_linked_accounts_dialog_construct (GType object_type, ContactsContact* contact);
void contacts_contact_pane_set_edit_mode (ContactsContactPane* self, gboolean on_edit);
void contacts_contact_hide (ContactsContact* self);
gboolean contacts_contact_has_birthday (ContactsContact* self);
gboolean contacts_contact_has_nickname (ContactsContact* self);
gboolean contacts_contact_has_notes (ContactsContact* self);
void contacts_contact_editor_clear (ContactsContactEditor* self);
void contacts_contact_editor_update (ContactsContactEditor* self, ContactsContact* c);
GType contacts_contact_editor_property_data_get_type (void) G_GNUC_CONST;
ContactsContactEditorPropertyData* contacts_contact_editor_property_data_dup (const ContactsContactEditorPropertyData* self);
void contacts_contact_editor_property_data_free (ContactsContactEditorPropertyData* self);
void contacts_contact_editor_property_data_copy (const ContactsContactEditorPropertyData* self, ContactsContactEditorPropertyData* dest);
void contacts_contact_editor_property_data_destroy (ContactsContactEditorPropertyData* self);
GeeHashMap* contacts_contact_editor_properties_changed (ContactsContactEditor* self);
void contacts_contact_set_persona_property (FolksPersona* persona, const gchar* property_name, GValue* new_value, GAsyncReadyCallback _callback_, gpointer _user_data_);
GQuark contact_error_quark (void);
void contacts_contact_set_persona_property_finish (GAsyncResult* _res_, GError** error);
static void _____lambda94_ (ContactsContactPane* self, GObject* obj, GAsyncResult* _result_);
static void ______lambda94__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
gboolean contacts_contact_editor_name_changed (ContactsContactEditor* self);
void contacts_contact_editor_get_full_name_value (ContactsContactEditor* self, GValue* result);
static void ____lambda95_ (ContactsContactPane* self, GObject* obj, GAsyncResult* _result_);
static void _____lambda95__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static void g_cclosure_user_marshal_VOID__STRING_STRING_OBJECT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
static void contacts_contact_pane_finalize (GObject* obj);


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


static Block27Data* block27_data_ref (Block27Data* _data27_) {
	g_atomic_int_inc (&_data27_->_ref_count_);
	return _data27_;
}


static void block27_data_unref (void * _userdata_) {
	Block27Data* _data27_;
	_data27_ = (Block27Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data27_->_ref_count_)) {
		_g_object_unref0 (_data27_->contact);
		_g_object_unref0 (_data27_->image_frame);
		g_slice_free (Block27Data, _data27_);
	}
}


static void __lambda71_ (Block27Data* _data27_, GObject* obj, GAsyncResult* _result_) {
	GError * _inner_error_ = NULL;
	g_return_if_fail (_result_ != NULL);
	{
		GAsyncResult* _tmp0_ = NULL;
		FolksPersona* _tmp1_ = NULL;
		FolksPersona* _tmp2_ = NULL;
		_tmp0_ = _result_;
		_tmp1_ = contacts_contact_set_individual_property_finish (_tmp0_, &_inner_error_);
		_tmp2_ = _tmp1_;
		_g_object_unref0 (_tmp2_);
		if (_inner_error_ != NULL) {
			goto __catch5_g_error;
		}
	}
	goto __finally5;
	__catch5_g_error:
	{
		GError* e = NULL;
		ContactsApp* _tmp3_ = NULL;
		GError* _tmp4_ = NULL;
		const gchar* _tmp5_ = NULL;
		ContactsContactFrame* _tmp6_ = NULL;
		ContactsContact* _tmp7_ = NULL;
		FolksIndividual* _tmp8_ = NULL;
		ContactsContact* _tmp9_ = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp3_ = contacts_app_app;
		_tmp4_ = e;
		_tmp5_ = _tmp4_->message;
		contacts_app_show_message (_tmp3_, _tmp5_);
		_tmp6_ = _data27_->image_frame;
		_tmp7_ = _data27_->contact;
		_tmp8_ = _tmp7_->individual;
		_tmp9_ = _data27_->contact;
		contacts_contact_frame_set_image (_tmp6_, (FolksAvatarDetails*) _tmp8_, _tmp9_);
		_g_error_free0 (e);
	}
	__finally5:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
}


static void ___lambda71__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	__lambda71_ (self, source_object, res);
	block27_data_unref (self);
}


static void __lambda70_ (Block27Data* _data27_, GIcon* icon) {
	GValue v = {0};
	GIcon* _tmp0_ = NULL;
	GType _tmp1_ = 0UL;
	GValue _tmp2_ = {0};
	GIcon* _tmp3_ = NULL;
	ContactsContact* _tmp4_ = NULL;
	GValue _tmp5_ = {0};
	g_return_if_fail (icon != NULL);
	_tmp0_ = icon;
	_tmp1_ = G_TYPE_FROM_INSTANCE ((GObject*) _tmp0_);
	g_value_init (&_tmp2_, _tmp1_);
	v = _tmp2_;
	_tmp3_ = icon;
	g_value_set_object (&v, (GObject*) _tmp3_);
	_tmp4_ = _data27_->contact;
	_tmp5_ = v;
	contacts_contact_set_individual_property (_tmp4_, "avatar", &_tmp5_, ___lambda71__gasync_ready_callback, block27_data_ref (_data27_));
	G_IS_VALUE (&v) ? (g_value_unset (&v), NULL) : NULL;
}


static void ___lambda70__contacts_avatar_dialog_set_avatar (ContactsAvatarDialog* _sender, GIcon* avatar_icon, gpointer self) {
	__lambda70_ (self, avatar_icon);
}


void contacts_change_avatar (ContactsContact* contact, ContactsContactFrame* image_frame) {
	Block27Data* _data27_;
	ContactsContact* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	ContactsContactFrame* _tmp2_ = NULL;
	ContactsContactFrame* _tmp3_ = NULL;
	ContactsAvatarDialog* dialog = NULL;
	ContactsContact* _tmp4_ = NULL;
	ContactsAvatarDialog* _tmp5_ = NULL;
	g_return_if_fail (contact != NULL);
	g_return_if_fail (image_frame != NULL);
	_data27_ = g_slice_new0 (Block27Data);
	_data27_->_ref_count_ = 1;
	_tmp0_ = contact;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data27_->contact);
	_data27_->contact = _tmp1_;
	_tmp2_ = image_frame;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_g_object_unref0 (_data27_->image_frame);
	_data27_->image_frame = _tmp3_;
	_tmp4_ = _data27_->contact;
	_tmp5_ = contacts_avatar_dialog_new (_tmp4_);
	g_object_ref_sink (_tmp5_);
	dialog = _tmp5_;
	gtk_widget_show ((GtkWidget*) dialog);
	g_signal_connect_data (dialog, "set-avatar", (GCallback) ___lambda70__contacts_avatar_dialog_set_avatar, block27_data_ref (_data27_), (GClosureNotify) block27_data_unref, 0);
	_g_object_unref0 (dialog);
	block27_data_unref (_data27_);
	_data27_ = NULL;
}


Center* center_construct (GType object_type) {
	Center * self = NULL;
	self = (Center*) g_object_new (object_type, NULL);
	center_set_xalign (self, 0.5);
	return self;
}


Center* center_new (void) {
	return center_construct (TYPE_CENTER);
}


static void center_real_get_preferred_height (GtkWidget* base, gint* minimum_height, gint* natural_height) {
	Center * self;
	gint _vala_minimum_height = 0;
	gint _vala_natural_height = 0;
	GtkWidget* child = NULL;
	GtkWidget* _tmp0_ = NULL;
	GtkWidget* _tmp1_ = NULL;
	GtkWidget* _tmp2_ = NULL;
	self = (Center*) base;
	_tmp0_ = gtk_bin_get_child ((GtkBin*) self);
	_tmp1_ = _g_object_ref0 (_tmp0_);
	child = _tmp1_;
	_tmp2_ = child;
	if (_tmp2_ != NULL) {
		gint min = 0;
		gint nat = 0;
		GtkWidget* _tmp3_ = NULL;
		gint _tmp4_ = 0;
		gint _tmp5_ = 0;
		gint _tmp6_ = 0;
		gint _tmp7_ = 0;
		_tmp3_ = child;
		gtk_widget_get_preferred_height (_tmp3_, &_tmp4_, &_tmp5_);
		min = _tmp4_;
		nat = _tmp5_;
		_tmp6_ = min;
		_vala_minimum_height = _tmp6_;
		_tmp7_ = nat;
		_vala_natural_height = _tmp7_;
	} else {
		_vala_minimum_height = -1;
		_vala_natural_height = -1;
	}
	_g_object_unref0 (child);
	if (minimum_height) {
		*minimum_height = _vala_minimum_height;
	}
	if (natural_height) {
		*natural_height = _vala_natural_height;
	}
}


static void center_real_get_preferred_width (GtkWidget* base, gint* minimum_width, gint* natural_width) {
	Center * self;
	gint _vala_minimum_width = 0;
	gint _vala_natural_width = 0;
	GtkWidget* child = NULL;
	GtkWidget* _tmp0_ = NULL;
	GtkWidget* _tmp1_ = NULL;
	GtkWidget* _tmp2_ = NULL;
	self = (Center*) base;
	_tmp0_ = gtk_bin_get_child ((GtkBin*) self);
	_tmp1_ = _g_object_ref0 (_tmp0_);
	child = _tmp1_;
	_tmp2_ = child;
	if (_tmp2_ != NULL) {
		gint min = 0;
		gint nat = 0;
		GtkWidget* _tmp3_ = NULL;
		gint _tmp4_ = 0;
		gint _tmp5_ = 0;
		gint _tmp6_ = 0;
		gint _tmp7_ = 0;
		_tmp3_ = child;
		gtk_widget_get_preferred_width (_tmp3_, &_tmp4_, &_tmp5_);
		min = _tmp4_;
		nat = _tmp5_;
		_tmp6_ = min;
		_vala_minimum_width = _tmp6_;
		_tmp7_ = nat;
		_vala_natural_width = _tmp7_;
	} else {
		_vala_minimum_width = -1;
		_vala_natural_width = -1;
	}
	_g_object_unref0 (child);
	if (minimum_width) {
		*minimum_width = _vala_minimum_width;
	}
	if (natural_width) {
		*natural_width = _vala_natural_width;
	}
}


static void center_real_size_allocate (GtkWidget* base, GtkAllocation* allocation) {
	Center * self;
	GtkAllocation new_alloc = {0};
	GtkAllocation _tmp0_ = {0};
	GtkAllocation _tmp1_ = {0};
	GtkAllocation _tmp2_ = {0};
	gint _tmp3_ = 0;
	gint _tmp4_ = 0;
	GtkWidget* child = NULL;
	GtkWidget* _tmp12_ = NULL;
	GtkWidget* _tmp13_ = NULL;
	GtkAllocation _tmp14_ = {0};
	self = (Center*) base;
	g_return_if_fail (allocation != NULL);
	_tmp0_ = *allocation;
	gtk_widget_set_allocation ((GtkWidget*) self, &_tmp0_);
	_tmp1_ = *allocation;
	new_alloc = _tmp1_;
	_tmp2_ = *allocation;
	_tmp3_ = _tmp2_.width;
	_tmp4_ = self->priv->_max_width;
	if (_tmp3_ > _tmp4_) {
		gint _tmp5_ = 0;
		GtkAllocation _tmp6_ = {0};
		gint _tmp7_ = 0;
		gint _tmp8_ = 0;
		gdouble _tmp9_ = 0.0;
		GtkAllocation _tmp10_ = {0};
		gint _tmp11_ = 0;
		_tmp5_ = self->priv->_max_width;
		new_alloc.width = _tmp5_;
		_tmp6_ = *allocation;
		_tmp7_ = _tmp6_.width;
		_tmp8_ = self->priv->_max_width;
		_tmp9_ = self->priv->_xalign;
		_tmp10_ = *allocation;
		_tmp11_ = _tmp10_.x;
		new_alloc.x = ((gint) ((_tmp7_ - _tmp8_) * _tmp9_)) + _tmp11_;
	}
	_tmp12_ = gtk_bin_get_child ((GtkBin*) self);
	_tmp13_ = _g_object_ref0 (_tmp12_);
	child = _tmp13_;
	_tmp14_ = new_alloc;
	gtk_widget_size_allocate (child, &_tmp14_);
	_g_object_unref0 (child);
}


gint center_get_max_width (Center* self) {
	gint result;
	gint _tmp0_ = 0;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->_max_width;
	result = _tmp0_;
	return result;
}


void center_set_max_width (Center* self, gint value) {
	gint _tmp0_ = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_max_width = _tmp0_;
	g_object_notify ((GObject *) self, "max-width");
}


gdouble center_get_xalign (Center* self) {
	gdouble result;
	gdouble _tmp0_ = 0.0;
	g_return_val_if_fail (self != NULL, 0.0);
	_tmp0_ = self->priv->_xalign;
	result = _tmp0_;
	return result;
}


void center_set_xalign (Center* self, gdouble value) {
	gdouble _tmp0_ = 0.0;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_xalign = _tmp0_;
	g_object_notify ((GObject *) self, "xalign");
}


static void center_class_init (CenterClass * klass) {
	center_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (CenterPrivate));
	GTK_WIDGET_CLASS (klass)->get_preferred_height = center_real_get_preferred_height;
	GTK_WIDGET_CLASS (klass)->get_preferred_width = center_real_get_preferred_width;
	GTK_WIDGET_CLASS (klass)->size_allocate = center_real_size_allocate;
	G_OBJECT_CLASS (klass)->get_property = _vala_center_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_center_set_property;
	G_OBJECT_CLASS (klass)->finalize = center_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CENTER_MAX_WIDTH, g_param_spec_int ("max-width", "max-width", "max-width", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CENTER_XALIGN, g_param_spec_double ("xalign", "xalign", "xalign", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
}


static void center_instance_init (Center * self) {
	self->priv = CENTER_GET_PRIVATE (self);
}


static void center_finalize (GObject* obj) {
	Center * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_CENTER, Center);
	G_OBJECT_CLASS (center_parent_class)->finalize (obj);
}


GType center_get_type (void) {
	static volatile gsize center_type_id__volatile = 0;
	if (g_once_init_enter (&center_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (CenterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) center_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Center), 0, (GInstanceInitFunc) center_instance_init, NULL };
		GType center_type_id;
		center_type_id = g_type_register_static (GTK_TYPE_BIN, "Center", &g_define_type_info, 0);
		g_once_init_leave (&center_type_id__volatile, center_type_id);
	}
	return center_type_id__volatile;
}


static void _vala_center_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	Center * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_CENTER, Center);
	switch (property_id) {
		case CENTER_MAX_WIDTH:
		g_value_set_int (value, center_get_max_width (self));
		break;
		case CENTER_XALIGN:
		g_value_set_double (value, center_get_xalign (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_center_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	Center * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_CENTER, Center);
	switch (property_id) {
		case CENTER_MAX_WIDTH:
		center_set_max_width (self, g_value_get_int (value));
		break;
		case CENTER_XALIGN:
		center_set_xalign (self, g_value_get_double (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


void contacts_contact_pane_update_sheet (ContactsContactPane* self, gboolean show_matches) {
	gboolean _tmp0_ = FALSE;
	ContactsContactSheet* _tmp1_ = NULL;
	ContactsContact* _tmp2_ = NULL;
	ContactsContactSheet* _tmp3_ = NULL;
	ContactsContact* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->on_edit_mode;
	if (_tmp0_) {
		return;
	}
	_tmp1_ = self->priv->sheet;
	contacts_contact_sheet_clear (_tmp1_);
	_tmp2_ = self->contact;
	if (_tmp2_ == NULL) {
		return;
	}
	_tmp3_ = self->priv->sheet;
	_tmp4_ = self->contact;
	contacts_contact_sheet_update (_tmp3_, _tmp4_);
	gtk_notebook_set_current_page ((GtkNotebook*) self, 1);
	_tmp5_ = show_matches;
	if (_tmp5_) {
		GeeMap* matches = NULL;
		ContactsContact* _tmp6_ = NULL;
		ContactsStore* _tmp7_ = NULL;
		FolksIndividualAggregator* _tmp8_ = NULL;
		FolksIndividualAggregator* _tmp9_ = NULL;
		ContactsContact* _tmp10_ = NULL;
		FolksIndividual* _tmp11_ = NULL;
		GeeMap* _tmp12_ = NULL;
		_tmp6_ = self->contact;
		_tmp7_ = _tmp6_->store;
		_tmp8_ = contacts_store_get_aggregator (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = self->contact;
		_tmp11_ = _tmp10_->individual;
		_tmp12_ = folks_individual_aggregator_get_potential_matches (_tmp9_, _tmp11_, FOLKS_MATCH_RESULT_HIGH);
		matches = _tmp12_;
		{
			GeeIterator* _ind_it = NULL;
			GeeMap* _tmp13_ = NULL;
			GeeSet* _tmp14_ = NULL;
			GeeSet* _tmp15_ = NULL;
			GeeSet* _tmp16_ = NULL;
			GeeIterator* _tmp17_ = NULL;
			GeeIterator* _tmp18_ = NULL;
			_tmp13_ = matches;
			_tmp14_ = gee_map_get_keys (_tmp13_);
			_tmp15_ = _tmp14_;
			_tmp16_ = _tmp15_;
			_tmp17_ = gee_iterable_iterator ((GeeIterable*) _tmp16_);
			_tmp18_ = _tmp17_;
			_g_object_unref0 (_tmp16_);
			_ind_it = _tmp18_;
			while (TRUE) {
				GeeIterator* _tmp19_ = NULL;
				gboolean _tmp20_ = FALSE;
				FolksIndividual* ind = NULL;
				GeeIterator* _tmp21_ = NULL;
				gpointer _tmp22_ = NULL;
				ContactsContact* c = NULL;
				FolksIndividual* _tmp23_ = NULL;
				ContactsContact* _tmp24_ = NULL;
				gboolean _tmp25_ = FALSE;
				ContactsContact* _tmp26_ = NULL;
				gboolean _tmp30_ = FALSE;
				_tmp19_ = _ind_it;
				_tmp20_ = gee_iterator_next (_tmp19_);
				if (!_tmp20_) {
					break;
				}
				_tmp21_ = _ind_it;
				_tmp22_ = gee_iterator_get (_tmp21_);
				ind = (FolksIndividual*) _tmp22_;
				_tmp23_ = ind;
				_tmp24_ = contacts_contact_from_individual (_tmp23_);
				c = _tmp24_;
				_tmp26_ = c;
				if (_tmp26_ != NULL) {
					ContactsContact* _tmp27_ = NULL;
					ContactsContact* _tmp28_ = NULL;
					gboolean _tmp29_ = FALSE;
					_tmp27_ = self->contact;
					_tmp28_ = c;
					_tmp29_ = contacts_contact_suggest_link_to (_tmp27_, _tmp28_);
					_tmp25_ = _tmp29_;
				} else {
					_tmp25_ = FALSE;
				}
				_tmp30_ = _tmp25_;
				if (_tmp30_) {
					ContactsContact* _tmp31_ = NULL;
					_tmp31_ = c;
					contacts_contact_pane_add_suggestion (self, _tmp31_);
				}
				_g_object_unref0 (c);
				_g_object_unref0 (ind);
			}
			_g_object_unref0 (_ind_it);
		}
		_g_object_unref0 (matches);
	}
}


static Block28Data* block28_data_ref (Block28Data* _data28_) {
	g_atomic_int_inc (&_data28_->_ref_count_);
	return _data28_;
}


static void block28_data_unref (void * _userdata_) {
	Block28Data* _data28_;
	_data28_ = (Block28Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data28_->_ref_count_)) {
		ContactsContactPane * self;
		self = _data28_->self;
		_g_object_unref0 (_data28_->c);
		_g_object_unref0 (self);
		g_slice_free (Block28Data, _data28_);
	}
}


static gboolean __lambda74_ (ContactsContactPane* self, cairo_t* cr) {
	gboolean result = FALSE;
	GtkAllocation allocation = {0};
	GtkGrid* _tmp0_ = NULL;
	GtkAllocation _tmp1_ = {0};
	GtkStyleContext* context = NULL;
	GtkGrid* _tmp2_ = NULL;
	GtkStyleContext* _tmp3_ = NULL;
	GtkStyleContext* _tmp4_ = NULL;
	cairo_t* _tmp5_ = NULL;
	GtkAllocation _tmp6_ = {0};
	gint _tmp7_ = 0;
	GtkAllocation _tmp8_ = {0};
	gint _tmp9_ = 0;
	g_return_val_if_fail (cr != NULL, FALSE);
	_tmp0_ = self->suggestion_grid;
	gtk_widget_get_allocation ((GtkWidget*) _tmp0_, &_tmp1_);
	allocation = _tmp1_;
	_tmp2_ = self->suggestion_grid;
	_tmp3_ = gtk_widget_get_style_context ((GtkWidget*) _tmp2_);
	_tmp4_ = _g_object_ref0 (_tmp3_);
	context = _tmp4_;
	_tmp5_ = cr;
	_tmp6_ = allocation;
	_tmp7_ = _tmp6_.width;
	_tmp8_ = allocation;
	_tmp9_ = _tmp8_.height;
	gtk_render_background (context, _tmp5_, (gdouble) 0, (gdouble) 0, (gdouble) _tmp7_, (gdouble) _tmp9_);
	result = FALSE;
	_g_object_unref0 (context);
	return result;
}


static gboolean ___lambda74__gtk_widget_draw (GtkWidget* _sender, cairo_t* cr, gpointer self) {
	gboolean result;
	result = __lambda74_ (self, cr);
	return result;
}


static void __lambda75_ (Block28Data* _data28_, GtkWidget* w) {
	ContactsContactPane * self;
	GtkWidget* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	FolksIndividual* _tmp2_ = NULL;
	ContactsContact* _tmp3_ = NULL;
	self = _data28_->self;
	g_return_if_fail (w != NULL);
	_tmp0_ = w;
	_tmp1_ = _data28_->c;
	_tmp2_ = _tmp1_->individual;
	_tmp3_ = _data28_->c;
	contacts_contact_frame_set_image (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, CONTACTS_TYPE_CONTACT_FRAME) ? ((ContactsContactFrame*) _tmp0_) : NULL, (FolksAvatarDetails*) _tmp2_, _tmp3_);
}


static void ___lambda75__gtk_callback (GtkWidget* widget, gpointer self) {
	__lambda75_ (self, widget);
}


static Block29Data* block29_data_ref (Block29Data* _data29_) {
	g_atomic_int_inc (&_data29_->_ref_count_);
	return _data29_;
}


static void block29_data_unref (void * _userdata_) {
	Block29Data* _data29_;
	_data29_ = (Block29Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data29_->_ref_count_)) {
		ContactsContactPane * self;
		self = _data29_->_data28_->self;
		_g_free0 (_data29_->linked_contact);
		block28_data_unref (_data29_->_data28_);
		_data29_->_data28_ = NULL;
		g_slice_free (Block29Data, _data29_);
	}
}


static void __lambda77_ (Block29Data* _data29_, GObject* obj, GAsyncResult* _result_) {
	Block28Data* _data28_;
	ContactsContactPane * self;
	ContactsLinkOperation* operation = NULL;
	GAsyncResult* _tmp0_ = NULL;
	ContactsLinkOperation* _tmp1_ = NULL;
	_data28_ = _data29_->_data28_;
	self = _data28_->self;
	g_return_if_fail (_result_ != NULL);
	_tmp0_ = _result_;
	_tmp1_ = contacts_link_contacts_finish (_tmp0_);
	operation = _tmp1_;
	g_signal_emit_by_name (self, "contacts-linked", NULL, _data29_->linked_contact, operation);
	_g_object_unref0 (operation);
}


static void ___lambda77__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	__lambda77_ (self, source_object, res);
	block29_data_unref (self);
}


static void __lambda76_ (Block28Data* _data28_) {
	ContactsContactPane * self;
	Block29Data* _data29_;
	ContactsContact* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	ContactsContact* _tmp4_ = NULL;
	ContactsContact* _tmp5_ = NULL;
	GtkGrid* _tmp6_ = NULL;
	self = _data28_->self;
	_data29_ = g_slice_new0 (Block29Data);
	_data29_->_ref_count_ = 1;
	_data29_->_data28_ = block28_data_ref (_data28_);
	_tmp0_ = _data28_->c;
	_tmp1_ = contacts_contact_get_display_name (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strdup (_tmp2_);
	_data29_->linked_contact = _tmp3_;
	_tmp4_ = self->contact;
	_tmp5_ = _data28_->c;
	contacts_link_contacts (_tmp4_, _tmp5_, ___lambda77__gasync_ready_callback, block29_data_ref (_data29_));
	_tmp6_ = self->suggestion_grid;
	gtk_widget_destroy ((GtkWidget*) _tmp6_);
	block29_data_unref (_data29_);
	_data29_ = NULL;
}


static void ___lambda76__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda76_ (self);
}


static void __lambda78_ (Block28Data* _data28_) {
	ContactsContactPane * self;
	ContactsStore* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	ContactsContact* _tmp2_ = NULL;
	GtkGrid* _tmp3_ = NULL;
	self = _data28_->self;
	_tmp0_ = self->priv->contacts_store;
	_tmp1_ = self->contact;
	_tmp2_ = _data28_->c;
	contacts_store_add_no_suggest_link (_tmp0_, _tmp1_, _tmp2_);
	_tmp3_ = self->suggestion_grid;
	gtk_widget_destroy ((GtkWidget*) _tmp3_);
}


static void ___lambda78__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda78_ (self);
}


void contacts_contact_pane_add_suggestion (ContactsContactPane* self, ContactsContact* c) {
	Block28Data* _data28_;
	ContactsContact* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	GtkOverlay* parent_overlay = NULL;
	GtkWidget* _tmp2_ = NULL;
	GtkOverlay* _tmp3_ = NULL;
	GtkGrid* _tmp4_ = NULL;
	GtkGrid* _tmp6_ = NULL;
	GtkGrid* _tmp7_ = NULL;
	GtkOverlay* _tmp8_ = NULL;
	GtkGrid* _tmp9_ = NULL;
	GtkGrid* _tmp10_ = NULL;
	GtkStyleContext* _tmp11_ = NULL;
	GtkGrid* _tmp12_ = NULL;
	GtkGrid* _tmp13_ = NULL;
	ContactsContactFrame* image_frame = NULL;
	ContactsContactFrame* _tmp14_ = NULL;
	ContactsContactFrame* _tmp15_ = NULL;
	ContactsContactFrame* _tmp16_ = NULL;
	ContactsContactFrame* _tmp17_ = NULL;
	GtkTextDirection _tmp18_ = 0;
	ContactsContact* _tmp21_ = NULL;
	ContactsContactFrame* _tmp22_ = NULL;
	GtkGrid* _tmp23_ = NULL;
	ContactsContactFrame* _tmp24_ = NULL;
	GtkLabel* label = NULL;
	GtkLabel* _tmp25_ = NULL;
	ContactsContact* _tmp26_ = NULL;
	gboolean _tmp27_ = FALSE;
	GtkLabel* _tmp45_ = NULL;
	GtkLabel* _tmp46_ = NULL;
	GtkLabel* _tmp47_ = NULL;
	GtkLabel* _tmp48_ = NULL;
	GtkLabel* _tmp49_ = NULL;
	GtkLabel* _tmp50_ = NULL;
	GtkLabel* _tmp51_ = NULL;
	GtkGrid* _tmp52_ = NULL;
	GtkLabel* _tmp53_ = NULL;
	GtkButtonBox* bbox = NULL;
	GtkButtonBox* _tmp54_ = NULL;
	GtkButton* yes = NULL;
	const gchar* _tmp55_ = NULL;
	GtkButton* _tmp56_ = NULL;
	GtkButton* no = NULL;
	const gchar* _tmp57_ = NULL;
	GtkButton* _tmp58_ = NULL;
	GtkButton* _tmp59_ = NULL;
	GtkButton* _tmp60_ = NULL;
	GtkButtonBox* _tmp61_ = NULL;
	GtkButton* _tmp62_ = NULL;
	GtkButtonBox* _tmp63_ = NULL;
	GtkButton* _tmp64_ = NULL;
	GtkButtonBox* _tmp65_ = NULL;
	GtkButtonBox* _tmp66_ = NULL;
	GtkButtonBox* _tmp67_ = NULL;
	GtkButtonBox* _tmp68_ = NULL;
	GtkButtonBox* _tmp69_ = NULL;
	GtkTextDirection _tmp70_ = 0;
	GtkGrid* _tmp73_ = NULL;
	GtkButtonBox* _tmp74_ = NULL;
	GtkGrid* _tmp75_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (c != NULL);
	_data28_ = g_slice_new0 (Block28Data);
	_data28_->_ref_count_ = 1;
	_data28_->self = g_object_ref (self);
	_tmp0_ = c;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data28_->c);
	_data28_->c = _tmp1_;
	_tmp2_ = gtk_widget_get_parent ((GtkWidget*) self);
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, GTK_TYPE_OVERLAY) ? ((GtkOverlay*) _tmp2_) : NULL);
	parent_overlay = _tmp3_;
	_tmp4_ = self->suggestion_grid;
	if (_tmp4_ != NULL) {
		GtkGrid* _tmp5_ = NULL;
		_tmp5_ = self->suggestion_grid;
		gtk_widget_destroy ((GtkWidget*) _tmp5_);
		_g_object_unref0 (self->suggestion_grid);
		self->suggestion_grid = NULL;
	}
	_tmp6_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp6_);
	_g_object_unref0 (self->suggestion_grid);
	self->suggestion_grid = _tmp6_;
	_tmp7_ = self->suggestion_grid;
	gtk_widget_set_valign ((GtkWidget*) _tmp7_, GTK_ALIGN_END);
	_tmp8_ = parent_overlay;
	_tmp9_ = self->suggestion_grid;
	gtk_overlay_add_overlay (_tmp8_, (GtkWidget*) _tmp9_);
	_tmp10_ = self->suggestion_grid;
	_tmp11_ = gtk_widget_get_style_context ((GtkWidget*) _tmp10_);
	gtk_style_context_add_class (_tmp11_, "contacts-suggestion");
	_tmp12_ = self->suggestion_grid;
	gtk_widget_set_redraw_on_allocate ((GtkWidget*) _tmp12_, TRUE);
	_tmp13_ = self->suggestion_grid;
	g_signal_connect_object ((GtkWidget*) _tmp13_, "draw", (GCallback) ___lambda74__gtk_widget_draw, self, 0);
	_tmp14_ = contacts_contact_frame_new (CONTACTS_CONTACT_SMALL_AVATAR_SIZE, FALSE);
	g_object_ref_sink (_tmp14_);
	image_frame = _tmp14_;
	_tmp15_ = image_frame;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp15_, FALSE);
	_tmp16_ = image_frame;
	g_object_set ((GtkWidget*) _tmp16_, "margin", 24, NULL);
	_tmp17_ = image_frame;
	_tmp18_ = gtk_widget_get_direction ((GtkWidget*) _tmp17_);
	if (_tmp18_ == GTK_TEXT_DIR_LTR) {
		ContactsContactFrame* _tmp19_ = NULL;
		_tmp19_ = image_frame;
		gtk_widget_set_margin_right ((GtkWidget*) _tmp19_, 12);
	} else {
		ContactsContactFrame* _tmp20_ = NULL;
		_tmp20_ = image_frame;
		gtk_widget_set_margin_left ((GtkWidget*) _tmp20_, 12);
	}
	_tmp21_ = _data28_->c;
	_tmp22_ = image_frame;
	contacts_contact_keep_widget_uptodate (_tmp21_, (GtkWidget*) _tmp22_, ___lambda75__gtk_callback, block28_data_ref (_data28_), block28_data_unref);
	_tmp23_ = self->suggestion_grid;
	_tmp24_ = image_frame;
	gtk_grid_attach (_tmp23_, (GtkWidget*) _tmp24_, 0, 0, 1, 2);
	_tmp25_ = (GtkLabel*) gtk_label_new ("");
	g_object_ref_sink (_tmp25_);
	label = _tmp25_;
	_tmp26_ = self->contact;
	_tmp27_ = _tmp26_->is_main;
	if (_tmp27_) {
		GtkLabel* _tmp28_ = NULL;
		const gchar* _tmp29_ = NULL;
		ContactsContact* _tmp30_ = NULL;
		const gchar* _tmp31_ = NULL;
		const gchar* _tmp32_ = NULL;
		ContactsContact* _tmp33_ = NULL;
		gchar* _tmp34_ = NULL;
		gchar* _tmp35_ = NULL;
		gchar* _tmp36_ = NULL;
		gchar* _tmp37_ = NULL;
		_tmp28_ = label;
		_tmp29_ = _ ("Does %s from %s belong here?");
		_tmp30_ = _data28_->c;
		_tmp31_ = contacts_contact_get_display_name (_tmp30_);
		_tmp32_ = _tmp31_;
		_tmp33_ = _data28_->c;
		_tmp34_ = contacts_contact_format_persona_stores (_tmp33_);
		_tmp35_ = _tmp34_;
		_tmp36_ = g_markup_printf_escaped (_tmp29_, _tmp32_, _tmp35_);
		_tmp37_ = _tmp36_;
		gtk_label_set_markup (_tmp28_, _tmp37_);
		_g_free0 (_tmp37_);
		_g_free0 (_tmp35_);
	} else {
		GtkLabel* _tmp38_ = NULL;
		const gchar* _tmp39_ = NULL;
		ContactsContact* _tmp40_ = NULL;
		const gchar* _tmp41_ = NULL;
		const gchar* _tmp42_ = NULL;
		gchar* _tmp43_ = NULL;
		gchar* _tmp44_ = NULL;
		_tmp38_ = label;
		_tmp39_ = _ ("Do these details belong to %s?");
		_tmp40_ = _data28_->c;
		_tmp41_ = contacts_contact_get_display_name (_tmp40_);
		_tmp42_ = _tmp41_;
		_tmp43_ = g_markup_printf_escaped (_tmp39_, _tmp42_);
		_tmp44_ = _tmp43_;
		gtk_label_set_markup (_tmp38_, _tmp44_);
		_g_free0 (_tmp44_);
	}
	_tmp45_ = label;
	gtk_widget_set_valign ((GtkWidget*) _tmp45_, GTK_ALIGN_START);
	_tmp46_ = label;
	gtk_widget_set_halign ((GtkWidget*) _tmp46_, GTK_ALIGN_START);
	_tmp47_ = label;
	gtk_label_set_line_wrap (_tmp47_, TRUE);
	_tmp48_ = label;
	gtk_label_set_line_wrap_mode (_tmp48_, PANGO_WRAP_WORD_CHAR);
	_tmp49_ = label;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp49_, TRUE);
	_tmp50_ = label;
	gtk_widget_set_margin_top ((GtkWidget*) _tmp50_, 24);
	_tmp51_ = label;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp51_, 24);
	_tmp52_ = self->suggestion_grid;
	_tmp53_ = label;
	gtk_grid_attach (_tmp52_, (GtkWidget*) _tmp53_, 1, 0, 1, 2);
	_tmp54_ = (GtkButtonBox*) gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
	g_object_ref_sink (_tmp54_);
	bbox = _tmp54_;
	_tmp55_ = _ ("Yes");
	_tmp56_ = (GtkButton*) gtk_button_new_with_label (_tmp55_);
	g_object_ref_sink (_tmp56_);
	yes = _tmp56_;
	_tmp57_ = _ ("No");
	_tmp58_ = (GtkButton*) gtk_button_new_with_label (_tmp57_);
	g_object_ref_sink (_tmp58_);
	no = _tmp58_;
	_tmp59_ = yes;
	g_signal_connect_data (_tmp59_, "clicked", (GCallback) ___lambda76__gtk_button_clicked, block28_data_ref (_data28_), (GClosureNotify) block28_data_unref, 0);
	_tmp60_ = no;
	g_signal_connect_data (_tmp60_, "clicked", (GCallback) ___lambda78__gtk_button_clicked, block28_data_ref (_data28_), (GClosureNotify) block28_data_unref, 0);
	_tmp61_ = bbox;
	_tmp62_ = yes;
	gtk_container_add ((GtkContainer*) _tmp61_, (GtkWidget*) _tmp62_);
	_tmp63_ = bbox;
	_tmp64_ = no;
	gtk_container_add ((GtkContainer*) _tmp63_, (GtkWidget*) _tmp64_);
	_tmp65_ = bbox;
	gtk_box_set_spacing ((GtkBox*) _tmp65_, 8);
	_tmp66_ = bbox;
	gtk_widget_set_halign ((GtkWidget*) _tmp66_, GTK_ALIGN_END);
	_tmp67_ = bbox;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp67_, TRUE);
	_tmp68_ = bbox;
	g_object_set ((GtkWidget*) _tmp68_, "margin", 24, NULL);
	_tmp69_ = bbox;
	_tmp70_ = gtk_widget_get_direction ((GtkWidget*) _tmp69_);
	if (_tmp70_ == GTK_TEXT_DIR_LTR) {
		GtkButtonBox* _tmp71_ = NULL;
		_tmp71_ = bbox;
		gtk_widget_set_margin_left ((GtkWidget*) _tmp71_, 12);
	} else {
		GtkButtonBox* _tmp72_ = NULL;
		_tmp72_ = bbox;
		gtk_widget_set_margin_right ((GtkWidget*) _tmp72_, 12);
	}
	_tmp73_ = self->suggestion_grid;
	_tmp74_ = bbox;
	gtk_grid_attach (_tmp73_, (GtkWidget*) _tmp74_, 2, 0, 1, 2);
	_tmp75_ = self->suggestion_grid;
	gtk_widget_show_all ((GtkWidget*) _tmp75_);
	_g_object_unref0 (no);
	_g_object_unref0 (yes);
	_g_object_unref0 (bbox);
	_g_object_unref0 (label);
	_g_object_unref0 (image_frame);
	_g_object_unref0 (parent_overlay);
	block28_data_unref (_data28_);
	_data28_ = NULL;
}


static void _contacts_contact_pane_personas_changed_cb_contacts_contact_personas_changed (ContactsContact* _sender, gpointer self) {
	contacts_contact_pane_personas_changed_cb (self, _sender);
}


static void _contacts_contact_pane_contact_changed_cb_contacts_contact_changed (ContactsContact* _sender, gpointer self) {
	contacts_contact_pane_contact_changed_cb (self, _sender);
}


void contacts_contact_pane_show_contact (ContactsContactPane* self, ContactsContact* new_contact, gboolean edit, gboolean show_matches) {
	ContactsContact* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	GtkGrid* _tmp2_ = NULL;
	ContactsContact* _tmp4_ = NULL;
	ContactsContact* _tmp9_ = NULL;
	ContactsContact* _tmp10_ = NULL;
	gboolean can_remove = FALSE;
	gboolean has_links = FALSE;
	ContactsContact* _tmp11_ = NULL;
	GtkButton* _tmp22_ = NULL;
	gboolean _tmp23_ = FALSE;
	GtkButton* _tmp24_ = NULL;
	gboolean _tmp25_ = FALSE;
	ContactsContact* _tmp26_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->contact;
	_tmp1_ = new_contact;
	if (_tmp0_ == _tmp1_) {
		return;
	}
	_tmp2_ = self->suggestion_grid;
	if (_tmp2_ != NULL) {
		GtkGrid* _tmp3_ = NULL;
		_tmp3_ = self->suggestion_grid;
		gtk_widget_destroy ((GtkWidget*) _tmp3_);
		_g_object_unref0 (self->suggestion_grid);
		self->suggestion_grid = NULL;
	}
	_tmp4_ = self->contact;
	if (_tmp4_ != NULL) {
		ContactsContact* _tmp5_ = NULL;
		guint _tmp6_ = 0U;
		ContactsContact* _tmp7_ = NULL;
		guint _tmp8_ = 0U;
		_tmp5_ = self->contact;
		g_signal_parse_name ("personas-changed", CONTACTS_TYPE_CONTACT, &_tmp6_, NULL, FALSE);
		g_signal_handlers_disconnect_matched (_tmp5_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp6_, 0, NULL, (GCallback) _contacts_contact_pane_personas_changed_cb_contacts_contact_personas_changed, self);
		_tmp7_ = self->contact;
		g_signal_parse_name ("changed", CONTACTS_TYPE_CONTACT, &_tmp8_, NULL, FALSE);
		g_signal_handlers_disconnect_matched (_tmp7_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp8_, 0, NULL, (GCallback) _contacts_contact_pane_contact_changed_cb_contacts_contact_changed, self);
	}
	_tmp9_ = new_contact;
	_tmp10_ = _g_object_ref0 (_tmp9_);
	_g_object_unref0 (self->contact);
	self->contact = _tmp10_;
	contacts_contact_pane_update_sheet (self, TRUE);
	can_remove = FALSE;
	has_links = FALSE;
	_tmp11_ = self->contact;
	if (_tmp11_ != NULL) {
		ContactsContact* _tmp12_ = NULL;
		ContactsContact* _tmp13_ = NULL;
		ContactsContact* _tmp14_ = NULL;
		gboolean _tmp15_ = FALSE;
		ContactsContact* _tmp16_ = NULL;
		FolksIndividual* _tmp17_ = NULL;
		GeeSet* _tmp18_ = NULL;
		GeeSet* _tmp19_ = NULL;
		gint _tmp20_ = 0;
		gint _tmp21_ = 0;
		_tmp12_ = self->contact;
		g_signal_connect_object (_tmp12_, "personas-changed", (GCallback) _contacts_contact_pane_personas_changed_cb_contacts_contact_personas_changed, self, 0);
		_tmp13_ = self->contact;
		g_signal_connect_object (_tmp13_, "changed", (GCallback) _contacts_contact_pane_contact_changed_cb_contacts_contact_changed, self, 0);
		_tmp14_ = self->contact;
		_tmp15_ = contacts_contact_can_remove_personas (_tmp14_);
		can_remove = _tmp15_;
		_tmp16_ = self->contact;
		_tmp17_ = _tmp16_->individual;
		_tmp18_ = folks_individual_get_personas (_tmp17_);
		_tmp19_ = _tmp18_;
		_tmp20_ = gee_collection_get_size ((GeeCollection*) _tmp19_);
		_tmp21_ = _tmp20_;
		has_links = _tmp21_ > 1;
	}
	_tmp22_ = self->priv->remove_button;
	_tmp23_ = can_remove;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp22_, _tmp23_);
	_tmp24_ = self->priv->linked_button;
	_tmp25_ = has_links;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp24_, _tmp25_);
	_tmp26_ = self->contact;
	if (_tmp26_ == NULL) {
		contacts_contact_pane_show_no_selection_frame (self);
	}
}


static void contacts_contact_pane_personas_changed_cb (ContactsContactPane* self, ContactsContact* contact) {
	g_return_if_fail (self != NULL);
	g_return_if_fail (contact != NULL);
	contacts_contact_pane_update_sheet (self, TRUE);
}


static void contacts_contact_pane_contact_changed_cb (ContactsContactPane* self, ContactsContact* contact) {
	g_return_if_fail (self != NULL);
	g_return_if_fail (contact != NULL);
	contacts_contact_pane_update_sheet (self, TRUE);
}


static void __lambda79_ (ContactsContactPane* self) {
	contacts_contact_pane_update_sheet (self, TRUE);
}


static void ___lambda79__contacts_store_quiescent (ContactsStore* _sender, gpointer self) {
	__lambda79_ (self);
}


static void __lambda80_ (ContactsContactPane* self) {
	ContactsContactEditor* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	FolksPersona* _tmp2_ = NULL;
	FolksPersona* _tmp3_ = NULL;
	_tmp0_ = self->priv->editor;
	_tmp1_ = self->contact;
	_tmp2_ = contacts_contact_find_primary_persona (_tmp1_);
	_tmp3_ = _tmp2_;
	contacts_contact_editor_add_new_row_for_property (_tmp0_, _tmp3_, "email-addresses", "PERSONAL");
	_g_object_unref0 (_tmp3_);
}


static void ___lambda80__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
	__lambda80_ (self);
}


static void __lambda81_ (ContactsContactPane* self) {
	ContactsContactEditor* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	FolksPersona* _tmp2_ = NULL;
	FolksPersona* _tmp3_ = NULL;
	_tmp0_ = self->priv->editor;
	_tmp1_ = self->contact;
	_tmp2_ = contacts_contact_find_primary_persona (_tmp1_);
	_tmp3_ = _tmp2_;
	contacts_contact_editor_add_new_row_for_property (_tmp0_, _tmp3_, "email-addresses", "WORK");
	_g_object_unref0 (_tmp3_);
}


static void ___lambda81__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
	__lambda81_ (self);
}


static void __lambda82_ (ContactsContactPane* self) {
	ContactsContactEditor* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	FolksPersona* _tmp2_ = NULL;
	FolksPersona* _tmp3_ = NULL;
	_tmp0_ = self->priv->editor;
	_tmp1_ = self->contact;
	_tmp2_ = contacts_contact_find_primary_persona (_tmp1_);
	_tmp3_ = _tmp2_;
	contacts_contact_editor_add_new_row_for_property (_tmp0_, _tmp3_, "phone-numbers", "CELL");
	_g_object_unref0 (_tmp3_);
}


static void ___lambda82__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
	__lambda82_ (self);
}


static void __lambda83_ (ContactsContactPane* self) {
	ContactsContactEditor* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	FolksPersona* _tmp2_ = NULL;
	FolksPersona* _tmp3_ = NULL;
	_tmp0_ = self->priv->editor;
	_tmp1_ = self->contact;
	_tmp2_ = contacts_contact_find_primary_persona (_tmp1_);
	_tmp3_ = _tmp2_;
	contacts_contact_editor_add_new_row_for_property (_tmp0_, _tmp3_, "phone-numbers", "HOME");
	_g_object_unref0 (_tmp3_);
}


static void ___lambda83__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
	__lambda83_ (self);
}


static void __lambda84_ (ContactsContactPane* self) {
	ContactsContactEditor* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	FolksPersona* _tmp2_ = NULL;
	FolksPersona* _tmp3_ = NULL;
	_tmp0_ = self->priv->editor;
	_tmp1_ = self->contact;
	_tmp2_ = contacts_contact_find_primary_persona (_tmp1_);
	_tmp3_ = _tmp2_;
	contacts_contact_editor_add_new_row_for_property (_tmp0_, _tmp3_, "phone-numbers", "WORK");
	_g_object_unref0 (_tmp3_);
}


static void ___lambda84__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
	__lambda84_ (self);
}


static void __lambda85_ (ContactsContactPane* self) {
	ContactsContactEditor* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	FolksPersona* _tmp2_ = NULL;
	FolksPersona* _tmp3_ = NULL;
	_tmp0_ = self->priv->editor;
	_tmp1_ = self->contact;
	_tmp2_ = contacts_contact_find_primary_persona (_tmp1_);
	_tmp3_ = _tmp2_;
	contacts_contact_editor_add_new_row_for_property (_tmp0_, _tmp3_, "urls", NULL);
	_g_object_unref0 (_tmp3_);
}


static void ___lambda85__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
	__lambda85_ (self);
}


static void __lambda86_ (ContactsContactPane* self) {
	ContactsContactEditor* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	FolksPersona* _tmp2_ = NULL;
	FolksPersona* _tmp3_ = NULL;
	_tmp0_ = self->priv->editor;
	_tmp1_ = self->contact;
	_tmp2_ = contacts_contact_find_primary_persona (_tmp1_);
	_tmp3_ = _tmp2_;
	contacts_contact_editor_add_new_row_for_property (_tmp0_, _tmp3_, "nickname", NULL);
	_g_object_unref0 (_tmp3_);
}


static void ___lambda86__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
	__lambda86_ (self);
}


static void __lambda87_ (ContactsContactPane* self) {
	ContactsContactEditor* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	FolksPersona* _tmp2_ = NULL;
	FolksPersona* _tmp3_ = NULL;
	_tmp0_ = self->priv->editor;
	_tmp1_ = self->contact;
	_tmp2_ = contacts_contact_find_primary_persona (_tmp1_);
	_tmp3_ = _tmp2_;
	contacts_contact_editor_add_new_row_for_property (_tmp0_, _tmp3_, "birthday", NULL);
	_g_object_unref0 (_tmp3_);
}


static void ___lambda87__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
	__lambda87_ (self);
}


static void __lambda88_ (ContactsContactPane* self) {
	ContactsContactEditor* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	FolksPersona* _tmp2_ = NULL;
	FolksPersona* _tmp3_ = NULL;
	_tmp0_ = self->priv->editor;
	_tmp1_ = self->contact;
	_tmp2_ = contacts_contact_find_primary_persona (_tmp1_);
	_tmp3_ = _tmp2_;
	contacts_contact_editor_add_new_row_for_property (_tmp0_, _tmp3_, "postal-addresses", "HOME");
	_g_object_unref0 (_tmp3_);
}


static void ___lambda88__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
	__lambda88_ (self);
}


static void __lambda89_ (ContactsContactPane* self) {
	ContactsContactEditor* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	FolksPersona* _tmp2_ = NULL;
	FolksPersona* _tmp3_ = NULL;
	_tmp0_ = self->priv->editor;
	_tmp1_ = self->contact;
	_tmp2_ = contacts_contact_find_primary_persona (_tmp1_);
	_tmp3_ = _tmp2_;
	contacts_contact_editor_add_new_row_for_property (_tmp0_, _tmp3_, "postal-addresses", "WORK");
	_g_object_unref0 (_tmp3_);
}


static void ___lambda89__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
	__lambda89_ (self);
}


static void __lambda90_ (ContactsContactPane* self) {
	ContactsContactEditor* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	FolksPersona* _tmp2_ = NULL;
	FolksPersona* _tmp3_ = NULL;
	_tmp0_ = self->priv->editor;
	_tmp1_ = self->contact;
	_tmp2_ = contacts_contact_find_primary_persona (_tmp1_);
	_tmp3_ = _tmp2_;
	contacts_contact_editor_add_new_row_for_property (_tmp0_, _tmp3_, "notes", NULL);
	_g_object_unref0 (_tmp3_);
}


static void ___lambda90__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
	__lambda90_ (self);
}


static void _contacts_contact_pane_linked_accounts_gtk_button_clicked (GtkButton* _sender, gpointer self) {
	contacts_contact_pane_linked_accounts (self);
}


static void _contacts_contact_pane_delete_contact_gtk_button_clicked (GtkButton* _sender, gpointer self) {
	contacts_contact_pane_delete_contact (self);
}


ContactsContactPane* contacts_contact_pane_construct (GType object_type, ContactsStore* contacts_store) {
	ContactsContactPane * self = NULL;
	ContactsStore* _tmp0_ = NULL;
	ContactsStore* _tmp1_ = NULL;
	GtkScrolledWindow* main_sw = NULL;
	GtkScrolledWindow* _tmp2_ = NULL;
	GtkScrolledWindow* _tmp3_ = NULL;
	GtkScrolledWindow* _tmp4_ = NULL;
	GtkScrolledWindow* _tmp5_ = NULL;
	GtkScrolledWindow* _tmp6_ = NULL;
	Center* hcenter = NULL;
	Center* _tmp7_ = NULL;
	Center* _tmp8_ = NULL;
	Center* _tmp9_ = NULL;
	ContactsContactSheet* _tmp10_ = NULL;
	Center* _tmp11_ = NULL;
	ContactsContactSheet* _tmp12_ = NULL;
	ContactsContactSheet* _tmp13_ = NULL;
	ContactsContactSheet* _tmp14_ = NULL;
	ContactsContactSheet* _tmp15_ = NULL;
	ContactsContactSheet* _tmp16_ = NULL;
	GtkScrolledWindow* _tmp17_ = NULL;
	Center* _tmp18_ = NULL;
	ContactsContactSheet* _tmp19_ = NULL;
	GtkScrolledWindow* _tmp20_ = NULL;
	GtkAdjustment* _tmp21_ = NULL;
	GtkScrolledWindow* _tmp22_ = NULL;
	GtkWidget* _tmp23_ = NULL;
	GtkStyleContext* _tmp24_ = NULL;
	GtkScrolledWindow* _tmp25_ = NULL;
	GtkWidget* _tmp26_ = NULL;
	GtkStyleContext* _tmp27_ = NULL;
	GtkScrolledWindow* _tmp28_ = NULL;
	GtkScrolledWindow* _tmp29_ = NULL;
	ContactsStore* _tmp30_ = NULL;
	GtkGrid* top_grid = NULL;
	GtkGrid* _tmp31_ = NULL;
	GtkGrid* _tmp32_ = NULL;
	GtkScrolledWindow* _tmp33_ = NULL;
	GtkGrid* _tmp34_ = NULL;
	GtkScrolledWindow* _tmp35_ = NULL;
	GtkScrolledWindow* _tmp36_ = NULL;
	GtkScrolledWindow* _tmp37_ = NULL;
	GtkScrolledWindow* _tmp38_ = NULL;
	GtkScrolledWindow* _tmp39_ = NULL;
	Center* _tmp40_ = NULL;
	Center* _tmp41_ = NULL;
	Center* _tmp42_ = NULL;
	ContactsContactEditor* _tmp43_ = NULL;
	Center* _tmp44_ = NULL;
	ContactsContactEditor* _tmp45_ = NULL;
	ContactsContactEditor* _tmp46_ = NULL;
	ContactsContactEditor* _tmp47_ = NULL;
	GtkScrolledWindow* _tmp48_ = NULL;
	Center* _tmp49_ = NULL;
	ContactsContactEditor* _tmp50_ = NULL;
	GtkScrolledWindow* _tmp51_ = NULL;
	GtkAdjustment* _tmp52_ = NULL;
	GtkScrolledWindow* _tmp53_ = NULL;
	GtkWidget* _tmp54_ = NULL;
	GtkStyleContext* _tmp55_ = NULL;
	GtkScrolledWindow* _tmp56_ = NULL;
	GtkWidget* _tmp57_ = NULL;
	GtkStyleContext* _tmp58_ = NULL;
	GtkToolbar* edit_toolbar = NULL;
	GtkToolbar* _tmp59_ = NULL;
	GtkToolbar* _tmp60_ = NULL;
	GtkStyleContext* _tmp61_ = NULL;
	GtkToolbar* _tmp62_ = NULL;
	GtkStyleContext* _tmp63_ = NULL;
	GtkToolbar* _tmp64_ = NULL;
	GtkMenuButton* add_detail_button = NULL;
	GtkMenuButton* _tmp65_ = NULL;
	GtkMenuButton* _tmp66_ = NULL;
	GtkGrid* box = NULL;
	GtkGrid* _tmp67_ = NULL;
	GtkWidget* w = NULL;
	const gchar* _tmp68_ = NULL;
	GtkLabel* _tmp69_ = NULL;
	GtkWidget* _tmp70_ = NULL;
	GtkWidget* _tmp71_ = NULL;
	GtkWidget* _tmp72_ = NULL;
	GtkGrid* _tmp73_ = NULL;
	GtkGrid* _tmp74_ = NULL;
	GtkWidget* _tmp75_ = NULL;
	GtkArrow* _tmp76_ = NULL;
	GtkWidget* _tmp77_ = NULL;
	GtkWidget* _tmp78_ = NULL;
	GtkWidget* _tmp79_ = NULL;
	GtkGrid* _tmp80_ = NULL;
	GtkWidget* _tmp81_ = NULL;
	GtkMenuButton* _tmp82_ = NULL;
	GtkGrid* _tmp83_ = NULL;
	GtkMenu* details_menu = NULL;
	GtkMenu* _tmp84_ = NULL;
	GtkMenu* _tmp85_ = NULL;
	GtkMenuItem* item = NULL;
	const gchar* _tmp86_ = NULL;
	GtkMenuItem* _tmp87_ = NULL;
	GtkMenu* _tmp88_ = NULL;
	GtkMenuItem* _tmp89_ = NULL;
	GtkMenuItem* _tmp90_ = NULL;
	const gchar* _tmp91_ = NULL;
	GtkMenuItem* _tmp92_ = NULL;
	GtkMenu* _tmp93_ = NULL;
	GtkMenuItem* _tmp94_ = NULL;
	GtkMenuItem* _tmp95_ = NULL;
	const gchar* _tmp96_ = NULL;
	GtkMenuItem* _tmp97_ = NULL;
	GtkMenu* _tmp98_ = NULL;
	GtkMenuItem* _tmp99_ = NULL;
	GtkMenuItem* _tmp100_ = NULL;
	const gchar* _tmp101_ = NULL;
	GtkMenuItem* _tmp102_ = NULL;
	GtkMenu* _tmp103_ = NULL;
	GtkMenuItem* _tmp104_ = NULL;
	GtkMenuItem* _tmp105_ = NULL;
	const gchar* _tmp106_ = NULL;
	GtkMenuItem* _tmp107_ = NULL;
	GtkMenu* _tmp108_ = NULL;
	GtkMenuItem* _tmp109_ = NULL;
	GtkMenuItem* _tmp110_ = NULL;
	const gchar* _tmp111_ = NULL;
	GtkMenuItem* _tmp112_ = NULL;
	GtkMenu* _tmp113_ = NULL;
	GtkMenuItem* _tmp114_ = NULL;
	GtkMenuItem* _tmp115_ = NULL;
	const gchar* _tmp116_ = NULL;
	GtkMenuItem* _tmp117_ = NULL;
	GtkMenu* _tmp118_ = NULL;
	GtkMenuItem* _tmp119_ = NULL;
	GtkMenuItem* _tmp120_ = NULL;
	const gchar* _tmp121_ = NULL;
	GtkMenuItem* _tmp122_ = NULL;
	GtkMenu* _tmp123_ = NULL;
	GtkMenuItem* _tmp124_ = NULL;
	GtkMenuItem* _tmp125_ = NULL;
	const gchar* _tmp126_ = NULL;
	GtkMenuItem* _tmp127_ = NULL;
	GtkMenu* _tmp128_ = NULL;
	GtkMenuItem* _tmp129_ = NULL;
	GtkMenuItem* _tmp130_ = NULL;
	const gchar* _tmp131_ = NULL;
	GtkMenuItem* _tmp132_ = NULL;
	GtkMenu* _tmp133_ = NULL;
	GtkMenuItem* _tmp134_ = NULL;
	GtkMenuItem* _tmp135_ = NULL;
	const gchar* _tmp136_ = NULL;
	GtkMenuItem* _tmp137_ = NULL;
	GtkMenu* _tmp138_ = NULL;
	GtkMenuItem* _tmp139_ = NULL;
	GtkMenuItem* _tmp140_ = NULL;
	GtkMenu* _tmp141_ = NULL;
	GtkMenuButton* _tmp142_ = NULL;
	GtkMenu* _tmp143_ = NULL;
	GtkMenuButton* _tmp144_ = NULL;
	GtkToolItem* tool_item = NULL;
	GtkToolItem* _tmp145_ = NULL;
	GtkToolItem* _tmp146_ = NULL;
	GtkMenuButton* _tmp147_ = NULL;
	GtkToolItem* _tmp148_ = NULL;
	GtkTextDirection _tmp149_ = 0;
	GtkToolbar* _tmp152_ = NULL;
	GtkToolItem* _tmp153_ = NULL;
	GtkToolItem* _tmp154_ = NULL;
	const gchar* _tmp155_ = NULL;
	GtkButton* _tmp156_ = NULL;
	GtkButton* _tmp157_ = NULL;
	GtkToolItem* _tmp158_ = NULL;
	GtkButton* _tmp159_ = NULL;
	GtkToolbar* _tmp160_ = NULL;
	GtkToolItem* _tmp161_ = NULL;
	GtkButton* _tmp162_ = NULL;
	GtkSeparatorToolItem* _tmp163_ = NULL;
	GtkToolItem* _tmp164_ = NULL;
	GtkToolItem* _tmp165_ = NULL;
	GtkToolbar* _tmp166_ = NULL;
	GtkToolItem* _tmp167_ = NULL;
	GtkToolItem* _tmp168_ = NULL;
	const gchar* _tmp169_ = NULL;
	GtkButton* _tmp170_ = NULL;
	GtkButton* _tmp171_ = NULL;
	GtkToolItem* _tmp172_ = NULL;
	GtkButton* _tmp173_ = NULL;
	GtkToolbar* _tmp174_ = NULL;
	GtkToolItem* _tmp175_ = NULL;
	GtkButton* _tmp176_ = NULL;
	GtkToolbar* _tmp177_ = NULL;
	GtkGrid* _tmp178_ = NULL;
	GtkToolbar* _tmp179_ = NULL;
	ContactsContactEditor* _tmp180_ = NULL;
	ContactsContactEditor* _tmp181_ = NULL;
	ContactsContactEditor* _tmp182_ = NULL;
	GtkScrolledWindow* _tmp183_ = NULL;
	GtkGrid* _tmp184_ = NULL;
	GtkGrid* _tmp185_ = NULL;
	g_return_val_if_fail (contacts_store != NULL, NULL);
	self = (ContactsContactPane*) g_object_new (object_type, NULL);
	gtk_notebook_set_show_tabs ((GtkNotebook*) self, FALSE);
	_tmp0_ = contacts_store;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->contacts_store);
	self->priv->contacts_store = _tmp1_;
	contacts_contact_pane_show_no_selection_frame (self);
	_tmp2_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
	g_object_ref_sink (_tmp2_);
	main_sw = _tmp2_;
	_tmp3_ = main_sw;
	gtk_scrolled_window_set_shadow_type (_tmp3_, GTK_SHADOW_NONE);
	_tmp4_ = main_sw;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp4_, TRUE);
	_tmp5_ = main_sw;
	gtk_widget_set_vexpand ((GtkWidget*) _tmp5_, TRUE);
	_tmp6_ = main_sw;
	gtk_scrolled_window_set_policy (_tmp6_, GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
	_tmp7_ = center_new ();
	g_object_ref_sink (_tmp7_);
	hcenter = _tmp7_;
	_tmp8_ = hcenter;
	center_set_max_width (_tmp8_, 600);
	_tmp9_ = hcenter;
	center_set_xalign (_tmp9_, 0.0);
	_tmp10_ = contacts_contact_sheet_new ();
	g_object_ref_sink (_tmp10_);
	_g_object_unref0 (self->priv->sheet);
	self->priv->sheet = _tmp10_;
	_tmp11_ = hcenter;
	_tmp12_ = self->priv->sheet;
	gtk_container_add ((GtkContainer*) _tmp11_, (GtkWidget*) _tmp12_);
	_tmp13_ = self->priv->sheet;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp13_, TRUE);
	_tmp14_ = self->priv->sheet;
	gtk_widget_set_vexpand ((GtkWidget*) _tmp14_, TRUE);
	_tmp15_ = self->priv->sheet;
	g_object_set ((GtkWidget*) _tmp15_, "margin", 36, NULL);
	_tmp16_ = self->priv->sheet;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp16_, 24);
	_tmp17_ = main_sw;
	_tmp18_ = hcenter;
	gtk_scrolled_window_add_with_viewport (_tmp17_, (GtkWidget*) _tmp18_);
	_tmp19_ = self->priv->sheet;
	_tmp20_ = main_sw;
	_tmp21_ = gtk_scrolled_window_get_vadjustment (_tmp20_);
	gtk_container_set_focus_vadjustment ((GtkContainer*) _tmp19_, _tmp21_);
	_tmp22_ = main_sw;
	_tmp23_ = gtk_bin_get_child ((GtkBin*) _tmp22_);
	_tmp24_ = gtk_widget_get_style_context (_tmp23_);
	gtk_style_context_add_class (_tmp24_, "contacts-main-view");
	_tmp25_ = main_sw;
	_tmp26_ = gtk_bin_get_child ((GtkBin*) _tmp25_);
	_tmp27_ = gtk_widget_get_style_context (_tmp26_);
	gtk_style_context_add_class (_tmp27_, "view");
	_tmp28_ = main_sw;
	gtk_widget_show_all ((GtkWidget*) _tmp28_);
	_tmp29_ = main_sw;
	gtk_notebook_insert_page ((GtkNotebook*) self, (GtkWidget*) _tmp29_, NULL, 1);
	_tmp30_ = contacts_store;
	g_signal_connect_object (_tmp30_, "quiescent", (GCallback) ___lambda79__contacts_store_quiescent, self, 0);
	_g_object_unref0 (self->suggestion_grid);
	self->suggestion_grid = NULL;
	_tmp31_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp31_);
	top_grid = _tmp31_;
	_tmp32_ = top_grid;
	gtk_orientable_set_orientation ((GtkOrientable*) _tmp32_, GTK_ORIENTATION_VERTICAL);
	_tmp33_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
	g_object_ref_sink (_tmp33_);
	_g_object_unref0 (main_sw);
	main_sw = _tmp33_;
	_tmp34_ = top_grid;
	_tmp35_ = main_sw;
	gtk_container_add ((GtkContainer*) _tmp34_, (GtkWidget*) _tmp35_);
	_tmp36_ = main_sw;
	gtk_scrolled_window_set_shadow_type (_tmp36_, GTK_SHADOW_NONE);
	_tmp37_ = main_sw;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp37_, TRUE);
	_tmp38_ = main_sw;
	gtk_widget_set_vexpand ((GtkWidget*) _tmp38_, TRUE);
	_tmp39_ = main_sw;
	gtk_scrolled_window_set_policy (_tmp39_, GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
	_tmp40_ = center_new ();
	g_object_ref_sink (_tmp40_);
	_g_object_unref0 (hcenter);
	hcenter = _tmp40_;
	_tmp41_ = hcenter;
	center_set_max_width (_tmp41_, 600);
	_tmp42_ = hcenter;
	center_set_xalign (_tmp42_, 0.0);
	_tmp43_ = contacts_contact_editor_new ();
	g_object_ref_sink (_tmp43_);
	_g_object_unref0 (self->priv->editor);
	self->priv->editor = _tmp43_;
	_tmp44_ = hcenter;
	_tmp45_ = self->priv->editor;
	gtk_container_add ((GtkContainer*) _tmp44_, (GtkWidget*) _tmp45_);
	_tmp46_ = self->priv->editor;
	g_object_set ((GtkWidget*) _tmp46_, "margin", 36, NULL);
	_tmp47_ = self->priv->editor;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp47_, 24);
	_tmp48_ = main_sw;
	_tmp49_ = hcenter;
	gtk_scrolled_window_add_with_viewport (_tmp48_, (GtkWidget*) _tmp49_);
	_tmp50_ = self->priv->editor;
	_tmp51_ = main_sw;
	_tmp52_ = gtk_scrolled_window_get_vadjustment (_tmp51_);
	gtk_container_set_focus_vadjustment ((GtkContainer*) _tmp50_, _tmp52_);
	_tmp53_ = main_sw;
	_tmp54_ = gtk_bin_get_child ((GtkBin*) _tmp53_);
	_tmp55_ = gtk_widget_get_style_context (_tmp54_);
	gtk_style_context_add_class (_tmp55_, "contacts-main-view");
	_tmp56_ = main_sw;
	_tmp57_ = gtk_bin_get_child ((GtkBin*) _tmp56_);
	_tmp58_ = gtk_widget_get_style_context (_tmp57_);
	gtk_style_context_add_class (_tmp58_, "view");
	self->on_edit_mode = FALSE;
	_tmp59_ = (GtkToolbar*) gtk_toolbar_new ();
	g_object_ref_sink (_tmp59_);
	edit_toolbar = _tmp59_;
	_tmp60_ = edit_toolbar;
	_tmp61_ = gtk_widget_get_style_context ((GtkWidget*) _tmp60_);
	gtk_style_context_add_class (_tmp61_, GTK_STYLE_CLASS_MENUBAR);
	_tmp62_ = edit_toolbar;
	_tmp63_ = gtk_widget_get_style_context ((GtkWidget*) _tmp62_);
	gtk_style_context_add_class (_tmp63_, "contacts-edit-toolbar");
	_tmp64_ = edit_toolbar;
	gtk_widget_set_vexpand ((GtkWidget*) _tmp64_, FALSE);
	_tmp65_ = (GtkMenuButton*) gtk_menu_button_new ();
	g_object_ref_sink (_tmp65_);
	add_detail_button = _tmp65_;
	_tmp66_ = add_detail_button;
	gtk_widget_set_vexpand ((GtkWidget*) _tmp66_, TRUE);
	_tmp67_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp67_);
	box = _tmp67_;
	_tmp68_ = _ ("New Detail");
	_tmp69_ = (GtkLabel*) gtk_label_new (_tmp68_);
	g_object_ref_sink (_tmp69_);
	_tmp70_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp69_, GTK_TYPE_WIDGET) ? ((GtkWidget*) _tmp69_) : NULL;
	if (_tmp70_ == NULL) {
		_g_object_unref0 (_tmp69_);
	}
	w = _tmp70_;
	_tmp71_ = w;
	gtk_widget_set_valign (_tmp71_, GTK_ALIGN_CENTER);
	_tmp72_ = w;
	gtk_widget_set_vexpand (_tmp72_, TRUE);
	_tmp73_ = box;
	gtk_grid_set_column_spacing (_tmp73_, (guint) 4);
	_tmp74_ = box;
	_tmp75_ = w;
	gtk_container_add ((GtkContainer*) _tmp74_, _tmp75_);
	_tmp76_ = (GtkArrow*) gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_OUT);
	g_object_ref_sink (_tmp76_);
	_tmp77_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp76_, GTK_TYPE_WIDGET) ? ((GtkWidget*) _tmp76_) : NULL;
	if (_tmp77_ == NULL) {
		_g_object_unref0 (_tmp76_);
	}
	_g_object_unref0 (w);
	w = _tmp77_;
	_tmp78_ = w;
	gtk_widget_set_valign (_tmp78_, GTK_ALIGN_CENTER);
	_tmp79_ = w;
	gtk_widget_set_vexpand (_tmp79_, TRUE);
	_tmp80_ = box;
	_tmp81_ = w;
	gtk_container_add ((GtkContainer*) _tmp80_, _tmp81_);
	_tmp82_ = add_detail_button;
	_tmp83_ = box;
	gtk_container_add ((GtkContainer*) _tmp82_, (GtkWidget*) _tmp83_);
	_tmp84_ = (GtkMenu*) gtk_menu_new ();
	g_object_ref_sink (_tmp84_);
	details_menu = _tmp84_;
	_tmp85_ = details_menu;
	gtk_widget_set_halign ((GtkWidget*) _tmp85_, GTK_ALIGN_START);
	_tmp86_ = _ ("Personal email");
	_tmp87_ = (GtkMenuItem*) gtk_menu_item_new_with_label (_tmp86_);
	g_object_ref_sink (_tmp87_);
	item = _tmp87_;
	_tmp88_ = details_menu;
	_tmp89_ = item;
	gtk_menu_shell_append ((GtkMenuShell*) _tmp88_, (GtkWidget*) _tmp89_);
	_tmp90_ = item;
	g_signal_connect_object (_tmp90_, "activate", (GCallback) ___lambda80__gtk_menu_item_activate, self, 0);
	_tmp91_ = _ ("Work email");
	_tmp92_ = (GtkMenuItem*) gtk_menu_item_new_with_label (_tmp91_);
	g_object_ref_sink (_tmp92_);
	_g_object_unref0 (item);
	item = _tmp92_;
	_tmp93_ = details_menu;
	_tmp94_ = item;
	gtk_menu_shell_append ((GtkMenuShell*) _tmp93_, (GtkWidget*) _tmp94_);
	_tmp95_ = item;
	g_signal_connect_object (_tmp95_, "activate", (GCallback) ___lambda81__gtk_menu_item_activate, self, 0);
	_tmp96_ = _ ("Mobile phone");
	_tmp97_ = (GtkMenuItem*) gtk_menu_item_new_with_label (_tmp96_);
	g_object_ref_sink (_tmp97_);
	_g_object_unref0 (item);
	item = _tmp97_;
	_tmp98_ = details_menu;
	_tmp99_ = item;
	gtk_menu_shell_append ((GtkMenuShell*) _tmp98_, (GtkWidget*) _tmp99_);
	_tmp100_ = item;
	g_signal_connect_object (_tmp100_, "activate", (GCallback) ___lambda82__gtk_menu_item_activate, self, 0);
	_tmp101_ = _ ("Home phone");
	_tmp102_ = (GtkMenuItem*) gtk_menu_item_new_with_label (_tmp101_);
	g_object_ref_sink (_tmp102_);
	_g_object_unref0 (item);
	item = _tmp102_;
	_tmp103_ = details_menu;
	_tmp104_ = item;
	gtk_menu_shell_append ((GtkMenuShell*) _tmp103_, (GtkWidget*) _tmp104_);
	_tmp105_ = item;
	g_signal_connect_object (_tmp105_, "activate", (GCallback) ___lambda83__gtk_menu_item_activate, self, 0);
	_tmp106_ = _ ("Work phone");
	_tmp107_ = (GtkMenuItem*) gtk_menu_item_new_with_label (_tmp106_);
	g_object_ref_sink (_tmp107_);
	_g_object_unref0 (item);
	item = _tmp107_;
	_tmp108_ = details_menu;
	_tmp109_ = item;
	gtk_menu_shell_append ((GtkMenuShell*) _tmp108_, (GtkWidget*) _tmp109_);
	_tmp110_ = item;
	g_signal_connect_object (_tmp110_, "activate", (GCallback) ___lambda84__gtk_menu_item_activate, self, 0);
	_tmp111_ = _ ("Website");
	_tmp112_ = (GtkMenuItem*) gtk_menu_item_new_with_label (_tmp111_);
	g_object_ref_sink (_tmp112_);
	_g_object_unref0 (item);
	item = _tmp112_;
	_tmp113_ = details_menu;
	_tmp114_ = item;
	gtk_menu_shell_append ((GtkMenuShell*) _tmp113_, (GtkWidget*) _tmp114_);
	_tmp115_ = item;
	g_signal_connect_object (_tmp115_, "activate", (GCallback) ___lambda85__gtk_menu_item_activate, self, 0);
	_tmp116_ = _ ("Nickname");
	_tmp117_ = (GtkMenuItem*) gtk_menu_item_new_with_label (_tmp116_);
	g_object_ref_sink (_tmp117_);
	_g_object_unref0 (self->priv->nickname_item);
	self->priv->nickname_item = _tmp117_;
	_tmp118_ = details_menu;
	_tmp119_ = self->priv->nickname_item;
	gtk_menu_shell_append ((GtkMenuShell*) _tmp118_, (GtkWidget*) _tmp119_);
	_tmp120_ = self->priv->nickname_item;
	g_signal_connect_object (_tmp120_, "activate", (GCallback) ___lambda86__gtk_menu_item_activate, self, 0);
	_tmp121_ = _ ("Birthday");
	_tmp122_ = (GtkMenuItem*) gtk_menu_item_new_with_label (_tmp121_);
	g_object_ref_sink (_tmp122_);
	_g_object_unref0 (self->priv->birthday_item);
	self->priv->birthday_item = _tmp122_;
	_tmp123_ = details_menu;
	_tmp124_ = self->priv->birthday_item;
	gtk_menu_shell_append ((GtkMenuShell*) _tmp123_, (GtkWidget*) _tmp124_);
	_tmp125_ = self->priv->birthday_item;
	g_signal_connect_object (_tmp125_, "activate", (GCallback) ___lambda87__gtk_menu_item_activate, self, 0);
	_tmp126_ = _ ("Home address");
	_tmp127_ = (GtkMenuItem*) gtk_menu_item_new_with_label (_tmp126_);
	g_object_ref_sink (_tmp127_);
	_g_object_unref0 (item);
	item = _tmp127_;
	_tmp128_ = details_menu;
	_tmp129_ = item;
	gtk_menu_shell_append ((GtkMenuShell*) _tmp128_, (GtkWidget*) _tmp129_);
	_tmp130_ = item;
	g_signal_connect_object (_tmp130_, "activate", (GCallback) ___lambda88__gtk_menu_item_activate, self, 0);
	_tmp131_ = _ ("Work address");
	_tmp132_ = (GtkMenuItem*) gtk_menu_item_new_with_label (_tmp131_);
	g_object_ref_sink (_tmp132_);
	_g_object_unref0 (item);
	item = _tmp132_;
	_tmp133_ = details_menu;
	_tmp134_ = item;
	gtk_menu_shell_append ((GtkMenuShell*) _tmp133_, (GtkWidget*) _tmp134_);
	_tmp135_ = item;
	g_signal_connect_object (_tmp135_, "activate", (GCallback) ___lambda89__gtk_menu_item_activate, self, 0);
	_tmp136_ = _ ("Notes");
	_tmp137_ = (GtkMenuItem*) gtk_menu_item_new_with_label (_tmp136_);
	g_object_ref_sink (_tmp137_);
	_g_object_unref0 (self->priv->notes_item);
	self->priv->notes_item = _tmp137_;
	_tmp138_ = details_menu;
	_tmp139_ = self->priv->notes_item;
	gtk_menu_shell_append ((GtkMenuShell*) _tmp138_, (GtkWidget*) _tmp139_);
	_tmp140_ = self->priv->notes_item;
	g_signal_connect_object (_tmp140_, "activate", (GCallback) ___lambda90__gtk_menu_item_activate, self, 0);
	_tmp141_ = details_menu;
	gtk_widget_show_all ((GtkWidget*) _tmp141_);
	_tmp142_ = add_detail_button;
	_tmp143_ = details_menu;
	gtk_menu_button_set_popup (_tmp142_, (GtkWidget*) _tmp143_);
	_tmp144_ = add_detail_button;
	gtk_menu_button_set_direction (_tmp144_, GTK_ARROW_UP);
	_tmp145_ = gtk_tool_item_new ();
	g_object_ref_sink (_tmp145_);
	tool_item = _tmp145_;
	_tmp146_ = tool_item;
	_tmp147_ = add_detail_button;
	gtk_container_add ((GtkContainer*) _tmp146_, (GtkWidget*) _tmp147_);
	_tmp148_ = tool_item;
	_tmp149_ = gtk_widget_get_direction ((GtkWidget*) _tmp148_);
	if (_tmp149_ == GTK_TEXT_DIR_LTR) {
		GtkToolItem* _tmp150_ = NULL;
		_tmp150_ = tool_item;
		gtk_widget_set_margin_right ((GtkWidget*) _tmp150_, 12);
	} else {
		GtkToolItem* _tmp151_ = NULL;
		_tmp151_ = tool_item;
		gtk_widget_set_margin_left ((GtkWidget*) _tmp151_, 12);
	}
	_tmp152_ = edit_toolbar;
	_tmp153_ = tool_item;
	gtk_toolbar_insert (_tmp152_, _tmp153_, -1);
	_tmp154_ = gtk_tool_item_new ();
	g_object_ref_sink (_tmp154_);
	_g_object_unref0 (tool_item);
	tool_item = _tmp154_;
	_tmp155_ = _ ("Linked Accounts");
	_tmp156_ = (GtkButton*) gtk_button_new_with_label (_tmp155_);
	g_object_ref_sink (_tmp156_);
	_g_object_unref0 (self->priv->linked_button);
	self->priv->linked_button = _tmp156_;
	_tmp157_ = self->priv->linked_button;
	gtk_widget_set_vexpand ((GtkWidget*) _tmp157_, TRUE);
	_tmp158_ = tool_item;
	_tmp159_ = self->priv->linked_button;
	gtk_container_add ((GtkContainer*) _tmp158_, (GtkWidget*) _tmp159_);
	_tmp160_ = edit_toolbar;
	_tmp161_ = tool_item;
	gtk_toolbar_insert (_tmp160_, _tmp161_, -1);
	_tmp162_ = self->priv->linked_button;
	g_signal_connect_object (_tmp162_, "clicked", (GCallback) _contacts_contact_pane_linked_accounts_gtk_button_clicked, self, 0);
	_tmp163_ = (GtkSeparatorToolItem*) gtk_separator_tool_item_new ();
	g_object_ref_sink (_tmp163_);
	_g_object_unref0 (tool_item);
	tool_item = (GtkToolItem*) _tmp163_;
	_tmp164_ = tool_item;
	gtk_tool_item_set_expand (_tmp164_, TRUE);
	_tmp165_ = tool_item;
	gtk_separator_tool_item_set_draw (G_TYPE_CHECK_INSTANCE_TYPE (_tmp165_, GTK_TYPE_SEPARATOR_TOOL_ITEM) ? ((GtkSeparatorToolItem*) _tmp165_) : NULL, FALSE);
	_tmp166_ = edit_toolbar;
	_tmp167_ = tool_item;
	gtk_toolbar_insert (_tmp166_, _tmp167_, -1);
	_tmp168_ = gtk_tool_item_new ();
	g_object_ref_sink (_tmp168_);
	_g_object_unref0 (tool_item);
	tool_item = _tmp168_;
	_tmp169_ = _ ("Remove Contact");
	_tmp170_ = (GtkButton*) gtk_button_new_with_label (_tmp169_);
	g_object_ref_sink (_tmp170_);
	_g_object_unref0 (self->priv->remove_button);
	self->priv->remove_button = _tmp170_;
	_tmp171_ = self->priv->remove_button;
	gtk_widget_set_vexpand ((GtkWidget*) _tmp171_, TRUE);
	_tmp172_ = tool_item;
	_tmp173_ = self->priv->remove_button;
	gtk_container_add ((GtkContainer*) _tmp172_, (GtkWidget*) _tmp173_);
	_tmp174_ = edit_toolbar;
	_tmp175_ = tool_item;
	gtk_toolbar_insert (_tmp174_, _tmp175_, -1);
	_tmp176_ = self->priv->remove_button;
	g_signal_connect_object (_tmp176_, "clicked", (GCallback) _contacts_contact_pane_delete_contact_gtk_button_clicked, self, 0);
	_tmp177_ = edit_toolbar;
	gtk_widget_show_all ((GtkWidget*) _tmp177_);
	_tmp178_ = top_grid;
	_tmp179_ = edit_toolbar;
	gtk_container_add ((GtkContainer*) _tmp178_, (GtkWidget*) _tmp179_);
	_tmp180_ = self->priv->editor;
	gtk_widget_set_vexpand ((GtkWidget*) _tmp180_, TRUE);
	_tmp181_ = self->priv->editor;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp181_, TRUE);
	_tmp182_ = self->priv->editor;
	gtk_widget_show_all ((GtkWidget*) _tmp182_);
	_tmp183_ = main_sw;
	gtk_widget_show ((GtkWidget*) _tmp183_);
	_tmp184_ = top_grid;
	gtk_widget_show_all ((GtkWidget*) _tmp184_);
	_tmp185_ = top_grid;
	gtk_notebook_insert_page ((GtkNotebook*) self, (GtkWidget*) _tmp185_, NULL, 2);
	_g_object_unref0 (tool_item);
	_g_object_unref0 (item);
	_g_object_unref0 (details_menu);
	_g_object_unref0 (w);
	_g_object_unref0 (box);
	_g_object_unref0 (add_detail_button);
	_g_object_unref0 (edit_toolbar);
	_g_object_unref0 (top_grid);
	_g_object_unref0 (hcenter);
	_g_object_unref0 (main_sw);
	return self;
}


ContactsContactPane* contacts_contact_pane_new (ContactsStore* contacts_store) {
	return contacts_contact_pane_construct (CONTACTS_TYPE_CONTACT_PANE, contacts_store);
}


static void contacts_contact_pane_linked_accounts (ContactsContactPane* self) {
	ContactsLinkedAccountsDialog* dialog = NULL;
	ContactsContact* _tmp0_ = NULL;
	ContactsLinkedAccountsDialog* _tmp1_ = NULL;
	gint _result_ = 0;
	ContactsLinkedAccountsDialog* _tmp2_ = NULL;
	gint _tmp3_ = 0;
	gboolean _tmp4_ = FALSE;
	gint _tmp5_ = 0;
	gboolean _tmp8_ = FALSE;
	ContactsLinkedAccountsDialog* _tmp9_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->contact;
	_tmp1_ = contacts_linked_accounts_dialog_new (_tmp0_);
	g_object_ref_sink (_tmp1_);
	dialog = _tmp1_;
	_tmp2_ = dialog;
	_tmp3_ = gtk_dialog_run ((GtkDialog*) _tmp2_);
	_result_ = _tmp3_;
	_tmp5_ = _result_;
	if (_tmp5_ == ((gint) GTK_RESPONSE_CLOSE)) {
		ContactsLinkedAccountsDialog* _tmp6_ = NULL;
		gboolean _tmp7_ = FALSE;
		_tmp6_ = dialog;
		_tmp7_ = _tmp6_->any_unlinked;
		_tmp4_ = _tmp7_;
	} else {
		_tmp4_ = FALSE;
	}
	_tmp8_ = _tmp4_;
	if (_tmp8_) {
		contacts_contact_pane_set_edit_mode (self, FALSE);
		contacts_contact_pane_set_edit_mode (self, TRUE);
	}
	_tmp9_ = dialog;
	gtk_widget_destroy ((GtkWidget*) _tmp9_);
	_g_object_unref0 (dialog);
}


static void contacts_contact_pane_delete_contact (ContactsContactPane* self) {
	ContactsContact* _tmp0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->contact;
	if (_tmp0_ != NULL) {
		ContactsContact* _tmp1_ = NULL;
		ContactsContact* _tmp2_ = NULL;
		_tmp1_ = self->contact;
		contacts_contact_hide (_tmp1_);
		contacts_contact_pane_set_edit_mode (self, FALSE);
		_tmp2_ = self->contact;
		g_signal_emit_by_name (self, "will-delete", _tmp2_);
		contacts_contact_pane_show_contact (self, NULL, FALSE, TRUE);
	}
}


static void contacts_contact_pane_show_no_selection_frame (ContactsContactPane* self) {
	GtkIconSize _tmp0_ = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_icon_size_from_name ("ULTRABIG");
	if (_tmp0_ == 0) {
		GtkFrame* _tmp1_ = NULL;
		GtkFrame* _tmp2_ = NULL;
		GtkFrame* _tmp3_ = NULL;
		GdkRGBA color = {0};
		GtkFrame* _tmp4_ = NULL;
		GdkRGBA _tmp5_ = {0};
		GtkGrid* box = NULL;
		GtkGrid* _tmp6_ = NULL;
		GtkGrid* _tmp7_ = NULL;
		GtkGrid* _tmp8_ = NULL;
		GtkGrid* _tmp9_ = NULL;
		GtkGrid* _tmp10_ = NULL;
		GtkGrid* _tmp11_ = NULL;
		GtkGrid* _tmp12_ = NULL;
		GtkImage* image = NULL;
		GtkIconSize _tmp13_ = 0;
		GtkImage* _tmp14_ = NULL;
		GtkImage* _tmp15_ = NULL;
		GtkStyleContext* _tmp16_ = NULL;
		GtkGrid* _tmp17_ = NULL;
		GtkImage* _tmp18_ = NULL;
		GtkLabel* label = NULL;
		GtkLabel* _tmp19_ = NULL;
		GtkLabel* _tmp20_ = NULL;
		const gchar* _tmp21_ = NULL;
		gchar* _tmp22_ = NULL;
		gchar* _tmp23_ = NULL;
		GtkLabel* _tmp24_ = NULL;
		GtkStyleContext* _tmp25_ = NULL;
		GtkGrid* _tmp26_ = NULL;
		GtkLabel* _tmp27_ = NULL;
		GtkFrame* _tmp28_ = NULL;
		GtkGrid* _tmp29_ = NULL;
		GtkFrame* _tmp30_ = NULL;
		GtkFrame* _tmp31_ = NULL;
		gtk_icon_size_register ("ULTRABIG", 144, 144);
		_tmp1_ = (GtkFrame*) gtk_frame_new (NULL);
		g_object_ref_sink (_tmp1_);
		_g_object_unref0 (self->priv->no_selection_frame);
		self->priv->no_selection_frame = _tmp1_;
		_tmp2_ = self->priv->no_selection_frame;
		gtk_frame_set_shadow_type (_tmp2_, GTK_SHADOW_NONE);
		_tmp3_ = self->priv->no_selection_frame;
		gtk_widget_set_size_request ((GtkWidget*) _tmp3_, 500, -1);
		memset (&color, 0, sizeof (GdkRGBA));
		gdk_rgba_parse (&color, "#f1f2f1");
		_tmp4_ = self->priv->no_selection_frame;
		_tmp5_ = color;
		gtk_widget_override_background_color ((GtkWidget*) _tmp4_, 0, &_tmp5_);
		_tmp6_ = (GtkGrid*) gtk_grid_new ();
		g_object_ref_sink (_tmp6_);
		box = _tmp6_;
		_tmp7_ = box;
		gtk_orientable_set_orientation ((GtkOrientable*) _tmp7_, GTK_ORIENTATION_VERTICAL);
		_tmp8_ = box;
		gtk_widget_set_valign ((GtkWidget*) _tmp8_, GTK_ALIGN_CENTER);
		_tmp9_ = box;
		gtk_widget_set_halign ((GtkWidget*) _tmp9_, GTK_ALIGN_CENTER);
		_tmp10_ = box;
		gtk_widget_set_vexpand ((GtkWidget*) _tmp10_, TRUE);
		_tmp11_ = box;
		gtk_widget_set_hexpand ((GtkWidget*) _tmp11_, TRUE);
		_tmp12_ = box;
		gtk_widget_set_margin_bottom ((GtkWidget*) _tmp12_, 60);
		_tmp13_ = gtk_icon_size_from_name ("ULTRABIG");
		_tmp14_ = (GtkImage*) gtk_image_new_from_icon_name ("avatar-default-symbolic", _tmp13_);
		g_object_ref_sink (_tmp14_);
		image = _tmp14_;
		_tmp15_ = image;
		_tmp16_ = gtk_widget_get_style_context ((GtkWidget*) _tmp15_);
		gtk_style_context_add_class (_tmp16_, "contacts-watermark");
		_tmp17_ = box;
		_tmp18_ = image;
		gtk_container_add ((GtkContainer*) _tmp17_, (GtkWidget*) _tmp18_);
		_tmp19_ = (GtkLabel*) gtk_label_new ("");
		g_object_ref_sink (_tmp19_);
		label = _tmp19_;
		_tmp20_ = label;
		_tmp21_ = _ ("Select a contact");
		_tmp22_ = g_strdup_printf ("<span font=\"12\">%s</span>", _tmp21_);
		_tmp23_ = _tmp22_;
		gtk_label_set_markup (_tmp20_, _tmp23_);
		_g_free0 (_tmp23_);
		_tmp24_ = label;
		_tmp25_ = gtk_widget_get_style_context ((GtkWidget*) _tmp24_);
		gtk_style_context_add_class (_tmp25_, "contacts-watermark");
		_tmp26_ = box;
		_tmp27_ = label;
		gtk_container_add ((GtkContainer*) _tmp26_, (GtkWidget*) _tmp27_);
		_tmp28_ = self->priv->no_selection_frame;
		_tmp29_ = box;
		gtk_container_add ((GtkContainer*) _tmp28_, (GtkWidget*) _tmp29_);
		_tmp30_ = self->priv->no_selection_frame;
		gtk_widget_show_all ((GtkWidget*) _tmp30_);
		_tmp31_ = self->priv->no_selection_frame;
		gtk_notebook_insert_page ((GtkNotebook*) self, (GtkWidget*) _tmp31_, NULL, 0);
		_g_object_unref0 (label);
		_g_object_unref0 (image);
		_g_object_unref0 (box);
	}
	gtk_notebook_set_current_page ((GtkNotebook*) self, 0);
}


static void _____lambda94_ (ContactsContactPane* self, GObject* obj, GAsyncResult* _result_) {
	GError * _inner_error_ = NULL;
	g_return_if_fail (_result_ != NULL);
	{
		GAsyncResult* _tmp0_ = NULL;
		_tmp0_ = _result_;
		contacts_contact_set_persona_property_finish (_tmp0_, &_inner_error_);
		if (_inner_error_ != NULL) {
			goto __catch6_g_error;
		}
	}
	goto __finally6;
	__catch6_g_error:
	{
		GError* e2 = NULL;
		ContactsApp* _tmp1_ = NULL;
		GError* _tmp2_ = NULL;
		const gchar* _tmp3_ = NULL;
		e2 = _inner_error_;
		_inner_error_ = NULL;
		_tmp1_ = contacts_app_app;
		_tmp2_ = e2;
		_tmp3_ = _tmp2_->message;
		contacts_app_show_message (_tmp1_, _tmp3_);
		contacts_contact_pane_update_sheet (self, TRUE);
		_g_error_free0 (e2);
	}
	__finally6:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
}


static void ______lambda94__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	_____lambda94_ (self, source_object, res);
	g_object_unref (self);
}


static void ____lambda95_ (ContactsContactPane* self, GObject* obj, GAsyncResult* _result_) {
	GError * _inner_error_ = NULL;
	g_return_if_fail (_result_ != NULL);
	{
		GAsyncResult* _tmp0_ = NULL;
		FolksPersona* _tmp1_ = NULL;
		FolksPersona* _tmp2_ = NULL;
		_tmp0_ = _result_;
		_tmp1_ = contacts_contact_set_individual_property_finish (_tmp0_, &_inner_error_);
		_tmp2_ = _tmp1_;
		_g_object_unref0 (_tmp2_);
		if (_inner_error_ != NULL) {
			goto __catch7_g_error;
		}
	}
	goto __finally7;
	__catch7_g_error:
	{
		GError* e = NULL;
		ContactsApp* _tmp3_ = NULL;
		GError* _tmp4_ = NULL;
		const gchar* _tmp5_ = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp3_ = contacts_app_app;
		_tmp4_ = e;
		_tmp5_ = _tmp4_->message;
		contacts_app_show_message (_tmp3_, _tmp5_);
		_g_error_free0 (e);
	}
	__finally7:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
}


static void _____lambda95__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	____lambda95_ (self, source_object, res);
	g_object_unref (self);
}


void contacts_contact_pane_set_edit_mode (ContactsContactPane* self, gboolean on_edit) {
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = on_edit;
	_tmp1_ = self->on_edit_mode;
	if (_tmp0_ == _tmp1_) {
		return;
	}
	_tmp2_ = on_edit;
	if (_tmp2_) {
		ContactsContact* _tmp3_ = NULL;
		ContactsContact* _tmp4_ = NULL;
		gboolean _tmp5_ = FALSE;
		ContactsContact* _tmp8_ = NULL;
		gboolean _tmp9_ = FALSE;
		ContactsContact* _tmp12_ = NULL;
		gboolean _tmp13_ = FALSE;
		ContactsContactSheet* _tmp16_ = NULL;
		GtkGrid* _tmp17_ = NULL;
		ContactsContactEditor* _tmp19_ = NULL;
		ContactsContactEditor* _tmp20_ = NULL;
		ContactsContact* _tmp21_ = NULL;
		ContactsContactEditor* _tmp22_ = NULL;
		_tmp3_ = self->contact;
		if (_tmp3_ == NULL) {
			return;
		}
		self->on_edit_mode = TRUE;
		_tmp4_ = self->contact;
		_tmp5_ = contacts_contact_has_birthday (_tmp4_);
		if (_tmp5_) {
			GtkMenuItem* _tmp6_ = NULL;
			_tmp6_ = self->priv->birthday_item;
			gtk_widget_hide ((GtkWidget*) _tmp6_);
		} else {
			GtkMenuItem* _tmp7_ = NULL;
			_tmp7_ = self->priv->birthday_item;
			gtk_widget_show ((GtkWidget*) _tmp7_);
		}
		_tmp8_ = self->contact;
		_tmp9_ = contacts_contact_has_nickname (_tmp8_);
		if (_tmp9_) {
			GtkMenuItem* _tmp10_ = NULL;
			_tmp10_ = self->priv->nickname_item;
			gtk_widget_hide ((GtkWidget*) _tmp10_);
		} else {
			GtkMenuItem* _tmp11_ = NULL;
			_tmp11_ = self->priv->nickname_item;
			gtk_widget_show ((GtkWidget*) _tmp11_);
		}
		_tmp12_ = self->contact;
		_tmp13_ = contacts_contact_has_notes (_tmp12_);
		if (_tmp13_) {
			GtkMenuItem* _tmp14_ = NULL;
			_tmp14_ = self->priv->notes_item;
			gtk_widget_hide ((GtkWidget*) _tmp14_);
		} else {
			GtkMenuItem* _tmp15_ = NULL;
			_tmp15_ = self->priv->notes_item;
			gtk_widget_show ((GtkWidget*) _tmp15_);
		}
		_tmp16_ = self->priv->sheet;
		contacts_contact_sheet_clear (_tmp16_);
		_tmp17_ = self->suggestion_grid;
		if (_tmp17_ != NULL) {
			GtkGrid* _tmp18_ = NULL;
			_tmp18_ = self->suggestion_grid;
			gtk_widget_destroy ((GtkWidget*) _tmp18_);
			_g_object_unref0 (self->suggestion_grid);
			self->suggestion_grid = NULL;
		}
		_tmp19_ = self->priv->editor;
		contacts_contact_editor_clear (_tmp19_);
		_tmp20_ = self->priv->editor;
		_tmp21_ = self->contact;
		contacts_contact_editor_update (_tmp20_, _tmp21_);
		_tmp22_ = self->priv->editor;
		gtk_widget_show_all ((GtkWidget*) _tmp22_);
		gtk_notebook_set_current_page ((GtkNotebook*) self, 2);
	} else {
		ContactsContactEditor* _tmp46_ = NULL;
		gboolean _tmp47_ = FALSE;
		ContactsContactEditor* _tmp52_ = NULL;
		ContactsContactSheet* _tmp53_ = NULL;
		ContactsContactSheet* _tmp54_ = NULL;
		ContactsContact* _tmp55_ = NULL;
		self->on_edit_mode = FALSE;
		{
			GeeIterator* _prop_it = NULL;
			ContactsContactEditor* _tmp23_ = NULL;
			GeeHashMap* _tmp24_ = NULL;
			GeeHashMap* _tmp25_ = NULL;
			GeeSet* _tmp26_ = NULL;
			GeeSet* _tmp27_ = NULL;
			GeeSet* _tmp28_ = NULL;
			GeeIterator* _tmp29_ = NULL;
			GeeIterator* _tmp30_ = NULL;
			_tmp23_ = self->priv->editor;
			_tmp24_ = contacts_contact_editor_properties_changed (_tmp23_);
			_tmp25_ = _tmp24_;
			_tmp26_ = gee_abstract_map_get_entries ((GeeMap*) _tmp25_);
			_tmp27_ = _tmp26_;
			_tmp28_ = _tmp27_;
			_tmp29_ = gee_iterable_iterator ((GeeIterable*) _tmp28_);
			_tmp30_ = _tmp29_;
			_g_object_unref0 (_tmp28_);
			_g_object_unref0 (_tmp25_);
			_prop_it = _tmp30_;
			while (TRUE) {
				GeeIterator* _tmp31_ = NULL;
				gboolean _tmp32_ = FALSE;
				GeeMapEntry* prop = NULL;
				GeeIterator* _tmp33_ = NULL;
				gpointer _tmp34_ = NULL;
				GeeMapEntry* _tmp35_ = NULL;
				gconstpointer _tmp36_ = NULL;
				ContactsContactEditorPropertyData* _tmp37_ = NULL;
				FolksPersona* _tmp38_ = NULL;
				GeeMapEntry* _tmp39_ = NULL;
				gconstpointer _tmp40_ = NULL;
				const gchar* _tmp41_ = NULL;
				GeeMapEntry* _tmp42_ = NULL;
				gconstpointer _tmp43_ = NULL;
				ContactsContactEditorPropertyData* _tmp44_ = NULL;
				GValue _tmp45_ = {0};
				_tmp31_ = _prop_it;
				_tmp32_ = gee_iterator_next (_tmp31_);
				if (!_tmp32_) {
					break;
				}
				_tmp33_ = _prop_it;
				_tmp34_ = gee_iterator_get (_tmp33_);
				prop = (GeeMapEntry*) _tmp34_;
				_tmp35_ = prop;
				_tmp36_ = gee_map_entry_get_value (_tmp35_);
				_tmp37_ = _tmp36_;
				_tmp38_ = (*((ContactsContactEditorPropertyData*) _tmp37_)).persona;
				_tmp39_ = prop;
				_tmp40_ = gee_map_entry_get_key (_tmp39_);
				_tmp41_ = _tmp40_;
				_tmp42_ = prop;
				_tmp43_ = gee_map_entry_get_value (_tmp42_);
				_tmp44_ = _tmp43_;
				_tmp45_ = (*((ContactsContactEditorPropertyData*) _tmp44_)).value;
				contacts_contact_set_persona_property (_tmp38_, (const gchar*) _tmp41_, &_tmp45_, ______lambda94__gasync_ready_callback, g_object_ref (self));
				_g_object_unref0 (prop);
			}
			_g_object_unref0 (_prop_it);
		}
		_tmp46_ = self->priv->editor;
		_tmp47_ = contacts_contact_editor_name_changed (_tmp46_);
		if (_tmp47_) {
			GValue v = {0};
			ContactsContactEditor* _tmp48_ = NULL;
			GValue _tmp49_ = {0};
			ContactsContact* _tmp50_ = NULL;
			GValue _tmp51_ = {0};
			_tmp48_ = self->priv->editor;
			contacts_contact_editor_get_full_name_value (_tmp48_, &_tmp49_);
			v = _tmp49_;
			_tmp50_ = self->contact;
			_tmp51_ = v;
			contacts_contact_set_individual_property (_tmp50_, "full-name", &_tmp51_, _____lambda95__gasync_ready_callback, g_object_ref (self));
			G_IS_VALUE (&v) ? (g_value_unset (&v), NULL) : NULL;
		}
		_tmp52_ = self->priv->editor;
		contacts_contact_editor_clear (_tmp52_);
		_tmp53_ = self->priv->sheet;
		contacts_contact_sheet_clear (_tmp53_);
		_tmp54_ = self->priv->sheet;
		_tmp55_ = self->contact;
		contacts_contact_sheet_update (_tmp54_, _tmp55_);
		gtk_notebook_set_current_page ((GtkNotebook*) self, 1);
	}
}


static void g_cclosure_user_marshal_VOID__STRING_STRING_OBJECT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
	typedef void (*GMarshalFunc_VOID__STRING_STRING_OBJECT) (gpointer data1, const char* arg_1, const char* arg_2, gpointer arg_3, gpointer data2);
	register GMarshalFunc_VOID__STRING_STRING_OBJECT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 4);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__STRING_STRING_OBJECT) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_string (param_values + 1), g_value_get_string (param_values + 2), g_value_get_object (param_values + 3), data2);
}


static void contacts_contact_pane_class_init (ContactsContactPaneClass * klass) {
	contacts_contact_pane_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ContactsContactPanePrivate));
	G_OBJECT_CLASS (klass)->finalize = contacts_contact_pane_finalize;
	g_signal_new ("contacts_linked", CONTACTS_TYPE_CONTACT_PANE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_STRING_OBJECT, G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_STRING, CONTACTS_TYPE_LINK_OPERATION);
	g_signal_new ("will_delete", CONTACTS_TYPE_CONTACT_PANE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, CONTACTS_TYPE_CONTACT);
}


static void contacts_contact_pane_instance_init (ContactsContactPane * self) {
	self->priv = CONTACTS_CONTACT_PANE_GET_PRIVATE (self);
}


static void contacts_contact_pane_finalize (GObject* obj) {
	ContactsContactPane * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONTACTS_TYPE_CONTACT_PANE, ContactsContactPane);
	_g_object_unref0 (self->priv->contacts_store);
	_g_object_unref0 (self->contact);
	_g_object_unref0 (self->priv->no_selection_frame);
	_g_object_unref0 (self->priv->sheet);
	_g_object_unref0 (self->priv->editor);
	_g_object_unref0 (self->priv->linked_button);
	_g_object_unref0 (self->priv->remove_button);
	_g_object_unref0 (self->priv->nickname_item);
	_g_object_unref0 (self->priv->birthday_item);
	_g_object_unref0 (self->priv->notes_item);
	_g_object_unref0 (self->suggestion_grid);
	G_OBJECT_CLASS (contacts_contact_pane_parent_class)->finalize (obj);
}


GType contacts_contact_pane_get_type (void) {
	static volatile gsize contacts_contact_pane_type_id__volatile = 0;
	if (g_once_init_enter (&contacts_contact_pane_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ContactsContactPaneClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) contacts_contact_pane_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ContactsContactPane), 0, (GInstanceInitFunc) contacts_contact_pane_instance_init, NULL };
		GType contacts_contact_pane_type_id;
		contacts_contact_pane_type_id = g_type_register_static (GTK_TYPE_NOTEBOOK, "ContactsContactPane", &g_define_type_info, 0);
		g_once_init_leave (&contacts_contact_pane_type_id__volatile, contacts_contact_pane_type_id);
	}
	return contacts_contact_pane_type_id__volatile;
}



