~ubuntu-branches/ubuntu/trusty/gnome-contacts/trusty

« back to all changes in this revision

Viewing changes to src/contacts-view.c

  • Committer: Package Import Robot
  • Author(s): Michael Biebl, Jeremy Bicha, Michael Biebl
  • Date: 2013-09-19 18:23:06 UTC
  • mfrom: (1.3.10) (0.3.4 experimental)
  • mto: This revision was merged to the branch mainline in revision 40.
  • Revision ID: package-import@ubuntu.com-20130919182306-rcatwotzg94pr884
Tags: 3.8.3-1
[ Jeremy Bicha ]
* debian/control.in:
  - Drop alternate build-depends on valac-0.18 since it's no longer
    in Debian

[ Michael Biebl ]
* New upstream release.
* Loosen Build-Depends on libgnome-desktop-3-dev, we do not strictly require
  version (>= 3.6.0) which is not yet available in unstable.
* Bump Standards-Version to 3.9.4. No further changes.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* contacts-view.c generated by valac 0.15.1.23-684b1, the Vala compiler
 
1
/* contacts-view.c generated by valac 0.20.1, the Vala compiler
2
2
 * generated from contacts-view.vala, do not modify */
3
3
 
4
4
/* -*- Mode: vala; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 8 -*- */
21
21
 
22
22
#include <glib.h>
23
23
#include <glib-object.h>
24
 
#include <gtk/gtk.h>
 
24
#include <egg-list-box.h>
25
25
#include <gee.h>
26
26
#include <stdlib.h>
27
27
#include <string.h>
 
28
#include <gtk/gtk.h>
28
29
#include <folks/folks.h>
 
30
#include <pango/pango.h>
29
31
#include <glib/gi18n-lib.h>
30
 
#include <gdk-pixbuf/gdk-pixbuf.h>
31
 
#include <pango/pangocairo.h>
32
 
#include <cairo.h>
33
 
#include <pango/pango.h>
34
 
#include <float.h>
35
 
#include <math.h>
36
32
#include <gobject/gvaluecollector.h>
37
33
 
38
34
 
79
75
typedef struct _ContactsViewContactData ContactsViewContactData;
80
76
typedef struct _ContactsViewContactDataClass ContactsViewContactDataClass;
81
77
 
82
 
#define CONTACTS_TYPE_CELL_RENDERER_SHAPE (contacts_cell_renderer_shape_get_type ())
83
 
#define CONTACTS_CELL_RENDERER_SHAPE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_CELL_RENDERER_SHAPE, ContactsCellRendererShape))
84
 
#define CONTACTS_CELL_RENDERER_SHAPE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_CELL_RENDERER_SHAPE, ContactsCellRendererShapeClass))
85
 
#define CONTACTS_IS_CELL_RENDERER_SHAPE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_CELL_RENDERER_SHAPE))
86
 
#define CONTACTS_IS_CELL_RENDERER_SHAPE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_CELL_RENDERER_SHAPE))
87
 
#define CONTACTS_CELL_RENDERER_SHAPE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_CELL_RENDERER_SHAPE, ContactsCellRendererShapeClass))
88
 
 
89
 
typedef struct _ContactsCellRendererShape ContactsCellRendererShape;
90
 
typedef struct _ContactsCellRendererShapeClass ContactsCellRendererShapeClass;
91
 
 
92
78
#define CONTACTS_VIEW_TYPE_TEXT_DISPLAY (contacts_view_text_display_get_type ())
93
79
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
94
80
#define _contacts_view_contact_data_unref0(var) ((var == NULL) ? NULL : (var = (contacts_view_contact_data_unref (var), NULL)))
95
81
typedef struct _ContactsViewContactDataPrivate ContactsViewContactDataPrivate;
 
82
 
 
83
#define CONTACTS_TYPE_CONTACT_FRAME (contacts_contact_frame_get_type ())
 
84
#define CONTACTS_CONTACT_FRAME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_CONTACT_FRAME, ContactsContactFrame))
 
85
#define CONTACTS_CONTACT_FRAME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_CONTACT_FRAME, ContactsContactFrameClass))
 
86
#define CONTACTS_IS_CONTACT_FRAME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_CONTACT_FRAME))
 
87
#define CONTACTS_IS_CONTACT_FRAME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_CONTACT_FRAME))
 
88
#define CONTACTS_CONTACT_FRAME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_CONTACT_FRAME, ContactsContactFrameClass))
 
89
 
 
90
typedef struct _ContactsContactFrame ContactsContactFrame;
 
91
typedef struct _ContactsContactFrameClass ContactsContactFrameClass;
96
92
typedef struct _ContactsContactPrivate ContactsContactPrivate;
97
 
#define _gtk_tree_path_free0(var) ((var == NULL) ? NULL : (var = (gtk_tree_path_free (var), NULL)))
98
 
typedef struct _Block30Data Block30Data;
99
93
#define _g_free0(var) (var = (g_free (var), NULL))
 
94
typedef struct _Block36Data Block36Data;
100
95
typedef struct _ContactsViewParamSpecContactData ContactsViewParamSpecContactData;
 
96
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
101
97
 
102
98
struct _ContactsView {
103
 
        GtkTreeView parent_instance;
 
99
        EggListBox parent_instance;
104
100
        ContactsViewPrivate * priv;
105
101
};
106
102
 
107
103
struct _ContactsViewClass {
108
 
        GtkTreeViewClass parent_class;
 
104
        EggListBoxClass parent_class;
109
105
};
110
106
 
111
107
typedef enum  {
124
120
struct _ContactsViewPrivate {
125
121
        ContactsStore* contacts_store;
126
122
        ContactsViewSubset show_subset;
127
 
        GtkListStore* list_store;
 
123
        GeeHashMap* contacts;
128
124
        GeeHashSet* hidden_contacts;
 
125
        gint nr_contacts_marked;
129
126
        gchar** filter_values;
130
127
        gint filter_values_length1;
131
128
        gint _filter_values_size_;
132
 
        gint custom_visible_count;
133
 
        ContactsViewContactData* suggestions_header_data;
134
 
        ContactsViewContactData* padding_data;
135
 
        ContactsViewContactData* other_header_data;
136
 
        ContactsCellRendererShape* shape;
137
129
        ContactsViewTextDisplay text_display;
 
130
        gboolean selectors_visible;
 
131
        GtkWidget* last_selected;
138
132
};
139
133
 
140
134
struct _ContactsViewContactData {
142
136
        volatile int ref_count;
143
137
        ContactsViewContactDataPrivate * priv;
144
138
        ContactsContact* contact;
145
 
        GtkTreeIter iter;
146
 
        gboolean visible;
147
 
        gboolean is_first;
 
139
        GtkGrid* grid;
 
140
        GtkLabel* label;
 
141
        ContactsContactFrame* image_frame;
 
142
        GtkCheckButton* selector_button;
148
143
        gint sort_prio;
 
144
        gchar* display_name;
 
145
        gunichar initial_letter;
 
146
        gboolean filtered;
149
147
};
150
148
 
151
149
struct _ContactsViewContactDataClass {
168
166
        GObjectClass parent_class;
169
167
};
170
168
 
171
 
struct _Block30Data {
 
169
struct _Block36Data {
172
170
        int _ref_count_;
173
171
        ContactsView * self;
174
 
        ContactsViewTextDisplay text_display;
 
172
        ContactsViewContactData* data;
175
173
};
176
174
 
177
175
struct _ContactsViewParamSpecContactData {
193
191
static void contacts_view_value_take_contact_data (GValue* value, gpointer v_object) G_GNUC_UNUSED;
194
192
static gpointer contacts_view_value_get_contact_data (const GValue* value) G_GNUC_UNUSED;
195
193
static GType contacts_view_contact_data_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
196
 
GType contacts_cell_renderer_shape_get_type (void) G_GNUC_CONST;
197
194
GType contacts_view_text_display_get_type (void) G_GNUC_CONST;
198
195
#define CONTACTS_VIEW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CONTACTS_TYPE_VIEW, ContactsViewPrivate))
199
196
enum  {
201
198
};
202
199
ContactsView* contacts_view_new (ContactsStore* store, ContactsViewTextDisplay text_display);
203
200
ContactsView* contacts_view_construct (GType object_type, ContactsStore* store, ContactsViewTextDisplay text_display);
204
 
static ContactsViewContactData* contacts_view_contact_data_new (void);
205
 
static ContactsViewContactData* contacts_view_contact_data_construct (GType object_type);
206
 
static gint __lambda21_ (ContactsView* self, GtkTreeModel* model, GtkTreeIter* iter_a, GtkTreeIter* iter_b);
 
201
static gint __lambda23_ (ContactsView* self, GtkWidget* widget_a, GtkWidget* widget_b);
207
202
static gint contacts_view_compare_data (ContactsView* self, ContactsViewContactData* a_data, ContactsViewContactData* b_data);
208
 
static gint ___lambda21__gtk_tree_iter_compare_func (GtkTreeModel* model, GtkTreeIter* a, GtkTreeIter* b, gpointer self);
 
203
static gint ___lambda23__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self);
 
204
static gboolean contacts_view_filter (ContactsView* self, GtkWidget* child);
 
205
static gboolean _contacts_view_filter_egg_list_box_filter_func (GtkWidget* child, gpointer self);
 
206
static void contacts_view_update_separator (ContactsView* self, GtkWidget** separator, GtkWidget* widget, GtkWidget* before_widget);
 
207
static void _contacts_view_update_separator_egg_list_box_update_separator_func (GtkWidget** separator, GtkWidget* child, GtkWidget* before, gpointer self);
209
208
static void contacts_view_contact_added_cb (ContactsView* self, ContactsStore* store, ContactsContact* c);
210
209
static void _contacts_view_contact_added_cb_contacts_store_added (ContactsStore* _sender, ContactsContact* c, gpointer self);
211
210
static void contacts_view_contact_removed_cb (ContactsView* self, ContactsStore* store, ContactsContact* c);
213
212
static void contacts_view_contact_changed_cb (ContactsView* self, ContactsStore* store, ContactsContact* c);
214
213
static void _contacts_view_contact_changed_cb_contacts_store_changed (ContactsStore* _sender, ContactsContact* c, gpointer self);
215
214
GeeCollection* contacts_store_get_contacts (ContactsStore* self);
216
 
static void contacts_view_init_view (ContactsView* self, ContactsViewTextDisplay text_display);
217
215
static gint contacts_view_get_sort_prio (ContactsView* self, ContactsViewContactData* data);
218
216
gboolean contacts_is_set (const gchar* str);
219
 
const gchar* contacts_contact_get_display_name (ContactsContact* self);
 
217
GType contacts_contact_frame_get_type (void) G_GNUC_CONST;
220
218
static gboolean contacts_view_is_other (ContactsView* self, ContactsViewContactData* data);
221
 
gchar* contacts_view_get_header_text (ContactsView* self, GtkTreeIter* iter);
222
219
void contacts_view_set_show_subset (ContactsView* self, ContactsViewSubset subset);
223
 
static void contacts_view_refilter (ContactsView* self);
 
220
static void contacts_view_update_all_filtered (ContactsView* self);
224
221
void contacts_view_set_custom_sort_prio (ContactsView* self, ContactsContact* c, gint prio);
225
 
static ContactsViewContactData* contacts_view_lookup_data (ContactsView* self, ContactsContact* c);
226
 
static void contacts_view_add_custom_headers (ContactsView* self);
227
 
static void contacts_view_remove_custom_headers (ContactsView* self);
228
 
static gboolean contacts_view_apply_filter (ContactsView* self, ContactsContact* contact);
 
222
void contacts_view_hide_contact (ContactsView* self, ContactsContact* contact);
 
223
void contacts_view_set_filter_values (ContactsView* self, gchar** values, int values_length1);
 
224
static gchar** _vala_array_dup4 (gchar** self, int length);
 
225
static gboolean contacts_view_calculate_filtered (ContactsView* self, ContactsContact* c);
229
226
gboolean contacts_contact_get_is_hidden (ContactsContact* self);
230
227
gboolean contacts_contact_contains_strings (ContactsContact* self, gchar** strings, int strings_length1);
231
 
gboolean contacts_view_is_first (ContactsView* self, GtkTreeIter* iter);
232
 
static ContactsViewContactData* contacts_view_get_previous (ContactsView* self, ContactsViewContactData* data);
233
 
static ContactsViewContactData* contacts_view_get_next (ContactsView* self, ContactsViewContactData* data);
234
 
static void contacts_view_row_changed_no_resort (ContactsView* self, ContactsViewContactData* data);
235
 
static void contacts_view_row_changed_resort (ContactsView* self, ContactsViewContactData* data);
236
 
static gboolean contacts_view_update_is_first (ContactsView* self, ContactsViewContactData* data, ContactsViewContactData* previous);
 
228
static void contacts_view_update_data (ContactsView* self, ContactsViewContactData* data);
 
229
const gchar* contacts_contact_get_display_name (ContactsContact* self);
237
230
gunichar contacts_contact_get_initial_letter (ContactsContact* self);
238
 
static void contacts_view_add_to_model (ContactsView* self, ContactsViewContactData* data);
239
 
static void contacts_view_remove_from_model (ContactsView* self, ContactsViewContactData* data);
240
 
static void contacts_view_update_visible (ContactsView* self, ContactsViewContactData* data);
241
 
void contacts_view_hide_contact (ContactsView* self, ContactsContact* contact);
242
 
void contacts_view_set_filter_values (ContactsView* self, gchar** values, int values_length1);
243
 
static gchar** _vala_array_dup4 (gchar** self, int length);
244
 
gconstpointer contacts_contact_lookup (ContactsContact* self, GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, void* key);
245
 
void contacts_contact_set_lookup (ContactsContact* self, GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, void* key, gpointer data);
246
 
void contacts_contact_remove_lookup (ContactsContact* self, GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, void* key);
247
 
gboolean contacts_view_lookup_iter (ContactsView* self, ContactsContact* c, GtkTreeIter* iter);
248
 
static Block30Data* block30_data_ref (Block30Data* _data30_);
249
 
static void block30_data_unref (void * _userdata_);
250
 
static gboolean __lambda22_ (ContactsView* self, GtkTreeSelection* selection, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected);
251
 
static gboolean ___lambda22__gtk_tree_selection_func (GtkTreeSelection* selection, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected, gpointer self);
252
 
static void contacts_view_contacts_selection_changed (ContactsView* self, GtkTreeSelection* selection);
253
 
static void _contacts_view_contacts_selection_changed_gtk_tree_selection_changed (GtkTreeSelection* _sender, gpointer self);
 
231
void contacts_contact_frame_set_image (ContactsContactFrame* self, FolksAvatarDetails* details, ContactsContact* contact);
 
232
static Block36Data* block36_data_ref (Block36Data* _data36_);
 
233
static void block36_data_unref (void * _userdata_);
 
234
static ContactsViewContactData* contacts_view_contact_data_new (void);
 
235
static ContactsViewContactData* contacts_view_contact_data_construct (GType object_type);
254
236
#define CONTACTS_CONTACT_SMALL_AVATAR_SIZE 54
255
 
static void __lambda23_ (ContactsView* self, GtkCellLayout* column, GtkCellRenderer* cell, GtkTreeModel* model, GtkTreeIter* iter);
256
 
GdkPixbuf* contacts_contact_get_small_avatar (ContactsContact* self);
257
 
static void ___lambda23__gtk_cell_layout_data_func (GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer self);
258
 
ContactsCellRendererShape* contacts_cell_renderer_shape_new (void);
259
 
ContactsCellRendererShape* contacts_cell_renderer_shape_construct (GType object_type);
260
 
void contacts_cell_renderer_shape_render_shape (ContactsCellRendererShape* self, cairo_t* cr, PangoAttrShape* attr, gboolean do_path);
261
 
static void _contacts_cell_renderer_shape_render_shape_pango_cairo_shape_renderer_func (cairo_t* cr, PangoAttrShape* attr, gboolean do_path, gpointer self);
262
 
static void __lambda24_ (Block30Data* _data30_, GtkCellLayout* column, GtkCellRenderer* cell, GtkTreeModel* model, GtkTreeIter* iter);
 
237
ContactsContactFrame* contacts_contact_frame_new (gint size, gboolean with_button);
 
238
ContactsContactFrame* contacts_contact_frame_construct (GType object_type, gint size, gboolean with_button);
 
239
GtkWidget* contacts_contact_create_merged_presence_widget (ContactsContact* self);
263
240
gchar* contacts_contact_format_persona_stores (ContactsContact* self);
264
 
static void ___lambda24__gtk_cell_layout_data_func (GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer self);
265
 
static void __lambda25_ (ContactsView* self, GtkCellLayout* column, GtkCellRenderer* cell, GtkTreeModel* model, GtkTreeIter* iter);
266
 
static void ___lambda25__gtk_cell_layout_data_func (GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer self);
 
241
static void __lambda24_ (Block36Data* _data36_);
 
242
static void ___lambda24__gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self);
 
243
static void contacts_view_real_child_selected (EggListBox* base, GtkWidget* child);
 
244
void contacts_contact_fetch_contact_info (ContactsContact* self);
267
245
void contacts_view_select_contact (ContactsView* self, ContactsContact* contact);
 
246
void contacts_view_show_selectors (ContactsView* self);
 
247
void contacts_view_hide_selectors (ContactsView* self);
 
248
GeeLinkedList* contacts_view_get_marked_contacts (ContactsView* self);
268
249
enum  {
269
250
        CONTACTS_VIEW_CONTACT_DATA_DUMMY_PROPERTY
270
251
};
303
284
}
304
285
 
305
286
 
306
 
static gint __lambda21_ (ContactsView* self, GtkTreeModel* model, GtkTreeIter* iter_a, GtkTreeIter* iter_b) {
 
287
static gpointer _contacts_view_contact_data_ref0 (gpointer self) {
 
288
        return self ? contacts_view_contact_data_ref (self) : NULL;
 
289
}
 
290
 
 
291
 
 
292
static gint __lambda23_ (ContactsView* self, GtkWidget* widget_a, GtkWidget* widget_b) {
307
293
        gint result = 0;
308
 
        ContactsViewContactData* aa = NULL;
309
 
        ContactsViewContactData* bb = NULL;
310
 
        GtkTreeModel* _tmp0_;
311
 
        GtkTreeIter _tmp1_;
312
 
        GtkTreeModel* _tmp2_;
313
 
        GtkTreeIter _tmp3_;
314
 
        gint _tmp4_ = 0;
315
 
        g_return_val_if_fail (model != NULL, 0);
316
 
        g_return_val_if_fail (iter_a != NULL, 0);
317
 
        g_return_val_if_fail (iter_b != NULL, 0);
318
 
        _tmp0_ = model;
319
 
        _tmp1_ = *iter_a;
320
 
        gtk_tree_model_get (_tmp0_, &_tmp1_, 1, &aa, -1);
321
 
        _tmp2_ = model;
322
 
        _tmp3_ = *iter_b;
323
 
        gtk_tree_model_get (_tmp2_, &_tmp3_, 1, &bb, -1);
324
 
        _tmp4_ = contacts_view_compare_data (self, aa, bb);
325
 
        result = _tmp4_;
 
294
        GtkWidget* _tmp0_;
 
295
        gconstpointer _tmp1_ = NULL;
 
296
        ContactsViewContactData* _tmp2_;
 
297
        ContactsViewContactData* a;
 
298
        GtkWidget* _tmp3_;
 
299
        gconstpointer _tmp4_ = NULL;
 
300
        ContactsViewContactData* _tmp5_;
 
301
        ContactsViewContactData* b;
 
302
        gint _tmp6_ = 0;
 
303
        g_return_val_if_fail (widget_a != NULL, 0);
 
304
        g_return_val_if_fail (widget_b != NULL, 0);
 
305
        _tmp0_ = widget_a;
 
306
        _tmp1_ = g_object_get_data ((GObject*) _tmp0_, "data");
 
307
        _tmp2_ = _contacts_view_contact_data_ref0 ((ContactsViewContactData*) _tmp1_);
 
308
        a = _tmp2_;
 
309
        _tmp3_ = widget_b;
 
310
        _tmp4_ = g_object_get_data ((GObject*) _tmp3_, "data");
 
311
        _tmp5_ = _contacts_view_contact_data_ref0 ((ContactsViewContactData*) _tmp4_);
 
312
        b = _tmp5_;
 
313
        _tmp6_ = contacts_view_compare_data (self, a, b);
 
314
        result = _tmp6_;
 
315
        _contacts_view_contact_data_unref0 (b);
 
316
        _contacts_view_contact_data_unref0 (a);
326
317
        return result;
327
318
}
328
319
 
329
320
 
330
 
static gint ___lambda21__gtk_tree_iter_compare_func (GtkTreeModel* model, GtkTreeIter* a, GtkTreeIter* b, gpointer self) {
 
321
static gint ___lambda23__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self) {
331
322
        gint result;
332
 
        result = __lambda21_ (self, model, a, b);
333
 
        return result;
 
323
        result = __lambda23_ (self, a, b);
 
324
        return result;
 
325
}
 
326
 
 
327
 
 
328
static gboolean _contacts_view_filter_egg_list_box_filter_func (GtkWidget* child, gpointer self) {
 
329
        gboolean result;
 
330
        result = contacts_view_filter (self, child);
 
331
        return result;
 
332
}
 
333
 
 
334
 
 
335
static void _contacts_view_update_separator_egg_list_box_update_separator_func (GtkWidget** separator, GtkWidget* child, GtkWidget* before, gpointer self) {
 
336
        contacts_view_update_separator (self, separator, child, before);
334
337
}
335
338
 
336
339
 
354
357
        ContactsStore* _tmp0_;
355
358
        ContactsStore* _tmp1_;
356
359
        GeeHashSet* _tmp2_;
357
 
        GtkListStore* _tmp3_;
358
 
        ContactsViewContactData* _tmp4_;
359
 
        ContactsViewContactData* _tmp5_;
360
 
        gint _tmp6_;
361
 
        ContactsViewContactData* _tmp7_;
362
 
        ContactsViewContactData* _tmp8_;
363
 
        ContactsViewContactData* _tmp9_;
364
 
        ContactsViewContactData* _tmp10_;
365
 
        GtkListStore* _tmp11_;
366
 
        GtkListStore* _tmp12_;
367
 
        ContactsStore* _tmp13_;
368
 
        ContactsStore* _tmp14_;
369
 
        ContactsStore* _tmp15_;
370
 
        ContactsViewTextDisplay _tmp27_;
 
360
        ContactsViewTextDisplay _tmp3_;
 
361
        GeeHashMap* _tmp4_;
 
362
        ContactsStore* _tmp5_;
 
363
        ContactsStore* _tmp6_;
 
364
        ContactsStore* _tmp7_;
371
365
        g_return_val_if_fail (store != NULL, NULL);
372
366
        self = (ContactsView*) g_object_new (object_type, NULL);
 
367
        egg_list_box_set_selection_mode ((EggListBox*) self, GTK_SELECTION_BROWSE);
373
368
        _tmp0_ = store;
374
369
        _tmp1_ = _g_object_ref0 (_tmp0_);
375
370
        _g_object_unref0 (self->priv->contacts_store);
376
371
        self->priv->contacts_store = _tmp1_;
377
 
        _tmp2_ = gee_hash_set_new (CONTACTS_TYPE_CONTACT, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL);
 
372
        _tmp2_ = gee_hash_set_new (CONTACTS_TYPE_CONTACT, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
378
373
        _g_object_unref0 (self->priv->hidden_contacts);
379
374
        self->priv->hidden_contacts = _tmp2_;
 
375
        self->priv->nr_contacts_marked = 0;
380
376
        self->priv->show_subset = CONTACTS_VIEW_SUBSET_ALL;
381
 
        _tmp3_ = gtk_list_store_new (2, CONTACTS_TYPE_CONTACT, G_TYPE_POINTER);
382
 
        _g_object_unref0 (self->priv->list_store);
383
 
        self->priv->list_store = _tmp3_;
384
 
        _tmp4_ = contacts_view_contact_data_new ();
385
 
        _contacts_view_contact_data_unref0 (self->priv->suggestions_header_data);
386
 
        self->priv->suggestions_header_data = _tmp4_;
387
 
        _tmp5_ = self->priv->suggestions_header_data;
388
 
        _tmp6_ = G_MAXINT;
389
 
        _tmp5_->sort_prio = _tmp6_;
390
 
        _tmp7_ = contacts_view_contact_data_new ();
391
 
        _contacts_view_contact_data_unref0 (self->priv->padding_data);
392
 
        self->priv->padding_data = _tmp7_;
393
 
        _tmp8_ = self->priv->padding_data;
394
 
        _tmp8_->sort_prio = 1;
395
 
        _tmp9_ = contacts_view_contact_data_new ();
396
 
        _contacts_view_contact_data_unref0 (self->priv->other_header_data);
397
 
        self->priv->other_header_data = _tmp9_;
398
 
        _tmp10_ = self->priv->other_header_data;
399
 
        _tmp10_->sort_prio = -1;
400
 
        _tmp11_ = self->priv->list_store;
401
 
        gtk_tree_sortable_set_sort_func ((GtkTreeSortable*) _tmp11_, 0, ___lambda21__gtk_tree_iter_compare_func, g_object_ref (self), g_object_unref);
402
 
        _tmp12_ = self->priv->list_store;
403
 
        gtk_tree_sortable_set_sort_column_id ((GtkTreeSortable*) _tmp12_, 0, GTK_SORT_ASCENDING);
404
 
        _tmp13_ = self->priv->contacts_store;
405
 
        g_signal_connect_object (_tmp13_, "added", (GCallback) _contacts_view_contact_added_cb_contacts_store_added, self, 0);
406
 
        _tmp14_ = self->priv->contacts_store;
407
 
        g_signal_connect_object (_tmp14_, "removed", (GCallback) _contacts_view_contact_removed_cb_contacts_store_removed, self, 0);
408
 
        _tmp15_ = self->priv->contacts_store;
409
 
        g_signal_connect_object (_tmp15_, "changed", (GCallback) _contacts_view_contact_changed_cb_contacts_store_changed, self, 0);
 
377
        _tmp3_ = text_display;
 
378
        self->priv->text_display = _tmp3_;
 
379
        _tmp4_ = gee_hash_map_new (CONTACTS_TYPE_CONTACT, (GBoxedCopyFunc) g_object_ref, g_object_unref, CONTACTS_VIEW_TYPE_CONTACT_DATA, (GBoxedCopyFunc) contacts_view_contact_data_ref, contacts_view_contact_data_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
 
380
        _g_object_unref0 (self->priv->contacts);
 
381
        self->priv->contacts = _tmp4_;
 
382
        egg_list_box_set_sort_func ((EggListBox*) self, ___lambda23__gcompare_data_func, g_object_ref (self), g_object_unref);
 
383
        egg_list_box_set_filter_func ((EggListBox*) self, _contacts_view_filter_egg_list_box_filter_func, g_object_ref (self), g_object_unref);
 
384
        egg_list_box_set_separator_funcs ((EggListBox*) self, _contacts_view_update_separator_egg_list_box_update_separator_func, g_object_ref (self), g_object_unref);
 
385
        self->priv->selectors_visible = FALSE;
 
386
        _tmp5_ = self->priv->contacts_store;
 
387
        g_signal_connect_object (_tmp5_, "added", (GCallback) _contacts_view_contact_added_cb_contacts_store_added, self, 0);
 
388
        _tmp6_ = self->priv->contacts_store;
 
389
        g_signal_connect_object (_tmp6_, "removed", (GCallback) _contacts_view_contact_removed_cb_contacts_store_removed, self, 0);
 
390
        _tmp7_ = self->priv->contacts_store;
 
391
        g_signal_connect_object (_tmp7_, "changed", (GCallback) _contacts_view_contact_changed_cb_contacts_store_changed, self, 0);
410
392
        {
411
 
                ContactsStore* _tmp16_;
412
 
                GeeCollection* _tmp17_ = NULL;
413
 
                GeeCollection* _tmp18_;
414
 
                GeeIterator* _tmp19_ = NULL;
415
 
                GeeIterator* _tmp20_;
 
393
                ContactsStore* _tmp8_;
 
394
                GeeCollection* _tmp9_ = NULL;
 
395
                GeeCollection* _tmp10_;
 
396
                GeeIterator* _tmp11_ = NULL;
 
397
                GeeIterator* _tmp12_;
416
398
                GeeIterator* _c_it;
417
 
                _tmp16_ = store;
418
 
                _tmp17_ = contacts_store_get_contacts (_tmp16_);
419
 
                _tmp18_ = _tmp17_;
420
 
                _tmp19_ = gee_iterable_iterator ((GeeIterable*) _tmp18_);
421
 
                _tmp20_ = _tmp19_;
422
 
                _g_object_unref0 (_tmp18_);
423
 
                _c_it = _tmp20_;
 
399
                _tmp8_ = store;
 
400
                _tmp9_ = contacts_store_get_contacts (_tmp8_);
 
401
                _tmp10_ = _tmp9_;
 
402
                _tmp11_ = gee_iterable_iterator ((GeeIterable*) _tmp10_);
 
403
                _tmp12_ = _tmp11_;
 
404
                _g_object_unref0 (_tmp10_);
 
405
                _c_it = _tmp12_;
424
406
                while (TRUE) {
425
 
                        GeeIterator* _tmp21_;
426
 
                        gboolean _tmp22_ = FALSE;
427
 
                        GeeIterator* _tmp23_;
428
 
                        gpointer _tmp24_ = NULL;
 
407
                        GeeIterator* _tmp13_;
 
408
                        gboolean _tmp14_ = FALSE;
 
409
                        GeeIterator* _tmp15_;
 
410
                        gpointer _tmp16_ = NULL;
429
411
                        ContactsContact* c;
430
 
                        ContactsStore* _tmp25_;
431
 
                        ContactsContact* _tmp26_;
432
 
                        _tmp21_ = _c_it;
433
 
                        _tmp22_ = gee_iterator_next (_tmp21_);
434
 
                        if (!_tmp22_) {
 
412
                        ContactsStore* _tmp17_;
 
413
                        ContactsContact* _tmp18_;
 
414
                        _tmp13_ = _c_it;
 
415
                        _tmp14_ = gee_iterator_next (_tmp13_);
 
416
                        if (!_tmp14_) {
435
417
                                break;
436
418
                        }
437
 
                        _tmp23_ = _c_it;
438
 
                        _tmp24_ = gee_iterator_get (_tmp23_);
439
 
                        c = (ContactsContact*) _tmp24_;
440
 
                        _tmp25_ = store;
441
 
                        _tmp26_ = c;
442
 
                        contacts_view_contact_added_cb (self, _tmp25_, _tmp26_);
 
419
                        _tmp15_ = _c_it;
 
420
                        _tmp16_ = gee_iterator_get (_tmp15_);
 
421
                        c = (ContactsContact*) _tmp16_;
 
422
                        _tmp17_ = store;
 
423
                        _tmp18_ = c;
 
424
                        contacts_view_contact_added_cb (self, _tmp17_, _tmp18_);
443
425
                        _g_object_unref0 (c);
444
426
                }
445
427
                _g_object_unref0 (_c_it);
446
428
        }
447
 
        _tmp27_ = text_display;
448
 
        contacts_view_init_view (self, _tmp27_);
449
429
        return self;
450
430
}
451
431
 
467
447
        gint _tmp5_;
468
448
        gint _tmp6_;
469
449
        gint _tmp7_;
470
 
        ContactsViewContactData* _tmp8_;
471
 
        ContactsContact* _tmp9_;
472
 
        ContactsContact* _tmp10_;
473
 
        ContactsContact* a;
474
 
        ContactsViewContactData* _tmp11_;
475
 
        ContactsContact* _tmp12_;
476
 
        ContactsContact* _tmp13_;
477
 
        ContactsContact* b;
478
 
        gboolean _tmp14_ = FALSE;
479
 
        ContactsContact* _tmp15_;
480
 
        const gchar* _tmp16_;
481
 
        const gchar* _tmp17_;
482
 
        gboolean _tmp18_ = FALSE;
483
 
        gboolean _tmp23_;
484
 
        ContactsContact* _tmp31_;
485
 
        const gchar* _tmp32_;
486
 
        const gchar* _tmp33_;
487
 
        gboolean _tmp34_ = FALSE;
488
 
        ContactsContact* _tmp35_;
489
 
        const gchar* _tmp36_;
490
 
        const gchar* _tmp37_;
491
 
        gboolean _tmp38_ = FALSE;
 
450
        gboolean _tmp8_ = FALSE;
 
451
        ContactsViewContactData* _tmp9_;
 
452
        const gchar* _tmp10_;
 
453
        gboolean _tmp11_ = FALSE;
 
454
        gboolean _tmp15_;
 
455
        ContactsViewContactData* _tmp21_;
 
456
        const gchar* _tmp22_;
 
457
        gboolean _tmp23_ = FALSE;
 
458
        ContactsViewContactData* _tmp24_;
 
459
        const gchar* _tmp25_;
 
460
        gboolean _tmp26_ = FALSE;
492
461
        g_return_val_if_fail (self != NULL, 0);
493
462
        g_return_val_if_fail (a_data != NULL, 0);
494
463
        g_return_val_if_fail (b_data != NULL, 0);
510
479
                result = 1;
511
480
                return result;
512
481
        }
513
 
        _tmp8_ = a_data;
514
 
        _tmp9_ = _tmp8_->contact;
515
 
        _tmp10_ = _g_object_ref0 (_tmp9_);
516
 
        a = _tmp10_;
517
 
        _tmp11_ = b_data;
518
 
        _tmp12_ = _tmp11_->contact;
519
 
        _tmp13_ = _g_object_ref0 (_tmp12_);
520
 
        b = _tmp13_;
521
 
        _tmp15_ = a;
522
 
        _tmp16_ = contacts_contact_get_display_name (_tmp15_);
523
 
        _tmp17_ = _tmp16_;
524
 
        _tmp18_ = contacts_is_set (_tmp17_);
525
 
        if (_tmp18_) {
526
 
                ContactsContact* _tmp19_;
527
 
                const gchar* _tmp20_;
528
 
                const gchar* _tmp21_;
529
 
                gboolean _tmp22_ = FALSE;
530
 
                _tmp19_ = b;
531
 
                _tmp20_ = contacts_contact_get_display_name (_tmp19_);
532
 
                _tmp21_ = _tmp20_;
533
 
                _tmp22_ = contacts_is_set (_tmp21_);
534
 
                _tmp14_ = _tmp22_;
 
482
        _tmp9_ = a_data;
 
483
        _tmp10_ = _tmp9_->display_name;
 
484
        _tmp11_ = contacts_is_set (_tmp10_);
 
485
        if (_tmp11_) {
 
486
                ContactsViewContactData* _tmp12_;
 
487
                const gchar* _tmp13_;
 
488
                gboolean _tmp14_ = FALSE;
 
489
                _tmp12_ = b_data;
 
490
                _tmp13_ = _tmp12_->display_name;
 
491
                _tmp14_ = contacts_is_set (_tmp13_);
 
492
                _tmp8_ = _tmp14_;
535
493
        } else {
536
 
                _tmp14_ = FALSE;
537
 
        }
538
 
        _tmp23_ = _tmp14_;
 
494
                _tmp8_ = FALSE;
 
495
        }
 
496
        _tmp15_ = _tmp8_;
 
497
        if (_tmp15_) {
 
498
                ContactsViewContactData* _tmp16_;
 
499
                const gchar* _tmp17_;
 
500
                ContactsViewContactData* _tmp18_;
 
501
                const gchar* _tmp19_;
 
502
                gint _tmp20_ = 0;
 
503
                _tmp16_ = a_data;
 
504
                _tmp17_ = _tmp16_->display_name;
 
505
                _tmp18_ = b_data;
 
506
                _tmp19_ = _tmp18_->display_name;
 
507
                _tmp20_ = g_utf8_collate (_tmp17_, _tmp19_);
 
508
                result = _tmp20_;
 
509
                return result;
 
510
        }
 
511
        _tmp21_ = a_data;
 
512
        _tmp22_ = _tmp21_->display_name;
 
513
        _tmp23_ = contacts_is_set (_tmp22_);
539
514
        if (_tmp23_) {
540
 
                ContactsContact* _tmp24_;
541
 
                const gchar* _tmp25_;
542
 
                const gchar* _tmp26_;
543
 
                ContactsContact* _tmp27_;
544
 
                const gchar* _tmp28_;
545
 
                const gchar* _tmp29_;
546
 
                gint _tmp30_ = 0;
547
 
                _tmp24_ = a;
548
 
                _tmp25_ = contacts_contact_get_display_name (_tmp24_);
549
 
                _tmp26_ = _tmp25_;
550
 
                _tmp27_ = b;
551
 
                _tmp28_ = contacts_contact_get_display_name (_tmp27_);
552
 
                _tmp29_ = _tmp28_;
553
 
                _tmp30_ = g_utf8_collate (_tmp26_, _tmp29_);
554
 
                result = _tmp30_;
555
 
                _g_object_unref0 (b);
556
 
                _g_object_unref0 (a);
557
 
                return result;
558
 
        }
559
 
        _tmp31_ = a;
560
 
        _tmp32_ = contacts_contact_get_display_name (_tmp31_);
561
 
        _tmp33_ = _tmp32_;
562
 
        _tmp34_ = contacts_is_set (_tmp33_);
563
 
        if (_tmp34_) {
564
515
                result = -1;
565
 
                _g_object_unref0 (b);
566
 
                _g_object_unref0 (a);
567
516
                return result;
568
517
        }
569
 
        _tmp35_ = b;
570
 
        _tmp36_ = contacts_contact_get_display_name (_tmp35_);
571
 
        _tmp37_ = _tmp36_;
572
 
        _tmp38_ = contacts_is_set (_tmp37_);
573
 
        if (_tmp38_) {
 
518
        _tmp24_ = b_data;
 
519
        _tmp25_ = _tmp24_->display_name;
 
520
        _tmp26_ = contacts_is_set (_tmp25_);
 
521
        if (_tmp26_) {
574
522
                result = 1;
575
 
                _g_object_unref0 (b);
576
 
                _g_object_unref0 (a);
577
523
                return result;
578
524
        }
579
525
        result = 0;
580
 
        _g_object_unref0 (b);
581
 
        _g_object_unref0 (a);
582
526
        return result;
583
527
}
584
528
 
644
588
        _tmp4_ = data;
645
589
        _tmp5_ = contacts_view_is_other (self, _tmp4_);
646
590
        if (_tmp5_) {
647
 
                result = -2;
 
591
                result = -1;
648
592
                return result;
649
593
        }
650
594
        result = 0;
652
596
}
653
597
 
654
598
 
655
 
gchar* contacts_view_get_header_text (ContactsView* self, GtkTreeIter* iter) {
656
 
        gchar* result = NULL;
657
 
        ContactsViewContactData* data = NULL;
658
 
        GtkListStore* _tmp0_;
659
 
        GtkTreeIter _tmp1_;
660
 
        ContactsViewContactData* _tmp2_;
661
 
        ContactsViewContactData* _tmp3_;
662
 
        ContactsViewContactData* _tmp7_;
663
 
        ContactsViewContactData* _tmp8_;
664
 
        gchar* _tmp11_;
665
 
        g_return_val_if_fail (self != NULL, NULL);
666
 
        g_return_val_if_fail (iter != NULL, NULL);
667
 
        _tmp0_ = self->priv->list_store;
668
 
        _tmp1_ = *iter;
669
 
        gtk_tree_model_get ((GtkTreeModel*) _tmp0_, &_tmp1_, 1, &data, -1);
670
 
        _tmp2_ = data;
671
 
        _tmp3_ = self->priv->suggestions_header_data;
672
 
        if (_tmp2_ == _tmp3_) {
673
 
                gint _tmp4_;
674
 
                const gchar* _tmp5_ = NULL;
675
 
                gchar* _tmp6_;
676
 
                _tmp4_ = self->priv->custom_visible_count;
677
 
                _tmp5_ = ngettext ("Suggestion", "Suggestions", (gulong) _tmp4_);
678
 
                _tmp6_ = g_strdup (_tmp5_);
679
 
                result = _tmp6_;
680
 
                return result;
681
 
        }
682
 
        _tmp7_ = data;
683
 
        _tmp8_ = self->priv->other_header_data;
684
 
        if (_tmp7_ == _tmp8_) {
685
 
                const gchar* _tmp9_ = NULL;
686
 
                gchar* _tmp10_;
687
 
                _tmp9_ = _ ("Other Contacts");
688
 
                _tmp10_ = g_strdup (_tmp9_);
689
 
                result = _tmp10_;
690
 
                return result;
691
 
        }
692
 
        _tmp11_ = g_strdup ("");
693
 
        result = _tmp11_;
694
 
        return result;
695
 
}
696
 
 
697
 
 
698
599
void contacts_view_set_show_subset (ContactsView* self, ContactsViewSubset subset) {
699
600
        ContactsViewSubset _tmp0_;
700
 
        ContactsViewSubset _tmp1_;
701
 
        gboolean new_visible;
702
 
        gboolean _tmp2_ = FALSE;
703
 
        gboolean _tmp3_;
704
 
        gboolean _tmp6_;
705
 
        gboolean _tmp15_ = FALSE;
706
 
        gboolean _tmp16_;
707
 
        gboolean _tmp19_;
708
601
        g_return_if_fail (self != NULL);
709
602
        _tmp0_ = subset;
710
603
        self->priv->show_subset = _tmp0_;
711
 
        _tmp1_ = self->priv->show_subset;
712
 
        new_visible = _tmp1_ == CONTACTS_VIEW_SUBSET_ALL_SEPARATED;
713
 
        _tmp3_ = new_visible;
714
 
        if (_tmp3_) {
715
 
                ContactsViewContactData* _tmp4_;
716
 
                gboolean _tmp5_;
717
 
                _tmp4_ = self->priv->other_header_data;
718
 
                _tmp5_ = _tmp4_->visible;
719
 
                _tmp2_ = !_tmp5_;
720
 
        } else {
721
 
                _tmp2_ = FALSE;
722
 
        }
723
 
        _tmp6_ = _tmp2_;
724
 
        if (_tmp6_) {
725
 
                ContactsViewContactData* _tmp7_;
726
 
                GtkListStore* _tmp8_;
727
 
                ContactsViewContactData* _tmp9_;
728
 
                GtkTreeIter _tmp10_ = {0};
729
 
                GtkListStore* _tmp11_;
730
 
                ContactsViewContactData* _tmp12_;
731
 
                GtkTreeIter _tmp13_;
732
 
                ContactsViewContactData* _tmp14_;
733
 
                _tmp7_ = self->priv->other_header_data;
734
 
                _tmp7_->visible = TRUE;
735
 
                _tmp8_ = self->priv->list_store;
736
 
                _tmp9_ = self->priv->other_header_data;
737
 
                gtk_list_store_append (_tmp8_, &_tmp10_);
738
 
                _tmp9_->iter = _tmp10_;
739
 
                _tmp11_ = self->priv->list_store;
740
 
                _tmp12_ = self->priv->other_header_data;
741
 
                _tmp13_ = _tmp12_->iter;
742
 
                _tmp14_ = self->priv->other_header_data;
743
 
                gtk_list_store_set (_tmp11_, &_tmp13_, 1, _tmp14_, -1);
744
 
        }
745
 
        _tmp16_ = new_visible;
746
 
        if (!_tmp16_) {
747
 
                ContactsViewContactData* _tmp17_;
748
 
                gboolean _tmp18_;
749
 
                _tmp17_ = self->priv->other_header_data;
750
 
                _tmp18_ = _tmp17_->visible;
751
 
                _tmp15_ = _tmp18_;
752
 
        } else {
753
 
                _tmp15_ = FALSE;
754
 
        }
755
 
        _tmp19_ = _tmp15_;
756
 
        if (_tmp19_) {
757
 
                ContactsViewContactData* _tmp20_;
758
 
                GtkListStore* _tmp21_;
759
 
                ContactsViewContactData* _tmp22_;
760
 
                GtkTreeIter _tmp23_;
761
 
                _tmp20_ = self->priv->other_header_data;
762
 
                _tmp20_->visible = FALSE;
763
 
                _tmp21_ = self->priv->list_store;
764
 
                _tmp22_ = self->priv->other_header_data;
765
 
                _tmp23_ = _tmp22_->iter;
766
 
                gtk_list_store_remove (_tmp21_, &_tmp23_);
767
 
        }
768
 
        contacts_view_refilter (self);
 
604
        contacts_view_update_all_filtered (self);
 
605
        egg_list_box_refilter ((EggListBox*) self);
 
606
        egg_list_box_resort ((EggListBox*) self);
769
607
}
770
608
 
771
609
 
772
610
void contacts_view_set_custom_sort_prio (ContactsView* self, ContactsContact* c, gint prio) {
773
611
        gint _tmp0_;
774
 
        ContactsContact* _tmp1_;
775
 
        ContactsViewContactData* _tmp2_ = NULL;
 
612
        GeeHashMap* _tmp1_;
 
613
        ContactsContact* _tmp2_;
 
614
        gpointer _tmp3_ = NULL;
776
615
        ContactsViewContactData* data;
777
 
        ContactsViewContactData* _tmp3_;
778
 
        gint _tmp4_;
779
 
        ContactsViewContactData* _tmp6_;
780
 
        gint _tmp7_;
781
 
        ContactsStore* _tmp8_;
782
 
        ContactsContact* _tmp9_;
783
 
        ContactsViewContactData* _tmp10_;
784
 
        gboolean _tmp11_;
 
616
        ContactsViewContactData* _tmp4_;
 
617
        ContactsViewContactData* _tmp5_;
 
618
        gint _tmp6_;
 
619
        ContactsViewContactData* _tmp7_;
 
620
        GtkGrid* _tmp8_;
785
621
        g_return_if_fail (self != NULL);
786
622
        g_return_if_fail (c != NULL);
787
623
        _tmp0_ = prio;
788
 
        g_assert (_tmp0_ >= 0);
789
 
        _tmp1_ = c;
790
 
        _tmp2_ = contacts_view_lookup_data (self, _tmp1_);
791
 
        data = _tmp2_;
792
 
        _tmp3_ = data;
793
 
        if (_tmp3_ == NULL) {
 
624
        _vala_assert (_tmp0_ >= 0, "prio >= 0");
 
625
        _tmp1_ = self->priv->contacts;
 
626
        _tmp2_ = c;
 
627
        _tmp3_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp1_, _tmp2_);
 
628
        data = (ContactsViewContactData*) _tmp3_;
 
629
        _tmp4_ = data;
 
630
        if (_tmp4_ == NULL) {
794
631
                _contacts_view_contact_data_unref0 (data);
795
632
                return;
796
633
        }
797
 
        _tmp4_ = prio;
798
 
        if (_tmp4_ > 0) {
799
 
                gint _tmp5_;
800
 
                _tmp5_ = prio;
801
 
                prio = _tmp5_ + 1;
802
 
        }
803
 
        _tmp6_ = data;
804
 
        _tmp7_ = prio;
805
 
        _tmp6_->sort_prio = _tmp7_;
806
 
        _tmp8_ = self->priv->contacts_store;
807
 
        _tmp9_ = c;
808
 
        contacts_view_contact_changed_cb (self, _tmp8_, _tmp9_);
809
 
        _tmp10_ = data;
810
 
        _tmp11_ = _tmp10_->visible;
811
 
        if (_tmp11_) {
812
 
                gint _tmp12_;
813
 
                _tmp12_ = prio;
814
 
                if (_tmp12_ > 0) {
815
 
                        gint _tmp13_;
816
 
                        _tmp13_ = self->priv->custom_visible_count;
817
 
                        self->priv->custom_visible_count = _tmp13_ + 1;
818
 
                        if (_tmp13_ == 0) {
819
 
                                contacts_view_add_custom_headers (self);
820
 
                        }
821
 
                } else {
822
 
                        gint _tmp14_;
823
 
                        _tmp14_ = self->priv->custom_visible_count;
824
 
                        self->priv->custom_visible_count = _tmp14_ - 1;
825
 
                        if (_tmp14_ == 1) {
826
 
                                contacts_view_remove_custom_headers (self);
827
 
                        }
828
 
                }
829
 
        }
 
634
        _tmp5_ = data;
 
635
        _tmp6_ = prio;
 
636
        _tmp5_->sort_prio = _tmp6_;
 
637
        _tmp7_ = data;
 
638
        _tmp8_ = _tmp7_->grid;
 
639
        egg_list_box_child_changed ((EggListBox*) self, (GtkWidget*) _tmp8_);
830
640
        _contacts_view_contact_data_unref0 (data);
831
641
}
832
642
 
833
643
 
834
 
static gboolean contacts_view_apply_filter (ContactsView* self, ContactsContact* contact) {
 
644
void contacts_view_hide_contact (ContactsView* self, ContactsContact* contact) {
 
645
        GeeHashSet* _tmp0_;
 
646
        ContactsContact* _tmp1_;
 
647
        g_return_if_fail (self != NULL);
 
648
        g_return_if_fail (contact != NULL);
 
649
        _tmp0_ = self->priv->hidden_contacts;
 
650
        _tmp1_ = contact;
 
651
        gee_abstract_collection_add ((GeeAbstractCollection*) _tmp0_, _tmp1_);
 
652
        contacts_view_update_all_filtered (self);
 
653
        egg_list_box_refilter ((EggListBox*) self);
 
654
}
 
655
 
 
656
 
 
657
static gchar** _vala_array_dup4 (gchar** self, int length) {
 
658
        gchar** result;
 
659
        int i;
 
660
        result = g_new0 (gchar*, length + 1);
 
661
        for (i = 0; i < length; i++) {
 
662
                gchar* _tmp0_;
 
663
                _tmp0_ = g_strdup (self[i]);
 
664
                result[i] = _tmp0_;
 
665
        }
 
666
        return result;
 
667
}
 
668
 
 
669
 
 
670
void contacts_view_set_filter_values (ContactsView* self, gchar** values, int values_length1) {
 
671
        gchar** _tmp0_;
 
672
        gint _tmp0__length1;
 
673
        gchar** _tmp1_;
 
674
        gint _tmp1__length1;
 
675
        g_return_if_fail (self != NULL);
 
676
        _tmp0_ = values;
 
677
        _tmp0__length1 = values_length1;
 
678
        _tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup4 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_);
 
679
        _tmp1__length1 = _tmp0__length1;
 
680
        self->priv->filter_values = (_vala_array_free (self->priv->filter_values, self->priv->filter_values_length1, (GDestroyNotify) g_free), NULL);
 
681
        self->priv->filter_values = _tmp1_;
 
682
        self->priv->filter_values_length1 = _tmp1__length1;
 
683
        self->priv->_filter_values_size_ = self->priv->filter_values_length1;
 
684
        contacts_view_update_all_filtered (self);
 
685
        egg_list_box_refilter ((EggListBox*) self);
 
686
}
 
687
 
 
688
 
 
689
static gboolean contacts_view_calculate_filtered (ContactsView* self, ContactsContact* c) {
835
690
        gboolean result = FALSE;
836
691
        ContactsContact* _tmp0_;
837
692
        gboolean _tmp1_;
853
708
        gint _tmp23__length1;
854
709
        gboolean _tmp24_ = FALSE;
855
710
        g_return_val_if_fail (self != NULL, FALSE);
856
 
        g_return_val_if_fail (contact != NULL, FALSE);
857
 
        _tmp0_ = contact;
 
711
        g_return_val_if_fail (c != NULL, FALSE);
 
712
        _tmp0_ = c;
858
713
        _tmp1_ = contacts_contact_get_is_hidden (_tmp0_);
859
714
        _tmp2_ = _tmp1_;
860
715
        if (_tmp2_) {
862
717
                return result;
863
718
        }
864
719
        _tmp3_ = self->priv->hidden_contacts;
865
 
        _tmp4_ = contact;
 
720
        _tmp4_ = c;
866
721
        _tmp5_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp3_, _tmp4_);
867
722
        if (_tmp5_) {
868
723
                result = FALSE;
872
727
        if (_tmp8_ == CONTACTS_VIEW_SUBSET_MAIN) {
873
728
                ContactsContact* _tmp9_;
874
729
                gboolean _tmp10_;
875
 
                _tmp9_ = contact;
 
730
                _tmp9_ = c;
876
731
                _tmp10_ = _tmp9_->is_main;
877
732
                _tmp7_ = !_tmp10_;
878
733
        } else {
889
744
                if (_tmp13_ == CONTACTS_VIEW_SUBSET_OTHER) {
890
745
                        ContactsContact* _tmp14_;
891
746
                        gboolean _tmp15_;
892
 
                        _tmp14_ = contact;
 
747
                        _tmp14_ = c;
893
748
                        _tmp15_ = _tmp14_->is_main;
894
749
                        _tmp12_ = _tmp15_;
895
750
                } else {
919
774
                result = TRUE;
920
775
                return result;
921
776
        }
922
 
        _tmp22_ = contact;
 
777
        _tmp22_ = c;
923
778
        _tmp23_ = self->priv->filter_values;
924
779
        _tmp23__length1 = self->priv->filter_values_length1;
925
780
        _tmp24_ = contacts_contact_contains_strings (_tmp22_, _tmp23_, _tmp23__length1);
928
783
}
929
784
 
930
785
 
931
 
gboolean contacts_view_is_first (ContactsView* self, GtkTreeIter* iter) {
932
 
        gboolean result = FALSE;
933
 
        ContactsViewContactData* data = NULL;
934
 
        GtkListStore* _tmp0_;
935
 
        GtkTreeIter _tmp1_;
936
 
        ContactsViewContactData* _tmp2_;
937
 
        g_return_val_if_fail (self != NULL, FALSE);
938
 
        g_return_val_if_fail (iter != NULL, FALSE);
939
 
        _tmp0_ = self->priv->list_store;
940
 
        _tmp1_ = *iter;
941
 
        gtk_tree_model_get ((GtkTreeModel*) _tmp0_, &_tmp1_, 1, &data, -1);
942
 
        _tmp2_ = data;
943
 
        if (_tmp2_ != NULL) {
944
 
                ContactsViewContactData* _tmp3_;
945
 
                gboolean _tmp4_;
946
 
                _tmp3_ = data;
947
 
                _tmp4_ = _tmp3_->is_first;
948
 
                result = _tmp4_;
949
 
                return result;
950
 
        }
951
 
        result = FALSE;
952
 
        return result;
953
 
}
954
 
 
955
 
 
956
 
static gpointer _contacts_view_contact_data_ref0 (gpointer self) {
957
 
        return self ? contacts_view_contact_data_ref (self) : NULL;
958
 
}
959
 
 
960
 
 
961
 
static ContactsViewContactData* contacts_view_get_previous (ContactsView* self, ContactsViewContactData* data) {
962
 
        ContactsViewContactData* result = NULL;
963
 
        ContactsViewContactData* previous;
964
 
        ContactsViewContactData* _tmp0_;
965
 
        GtkTreeIter _tmp1_;
966
 
        GtkTreeIter iter;
967
 
        GtkListStore* _tmp2_;
968
 
        gboolean _tmp3_ = FALSE;
969
 
        ContactsViewContactData* _tmp6_;
970
 
        ContactsViewContactData* _tmp7_;
971
 
        g_return_val_if_fail (self != NULL, NULL);
972
 
        g_return_val_if_fail (data != NULL, NULL);
973
 
        previous = NULL;
974
 
        _tmp0_ = data;
975
 
        _tmp1_ = _tmp0_->iter;
976
 
        iter = _tmp1_;
977
 
        _tmp2_ = self->priv->list_store;
978
 
        _tmp3_ = gtk_tree_model_iter_previous ((GtkTreeModel*) _tmp2_, &iter);
979
 
        if (_tmp3_) {
980
 
                GtkListStore* _tmp4_;
981
 
                GtkTreeIter _tmp5_;
982
 
                _tmp4_ = self->priv->list_store;
983
 
                _tmp5_ = iter;
984
 
                gtk_tree_model_get ((GtkTreeModel*) _tmp4_, &_tmp5_, 1, &previous, -1);
985
 
        }
986
 
        _tmp6_ = previous;
987
 
        _tmp7_ = _contacts_view_contact_data_ref0 (_tmp6_);
988
 
        result = _tmp7_;
989
 
        return result;
990
 
}
991
 
 
992
 
 
993
 
static ContactsViewContactData* contacts_view_get_next (ContactsView* self, ContactsViewContactData* data) {
994
 
        ContactsViewContactData* result = NULL;
995
 
        ContactsViewContactData* next;
996
 
        ContactsViewContactData* _tmp0_;
997
 
        GtkTreeIter _tmp1_;
998
 
        GtkTreeIter iter;
999
 
        GtkListStore* _tmp2_;
1000
 
        gboolean _tmp3_ = FALSE;
1001
 
        ContactsViewContactData* _tmp6_;
1002
 
        ContactsViewContactData* _tmp7_;
1003
 
        g_return_val_if_fail (self != NULL, NULL);
1004
 
        g_return_val_if_fail (data != NULL, NULL);
1005
 
        next = NULL;
1006
 
        _tmp0_ = data;
1007
 
        _tmp1_ = _tmp0_->iter;
1008
 
        iter = _tmp1_;
1009
 
        _tmp2_ = self->priv->list_store;
1010
 
        _tmp3_ = gtk_tree_model_iter_next ((GtkTreeModel*) _tmp2_, &iter);
1011
 
        if (_tmp3_) {
1012
 
                GtkListStore* _tmp4_;
1013
 
                GtkTreeIter _tmp5_;
1014
 
                _tmp4_ = self->priv->list_store;
1015
 
                _tmp5_ = iter;
1016
 
                gtk_tree_model_get ((GtkTreeModel*) _tmp4_, &_tmp5_, 1, &next, -1);
1017
 
        }
1018
 
        _tmp6_ = next;
1019
 
        _tmp7_ = _contacts_view_contact_data_ref0 (_tmp6_);
1020
 
        result = _tmp7_;
1021
 
        return result;
1022
 
}
1023
 
 
1024
 
 
1025
 
static void contacts_view_row_changed_no_resort (ContactsView* self, ContactsViewContactData* data) {
1026
 
        GtkListStore* _tmp0_;
1027
 
        ContactsViewContactData* _tmp1_;
1028
 
        GtkTreeIter _tmp2_;
1029
 
        GtkTreePath* _tmp3_ = NULL;
1030
 
        GtkTreePath* path;
1031
 
        GtkListStore* _tmp4_;
1032
 
        ContactsViewContactData* _tmp5_;
1033
 
        GtkTreeIter _tmp6_;
1034
 
        g_return_if_fail (self != NULL);
1035
 
        g_return_if_fail (data != NULL);
1036
 
        _tmp0_ = self->priv->list_store;
1037
 
        _tmp1_ = data;
1038
 
        _tmp2_ = _tmp1_->iter;
1039
 
        _tmp3_ = gtk_tree_model_get_path ((GtkTreeModel*) _tmp0_, &_tmp2_);
1040
 
        path = _tmp3_;
1041
 
        _tmp4_ = self->priv->list_store;
1042
 
        _tmp5_ = data;
1043
 
        _tmp6_ = _tmp5_->iter;
1044
 
        gtk_tree_model_row_changed ((GtkTreeModel*) _tmp4_, path, &_tmp6_);
1045
 
        _gtk_tree_path_free0 (path);
1046
 
}
1047
 
 
1048
 
 
1049
 
static void contacts_view_row_changed_resort (ContactsView* self, ContactsViewContactData* data) {
1050
 
        GtkListStore* _tmp0_;
1051
 
        ContactsViewContactData* _tmp1_;
1052
 
        GtkTreeIter _tmp2_;
 
786
static void contacts_view_update_data (ContactsView* self, ContactsViewContactData* data) {
 
787
        ContactsViewContactData* _tmp0_;
 
788
        ContactsContact* _tmp1_;
 
789
        ContactsContact* _tmp2_;
 
790
        ContactsContact* c;
1053
791
        ContactsViewContactData* _tmp3_;
1054
 
        ContactsContact* _tmp4_;
1055
 
        g_return_if_fail (self != NULL);
1056
 
        g_return_if_fail (data != NULL);
1057
 
        _tmp0_ = self->priv->list_store;
1058
 
        _tmp1_ = data;
1059
 
        _tmp2_ = _tmp1_->iter;
1060
 
        _tmp3_ = data;
1061
 
        _tmp4_ = _tmp3_->contact;
1062
 
        gtk_list_store_set (_tmp0_, &_tmp2_, 0, _tmp4_, -1);
1063
 
}
1064
 
 
1065
 
 
1066
 
static gboolean contacts_view_update_is_first (ContactsView* self, ContactsViewContactData* data, ContactsViewContactData* previous) {
1067
 
        gboolean result = FALSE;
1068
 
        ContactsViewContactData* _tmp0_;
1069
 
        gboolean _tmp1_;
1070
 
        gboolean old_is_first;
1071
 
        ContactsViewContactData* _tmp2_;
1072
 
        gint _tmp3_;
1073
 
        gboolean is_custom;
1074
 
        gboolean _tmp4_ = FALSE;
1075
 
        ContactsViewContactData* _tmp5_;
1076
 
        gboolean _tmp8_;
1077
 
        gboolean previous_is_custom;
1078
 
        gboolean _tmp9_;
1079
 
        gboolean _tmp27_;
1080
 
        ContactsViewContactData* _tmp28_;
1081
 
        gboolean _tmp29_;
1082
 
        g_return_val_if_fail (self != NULL, FALSE);
1083
 
        g_return_val_if_fail (data != NULL, FALSE);
1084
 
        _tmp0_ = data;
1085
 
        _tmp1_ = _tmp0_->is_first;
1086
 
        old_is_first = _tmp1_;
1087
 
        _tmp2_ = data;
1088
 
        _tmp3_ = _tmp2_->sort_prio;
1089
 
        is_custom = _tmp3_ != 0;
1090
 
        _tmp5_ = previous;
1091
 
        if (_tmp5_ != NULL) {
1092
 
                ContactsViewContactData* _tmp6_;
1093
 
                gint _tmp7_;
1094
 
                _tmp6_ = previous;
1095
 
                _tmp7_ = _tmp6_->sort_prio;
1096
 
                _tmp4_ = _tmp7_ != 0;
1097
 
        } else {
1098
 
                _tmp4_ = FALSE;
1099
 
        }
1100
 
        _tmp8_ = _tmp4_;
1101
 
        previous_is_custom = _tmp8_;
1102
 
        _tmp9_ = is_custom;
1103
 
        if (_tmp9_) {
1104
 
                ContactsViewContactData* _tmp10_;
1105
 
                _tmp10_ = data;
1106
 
                _tmp10_->is_first = FALSE;
1107
 
        } else {
1108
 
                gboolean _tmp11_ = FALSE;
1109
 
                ContactsViewContactData* _tmp12_;
1110
 
                gboolean _tmp14_;
1111
 
                _tmp12_ = previous;
1112
 
                if (_tmp12_ != NULL) {
1113
 
                        gboolean _tmp13_;
1114
 
                        _tmp13_ = previous_is_custom;
1115
 
                        _tmp11_ = !_tmp13_;
1116
 
                } else {
1117
 
                        _tmp11_ = FALSE;
1118
 
                }
1119
 
                _tmp14_ = _tmp11_;
1120
 
                if (_tmp14_) {
1121
 
                        ContactsViewContactData* _tmp15_;
1122
 
                        ContactsContact* _tmp16_;
1123
 
                        gunichar _tmp17_;
1124
 
                        gunichar _tmp18_;
1125
 
                        gunichar previous_initial;
1126
 
                        ContactsViewContactData* _tmp19_;
1127
 
                        ContactsContact* _tmp20_;
1128
 
                        gunichar _tmp21_;
1129
 
                        gunichar _tmp22_;
1130
 
                        gunichar initial;
1131
 
                        ContactsViewContactData* _tmp23_;
1132
 
                        gunichar _tmp24_;
1133
 
                        gunichar _tmp25_;
1134
 
                        _tmp15_ = previous;
1135
 
                        _tmp16_ = _tmp15_->contact;
1136
 
                        _tmp17_ = contacts_contact_get_initial_letter (_tmp16_);
1137
 
                        _tmp18_ = _tmp17_;
1138
 
                        previous_initial = _tmp18_;
1139
 
                        _tmp19_ = data;
1140
 
                        _tmp20_ = _tmp19_->contact;
1141
 
                        _tmp21_ = contacts_contact_get_initial_letter (_tmp20_);
1142
 
                        _tmp22_ = _tmp21_;
1143
 
                        initial = _tmp22_;
1144
 
                        _tmp23_ = data;
1145
 
                        _tmp24_ = previous_initial;
1146
 
                        _tmp25_ = initial;
1147
 
                        _tmp23_->is_first = _tmp24_ != _tmp25_;
1148
 
                } else {
1149
 
                        ContactsViewContactData* _tmp26_;
1150
 
                        _tmp26_ = data;
1151
 
                        _tmp26_->is_first = TRUE;
1152
 
                }
1153
 
        }
1154
 
        _tmp27_ = old_is_first;
1155
 
        _tmp28_ = data;
1156
 
        _tmp29_ = _tmp28_->is_first;
1157
 
        if (_tmp27_ != _tmp29_) {
1158
 
                ContactsViewContactData* _tmp30_;
1159
 
                _tmp30_ = data;
1160
 
                contacts_view_row_changed_no_resort (self, _tmp30_);
1161
 
                result = TRUE;
1162
 
                return result;
1163
 
        }
1164
 
        result = FALSE;
1165
 
        return result;
1166
 
}
1167
 
 
1168
 
 
1169
 
static void contacts_view_add_custom_headers (ContactsView* self) {
1170
 
        ContactsViewContactData* _tmp0_;
1171
 
        GtkListStore* _tmp1_;
1172
 
        ContactsViewContactData* _tmp2_;
1173
 
        GtkTreeIter _tmp3_ = {0};
1174
 
        GtkListStore* _tmp4_;
1175
 
        ContactsViewContactData* _tmp5_;
1176
 
        GtkTreeIter _tmp6_;
 
792
        const gchar* _tmp4_;
 
793
        const gchar* _tmp5_;
 
794
        gchar* _tmp6_;
1177
795
        ContactsViewContactData* _tmp7_;
1178
 
        ContactsViewContactData* _tmp8_;
1179
 
        GtkListStore* _tmp9_;
 
796
        gunichar _tmp8_;
 
797
        gunichar _tmp9_;
1180
798
        ContactsViewContactData* _tmp10_;
1181
 
        GtkTreeIter _tmp11_ = {0};
1182
 
        GtkListStore* _tmp12_;
1183
 
        ContactsViewContactData* _tmp13_;
1184
 
        GtkTreeIter _tmp14_;
1185
 
        ContactsViewContactData* _tmp15_;
1186
 
        g_return_if_fail (self != NULL);
1187
 
        _tmp0_ = self->priv->suggestions_header_data;
1188
 
        _tmp0_->visible = TRUE;
1189
 
        _tmp1_ = self->priv->list_store;
1190
 
        _tmp2_ = self->priv->suggestions_header_data;
1191
 
        gtk_list_store_append (_tmp1_, &_tmp3_);
1192
 
        _tmp2_->iter = _tmp3_;
1193
 
        _tmp4_ = self->priv->list_store;
1194
 
        _tmp5_ = self->priv->suggestions_header_data;
1195
 
        _tmp6_ = _tmp5_->iter;
1196
 
        _tmp7_ = self->priv->suggestions_header_data;
1197
 
        gtk_list_store_set (_tmp4_, &_tmp6_, 1, _tmp7_, -1);
1198
 
        _tmp8_ = self->priv->padding_data;
1199
 
        _tmp8_->visible = TRUE;
1200
 
        _tmp9_ = self->priv->list_store;
1201
 
        _tmp10_ = self->priv->padding_data;
1202
 
        gtk_list_store_append (_tmp9_, &_tmp11_);
1203
 
        _tmp10_->iter = _tmp11_;
1204
 
        _tmp12_ = self->priv->list_store;
1205
 
        _tmp13_ = self->priv->padding_data;
1206
 
        _tmp14_ = _tmp13_->iter;
1207
 
        _tmp15_ = self->priv->padding_data;
1208
 
        gtk_list_store_set (_tmp12_, &_tmp14_, 1, _tmp15_, -1);
1209
 
}
1210
 
 
1211
 
 
1212
 
static void contacts_view_remove_custom_headers (ContactsView* self) {
1213
 
        ContactsViewContactData* _tmp0_;
1214
 
        GtkListStore* _tmp1_;
1215
 
        ContactsViewContactData* _tmp2_;
1216
 
        GtkTreeIter _tmp3_;
1217
 
        ContactsViewContactData* _tmp4_;
1218
 
        GtkListStore* _tmp5_;
1219
 
        ContactsViewContactData* _tmp6_;
1220
 
        GtkTreeIter _tmp7_;
1221
 
        g_return_if_fail (self != NULL);
1222
 
        _tmp0_ = self->priv->suggestions_header_data;
1223
 
        _tmp0_->visible = FALSE;
1224
 
        _tmp1_ = self->priv->list_store;
1225
 
        _tmp2_ = self->priv->suggestions_header_data;
1226
 
        _tmp3_ = _tmp2_->iter;
1227
 
        gtk_list_store_remove (_tmp1_, &_tmp3_);
1228
 
        _tmp4_ = self->priv->padding_data;
1229
 
        _tmp4_->visible = FALSE;
1230
 
        _tmp5_ = self->priv->list_store;
1231
 
        _tmp6_ = self->priv->padding_data;
1232
 
        _tmp7_ = _tmp6_->iter;
1233
 
        gtk_list_store_remove (_tmp5_, &_tmp7_);
1234
 
}
1235
 
 
1236
 
 
1237
 
static void contacts_view_add_to_model (ContactsView* self, ContactsViewContactData* data) {
1238
 
        GtkListStore* _tmp0_;
1239
 
        ContactsViewContactData* _tmp1_;
1240
 
        GtkTreeIter _tmp2_ = {0};
1241
 
        GtkListStore* _tmp3_;
1242
 
        ContactsViewContactData* _tmp4_;
1243
 
        GtkTreeIter _tmp5_;
1244
 
        ContactsViewContactData* _tmp6_;
1245
 
        ContactsContact* _tmp7_;
1246
 
        ContactsViewContactData* _tmp8_;
1247
 
        ContactsViewContactData* _tmp9_;
1248
 
        gint _tmp10_;
1249
 
        gboolean _tmp12_ = FALSE;
1250
 
        ContactsViewContactData* _tmp13_;
 
799
        gboolean _tmp11_ = FALSE;
 
800
        ContactsViewContactData* _tmp12_;
 
801
        GtkLabel* _tmp13_;
1251
802
        ContactsViewContactData* _tmp14_;
1252
 
        ContactsViewContactData* _tmp15_ = NULL;
1253
 
        ContactsViewContactData* _tmp16_;
1254
 
        gboolean _tmp17_ = FALSE;
1255
 
        gboolean _tmp18_;
1256
 
        gboolean _tmp21_;
 
803
        const gchar* _tmp15_;
 
804
        gchar* _tmp16_ = NULL;
 
805
        gchar* _tmp17_;
 
806
        ContactsViewContactData* _tmp18_;
 
807
        ContactsContactFrame* _tmp19_;
 
808
        FolksIndividual* _tmp20_;
1257
809
        g_return_if_fail (self != NULL);
1258
810
        g_return_if_fail (data != NULL);
1259
 
        _tmp0_ = self->priv->list_store;
1260
 
        _tmp1_ = data;
1261
 
        gtk_list_store_append (_tmp0_, &_tmp2_);
1262
 
        _tmp1_->iter = _tmp2_;
1263
 
        _tmp3_ = self->priv->list_store;
1264
 
        _tmp4_ = data;
1265
 
        _tmp5_ = _tmp4_->iter;
1266
 
        _tmp6_ = data;
1267
 
        _tmp7_ = _tmp6_->contact;
1268
 
        _tmp8_ = data;
1269
 
        gtk_list_store_set (_tmp3_, &_tmp5_, 0, _tmp7_, 1, _tmp8_, -1);
1270
 
        _tmp9_ = data;
1271
 
        _tmp10_ = _tmp9_->sort_prio;
1272
 
        if (_tmp10_ > 0) {
1273
 
                gint _tmp11_;
1274
 
                _tmp11_ = self->priv->custom_visible_count;
1275
 
                self->priv->custom_visible_count = _tmp11_ + 1;
1276
 
                if (_tmp11_ == 0) {
1277
 
                        contacts_view_add_custom_headers (self);
1278
 
                }
1279
 
        }
1280
 
        _tmp13_ = data;
 
811
        _tmp0_ = data;
 
812
        _tmp1_ = _tmp0_->contact;
 
813
        _tmp2_ = _g_object_ref0 (_tmp1_);
 
814
        c = _tmp2_;
 
815
        _tmp3_ = data;
 
816
        _tmp4_ = contacts_contact_get_display_name (c);
 
817
        _tmp5_ = _tmp4_;
 
818
        _tmp6_ = g_strdup (_tmp5_);
 
819
        _g_free0 (_tmp3_->display_name);
 
820
        _tmp3_->display_name = _tmp6_;
 
821
        _tmp7_ = data;
 
822
        _tmp8_ = contacts_contact_get_initial_letter (c);
 
823
        _tmp9_ = _tmp8_;
 
824
        _tmp7_->initial_letter = _tmp9_;
 
825
        _tmp10_ = data;
 
826
        _tmp11_ = contacts_view_calculate_filtered (self, c);
 
827
        _tmp10_->filtered = _tmp11_;
 
828
        _tmp12_ = data;
 
829
        _tmp13_ = _tmp12_->label;
1281
830
        _tmp14_ = data;
1282
 
        _tmp15_ = contacts_view_get_previous (self, _tmp14_);
1283
 
        _tmp16_ = _tmp15_;
1284
 
        _tmp17_ = contacts_view_update_is_first (self, _tmp13_, _tmp16_);
1285
 
        _tmp18_ = _tmp17_;
1286
 
        _contacts_view_contact_data_unref0 (_tmp16_);
1287
 
        if (_tmp18_) {
1288
 
                ContactsViewContactData* _tmp19_;
1289
 
                gboolean _tmp20_;
1290
 
                _tmp19_ = data;
1291
 
                _tmp20_ = _tmp19_->is_first;
1292
 
                _tmp12_ = _tmp20_;
1293
 
        } else {
1294
 
                _tmp12_ = FALSE;
1295
 
        }
1296
 
        _tmp21_ = _tmp12_;
1297
 
        if (_tmp21_) {
1298
 
                ContactsViewContactData* _tmp22_;
1299
 
                ContactsViewContactData* _tmp23_ = NULL;
1300
 
                ContactsViewContactData* next;
1301
 
                ContactsViewContactData* _tmp24_;
1302
 
                _tmp22_ = data;
1303
 
                _tmp23_ = contacts_view_get_next (self, _tmp22_);
1304
 
                next = _tmp23_;
1305
 
                _tmp24_ = next;
1306
 
                if (_tmp24_ != NULL) {
1307
 
                        ContactsViewContactData* _tmp25_;
1308
 
                        ContactsViewContactData* _tmp26_;
1309
 
                        _tmp25_ = next;
1310
 
                        _tmp26_ = data;
1311
 
                        contacts_view_update_is_first (self, _tmp25_, _tmp26_);
1312
 
                }
1313
 
                _contacts_view_contact_data_unref0 (next);
1314
 
        }
1315
 
}
1316
 
 
1317
 
 
1318
 
static void contacts_view_remove_from_model (ContactsView* self, ContactsViewContactData* data) {
1319
 
        ContactsViewContactData* _tmp0_;
1320
 
        gint _tmp1_;
1321
 
        ContactsViewContactData* next;
1322
 
        ContactsViewContactData* _tmp3_;
1323
 
        gboolean _tmp4_;
1324
 
        GtkListStore* _tmp7_;
1325
 
        ContactsViewContactData* _tmp8_;
1326
 
        GtkTreeIter _tmp9_;
1327
 
        ContactsViewContactData* _tmp10_;
1328
 
        ContactsViewContactData* _tmp11_;
1329
 
        g_return_if_fail (self != NULL);
1330
 
        g_return_if_fail (data != NULL);
1331
 
        _tmp0_ = data;
1332
 
        _tmp1_ = _tmp0_->sort_prio;
1333
 
        if (_tmp1_ > 0) {
1334
 
                gint _tmp2_;
1335
 
                _tmp2_ = self->priv->custom_visible_count;
1336
 
                self->priv->custom_visible_count = _tmp2_ - 1;
1337
 
                if (_tmp2_ == 1) {
1338
 
                        contacts_view_remove_custom_headers (self);
1339
 
                }
1340
 
        }
1341
 
        next = NULL;
1342
 
        _tmp3_ = data;
1343
 
        _tmp4_ = _tmp3_->is_first;
1344
 
        if (_tmp4_) {
1345
 
                ContactsViewContactData* _tmp5_;
1346
 
                ContactsViewContactData* _tmp6_ = NULL;
1347
 
                _tmp5_ = data;
1348
 
                _tmp6_ = contacts_view_get_next (self, _tmp5_);
1349
 
                _contacts_view_contact_data_unref0 (next);
1350
 
                next = _tmp6_;
1351
 
        }
1352
 
        _tmp7_ = self->priv->list_store;
1353
 
        _tmp8_ = data;
1354
 
        _tmp9_ = _tmp8_->iter;
1355
 
        gtk_list_store_remove (_tmp7_, &_tmp9_);
1356
 
        _tmp10_ = data;
1357
 
        _tmp10_->is_first = FALSE;
1358
 
        _tmp11_ = next;
1359
 
        if (_tmp11_ != NULL) {
1360
 
                ContactsViewContactData* _tmp12_;
1361
 
                ContactsViewContactData* _tmp13_;
1362
 
                ContactsViewContactData* _tmp14_ = NULL;
1363
 
                ContactsViewContactData* _tmp15_;
1364
 
                _tmp12_ = next;
1365
 
                _tmp13_ = next;
1366
 
                _tmp14_ = contacts_view_get_previous (self, _tmp13_);
1367
 
                _tmp15_ = _tmp14_;
1368
 
                contacts_view_update_is_first (self, _tmp12_, _tmp15_);
1369
 
                _contacts_view_contact_data_unref0 (_tmp15_);
1370
 
        }
1371
 
        _contacts_view_contact_data_unref0 (next);
1372
 
}
1373
 
 
1374
 
 
1375
 
static void contacts_view_update_visible (ContactsView* self, ContactsViewContactData* data) {
1376
 
        ContactsViewContactData* _tmp0_;
1377
 
        gboolean _tmp1_;
1378
 
        gboolean was_visible;
1379
 
        ContactsViewContactData* _tmp2_;
1380
 
        ContactsViewContactData* _tmp3_;
1381
 
        ContactsContact* _tmp4_;
1382
 
        gboolean _tmp5_ = FALSE;
1383
 
        gboolean _tmp6_ = FALSE;
1384
 
        gboolean _tmp7_;
1385
 
        gboolean _tmp10_;
1386
 
        gboolean _tmp12_ = FALSE;
1387
 
        gboolean _tmp13_;
1388
 
        gboolean _tmp16_;
1389
 
        g_return_if_fail (self != NULL);
1390
 
        g_return_if_fail (data != NULL);
1391
 
        _tmp0_ = data;
1392
 
        _tmp1_ = _tmp0_->visible;
1393
 
        was_visible = _tmp1_;
1394
 
        _tmp2_ = data;
1395
 
        _tmp3_ = data;
1396
 
        _tmp4_ = _tmp3_->contact;
1397
 
        _tmp5_ = contacts_view_apply_filter (self, _tmp4_);
1398
 
        _tmp2_->visible = _tmp5_;
1399
 
        _tmp7_ = was_visible;
1400
 
        if (_tmp7_) {
1401
 
                ContactsViewContactData* _tmp8_;
1402
 
                gboolean _tmp9_;
1403
 
                _tmp8_ = data;
1404
 
                _tmp9_ = _tmp8_->visible;
1405
 
                _tmp6_ = !_tmp9_;
1406
 
        } else {
1407
 
                _tmp6_ = FALSE;
1408
 
        }
1409
 
        _tmp10_ = _tmp6_;
1410
 
        if (_tmp10_) {
1411
 
                ContactsViewContactData* _tmp11_;
1412
 
                _tmp11_ = data;
1413
 
                contacts_view_remove_from_model (self, _tmp11_);
1414
 
        }
1415
 
        _tmp13_ = was_visible;
1416
 
        if (!_tmp13_) {
1417
 
                ContactsViewContactData* _tmp14_;
1418
 
                gboolean _tmp15_;
1419
 
                _tmp14_ = data;
1420
 
                _tmp15_ = _tmp14_->visible;
1421
 
                _tmp12_ = _tmp15_;
1422
 
        } else {
1423
 
                _tmp12_ = FALSE;
1424
 
        }
1425
 
        _tmp16_ = _tmp12_;
1426
 
        if (_tmp16_) {
1427
 
                ContactsViewContactData* _tmp17_;
1428
 
                _tmp17_ = data;
1429
 
                contacts_view_add_to_model (self, _tmp17_);
1430
 
        }
1431
 
}
1432
 
 
1433
 
 
1434
 
static void contacts_view_refilter (ContactsView* self) {
 
831
        _tmp15_ = _tmp14_->display_name;
 
832
        _tmp16_ = g_markup_printf_escaped ("<span font='16px'>%s</span>", _tmp15_);
 
833
        _tmp17_ = _tmp16_;
 
834
        gtk_label_set_markup (_tmp13_, _tmp17_);
 
835
        _g_free0 (_tmp17_);
 
836
        _tmp18_ = data;
 
837
        _tmp19_ = _tmp18_->image_frame;
 
838
        _tmp20_ = c->individual;
 
839
        contacts_contact_frame_set_image (_tmp19_, (FolksAvatarDetails*) _tmp20_, c);
 
840
        _g_object_unref0 (c);
 
841
}
 
842
 
 
843
 
 
844
static void contacts_view_update_all_filtered (ContactsView* self) {
1435
845
        g_return_if_fail (self != NULL);
1436
846
        {
1437
 
                ContactsStore* _tmp0_;
1438
 
                GeeCollection* _tmp1_ = NULL;
 
847
                GeeHashMap* _tmp0_;
 
848
                GeeCollection* _tmp1_;
1439
849
                GeeCollection* _tmp2_;
1440
 
                GeeIterator* _tmp3_ = NULL;
1441
 
                GeeIterator* _tmp4_;
1442
 
                GeeIterator* _c_it;
1443
 
                _tmp0_ = self->priv->contacts_store;
1444
 
                _tmp1_ = contacts_store_get_contacts (_tmp0_);
 
850
                GeeCollection* _tmp3_;
 
851
                GeeIterator* _tmp4_ = NULL;
 
852
                GeeIterator* _tmp5_;
 
853
                GeeIterator* _data_it;
 
854
                _tmp0_ = self->priv->contacts;
 
855
                _tmp1_ = gee_abstract_map_get_values ((GeeMap*) _tmp0_);
1445
856
                _tmp2_ = _tmp1_;
1446
 
                _tmp3_ = gee_iterable_iterator ((GeeIterable*) _tmp2_);
1447
 
                _tmp4_ = _tmp3_;
1448
 
                _g_object_unref0 (_tmp2_);
1449
 
                _c_it = _tmp4_;
 
857
                _tmp3_ = _tmp2_;
 
858
                _tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
 
859
                _tmp5_ = _tmp4_;
 
860
                _g_object_unref0 (_tmp3_);
 
861
                _data_it = _tmp5_;
1450
862
                while (TRUE) {
1451
 
                        GeeIterator* _tmp5_;
1452
 
                        gboolean _tmp6_ = FALSE;
1453
 
                        GeeIterator* _tmp7_;
1454
 
                        gpointer _tmp8_ = NULL;
1455
 
                        ContactsContact* c;
1456
 
                        ContactsContact* _tmp9_;
1457
 
                        ContactsViewContactData* _tmp10_ = NULL;
 
863
                        GeeIterator* _tmp6_;
 
864
                        gboolean _tmp7_ = FALSE;
 
865
                        GeeIterator* _tmp8_;
 
866
                        gpointer _tmp9_ = NULL;
 
867
                        ContactsViewContactData* data;
 
868
                        ContactsViewContactData* _tmp10_;
1458
869
                        ContactsViewContactData* _tmp11_;
1459
 
                        _tmp5_ = _c_it;
1460
 
                        _tmp6_ = gee_iterator_next (_tmp5_);
1461
 
                        if (!_tmp6_) {
 
870
                        ContactsContact* _tmp12_;
 
871
                        gboolean _tmp13_ = FALSE;
 
872
                        _tmp6_ = _data_it;
 
873
                        _tmp7_ = gee_iterator_next (_tmp6_);
 
874
                        if (!_tmp7_) {
1462
875
                                break;
1463
876
                        }
1464
 
                        _tmp7_ = _c_it;
1465
 
                        _tmp8_ = gee_iterator_get (_tmp7_);
1466
 
                        c = (ContactsContact*) _tmp8_;
1467
 
                        _tmp9_ = c;
1468
 
                        _tmp10_ = contacts_view_lookup_data (self, _tmp9_);
1469
 
                        _tmp11_ = _tmp10_;
1470
 
                        contacts_view_update_visible (self, _tmp11_);
1471
 
                        _contacts_view_contact_data_unref0 (_tmp11_);
1472
 
                        _g_object_unref0 (c);
 
877
                        _tmp8_ = _data_it;
 
878
                        _tmp9_ = gee_iterator_get (_tmp8_);
 
879
                        data = (ContactsViewContactData*) _tmp9_;
 
880
                        _tmp10_ = data;
 
881
                        _tmp11_ = data;
 
882
                        _tmp12_ = _tmp11_->contact;
 
883
                        _tmp13_ = contacts_view_calculate_filtered (self, _tmp12_);
 
884
                        _tmp10_->filtered = _tmp13_;
 
885
                        _contacts_view_contact_data_unref0 (data);
1473
886
                }
1474
 
                _g_object_unref0 (_c_it);
1475
 
        }
1476
 
}
1477
 
 
1478
 
 
1479
 
void contacts_view_hide_contact (ContactsView* self, ContactsContact* contact) {
1480
 
        GeeHashSet* _tmp0_;
1481
 
        ContactsContact* _tmp1_;
1482
 
        g_return_if_fail (self != NULL);
1483
 
        g_return_if_fail (contact != NULL);
1484
 
        _tmp0_ = self->priv->hidden_contacts;
1485
 
        _tmp1_ = contact;
1486
 
        gee_abstract_collection_add ((GeeAbstractCollection*) _tmp0_, _tmp1_);
1487
 
        contacts_view_refilter (self);
1488
 
}
1489
 
 
1490
 
 
1491
 
static gchar** _vala_array_dup4 (gchar** self, int length) {
1492
 
        gchar** result;
1493
 
        int i;
1494
 
        result = g_new0 (gchar*, length + 1);
1495
 
        for (i = 0; i < length; i++) {
1496
 
                gchar* _tmp0_;
1497
 
                _tmp0_ = g_strdup (self[i]);
1498
 
                result[i] = _tmp0_;
1499
 
        }
1500
 
        return result;
1501
 
}
1502
 
 
1503
 
 
1504
 
void contacts_view_set_filter_values (ContactsView* self, gchar** values, int values_length1) {
1505
 
        gchar** _tmp0_;
1506
 
        gint _tmp0__length1;
1507
 
        gchar** _tmp1_;
1508
 
        gint _tmp1__length1;
1509
 
        g_return_if_fail (self != NULL);
1510
 
        _tmp0_ = values;
1511
 
        _tmp0__length1 = values_length1;
1512
 
        _tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup4 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_);
1513
 
        _tmp1__length1 = _tmp0__length1;
1514
 
        self->priv->filter_values = (_vala_array_free (self->priv->filter_values, self->priv->filter_values_length1, (GDestroyNotify) g_free), NULL);
1515
 
        self->priv->filter_values = _tmp1_;
1516
 
        self->priv->filter_values_length1 = _tmp1__length1;
1517
 
        self->priv->_filter_values_size_ = self->priv->filter_values_length1;
1518
 
        contacts_view_refilter (self);
 
887
                _g_object_unref0 (_data_it);
 
888
        }
1519
889
}
1520
890
 
1521
891
 
1522
892
static void contacts_view_contact_changed_cb (ContactsView* self, ContactsStore* store, ContactsContact* c) {
1523
 
        ContactsContact* _tmp0_;
1524
 
        ContactsViewContactData* _tmp1_ = NULL;
 
893
        GeeHashMap* _tmp0_;
 
894
        ContactsContact* _tmp1_;
 
895
        gpointer _tmp2_ = NULL;
1525
896
        ContactsViewContactData* data;
1526
 
        ContactsViewContactData* _tmp2_;
1527
 
        gboolean _tmp3_;
1528
 
        gboolean was_visible;
1529
 
        ContactsViewContactData* next;
1530
 
        ContactsViewContactData* _tmp4_;
1531
 
        gboolean _tmp5_;
1532
 
        ContactsViewContactData* _tmp8_;
1533
 
        gboolean _tmp9_ = FALSE;
1534
 
        gboolean _tmp10_;
1535
 
        gboolean _tmp13_;
 
897
        GtkGrid* _tmp3_;
1536
898
        g_return_if_fail (self != NULL);
1537
899
        g_return_if_fail (store != NULL);
1538
900
        g_return_if_fail (c != NULL);
1539
 
        _tmp0_ = c;
1540
 
        _tmp1_ = contacts_view_lookup_data (self, _tmp0_);
1541
 
        data = _tmp1_;
1542
 
        _tmp2_ = data;
1543
 
        _tmp3_ = _tmp2_->visible;
1544
 
        was_visible = _tmp3_;
1545
 
        next = NULL;
1546
 
        _tmp4_ = data;
1547
 
        _tmp5_ = _tmp4_->visible;
1548
 
        if (_tmp5_) {
1549
 
                ContactsViewContactData* _tmp6_;
1550
 
                ContactsViewContactData* _tmp7_ = NULL;
1551
 
                _tmp6_ = data;
1552
 
                _tmp7_ = contacts_view_get_next (self, _tmp6_);
1553
 
                _contacts_view_contact_data_unref0 (next);
1554
 
                next = _tmp7_;
 
901
        _tmp0_ = self->priv->contacts;
 
902
        _tmp1_ = c;
 
903
        _tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp0_, _tmp1_);
 
904
        data = (ContactsViewContactData*) _tmp2_;
 
905
        contacts_view_update_data (self, data);
 
906
        _tmp3_ = data->grid;
 
907
        egg_list_box_child_changed ((EggListBox*) self, (GtkWidget*) _tmp3_);
 
908
        _contacts_view_contact_data_unref0 (data);
 
909
}
 
910
 
 
911
 
 
912
static Block36Data* block36_data_ref (Block36Data* _data36_) {
 
913
        g_atomic_int_inc (&_data36_->_ref_count_);
 
914
        return _data36_;
 
915
}
 
916
 
 
917
 
 
918
static void block36_data_unref (void * _userdata_) {
 
919
        Block36Data* _data36_;
 
920
        _data36_ = (Block36Data*) _userdata_;
 
921
        if (g_atomic_int_dec_and_test (&_data36_->_ref_count_)) {
 
922
                ContactsView * self;
 
923
                self = _data36_->self;
 
924
                _contacts_view_contact_data_unref0 (_data36_->data);
 
925
                _g_object_unref0 (self);
 
926
                g_slice_free (Block36Data, _data36_);
1555
927
        }
1556
 
        _tmp8_ = data;
1557
 
        contacts_view_update_visible (self, _tmp8_);
1558
 
        _tmp10_ = was_visible;
1559
 
        if (_tmp10_) {
1560
 
                ContactsViewContactData* _tmp11_;
1561
 
                gboolean _tmp12_;
1562
 
                _tmp11_ = data;
1563
 
                _tmp12_ = _tmp11_->visible;
1564
 
                _tmp9_ = _tmp12_;
 
928
}
 
929
 
 
930
 
 
931
static void __lambda24_ (Block36Data* _data36_) {
 
932
        ContactsView * self;
 
933
        ContactsViewContactData* _tmp0_;
 
934
        GtkCheckButton* _tmp1_;
 
935
        gboolean _tmp2_;
 
936
        gboolean _tmp3_;
 
937
        gint _tmp6_;
 
938
        self = _data36_->self;
 
939
        _tmp0_ = _data36_->data;
 
940
        _tmp1_ = _tmp0_->selector_button;
 
941
        _tmp2_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp1_);
 
942
        _tmp3_ = _tmp2_;
 
943
        if (_tmp3_) {
 
944
                gint _tmp4_;
 
945
                _tmp4_ = self->priv->nr_contacts_marked;
 
946
                self->priv->nr_contacts_marked = _tmp4_ + 1;
1565
947
        } else {
1566
 
                _tmp9_ = FALSE;
1567
 
        }
1568
 
        _tmp13_ = _tmp9_;
1569
 
        if (_tmp13_) {
1570
 
                ContactsViewContactData* _tmp14_;
1571
 
                ContactsViewContactData* _tmp15_;
1572
 
                ContactsViewContactData* _tmp20_;
1573
 
                ContactsViewContactData* _tmp21_ = NULL;
1574
 
                ContactsViewContactData* _tmp22_;
1575
 
                _tmp14_ = data;
1576
 
                contacts_view_row_changed_resort (self, _tmp14_);
1577
 
                _tmp15_ = next;
1578
 
                if (_tmp15_ != NULL) {
1579
 
                        ContactsViewContactData* _tmp16_;
1580
 
                        ContactsViewContactData* _tmp17_;
1581
 
                        ContactsViewContactData* _tmp18_ = NULL;
1582
 
                        ContactsViewContactData* _tmp19_;
1583
 
                        _tmp16_ = next;
1584
 
                        _tmp17_ = next;
1585
 
                        _tmp18_ = contacts_view_get_previous (self, _tmp17_);
1586
 
                        _tmp19_ = _tmp18_;
1587
 
                        contacts_view_update_is_first (self, _tmp16_, _tmp19_);
1588
 
                        _contacts_view_contact_data_unref0 (_tmp19_);
1589
 
                }
1590
 
                _tmp20_ = data;
1591
 
                _tmp21_ = contacts_view_get_next (self, _tmp20_);
1592
 
                _contacts_view_contact_data_unref0 (next);
1593
 
                next = _tmp21_;
1594
 
                _tmp22_ = next;
1595
 
                if (_tmp22_ != NULL) {
1596
 
                        ContactsViewContactData* _tmp23_;
1597
 
                        ContactsViewContactData* _tmp24_;
1598
 
                        _tmp23_ = next;
1599
 
                        _tmp24_ = data;
1600
 
                        contacts_view_update_is_first (self, _tmp23_, _tmp24_);
1601
 
                }
1602
 
        }
1603
 
        _contacts_view_contact_data_unref0 (next);
1604
 
        _contacts_view_contact_data_unref0 (data);
 
948
                gint _tmp5_;
 
949
                _tmp5_ = self->priv->nr_contacts_marked;
 
950
                self->priv->nr_contacts_marked = _tmp5_ - 1;
 
951
        }
 
952
        _tmp6_ = self->priv->nr_contacts_marked;
 
953
        g_signal_emit_by_name (self, "contacts-marked", _tmp6_);
1605
954
}
1606
955
 
1607
956
 
1608
 
static ContactsViewContactData* contacts_view_lookup_data (ContactsView* self, ContactsContact* c) {
1609
 
        ContactsViewContactData* result = NULL;
1610
 
        ContactsContact* _tmp0_;
1611
 
        gconstpointer _tmp1_ = NULL;
1612
 
        ContactsViewContactData* _tmp2_;
1613
 
        g_return_val_if_fail (self != NULL, NULL);
1614
 
        g_return_val_if_fail (c != NULL, NULL);
1615
 
        _tmp0_ = c;
1616
 
        _tmp1_ = contacts_contact_lookup (_tmp0_, CONTACTS_VIEW_TYPE_CONTACT_DATA, (GBoxedCopyFunc) contacts_view_contact_data_ref, contacts_view_contact_data_unref, self);
1617
 
        _tmp2_ = _contacts_view_contact_data_ref0 ((ContactsViewContactData*) _tmp1_);
1618
 
        result = _tmp2_;
1619
 
        return result;
 
957
static void ___lambda24__gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self) {
 
958
        __lambda24_ (self);
1620
959
}
1621
960
 
1622
961
 
1623
962
static void contacts_view_contact_added_cb (ContactsView* self, ContactsStore* store, ContactsContact* c) {
 
963
        Block36Data* _data36_;
1624
964
        ContactsViewContactData* _tmp0_;
1625
 
        ContactsViewContactData* data;
1626
 
        ContactsContact* _tmp1_;
 
965
        ContactsViewContactData* _tmp1_;
1627
966
        ContactsContact* _tmp2_;
1628
967
        ContactsContact* _tmp3_;
1629
968
        ContactsViewContactData* _tmp4_;
 
969
        GtkGrid* _tmp5_;
 
970
        ContactsViewContactData* _tmp6_;
 
971
        GtkGrid* _tmp7_;
 
972
        ContactsViewContactData* _tmp8_;
 
973
        GtkGrid* _tmp9_;
 
974
        ContactsViewContactData* _tmp10_;
 
975
        ContactsContactFrame* _tmp11_;
 
976
        ContactsViewContactData* _tmp12_;
 
977
        GtkLabel* _tmp13_;
 
978
        ContactsViewContactData* _tmp14_;
 
979
        GtkLabel* _tmp15_;
 
980
        ContactsViewContactData* _tmp16_;
 
981
        GtkLabel* _tmp17_;
 
982
        ContactsViewContactData* _tmp18_;
 
983
        GtkLabel* _tmp19_;
 
984
        ContactsViewContactData* _tmp20_;
 
985
        GtkCheckButton* _tmp21_;
 
986
        ContactsViewContactData* _tmp22_;
 
987
        GtkCheckButton* _tmp23_;
 
988
        ContactsViewContactData* _tmp24_;
 
989
        GtkCheckButton* _tmp25_;
 
990
        ContactsViewContactData* _tmp26_;
 
991
        GtkCheckButton* _tmp27_;
 
992
        ContactsViewContactData* _tmp28_;
 
993
        GtkGrid* _tmp29_;
 
994
        ContactsViewContactData* _tmp30_;
 
995
        ContactsContactFrame* _tmp31_;
 
996
        ContactsViewContactData* _tmp32_;
 
997
        GtkGrid* _tmp33_;
 
998
        ContactsViewContactData* _tmp34_;
 
999
        GtkLabel* _tmp35_;
 
1000
        ContactsViewContactData* _tmp36_;
 
1001
        GtkGrid* _tmp37_;
 
1002
        ContactsViewContactData* _tmp38_;
 
1003
        GtkCheckButton* _tmp39_;
 
1004
        ContactsViewTextDisplay _tmp40_;
 
1005
        ContactsViewTextDisplay _tmp50_;
 
1006
        ContactsViewContactData* _tmp63_;
 
1007
        ContactsViewContactData* _tmp64_;
 
1008
        GtkCheckButton* _tmp65_;
 
1009
        ContactsViewContactData* _tmp66_;
 
1010
        GtkGrid* _tmp67_;
 
1011
        ContactsViewContactData* _tmp68_;
 
1012
        ContactsViewContactData* _tmp69_;
 
1013
        ContactsViewContactData* _tmp70_;
 
1014
        GtkGrid* _tmp71_;
 
1015
        gboolean _tmp72_;
 
1016
        GeeHashMap* _tmp75_;
 
1017
        ContactsContact* _tmp76_;
 
1018
        ContactsViewContactData* _tmp77_;
 
1019
        ContactsViewContactData* _tmp78_;
 
1020
        GtkGrid* _tmp79_;
1630
1021
        g_return_if_fail (self != NULL);
1631
1022
        g_return_if_fail (store != NULL);
1632
1023
        g_return_if_fail (c != NULL);
 
1024
        _data36_ = g_slice_new0 (Block36Data);
 
1025
        _data36_->_ref_count_ = 1;
 
1026
        _data36_->self = g_object_ref (self);
1633
1027
        _tmp0_ = contacts_view_contact_data_new ();
1634
 
        data = _tmp0_;
1635
 
        _tmp1_ = c;
1636
 
        _tmp2_ = _g_object_ref0 (_tmp1_);
1637
 
        _g_object_unref0 (data->contact);
1638
 
        data->contact = _tmp2_;
1639
 
        data->visible = FALSE;
1640
 
        _tmp3_ = c;
1641
 
        _tmp4_ = _contacts_view_contact_data_ref0 (data);
1642
 
        contacts_contact_set_lookup (_tmp3_, CONTACTS_VIEW_TYPE_CONTACT_DATA, (GBoxedCopyFunc) contacts_view_contact_data_ref, contacts_view_contact_data_unref, self, _tmp4_);
1643
 
        contacts_view_update_visible (self, data);
1644
 
        _contacts_view_contact_data_unref0 (data);
 
1028
        _data36_->data = _tmp0_;
 
1029
        _tmp1_ = _data36_->data;
 
1030
        _tmp2_ = c;
 
1031
        _tmp3_ = _g_object_ref0 (_tmp2_);
 
1032
        _g_object_unref0 (_tmp1_->contact);
 
1033
        _tmp1_->contact = _tmp3_;
 
1034
        _tmp4_ = _data36_->data;
 
1035
        _tmp5_ = (GtkGrid*) gtk_grid_new ();
 
1036
        g_object_ref_sink (_tmp5_);
 
1037
        _g_object_unref0 (_tmp4_->grid);
 
1038
        _tmp4_->grid = _tmp5_;
 
1039
        _tmp6_ = _data36_->data;
 
1040
        _tmp7_ = _tmp6_->grid;
 
1041
        g_object_set ((GtkWidget*) _tmp7_, "margin", 12, NULL);
 
1042
        _tmp8_ = _data36_->data;
 
1043
        _tmp9_ = _tmp8_->grid;
 
1044
        gtk_grid_set_column_spacing (_tmp9_, (guint) 10);
 
1045
        _tmp10_ = _data36_->data;
 
1046
        _tmp11_ = contacts_contact_frame_new (CONTACTS_CONTACT_SMALL_AVATAR_SIZE, FALSE);
 
1047
        g_object_ref_sink (_tmp11_);
 
1048
        _g_object_unref0 (_tmp10_->image_frame);
 
1049
        _tmp10_->image_frame = _tmp11_;
 
1050
        _tmp12_ = _data36_->data;
 
1051
        _tmp13_ = (GtkLabel*) gtk_label_new ("");
 
1052
        g_object_ref_sink (_tmp13_);
 
1053
        _g_object_unref0 (_tmp12_->label);
 
1054
        _tmp12_->label = _tmp13_;
 
1055
        _tmp14_ = _data36_->data;
 
1056
        _tmp15_ = _tmp14_->label;
 
1057
        gtk_label_set_ellipsize (_tmp15_, PANGO_ELLIPSIZE_END);
 
1058
        _tmp16_ = _data36_->data;
 
1059
        _tmp17_ = _tmp16_->label;
 
1060
        gtk_widget_set_valign ((GtkWidget*) _tmp17_, GTK_ALIGN_START);
 
1061
        _tmp18_ = _data36_->data;
 
1062
        _tmp19_ = _tmp18_->label;
 
1063
        gtk_widget_set_halign ((GtkWidget*) _tmp19_, GTK_ALIGN_START);
 
1064
        _tmp20_ = _data36_->data;
 
1065
        _tmp21_ = (GtkCheckButton*) gtk_check_button_new ();
 
1066
        g_object_ref_sink (_tmp21_);
 
1067
        _g_object_unref0 (_tmp20_->selector_button);
 
1068
        _tmp20_->selector_button = _tmp21_;
 
1069
        _tmp22_ = _data36_->data;
 
1070
        _tmp23_ = _tmp22_->selector_button;
 
1071
        gtk_widget_set_valign ((GtkWidget*) _tmp23_, GTK_ALIGN_CENTER);
 
1072
        _tmp24_ = _data36_->data;
 
1073
        _tmp25_ = _tmp24_->selector_button;
 
1074
        gtk_widget_set_halign ((GtkWidget*) _tmp25_, GTK_ALIGN_END);
 
1075
        _tmp26_ = _data36_->data;
 
1076
        _tmp27_ = _tmp26_->selector_button;
 
1077
        gtk_widget_set_hexpand ((GtkWidget*) _tmp27_, TRUE);
 
1078
        _tmp28_ = _data36_->data;
 
1079
        _tmp29_ = _tmp28_->grid;
 
1080
        _tmp30_ = _data36_->data;
 
1081
        _tmp31_ = _tmp30_->image_frame;
 
1082
        gtk_grid_attach (_tmp29_, (GtkWidget*) _tmp31_, 0, 0, 1, 2);
 
1083
        _tmp32_ = _data36_->data;
 
1084
        _tmp33_ = _tmp32_->grid;
 
1085
        _tmp34_ = _data36_->data;
 
1086
        _tmp35_ = _tmp34_->label;
 
1087
        gtk_grid_attach (_tmp33_, (GtkWidget*) _tmp35_, 1, 0, 1, 1);
 
1088
        _tmp36_ = _data36_->data;
 
1089
        _tmp37_ = _tmp36_->grid;
 
1090
        _tmp38_ = _data36_->data;
 
1091
        _tmp39_ = _tmp38_->selector_button;
 
1092
        gtk_grid_attach (_tmp37_, (GtkWidget*) _tmp39_, 2, 0, 1, 2);
 
1093
        _tmp40_ = self->priv->text_display;
 
1094
        if (_tmp40_ == CONTACTS_VIEW_TEXT_DISPLAY_PRESENCE) {
 
1095
                ContactsContact* _tmp41_;
 
1096
                GtkWidget* _tmp42_ = NULL;
 
1097
                GtkWidget* merged_presence;
 
1098
                GtkWidget* _tmp43_;
 
1099
                GtkWidget* _tmp44_;
 
1100
                GtkWidget* _tmp45_;
 
1101
                GtkWidget* _tmp46_;
 
1102
                ContactsViewContactData* _tmp47_;
 
1103
                GtkGrid* _tmp48_;
 
1104
                GtkWidget* _tmp49_;
 
1105
                _tmp41_ = c;
 
1106
                _tmp42_ = contacts_contact_create_merged_presence_widget (_tmp41_);
 
1107
                merged_presence = _tmp42_;
 
1108
                _tmp43_ = merged_presence;
 
1109
                gtk_widget_set_halign (_tmp43_, GTK_ALIGN_START);
 
1110
                _tmp44_ = merged_presence;
 
1111
                gtk_widget_set_valign (_tmp44_, GTK_ALIGN_END);
 
1112
                _tmp45_ = merged_presence;
 
1113
                gtk_widget_set_vexpand (_tmp45_, FALSE);
 
1114
                _tmp46_ = merged_presence;
 
1115
                gtk_widget_set_margin_bottom (_tmp46_, 4);
 
1116
                _tmp47_ = _data36_->data;
 
1117
                _tmp48_ = _tmp47_->grid;
 
1118
                _tmp49_ = merged_presence;
 
1119
                gtk_grid_attach (_tmp48_, _tmp49_, 1, 1, 1, 1);
 
1120
                _g_object_unref0 (merged_presence);
 
1121
        }
 
1122
        _tmp50_ = self->priv->text_display;
 
1123
        if (_tmp50_ == CONTACTS_VIEW_TEXT_DISPLAY_STORES) {
 
1124
                GtkLabel* _tmp51_;
 
1125
                GtkLabel* stores;
 
1126
                GtkLabel* _tmp52_;
 
1127
                ContactsContact* _tmp53_;
 
1128
                gchar* _tmp54_ = NULL;
 
1129
                gchar* _tmp55_;
 
1130
                gchar* _tmp56_ = NULL;
 
1131
                gchar* _tmp57_;
 
1132
                GtkLabel* _tmp58_;
 
1133
                GtkLabel* _tmp59_;
 
1134
                ContactsViewContactData* _tmp60_;
 
1135
                GtkGrid* _tmp61_;
 
1136
                GtkLabel* _tmp62_;
 
1137
                _tmp51_ = (GtkLabel*) gtk_label_new ("");
 
1138
                g_object_ref_sink (_tmp51_);
 
1139
                stores = _tmp51_;
 
1140
                _tmp52_ = stores;
 
1141
                _tmp53_ = c;
 
1142
                _tmp54_ = contacts_contact_format_persona_stores (_tmp53_);
 
1143
                _tmp55_ = _tmp54_;
 
1144
                _tmp56_ = g_markup_printf_escaped ("<span font='12px'>%s</span>", _tmp55_);
 
1145
                _tmp57_ = _tmp56_;
 
1146
                gtk_label_set_markup (_tmp52_, _tmp57_);
 
1147
                _g_free0 (_tmp57_);
 
1148
                _g_free0 (_tmp55_);
 
1149
                _tmp58_ = stores;
 
1150
                gtk_label_set_ellipsize (_tmp58_, PANGO_ELLIPSIZE_END);
 
1151
                _tmp59_ = stores;
 
1152
                gtk_widget_set_halign ((GtkWidget*) _tmp59_, GTK_ALIGN_START);
 
1153
                _tmp60_ = _data36_->data;
 
1154
                _tmp61_ = _tmp60_->grid;
 
1155
                _tmp62_ = stores;
 
1156
                gtk_grid_attach (_tmp61_, (GtkWidget*) _tmp62_, 1, 1, 1, 1);
 
1157
                _g_object_unref0 (stores);
 
1158
        }
 
1159
        _tmp63_ = _data36_->data;
 
1160
        contacts_view_update_data (self, _tmp63_);
 
1161
        _tmp64_ = _data36_->data;
 
1162
        _tmp65_ = _tmp64_->selector_button;
 
1163
        g_signal_connect_data ((GtkToggleButton*) _tmp65_, "toggled", (GCallback) ___lambda24__gtk_toggle_button_toggled, block36_data_ref (_data36_), (GClosureNotify) block36_data_unref, 0);
 
1164
        _tmp66_ = _data36_->data;
 
1165
        _tmp67_ = _tmp66_->grid;
 
1166
        _tmp68_ = _data36_->data;
 
1167
        _tmp69_ = _contacts_view_contact_data_ref0 (_tmp68_);
 
1168
        g_object_set_data_full ((GObject*) _tmp67_, "data", _tmp69_, contacts_view_contact_data_unref);
 
1169
        _tmp70_ = _data36_->data;
 
1170
        _tmp71_ = _tmp70_->grid;
 
1171
        gtk_widget_show_all ((GtkWidget*) _tmp71_);
 
1172
        _tmp72_ = self->priv->selectors_visible;
 
1173
        if (!_tmp72_) {
 
1174
                ContactsViewContactData* _tmp73_;
 
1175
                GtkCheckButton* _tmp74_;
 
1176
                _tmp73_ = _data36_->data;
 
1177
                _tmp74_ = _tmp73_->selector_button;
 
1178
                gtk_widget_hide ((GtkWidget*) _tmp74_);
 
1179
        }
 
1180
        _tmp75_ = self->priv->contacts;
 
1181
        _tmp76_ = c;
 
1182
        _tmp77_ = _data36_->data;
 
1183
        gee_abstract_map_set ((GeeAbstractMap*) _tmp75_, _tmp76_, _tmp77_);
 
1184
        _tmp78_ = _data36_->data;
 
1185
        _tmp79_ = _tmp78_->grid;
 
1186
        gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp79_);
 
1187
        block36_data_unref (_data36_);
 
1188
        _data36_ = NULL;
1645
1189
}
1646
1190
 
1647
1191
 
1648
1192
static void contacts_view_contact_removed_cb (ContactsView* self, ContactsStore* store, ContactsContact* c) {
1649
 
        ContactsContact* _tmp0_;
1650
 
        ContactsViewContactData* _tmp1_ = NULL;
 
1193
        GeeHashMap* _tmp0_;
 
1194
        ContactsContact* _tmp1_;
 
1195
        gpointer _tmp2_ = NULL;
1651
1196
        ContactsViewContactData* data;
1652
 
        ContactsViewContactData* _tmp2_;
1653
 
        gboolean _tmp3_;
1654
 
        ContactsContact* _tmp5_;
 
1197
        GtkGrid* _tmp3_;
 
1198
        GtkLabel* _tmp4_;
 
1199
        ContactsContactFrame* _tmp5_;
 
1200
        GeeHashMap* _tmp6_;
 
1201
        ContactsContact* _tmp7_;
1655
1202
        g_return_if_fail (self != NULL);
1656
1203
        g_return_if_fail (store != NULL);
1657
1204
        g_return_if_fail (c != NULL);
1658
 
        _tmp0_ = c;
1659
 
        _tmp1_ = contacts_view_lookup_data (self, _tmp0_);
1660
 
        data = _tmp1_;
1661
 
        _tmp2_ = data;
1662
 
        _tmp3_ = _tmp2_->visible;
1663
 
        if (_tmp3_) {
1664
 
                ContactsViewContactData* _tmp4_;
1665
 
                _tmp4_ = data;
1666
 
                contacts_view_remove_from_model (self, _tmp4_);
1667
 
        }
1668
 
        _tmp5_ = c;
1669
 
        contacts_contact_remove_lookup (_tmp5_, CONTACTS_VIEW_TYPE_CONTACT_DATA, (GBoxedCopyFunc) contacts_view_contact_data_ref, contacts_view_contact_data_unref, self);
1670
 
        _contacts_view_contact_data_unref0 (data);
1671
 
}
1672
 
 
1673
 
 
1674
 
gboolean contacts_view_lookup_iter (ContactsView* self, ContactsContact* c, GtkTreeIter* iter) {
1675
 
        GtkTreeIter _vala_iter = {0};
 
1205
        _tmp0_ = self->priv->contacts;
 
1206
        _tmp1_ = c;
 
1207
        _tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp0_, _tmp1_);
 
1208
        data = (ContactsViewContactData*) _tmp2_;
 
1209
        _tmp3_ = data->grid;
 
1210
        gtk_widget_destroy ((GtkWidget*) _tmp3_);
 
1211
        _tmp4_ = data->label;
 
1212
        gtk_widget_destroy ((GtkWidget*) _tmp4_);
 
1213
        _tmp5_ = data->image_frame;
 
1214
        gtk_widget_destroy ((GtkWidget*) _tmp5_);
 
1215
        _tmp6_ = self->priv->contacts;
 
1216
        _tmp7_ = c;
 
1217
        gee_abstract_map_unset ((GeeAbstractMap*) _tmp6_, _tmp7_, NULL);
 
1218
        _contacts_view_contact_data_unref0 (data);
 
1219
}
 
1220
 
 
1221
 
 
1222
static void contacts_view_real_child_selected (EggListBox* base, GtkWidget* child) {
 
1223
        ContactsView * self;
 
1224
        ContactsViewContactData* _tmp0_ = NULL;
 
1225
        GtkWidget* _tmp1_;
 
1226
        ContactsViewContactData* _tmp4_;
 
1227
        ContactsViewContactData* _tmp5_;
 
1228
        ContactsViewContactData* data;
 
1229
        ContactsContact* _tmp6_ = NULL;
 
1230
        ContactsViewContactData* _tmp7_;
 
1231
        ContactsContact* _tmp10_;
 
1232
        ContactsContact* _tmp11_;
 
1233
        ContactsContact* contact;
 
1234
        ContactsContact* _tmp12_;
 
1235
        ContactsContact* _tmp13_;
 
1236
        GtkWidget* _tmp15_;
 
1237
        ContactsViewContactData* _tmp26_;
 
1238
        self = (ContactsView*) base;
 
1239
        _tmp1_ = child;
 
1240
        if (_tmp1_ != NULL) {
 
1241
                GtkWidget* _tmp2_;
 
1242
                gconstpointer _tmp3_ = NULL;
 
1243
                _tmp2_ = child;
 
1244
                _tmp3_ = g_object_get_data ((GObject*) _tmp2_, "data");
 
1245
                _tmp0_ = (ContactsViewContactData*) _tmp3_;
 
1246
        } else {
 
1247
                _tmp0_ = NULL;
 
1248
        }
 
1249
        _tmp4_ = _tmp0_;
 
1250
        _tmp5_ = _contacts_view_contact_data_ref0 (_tmp4_);
 
1251
        data = _tmp5_;
 
1252
        _tmp7_ = data;
 
1253
        if (_tmp7_ != NULL) {
 
1254
                ContactsViewContactData* _tmp8_;
 
1255
                ContactsContact* _tmp9_;
 
1256
                _tmp8_ = data;
 
1257
                _tmp9_ = _tmp8_->contact;
 
1258
                _tmp6_ = _tmp9_;
 
1259
        } else {
 
1260
                _tmp6_ = NULL;
 
1261
        }
 
1262
        _tmp10_ = _tmp6_;
 
1263
        _tmp11_ = _g_object_ref0 (_tmp10_);
 
1264
        contact = _tmp11_;
 
1265
        _tmp12_ = contact;
 
1266
        g_signal_emit_by_name (self, "selection-changed", _tmp12_);
 
1267
        _tmp13_ = contact;
 
1268
        if (_tmp13_ != NULL) {
 
1269
                ContactsContact* _tmp14_;
 
1270
                _tmp14_ = contact;
 
1271
                contacts_contact_fetch_contact_info (_tmp14_);
 
1272
        }
 
1273
        _tmp15_ = self->priv->last_selected;
 
1274
        if (_tmp15_ != NULL) {
 
1275
                GtkWidget* _tmp16_;
 
1276
                gconstpointer _tmp17_ = NULL;
 
1277
                ContactsViewContactData* _tmp18_;
 
1278
                ContactsViewContactData* last_data;
 
1279
                ContactsViewContactData* _tmp19_;
 
1280
                GtkLabel* _tmp20_;
 
1281
                GtkStateFlags _tmp21_ = 0;
 
1282
                GtkStateFlags label_flags;
 
1283
                GtkStateFlags _tmp22_;
 
1284
                ContactsViewContactData* _tmp23_;
 
1285
                GtkLabel* _tmp24_;
 
1286
                GtkStateFlags _tmp25_;
 
1287
                _tmp16_ = self->priv->last_selected;
 
1288
                _tmp17_ = g_object_get_data ((GObject*) _tmp16_, "data");
 
1289
                _tmp18_ = _contacts_view_contact_data_ref0 ((ContactsViewContactData*) _tmp17_);
 
1290
                last_data = _tmp18_;
 
1291
                _tmp19_ = last_data;
 
1292
                _tmp20_ = _tmp19_->label;
 
1293
                _tmp21_ = gtk_widget_get_state_flags ((GtkWidget*) _tmp20_);
 
1294
                label_flags = _tmp21_;
 
1295
                _tmp22_ = label_flags;
 
1296
                label_flags = _tmp22_ & (~GTK_STATE_FLAG_SELECTED);
 
1297
                _tmp23_ = last_data;
 
1298
                _tmp24_ = _tmp23_->label;
 
1299
                _tmp25_ = label_flags;
 
1300
                gtk_widget_set_state_flags ((GtkWidget*) _tmp24_, _tmp25_, TRUE);
 
1301
                _contacts_view_contact_data_unref0 (last_data);
 
1302
        }
 
1303
        _tmp26_ = data;
 
1304
        if (_tmp26_ != NULL) {
 
1305
                ContactsViewContactData* _tmp27_;
 
1306
                GtkLabel* _tmp28_;
 
1307
                GtkWidget* _tmp29_;
 
1308
                GtkWidget* _tmp30_;
 
1309
                _tmp27_ = data;
 
1310
                _tmp28_ = _tmp27_->label;
 
1311
                gtk_widget_set_state_flags ((GtkWidget*) _tmp28_, GTK_STATE_FLAG_SELECTED, FALSE);
 
1312
                _tmp29_ = child;
 
1313
                _tmp30_ = _g_object_ref0 (_tmp29_);
 
1314
                _g_object_unref0 (self->priv->last_selected);
 
1315
                self->priv->last_selected = _tmp30_;
 
1316
        }
 
1317
        _g_object_unref0 (contact);
 
1318
        _contacts_view_contact_data_unref0 (data);
 
1319
}
 
1320
 
 
1321
 
 
1322
static gboolean contacts_view_filter (ContactsView* self, GtkWidget* child) {
1676
1323
        gboolean result = FALSE;
1677
 
        ContactsContact* _tmp0_;
1678
 
        ContactsViewContactData* _tmp1_ = NULL;
 
1324
        GtkWidget* _tmp0_;
 
1325
        gconstpointer _tmp1_ = NULL;
 
1326
        ContactsViewContactData* _tmp2_;
1679
1327
        ContactsViewContactData* data;
1680
 
        GtkTreeIter _tmp2_;
1681
1328
        gboolean _tmp3_;
1682
1329
        g_return_val_if_fail (self != NULL, FALSE);
1683
 
        g_return_val_if_fail (c != NULL, FALSE);
1684
 
        _tmp0_ = c;
1685
 
        _tmp1_ = contacts_view_lookup_data (self, _tmp0_);
1686
 
        data = _tmp1_;
1687
 
        _tmp2_ = data->iter;
1688
 
        _vala_iter = _tmp2_;
1689
 
        _tmp3_ = data->visible;
 
1330
        g_return_val_if_fail (child != NULL, FALSE);
 
1331
        _tmp0_ = child;
 
1332
        _tmp1_ = g_object_get_data ((GObject*) _tmp0_, "data");
 
1333
        _tmp2_ = _contacts_view_contact_data_ref0 ((ContactsViewContactData*) _tmp1_);
 
1334
        data = _tmp2_;
 
1335
        _tmp3_ = data->filtered;
1690
1336
        result = _tmp3_;
1691
1337
        _contacts_view_contact_data_unref0 (data);
1692
 
        if (iter) {
1693
 
                *iter = _vala_iter;
1694
 
        }
1695
 
        return result;
1696
 
}
1697
 
 
1698
 
 
1699
 
static Block30Data* block30_data_ref (Block30Data* _data30_) {
1700
 
        g_atomic_int_inc (&_data30_->_ref_count_);
1701
 
        return _data30_;
1702
 
}
1703
 
 
1704
 
 
1705
 
static void block30_data_unref (void * _userdata_) {
1706
 
        Block30Data* _data30_;
1707
 
        _data30_ = (Block30Data*) _userdata_;
1708
 
        if (g_atomic_int_dec_and_test (&_data30_->_ref_count_)) {
1709
 
                ContactsView * self;
1710
 
                self = _data30_->self;
1711
 
                _g_object_unref0 (self);
1712
 
                g_slice_free (Block30Data, _data30_);
1713
 
        }
1714
 
}
1715
 
 
1716
 
 
1717
 
static gboolean __lambda22_ (ContactsView* self, GtkTreeSelection* selection, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected) {
1718
 
        gboolean result = FALSE;
1719
 
        ContactsContact* contact = NULL;
1720
 
        GtkTreeIter iter = {0};
1721
 
        GtkTreeModel* _tmp0_;
1722
 
        GtkTreePath* _tmp1_;
1723
 
        GtkTreeIter _tmp2_ = {0};
1724
 
        GtkTreeModel* _tmp3_;
1725
 
        GtkTreeIter _tmp4_;
1726
 
        g_return_val_if_fail (selection != NULL, FALSE);
1727
 
        g_return_val_if_fail (model != NULL, FALSE);
1728
 
        g_return_val_if_fail (path != NULL, FALSE);
1729
 
        _tmp0_ = model;
1730
 
        _tmp1_ = path;
1731
 
        gtk_tree_model_get_iter (_tmp0_, &_tmp2_, _tmp1_);
1732
 
        iter = _tmp2_;
1733
 
        _tmp3_ = model;
1734
 
        _tmp4_ = iter;
1735
 
        gtk_tree_model_get (_tmp3_, &_tmp4_, 0, &contact, -1);
1736
 
        result = contact != NULL;
1737
 
        _g_object_unref0 (contact);
1738
 
        return result;
1739
 
}
1740
 
 
1741
 
 
1742
 
static gboolean ___lambda22__gtk_tree_selection_func (GtkTreeSelection* selection, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected, gpointer self) {
1743
 
        gboolean result;
1744
 
        result = __lambda22_ (self, selection, model, path, path_currently_selected);
1745
 
        return result;
1746
 
}
1747
 
 
1748
 
 
1749
 
static void _contacts_view_contacts_selection_changed_gtk_tree_selection_changed (GtkTreeSelection* _sender, gpointer self) {
1750
 
        contacts_view_contacts_selection_changed (self, _sender);
1751
 
}
1752
 
 
1753
 
 
1754
 
static void __lambda23_ (ContactsView* self, GtkCellLayout* column, GtkCellRenderer* cell, GtkTreeModel* model, GtkTreeIter* iter) {
1755
 
        ContactsContact* contact = NULL;
1756
 
        GtkTreeModel* _tmp0_;
1757
 
        GtkTreeIter _tmp1_;
1758
 
        ContactsContact* _tmp2_;
1759
 
        GtkCellRenderer* _tmp5_;
1760
 
        ContactsContact* _tmp6_;
1761
 
        g_return_if_fail (column != NULL);
1762
 
        g_return_if_fail (cell != NULL);
1763
 
        g_return_if_fail (model != NULL);
1764
 
        g_return_if_fail (iter != NULL);
1765
 
        _tmp0_ = model;
1766
 
        _tmp1_ = *iter;
1767
 
        gtk_tree_model_get (_tmp0_, &_tmp1_, 0, &contact, -1);
1768
 
        _tmp2_ = contact;
1769
 
        if (_tmp2_ == NULL) {
1770
 
                GtkCellRenderer* _tmp3_;
1771
 
                GtkCellRenderer* _tmp4_;
1772
 
                _tmp3_ = cell;
1773
 
                g_object_set ((GObject*) _tmp3_, "pixbuf", NULL, NULL);
1774
 
                _tmp4_ = cell;
1775
 
                gtk_cell_renderer_set_visible (_tmp4_, FALSE);
1776
 
                _g_object_unref0 (contact);
1777
 
                return;
1778
 
        }
1779
 
        _tmp5_ = cell;
1780
 
        gtk_cell_renderer_set_visible (_tmp5_, TRUE);
1781
 
        _tmp6_ = contact;
1782
 
        if (_tmp6_ != NULL) {
1783
 
                GtkCellRenderer* _tmp7_;
1784
 
                ContactsContact* _tmp8_;
1785
 
                GdkPixbuf* _tmp9_;
1786
 
                GdkPixbuf* _tmp10_;
1787
 
                _tmp7_ = cell;
1788
 
                _tmp8_ = contact;
1789
 
                _tmp9_ = contacts_contact_get_small_avatar (_tmp8_);
1790
 
                _tmp10_ = _tmp9_;
1791
 
                g_object_set ((GObject*) _tmp7_, "pixbuf", _tmp10_, NULL);
 
1338
        return result;
 
1339
}
 
1340
 
 
1341
 
 
1342
static void contacts_view_update_separator (ContactsView* self, GtkWidget** separator, GtkWidget* widget, GtkWidget* before_widget) {
 
1343
        GtkWidget* _tmp0_;
 
1344
        gconstpointer _tmp1_ = NULL;
 
1345
        ContactsViewContactData* _tmp2_;
 
1346
        ContactsViewContactData* w_data;
 
1347
        ContactsViewContactData* before_data;
 
1348
        GtkWidget* _tmp3_;
 
1349
        gboolean _tmp7_ = FALSE;
 
1350
        ContactsViewContactData* _tmp8_;
 
1351
        gboolean _tmp11_;
 
1352
        gboolean _tmp26_ = FALSE;
 
1353
        gboolean _tmp27_ = FALSE;
 
1354
        ContactsViewContactData* _tmp28_;
 
1355
        gboolean _tmp31_;
 
1356
        gboolean _tmp34_;
 
1357
        gboolean _tmp45_ = FALSE;
 
1358
        ContactsViewContactData* _tmp46_;
 
1359
        gboolean _tmp47_ = FALSE;
 
1360
        gboolean _tmp53_;
 
1361
        ContactsViewContactData* _tmp68_;
 
1362
        g_return_if_fail (self != NULL);
 
1363
        g_return_if_fail (widget != NULL);
 
1364
        _tmp0_ = widget;
 
1365
        _tmp1_ = g_object_get_data ((GObject*) _tmp0_, "data");
 
1366
        _tmp2_ = _contacts_view_contact_data_ref0 ((ContactsViewContactData*) _tmp1_);
 
1367
        w_data = _tmp2_;
 
1368
        before_data = NULL;
 
1369
        _tmp3_ = before_widget;
 
1370
        if (_tmp3_ != NULL) {
 
1371
                GtkWidget* _tmp4_;
 
1372
                gconstpointer _tmp5_ = NULL;
 
1373
                ContactsViewContactData* _tmp6_;
 
1374
                _tmp4_ = before_widget;
 
1375
                _tmp5_ = g_object_get_data ((GObject*) _tmp4_, "data");
 
1376
                _tmp6_ = _contacts_view_contact_data_ref0 ((ContactsViewContactData*) _tmp5_);
 
1377
                _contacts_view_contact_data_unref0 (before_data);
 
1378
                before_data = _tmp6_;
 
1379
        }
 
1380
        _tmp8_ = before_data;
 
1381
        if (_tmp8_ == NULL) {
 
1382
                ContactsViewContactData* _tmp9_;
 
1383
                gint _tmp10_;
 
1384
                _tmp9_ = w_data;
 
1385
                _tmp10_ = _tmp9_->sort_prio;
 
1386
                _tmp7_ = _tmp10_ > 0;
1792
1387
        } else {
1793
 
                GtkCellRenderer* _tmp11_;
1794
 
                _tmp11_ = cell;
1795
 
                g_object_set ((GObject*) _tmp11_, "pixbuf", NULL, NULL);
1796
 
        }
1797
 
        _g_object_unref0 (contact);
1798
 
}
1799
 
 
1800
 
 
1801
 
static void ___lambda23__gtk_cell_layout_data_func (GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer self) {
1802
 
        __lambda23_ (self, cell_layout, cell, tree_model, iter);
1803
 
}
1804
 
 
1805
 
 
1806
 
static void _contacts_cell_renderer_shape_render_shape_pango_cairo_shape_renderer_func (cairo_t* cr, PangoAttrShape* attr, gboolean do_path, gpointer self) {
1807
 
        contacts_cell_renderer_shape_render_shape (self, cr, attr, do_path);
1808
 
}
1809
 
 
1810
 
 
1811
 
static void __lambda24_ (Block30Data* _data30_, GtkCellLayout* column, GtkCellRenderer* cell, GtkTreeModel* model, GtkTreeIter* iter) {
1812
 
        ContactsView * self;
1813
 
        ContactsContact* contact = NULL;
1814
 
        GtkTreeModel* _tmp0_;
1815
 
        GtkTreeIter _tmp1_;
1816
 
        ContactsContact* _tmp2_;
1817
 
        GtkCellRenderer* _tmp4_;
1818
 
        ContactsContact* _tmp5_;
1819
 
        const gchar* _tmp6_;
1820
 
        const gchar* _tmp7_;
1821
 
        gchar* _tmp8_;
1822
 
        gchar* name;
1823
 
        ContactsViewTextDisplay _tmp9_;
1824
 
        self = _data30_->self;
1825
 
        g_return_if_fail (column != NULL);
1826
 
        g_return_if_fail (cell != NULL);
1827
 
        g_return_if_fail (model != NULL);
1828
 
        g_return_if_fail (iter != NULL);
1829
 
        _tmp0_ = model;
1830
 
        _tmp1_ = *iter;
1831
 
        gtk_tree_model_get (_tmp0_, &_tmp1_, 0, &contact, -1);
1832
 
        _tmp2_ = contact;
1833
 
        if (_tmp2_ == NULL) {
1834
 
                GtkCellRenderer* _tmp3_;
1835
 
                _tmp3_ = cell;
1836
 
                gtk_cell_renderer_set_visible (_tmp3_, FALSE);
1837
 
                _g_object_unref0 (contact);
1838
 
                return;
1839
 
        }
1840
 
        _tmp4_ = cell;
1841
 
        gtk_cell_renderer_set_visible (_tmp4_, TRUE);
1842
 
        _tmp5_ = contact;
1843
 
        _tmp6_ = contacts_contact_get_display_name (_tmp5_);
1844
 
        _tmp7_ = _tmp6_;
1845
 
        _tmp8_ = g_strdup (_tmp7_);
1846
 
        name = _tmp8_;
1847
 
        _tmp9_ = _data30_->text_display;
1848
 
        switch (_tmp9_) {
1849
 
                default:
1850
 
                case CONTACTS_VIEW_TEXT_DISPLAY_NONE:
1851
 
                {
1852
 
                        GtkCellRenderer* _tmp10_;
1853
 
                        const gchar* _tmp11_;
1854
 
                        _tmp10_ = cell;
1855
 
                        _tmp11_ = name;
1856
 
                        g_object_set ((GObject*) _tmp10_, "name", _tmp11_, "show_presence", FALSE, "message", "", NULL);
1857
 
                        break;
1858
 
                }
1859
 
                case CONTACTS_VIEW_TEXT_DISPLAY_PRESENCE:
1860
 
                {
1861
 
                        GtkCellRenderer* _tmp12_;
1862
 
                        const gchar* _tmp13_;
1863
 
                        ContactsContact* _tmp14_;
1864
 
                        FolksPresenceType _tmp15_;
1865
 
                        ContactsContact* _tmp16_;
1866
 
                        const gchar* _tmp17_;
1867
 
                        ContactsContact* _tmp18_;
1868
 
                        gboolean _tmp19_;
1869
 
                        _tmp12_ = cell;
1870
 
                        _tmp13_ = name;
1871
 
                        _tmp14_ = contact;
1872
 
                        _tmp15_ = _tmp14_->presence_type;
1873
 
                        _tmp16_ = contact;
1874
 
                        _tmp17_ = _tmp16_->presence_message;
1875
 
                        _tmp18_ = contact;
1876
 
                        _tmp19_ = _tmp18_->is_phone;
1877
 
                        g_object_set ((GObject*) _tmp12_, "name", _tmp13_, "show_presence", TRUE, "presence", _tmp15_, "message", _tmp17_, "is_phone", _tmp19_, NULL);
1878
 
                        break;
1879
 
                }
1880
 
                case CONTACTS_VIEW_TEXT_DISPLAY_STORES:
1881
 
                {
1882
 
                        ContactsContact* _tmp20_;
 
1388
                _tmp7_ = FALSE;
 
1389
        }
 
1390
        _tmp11_ = _tmp7_;
 
1391
        if (_tmp11_) {
 
1392
                gboolean _tmp12_ = FALSE;
 
1393
                GtkWidget* _tmp13_;
 
1394
                gboolean _tmp16_;
 
1395
                _tmp13_ = *separator;
 
1396
                if (_tmp13_ == NULL) {
 
1397
                        _tmp12_ = TRUE;
 
1398
                } else {
 
1399
                        GtkWidget* _tmp14_;
 
1400
                        gconstpointer _tmp15_ = NULL;
 
1401
                        _tmp14_ = *separator;
 
1402
                        _tmp15_ = g_object_get_data ((GObject*) _tmp14_, "contacts-suggestions-header");
 
1403
                        _tmp12_ = !((gboolean) ((gintptr) _tmp15_));
 
1404
                }
 
1405
                _tmp16_ = _tmp12_;
 
1406
                if (_tmp16_) {
 
1407
                        GtkLabel* _tmp17_;
 
1408
                        GtkLabel* l;
 
1409
                        GtkLabel* _tmp18_;
 
1410
                        GtkLabel* _tmp19_;
 
1411
                        const gchar* _tmp20_ = NULL;
1883
1412
                        gchar* _tmp21_ = NULL;
1884
 
                        gchar* stores;
1885
 
                        GtkCellRenderer* _tmp22_;
1886
 
                        const gchar* _tmp23_;
1887
 
                        const gchar* _tmp24_;
1888
 
                        _tmp20_ = contact;
1889
 
                        _tmp21_ = contacts_contact_format_persona_stores (_tmp20_);
1890
 
                        stores = _tmp21_;
1891
 
                        _tmp22_ = cell;
1892
 
                        _tmp23_ = name;
1893
 
                        _tmp24_ = stores;
1894
 
                        g_object_set ((GObject*) _tmp22_, "name", _tmp23_, "show_presence", FALSE, "message", _tmp24_, NULL);
1895
 
                        _g_free0 (stores);
1896
 
                        break;
1897
 
                }
1898
 
        }
1899
 
        _g_free0 (name);
1900
 
        _g_object_unref0 (contact);
1901
 
}
1902
 
 
1903
 
 
1904
 
static void ___lambda24__gtk_cell_layout_data_func (GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer self) {
1905
 
        __lambda24_ (self, cell_layout, cell, tree_model, iter);
1906
 
}
1907
 
 
1908
 
 
1909
 
static void __lambda25_ (ContactsView* self, GtkCellLayout* column, GtkCellRenderer* cell, GtkTreeModel* model, GtkTreeIter* iter) {
1910
 
        ContactsContact* contact = NULL;
1911
 
        GtkTreeModel* _tmp0_;
1912
 
        GtkTreeIter _tmp1_;
1913
 
        GtkCellRenderer* _tmp2_;
1914
 
        ContactsContact* _tmp3_;
1915
 
        GtkCellRenderer* _tmp4_;
1916
 
        gboolean _tmp5_;
1917
 
        gboolean _tmp6_;
1918
 
        g_return_if_fail (column != NULL);
1919
 
        g_return_if_fail (cell != NULL);
1920
 
        g_return_if_fail (model != NULL);
1921
 
        g_return_if_fail (iter != NULL);
1922
 
        _tmp0_ = model;
1923
 
        _tmp1_ = *iter;
1924
 
        gtk_tree_model_get (_tmp0_, &_tmp1_, 0, &contact, -1);
1925
 
        _tmp2_ = cell;
1926
 
        _tmp3_ = contact;
1927
 
        gtk_cell_renderer_set_visible (_tmp2_, _tmp3_ == NULL);
1928
 
        _tmp4_ = cell;
1929
 
        _tmp5_ = gtk_cell_renderer_get_visible (_tmp4_);
1930
 
        _tmp6_ = _tmp5_;
1931
 
        if (_tmp6_) {
1932
 
                GtkTreeIter _tmp7_;
1933
 
                gchar* _tmp8_ = NULL;
1934
 
                gchar* header;
1935
 
                GtkCellRenderer* _tmp9_;
1936
 
                const gchar* _tmp10_;
1937
 
                const gchar* _tmp11_;
1938
 
                _tmp7_ = *iter;
1939
 
                _tmp8_ = contacts_view_get_header_text (self, &_tmp7_);
1940
 
                header = _tmp8_;
1941
 
                _tmp9_ = cell;
1942
 
                _tmp10_ = header;
1943
 
                g_object_set ((GObject*) _tmp9_, "text", _tmp10_, NULL);
1944
 
                _tmp11_ = header;
1945
 
                if (g_strcmp0 (_tmp11_, "") == 0) {
1946
 
                        GtkCellRenderer* _tmp12_;
1947
 
                        _tmp12_ = cell;
1948
 
                        g_object_set (_tmp12_, "height", 6, NULL);
1949
 
                } else {
1950
 
                        GtkCellRenderer* _tmp13_;
1951
 
                        _tmp13_ = cell;
1952
 
                        g_object_set (_tmp13_, "height", -1, NULL);
1953
 
                }
1954
 
                _g_free0 (header);
1955
 
        }
1956
 
        _g_object_unref0 (contact);
1957
 
}
1958
 
 
1959
 
 
1960
 
static void ___lambda25__gtk_cell_layout_data_func (GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer self) {
1961
 
        __lambda25_ (self, cell_layout, cell, tree_model, iter);
1962
 
}
1963
 
 
1964
 
 
1965
 
static void contacts_view_init_view (ContactsView* self, ContactsViewTextDisplay text_display) {
1966
 
        Block30Data* _data30_;
1967
 
        ContactsViewTextDisplay _tmp0_;
1968
 
        ContactsViewTextDisplay _tmp1_;
1969
 
        GtkListStore* _tmp2_;
1970
 
        gint row_padding;
1971
 
        GtkTreeSelection* _tmp3_ = NULL;
1972
 
        GtkTreeSelection* _tmp4_;
1973
 
        GtkTreeSelection* selection;
1974
 
        GtkTreeViewColumn* _tmp5_;
1975
 
        GtkTreeViewColumn* _tmp6_;
1976
 
        GtkTreeViewColumn* column;
1977
 
        GtkCellRendererPixbuf* _tmp7_;
1978
 
        GtkCellRendererPixbuf* _tmp8_;
1979
 
        GtkCellRendererPixbuf* icon;
1980
 
        ContactsCellRendererShape* _tmp9_;
1981
 
        ContactsCellRendererShape* _tmp10_;
1982
 
        ContactsCellRendererShape* _tmp11_;
1983
 
        PangoContext* _tmp12_ = NULL;
1984
 
        ContactsCellRendererShape* _tmp13_;
1985
 
        ContactsCellRendererShape* _tmp14_;
1986
 
        ContactsCellRendererShape* _tmp15_;
1987
 
        GtkCellRendererText* _tmp16_;
1988
 
        GtkCellRendererText* _tmp17_;
1989
 
        GtkCellRendererText* text;
1990
 
        g_return_if_fail (self != NULL);
1991
 
        _data30_ = g_slice_new0 (Block30Data);
1992
 
        _data30_->_ref_count_ = 1;
1993
 
        _data30_->self = g_object_ref (self);
1994
 
        _tmp0_ = text_display;
1995
 
        _data30_->text_display = _tmp0_;
1996
 
        _tmp1_ = _data30_->text_display;
1997
 
        self->priv->text_display = _tmp1_;
1998
 
        _tmp2_ = self->priv->list_store;
1999
 
        gtk_tree_view_set_model ((GtkTreeView*) self, (GtkTreeModel*) _tmp2_);
2000
 
        gtk_tree_view_set_headers_visible ((GtkTreeView*) self, FALSE);
2001
 
        row_padding = 12;
2002
 
        _tmp3_ = gtk_tree_view_get_selection ((GtkTreeView*) self);
2003
 
        _tmp4_ = _g_object_ref0 (_tmp3_);
2004
 
        selection = _tmp4_;
2005
 
        gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
2006
 
        gtk_tree_selection_set_select_function (selection, ___lambda22__gtk_tree_selection_func, g_object_ref (self), g_object_unref);
2007
 
        g_signal_connect_object (selection, "changed", (GCallback) _contacts_view_contacts_selection_changed_gtk_tree_selection_changed, self, 0);
2008
 
        _tmp5_ = gtk_tree_view_column_new ();
2009
 
        _tmp6_ = g_object_ref_sink (_tmp5_);
2010
 
        column = _tmp6_;
2011
 
        gtk_tree_view_column_set_spacing (column, 8);
2012
 
        _tmp7_ = (GtkCellRendererPixbuf*) gtk_cell_renderer_pixbuf_new ();
2013
 
        _tmp8_ = g_object_ref_sink (_tmp7_);
2014
 
        icon = _tmp8_;
2015
 
        gtk_cell_renderer_set_padding ((GtkCellRenderer*) icon, 0, row_padding);
2016
 
        g_object_set ((GtkCellRenderer*) icon, "xalign", 1.0f, NULL);
2017
 
        g_object_set ((GtkCellRenderer*) icon, "yalign", 0.0f, NULL);
2018
 
        g_object_set ((GtkCellRenderer*) icon, "width", CONTACTS_CONTACT_SMALL_AVATAR_SIZE + 12, NULL);
2019
 
        gtk_cell_layout_pack_start ((GtkCellLayout*) column, (GtkCellRenderer*) icon, FALSE);
2020
 
        gtk_cell_layout_set_cell_data_func ((GtkCellLayout*) column, (GtkCellRenderer*) icon, ___lambda23__gtk_cell_layout_data_func, g_object_ref (self), g_object_unref);
2021
 
        _tmp9_ = contacts_cell_renderer_shape_new ();
2022
 
        _tmp10_ = g_object_ref_sink (_tmp9_);
2023
 
        _g_object_unref0 (self->priv->shape);
2024
 
        self->priv->shape = _tmp10_;
2025
 
        _tmp11_ = self->priv->shape;
2026
 
        gtk_cell_renderer_set_padding ((GtkCellRenderer*) _tmp11_, 0, row_padding);
2027
 
        _tmp12_ = gtk_widget_get_pango_context ((GtkWidget*) self);
2028
 
        _tmp13_ = self->priv->shape;
2029
 
        pango_cairo_context_set_shape_renderer (_tmp12_, _contacts_cell_renderer_shape_render_shape_pango_cairo_shape_renderer_func, g_object_ref (_tmp13_), g_object_unref);
2030
 
        _tmp14_ = self->priv->shape;
2031
 
        gtk_cell_layout_pack_start ((GtkCellLayout*) column, (GtkCellRenderer*) _tmp14_, TRUE);
2032
 
        _tmp15_ = self->priv->shape;
2033
 
        gtk_cell_layout_set_cell_data_func ((GtkCellLayout*) column, (GtkCellRenderer*) _tmp15_, ___lambda24__gtk_cell_layout_data_func, block30_data_ref (_data30_), block30_data_unref);
2034
 
        _tmp16_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
2035
 
        _tmp17_ = g_object_ref_sink (_tmp16_);
2036
 
        text = _tmp17_;
2037
 
        gtk_cell_renderer_set_alignment ((GtkCellRenderer*) text, (gfloat) 0, (gfloat) 0);
2038
 
        gtk_cell_layout_pack_start ((GtkCellLayout*) column, (GtkCellRenderer*) text, TRUE);
2039
 
        g_object_set ((GObject*) text, "weight", PANGO_WEIGHT_BOLD, NULL);
2040
 
        gtk_cell_layout_set_cell_data_func ((GtkCellLayout*) column, (GtkCellRenderer*) text, ___lambda25__gtk_cell_layout_data_func, g_object_ref (self), g_object_unref);
2041
 
        gtk_tree_view_append_column ((GtkTreeView*) self, column);
2042
 
        _g_object_unref0 (text);
2043
 
        _g_object_unref0 (icon);
2044
 
        _g_object_unref0 (column);
2045
 
        _g_object_unref0 (selection);
2046
 
        block30_data_unref (_data30_);
2047
 
        _data30_ = NULL;
2048
 
}
2049
 
 
2050
 
 
2051
 
static void contacts_view_contacts_selection_changed (ContactsView* self, GtkTreeSelection* selection) {
2052
 
        GtkTreeIter iter = {0};
2053
 
        GtkTreeModel* model = NULL;
2054
 
        ContactsContact* contact;
2055
 
        GtkTreeSelection* _tmp0_;
2056
 
        GtkTreeModel* _tmp1_ = NULL;
2057
 
        GtkTreeIter _tmp2_ = {0};
2058
 
        gboolean _tmp3_ = FALSE;
2059
 
        GtkTreeModel* _tmp4_;
2060
 
        ContactsContact* _tmp7_;
2061
 
        g_return_if_fail (self != NULL);
2062
 
        g_return_if_fail (selection != NULL);
2063
 
        contact = NULL;
2064
 
        _tmp0_ = selection;
2065
 
        _tmp3_ = gtk_tree_selection_get_selected (_tmp0_, &_tmp1_, &_tmp2_);
2066
 
        _g_object_unref0 (model);
2067
 
        _tmp4_ = _g_object_ref0 (_tmp1_);
2068
 
        model = _tmp4_;
2069
 
        iter = _tmp2_;
2070
 
        if (_tmp3_) {
2071
 
                GtkTreeModel* _tmp5_;
2072
 
                GtkTreeIter _tmp6_;
2073
 
                _tmp5_ = model;
2074
 
                _tmp6_ = iter;
2075
 
                gtk_tree_model_get (_tmp5_, &_tmp6_, 0, &contact, -1);
2076
 
        }
2077
 
        _tmp7_ = contact;
2078
 
        g_signal_emit_by_name (self, "selection-changed", _tmp7_);
2079
 
        _g_object_unref0 (contact);
2080
 
        _g_object_unref0 (model);
 
1413
                        gchar* _tmp22_;
 
1414
                        GtkLabel* _tmp23_;
 
1415
                        GtkLabel* _tmp24_;
 
1416
                        GtkWidget* _tmp25_;
 
1417
                        _tmp17_ = (GtkLabel*) gtk_label_new ("");
 
1418
                        g_object_ref_sink (_tmp17_);
 
1419
                        l = _tmp17_;
 
1420
                        _tmp18_ = l;
 
1421
                        g_object_set_data_full ((GObject*) _tmp18_, "contacts-suggestions-header", (gpointer) ((gintptr) TRUE), NULL);
 
1422
                        _tmp19_ = l;
 
1423
                        _tmp20_ = _ ("Suggestions");
 
1424
                        _tmp21_ = g_markup_printf_escaped ("<b>%s</b>", _tmp20_);
 
1425
                        _tmp22_ = _tmp21_;
 
1426
                        gtk_label_set_markup (_tmp19_, _tmp22_);
 
1427
                        _g_free0 (_tmp22_);
 
1428
                        _tmp23_ = l;
 
1429
                        gtk_widget_set_halign ((GtkWidget*) _tmp23_, GTK_ALIGN_START);
 
1430
                        _tmp24_ = l;
 
1431
                        _tmp25_ = _g_object_ref0 ((GtkWidget*) _tmp24_);
 
1432
                        _g_object_unref0 (*separator);
 
1433
                        *separator = _tmp25_;
 
1434
                        _g_object_unref0 (l);
 
1435
                }
 
1436
                _contacts_view_contact_data_unref0 (before_data);
 
1437
                _contacts_view_contact_data_unref0 (w_data);
 
1438
                return;
 
1439
        }
 
1440
        _tmp28_ = before_data;
 
1441
        if (_tmp28_ != NULL) {
 
1442
                ContactsViewContactData* _tmp29_;
 
1443
                gint _tmp30_;
 
1444
                _tmp29_ = before_data;
 
1445
                _tmp30_ = _tmp29_->sort_prio;
 
1446
                _tmp27_ = _tmp30_ > 0;
 
1447
        } else {
 
1448
                _tmp27_ = FALSE;
 
1449
        }
 
1450
        _tmp31_ = _tmp27_;
 
1451
        if (_tmp31_) {
 
1452
                ContactsViewContactData* _tmp32_;
 
1453
                gint _tmp33_;
 
1454
                _tmp32_ = w_data;
 
1455
                _tmp33_ = _tmp32_->sort_prio;
 
1456
                _tmp26_ = _tmp33_ == 0;
 
1457
        } else {
 
1458
                _tmp26_ = FALSE;
 
1459
        }
 
1460
        _tmp34_ = _tmp26_;
 
1461
        if (_tmp34_) {
 
1462
                gboolean _tmp35_ = FALSE;
 
1463
                GtkWidget* _tmp36_;
 
1464
                gboolean _tmp39_;
 
1465
                _tmp36_ = *separator;
 
1466
                if (_tmp36_ == NULL) {
 
1467
                        _tmp35_ = TRUE;
 
1468
                } else {
 
1469
                        GtkWidget* _tmp37_;
 
1470
                        gconstpointer _tmp38_ = NULL;
 
1471
                        _tmp37_ = *separator;
 
1472
                        _tmp38_ = g_object_get_data ((GObject*) _tmp37_, "contacts-rest-header");
 
1473
                        _tmp35_ = !((gboolean) ((gintptr) _tmp38_));
 
1474
                }
 
1475
                _tmp39_ = _tmp35_;
 
1476
                if (_tmp39_) {
 
1477
                        GtkLabel* _tmp40_;
 
1478
                        GtkLabel* l;
 
1479
                        GtkLabel* _tmp41_;
 
1480
                        GtkLabel* _tmp42_;
 
1481
                        GtkLabel* _tmp43_;
 
1482
                        GtkWidget* _tmp44_;
 
1483
                        _tmp40_ = (GtkLabel*) gtk_label_new ("");
 
1484
                        g_object_ref_sink (_tmp40_);
 
1485
                        l = _tmp40_;
 
1486
                        _tmp41_ = l;
 
1487
                        g_object_set_data_full ((GObject*) _tmp41_, "contacts-rest-header", (gpointer) ((gintptr) TRUE), NULL);
 
1488
                        _tmp42_ = l;
 
1489
                        gtk_widget_set_halign ((GtkWidget*) _tmp42_, GTK_ALIGN_START);
 
1490
                        _tmp43_ = l;
 
1491
                        _tmp44_ = _g_object_ref0 ((GtkWidget*) _tmp43_);
 
1492
                        _g_object_unref0 (*separator);
 
1493
                        *separator = _tmp44_;
 
1494
                        _g_object_unref0 (l);
 
1495
                }
 
1496
                _contacts_view_contact_data_unref0 (before_data);
 
1497
                _contacts_view_contact_data_unref0 (w_data);
 
1498
                return;
 
1499
        }
 
1500
        _tmp46_ = w_data;
 
1501
        _tmp47_ = contacts_view_is_other (self, _tmp46_);
 
1502
        if (_tmp47_) {
 
1503
                gboolean _tmp48_ = FALSE;
 
1504
                ContactsViewContactData* _tmp49_;
 
1505
                gboolean _tmp52_;
 
1506
                _tmp49_ = before_data;
 
1507
                if (_tmp49_ == NULL) {
 
1508
                        _tmp48_ = TRUE;
 
1509
                } else {
 
1510
                        ContactsViewContactData* _tmp50_;
 
1511
                        gboolean _tmp51_ = FALSE;
 
1512
                        _tmp50_ = before_data;
 
1513
                        _tmp51_ = contacts_view_is_other (self, _tmp50_);
 
1514
                        _tmp48_ = !_tmp51_;
 
1515
                }
 
1516
                _tmp52_ = _tmp48_;
 
1517
                _tmp45_ = _tmp52_;
 
1518
        } else {
 
1519
                _tmp45_ = FALSE;
 
1520
        }
 
1521
        _tmp53_ = _tmp45_;
 
1522
        if (_tmp53_) {
 
1523
                gboolean _tmp54_ = FALSE;
 
1524
                GtkWidget* _tmp55_;
 
1525
                gboolean _tmp58_;
 
1526
                _tmp55_ = *separator;
 
1527
                if (_tmp55_ == NULL) {
 
1528
                        _tmp54_ = TRUE;
 
1529
                } else {
 
1530
                        GtkWidget* _tmp56_;
 
1531
                        gconstpointer _tmp57_ = NULL;
 
1532
                        _tmp56_ = *separator;
 
1533
                        _tmp57_ = g_object_get_data ((GObject*) _tmp56_, "contacts-other-header");
 
1534
                        _tmp54_ = !((gboolean) ((gintptr) _tmp57_));
 
1535
                }
 
1536
                _tmp58_ = _tmp54_;
 
1537
                if (_tmp58_) {
 
1538
                        GtkLabel* _tmp59_;
 
1539
                        GtkLabel* l;
 
1540
                        GtkLabel* _tmp60_;
 
1541
                        GtkLabel* _tmp61_;
 
1542
                        const gchar* _tmp62_ = NULL;
 
1543
                        gchar* _tmp63_ = NULL;
 
1544
                        gchar* _tmp64_;
 
1545
                        GtkLabel* _tmp65_;
 
1546
                        GtkLabel* _tmp66_;
 
1547
                        GtkWidget* _tmp67_;
 
1548
                        _tmp59_ = (GtkLabel*) gtk_label_new ("");
 
1549
                        g_object_ref_sink (_tmp59_);
 
1550
                        l = _tmp59_;
 
1551
                        _tmp60_ = l;
 
1552
                        g_object_set_data_full ((GObject*) _tmp60_, "contacts-other-header", (gpointer) ((gintptr) TRUE), NULL);
 
1553
                        _tmp61_ = l;
 
1554
                        _tmp62_ = _ ("Other Contacts");
 
1555
                        _tmp63_ = g_markup_printf_escaped ("<b>%s</b>", _tmp62_);
 
1556
                        _tmp64_ = _tmp63_;
 
1557
                        gtk_label_set_markup (_tmp61_, _tmp64_);
 
1558
                        _g_free0 (_tmp64_);
 
1559
                        _tmp65_ = l;
 
1560
                        gtk_widget_set_halign ((GtkWidget*) _tmp65_, GTK_ALIGN_START);
 
1561
                        _tmp66_ = l;
 
1562
                        _tmp67_ = _g_object_ref0 ((GtkWidget*) _tmp66_);
 
1563
                        _g_object_unref0 (*separator);
 
1564
                        *separator = _tmp67_;
 
1565
                        _g_object_unref0 (l);
 
1566
                }
 
1567
                _contacts_view_contact_data_unref0 (before_data);
 
1568
                _contacts_view_contact_data_unref0 (w_data);
 
1569
                return;
 
1570
        }
 
1571
        _tmp68_ = before_data;
 
1572
        if (_tmp68_ != NULL) {
 
1573
                gboolean _tmp69_ = FALSE;
 
1574
                GtkWidget* _tmp70_;
 
1575
                gboolean _tmp72_;
 
1576
                _tmp70_ = *separator;
 
1577
                if (_tmp70_ == NULL) {
 
1578
                        _tmp69_ = TRUE;
 
1579
                } else {
 
1580
                        GtkWidget* _tmp71_;
 
1581
                        _tmp71_ = *separator;
 
1582
                        _tmp69_ = !G_TYPE_CHECK_INSTANCE_TYPE (_tmp71_, GTK_TYPE_SEPARATOR);
 
1583
                }
 
1584
                _tmp72_ = _tmp69_;
 
1585
                if (_tmp72_) {
 
1586
                        GtkSeparator* _tmp73_;
 
1587
                        _tmp73_ = (GtkSeparator*) gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
 
1588
                        g_object_ref_sink (_tmp73_);
 
1589
                        _g_object_unref0 (*separator);
 
1590
                        *separator = (GtkWidget*) _tmp73_;
 
1591
                }
 
1592
                _contacts_view_contact_data_unref0 (before_data);
 
1593
                _contacts_view_contact_data_unref0 (w_data);
 
1594
                return;
 
1595
        }
 
1596
        _g_object_unref0 (*separator);
 
1597
        *separator = NULL;
 
1598
        _contacts_view_contact_data_unref0 (before_data);
 
1599
        _contacts_view_contact_data_unref0 (w_data);
2081
1600
}
2082
1601
 
2083
1602
 
2084
1603
void contacts_view_select_contact (ContactsView* self, ContactsContact* contact) {
2085
 
        GtkTreeIter iter = {0};
2086
1604
        ContactsContact* _tmp0_;
2087
 
        GtkTreeIter _tmp1_ = {0};
2088
 
        gboolean _tmp2_ = FALSE;
 
1605
        GeeHashMap* _tmp1_;
 
1606
        ContactsContact* _tmp2_;
 
1607
        gpointer _tmp3_ = NULL;
 
1608
        ContactsViewContactData* data;
 
1609
        ContactsViewContactData* _tmp4_;
 
1610
        GtkGrid* _tmp5_;
2089
1611
        g_return_if_fail (self != NULL);
2090
 
        g_return_if_fail (contact != NULL);
2091
1612
        _tmp0_ = contact;
2092
 
        _tmp2_ = contacts_view_lookup_iter (self, _tmp0_, &_tmp1_);
2093
 
        iter = _tmp1_;
2094
 
        if (_tmp2_) {
2095
 
                GtkTreeSelection* _tmp3_ = NULL;
2096
 
                GtkTreeIter _tmp4_;
2097
 
                GtkListStore* _tmp5_;
2098
 
                GtkTreeIter _tmp6_;
2099
 
                GtkTreePath* _tmp7_ = NULL;
2100
 
                GtkTreePath* _tmp8_;
2101
 
                _tmp3_ = gtk_tree_view_get_selection ((GtkTreeView*) self);
2102
 
                _tmp4_ = iter;
2103
 
                gtk_tree_selection_select_iter (_tmp3_, &_tmp4_);
2104
 
                _tmp5_ = self->priv->list_store;
2105
 
                _tmp6_ = iter;
2106
 
                _tmp7_ = gtk_tree_model_get_path ((GtkTreeModel*) _tmp5_, &_tmp6_);
2107
 
                _tmp8_ = _tmp7_;
2108
 
                gtk_tree_view_scroll_to_cell ((GtkTreeView*) self, _tmp8_, NULL, TRUE, 0.0f, 0.0f);
2109
 
                _gtk_tree_path_free0 (_tmp8_);
2110
 
        }
 
1613
        if (_tmp0_ == NULL) {
 
1614
                egg_list_box_select_child ((EggListBox*) self, NULL);
 
1615
                return;
 
1616
        }
 
1617
        _tmp1_ = self->priv->contacts;
 
1618
        _tmp2_ = contact;
 
1619
        _tmp3_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp1_, _tmp2_);
 
1620
        data = (ContactsViewContactData*) _tmp3_;
 
1621
        _tmp4_ = data;
 
1622
        _tmp5_ = _tmp4_->grid;
 
1623
        egg_list_box_select_child ((EggListBox*) self, (GtkWidget*) _tmp5_);
 
1624
        _contacts_view_contact_data_unref0 (data);
 
1625
}
 
1626
 
 
1627
 
 
1628
void contacts_view_show_selectors (ContactsView* self) {
 
1629
        g_return_if_fail (self != NULL);
 
1630
        {
 
1631
                GeeHashMap* _tmp0_;
 
1632
                GeeCollection* _tmp1_;
 
1633
                GeeCollection* _tmp2_;
 
1634
                GeeCollection* _tmp3_;
 
1635
                GeeIterator* _tmp4_ = NULL;
 
1636
                GeeIterator* _tmp5_;
 
1637
                GeeIterator* _data_it;
 
1638
                _tmp0_ = self->priv->contacts;
 
1639
                _tmp1_ = gee_abstract_map_get_values ((GeeMap*) _tmp0_);
 
1640
                _tmp2_ = _tmp1_;
 
1641
                _tmp3_ = _tmp2_;
 
1642
                _tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
 
1643
                _tmp5_ = _tmp4_;
 
1644
                _g_object_unref0 (_tmp3_);
 
1645
                _data_it = _tmp5_;
 
1646
                while (TRUE) {
 
1647
                        GeeIterator* _tmp6_;
 
1648
                        gboolean _tmp7_ = FALSE;
 
1649
                        GeeIterator* _tmp8_;
 
1650
                        gpointer _tmp9_ = NULL;
 
1651
                        ContactsViewContactData* data;
 
1652
                        ContactsViewContactData* _tmp10_;
 
1653
                        GtkCheckButton* _tmp11_;
 
1654
                        _tmp6_ = _data_it;
 
1655
                        _tmp7_ = gee_iterator_next (_tmp6_);
 
1656
                        if (!_tmp7_) {
 
1657
                                break;
 
1658
                        }
 
1659
                        _tmp8_ = _data_it;
 
1660
                        _tmp9_ = gee_iterator_get (_tmp8_);
 
1661
                        data = (ContactsViewContactData*) _tmp9_;
 
1662
                        _tmp10_ = data;
 
1663
                        _tmp11_ = _tmp10_->selector_button;
 
1664
                        gtk_widget_show ((GtkWidget*) _tmp11_);
 
1665
                        _contacts_view_contact_data_unref0 (data);
 
1666
                }
 
1667
                _g_object_unref0 (_data_it);
 
1668
        }
 
1669
        self->priv->selectors_visible = TRUE;
 
1670
}
 
1671
 
 
1672
 
 
1673
void contacts_view_hide_selectors (ContactsView* self) {
 
1674
        g_return_if_fail (self != NULL);
 
1675
        {
 
1676
                GeeHashMap* _tmp0_;
 
1677
                GeeCollection* _tmp1_;
 
1678
                GeeCollection* _tmp2_;
 
1679
                GeeCollection* _tmp3_;
 
1680
                GeeIterator* _tmp4_ = NULL;
 
1681
                GeeIterator* _tmp5_;
 
1682
                GeeIterator* _data_it;
 
1683
                _tmp0_ = self->priv->contacts;
 
1684
                _tmp1_ = gee_abstract_map_get_values ((GeeMap*) _tmp0_);
 
1685
                _tmp2_ = _tmp1_;
 
1686
                _tmp3_ = _tmp2_;
 
1687
                _tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
 
1688
                _tmp5_ = _tmp4_;
 
1689
                _g_object_unref0 (_tmp3_);
 
1690
                _data_it = _tmp5_;
 
1691
                while (TRUE) {
 
1692
                        GeeIterator* _tmp6_;
 
1693
                        gboolean _tmp7_ = FALSE;
 
1694
                        GeeIterator* _tmp8_;
 
1695
                        gpointer _tmp9_ = NULL;
 
1696
                        ContactsViewContactData* data;
 
1697
                        ContactsViewContactData* _tmp10_;
 
1698
                        GtkCheckButton* _tmp11_;
 
1699
                        ContactsViewContactData* _tmp12_;
 
1700
                        GtkCheckButton* _tmp13_;
 
1701
                        _tmp6_ = _data_it;
 
1702
                        _tmp7_ = gee_iterator_next (_tmp6_);
 
1703
                        if (!_tmp7_) {
 
1704
                                break;
 
1705
                        }
 
1706
                        _tmp8_ = _data_it;
 
1707
                        _tmp9_ = gee_iterator_get (_tmp8_);
 
1708
                        data = (ContactsViewContactData*) _tmp9_;
 
1709
                        _tmp10_ = data;
 
1710
                        _tmp11_ = _tmp10_->selector_button;
 
1711
                        gtk_widget_hide ((GtkWidget*) _tmp11_);
 
1712
                        _tmp12_ = data;
 
1713
                        _tmp13_ = _tmp12_->selector_button;
 
1714
                        gtk_toggle_button_set_active ((GtkToggleButton*) _tmp13_, FALSE);
 
1715
                        _contacts_view_contact_data_unref0 (data);
 
1716
                }
 
1717
                _g_object_unref0 (_data_it);
 
1718
        }
 
1719
        self->priv->selectors_visible = FALSE;
 
1720
        self->priv->nr_contacts_marked = 0;
 
1721
}
 
1722
 
 
1723
 
 
1724
GeeLinkedList* contacts_view_get_marked_contacts (ContactsView* self) {
 
1725
        GeeLinkedList* result = NULL;
 
1726
        GeeLinkedList* _tmp0_;
 
1727
        GeeLinkedList* cs;
 
1728
        g_return_val_if_fail (self != NULL, NULL);
 
1729
        _tmp0_ = gee_linked_list_new (CONTACTS_TYPE_CONTACT, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL);
 
1730
        cs = _tmp0_;
 
1731
        {
 
1732
                GeeHashMap* _tmp1_;
 
1733
                GeeCollection* _tmp2_;
 
1734
                GeeCollection* _tmp3_;
 
1735
                GeeCollection* _tmp4_;
 
1736
                GeeIterator* _tmp5_ = NULL;
 
1737
                GeeIterator* _tmp6_;
 
1738
                GeeIterator* _data_it;
 
1739
                _tmp1_ = self->priv->contacts;
 
1740
                _tmp2_ = gee_abstract_map_get_values ((GeeMap*) _tmp1_);
 
1741
                _tmp3_ = _tmp2_;
 
1742
                _tmp4_ = _tmp3_;
 
1743
                _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
 
1744
                _tmp6_ = _tmp5_;
 
1745
                _g_object_unref0 (_tmp4_);
 
1746
                _data_it = _tmp6_;
 
1747
                while (TRUE) {
 
1748
                        GeeIterator* _tmp7_;
 
1749
                        gboolean _tmp8_ = FALSE;
 
1750
                        GeeIterator* _tmp9_;
 
1751
                        gpointer _tmp10_ = NULL;
 
1752
                        ContactsViewContactData* data;
 
1753
                        ContactsViewContactData* _tmp11_;
 
1754
                        GtkCheckButton* _tmp12_;
 
1755
                        gboolean _tmp13_;
 
1756
                        gboolean _tmp14_;
 
1757
                        _tmp7_ = _data_it;
 
1758
                        _tmp8_ = gee_iterator_next (_tmp7_);
 
1759
                        if (!_tmp8_) {
 
1760
                                break;
 
1761
                        }
 
1762
                        _tmp9_ = _data_it;
 
1763
                        _tmp10_ = gee_iterator_get (_tmp9_);
 
1764
                        data = (ContactsViewContactData*) _tmp10_;
 
1765
                        _tmp11_ = data;
 
1766
                        _tmp12_ = _tmp11_->selector_button;
 
1767
                        _tmp13_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp12_);
 
1768
                        _tmp14_ = _tmp13_;
 
1769
                        if (_tmp14_) {
 
1770
                                GeeLinkedList* _tmp15_;
 
1771
                                ContactsViewContactData* _tmp16_;
 
1772
                                ContactsContact* _tmp17_;
 
1773
                                _tmp15_ = cs;
 
1774
                                _tmp16_ = data;
 
1775
                                _tmp17_ = _tmp16_->contact;
 
1776
                                gee_abstract_collection_add ((GeeAbstractCollection*) _tmp15_, _tmp17_);
 
1777
                        }
 
1778
                        _contacts_view_contact_data_unref0 (data);
 
1779
                }
 
1780
                _g_object_unref0 (_data_it);
 
1781
        }
 
1782
        result = cs;
 
1783
        return result;
2111
1784
}
2112
1785
 
2113
1786
 
2246
1919
 
2247
1920
static void contacts_view_contact_data_finalize (ContactsViewContactData* obj) {
2248
1921
        ContactsViewContactData * self;
2249
 
        self = CONTACTS_VIEW_CONTACT_DATA (obj);
 
1922
        self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONTACTS_VIEW_TYPE_CONTACT_DATA, ContactsViewContactData);
2250
1923
        _g_object_unref0 (self->contact);
 
1924
        _g_object_unref0 (self->grid);
 
1925
        _g_object_unref0 (self->label);
 
1926
        _g_object_unref0 (self->image_frame);
 
1927
        _g_object_unref0 (self->selector_button);
 
1928
        _g_free0 (self->display_name);
2251
1929
}
2252
1930
 
2253
1931
 
2286
1964
static void contacts_view_class_init (ContactsViewClass * klass) {
2287
1965
        contacts_view_parent_class = g_type_class_peek_parent (klass);
2288
1966
        g_type_class_add_private (klass, sizeof (ContactsViewPrivate));
 
1967
        EGG_LIST_BOX_CLASS (klass)->child_selected = contacts_view_real_child_selected;
2289
1968
        G_OBJECT_CLASS (klass)->finalize = contacts_view_finalize;
2290
1969
        g_signal_new ("selection_changed", CONTACTS_TYPE_VIEW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, CONTACTS_TYPE_CONTACT);
 
1970
        g_signal_new ("contacts_marked", CONTACTS_TYPE_VIEW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
2291
1971
}
2292
1972
 
2293
1973
 
2298
1978
 
2299
1979
static void contacts_view_finalize (GObject* obj) {
2300
1980
        ContactsView * self;
2301
 
        self = CONTACTS_VIEW (obj);
 
1981
        self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONTACTS_TYPE_VIEW, ContactsView);
2302
1982
        _g_object_unref0 (self->priv->contacts_store);
2303
 
        _g_object_unref0 (self->priv->list_store);
 
1983
        _g_object_unref0 (self->priv->contacts);
2304
1984
        _g_object_unref0 (self->priv->hidden_contacts);
2305
1985
        self->priv->filter_values = (_vala_array_free (self->priv->filter_values, self->priv->filter_values_length1, (GDestroyNotify) g_free), NULL);
2306
 
        _contacts_view_contact_data_unref0 (self->priv->suggestions_header_data);
2307
 
        _contacts_view_contact_data_unref0 (self->priv->padding_data);
2308
 
        _contacts_view_contact_data_unref0 (self->priv->other_header_data);
2309
 
        _g_object_unref0 (self->priv->shape);
 
1986
        _g_object_unref0 (self->priv->last_selected);
2310
1987
        G_OBJECT_CLASS (contacts_view_parent_class)->finalize (obj);
2311
1988
}
2312
1989
 
2316
1993
        if (g_once_init_enter (&contacts_view_type_id__volatile)) {
2317
1994
                static const GTypeInfo g_define_type_info = { sizeof (ContactsViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) contacts_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ContactsView), 0, (GInstanceInitFunc) contacts_view_instance_init, NULL };
2318
1995
                GType contacts_view_type_id;
2319
 
                contacts_view_type_id = g_type_register_static (GTK_TYPE_TREE_VIEW, "ContactsView", &g_define_type_info, 0);
 
1996
                contacts_view_type_id = g_type_register_static (EGG_TYPE_LIST_BOX, "ContactsView", &g_define_type_info, 0);
2320
1997
                g_once_init_leave (&contacts_view_type_id__volatile, contacts_view_type_id);
2321
1998
        }
2322
1999
        return contacts_view_type_id__volatile;