/* contacts-app.c generated by valac 0.20.1.71-45f6, the Vala compiler
 * generated from contacts-app.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 <libgd/gd.h>
#include <stdlib.h>
#include <string.h>
#include <gdk/gdk.h>
#include <folks/folks.h>
#include <glib/gi18n-lib.h>
#include <folks/folks-eds.h>
#include <contacts-esd-setup.h>
#include <libedataserver/libedataserver.h>
#include <config.h>
#include <pango/pango.h>
#include <float.h>
#include <math.h>
#include <gee.h>


#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 _ContactsAppPrivate ContactsAppPrivate;

#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 CONTACTS_TYPE_WINDOW (contacts_window_get_type ())
#define CONTACTS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_WINDOW, ContactsWindow))
#define CONTACTS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_WINDOW, ContactsWindowClass))
#define CONTACTS_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_WINDOW))
#define CONTACTS_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_WINDOW))
#define CONTACTS_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_WINDOW, ContactsWindowClass))

typedef struct _ContactsWindow ContactsWindow;
typedef struct _ContactsWindowClass ContactsWindowClass;

#define CONTACTS_TYPE_LIST_PANE (contacts_list_pane_get_type ())
#define CONTACTS_LIST_PANE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_LIST_PANE, ContactsListPane))
#define CONTACTS_LIST_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_LIST_PANE, ContactsListPaneClass))
#define CONTACTS_IS_LIST_PANE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_LIST_PANE))
#define CONTACTS_IS_LIST_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_LIST_PANE))
#define CONTACTS_LIST_PANE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_LIST_PANE, ContactsListPaneClass))

typedef struct _ContactsListPane ContactsListPane;
typedef struct _ContactsListPaneClass ContactsListPaneClass;

#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;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#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;
typedef struct _ContactsListPanePrivate ContactsListPanePrivate;
typedef struct _ContactsContactPanePrivate ContactsContactPanePrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block1Data Block1Data;
typedef struct _ContactsContactPrivate ContactsContactPrivate;
typedef struct _Block2Data Block2Data;
typedef struct _ContactsAppShowIndividualData ContactsAppShowIndividualData;

#define CONTACTS_TYPE_ACCOUNTS_LIST (contacts_accounts_list_get_type ())
#define CONTACTS_ACCOUNTS_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_ACCOUNTS_LIST, ContactsAccountsList))
#define CONTACTS_ACCOUNTS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_ACCOUNTS_LIST, ContactsAccountsListClass))
#define CONTACTS_IS_ACCOUNTS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_ACCOUNTS_LIST))
#define CONTACTS_IS_ACCOUNTS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_ACCOUNTS_LIST))
#define CONTACTS_ACCOUNTS_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_ACCOUNTS_LIST, ContactsAccountsListClass))

typedef struct _ContactsAccountsList ContactsAccountsList;
typedef struct _ContactsAccountsListClass ContactsAccountsListClass;
typedef struct _Block3Data Block3Data;
typedef struct _ContactsAccountsListPrivate ContactsAccountsListPrivate;
typedef struct _Block4Data Block4Data;
typedef struct _Block5Data Block5Data;
typedef struct _ContactsAppShowByEmailData ContactsAppShowByEmailData;
typedef struct _Block6Data Block6Data;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))

#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_SETUP_WINDOW (contacts_setup_window_get_type ())
#define CONTACTS_SETUP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_SETUP_WINDOW, ContactsSetupWindow))
#define CONTACTS_SETUP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_SETUP_WINDOW, ContactsSetupWindowClass))
#define CONTACTS_IS_SETUP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_SETUP_WINDOW))
#define CONTACTS_IS_SETUP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_SETUP_WINDOW))
#define CONTACTS_SETUP_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_SETUP_WINDOW, ContactsSetupWindowClass))

typedef struct _ContactsSetupWindow ContactsSetupWindow;
typedef struct _ContactsSetupWindowClass ContactsSetupWindowClass;
typedef struct _Block7Data Block7Data;
typedef struct _ContactsSetupWindowPrivate ContactsSetupWindowPrivate;
typedef struct _Block8Data Block8Data;

#define CONTACTS_TYPE_NEW_CONTACT_DIALOG (contacts_new_contact_dialog_get_type ())
#define CONTACTS_NEW_CONTACT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_NEW_CONTACT_DIALOG, ContactsNewContactDialog))
#define CONTACTS_NEW_CONTACT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_NEW_CONTACT_DIALOG, ContactsNewContactDialogClass))
#define CONTACTS_IS_NEW_CONTACT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_NEW_CONTACT_DIALOG))
#define CONTACTS_IS_NEW_CONTACT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_NEW_CONTACT_DIALOG))
#define CONTACTS_NEW_CONTACT_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_NEW_CONTACT_DIALOG, ContactsNewContactDialogClass))

typedef struct _ContactsNewContactDialog ContactsNewContactDialog;
typedef struct _ContactsNewContactDialogClass ContactsNewContactDialogClass;

#define CONTACTS_TYPE_LINK_OPERATION2 (contacts_link_operation2_get_type ())
#define CONTACTS_LINK_OPERATION2(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_LINK_OPERATION2, ContactsLinkOperation2))
#define CONTACTS_LINK_OPERATION2_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_LINK_OPERATION2, ContactsLinkOperation2Class))
#define CONTACTS_IS_LINK_OPERATION2(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_LINK_OPERATION2))
#define CONTACTS_IS_LINK_OPERATION2_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_LINK_OPERATION2))
#define CONTACTS_LINK_OPERATION2_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_LINK_OPERATION2, ContactsLinkOperation2Class))

typedef struct _ContactsLinkOperation2 ContactsLinkOperation2;
typedef struct _ContactsLinkOperation2Class ContactsLinkOperation2Class;
typedef struct _Block9Data Block9Data;
typedef struct _Block10Data Block10Data;
typedef struct _Block11Data Block11Data;
typedef struct _Block12Data Block12Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_option_context_free0(var) ((var == NULL) ? NULL : (var = (g_option_context_free (var), NULL)))

struct _ContactsApp {
	GtkApplication parent_instance;
	ContactsAppPrivate * priv;
	GSettings* settings;
	ContactsStore* contacts_store;
	ContactsWindow* window;
};

struct _ContactsAppClass {
	GtkApplicationClass parent_class;
};

struct _ContactsAppPrivate {
	GtkOverlay* overlay;
	GdMainToolbar* left_toolbar;
	GtkToggleButton* select_button;
	ContactsListPane* list_pane;
	GtkToolbar* right_toolbar;
	GtkLabel* contact_name;
	GtkButton* edit_button;
	GtkButton* done_button;
	ContactsContactPane* contacts_pane;
	GtkOverlay* right_overlay;
};

struct _ContactsListPane {
	GtkFrame parent_instance;
	ContactsListPanePrivate * priv;
	GtkSearchEntry* filter_entry;
};

struct _ContactsListPaneClass {
	GtkFrameClass parent_class;
};

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

struct _ContactsContactPaneClass {
	GtkNotebookClass parent_class;
};

struct _Block1Data {
	int _ref_count_;
	ContactsApp * self;
	gchar* id;
	gpointer _async_data_;
};

typedef gboolean (*ContactsStoreContactMatcher) (ContactsContact* c, void* user_data);
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 _Block2Data {
	int _ref_count_;
	Block1Data * _data1_;
	GtkMessageDialog* dialog;
};

struct _ContactsAppShowIndividualData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	ContactsApp* self;
	gchar* id;
	Block1Data* _data1_;
	const gchar* _tmp0_;
	ContactsContact* contact;
	ContactsStore* _tmp1_;
	ContactsContact* _tmp2_;
	ContactsContact* _tmp3_;
	ContactsListPane* _tmp4_;
	ContactsContact* _tmp5_;
	ContactsContactPane* _tmp6_;
	ContactsContact* _tmp7_;
	Block2Data* _data2_;
	ContactsApp* _tmp8_;
	ContactsWindow* _tmp9_;
	const gchar* _tmp10_;
	const gchar* _tmp11_;
	GtkMessageDialog* _tmp12_;
	GtkMessageDialog* _tmp13_;
	const gchar* _tmp14_;
	GtkMessageDialog* _tmp15_;
	GtkMessageDialog* _tmp16_;
};

struct _Block3Data {
	int _ref_count_;
	ContactsApp * self;
	GtkDialog* dialog;
	ContactsAccountsList* acc;
};

struct _ContactsAccountsList {
	GtkFrame parent_instance;
	ContactsAccountsListPrivate * priv;
	FolksPersonaStore* selected_store;
};

struct _ContactsAccountsListClass {
	GtkFrameClass parent_class;
};

struct _Block4Data {
	int _ref_count_;
	ContactsApp * self;
	gchar* email_address;
	gpointer _async_data_;
};

struct _Block5Data {
	int _ref_count_;
	Block4Data * _data4_;
	GtkMessageDialog* dialog;
};

struct _ContactsAppShowByEmailData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	ContactsApp* self;
	gchar* email_address;
	Block4Data* _data4_;
	const gchar* _tmp0_;
	ContactsContact* contact;
	ContactsStore* _tmp1_;
	ContactsContact* _tmp2_;
	ContactsContact* _tmp3_;
	ContactsListPane* _tmp4_;
	ContactsContact* _tmp5_;
	ContactsContactPane* _tmp6_;
	ContactsContact* _tmp7_;
	Block5Data* _data5_;
	ContactsApp* _tmp8_;
	ContactsWindow* _tmp9_;
	const gchar* _tmp10_;
	const gchar* _tmp11_;
	GtkMessageDialog* _tmp12_;
	GtkMessageDialog* _tmp13_;
	const gchar* _tmp14_;
	GtkMessageDialog* _tmp15_;
	GtkMessageDialog* _tmp16_;
};

struct _Block6Data {
	int _ref_count_;
	ContactsApp * self;
	GSimpleAction* view_action;
};

struct _Block7Data {
	int _ref_count_;
	ContactsApp * self;
	ContactsSetupWindow* setup;
};

struct _ContactsSetupWindow {
	GtkWindow parent_instance;
	ContactsSetupWindowPrivate * priv;
	gboolean succeeded;
};

struct _ContactsSetupWindowClass {
	GtkWindowClass parent_class;
};

struct _Block8Data {
	int _ref_count_;
	ContactsApp * self;
	gulong id;
	guint id2;
};

struct _Block9Data {
	int _ref_count_;
	ContactsApp * self;
	ContactsLinkOperation2* operation;
	GdNotification* notification;
};

struct _Block10Data {
	int _ref_count_;
	ContactsApp * self;
	GdNotification* notification;
	gboolean really_delete;
	GeeLinkedList* contact_list;
};

struct _Block11Data {
	int _ref_count_;
	ContactsApp * self;
	GdNotification* notification;
	gboolean really_delete;
	ContactsContact* contact;
};

struct _Block12Data {
	int _ref_count_;
	ContactsApp * self;
	GdNotification* notification;
	ContactsLinkOperation* operation;
};


static gpointer contacts_app_parent_class = NULL;
extern ContactsApp* contacts_app_app;
ContactsApp* contacts_app_app = NULL;
static gchar* contacts_app_individual_id;
static gchar* contacts_app_individual_id = NULL;
static gchar* contacts_app_email_address;
static gchar* contacts_app_email_address = NULL;

GType contacts_app_get_type (void) G_GNUC_CONST;
GType contacts_store_get_type (void) G_GNUC_CONST;
GType contacts_window_get_type (void) G_GNUC_CONST;
GType contacts_list_pane_get_type (void) G_GNUC_CONST;
GType contacts_contact_pane_get_type (void) G_GNUC_CONST;
#define CONTACTS_APP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CONTACTS_TYPE_APP, ContactsAppPrivate))
enum  {
	CONTACTS_APP_DUMMY_PROPERTY
};
static gboolean contacts_app_window_delete_event (ContactsApp* self, GdkEventAny* event);
GType contacts_contact_get_type (void) G_GNUC_CONST;
void contacts_contact_pane_show_contact (ContactsContactPane* self, ContactsContact* new_contact, gboolean edit, gboolean show_matches);
static gboolean contacts_app_window_key_press_event (ContactsApp* self, GdkEventKey* event);
void contacts_utils_grab_entry_focus_no_select (GtkEntry* entry);
static void contacts_app_selection_changed (ContactsApp* self, ContactsContact* new_selection);
void contacts_contact_pane_set_edit_mode (ContactsContactPane* self, gboolean on_edit);
void contacts_app_show_contact (ContactsApp* self, ContactsContact* contact);
void contacts_list_pane_select_contact (ContactsListPane* self, ContactsContact* contact, gboolean ignore_change);
static void contacts_app_show_individual_data_free (gpointer _data);
void contacts_app_show_individual (ContactsApp* self, const gchar* id, GAsyncReadyCallback _callback_, gpointer _user_data_);
void contacts_app_show_individual_finish (ContactsApp* self, GAsyncResult* _res_);
static gboolean contacts_app_show_individual_co (ContactsAppShowIndividualData* _data_);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
void contacts_store_find_contact (ContactsStore* self, ContactsStoreContactMatcher matcher, void* matcher_target, GAsyncReadyCallback _callback_, gpointer _user_data_);
ContactsContact* contacts_store_find_contact_finish (ContactsStore* self, GAsyncResult* _res_);
static gboolean __lambda93_ (Block1Data* _data1_, ContactsContact* c);
static gboolean ___lambda93__contacts_store_contact_matcher (ContactsContact* c, gpointer self);
static void contacts_app_show_individual_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static void ___lambda94_ (Block2Data* _data2_, gint id);
static void ____lambda94__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self);
void contacts_app_change_address_book (ContactsApp* self);
GType contacts_accounts_list_get_type (void) G_GNUC_CONST;
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
static void __lambda95_ (Block3Data* _data3_);
static void ___lambda95__gtk_button_clicked (GtkButton* _sender, gpointer self);
ContactsAccountsList* contacts_accounts_list_new (void);
ContactsAccountsList* contacts_accounts_list_construct (GType object_type);
void contacts_accounts_list_update_contents (ContactsAccountsList* self, gboolean select_active);
static void __lambda97_ (Block3Data* _data3_, gint response);
void contacts_store_refresh (ContactsStore* self);
static void ___lambda97__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self);
void contacts_app_show_help (ContactsApp* self);
void contacts_app_show_about (ContactsApp* self);
static void contacts_app_show_by_email_data_free (gpointer _data);
void contacts_app_show_by_email (ContactsApp* self, const gchar* email_address, GAsyncReadyCallback _callback_, gpointer _user_data_);
void contacts_app_show_by_email_finish (ContactsApp* self, GAsyncResult* _res_);
static gboolean contacts_app_show_by_email_co (ContactsAppShowByEmailData* _data_);
static Block4Data* block4_data_ref (Block4Data* _data4_);
static void block4_data_unref (void * _userdata_);
static gboolean __lambda98_ (Block4Data* _data4_, ContactsContact* c);
gboolean contacts_contact_has_email (ContactsContact* self, const gchar* email_address);
static gboolean ___lambda98__contacts_store_contact_matcher (ContactsContact* c, gpointer self);
static void contacts_app_show_by_email_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static Block5Data* block5_data_ref (Block5Data* _data5_);
static void block5_data_unref (void * _userdata_);
static void ___lambda99_ (Block5Data* _data5_, gint id);
static void ____lambda99__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self);
static void contacts_app_create_window (ContactsApp* self);
static Block6Data* block6_data_ref (Block6Data* _data6_);
static void block6_data_unref (void * _userdata_);
static void __lambda100_ (ContactsApp* self);
static void ___lambda100__g_simple_action_activate (GSimpleAction* _sender, GVariant* parameter, gpointer self);
static void __lambda101_ (ContactsApp* self);
static void ___lambda101__g_simple_action_activate (GSimpleAction* _sender, GVariant* parameter, gpointer self);
static void __lambda102_ (ContactsApp* self);
static void ___lambda102__g_simple_action_activate (GSimpleAction* _sender, GVariant* parameter, gpointer self);
static void __lambda103_ (ContactsApp* self);
static void ___lambda103__g_simple_action_activate (GSimpleAction* _sender, GVariant* parameter, gpointer self);
static void __lambda104_ (ContactsApp* self);
void contacts_app_new_contact (ContactsApp* self);
static void ___lambda104__g_simple_action_activate (GSimpleAction* _sender, GVariant* parameter, gpointer self);
static void __lambda112_ (Block6Data* _data6_);
void contacts_list_pane_refilter (ContactsListPane* self);
static void ___lambda112__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
static void __lambda113_ (ContactsApp* self, GSimpleAction* act, GVariant* parameter);
static void ___lambda113__g_simple_action_activate (GSimpleAction* _sender, GVariant* parameter, gpointer self);
GtkBuilder* contacts_load_ui (const gchar* ui);
ContactsWindow* contacts_window_new (GtkApplication* app);
ContactsWindow* contacts_window_construct (GType object_type, GtkApplication* app);
static gboolean _contacts_app_window_delete_event_gtk_widget_delete_event (GtkWidget* _sender, GdkEventAny* event, gpointer self);
static gboolean _contacts_app_window_key_press_event_gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self);
static void _contacts_app_new_contact_gtk_button_clicked (GtkButton* _sender, gpointer self);
static gboolean __lambda114_ (ContactsApp* self, GtkOverlay* overlay, GtkWidget* widget, GdkRectangle* alloc);
static gboolean ___lambda114__gtk_overlay_get_child_position (GtkOverlay* _sender, GtkWidget* widget, GdkRectangle* allocation, gpointer self);
ContactsListPane* contacts_list_pane_new (ContactsStore* contacts_store);
ContactsListPane* contacts_list_pane_construct (GType object_type, ContactsStore* contacts_store);
static void _contacts_app_selection_changed_contacts_list_pane_selection_changed (ContactsListPane* _sender, ContactsContact* contact, gpointer self);
static void contacts_app_link_contacts (ContactsApp* self, GeeLinkedList* contact_list);
static void _contacts_app_link_contacts_contacts_list_pane_link_contacts (ContactsListPane* _sender, GeeLinkedList* contacts_list, gpointer self);
static void contacts_app_delete_contacts (ContactsApp* self, GeeLinkedList* contact_list);
static void _contacts_app_delete_contacts_contacts_list_pane_delete_contacts (ContactsListPane* _sender, GeeLinkedList* contacts_list, gpointer self);
ContactsContactPane* contacts_contact_pane_new (ContactsStore* contacts_store);
ContactsContactPane* contacts_contact_pane_construct (GType object_type, ContactsStore* contacts_store);
static void contacts_app_delete_contact (ContactsApp* self, ContactsContact* contact);
static void _contacts_app_delete_contact_contacts_contact_pane_will_delete (ContactsContactPane* _sender, ContactsContact* contact, gpointer self);
GType contacts_link_operation_get_type (void) G_GNUC_CONST;
static void contacts_app_contacts_linked (ContactsApp* self, const gchar* main_contact, const gchar* linked_contact, ContactsLinkOperation* operation);
static void _contacts_app_contacts_linked_contacts_contact_pane_contacts_linked (ContactsContactPane* _sender, const gchar* main_contact, const gchar* linked_contact, ContactsLinkOperation* operation, gpointer self);
static void __lambda123_ (ContactsApp* self);
void contacts_list_pane_show_selection (ContactsListPane* self);
void contacts_list_pane_hide_selection (ContactsListPane* self);
static void ___lambda123__gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self);
static void __lambda124_ (ContactsApp* self);
const gchar* contacts_contact_get_display_name (ContactsContact* self);
static void ___lambda124__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void __lambda125_ (ContactsApp* self);
static void ___lambda125__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void contacts_app_real_startup (GApplication* base);
ContactsStore* contacts_store_new (void);
ContactsStore* contacts_store_construct (GType object_type);
static void contacts_app_show_setup (ContactsApp* self);
GType contacts_setup_window_get_type (void) G_GNUC_CONST;
static Block7Data* block7_data_ref (Block7Data* _data7_);
static void block7_data_unref (void * _userdata_);
ContactsSetupWindow* contacts_setup_window_new (void);
ContactsSetupWindow* contacts_setup_window_construct (GType object_type);
static void __lambda130_ (Block7Data* _data7_);
static void ___lambda130__gtk_widget_destroy (GtkWidget* _sender, gpointer self);
static void contacts_app_real_activate (GApplication* base);
gboolean contacts_store_get_is_prepared (ContactsStore* self);
static Block8Data* block8_data_ref (Block8Data* _data8_);
static void block8_data_unref (void * _userdata_);
static void _____lambda131_ (Block8Data* _data8_);
static void ______lambda131__contacts_store_prepared (ContactsStore* _sender, gpointer self);
static gboolean _____lambda132_ (Block8Data* _data8_);
static gboolean ______lambda132__gsource_func (gpointer self);
static void ___lambda133_ (ContactsApp* self);
static void ____lambda133__contacts_store_quiescent (ContactsStore* _sender, gpointer self);
static gboolean ___lambda134_ (ContactsApp* self);
static gboolean ____lambda134__gsource_func (gpointer self);
void contacts_app_show_message (ContactsApp* self, const gchar* message);
GType contacts_new_contact_dialog_get_type (void) G_GNUC_CONST;
ContactsNewContactDialog* contacts_new_contact_dialog_get_default (ContactsStore* contacts_store, ContactsWindow* parent);
GType contacts_link_operation2_get_type (void) G_GNUC_CONST;
static Block9Data* block9_data_ref (Block9Data* _data9_);
static void block9_data_unref (void * _userdata_);
void contacts_link_contacts_list (GeeLinkedList* contact_list, GAsyncReadyCallback _callback_, gpointer _user_data_);
ContactsLinkOperation2* contacts_link_contacts_list_finish (GAsyncResult* _res_);
static void __lambda115_ (Block9Data* _data9_, GObject* obj, GAsyncResult* _result_);
static void ___lambda115__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static void __lambda116_ (Block9Data* _data9_);
void contacts_link_operation2_undo (ContactsLinkOperation2* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
void contacts_link_operation2_undo_finish (ContactsLinkOperation2* self, GAsyncResult* _res_);
static void ___lambda116__gtk_button_clicked (GtkButton* _sender, gpointer self);
static Block10Data* block10_data_ref (Block10Data* _data10_);
static void block10_data_unref (void * _userdata_);
static void __lambda117_ (Block10Data* _data10_);
void contacts_contact_remove_personas (ContactsContact* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
void contacts_contact_remove_personas_finish (ContactsContact* self, GAsyncResult* _res_, GError** error);
static void ___lambda117__gd_notification_dismissed (GdNotification* _sender, gpointer self);
static void __lambda118_ (Block10Data* _data10_);
void contacts_contact_show (ContactsContact* self);
static void ___lambda118__gtk_button_clicked (GtkButton* _sender, gpointer self);
static Block11Data* block11_data_ref (Block11Data* _data11_);
static void block11_data_unref (void * _userdata_);
static void __lambda119_ (Block11Data* _data11_);
static void ___lambda120_ (Block11Data* _data11_);
static void ____lambda120__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static void ___lambda119__gd_notification_dismissed (GdNotification* _sender, gpointer self);
static void __lambda121_ (Block11Data* _data11_);
static void ___lambda121__gtk_button_clicked (GtkButton* _sender, gpointer self);
static Block12Data* block12_data_ref (Block12Data* _data12_);
static void block12_data_unref (void * _userdata_);
static void __lambda122_ (Block12Data* _data12_);
void contacts_link_operation_undo (ContactsLinkOperation* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
void contacts_link_operation_undo_finish (ContactsLinkOperation* self, GAsyncResult* _res_);
static void ___lambda122__gtk_button_clicked (GtkButton* _sender, gpointer self);
static gint contacts_app_real_command_line (GApplication* base, GApplicationCommandLine* command_line);
FolksPersonaStore** contacts_app_get_eds_address_books (int* result_length1);
FolksBackendStore* contacts_store_get_backend_store (ContactsStore* self);
static void _vala_array_add1 (FolksPersonaStore*** array, int* length, int* size, FolksPersonaStore* value);
ContactsApp* contacts_app_new (void);
ContactsApp* contacts_app_construct (GType object_type);
static void contacts_app_finalize (GObject* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);

static const GOptionEntry CONTACTS_APP_options[3] = {{"individual", 'i', 0, G_OPTION_ARG_STRING, &contacts_app_individual_id, "Show contact with this individual id", NULL}, {"email", 'e', 0, G_OPTION_ARG_STRING, &contacts_app_email_address, "Show contact with this email address", NULL}, {NULL}};

static gboolean contacts_app_window_delete_event (ContactsApp* self, GdkEventAny* event) {
	gboolean result = FALSE;
	ContactsContactPane* _tmp0_ = NULL;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = self->priv->contacts_pane;
	contacts_contact_pane_show_contact (_tmp0_, NULL, FALSE, TRUE);
	result = FALSE;
	return result;
}


static gboolean contacts_app_window_key_press_event (ContactsApp* self, GdkEventKey* event) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	GdkEventKey _tmp1_ = {0};
	guint _tmp2_ = 0U;
	guint _tmp3_ = 0U;
	gboolean _tmp6_ = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp1_ = *event;
	_tmp2_ = _tmp1_.keyval;
	_tmp3_ = gdk_keyval_from_name ("q");
	if (_tmp2_ == _tmp3_) {
		GdkEventKey _tmp4_ = {0};
		GdkModifierType _tmp5_ = 0;
		_tmp4_ = *event;
		_tmp5_ = _tmp4_.state;
		_tmp0_ = (_tmp5_ & GDK_CONTROL_MASK) != 0;
	} else {
		_tmp0_ = FALSE;
	}
	_tmp6_ = _tmp0_;
	if (_tmp6_) {
		ContactsContactPane* _tmp7_ = NULL;
		ContactsWindow* _tmp8_ = NULL;
		_tmp7_ = self->priv->contacts_pane;
		contacts_contact_pane_show_contact (_tmp7_, NULL, FALSE, TRUE);
		_tmp8_ = self->window;
		gtk_widget_destroy ((GtkWidget*) _tmp8_);
	} else {
		gboolean _tmp9_ = FALSE;
		gboolean _tmp10_ = FALSE;
		GdkEventKey _tmp11_ = {0};
		guint _tmp12_ = 0U;
		gboolean _tmp15_ = FALSE;
		gboolean _tmp18_ = FALSE;
		_tmp11_ = *event;
		_tmp12_ = _tmp11_.keyval;
		if (_tmp12_ == ((guint) GDK_KEY_s)) {
			_tmp10_ = TRUE;
		} else {
			GdkEventKey _tmp13_ = {0};
			guint _tmp14_ = 0U;
			_tmp13_ = *event;
			_tmp14_ = _tmp13_.keyval;
			_tmp10_ = _tmp14_ == ((guint) GDK_KEY_f);
		}
		_tmp15_ = _tmp10_;
		if (_tmp15_) {
			GdkEventKey _tmp16_ = {0};
			GdkModifierType _tmp17_ = 0;
			_tmp16_ = *event;
			_tmp17_ = _tmp16_.state;
			_tmp9_ = (_tmp17_ & GDK_CONTROL_MASK) != 0;
		} else {
			_tmp9_ = FALSE;
		}
		_tmp18_ = _tmp9_;
		if (_tmp18_) {
			ContactsListPane* _tmp19_ = NULL;
			GtkSearchEntry* _tmp20_ = NULL;
			_tmp19_ = self->priv->list_pane;
			_tmp20_ = _tmp19_->filter_entry;
			contacts_utils_grab_entry_focus_no_select ((GtkEntry*) _tmp20_);
		} else {
			gboolean _tmp21_ = FALSE;
			gboolean _tmp22_ = FALSE;
			gboolean _tmp23_ = FALSE;
			gboolean _tmp24_ = FALSE;
			gboolean _tmp25_ = FALSE;
			gboolean _tmp26_ = FALSE;
			GdkEventKey _tmp27_ = {0};
			gint _tmp28_ = 0;
			gboolean _tmp32_ = FALSE;
			gboolean _tmp35_ = FALSE;
			gboolean _tmp38_ = FALSE;
			gboolean _tmp41_ = FALSE;
			gboolean _tmp44_ = FALSE;
			gboolean _tmp47_ = FALSE;
			_tmp27_ = *event;
			_tmp28_ = _tmp27_.length;
			if (_tmp28_ >= 1) {
				GdkEventKey _tmp29_ = {0};
				guint _tmp30_ = 0U;
				guint32 _tmp31_ = 0U;
				_tmp29_ = *event;
				_tmp30_ = _tmp29_.keyval;
				_tmp31_ = gdk_keyval_to_unicode (_tmp30_);
				_tmp26_ = _tmp31_ != ((guint32) 0);
			} else {
				_tmp26_ = FALSE;
			}
			_tmp32_ = _tmp26_;
			if (_tmp32_) {
				GdkEventKey _tmp33_ = {0};
				GdkModifierType _tmp34_ = 0;
				_tmp33_ = *event;
				_tmp34_ = _tmp33_.state;
				_tmp25_ = (_tmp34_ & GDK_CONTROL_MASK) == 0;
			} else {
				_tmp25_ = FALSE;
			}
			_tmp35_ = _tmp25_;
			if (_tmp35_) {
				GdkEventKey _tmp36_ = {0};
				GdkModifierType _tmp37_ = 0;
				_tmp36_ = *event;
				_tmp37_ = _tmp36_.state;
				_tmp24_ = (_tmp37_ & GDK_MOD1_MASK) == 0;
			} else {
				_tmp24_ = FALSE;
			}
			_tmp38_ = _tmp24_;
			if (_tmp38_) {
				GdkEventKey _tmp39_ = {0};
				guint _tmp40_ = 0U;
				_tmp39_ = *event;
				_tmp40_ = _tmp39_.keyval;
				_tmp23_ = _tmp40_ != ((guint) GDK_KEY_Escape);
			} else {
				_tmp23_ = FALSE;
			}
			_tmp41_ = _tmp23_;
			if (_tmp41_) {
				GdkEventKey _tmp42_ = {0};
				guint _tmp43_ = 0U;
				_tmp42_ = *event;
				_tmp43_ = _tmp42_.keyval;
				_tmp22_ = _tmp43_ != ((guint) GDK_KEY_Tab);
			} else {
				_tmp22_ = FALSE;
			}
			_tmp44_ = _tmp22_;
			if (_tmp44_) {
				GdkEventKey _tmp45_ = {0};
				guint _tmp46_ = 0U;
				_tmp45_ = *event;
				_tmp46_ = _tmp45_.keyval;
				_tmp21_ = _tmp46_ != ((guint) GDK_KEY_BackSpace);
			} else {
				_tmp21_ = FALSE;
			}
			_tmp47_ = _tmp21_;
			if (_tmp47_) {
				ContactsListPane* _tmp48_ = NULL;
				GtkSearchEntry* _tmp49_ = NULL;
				ContactsWindow* _tmp50_ = NULL;
				GdkEventKey _tmp51_ = {0};
				_tmp48_ = self->priv->list_pane;
				_tmp49_ = _tmp48_->filter_entry;
				contacts_utils_grab_entry_focus_no_select ((GtkEntry*) _tmp49_);
				_tmp50_ = self->window;
				_tmp51_ = *event;
				gtk_window_propagate_key_event ((GtkWindow*) _tmp50_, &_tmp51_);
			}
		}
	}
	result = FALSE;
	return result;
}


static void contacts_app_selection_changed (ContactsApp* self, ContactsContact* new_selection) {
	ContactsContactPane* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	ContactsContactPane* _tmp5_ = NULL;
	ContactsContact* _tmp6_ = NULL;
	ContactsContact* _tmp7_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->contacts_pane;
	_tmp1_ = _tmp0_->on_edit_mode;
	if (_tmp1_) {
		ContactsContactPane* _tmp2_ = NULL;
		GtkLabel* _tmp3_ = NULL;
		GtkButton* _tmp4_ = NULL;
		_tmp2_ = self->priv->contacts_pane;
		contacts_contact_pane_set_edit_mode (_tmp2_, FALSE);
		_tmp3_ = self->priv->contact_name;
		gtk_label_set_text (_tmp3_, NULL);
		_tmp4_ = self->priv->done_button;
		gtk_widget_hide ((GtkWidget*) _tmp4_);
	}
	_tmp5_ = self->priv->contacts_pane;
	_tmp6_ = new_selection;
	contacts_contact_pane_show_contact (_tmp5_, _tmp6_, FALSE, FALSE);
	_tmp7_ = new_selection;
	if (_tmp7_ != NULL) {
		GtkButton* _tmp8_ = NULL;
		_tmp8_ = self->priv->edit_button;
		gtk_widget_show ((GtkWidget*) _tmp8_);
	} else {
		GtkButton* _tmp9_ = NULL;
		_tmp9_ = self->priv->edit_button;
		gtk_widget_hide ((GtkWidget*) _tmp9_);
	}
}


void contacts_app_show_contact (ContactsApp* self, ContactsContact* contact) {
	ContactsListPane* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	ContactsContact* _tmp2_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->list_pane;
	_tmp1_ = contact;
	contacts_list_pane_select_contact (_tmp0_, _tmp1_, FALSE);
	_tmp2_ = contact;
	contacts_app_selection_changed (self, _tmp2_);
}


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


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


void contacts_app_show_individual (ContactsApp* self, const gchar* id, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	ContactsAppShowIndividualData* _data_;
	ContactsApp* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	_data_ = g_slice_new0 (ContactsAppShowIndividualData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, contacts_app_show_individual);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, contacts_app_show_individual_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = id;
	_tmp2_ = g_strdup (_tmp1_);
	_g_free0 (_data_->id);
	_data_->id = _tmp2_;
	contacts_app_show_individual_co (_data_);
}


void contacts_app_show_individual_finish (ContactsApp* self, GAsyncResult* _res_) {
	ContactsAppShowIndividualData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static Block1Data* block1_data_ref (Block1Data* _data1_) {
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}


static void block1_data_unref (void * _userdata_) {
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		ContactsApp * self;
		self = _data1_->self;
		_g_free0 (_data1_->id);
		_g_object_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}


static gboolean __lambda93_ (Block1Data* _data1_, ContactsContact* c) {
	ContactsApp * self;
	gboolean result = FALSE;
	ContactsContact* _tmp0_ = NULL;
	FolksIndividual* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	self = _data1_->self;
	g_return_val_if_fail (c != NULL, FALSE);
	_tmp0_ = c;
	_tmp1_ = _tmp0_->individual;
	_tmp2_ = folks_individual_get_id (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = _data1_->id;
	result = g_strcmp0 (_tmp3_, _tmp4_) == 0;
	return result;
}


static gboolean ___lambda93__contacts_store_contact_matcher (ContactsContact* c, gpointer self) {
	gboolean result;
	result = __lambda93_ (self, c);
	return result;
}


static void contacts_app_show_individual_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	ContactsAppShowIndividualData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	contacts_app_show_individual_co (_data_);
}


static Block2Data* block2_data_ref (Block2Data* _data2_) {
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}


static void block2_data_unref (void * _userdata_) {
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		ContactsApp * self;
		self = _data2_->_data1_->self;
		_g_object_unref0 (_data2_->dialog);
		block1_data_unref (_data2_->_data1_);
		_data2_->_data1_ = NULL;
		g_slice_free (Block2Data, _data2_);
	}
}


static void ___lambda94_ (Block2Data* _data2_, gint id) {
	Block1Data* _data1_;
	ContactsApp * self;
	GtkMessageDialog* _tmp0_ = NULL;
	_data1_ = _data2_->_data1_;
	self = _data1_->self;
	_tmp0_ = _data2_->dialog;
	gtk_widget_destroy ((GtkWidget*) _tmp0_);
}


static void ____lambda94__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self) {
	___lambda94_ (self, response_id);
}


static gboolean contacts_app_show_individual_co (ContactsAppShowIndividualData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data1_ = g_slice_new0 (Block1Data);
	_data_->_data1_->_ref_count_ = 1;
	_data_->_data1_->self = g_object_ref (_data_->self);
	_data_->_tmp0_ = NULL;
	_data_->_tmp0_ = _data_->id;
	_g_free0 (_data_->_data1_->id);
	_data_->_data1_->id = _data_->_tmp0_;
	_data_->_data1_->_async_data_ = _data_;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = _data_->self->contacts_store;
	_data_->_state_ = 1;
	contacts_store_find_contact (_data_->_tmp1_, ___lambda93__contacts_store_contact_matcher, _data_->_data1_, contacts_app_show_individual_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp2_ = NULL;
	_data_->_tmp2_ = contacts_store_find_contact_finish (_data_->_tmp1_, _data_->_res_);
	_data_->contact = _data_->_tmp2_;
	_data_->_tmp3_ = NULL;
	_data_->_tmp3_ = _data_->contact;
	if (_data_->_tmp3_ != NULL) {
		_data_->_tmp4_ = NULL;
		_data_->_tmp4_ = _data_->self->priv->list_pane;
		_data_->_tmp5_ = NULL;
		_data_->_tmp5_ = _data_->contact;
		contacts_list_pane_select_contact (_data_->_tmp4_, _data_->_tmp5_, FALSE);
		_data_->_tmp6_ = NULL;
		_data_->_tmp6_ = _data_->self->priv->contacts_pane;
		_data_->_tmp7_ = NULL;
		_data_->_tmp7_ = _data_->contact;
		contacts_contact_pane_show_contact (_data_->_tmp6_, _data_->_tmp7_, FALSE, TRUE);
	} else {
		_data_->_data2_ = g_slice_new0 (Block2Data);
		_data_->_data2_->_ref_count_ = 1;
		_data_->_data2_->_data1_ = block1_data_ref (_data_->_data1_);
		_data_->_tmp8_ = NULL;
		_data_->_tmp8_ = contacts_app_app;
		_data_->_tmp9_ = NULL;
		_data_->_tmp9_ = _data_->_tmp8_->window;
		_data_->_tmp10_ = NULL;
		_data_->_tmp10_ = _ ("No contact with id %s found");
		_data_->_tmp11_ = NULL;
		_data_->_tmp11_ = _data_->_data1_->id;
		_data_->_tmp12_ = NULL;
		_data_->_tmp12_ = (GtkMessageDialog*) gtk_message_dialog_new ((GtkWindow*) _data_->_tmp9_, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, _data_->_tmp10_, _data_->_tmp11_);
		g_object_ref_sink (_data_->_tmp12_);
		_data_->_data2_->dialog = _data_->_tmp12_;
		_data_->_tmp13_ = NULL;
		_data_->_tmp13_ = _data_->_data2_->dialog;
		_data_->_tmp14_ = NULL;
		_data_->_tmp14_ = _ ("Contact not found");
		gtk_window_set_title ((GtkWindow*) _data_->_tmp13_, _data_->_tmp14_);
		_data_->_tmp15_ = NULL;
		_data_->_tmp15_ = _data_->_data2_->dialog;
		gtk_widget_show ((GtkWidget*) _data_->_tmp15_);
		_data_->_tmp16_ = NULL;
		_data_->_tmp16_ = _data_->_data2_->dialog;
		g_signal_connect_data ((GtkDialog*) _data_->_tmp16_, "response", (GCallback) ____lambda94__gtk_dialog_response, block2_data_ref (_data_->_data2_), (GClosureNotify) block2_data_unref, 0);
		block2_data_unref (_data_->_data2_);
		_data_->_data2_ = NULL;
	}
	_g_object_unref0 (_data_->contact);
	block1_data_unref (_data_->_data1_);
	_data_->_data1_ = NULL;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


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


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


static void __lambda95_ (Block3Data* _data3_) {
	ContactsApp * self;
	self = _data3_->self;
	gtk_dialog_response (_data3_->dialog, (gint) GTK_RESPONSE_OK);
}


static void ___lambda95__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda95_ (self);
}


static void __lambda97_ (Block3Data* _data3_, gint response) {
	ContactsApp * self;
	gint _tmp0_ = 0;
	self = _data3_->self;
	_tmp0_ = response;
	if (_tmp0_ == ((gint) GTK_RESPONSE_OK)) {
		EdsfPersonaStore* e_store = NULL;
		FolksPersonaStore* _tmp1_ = NULL;
		EdsfPersonaStore* _tmp2_ = NULL;
		EdsfPersonaStore* _tmp3_ = NULL;
		_tmp1_ = _data3_->acc->selected_store;
		_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, EDSF_TYPE_PERSONA_STORE) ? ((EdsfPersonaStore*) _tmp1_) : NULL);
		e_store = _tmp2_;
		_tmp3_ = e_store;
		if (_tmp3_ != NULL) {
			ESourceRegistry* _tmp4_ = NULL;
			EdsfPersonaStore* _tmp5_ = NULL;
			ESource* _tmp6_ = NULL;
			ESource* _tmp7_ = NULL;
			ContactsStore* _tmp8_ = NULL;
			_tmp4_ = eds_source_registry;
			_tmp5_ = e_store;
			_tmp6_ = edsf_persona_store_get_source (_tmp5_);
			_tmp7_ = _tmp6_;
			e_source_registry_set_default_address_book (_tmp4_, _tmp7_);
			_tmp8_ = self->contacts_store;
			contacts_store_refresh (_tmp8_);
		}
		_g_object_unref0 (e_store);
	}
	gtk_widget_destroy ((GtkWidget*) _data3_->dialog);
}


static void ___lambda97__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self) {
	__lambda97_ (self, response_id);
}


void contacts_app_change_address_book (ContactsApp* self) {
	Block3Data* _data3_;
	gchar* title = NULL;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	ContactsWindow* _tmp2_ = NULL;
	GtkDialog* _tmp3_ = NULL;
	GtkHeaderBar* header = NULL;
	GtkHeaderBar* _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
	GtkButton* done_button = NULL;
	const gchar* _tmp6_ = NULL;
	GtkButton* _tmp7_ = NULL;
	GtkStyleContext* _tmp8_ = NULL;
	GtkWidget* _tmp9_ = NULL;
	GtkWidget* _tmp10_ = NULL;
	GtkWidget* _tmp11_ = NULL;
	ContactsAccountsList* _tmp12_ = NULL;
	GtkBox* _tmp13_ = NULL;
	g_return_if_fail (self != NULL);
	_data3_ = g_slice_new0 (Block3Data);
	_data3_->_ref_count_ = 1;
	_data3_->self = g_object_ref (self);
	_tmp0_ = _ ("Change Address Book");
	_tmp1_ = g_strdup (_tmp0_);
	title = _tmp1_;
	_tmp2_ = self->window;
	_tmp3_ = (GtkDialog*) gtk_dialog_new_with_buttons ("", (GtkWindow*) G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, CONTACTS_TYPE_WINDOW, ContactsWindow), GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, NULL, NULL);
	g_object_ref_sink (_tmp3_);
	_data3_->dialog = _tmp3_;
	gtk_window_set_resizable ((GtkWindow*) _data3_->dialog, FALSE);
	gtk_container_set_border_width ((GtkContainer*) _data3_->dialog, (guint) 36);
	_tmp4_ = (GtkHeaderBar*) gtk_header_bar_new ();
	g_object_ref_sink (_tmp4_);
	header = _tmp4_;
	_tmp5_ = _ ("Primary Contacts Account");
	gtk_header_bar_set_title (header, _tmp5_);
	_tmp6_ = _ ("Done");
	_tmp7_ = (GtkButton*) gtk_button_new_with_label (_tmp6_);
	g_object_ref_sink (_tmp7_);
	done_button = _tmp7_;
	_tmp8_ = gtk_widget_get_style_context ((GtkWidget*) done_button);
	gtk_style_context_add_class (_tmp8_, "suggested-action");
	_tmp9_ = gtk_bin_get_child ((GtkBin*) done_button);
	g_object_set (_tmp9_, "margin", 3, NULL);
	_tmp10_ = gtk_bin_get_child ((GtkBin*) done_button);
	gtk_widget_set_margin_left (_tmp10_, 6);
	_tmp11_ = gtk_bin_get_child ((GtkBin*) done_button);
	gtk_widget_set_margin_right (_tmp11_, 6);
	g_signal_connect_data (done_button, "clicked", (GCallback) ___lambda95__gtk_button_clicked, block3_data_ref (_data3_), (GClosureNotify) block3_data_unref, 0);
	gtk_header_bar_pack_end (header, (GtkWidget*) done_button);
	gtk_window_set_titlebar ((GtkWindow*) _data3_->dialog, (GtkWidget*) header);
	_tmp12_ = contacts_accounts_list_new ();
	g_object_ref_sink (_tmp12_);
	_data3_->acc = _tmp12_;
	contacts_accounts_list_update_contents (_data3_->acc, TRUE);
	_tmp13_ = (GtkBox*) gtk_dialog_get_content_area (_data3_->dialog);
	gtk_container_add ((GtkContainer*) (G_TYPE_CHECK_INSTANCE_TYPE (_tmp13_, GTK_TYPE_BOX) ? ((GtkBox*) _tmp13_) : NULL), (GtkWidget*) _data3_->acc);
	gtk_widget_show_all ((GtkWidget*) _data3_->dialog);
	g_signal_connect_data (_data3_->dialog, "response", (GCallback) ___lambda97__gtk_dialog_response, block3_data_ref (_data3_), (GClosureNotify) block3_data_unref, 0);
	_g_object_unref0 (done_button);
	_g_object_unref0 (header);
	_g_free0 (title);
	block3_data_unref (_data3_);
	_data3_ = NULL;
}


void contacts_app_show_help (ContactsApp* self) {
	ContactsWindow* _tmp0_ = NULL;
	GdkScreen* _tmp1_ = NULL;
	guint32 _tmp2_ = 0U;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->window;
	_tmp1_ = gtk_window_get_screen ((GtkWindow*) _tmp0_);
	_tmp2_ = gtk_get_current_event_time ();
	gtk_show_uri (_tmp1_, "help:gnome-help/contacts", _tmp2_, &_inner_error_);
	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;
	}
}


void contacts_app_show_about (ContactsApp* self) {
	gchar** authors = NULL;
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gchar** _tmp2_ = NULL;
	gint authors_length1 = 0;
	gint _authors_size_ = 0;
	gchar** artists = NULL;
	gchar* _tmp3_ = NULL;
	gchar** _tmp4_ = NULL;
	gint artists_length1 = 0;
	gint _artists_size_ = 0;
	ContactsWindow* _tmp5_ = NULL;
	const gchar* _tmp6_ = NULL;
	const gchar* _tmp7_ = NULL;
	const gchar* _tmp8_ = NULL;
	const gchar* _tmp9_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup ("Alexander Larsson <alexl@redhat.com>");
	_tmp1_ = g_strdup ("Erick Pérez Castellanos <erick.red@gmail.com>");
	_tmp2_ = g_new0 (gchar*, 2 + 1);
	_tmp2_[0] = _tmp0_;
	_tmp2_[1] = _tmp1_;
	authors = _tmp2_;
	authors_length1 = 2;
	_authors_size_ = authors_length1;
	_tmp3_ = g_strdup ("Allan Day <allanpday@gmail.com>");
	_tmp4_ = g_new0 (gchar*, 1 + 1);
	_tmp4_[0] = _tmp3_;
	artists = _tmp4_;
	artists_length1 = 1;
	_artists_size_ = artists_length1;
	_tmp5_ = self->window;
	_tmp6_ = _ ("translator-credits");
	_tmp7_ = _ ("GNOME Contacts");
	_tmp8_ = _ ("About GNOME Contacts");
	_tmp9_ = _ ("Contact Management Application");
	gtk_show_about_dialog ((GtkWindow*) _tmp5_, "artists", artists, "authors", authors, "translator-credits", _tmp6_, "program-name", _tmp7_, "title", _tmp8_, "comments", _tmp9_, "copyright", "Copyright 2011 Red Hat, Inc.\nCopyright 2013 The Contacts Developers", "license-type", GTK_LICENSE_GPL_2_0, "logo-icon-name", "x-office-address-book", "version", PACKAGE_VERSION, "website", "https://live.gnome.org/Contacts", "wrap-license", TRUE, NULL);
	artists = (_vala_array_free (artists, artists_length1, (GDestroyNotify) g_free), NULL);
	authors = (_vala_array_free (authors, authors_length1, (GDestroyNotify) g_free), NULL);
}


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


void contacts_app_show_by_email (ContactsApp* self, const gchar* email_address, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	ContactsAppShowByEmailData* _data_;
	ContactsApp* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	_data_ = g_slice_new0 (ContactsAppShowByEmailData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, contacts_app_show_by_email);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, contacts_app_show_by_email_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = email_address;
	_tmp2_ = g_strdup (_tmp1_);
	_g_free0 (_data_->email_address);
	_data_->email_address = _tmp2_;
	contacts_app_show_by_email_co (_data_);
}


void contacts_app_show_by_email_finish (ContactsApp* self, GAsyncResult* _res_) {
	ContactsAppShowByEmailData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static Block4Data* block4_data_ref (Block4Data* _data4_) {
	g_atomic_int_inc (&_data4_->_ref_count_);
	return _data4_;
}


static void block4_data_unref (void * _userdata_) {
	Block4Data* _data4_;
	_data4_ = (Block4Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data4_->_ref_count_)) {
		ContactsApp * self;
		self = _data4_->self;
		_g_free0 (_data4_->email_address);
		_g_object_unref0 (self);
		g_slice_free (Block4Data, _data4_);
	}
}


static gboolean __lambda98_ (Block4Data* _data4_, ContactsContact* c) {
	ContactsApp * self;
	gboolean result = FALSE;
	ContactsContact* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	self = _data4_->self;
	g_return_val_if_fail (c != NULL, FALSE);
	_tmp0_ = c;
	_tmp1_ = _data4_->email_address;
	_tmp2_ = contacts_contact_has_email (_tmp0_, _tmp1_);
	result = _tmp2_;
	return result;
}


static gboolean ___lambda98__contacts_store_contact_matcher (ContactsContact* c, gpointer self) {
	gboolean result;
	result = __lambda98_ (self, c);
	return result;
}


static void contacts_app_show_by_email_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	ContactsAppShowByEmailData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	contacts_app_show_by_email_co (_data_);
}


static Block5Data* block5_data_ref (Block5Data* _data5_) {
	g_atomic_int_inc (&_data5_->_ref_count_);
	return _data5_;
}


static void block5_data_unref (void * _userdata_) {
	Block5Data* _data5_;
	_data5_ = (Block5Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data5_->_ref_count_)) {
		ContactsApp * self;
		self = _data5_->_data4_->self;
		_g_object_unref0 (_data5_->dialog);
		block4_data_unref (_data5_->_data4_);
		_data5_->_data4_ = NULL;
		g_slice_free (Block5Data, _data5_);
	}
}


static void ___lambda99_ (Block5Data* _data5_, gint id) {
	Block4Data* _data4_;
	ContactsApp * self;
	GtkMessageDialog* _tmp0_ = NULL;
	_data4_ = _data5_->_data4_;
	self = _data4_->self;
	_tmp0_ = _data5_->dialog;
	gtk_widget_destroy ((GtkWidget*) _tmp0_);
}


static void ____lambda99__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self) {
	___lambda99_ (self, response_id);
}


static gboolean contacts_app_show_by_email_co (ContactsAppShowByEmailData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data4_ = g_slice_new0 (Block4Data);
	_data_->_data4_->_ref_count_ = 1;
	_data_->_data4_->self = g_object_ref (_data_->self);
	_data_->_tmp0_ = NULL;
	_data_->_tmp0_ = _data_->email_address;
	_g_free0 (_data_->_data4_->email_address);
	_data_->_data4_->email_address = _data_->_tmp0_;
	_data_->_data4_->_async_data_ = _data_;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = _data_->self->contacts_store;
	_data_->_state_ = 1;
	contacts_store_find_contact (_data_->_tmp1_, ___lambda98__contacts_store_contact_matcher, _data_->_data4_, contacts_app_show_by_email_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp2_ = NULL;
	_data_->_tmp2_ = contacts_store_find_contact_finish (_data_->_tmp1_, _data_->_res_);
	_data_->contact = _data_->_tmp2_;
	_data_->_tmp3_ = NULL;
	_data_->_tmp3_ = _data_->contact;
	if (_data_->_tmp3_ != NULL) {
		_data_->_tmp4_ = NULL;
		_data_->_tmp4_ = _data_->self->priv->list_pane;
		_data_->_tmp5_ = NULL;
		_data_->_tmp5_ = _data_->contact;
		contacts_list_pane_select_contact (_data_->_tmp4_, _data_->_tmp5_, FALSE);
		_data_->_tmp6_ = NULL;
		_data_->_tmp6_ = _data_->self->priv->contacts_pane;
		_data_->_tmp7_ = NULL;
		_data_->_tmp7_ = _data_->contact;
		contacts_contact_pane_show_contact (_data_->_tmp6_, _data_->_tmp7_, FALSE, TRUE);
	} else {
		_data_->_data5_ = g_slice_new0 (Block5Data);
		_data_->_data5_->_ref_count_ = 1;
		_data_->_data5_->_data4_ = block4_data_ref (_data_->_data4_);
		_data_->_tmp8_ = NULL;
		_data_->_tmp8_ = contacts_app_app;
		_data_->_tmp9_ = NULL;
		_data_->_tmp9_ = _data_->_tmp8_->window;
		_data_->_tmp10_ = NULL;
		_data_->_tmp10_ = _ ("No contact with email address %s found");
		_data_->_tmp11_ = NULL;
		_data_->_tmp11_ = _data_->_data4_->email_address;
		_data_->_tmp12_ = NULL;
		_data_->_tmp12_ = (GtkMessageDialog*) gtk_message_dialog_new ((GtkWindow*) _data_->_tmp9_, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, _data_->_tmp10_, _data_->_tmp11_);
		g_object_ref_sink (_data_->_tmp12_);
		_data_->_data5_->dialog = _data_->_tmp12_;
		_data_->_tmp13_ = NULL;
		_data_->_tmp13_ = _data_->_data5_->dialog;
		_data_->_tmp14_ = NULL;
		_data_->_tmp14_ = _ ("Contact not found");
		gtk_window_set_title ((GtkWindow*) _data_->_tmp13_, _data_->_tmp14_);
		_data_->_tmp15_ = NULL;
		_data_->_tmp15_ = _data_->_data5_->dialog;
		gtk_widget_show ((GtkWidget*) _data_->_tmp15_);
		_data_->_tmp16_ = NULL;
		_data_->_tmp16_ = _data_->_data5_->dialog;
		g_signal_connect_data ((GtkDialog*) _data_->_tmp16_, "response", (GCallback) ____lambda99__gtk_dialog_response, block5_data_ref (_data_->_data5_), (GClosureNotify) block5_data_unref, 0);
		block5_data_unref (_data_->_data5_);
		_data_->_data5_ = NULL;
	}
	_g_object_unref0 (_data_->contact);
	block4_data_unref (_data_->_data4_);
	_data_->_data4_ = NULL;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static Block6Data* block6_data_ref (Block6Data* _data6_) {
	g_atomic_int_inc (&_data6_->_ref_count_);
	return _data6_;
}


static void block6_data_unref (void * _userdata_) {
	Block6Data* _data6_;
	_data6_ = (Block6Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data6_->_ref_count_)) {
		ContactsApp * self;
		self = _data6_->self;
		_g_object_unref0 (_data6_->view_action);
		_g_object_unref0 (self);
		g_slice_free (Block6Data, _data6_);
	}
}


static void __lambda100_ (ContactsApp* self) {
	ContactsWindow* _tmp0_ = NULL;
	_tmp0_ = self->window;
	gtk_widget_destroy ((GtkWidget*) _tmp0_);
}


static void ___lambda100__g_simple_action_activate (GSimpleAction* _sender, GVariant* parameter, gpointer self) {
	__lambda100_ (self);
}


static void __lambda101_ (ContactsApp* self) {
	contacts_app_show_help (self);
}


static void ___lambda101__g_simple_action_activate (GSimpleAction* _sender, GVariant* parameter, gpointer self) {
	__lambda101_ (self);
}


static void __lambda102_ (ContactsApp* self) {
	contacts_app_show_about (self);
}


static void ___lambda102__g_simple_action_activate (GSimpleAction* _sender, GVariant* parameter, gpointer self) {
	__lambda102_ (self);
}


static void __lambda103_ (ContactsApp* self) {
	contacts_app_change_address_book (self);
}


static void ___lambda103__g_simple_action_activate (GSimpleAction* _sender, GVariant* parameter, gpointer self) {
	__lambda103_ (self);
}


static void __lambda104_ (ContactsApp* self) {
	contacts_app_new_contact (self);
}


static void ___lambda104__g_simple_action_activate (GSimpleAction* _sender, GVariant* parameter, gpointer self) {
	__lambda104_ (self);
}


static void __lambda112_ (Block6Data* _data6_) {
	ContactsApp * self;
	GSettings* _tmp0_ = NULL;
	GVariant* _tmp1_ = NULL;
	GVariant* _tmp2_ = NULL;
	ContactsListPane* _tmp3_ = NULL;
	self = _data6_->self;
	_tmp0_ = self->settings;
	_tmp1_ = g_settings_get_value (_tmp0_, "view-subset");
	_tmp2_ = _tmp1_;
	g_simple_action_set_state (_data6_->view_action, _tmp2_);
	_g_variant_unref0 (_tmp2_);
	_tmp3_ = self->priv->list_pane;
	contacts_list_pane_refilter (_tmp3_);
}


static void ___lambda112__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
	__lambda112_ (self);
}


static void __lambda113_ (ContactsApp* self, GSimpleAction* act, GVariant* parameter) {
	GSettings* _tmp0_ = NULL;
	GVariant* _tmp1_ = NULL;
	g_return_if_fail (act != NULL);
	_tmp0_ = self->settings;
	_tmp1_ = parameter;
	g_settings_set_value (_tmp0_, "view-subset", _tmp1_);
}


static void ___lambda113__g_simple_action_activate (GSimpleAction* _sender, GVariant* parameter, gpointer self) {
	__lambda113_ (self, _sender, parameter);
}


static gboolean _contacts_app_window_delete_event_gtk_widget_delete_event (GtkWidget* _sender, GdkEventAny* event, gpointer self) {
	gboolean result;
	result = contacts_app_window_delete_event (self, event);
	return result;
}


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


static void _contacts_app_new_contact_gtk_button_clicked (GtkButton* _sender, gpointer self) {
	contacts_app_new_contact (self);
}


static gboolean __lambda114_ (ContactsApp* self, GtkOverlay* overlay, GtkWidget* widget, GdkRectangle* alloc) {
	gboolean result = FALSE;
	gint nat = 0;
	GtkWidget* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	GtkOverlay* _tmp3_ = NULL;
	gint _tmp4_ = 0;
	gint _tmp5_ = 0;
	GdMainToolbar* _tmp6_ = NULL;
	gint _tmp7_ = 0;
	GtkWidget* _tmp8_ = NULL;
	gint _tmp9_ = 0;
	gint _tmp10_ = 0;
	g_return_val_if_fail (overlay != NULL, FALSE);
	g_return_val_if_fail (widget != NULL, FALSE);
	g_return_val_if_fail (alloc != NULL, FALSE);
	_tmp0_ = widget;
	gtk_widget_get_preferred_width (_tmp0_, NULL, &_tmp1_);
	nat = _tmp1_;
	_tmp2_ = nat;
	(*alloc).width = _tmp2_;
	_tmp3_ = overlay;
	_tmp4_ = gtk_widget_get_allocated_width ((GtkWidget*) _tmp3_);
	_tmp5_ = nat;
	(*alloc).x = (_tmp4_ - _tmp5_) / 2;
	_tmp6_ = self->priv->left_toolbar;
	_tmp7_ = gtk_widget_get_allocated_height ((GtkWidget*) _tmp6_);
	(*alloc).y = _tmp7_;
	_tmp8_ = widget;
	gtk_widget_get_preferred_height (_tmp8_, NULL, &_tmp9_);
	nat = _tmp9_;
	_tmp10_ = nat;
	(*alloc).height = _tmp10_;
	result = TRUE;
	return result;
}


static gboolean ___lambda114__gtk_overlay_get_child_position (GtkOverlay* _sender, GtkWidget* widget, GdkRectangle* allocation, gpointer self) {
	gboolean result;
	result = __lambda114_ (self, _sender, widget, allocation);
	return result;
}


static void _contacts_app_selection_changed_contacts_list_pane_selection_changed (ContactsListPane* _sender, ContactsContact* contact, gpointer self) {
	contacts_app_selection_changed (self, contact);
}


static void _contacts_app_link_contacts_contacts_list_pane_link_contacts (ContactsListPane* _sender, GeeLinkedList* contacts_list, gpointer self) {
	contacts_app_link_contacts (self, contacts_list);
}


static void _contacts_app_delete_contacts_contacts_list_pane_delete_contacts (ContactsListPane* _sender, GeeLinkedList* contacts_list, gpointer self) {
	contacts_app_delete_contacts (self, contacts_list);
}


static void _contacts_app_delete_contact_contacts_contact_pane_will_delete (ContactsContactPane* _sender, ContactsContact* contact, gpointer self) {
	contacts_app_delete_contact (self, contact);
}


static void _contacts_app_contacts_linked_contacts_contact_pane_contacts_linked (ContactsContactPane* _sender, const gchar* main_contact, const gchar* linked_contact, ContactsLinkOperation* operation, gpointer self) {
	contacts_app_contacts_linked (self, main_contact, linked_contact, operation);
}


static void __lambda123_ (ContactsApp* self) {
	GtkToggleButton* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	_tmp0_ = self->priv->select_button;
	_tmp1_ = gtk_toggle_button_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		ContactsListPane* _tmp3_ = NULL;
		_tmp3_ = self->priv->list_pane;
		contacts_list_pane_show_selection (_tmp3_);
	} else {
		ContactsListPane* _tmp4_ = NULL;
		_tmp4_ = self->priv->list_pane;
		contacts_list_pane_hide_selection (_tmp4_);
	}
}


static void ___lambda123__gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self) {
	__lambda123_ (self);
}


static void __lambda124_ (ContactsApp* self) {
	GtkToggleButton* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gchar* name = NULL;
	const gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	ContactsContactPane* _tmp6_ = NULL;
	ContactsContact* _tmp7_ = NULL;
	GtkLabel* _tmp16_ = NULL;
	const gchar* _tmp17_ = NULL;
	gchar* _tmp18_ = NULL;
	gchar* _tmp19_ = NULL;
	GtkButton* _tmp20_ = NULL;
	GtkButton* _tmp21_ = NULL;
	ContactsContactPane* _tmp22_ = NULL;
	_tmp0_ = self->priv->select_button;
	_tmp1_ = gtk_toggle_button_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		GtkToggleButton* _tmp3_ = NULL;
		_tmp3_ = self->priv->select_button;
		gtk_toggle_button_set_active (_tmp3_, FALSE);
	}
	_tmp4_ = _ ("Editing");
	_tmp5_ = g_strdup (_tmp4_);
	name = _tmp5_;
	_tmp6_ = self->priv->contacts_pane;
	_tmp7_ = _tmp6_->contact;
	if (_tmp7_ != NULL) {
		const gchar* _tmp8_ = NULL;
		ContactsContactPane* _tmp9_ = NULL;
		ContactsContact* _tmp10_ = NULL;
		const gchar* _tmp11_ = NULL;
		const gchar* _tmp12_ = NULL;
		gchar* _tmp13_ = NULL;
		gchar* _tmp14_ = NULL;
		gchar* _tmp15_ = NULL;
		_tmp8_ = name;
		_tmp9_ = self->priv->contacts_pane;
		_tmp10_ = _tmp9_->contact;
		_tmp11_ = contacts_contact_get_display_name (_tmp10_);
		_tmp12_ = _tmp11_;
		_tmp13_ = g_strdup_printf (" %s", _tmp12_);
		_tmp14_ = _tmp13_;
		_tmp15_ = g_strconcat (_tmp8_, _tmp14_, NULL);
		_g_free0 (name);
		name = _tmp15_;
		_g_free0 (_tmp14_);
	}
	_tmp16_ = self->priv->contact_name;
	_tmp17_ = name;
	_tmp18_ = g_markup_printf_escaped ("<b>%s</b>", _tmp17_);
	_tmp19_ = _tmp18_;
	gtk_label_set_markup (_tmp16_, _tmp19_);
	_g_free0 (_tmp19_);
	_tmp20_ = self->priv->edit_button;
	gtk_widget_hide ((GtkWidget*) _tmp20_);
	_tmp21_ = self->priv->done_button;
	gtk_widget_show ((GtkWidget*) _tmp21_);
	_tmp22_ = self->priv->contacts_pane;
	contacts_contact_pane_set_edit_mode (_tmp22_, TRUE);
	_g_free0 (name);
}


static void ___lambda124__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda124_ (self);
}


static void __lambda125_ (ContactsApp* self) {
	GtkLabel* _tmp0_ = NULL;
	GtkButton* _tmp1_ = NULL;
	GtkButton* _tmp2_ = NULL;
	ContactsContactPane* _tmp3_ = NULL;
	_tmp0_ = self->priv->contact_name;
	gtk_label_set_text (_tmp0_, NULL);
	_tmp1_ = self->priv->done_button;
	gtk_widget_hide ((GtkWidget*) _tmp1_);
	_tmp2_ = self->priv->edit_button;
	gtk_widget_show ((GtkWidget*) _tmp2_);
	_tmp3_ = self->priv->contacts_pane;
	contacts_contact_pane_set_edit_mode (_tmp3_, FALSE);
}


static void ___lambda125__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda125_ (self);
}


static void contacts_app_create_window (ContactsApp* self) {
	Block6Data* _data6_;
	GSimpleAction* action = NULL;
	GSimpleAction* _tmp0_ = NULL;
	GSimpleAction* _tmp1_ = NULL;
	GSimpleAction* _tmp2_ = NULL;
	GSimpleAction* _tmp3_ = NULL;
	GSimpleAction* _tmp4_ = NULL;
	GSimpleAction* _tmp5_ = NULL;
	GSimpleAction* _tmp6_ = NULL;
	GSimpleAction* _tmp7_ = NULL;
	GSimpleAction* _tmp8_ = NULL;
	GSimpleAction* _tmp9_ = NULL;
	GSimpleAction* _tmp10_ = NULL;
	GSimpleAction* _tmp11_ = NULL;
	GSimpleAction* _tmp12_ = NULL;
	GSimpleAction* _tmp13_ = NULL;
	GSimpleAction* _tmp14_ = NULL;
	const GVariantType* _tmp15_ = NULL;
	GSettings* _tmp16_ = NULL;
	GVariant* _tmp17_ = NULL;
	GVariant* _tmp18_ = NULL;
	GSimpleAction* _tmp19_ = NULL;
	GSimpleAction* _tmp20_ = NULL;
	GSettings* _tmp21_ = NULL;
	GtkBuilder* builder = NULL;
	GtkBuilder* _tmp22_ = NULL;
	GObject* _tmp23_ = NULL;
	ContactsWindow* _tmp24_ = NULL;
	ContactsWindow* _tmp25_ = NULL;
	ContactsWindow* _tmp26_ = NULL;
	const gchar* _tmp27_ = NULL;
	ContactsWindow* _tmp28_ = NULL;
	ContactsWindow* _tmp29_ = NULL;
	ContactsWindow* _tmp30_ = NULL;
	ContactsWindow* _tmp31_ = NULL;
	GtkGrid* grid = NULL;
	GtkGrid* _tmp32_ = NULL;
	GdMainToolbar* _tmp33_ = NULL;
	GdMainToolbar* _tmp34_ = NULL;
	GtkStyleContext* _tmp35_ = NULL;
	GdMainToolbar* _tmp36_ = NULL;
	GtkStyleContext* _tmp37_ = NULL;
	GdMainToolbar* _tmp38_ = NULL;
	GdMainToolbar* _tmp39_ = NULL;
	GtkButton* add_button = NULL;
	GdMainToolbar* _tmp40_ = NULL;
	const gchar* _tmp41_ = NULL;
	GtkWidget* _tmp42_ = NULL;
	GtkButton* _tmp43_ = NULL;
	ContactsApp* _tmp44_ = NULL;
	GdMainToolbar* _tmp45_ = NULL;
	GtkWidget* _tmp46_ = NULL;
	GtkToggleButton* _tmp47_ = NULL;
	GtkToolbar* _tmp48_ = NULL;
	GtkToolbar* _tmp49_ = NULL;
	GtkStyleContext* _tmp50_ = NULL;
	GtkToolbar* _tmp51_ = NULL;
	GtkToolbar* _tmp52_ = NULL;
	GtkLabel* _tmp53_ = NULL;
	GtkLabel* _tmp54_ = NULL;
	GtkLabel* _tmp55_ = NULL;
	GtkLabel* _tmp56_ = NULL;
	GtkLabel* _tmp57_ = NULL;
	GtkLabel* _tmp58_ = NULL;
	GtkLabel* _tmp59_ = NULL;
	GtkLabel* _tmp60_ = NULL;
	GtkLabel* _tmp61_ = NULL;
	GtkToolItem* item = NULL;
	GtkToolItem* _tmp62_ = NULL;
	GtkToolItem* _tmp63_ = NULL;
	GtkToolItem* _tmp64_ = NULL;
	GtkLabel* _tmp65_ = NULL;
	GtkToolbar* _tmp66_ = NULL;
	GtkToolItem* _tmp67_ = NULL;
	GtkSeparatorToolItem* _tmp68_ = NULL;
	GtkToolItem* _tmp69_ = NULL;
	GtkToolItem* _tmp70_ = NULL;
	GtkToolbar* _tmp71_ = NULL;
	GtkToolItem* _tmp72_ = NULL;
	const gchar* _tmp73_ = NULL;
	GtkButton* _tmp74_ = NULL;
	GtkButton* _tmp75_ = NULL;
	GtkToolItem* _tmp76_ = NULL;
	GtkToolItem* _tmp77_ = NULL;
	GtkButton* _tmp78_ = NULL;
	GtkToolbar* _tmp79_ = NULL;
	GtkToolItem* _tmp80_ = NULL;
	const gchar* _tmp81_ = NULL;
	GtkButton* _tmp82_ = NULL;
	GtkButton* _tmp83_ = NULL;
	GtkButton* _tmp84_ = NULL;
	GtkStyleContext* _tmp85_ = NULL;
	GtkToolItem* _tmp86_ = NULL;
	GtkToolItem* _tmp87_ = NULL;
	GtkButton* _tmp88_ = NULL;
	GtkToolbar* _tmp89_ = NULL;
	GtkToolItem* _tmp90_ = NULL;
	GtkOverlay* _tmp91_ = NULL;
	GdkRGBA transparent = {0};
	GdkRGBA _tmp92_ = {0};
	GtkOverlay* _tmp93_ = NULL;
	GdkRGBA _tmp94_ = {0};
	GtkOverlay* _tmp95_ = NULL;
	GtkOverlay* _tmp96_ = NULL;
	ContactsWindow* _tmp97_ = NULL;
	GtkOverlay* _tmp98_ = NULL;
	ContactsStore* _tmp99_ = NULL;
	ContactsListPane* _tmp100_ = NULL;
	ContactsListPane* _tmp101_ = NULL;
	ContactsListPane* _tmp102_ = NULL;
	ContactsListPane* _tmp103_ = NULL;
	ContactsListPane* _tmp104_ = NULL;
	ContactsStore* _tmp105_ = NULL;
	ContactsContactPane* _tmp106_ = NULL;
	ContactsContactPane* _tmp107_ = NULL;
	ContactsContactPane* _tmp108_ = NULL;
	ContactsContactPane* _tmp109_ = NULL;
	GtkOverlay* _tmp110_ = NULL;
	GtkOverlay* _tmp111_ = NULL;
	GdkRGBA _tmp112_ = {0};
	GtkOverlay* _tmp113_ = NULL;
	ContactsContactPane* _tmp114_ = NULL;
	GtkOverlay* _tmp115_ = NULL;
	GtkOverlay* _tmp116_ = NULL;
	GtkToggleButton* _tmp117_ = NULL;
	GtkButton* _tmp118_ = NULL;
	GtkButton* _tmp119_ = NULL;
	GtkButton* _tmp120_ = NULL;
	GtkButton* _tmp121_ = NULL;
	g_return_if_fail (self != NULL);
	_data6_ = g_slice_new0 (Block6Data);
	_data6_->_ref_count_ = 1;
	_data6_->self = g_object_ref (self);
	_tmp0_ = g_simple_action_new ("quit", NULL);
	action = _tmp0_;
	_tmp1_ = action;
	g_signal_connect_object (_tmp1_, "activate", (GCallback) ___lambda100__g_simple_action_activate, self, 0);
	_tmp2_ = action;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _tmp2_);
	_tmp3_ = g_simple_action_new ("help", NULL);
	_g_object_unref0 (action);
	action = _tmp3_;
	_tmp4_ = action;
	g_signal_connect_object (_tmp4_, "activate", (GCallback) ___lambda101__g_simple_action_activate, self, 0);
	_tmp5_ = action;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _tmp5_);
	gtk_application_add_accelerator ((GtkApplication*) self, "F1", "app.help", NULL);
	_tmp6_ = g_simple_action_new ("about", NULL);
	_g_object_unref0 (action);
	action = _tmp6_;
	_tmp7_ = action;
	g_signal_connect_object (_tmp7_, "activate", (GCallback) ___lambda102__g_simple_action_activate, self, 0);
	_tmp8_ = action;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _tmp8_);
	_tmp9_ = g_simple_action_new ("change_book", NULL);
	_g_object_unref0 (action);
	action = _tmp9_;
	_tmp10_ = action;
	g_signal_connect_object (_tmp10_, "activate", (GCallback) ___lambda103__g_simple_action_activate, self, 0);
	_tmp11_ = action;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _tmp11_);
	_tmp12_ = g_simple_action_new ("new_contact", NULL);
	_g_object_unref0 (action);
	action = _tmp12_;
	_tmp13_ = action;
	g_signal_connect_object (_tmp13_, "activate", (GCallback) ___lambda104__g_simple_action_activate, self, 0);
	_tmp14_ = action;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _tmp14_);
	gtk_application_add_accelerator ((GtkApplication*) self, "<Primary>n", "app.new_contact", NULL);
	_tmp15_ = G_VARIANT_TYPE_STRING;
	_tmp16_ = self->settings;
	_tmp17_ = g_settings_get_value (_tmp16_, "view-subset");
	_tmp18_ = _tmp17_;
	_tmp19_ = g_simple_action_new_stateful ("view_subset", _tmp15_, _tmp18_);
	_tmp20_ = _tmp19_;
	_g_variant_unref0 (_tmp18_);
	_data6_->view_action = _tmp20_;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _data6_->view_action);
	_tmp21_ = self->settings;
	g_signal_connect_data (_tmp21_, "changed::view-subset", (GCallback) ___lambda112__g_settings_changed, block6_data_ref (_data6_), (GClosureNotify) block6_data_unref, 0);
	g_signal_connect_object (_data6_->view_action, "activate", (GCallback) ___lambda113__g_simple_action_activate, self, 0);
	_tmp22_ = contacts_load_ui ("app-menu.ui");
	builder = _tmp22_;
	_tmp23_ = gtk_builder_get_object (builder, "app-menu");
	gtk_application_set_app_menu ((GtkApplication*) self, G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, g_menu_model_get_type (), GMenuModel));
	_tmp24_ = contacts_window_new ((GtkApplication*) self);
	g_object_ref_sink (_tmp24_);
	_g_object_unref0 (self->window);
	self->window = _tmp24_;
	_tmp25_ = self->window;
	gtk_window_set_application ((GtkWindow*) _tmp25_, (GtkApplication*) self);
	_tmp26_ = self->window;
	_tmp27_ = _ ("Contacts");
	gtk_window_set_title ((GtkWindow*) _tmp26_, _tmp27_);
	_tmp28_ = self->window;
	gtk_window_set_default_size ((GtkWindow*) _tmp28_, 800, 600);
	_tmp29_ = self->window;
	gtk_window_set_hide_titlebar_when_maximized ((GtkWindow*) _tmp29_, TRUE);
	_tmp30_ = self->window;
	g_signal_connect_object ((GtkWidget*) _tmp30_, "delete-event", (GCallback) _contacts_app_window_delete_event_gtk_widget_delete_event, self, 0);
	_tmp31_ = self->window;
	g_signal_connect_object ((GtkWidget*) _tmp31_, "key-press-event", (GCallback) _contacts_app_window_key_press_event_gtk_widget_key_press_event, self, G_CONNECT_AFTER);
	_tmp32_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp32_);
	grid = _tmp32_;
	_tmp33_ = (GdMainToolbar*) gd_main_toolbar_new ();
	g_object_ref_sink (_tmp33_);
	_g_object_unref0 (self->priv->left_toolbar);
	self->priv->left_toolbar = _tmp33_;
	_tmp34_ = self->priv->left_toolbar;
	_tmp35_ = gtk_widget_get_style_context ((GtkWidget*) _tmp34_);
	gtk_style_context_add_class (_tmp35_, GTK_STYLE_CLASS_MENUBAR);
	_tmp36_ = self->priv->left_toolbar;
	_tmp37_ = gtk_widget_get_style_context ((GtkWidget*) _tmp36_);
	gtk_style_context_add_class (_tmp37_, "contacts-left-toolbar");
	_tmp38_ = self->priv->left_toolbar;
	gtk_widget_set_vexpand ((GtkWidget*) _tmp38_, FALSE);
	_tmp39_ = self->priv->left_toolbar;
	gtk_grid_attach (grid, (GtkWidget*) _tmp39_, 0, 0, 1, 1);
	_tmp40_ = self->priv->left_toolbar;
	_tmp41_ = _ ("New");
	_tmp42_ = gd_main_toolbar_add_button (_tmp40_, NULL, _tmp41_, TRUE);
	_tmp43_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp42_, GTK_TYPE_BUTTON) ? ((GtkButton*) _tmp42_) : NULL);
	add_button = _tmp43_;
	gtk_widget_set_size_request ((GtkWidget*) add_button, 70, -1);
	_tmp44_ = contacts_app_app;
	g_signal_connect_object (add_button, "clicked", (GCallback) _contacts_app_new_contact_gtk_button_clicked, _tmp44_, 0);
	_tmp45_ = self->priv->left_toolbar;
	_tmp46_ = gd_main_toolbar_add_toggle (_tmp45_, "object-select-symbolic", NULL, FALSE);
	_tmp47_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp46_, GTK_TYPE_TOGGLE_BUTTON) ? ((GtkToggleButton*) _tmp46_) : NULL);
	_g_object_unref0 (self->priv->select_button);
	self->priv->select_button = _tmp47_;
	_tmp48_ = (GtkToolbar*) gtk_toolbar_new ();
	g_object_ref_sink (_tmp48_);
	_g_object_unref0 (self->priv->right_toolbar);
	self->priv->right_toolbar = _tmp48_;
	_tmp49_ = self->priv->right_toolbar;
	_tmp50_ = gtk_widget_get_style_context ((GtkWidget*) _tmp49_);
	gtk_style_context_add_class (_tmp50_, GTK_STYLE_CLASS_MENUBAR);
	_tmp51_ = self->priv->right_toolbar;
	gtk_widget_set_vexpand ((GtkWidget*) _tmp51_, FALSE);
	_tmp52_ = self->priv->right_toolbar;
	gtk_grid_attach (grid, (GtkWidget*) _tmp52_, 1, 0, 1, 1);
	_tmp53_ = (GtkLabel*) gtk_label_new (NULL);
	g_object_ref_sink (_tmp53_);
	_g_object_unref0 (self->priv->contact_name);
	self->priv->contact_name = _tmp53_;
	_tmp54_ = self->priv->contact_name;
	gtk_label_set_ellipsize (_tmp54_, PANGO_ELLIPSIZE_END);
	_tmp55_ = self->priv->contact_name;
	g_object_set (_tmp55_, "wrap-mode", PANGO_WRAP_CHAR, NULL);
	_tmp56_ = self->priv->contact_name;
	gtk_widget_set_halign ((GtkWidget*) _tmp56_, GTK_ALIGN_START);
	_tmp57_ = self->priv->contact_name;
	gtk_widget_set_valign ((GtkWidget*) _tmp57_, GTK_ALIGN_CENTER);
	_tmp58_ = self->priv->contact_name;
	gtk_widget_set_vexpand ((GtkWidget*) _tmp58_, TRUE);
	_tmp59_ = self->priv->contact_name;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp59_, TRUE);
	_tmp60_ = self->priv->contact_name;
	gtk_widget_set_margin_left ((GtkWidget*) _tmp60_, 12);
	_tmp61_ = self->priv->contact_name;
	gtk_widget_set_margin_right ((GtkWidget*) _tmp61_, 12);
	_tmp62_ = gtk_tool_item_new ();
	g_object_ref_sink (_tmp62_);
	item = _tmp62_;
	_tmp63_ = item;
	gtk_tool_item_set_expand (_tmp63_, TRUE);
	_tmp64_ = item;
	_tmp65_ = self->priv->contact_name;
	gtk_container_add ((GtkContainer*) _tmp64_, (GtkWidget*) _tmp65_);
	_tmp66_ = self->priv->right_toolbar;
	_tmp67_ = item;
	gtk_toolbar_insert (_tmp66_, _tmp67_, -1);
	_tmp68_ = (GtkSeparatorToolItem*) gtk_separator_tool_item_new ();
	g_object_ref_sink (_tmp68_);
	_g_object_unref0 (item);
	item = (GtkToolItem*) _tmp68_;
	_tmp69_ = item;
	gtk_separator_tool_item_set_draw (G_TYPE_CHECK_INSTANCE_TYPE (_tmp69_, GTK_TYPE_SEPARATOR_TOOL_ITEM) ? ((GtkSeparatorToolItem*) _tmp69_) : NULL, FALSE);
	_tmp70_ = item;
	gtk_tool_item_set_expand (G_TYPE_CHECK_INSTANCE_TYPE (_tmp70_, GTK_TYPE_TOOL_ITEM) ? ((GtkToolItem*) _tmp70_) : NULL, TRUE);
	_tmp71_ = self->priv->right_toolbar;
	_tmp72_ = item;
	gtk_toolbar_insert (_tmp71_, _tmp72_, -1);
	_tmp73_ = _ ("Edit");
	_tmp74_ = (GtkButton*) gtk_button_new_with_label (_tmp73_);
	g_object_ref_sink (_tmp74_);
	_g_object_unref0 (self->priv->edit_button);
	self->priv->edit_button = _tmp74_;
	_tmp75_ = self->priv->edit_button;
	gtk_widget_set_size_request ((GtkWidget*) _tmp75_, 70, -1);
	_tmp76_ = gtk_tool_item_new ();
	g_object_ref_sink (_tmp76_);
	_g_object_unref0 (item);
	item = _tmp76_;
	_tmp77_ = item;
	_tmp78_ = self->priv->edit_button;
	gtk_container_add ((GtkContainer*) _tmp77_, (GtkWidget*) _tmp78_);
	_tmp79_ = self->priv->right_toolbar;
	_tmp80_ = item;
	gtk_toolbar_insert (_tmp79_, _tmp80_, -1);
	_tmp81_ = _ ("Done");
	_tmp82_ = (GtkButton*) gtk_button_new_with_label (_tmp81_);
	g_object_ref_sink (_tmp82_);
	_g_object_unref0 (self->priv->done_button);
	self->priv->done_button = _tmp82_;
	_tmp83_ = self->priv->done_button;
	gtk_widget_set_size_request ((GtkWidget*) _tmp83_, 70, -1);
	_tmp84_ = self->priv->done_button;
	_tmp85_ = gtk_widget_get_style_context ((GtkWidget*) _tmp84_);
	gtk_style_context_add_class (_tmp85_, "suggested-action");
	_tmp86_ = gtk_tool_item_new ();
	g_object_ref_sink (_tmp86_);
	_g_object_unref0 (item);
	item = _tmp86_;
	_tmp87_ = item;
	_tmp88_ = self->priv->done_button;
	gtk_container_add ((GtkContainer*) _tmp87_, (GtkWidget*) _tmp88_);
	_tmp89_ = self->priv->right_toolbar;
	_tmp90_ = item;
	gtk_toolbar_insert (_tmp89_, _tmp90_, -1);
	_tmp91_ = (GtkOverlay*) gtk_overlay_new ();
	g_object_ref_sink (_tmp91_);
	_g_object_unref0 (self->priv->overlay);
	self->priv->overlay = _tmp91_;
	_tmp92_.red = (gdouble) 0;
	_tmp92_.green = (gdouble) 0;
	_tmp92_.blue = (gdouble) 0;
	_tmp92_.alpha = (gdouble) 0;
	transparent = _tmp92_;
	_tmp93_ = self->priv->overlay;
	_tmp94_ = transparent;
	gtk_widget_override_background_color ((GtkWidget*) _tmp93_, 0, &_tmp94_);
	_tmp95_ = self->priv->overlay;
	gtk_container_add ((GtkContainer*) _tmp95_, (GtkWidget*) grid);
	_tmp96_ = self->priv->overlay;
	g_signal_connect_object (_tmp96_, "get-child-position", (GCallback) ___lambda114__gtk_overlay_get_child_position, self, 0);
	_tmp97_ = self->window;
	_tmp98_ = self->priv->overlay;
	gtk_container_add ((GtkContainer*) _tmp97_, (GtkWidget*) _tmp98_);
	_tmp99_ = self->contacts_store;
	_tmp100_ = contacts_list_pane_new (_tmp99_);
	g_object_ref_sink (_tmp100_);
	_g_object_unref0 (self->priv->list_pane);
	self->priv->list_pane = _tmp100_;
	_tmp101_ = self->priv->list_pane;
	g_signal_connect_object (_tmp101_, "selection-changed", (GCallback) _contacts_app_selection_changed_contacts_list_pane_selection_changed, self, 0);
	_tmp102_ = self->priv->list_pane;
	g_signal_connect_object (_tmp102_, "link-contacts", (GCallback) _contacts_app_link_contacts_contacts_list_pane_link_contacts, self, 0);
	_tmp103_ = self->priv->list_pane;
	g_signal_connect_object (_tmp103_, "delete-contacts", (GCallback) _contacts_app_delete_contacts_contacts_list_pane_delete_contacts, self, 0);
	_tmp104_ = self->priv->list_pane;
	gtk_grid_attach (grid, (GtkWidget*) _tmp104_, 0, 1, 1, 1);
	_tmp105_ = self->contacts_store;
	_tmp106_ = contacts_contact_pane_new (_tmp105_);
	g_object_ref_sink (_tmp106_);
	_g_object_unref0 (self->priv->contacts_pane);
	self->priv->contacts_pane = _tmp106_;
	_tmp107_ = self->priv->contacts_pane;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp107_, TRUE);
	_tmp108_ = self->priv->contacts_pane;
	g_signal_connect_object (_tmp108_, "will-delete", (GCallback) _contacts_app_delete_contact_contacts_contact_pane_will_delete, self, 0);
	_tmp109_ = self->priv->contacts_pane;
	g_signal_connect_object (_tmp109_, "contacts-linked", (GCallback) _contacts_app_contacts_linked_contacts_contact_pane_contacts_linked, self, 0);
	_tmp110_ = (GtkOverlay*) gtk_overlay_new ();
	g_object_ref_sink (_tmp110_);
	_g_object_unref0 (self->priv->right_overlay);
	self->priv->right_overlay = _tmp110_;
	_tmp111_ = self->priv->right_overlay;
	_tmp112_ = transparent;
	gtk_widget_override_background_color ((GtkWidget*) _tmp111_, 0, &_tmp112_);
	_tmp113_ = self->priv->right_overlay;
	_tmp114_ = self->priv->contacts_pane;
	gtk_container_add ((GtkContainer*) _tmp113_, (GtkWidget*) _tmp114_);
	_tmp115_ = self->priv->right_overlay;
	gtk_grid_attach (grid, (GtkWidget*) _tmp115_, 1, 1, 1, 1);
	_tmp116_ = self->priv->overlay;
	gtk_widget_show_all ((GtkWidget*) _tmp116_);
	_tmp117_ = self->priv->select_button;
	g_signal_connect_object (_tmp117_, "toggled", (GCallback) ___lambda123__gtk_toggle_button_toggled, self, 0);
	_tmp118_ = self->priv->edit_button;
	g_signal_connect_object (_tmp118_, "clicked", (GCallback) ___lambda124__gtk_button_clicked, self, 0);
	_tmp119_ = self->priv->done_button;
	g_signal_connect_object (_tmp119_, "clicked", (GCallback) ___lambda125__gtk_button_clicked, self, 0);
	_tmp120_ = self->priv->edit_button;
	gtk_widget_hide ((GtkWidget*) _tmp120_);
	_tmp121_ = self->priv->done_button;
	gtk_widget_hide ((GtkWidget*) _tmp121_);
	_g_object_unref0 (item);
	_g_object_unref0 (add_button);
	_g_object_unref0 (grid);
	_g_object_unref0 (builder);
	_g_object_unref0 (action);
	block6_data_unref (_data6_);
	_data6_ = NULL;
}


static void contacts_app_real_startup (GApplication* base) {
	ContactsApp * self;
	ContactsStore* _tmp0_ = NULL;
	self = (ContactsApp*) base;
	contacts_ensure_eds_accounts ();
	_tmp0_ = contacts_store_new ();
	_g_object_unref0 (self->contacts_store);
	self->contacts_store = _tmp0_;
	G_APPLICATION_CLASS (contacts_app_parent_class)->startup ((GApplication*) G_TYPE_CHECK_INSTANCE_CAST (self, GTK_TYPE_APPLICATION, GtkApplication));
}


static Block7Data* block7_data_ref (Block7Data* _data7_) {
	g_atomic_int_inc (&_data7_->_ref_count_);
	return _data7_;
}


static void block7_data_unref (void * _userdata_) {
	Block7Data* _data7_;
	_data7_ = (Block7Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) {
		ContactsApp * self;
		self = _data7_->self;
		_g_object_unref0 (_data7_->setup);
		_g_object_unref0 (self);
		g_slice_free (Block7Data, _data7_);
	}
}


static void __lambda130_ (Block7Data* _data7_) {
	ContactsApp * self;
	gboolean _tmp0_ = FALSE;
	self = _data7_->self;
	gtk_widget_destroy ((GtkWidget*) _data7_->setup);
	_tmp0_ = _data7_->setup->succeeded;
	if (_tmp0_) {
		g_application_activate ((GApplication*) self);
	}
}


static void ___lambda130__gtk_widget_destroy (GtkWidget* _sender, gpointer self) {
	__lambda130_ (self);
}


static void contacts_app_show_setup (ContactsApp* self) {
	Block7Data* _data7_;
	ContactsSetupWindow* _tmp0_ = NULL;
	g_return_if_fail (self != NULL);
	_data7_ = g_slice_new0 (Block7Data);
	_data7_->_ref_count_ = 1;
	_data7_->self = g_object_ref (self);
	_tmp0_ = contacts_setup_window_new ();
	g_object_ref_sink (_tmp0_);
	_data7_->setup = _tmp0_;
	gtk_window_set_application ((GtkWindow*) _data7_->setup, (GtkApplication*) self);
	g_signal_connect_data ((GtkWidget*) _data7_->setup, "destroy", (GCallback) ___lambda130__gtk_widget_destroy, block7_data_ref (_data7_), (GClosureNotify) block7_data_unref, 0);
	gtk_widget_show ((GtkWidget*) _data7_->setup);
	block7_data_unref (_data7_);
	_data7_ = NULL;
}


static Block8Data* block8_data_ref (Block8Data* _data8_) {
	g_atomic_int_inc (&_data8_->_ref_count_);
	return _data8_;
}


static void block8_data_unref (void * _userdata_) {
	Block8Data* _data8_;
	_data8_ = (Block8Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data8_->_ref_count_)) {
		ContactsApp * self;
		self = _data8_->self;
		_g_object_unref0 (self);
		g_slice_free (Block8Data, _data8_);
	}
}


static void _____lambda131_ (Block8Data* _data8_) {
	ContactsApp * self;
	ContactsStore* _tmp0_ = NULL;
	gulong _tmp1_ = 0UL;
	guint _tmp2_ = 0U;
	self = _data8_->self;
	contacts_app_show_setup (self);
	_tmp0_ = self->contacts_store;
	_tmp1_ = _data8_->id;
	g_signal_handler_disconnect ((GObject*) _tmp0_, _tmp1_);
	_tmp2_ = _data8_->id2;
	g_source_remove (_tmp2_);
	g_application_release ((GApplication*) self);
}


static void ______lambda131__contacts_store_prepared (ContactsStore* _sender, gpointer self) {
	_____lambda131_ (self);
}


static gboolean _____lambda132_ (Block8Data* _data8_) {
	ContactsApp * self;
	gboolean result = FALSE;
	ContactsStore* _tmp0_ = NULL;
	gulong _tmp1_ = 0UL;
	self = _data8_->self;
	contacts_app_show_setup (self);
	_tmp0_ = self->contacts_store;
	_tmp1_ = _data8_->id;
	g_signal_handler_disconnect ((GObject*) _tmp0_, _tmp1_);
	g_application_release ((GApplication*) self);
	result = FALSE;
	return result;
}


static gboolean ______lambda132__gsource_func (gpointer self) {
	gboolean result;
	result = _____lambda132_ (self);
	return result;
}


static void ___lambda133_ (ContactsApp* self) {
	ContactsApp* _tmp0_ = NULL;
	ContactsWindow* _tmp1_ = NULL;
	_tmp0_ = contacts_app_app;
	_tmp1_ = _tmp0_->window;
	gtk_widget_show ((GtkWidget*) _tmp1_);
}


static void ____lambda133__contacts_store_quiescent (ContactsStore* _sender, gpointer self) {
	___lambda133_ (self);
}


static gboolean ___lambda134_ (ContactsApp* self) {
	gboolean result = FALSE;
	ContactsApp* _tmp0_ = NULL;
	ContactsWindow* _tmp1_ = NULL;
	_tmp0_ = contacts_app_app;
	_tmp1_ = _tmp0_->window;
	gtk_widget_show ((GtkWidget*) _tmp1_);
	result = FALSE;
	return result;
}


static gboolean ____lambda134__gsource_func (gpointer self) {
	gboolean result;
	result = ___lambda134_ (self);
	return result;
}


static void contacts_app_real_activate (GApplication* base) {
	ContactsApp * self;
	ContactsWindow* _tmp0_ = NULL;
	self = (ContactsApp*) base;
	_tmp0_ = self->window;
	if (_tmp0_ == NULL) {
		GSettings* _tmp1_ = NULL;
		gboolean _tmp2_ = FALSE;
		ContactsStore* _tmp9_ = NULL;
		_tmp1_ = self->settings;
		_tmp2_ = g_settings_get_boolean (_tmp1_, "did-initial-setup");
		if (!_tmp2_) {
			ContactsStore* _tmp3_ = NULL;
			gboolean _tmp4_ = FALSE;
			gboolean _tmp5_ = FALSE;
			_tmp3_ = self->contacts_store;
			_tmp4_ = contacts_store_get_is_prepared (_tmp3_);
			_tmp5_ = _tmp4_;
			if (_tmp5_) {
				contacts_app_show_setup (self);
			} else {
				Block8Data* _data8_;
				ContactsStore* _tmp6_ = NULL;
				gulong _tmp7_ = 0UL;
				guint _tmp8_ = 0U;
				_data8_ = g_slice_new0 (Block8Data);
				_data8_->_ref_count_ = 1;
				_data8_->self = g_object_ref (self);
				g_application_hold ((GApplication*) self);
				_data8_->id = (gulong) 0;
				_data8_->id2 = (guint) 0;
				_tmp6_ = self->contacts_store;
				_tmp7_ = g_signal_connect_data (_tmp6_, "prepared", (GCallback) ______lambda131__contacts_store_prepared, block8_data_ref (_data8_), (GClosureNotify) block8_data_unref, 0);
				_data8_->id = _tmp7_;
				_tmp8_ = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 500, ______lambda132__gsource_func, block8_data_ref (_data8_), block8_data_unref);
				_data8_->id2 = _tmp8_;
				block8_data_unref (_data8_);
				_data8_ = NULL;
			}
			return;
		}
		contacts_app_create_window (self);
		_tmp9_ = self->contacts_store;
		g_signal_connect_object (_tmp9_, "quiescent", (GCallback) ____lambda133__contacts_store_quiescent, self, 0);
		g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 500, ____lambda134__gsource_func, g_object_ref (self), g_object_unref);
	} else {
		ContactsWindow* _tmp10_ = NULL;
		_tmp10_ = self->window;
		gtk_window_present ((GtkWindow*) _tmp10_);
	}
}


void contacts_app_show_message (ContactsApp* self, const gchar* message) {
	GdNotification* notification = NULL;
	GdNotification* _tmp0_ = NULL;
	GtkGrid* g = NULL;
	GtkGrid* _tmp1_ = NULL;
	GtkLabel* l = NULL;
	const gchar* _tmp2_ = NULL;
	GtkLabel* _tmp3_ = NULL;
	GtkOverlay* _tmp4_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (message != NULL);
	_tmp0_ = (GdNotification*) gd_notification_new ();
	g_object_ref_sink (_tmp0_);
	notification = _tmp0_;
	g_object_set (notification, "timeout", 5, NULL);
	_tmp1_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp1_);
	g = _tmp1_;
	gtk_grid_set_column_spacing (g, (guint) 8);
	_tmp2_ = message;
	_tmp3_ = (GtkLabel*) gtk_label_new (_tmp2_);
	g_object_ref_sink (_tmp3_);
	l = _tmp3_;
	gtk_label_set_line_wrap (l, TRUE);
	gtk_label_set_line_wrap_mode (l, PANGO_WRAP_WORD_CHAR);
	gtk_container_add ((GtkContainer*) notification, (GtkWidget*) l);
	gtk_widget_show_all ((GtkWidget*) notification);
	_tmp4_ = self->priv->overlay;
	gtk_overlay_add_overlay (_tmp4_, (GtkWidget*) notification);
	_g_object_unref0 (l);
	_g_object_unref0 (g);
	_g_object_unref0 (notification);
}


void contacts_app_new_contact (ContactsApp* self) {
	ContactsNewContactDialog* dialog = NULL;
	ContactsStore* _tmp0_ = NULL;
	ContactsWindow* _tmp1_ = NULL;
	ContactsNewContactDialog* _tmp2_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->contacts_store;
	_tmp1_ = self->window;
	_tmp2_ = contacts_new_contact_dialog_get_default (_tmp0_, _tmp1_);
	dialog = _tmp2_;
	gtk_widget_show_all ((GtkWidget*) dialog);
	_g_object_unref0 (dialog);
}


static Block9Data* block9_data_ref (Block9Data* _data9_) {
	g_atomic_int_inc (&_data9_->_ref_count_);
	return _data9_;
}


static void block9_data_unref (void * _userdata_) {
	Block9Data* _data9_;
	_data9_ = (Block9Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data9_->_ref_count_)) {
		ContactsApp * self;
		self = _data9_->self;
		_g_object_unref0 (_data9_->notification);
		_g_object_unref0 (_data9_->operation);
		_g_object_unref0 (self);
		g_slice_free (Block9Data, _data9_);
	}
}


static void __lambda115_ (Block9Data* _data9_, GObject* obj, GAsyncResult* _result_) {
	ContactsApp * self;
	GAsyncResult* _tmp0_ = NULL;
	ContactsLinkOperation2* _tmp1_ = NULL;
	self = _data9_->self;
	g_return_if_fail (_result_ != NULL);
	_tmp0_ = _result_;
	_tmp1_ = contacts_link_contacts_list_finish (_tmp0_);
	_g_object_unref0 (_data9_->operation);
	_data9_->operation = _tmp1_;
}


static void ___lambda115__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	__lambda115_ (self, source_object, res);
	block9_data_unref (self);
}


static void __lambda116_ (Block9Data* _data9_) {
	ContactsApp * self;
	self = _data9_->self;
	contacts_link_operation2_undo (_data9_->operation, NULL, NULL);
	gd_notification_dismiss (_data9_->notification);
}


static void ___lambda116__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda116_ (self);
}


static void contacts_app_link_contacts (ContactsApp* self, GeeLinkedList* contact_list) {
	Block9Data* _data9_;
	GtkToggleButton* _tmp0_ = NULL;
	GeeLinkedList* _tmp1_ = NULL;
	GdNotification* _tmp2_ = NULL;
	GtkGrid* g = NULL;
	GtkGrid* _tmp3_ = NULL;
	gchar* msg = NULL;
	GeeLinkedList* _tmp4_ = NULL;
	gint _tmp5_ = 0;
	gint _tmp6_ = 0;
	const gchar* _tmp7_ = NULL;
	GeeLinkedList* _tmp8_ = NULL;
	gint _tmp9_ = 0;
	gint _tmp10_ = 0;
	gchar* _tmp11_ = NULL;
	GtkButton* b = NULL;
	GtkButton* _tmp12_ = NULL;
	GtkLabel* _tmp13_ = NULL;
	GtkLabel* _tmp14_ = NULL;
	GtkOverlay* _tmp15_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (contact_list != NULL);
	_data9_ = g_slice_new0 (Block9Data);
	_data9_->_ref_count_ = 1;
	_data9_->self = g_object_ref (self);
	contacts_app_show_contact (self, NULL);
	_tmp0_ = self->priv->select_button;
	gtk_toggle_button_set_active (_tmp0_, FALSE);
	_data9_->operation = NULL;
	_tmp1_ = contact_list;
	contacts_link_contacts_list (_tmp1_, ___lambda115__gasync_ready_callback, block9_data_ref (_data9_));
	_tmp2_ = (GdNotification*) gd_notification_new ();
	g_object_ref_sink (_tmp2_);
	_data9_->notification = _tmp2_;
	g_object_set (_data9_->notification, "timeout", 5, NULL);
	_tmp3_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp3_);
	g = _tmp3_;
	gtk_grid_set_column_spacing (g, (guint) 8);
	gtk_container_add ((GtkContainer*) _data9_->notification, (GtkWidget*) g);
	_tmp4_ = contact_list;
	_tmp5_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = ngettext ("%d contacts linked", "%d contacts linked", (gulong) _tmp6_);
	_tmp8_ = contact_list;
	_tmp9_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = g_strdup_printf (_tmp7_, _tmp10_);
	msg = _tmp11_;
	_tmp12_ = (GtkButton*) gtk_button_new_from_stock (GTK_STOCK_UNDO);
	g_object_ref_sink (_tmp12_);
	b = _tmp12_;
	_tmp13_ = (GtkLabel*) gtk_label_new (msg);
	g_object_ref_sink (_tmp13_);
	_tmp14_ = _tmp13_;
	gtk_container_add ((GtkContainer*) g, (GtkWidget*) _tmp14_);
	_g_object_unref0 (_tmp14_);
	gtk_container_add ((GtkContainer*) g, (GtkWidget*) b);
	gtk_widget_show_all ((GtkWidget*) _data9_->notification);
	_tmp15_ = self->priv->overlay;
	gtk_overlay_add_overlay (_tmp15_, (GtkWidget*) _data9_->notification);
	g_signal_connect_data (b, "clicked", (GCallback) ___lambda116__gtk_button_clicked, block9_data_ref (_data9_), (GClosureNotify) block9_data_unref, 0);
	_g_object_unref0 (b);
	_g_free0 (msg);
	_g_object_unref0 (g);
	block9_data_unref (_data9_);
	_data9_ = NULL;
}


static Block10Data* block10_data_ref (Block10Data* _data10_) {
	g_atomic_int_inc (&_data10_->_ref_count_);
	return _data10_;
}


static void block10_data_unref (void * _userdata_) {
	Block10Data* _data10_;
	_data10_ = (Block10Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data10_->_ref_count_)) {
		ContactsApp * self;
		self = _data10_->self;
		_g_object_unref0 (_data10_->notification);
		_g_object_unref0 (_data10_->contact_list);
		_g_object_unref0 (self);
		g_slice_free (Block10Data, _data10_);
	}
}


static void __lambda117_ (Block10Data* _data10_) {
	ContactsApp * self;
	self = _data10_->self;
	if (_data10_->really_delete) {
		{
			GeeLinkedList* _c_list = NULL;
			GeeLinkedList* _tmp0_ = NULL;
			GeeLinkedList* _tmp1_ = NULL;
			gint _c_size = 0;
			GeeLinkedList* _tmp2_ = NULL;
			gint _tmp3_ = 0;
			gint _tmp4_ = 0;
			gint _c_index = 0;
			_tmp0_ = _data10_->contact_list;
			_tmp1_ = _g_object_ref0 (_tmp0_);
			_c_list = _tmp1_;
			_tmp2_ = _c_list;
			_tmp3_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp2_);
			_tmp4_ = _tmp3_;
			_c_size = _tmp4_;
			_c_index = -1;
			while (TRUE) {
				gint _tmp5_ = 0;
				gint _tmp6_ = 0;
				gint _tmp7_ = 0;
				ContactsContact* c = NULL;
				GeeLinkedList* _tmp8_ = NULL;
				gint _tmp9_ = 0;
				gpointer _tmp10_ = NULL;
				ContactsContact* _tmp11_ = NULL;
				_tmp5_ = _c_index;
				_c_index = _tmp5_ + 1;
				_tmp6_ = _c_index;
				_tmp7_ = _c_size;
				if (!(_tmp6_ < _tmp7_)) {
					break;
				}
				_tmp8_ = _c_list;
				_tmp9_ = _c_index;
				_tmp10_ = gee_abstract_list_get ((GeeAbstractList*) _tmp8_, _tmp9_);
				c = (ContactsContact*) _tmp10_;
				_tmp11_ = c;
				contacts_contact_remove_personas (_tmp11_, NULL, NULL);
				_g_object_unref0 (c);
			}
			_g_object_unref0 (_c_list);
		}
	}
}


static void ___lambda117__gd_notification_dismissed (GdNotification* _sender, gpointer self) {
	__lambda117_ (self);
}


static void __lambda118_ (Block10Data* _data10_) {
	ContactsApp * self;
	self = _data10_->self;
	_data10_->really_delete = FALSE;
	gd_notification_dismiss (_data10_->notification);
	{
		GeeLinkedList* _c_list = NULL;
		GeeLinkedList* _tmp0_ = NULL;
		GeeLinkedList* _tmp1_ = NULL;
		gint _c_size = 0;
		GeeLinkedList* _tmp2_ = NULL;
		gint _tmp3_ = 0;
		gint _tmp4_ = 0;
		gint _c_index = 0;
		_tmp0_ = _data10_->contact_list;
		_tmp1_ = _g_object_ref0 (_tmp0_);
		_c_list = _tmp1_;
		_tmp2_ = _c_list;
		_tmp3_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_c_size = _tmp4_;
		_c_index = -1;
		while (TRUE) {
			gint _tmp5_ = 0;
			gint _tmp6_ = 0;
			gint _tmp7_ = 0;
			ContactsContact* c = NULL;
			GeeLinkedList* _tmp8_ = NULL;
			gint _tmp9_ = 0;
			gpointer _tmp10_ = NULL;
			ContactsContact* _tmp11_ = NULL;
			_tmp5_ = _c_index;
			_c_index = _tmp5_ + 1;
			_tmp6_ = _c_index;
			_tmp7_ = _c_size;
			if (!(_tmp6_ < _tmp7_)) {
				break;
			}
			_tmp8_ = _c_list;
			_tmp9_ = _c_index;
			_tmp10_ = gee_abstract_list_get ((GeeAbstractList*) _tmp8_, _tmp9_);
			c = (ContactsContact*) _tmp10_;
			_tmp11_ = c;
			contacts_contact_show (_tmp11_);
			_g_object_unref0 (c);
		}
		_g_object_unref0 (_c_list);
	}
}


static void ___lambda118__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda118_ (self);
}


static void contacts_app_delete_contacts (ContactsApp* self, GeeLinkedList* contact_list) {
	Block10Data* _data10_;
	GeeLinkedList* _tmp0_ = NULL;
	GeeLinkedList* _tmp1_ = NULL;
	GtkToggleButton* _tmp2_ = NULL;
	GdNotification* _tmp3_ = NULL;
	GtkGrid* g = NULL;
	GtkGrid* _tmp4_ = NULL;
	gchar* msg = NULL;
	GeeLinkedList* _tmp5_ = NULL;
	gint _tmp6_ = 0;
	gint _tmp7_ = 0;
	const gchar* _tmp8_ = NULL;
	GeeLinkedList* _tmp9_ = NULL;
	gint _tmp10_ = 0;
	gint _tmp11_ = 0;
	gchar* _tmp12_ = NULL;
	GtkButton* b = NULL;
	GtkButton* _tmp13_ = NULL;
	GtkLabel* _tmp14_ = NULL;
	GtkLabel* _tmp15_ = NULL;
	GtkOverlay* _tmp16_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (contact_list != NULL);
	_data10_ = g_slice_new0 (Block10Data);
	_data10_->_ref_count_ = 1;
	_data10_->self = g_object_ref (self);
	_tmp0_ = contact_list;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data10_->contact_list);
	_data10_->contact_list = _tmp1_;
	contacts_app_show_contact (self, NULL);
	_tmp2_ = self->priv->select_button;
	gtk_toggle_button_set_active (_tmp2_, FALSE);
	_tmp3_ = (GdNotification*) gd_notification_new ();
	g_object_ref_sink (_tmp3_);
	_data10_->notification = _tmp3_;
	g_object_set (_data10_->notification, "timeout", 5, NULL);
	_tmp4_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp4_);
	g = _tmp4_;
	gtk_grid_set_column_spacing (g, (guint) 8);
	gtk_container_add ((GtkContainer*) _data10_->notification, (GtkWidget*) g);
	_tmp5_ = _data10_->contact_list;
	_tmp6_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = ngettext ("%d contact deleted", "%d contacts deleted", (gulong) _tmp7_);
	_tmp9_ = _data10_->contact_list;
	_tmp10_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = g_strdup_printf (_tmp8_, _tmp11_);
	msg = _tmp12_;
	_tmp13_ = (GtkButton*) gtk_button_new_from_stock (GTK_STOCK_UNDO);
	g_object_ref_sink (_tmp13_);
	b = _tmp13_;
	_tmp14_ = (GtkLabel*) gtk_label_new (msg);
	g_object_ref_sink (_tmp14_);
	_tmp15_ = _tmp14_;
	gtk_container_add ((GtkContainer*) g, (GtkWidget*) _tmp15_);
	_g_object_unref0 (_tmp15_);
	gtk_container_add ((GtkContainer*) g, (GtkWidget*) b);
	gtk_widget_show_all ((GtkWidget*) _data10_->notification);
	_tmp16_ = self->priv->overlay;
	gtk_overlay_add_overlay (_tmp16_, (GtkWidget*) _data10_->notification);
	_data10_->really_delete = TRUE;
	g_signal_connect_data (_data10_->notification, "dismissed", (GCallback) ___lambda117__gd_notification_dismissed, block10_data_ref (_data10_), (GClosureNotify) block10_data_unref, 0);
	g_signal_connect_data (b, "clicked", (GCallback) ___lambda118__gtk_button_clicked, block10_data_ref (_data10_), (GClosureNotify) block10_data_unref, 0);
	_g_object_unref0 (b);
	_g_free0 (msg);
	_g_object_unref0 (g);
	block10_data_unref (_data10_);
	_data10_ = NULL;
}


static Block11Data* block11_data_ref (Block11Data* _data11_) {
	g_atomic_int_inc (&_data11_->_ref_count_);
	return _data11_;
}


static void block11_data_unref (void * _userdata_) {
	Block11Data* _data11_;
	_data11_ = (Block11Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data11_->_ref_count_)) {
		ContactsApp * self;
		self = _data11_->self;
		_g_object_unref0 (_data11_->notification);
		_g_object_unref0 (_data11_->contact);
		_g_object_unref0 (self);
		g_slice_free (Block11Data, _data11_);
	}
}


static void ___lambda120_ (Block11Data* _data11_) {
	ContactsApp * self;
	ContactsContact* _tmp0_ = NULL;
	self = _data11_->self;
	_tmp0_ = _data11_->contact;
	contacts_contact_show (_tmp0_);
}


static void ____lambda120__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	___lambda120_ (self);
	block11_data_unref (self);
}


static void __lambda119_ (Block11Data* _data11_) {
	ContactsApp * self;
	self = _data11_->self;
	if (_data11_->really_delete) {
		ContactsContact* _tmp0_ = NULL;
		_tmp0_ = _data11_->contact;
		contacts_contact_remove_personas (_tmp0_, ____lambda120__gasync_ready_callback, block11_data_ref (_data11_));
	}
}


static void ___lambda119__gd_notification_dismissed (GdNotification* _sender, gpointer self) {
	__lambda119_ (self);
}


static void __lambda121_ (Block11Data* _data11_) {
	ContactsApp * self;
	ContactsContact* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	self = _data11_->self;
	_data11_->really_delete = FALSE;
	gd_notification_dismiss (_data11_->notification);
	_tmp0_ = _data11_->contact;
	contacts_contact_show (_tmp0_);
	_tmp1_ = _data11_->contact;
	contacts_app_show_contact (self, _tmp1_);
}


static void ___lambda121__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda121_ (self);
}


static void contacts_app_delete_contact (ContactsApp* self, ContactsContact* contact) {
	Block11Data* _data11_;
	ContactsContact* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	GtkLabel* _tmp2_ = NULL;
	GtkButton* _tmp3_ = NULL;
	ContactsContactPane* _tmp4_ = NULL;
	GdNotification* _tmp5_ = NULL;
	GtkGrid* g = NULL;
	GtkGrid* _tmp6_ = NULL;
	GtkLabel* label = NULL;
	const gchar* _tmp7_ = NULL;
	ContactsContact* _tmp8_ = NULL;
	const gchar* _tmp9_ = NULL;
	const gchar* _tmp10_ = NULL;
	gchar* _tmp11_ = NULL;
	gchar* _tmp12_ = NULL;
	GtkLabel* _tmp13_ = NULL;
	GtkLabel* _tmp14_ = NULL;
	GtkButton* b = NULL;
	GtkButton* _tmp15_ = NULL;
	GtkOverlay* _tmp16_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (contact != NULL);
	_data11_ = g_slice_new0 (Block11Data);
	_data11_->_ref_count_ = 1;
	_data11_->self = g_object_ref (self);
	_tmp0_ = contact;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data11_->contact);
	_data11_->contact = _tmp1_;
	_tmp2_ = self->priv->contact_name;
	gtk_label_set_text (_tmp2_, NULL);
	_tmp3_ = self->priv->done_button;
	gtk_widget_hide ((GtkWidget*) _tmp3_);
	_tmp4_ = self->priv->contacts_pane;
	contacts_contact_pane_set_edit_mode (_tmp4_, FALSE);
	_tmp5_ = (GdNotification*) gd_notification_new ();
	g_object_ref_sink (_tmp5_);
	_data11_->notification = _tmp5_;
	g_object_set (_data11_->notification, "timeout", 5, NULL);
	_tmp6_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp6_);
	g = _tmp6_;
	gtk_grid_set_column_spacing (g, (guint) 8);
	gtk_container_add ((GtkContainer*) _data11_->notification, (GtkWidget*) g);
	_tmp7_ = _ ("Contact deleted: \"%s\"");
	_tmp8_ = _data11_->contact;
	_tmp9_ = contacts_contact_get_display_name (_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = g_strdup_printf (_tmp7_, _tmp10_);
	_tmp12_ = _tmp11_;
	_tmp13_ = (GtkLabel*) gtk_label_new (_tmp12_);
	g_object_ref_sink (_tmp13_);
	_tmp14_ = _tmp13_;
	_g_free0 (_tmp12_);
	label = _tmp14_;
	gtk_label_set_max_width_chars (label, 45);
	gtk_label_set_ellipsize (label, PANGO_ELLIPSIZE_END);
	_tmp15_ = (GtkButton*) gtk_button_new_from_stock (GTK_STOCK_UNDO);
	g_object_ref_sink (_tmp15_);
	b = _tmp15_;
	gtk_container_add ((GtkContainer*) g, (GtkWidget*) label);
	gtk_container_add ((GtkContainer*) g, (GtkWidget*) b);
	_data11_->really_delete = TRUE;
	gtk_widget_show_all ((GtkWidget*) _data11_->notification);
	g_signal_connect_data (_data11_->notification, "dismissed", (GCallback) ___lambda119__gd_notification_dismissed, block11_data_ref (_data11_), (GClosureNotify) block11_data_unref, 0);
	g_signal_connect_data (b, "clicked", (GCallback) ___lambda121__gtk_button_clicked, block11_data_ref (_data11_), (GClosureNotify) block11_data_unref, 0);
	_tmp16_ = self->priv->overlay;
	gtk_overlay_add_overlay (_tmp16_, (GtkWidget*) _data11_->notification);
	_g_object_unref0 (b);
	_g_object_unref0 (label);
	_g_object_unref0 (g);
	block11_data_unref (_data11_);
	_data11_ = NULL;
}


static Block12Data* block12_data_ref (Block12Data* _data12_) {
	g_atomic_int_inc (&_data12_->_ref_count_);
	return _data12_;
}


static void block12_data_unref (void * _userdata_) {
	Block12Data* _data12_;
	_data12_ = (Block12Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data12_->_ref_count_)) {
		ContactsApp * self;
		self = _data12_->self;
		_g_object_unref0 (_data12_->notification);
		_g_object_unref0 (_data12_->operation);
		_g_object_unref0 (self);
		g_slice_free (Block12Data, _data12_);
	}
}


static void __lambda122_ (Block12Data* _data12_) {
	ContactsApp * self;
	GdNotification* _tmp0_ = NULL;
	ContactsLinkOperation* _tmp1_ = NULL;
	self = _data12_->self;
	_tmp0_ = _data12_->notification;
	gd_notification_dismiss (_tmp0_);
	_tmp1_ = _data12_->operation;
	contacts_link_operation_undo (_tmp1_, NULL, NULL);
}


static void ___lambda122__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda122_ (self);
}


static void contacts_app_contacts_linked (ContactsApp* self, const gchar* main_contact, const gchar* linked_contact, ContactsLinkOperation* operation) {
	Block12Data* _data12_;
	ContactsLinkOperation* _tmp0_ = NULL;
	ContactsLinkOperation* _tmp1_ = NULL;
	GdNotification* _tmp2_ = NULL;
	GdNotification* _tmp3_ = NULL;
	GtkGrid* g = NULL;
	GtkGrid* _tmp4_ = NULL;
	GtkGrid* _tmp5_ = NULL;
	GdNotification* _tmp6_ = NULL;
	GtkGrid* _tmp7_ = NULL;
	gchar* msg = NULL;
	const gchar* _tmp8_ = NULL;
	GtkButton* b = NULL;
	GtkButton* _tmp16_ = NULL;
	GtkGrid* _tmp17_ = NULL;
	const gchar* _tmp18_ = NULL;
	GtkLabel* _tmp19_ = NULL;
	GtkLabel* _tmp20_ = NULL;
	GtkGrid* _tmp21_ = NULL;
	GdNotification* _tmp22_ = NULL;
	GtkOverlay* _tmp23_ = NULL;
	GdNotification* _tmp24_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (linked_contact != NULL);
	g_return_if_fail (operation != NULL);
	_data12_ = g_slice_new0 (Block12Data);
	_data12_->_ref_count_ = 1;
	_data12_->self = g_object_ref (self);
	_tmp0_ = operation;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data12_->operation);
	_data12_->operation = _tmp1_;
	_tmp2_ = (GdNotification*) gd_notification_new ();
	g_object_ref_sink (_tmp2_);
	_data12_->notification = _tmp2_;
	_tmp3_ = _data12_->notification;
	g_object_set (_tmp3_, "timeout", 5, NULL);
	_tmp4_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp4_);
	g = _tmp4_;
	_tmp5_ = g;
	gtk_grid_set_column_spacing (_tmp5_, (guint) 8);
	_tmp6_ = _data12_->notification;
	_tmp7_ = g;
	gtk_container_add ((GtkContainer*) _tmp6_, (GtkWidget*) _tmp7_);
	_tmp8_ = main_contact;
	if (_tmp8_ != NULL) {
		const gchar* _tmp9_ = NULL;
		const gchar* _tmp10_ = NULL;
		const gchar* _tmp11_ = NULL;
		gchar* _tmp12_ = NULL;
		_tmp9_ = _ ("%s linked to %s");
		_tmp10_ = main_contact;
		_tmp11_ = linked_contact;
		_tmp12_ = g_strdup_printf (_tmp9_, _tmp10_, _tmp11_);
		_g_free0 (msg);
		msg = _tmp12_;
	} else {
		const gchar* _tmp13_ = NULL;
		const gchar* _tmp14_ = NULL;
		gchar* _tmp15_ = NULL;
		_tmp13_ = _ ("%s linked to the contact");
		_tmp14_ = linked_contact;
		_tmp15_ = g_strdup_printf (_tmp13_, _tmp14_);
		_g_free0 (msg);
		msg = _tmp15_;
	}
	_tmp16_ = (GtkButton*) gtk_button_new_from_stock (GTK_STOCK_UNDO);
	g_object_ref_sink (_tmp16_);
	b = _tmp16_;
	_tmp17_ = g;
	_tmp18_ = msg;
	_tmp19_ = (GtkLabel*) gtk_label_new (_tmp18_);
	g_object_ref_sink (_tmp19_);
	_tmp20_ = _tmp19_;
	gtk_container_add ((GtkContainer*) _tmp17_, (GtkWidget*) _tmp20_);
	_g_object_unref0 (_tmp20_);
	_tmp21_ = g;
	gtk_container_add ((GtkContainer*) _tmp21_, (GtkWidget*) b);
	_tmp22_ = _data12_->notification;
	gtk_widget_show_all ((GtkWidget*) _tmp22_);
	g_signal_connect_data (b, "clicked", (GCallback) ___lambda122__gtk_button_clicked, block12_data_ref (_data12_), (GClosureNotify) block12_data_unref, 0);
	_tmp23_ = self->priv->overlay;
	_tmp24_ = _data12_->notification;
	gtk_overlay_add_overlay (_tmp23_, (GtkWidget*) _tmp24_);
	_g_object_unref0 (b);
	_g_free0 (msg);
	_g_object_unref0 (g);
	block12_data_unref (_data12_);
	_data12_ = NULL;
}


static gint contacts_app_real_command_line (GApplication* base, GApplicationCommandLine* command_line) {
	ContactsApp * self;
	gint result = 0;
	gchar** args = NULL;
	GApplicationCommandLine* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	gchar** _tmp2_ = NULL;
	gint args_length1 = 0;
	gint _args_size_ = 0;
	gchar** _args = NULL;
	gchar** _tmp3_ = NULL;
	gint _tmp3__length1 = 0;
	gint _args_length1 = 0;
	gint __args_size_ = 0;
	GOptionContext* context = NULL;
	GOptionContext* _tmp4_ = NULL;
	GOptionContext* _tmp5_ = NULL;
	GOptionContext* _tmp6_ = NULL;
	GOptionContext* _tmp7_ = NULL;
	GOptionGroup* _tmp8_ = NULL;
	const gchar* _tmp12_ = NULL;
	const gchar* _tmp15_ = NULL;
	GError * _inner_error_ = NULL;
	self = (ContactsApp*) base;
	g_return_val_if_fail (command_line != NULL, 0);
	_tmp0_ = command_line;
	_tmp2_ = g_application_command_line_get_arguments (_tmp0_, &_tmp1_);
	args = _tmp2_;
	args_length1 = _tmp1_;
	_args_size_ = args_length1;
	_tmp3_ = args;
	_tmp3__length1 = args_length1;
	_args = _tmp3_;
	_args_length1 = _tmp3__length1;
	__args_size_ = _args_length1;
	_tmp4_ = g_option_context_new ("— contact management");
	context = _tmp4_;
	_tmp5_ = context;
	g_option_context_add_main_entries (_tmp5_, CONTACTS_APP_options, GETTEXT_PACKAGE);
	_tmp6_ = context;
	g_option_context_set_translation_domain (_tmp6_, GETTEXT_PACKAGE);
	_tmp7_ = context;
	_tmp8_ = gtk_get_option_group (TRUE);
	g_option_context_add_group (_tmp7_, _tmp8_);
	_g_free0 (contacts_app_individual_id);
	contacts_app_individual_id = NULL;
	_g_free0 (contacts_app_email_address);
	contacts_app_email_address = NULL;
	{
		GOptionContext* _tmp9_ = NULL;
		_tmp9_ = context;
		g_option_context_parse (_tmp9_, &_args_length1, &_args, &_inner_error_);
		if (_inner_error_ != NULL) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp10_ = NULL;
		const gchar* _tmp11_ = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp10_ = e;
		_tmp11_ = _tmp10_->message;
		g_printerr ("Unable to parse: %s\n", _tmp11_);
		result = 1;
		_g_error_free0 (e);
		_g_option_context_free0 (context);
		args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), NULL);
		return result;
	}
	__finally0:
	if (_inner_error_ != NULL) {
		_g_option_context_free0 (context);
		args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), 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 0;
	}
	g_application_activate ((GApplication*) self);
	_tmp12_ = contacts_app_individual_id;
	if (_tmp12_ != NULL) {
		ContactsApp* _tmp13_ = NULL;
		const gchar* _tmp14_ = NULL;
		_tmp13_ = contacts_app_app;
		_tmp14_ = contacts_app_individual_id;
		contacts_app_show_individual (_tmp13_, _tmp14_, NULL, NULL);
	}
	_tmp15_ = contacts_app_email_address;
	if (_tmp15_ != NULL) {
		ContactsApp* _tmp16_ = NULL;
		const gchar* _tmp17_ = NULL;
		_tmp16_ = contacts_app_app;
		_tmp17_ = contacts_app_email_address;
		contacts_app_show_by_email (_tmp16_, _tmp17_, NULL, NULL);
	}
	result = 0;
	_g_option_context_free0 (context);
	args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), NULL);
	return result;
}


static void _vala_array_add1 (FolksPersonaStore*** array, int* length, int* size, FolksPersonaStore* value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (FolksPersonaStore*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}


FolksPersonaStore** contacts_app_get_eds_address_books (int* result_length1) {
	FolksPersonaStore** result = NULL;
	FolksPersonaStore** stores = NULL;
	FolksPersonaStore** _tmp0_ = NULL;
	gint stores_length1 = 0;
	gint _stores_size_ = 0;
	FolksPersonaStore** _tmp34_ = NULL;
	gint _tmp34__length1 = 0;
	_tmp0_ = g_new0 (FolksPersonaStore*, 0 + 1);
	stores = _tmp0_;
	stores_length1 = 0;
	_stores_size_ = stores_length1;
	{
		GeeIterator* _backend_it = NULL;
		ContactsApp* _tmp1_ = NULL;
		ContactsStore* _tmp2_ = NULL;
		FolksBackendStore* _tmp3_ = NULL;
		FolksBackendStore* _tmp4_ = NULL;
		GeeMap* _tmp5_ = NULL;
		GeeMap* _tmp6_ = NULL;
		GeeCollection* _tmp7_ = NULL;
		GeeCollection* _tmp8_ = NULL;
		GeeCollection* _tmp9_ = NULL;
		GeeIterator* _tmp10_ = NULL;
		GeeIterator* _tmp11_ = NULL;
		_tmp1_ = contacts_app_app;
		_tmp2_ = _tmp1_->contacts_store;
		_tmp3_ = contacts_store_get_backend_store (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = folks_backend_store_get_enabled_backends (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = gee_map_get_values (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = _tmp8_;
		_tmp10_ = gee_iterable_iterator ((GeeIterable*) _tmp9_);
		_tmp11_ = _tmp10_;
		_g_object_unref0 (_tmp9_);
		_backend_it = _tmp11_;
		while (TRUE) {
			GeeIterator* _tmp12_ = NULL;
			gboolean _tmp13_ = FALSE;
			FolksBackend* backend = NULL;
			GeeIterator* _tmp14_ = NULL;
			gpointer _tmp15_ = NULL;
			_tmp12_ = _backend_it;
			_tmp13_ = gee_iterator_next (_tmp12_);
			if (!_tmp13_) {
				break;
			}
			_tmp14_ = _backend_it;
			_tmp15_ = gee_iterator_get (_tmp14_);
			backend = (FolksBackend*) _tmp15_;
			{
				GeeIterator* _persona_store_it = NULL;
				FolksBackend* _tmp16_ = NULL;
				GeeMap* _tmp17_ = NULL;
				GeeMap* _tmp18_ = NULL;
				GeeCollection* _tmp19_ = NULL;
				GeeCollection* _tmp20_ = NULL;
				GeeCollection* _tmp21_ = NULL;
				GeeIterator* _tmp22_ = NULL;
				GeeIterator* _tmp23_ = NULL;
				_tmp16_ = backend;
				_tmp17_ = folks_backend_get_persona_stores (_tmp16_);
				_tmp18_ = _tmp17_;
				_tmp19_ = gee_map_get_values (_tmp18_);
				_tmp20_ = _tmp19_;
				_tmp21_ = _tmp20_;
				_tmp22_ = gee_iterable_iterator ((GeeIterable*) _tmp21_);
				_tmp23_ = _tmp22_;
				_g_object_unref0 (_tmp21_);
				_persona_store_it = _tmp23_;
				while (TRUE) {
					GeeIterator* _tmp24_ = NULL;
					gboolean _tmp25_ = FALSE;
					FolksPersonaStore* persona_store = NULL;
					GeeIterator* _tmp26_ = NULL;
					gpointer _tmp27_ = NULL;
					FolksPersonaStore* _tmp28_ = NULL;
					const gchar* _tmp29_ = NULL;
					const gchar* _tmp30_ = NULL;
					_tmp24_ = _persona_store_it;
					_tmp25_ = gee_iterator_next (_tmp24_);
					if (!_tmp25_) {
						break;
					}
					_tmp26_ = _persona_store_it;
					_tmp27_ = gee_iterator_get (_tmp26_);
					persona_store = (FolksPersonaStore*) _tmp27_;
					_tmp28_ = persona_store;
					_tmp29_ = folks_persona_store_get_type_id (_tmp28_);
					_tmp30_ = _tmp29_;
					if (g_strcmp0 (_tmp30_, "eds") == 0) {
						FolksPersonaStore** _tmp31_ = NULL;
						gint _tmp31__length1 = 0;
						FolksPersonaStore* _tmp32_ = NULL;
						FolksPersonaStore* _tmp33_ = NULL;
						_tmp31_ = stores;
						_tmp31__length1 = stores_length1;
						_tmp32_ = persona_store;
						_tmp33_ = _g_object_ref0 (_tmp32_);
						_vala_array_add1 (&stores, &stores_length1, &_stores_size_, _tmp33_);
					}
					_g_object_unref0 (persona_store);
				}
				_g_object_unref0 (_persona_store_it);
			}
			_g_object_unref0 (backend);
		}
		_g_object_unref0 (_backend_it);
	}
	_tmp34_ = stores;
	_tmp34__length1 = stores_length1;
	if (result_length1) {
		*result_length1 = _tmp34__length1;
	}
	result = _tmp34_;
	return result;
}


ContactsApp* contacts_app_construct (GType object_type) {
	ContactsApp * self = NULL;
	ContactsApp* _tmp0_ = NULL;
	GSettings* _tmp1_ = NULL;
	self = (ContactsApp*) g_object_new (object_type, "application-id", "org.gnome.Contacts", "flags", G_APPLICATION_HANDLES_COMMAND_LINE, NULL);
	_tmp0_ = _g_object_ref0 (self);
	_g_object_unref0 (contacts_app_app);
	contacts_app_app = _tmp0_;
	_tmp1_ = g_settings_new ("org.gnome.Contacts");
	_g_object_unref0 (self->settings);
	self->settings = _tmp1_;
	return self;
}


ContactsApp* contacts_app_new (void) {
	return contacts_app_construct (CONTACTS_TYPE_APP);
}


static void contacts_app_class_init (ContactsAppClass * klass) {
	contacts_app_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ContactsAppPrivate));
	G_APPLICATION_CLASS (klass)->startup = contacts_app_real_startup;
	G_APPLICATION_CLASS (klass)->activate = contacts_app_real_activate;
	G_APPLICATION_CLASS (klass)->command_line = contacts_app_real_command_line;
	G_OBJECT_CLASS (klass)->finalize = contacts_app_finalize;
}


static void contacts_app_instance_init (ContactsApp * self) {
	self->priv = CONTACTS_APP_GET_PRIVATE (self);
}


static void contacts_app_finalize (GObject* obj) {
	ContactsApp * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONTACTS_TYPE_APP, ContactsApp);
	_g_object_unref0 (self->settings);
	_g_object_unref0 (self->contacts_store);
	_g_object_unref0 (self->window);
	_g_object_unref0 (self->priv->overlay);
	_g_object_unref0 (self->priv->left_toolbar);
	_g_object_unref0 (self->priv->select_button);
	_g_object_unref0 (self->priv->list_pane);
	_g_object_unref0 (self->priv->right_toolbar);
	_g_object_unref0 (self->priv->contact_name);
	_g_object_unref0 (self->priv->edit_button);
	_g_object_unref0 (self->priv->done_button);
	_g_object_unref0 (self->priv->contacts_pane);
	_g_object_unref0 (self->priv->right_overlay);
	G_OBJECT_CLASS (contacts_app_parent_class)->finalize (obj);
}


GType contacts_app_get_type (void) {
	static volatile gsize contacts_app_type_id__volatile = 0;
	if (g_once_init_enter (&contacts_app_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ContactsAppClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) contacts_app_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ContactsApp), 0, (GInstanceInitFunc) contacts_app_instance_init, NULL };
		GType contacts_app_type_id;
		contacts_app_type_id = g_type_register_static (GTK_TYPE_APPLICATION, "ContactsApp", &g_define_type_info, 0);
		g_once_init_leave (&contacts_app_type_id__volatile, contacts_app_type_id);
	}
	return contacts_app_type_id__volatile;
}


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


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



