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

« back to all changes in this revision

Viewing changes to src/contacts-cell-renderer-shape.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-cell-renderer-shape.c generated by valac 0.15.1.23-684b1, the Vala compiler
2
 
 * generated from contacts-cell-renderer-shape.vala, do not modify */
3
 
 
4
 
/* -*- Mode: vala; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 8 -*- */
5
 
/*
6
 
 * Copyright (C) 2011 Alexander Larsson <alexl@redhat.com>
7
 
 *
8
 
 * This program is free software; you can redistribute it and/or modify
9
 
 * it under the terms of the GNU General Public License as published by
10
 
 * the Free Software Foundation; either version 2 of the License, or
11
 
 * (at your option) any later version.
12
 
 *
13
 
 * This program is distributed in the hope that it will be useful,
14
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
 
 * GNU General Public License for more details.
17
 
 *
18
 
 * You should have received a copy of the GNU General Public License
19
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
 
 */
21
 
 
22
 
#include <glib.h>
23
 
#include <glib-object.h>
24
 
#include <gtk/gtk.h>
25
 
#include <stdlib.h>
26
 
#include <string.h>
27
 
#include <folks/folks.h>
28
 
#include <gdk-pixbuf/gdk-pixbuf.h>
29
 
#include <gdk/gdk.h>
30
 
#include <pango/pango.h>
31
 
#include <cairo.h>
32
 
#include <float.h>
33
 
#include <math.h>
34
 
 
35
 
 
36
 
#define CONTACTS_TYPE_CELL_RENDERER_SHAPE (contacts_cell_renderer_shape_get_type ())
37
 
#define CONTACTS_CELL_RENDERER_SHAPE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_CELL_RENDERER_SHAPE, ContactsCellRendererShape))
38
 
#define CONTACTS_CELL_RENDERER_SHAPE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_CELL_RENDERER_SHAPE, ContactsCellRendererShapeClass))
39
 
#define CONTACTS_IS_CELL_RENDERER_SHAPE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_CELL_RENDERER_SHAPE))
40
 
#define CONTACTS_IS_CELL_RENDERER_SHAPE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_CELL_RENDERER_SHAPE))
41
 
#define CONTACTS_CELL_RENDERER_SHAPE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_CELL_RENDERER_SHAPE, ContactsCellRendererShapeClass))
42
 
 
43
 
typedef struct _ContactsCellRendererShape ContactsCellRendererShape;
44
 
typedef struct _ContactsCellRendererShapeClass ContactsCellRendererShapeClass;
45
 
typedef struct _ContactsCellRendererShapePrivate ContactsCellRendererShapePrivate;
46
 
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
47
 
#define _g_free0(var) (var = (g_free (var), NULL))
48
 
#define _gtk_icon_info_free0(var) ((var == NULL) ? NULL : (var = (gtk_icon_info_free (var), NULL)))
49
 
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
50
 
#define _pango_attribute_destroy0(var) ((var == NULL) ? NULL : (var = (pango_attribute_destroy (var), NULL)))
51
 
#define _pango_attr_list_unref0(var) ((var == NULL) ? NULL : (var = (pango_attr_list_unref (var), NULL)))
52
 
 
53
 
#define CONTACTS_CELL_RENDERER_SHAPE_TYPE_ICON_SHAPE (contacts_cell_renderer_shape_icon_shape_get_type ())
54
 
typedef struct _ContactsCellRendererShapeIconShape ContactsCellRendererShapeIconShape;
55
 
 
56
 
struct _ContactsCellRendererShape {
57
 
        GtkCellRenderer parent_instance;
58
 
        ContactsCellRendererShapePrivate * priv;
59
 
};
60
 
 
61
 
struct _ContactsCellRendererShapeClass {
62
 
        GtkCellRendererClass parent_class;
63
 
};
64
 
 
65
 
struct _ContactsCellRendererShapePrivate {
66
 
        GtkWidget* current_widget;
67
 
        gchar* _name;
68
 
        FolksPresenceType _presence;
69
 
        gchar* _message;
70
 
        gboolean _is_phone;
71
 
        gboolean _show_presence;
72
 
        gint renderer_height;
73
 
};
74
 
 
75
 
struct _ContactsCellRendererShapeIconShape {
76
 
        gchar* icon;
77
 
};
78
 
 
79
 
 
80
 
static gpointer contacts_cell_renderer_shape_parent_class = NULL;
81
 
 
82
 
GType contacts_cell_renderer_shape_get_type (void) G_GNUC_CONST;
83
 
#define CONTACTS_CELL_RENDERER_SHAPE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CONTACTS_TYPE_CELL_RENDERER_SHAPE, ContactsCellRendererShapePrivate))
84
 
enum  {
85
 
        CONTACTS_CELL_RENDERER_SHAPE_DUMMY_PROPERTY,
86
 
        CONTACTS_CELL_RENDERER_SHAPE_NAME,
87
 
        CONTACTS_CELL_RENDERER_SHAPE_PRESENCE,
88
 
        CONTACTS_CELL_RENDERER_SHAPE_MESSAGE,
89
 
        CONTACTS_CELL_RENDERER_SHAPE_IS_PHONE,
90
 
        CONTACTS_CELL_RENDERER_SHAPE_SHOW_PRESENCE
91
 
};
92
 
#define CONTACTS_CONTACT_SMALL_AVATAR_SIZE 54
93
 
#define CONTACTS_CELL_RENDERER_SHAPE_IMAGE_SIZE 14
94
 
#define CONTACTS_CELL_RENDERER_SHAPE_default_width 60
95
 
static GdkPixbuf* contacts_cell_renderer_shape_create_symbolic_pixbuf (ContactsCellRendererShape* self, GtkWidget* widget, const gchar* icon_name, gint size);
96
 
static PangoLayout* contacts_cell_renderer_shape_get_name_layout (ContactsCellRendererShape* self, GtkWidget* widget, GdkRectangle* cell_area, GtkCellRendererState flags);
97
 
const gchar* contacts_cell_renderer_shape_get_name (ContactsCellRendererShape* self);
98
 
static PangoLayout* contacts_cell_renderer_shape_get_presence_layout (ContactsCellRendererShape* self, GtkWidget* widget, GdkRectangle* cell_area, GtkCellRendererState flags);
99
 
gchar* contacts_contact_presence_to_icon (FolksPresenceType presence);
100
 
FolksPresenceType contacts_cell_renderer_shape_get_presence (ContactsCellRendererShape* self);
101
 
gboolean contacts_cell_renderer_shape_get_show_presence (ContactsCellRendererShape* self);
102
 
static GType contacts_cell_renderer_shape_icon_shape_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
103
 
static ContactsCellRendererShapeIconShape* contacts_cell_renderer_shape_icon_shape_dup (const ContactsCellRendererShapeIconShape* self);
104
 
static void contacts_cell_renderer_shape_icon_shape_free (ContactsCellRendererShapeIconShape* self);
105
 
static void contacts_cell_renderer_shape_icon_shape_copy (const ContactsCellRendererShapeIconShape* self, ContactsCellRendererShapeIconShape* dest);
106
 
static void contacts_cell_renderer_shape_icon_shape_destroy (ContactsCellRendererShapeIconShape* self);
107
 
static ContactsCellRendererShapeIconShape* ___lambda19_ (ContactsCellRendererShapeIconShape* s);
108
 
static gpointer ____lambda19__pango_attr_data_copy_func (gconstpointer data);
109
 
static void _contacts_cell_renderer_shape_icon_shape_free0_ (gpointer var);
110
 
const gchar* contacts_cell_renderer_shape_get_message (ContactsCellRendererShape* self);
111
 
gchar* contacts_contact_presence_to_string (FolksPresenceType presence);
112
 
gboolean contacts_cell_renderer_shape_get_is_phone (ContactsCellRendererShape* self);
113
 
static ContactsCellRendererShapeIconShape* ____lambda20_ (ContactsCellRendererShapeIconShape* s);
114
 
static gpointer _____lambda20__pango_attr_data_copy_func (gconstpointer data);
115
 
static void contacts_cell_renderer_shape_real_get_size (GtkCellRenderer* base, GtkWidget* widget, GdkRectangle* cell_area, gint* x_offset, gint* y_offset, gint* width, gint* height);
116
 
static void contacts_cell_renderer_shape_do_get_size (ContactsCellRendererShape* self, GtkWidget* widget, GdkRectangle* cell_area, PangoLayout* layout, gint* x_offset, gint* y_offset);
117
 
static void contacts_cell_renderer_shape_real_render (GtkCellRenderer* base, cairo_t* cr, GtkWidget* widget, GdkRectangle* background_area, GdkRectangle* cell_area, GtkCellRendererState flags);
118
 
static void contacts_cell_renderer_shape_real_get_preferred_width (GtkCellRenderer* base, GtkWidget* widget, gint* min_width, gint* nat_width);
119
 
static void contacts_cell_renderer_shape_real_get_preferred_height_for_width (GtkCellRenderer* base, GtkWidget* widget, gint width, gint* minimum_height, gint* natural_height);
120
 
static void contacts_cell_renderer_shape_real_get_preferred_height (GtkCellRenderer* base, GtkWidget* widget, gint* minimum_size, gint* natural_size);
121
 
void contacts_cell_renderer_shape_render_shape (ContactsCellRendererShape* self, cairo_t* cr, PangoAttrShape* attr, gboolean do_path);
122
 
ContactsCellRendererShape* contacts_cell_renderer_shape_new (void);
123
 
ContactsCellRendererShape* contacts_cell_renderer_shape_construct (GType object_type);
124
 
void contacts_cell_renderer_shape_set_name (ContactsCellRendererShape* self, const gchar* value);
125
 
void contacts_cell_renderer_shape_set_presence (ContactsCellRendererShape* self, FolksPresenceType value);
126
 
void contacts_cell_renderer_shape_set_message (ContactsCellRendererShape* self, const gchar* value);
127
 
void contacts_cell_renderer_shape_set_is_phone (ContactsCellRendererShape* self, gboolean value);
128
 
void contacts_cell_renderer_shape_set_show_presence (ContactsCellRendererShape* self, gboolean value);
129
 
static void contacts_cell_renderer_shape_finalize (GObject* obj);
130
 
static void _vala_contacts_cell_renderer_shape_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
131
 
static void _vala_contacts_cell_renderer_shape_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
132
 
 
133
 
 
134
 
static gpointer _g_object_ref0 (gpointer self) {
135
 
        return self ? g_object_ref (self) : NULL;
136
 
}
137
 
 
138
 
 
139
 
static GdkPixbuf* contacts_cell_renderer_shape_create_symbolic_pixbuf (ContactsCellRendererShape* self, GtkWidget* widget, const gchar* icon_name, gint size) {
140
 
        GdkPixbuf* result = NULL;
141
 
        GtkWidget* _tmp0_;
142
 
        GdkScreen* _tmp1_ = NULL;
143
 
        GdkScreen* _tmp2_;
144
 
        GdkScreen* screen;
145
 
        GdkScreen* _tmp3_;
146
 
        GtkIconTheme* _tmp4_ = NULL;
147
 
        GtkIconTheme* _tmp5_;
148
 
        GtkIconTheme* icon_theme;
149
 
        GtkIconTheme* _tmp6_;
150
 
        const gchar* _tmp7_;
151
 
        gint _tmp8_;
152
 
        GtkIconInfo* _tmp9_ = NULL;
153
 
        GtkIconInfo* info;
154
 
        GtkIconInfo* _tmp10_;
155
 
        GtkWidget* _tmp11_;
156
 
        GtkStyleContext* _tmp12_ = NULL;
157
 
        GtkStyleContext* _tmp13_;
158
 
        GtkStyleContext* context;
159
 
        GtkStyleContext* _tmp14_;
160
 
        gboolean is_symbolic = FALSE;
161
 
        GdkPixbuf* pixbuf;
162
 
        GtkStyleContext* _tmp20_;
163
 
        GError * _inner_error_ = NULL;
164
 
        g_return_val_if_fail (self != NULL, NULL);
165
 
        g_return_val_if_fail (widget != NULL, NULL);
166
 
        g_return_val_if_fail (icon_name != NULL, NULL);
167
 
        _tmp0_ = widget;
168
 
        _tmp1_ = gtk_widget_get_screen (_tmp0_);
169
 
        _tmp2_ = _g_object_ref0 (_tmp1_);
170
 
        screen = _tmp2_;
171
 
        _tmp3_ = screen;
172
 
        _tmp4_ = gtk_icon_theme_get_for_screen (_tmp3_);
173
 
        _tmp5_ = _g_object_ref0 (_tmp4_);
174
 
        icon_theme = _tmp5_;
175
 
        _tmp6_ = icon_theme;
176
 
        _tmp7_ = icon_name;
177
 
        _tmp8_ = size;
178
 
        _tmp9_ = gtk_icon_theme_lookup_icon (_tmp6_, _tmp7_, _tmp8_, GTK_ICON_LOOKUP_USE_BUILTIN);
179
 
        info = _tmp9_;
180
 
        _tmp10_ = info;
181
 
        if (_tmp10_ == NULL) {
182
 
                result = NULL;
183
 
                _gtk_icon_info_free0 (info);
184
 
                _g_object_unref0 (icon_theme);
185
 
                _g_object_unref0 (screen);
186
 
                return result;
187
 
        }
188
 
        _tmp11_ = widget;
189
 
        _tmp12_ = gtk_widget_get_style_context (_tmp11_);
190
 
        _tmp13_ = _g_object_ref0 (_tmp12_);
191
 
        context = _tmp13_;
192
 
        _tmp14_ = context;
193
 
        gtk_style_context_save (_tmp14_);
194
 
        pixbuf = NULL;
195
 
        {
196
 
                GtkIconInfo* _tmp15_;
197
 
                GtkStyleContext* _tmp16_;
198
 
                gboolean _tmp17_ = FALSE;
199
 
                GdkPixbuf* _tmp18_ = NULL;
200
 
                GdkPixbuf* _tmp19_;
201
 
                _tmp15_ = info;
202
 
                _tmp16_ = context;
203
 
                _tmp18_ = gtk_icon_info_load_symbolic_for_context (_tmp15_, _tmp16_, &_tmp17_, &_inner_error_);
204
 
                is_symbolic = _tmp17_;
205
 
                _tmp19_ = _tmp18_;
206
 
                if (_inner_error_ != NULL) {
207
 
                        goto __catch3_g_error;
208
 
                }
209
 
                _g_object_unref0 (pixbuf);
210
 
                pixbuf = _tmp19_;
211
 
        }
212
 
        goto __finally3;
213
 
        __catch3_g_error:
214
 
        {
215
 
                GError* e = NULL;
216
 
                e = _inner_error_;
217
 
                _inner_error_ = NULL;
218
 
                _g_error_free0 (e);
219
 
        }
220
 
        __finally3:
221
 
        if (_inner_error_ != NULL) {
222
 
                _g_object_unref0 (pixbuf);
223
 
                _g_object_unref0 (context);
224
 
                _gtk_icon_info_free0 (info);
225
 
                _g_object_unref0 (icon_theme);
226
 
                _g_object_unref0 (screen);
227
 
                g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
228
 
                g_clear_error (&_inner_error_);
229
 
                return NULL;
230
 
        }
231
 
        _tmp20_ = context;
232
 
        gtk_style_context_restore (_tmp20_);
233
 
        result = pixbuf;
234
 
        _g_object_unref0 (context);
235
 
        _gtk_icon_info_free0 (info);
236
 
        _g_object_unref0 (icon_theme);
237
 
        _g_object_unref0 (screen);
238
 
        return result;
239
 
}
240
 
 
241
 
 
242
 
static PangoLayout* contacts_cell_renderer_shape_get_name_layout (ContactsCellRendererShape* self, GtkWidget* widget, GdkRectangle* cell_area, GtkCellRendererState flags) {
243
 
        PangoLayout* result = NULL;
244
 
        PangoLayout* layout = NULL;
245
 
        gint xpad = 0;
246
 
        PangoAttrList* _tmp0_;
247
 
        PangoAttrList* attr_list;
248
 
        GtkWidget* _tmp1_;
249
 
        const gchar* _tmp2_;
250
 
        PangoLayout* _tmp3_ = NULL;
251
 
        PangoAttrSize* _tmp4_;
252
 
        PangoAttrSize* attr;
253
 
        PangoAttrSize* _tmp5_;
254
 
        PangoAttrSize* _tmp6_;
255
 
        PangoAttrSize* _tmp7_;
256
 
        PangoAttrSize* _tmp8_;
257
 
        guint _tmp9_;
258
 
        const gchar* _tmp10_;
259
 
        gint _tmp11_;
260
 
        gint _tmp12_;
261
 
        PangoAttrList* _tmp13_;
262
 
        PangoAttrSize* _tmp14_;
263
 
        PangoLayout* _tmp15_;
264
 
        PangoAttrList* _tmp16_;
265
 
        gint _tmp17_ = 0;
266
 
        PangoLayout* _tmp18_;
267
 
        PangoRectangle rect = {0};
268
 
        gint width = 0;
269
 
        gint text_width = 0;
270
 
        PangoLayout* _tmp19_;
271
 
        PangoRectangle _tmp20_ = {0};
272
 
        PangoRectangle _tmp21_;
273
 
        gint _tmp22_;
274
 
        GdkRectangle* _tmp23_;
275
 
        gint _tmp27_;
276
 
        gint _tmp28_;
277
 
        gint _tmp29_ = 0;
278
 
        PangoLayout* _tmp30_;
279
 
        gint _tmp31_;
280
 
        PangoLayout* _tmp32_;
281
 
        PangoLayout* _tmp33_;
282
 
        PangoAlignment align = 0;
283
 
        GtkWidget* _tmp34_;
284
 
        GtkTextDirection _tmp35_ = 0;
285
 
        PangoLayout* _tmp36_;
286
 
        PangoAlignment _tmp37_;
287
 
        g_return_val_if_fail (self != NULL, NULL);
288
 
        g_return_val_if_fail (widget != NULL, NULL);
289
 
        _tmp0_ = pango_attr_list_new ();
290
 
        attr_list = _tmp0_;
291
 
        _tmp1_ = widget;
292
 
        _tmp2_ = self->priv->_name;
293
 
        _tmp3_ = gtk_widget_create_pango_layout (_tmp1_, _tmp2_);
294
 
        _g_object_unref0 (layout);
295
 
        layout = _tmp3_;
296
 
        _tmp4_ = (PangoAttrSize*) pango_attr_size_new (13 * PANGO_SCALE);
297
 
        attr = _tmp4_;
298
 
        _tmp5_ = attr;
299
 
        _tmp5_->absolute = (guint) 1;
300
 
        _tmp6_ = attr;
301
 
        ((PangoAttribute*) _tmp6_)->start_index = (guint) 0;
302
 
        _tmp7_ = attr;
303
 
        _tmp8_ = attr;
304
 
        _tmp9_ = ((PangoAttribute*) _tmp8_)->start_index;
305
 
        _tmp10_ = self->priv->_name;
306
 
        _tmp11_ = strlen (_tmp10_);
307
 
        _tmp12_ = _tmp11_;
308
 
        ((PangoAttribute*) _tmp7_)->end_index = _tmp9_ + _tmp12_;
309
 
        _tmp13_ = attr_list;
310
 
        _tmp14_ = attr;
311
 
        attr = NULL;
312
 
        pango_attr_list_insert (_tmp13_, (PangoAttribute*) _tmp14_);
313
 
        _tmp15_ = layout;
314
 
        _tmp16_ = attr_list;
315
 
        pango_layout_set_attributes (_tmp15_, _tmp16_);
316
 
        gtk_cell_renderer_get_padding ((GtkCellRenderer*) self, &_tmp17_, NULL);
317
 
        xpad = _tmp17_;
318
 
        _tmp18_ = layout;
319
 
        pango_layout_set_ellipsize (_tmp18_, PANGO_ELLIPSIZE_END);
320
 
        _tmp19_ = layout;
321
 
        pango_layout_get_extents (_tmp19_, NULL, &_tmp20_);
322
 
        rect = _tmp20_;
323
 
        _tmp21_ = rect;
324
 
        _tmp22_ = _tmp21_.width;
325
 
        text_width = _tmp22_;
326
 
        _tmp23_ = cell_area;
327
 
        if (_tmp23_ != NULL) {
328
 
                GdkRectangle* _tmp24_;
329
 
                gint _tmp25_;
330
 
                gint _tmp26_;
331
 
                _tmp24_ = cell_area;
332
 
                _tmp25_ = (*_tmp24_).width;
333
 
                _tmp26_ = xpad;
334
 
                width = (_tmp25_ - _tmp26_) * PANGO_SCALE;
335
 
        } else {
336
 
                width = CONTACTS_CELL_RENDERER_SHAPE_default_width * PANGO_SCALE;
337
 
        }
338
 
        _tmp27_ = width;
339
 
        _tmp28_ = text_width;
340
 
        _tmp29_ = MIN (_tmp27_, _tmp28_);
341
 
        width = _tmp29_;
342
 
        _tmp30_ = layout;
343
 
        _tmp31_ = width;
344
 
        pango_layout_set_width (_tmp30_, _tmp31_);
345
 
        _tmp32_ = layout;
346
 
        pango_layout_set_wrap (_tmp32_, PANGO_WRAP_WORD_CHAR);
347
 
        _tmp33_ = layout;
348
 
        pango_layout_set_height (_tmp33_, -2);
349
 
        _tmp34_ = widget;
350
 
        _tmp35_ = gtk_widget_get_direction (_tmp34_);
351
 
        if (_tmp35_ == GTK_TEXT_DIR_RTL) {
352
 
                align = PANGO_ALIGN_RIGHT;
353
 
        } else {
354
 
                align = PANGO_ALIGN_LEFT;
355
 
        }
356
 
        _tmp36_ = layout;
357
 
        _tmp37_ = align;
358
 
        pango_layout_set_alignment (_tmp36_, _tmp37_);
359
 
        result = layout;
360
 
        _pango_attribute_destroy0 (attr);
361
 
        _pango_attr_list_unref0 (attr_list);
362
 
        return result;
363
 
}
364
 
 
365
 
 
366
 
static gpointer _contacts_cell_renderer_shape_icon_shape_dup0 (gpointer self) {
367
 
        return self ? contacts_cell_renderer_shape_icon_shape_dup (self) : NULL;
368
 
}
369
 
 
370
 
 
371
 
static ContactsCellRendererShapeIconShape* ___lambda19_ (ContactsCellRendererShapeIconShape* s) {
372
 
        ContactsCellRendererShapeIconShape* result = NULL;
373
 
        ContactsCellRendererShapeIconShape* _tmp0_;
374
 
        ContactsCellRendererShapeIconShape* _tmp1_;
375
 
        _tmp0_ = s;
376
 
        _tmp1_ = _contacts_cell_renderer_shape_icon_shape_dup0 (_tmp0_);
377
 
        result = _tmp1_;
378
 
        return result;
379
 
}
380
 
 
381
 
 
382
 
static gpointer ____lambda19__pango_attr_data_copy_func (gconstpointer data) {
383
 
        gpointer result;
384
 
        result = ___lambda19_ (data);
385
 
        return result;
386
 
}
387
 
 
388
 
 
389
 
static void _contacts_cell_renderer_shape_icon_shape_free0_ (gpointer var) {
390
 
        (var == NULL) ? NULL : (var = (contacts_cell_renderer_shape_icon_shape_free (var), NULL));
391
 
}
392
 
 
393
 
 
394
 
static ContactsCellRendererShapeIconShape* ____lambda20_ (ContactsCellRendererShapeIconShape* s) {
395
 
        ContactsCellRendererShapeIconShape* result = NULL;
396
 
        ContactsCellRendererShapeIconShape* _tmp0_;
397
 
        ContactsCellRendererShapeIconShape* _tmp1_;
398
 
        _tmp0_ = s;
399
 
        _tmp1_ = _contacts_cell_renderer_shape_icon_shape_dup0 (_tmp0_);
400
 
        result = _tmp1_;
401
 
        return result;
402
 
}
403
 
 
404
 
 
405
 
static gpointer _____lambda20__pango_attr_data_copy_func (gconstpointer data) {
406
 
        gpointer result;
407
 
        result = ____lambda20_ (data);
408
 
        return result;
409
 
}
410
 
 
411
 
 
412
 
static PangoLayout* contacts_cell_renderer_shape_get_presence_layout (ContactsCellRendererShape* self, GtkWidget* widget, GdkRectangle* cell_area, GtkCellRendererState flags) {
413
 
        PangoLayout* result = NULL;
414
 
        PangoLayout* layout = NULL;
415
 
        gint xpad = 0;
416
 
        PangoRectangle _tmp0_ = {0};
417
 
        PangoRectangle r;
418
 
        PangoAttrList* _tmp1_;
419
 
        PangoAttrList* attr_list;
420
 
        gchar* _tmp2_;
421
 
        gchar* str;
422
 
        FolksPresenceType _tmp3_;
423
 
        gchar* _tmp4_ = NULL;
424
 
        gchar* iconname;
425
 
        gboolean _tmp5_ = FALSE;
426
 
        const gchar* _tmp6_;
427
 
        gboolean _tmp8_;
428
 
        gboolean _tmp25_ = FALSE;
429
 
        const gchar* _tmp26_;
430
 
        gboolean _tmp31_;
431
 
        GtkWidget* _tmp79_;
432
 
        const gchar* _tmp80_;
433
 
        PangoLayout* _tmp81_ = NULL;
434
 
        gint _tmp82_ = 0;
435
 
        PangoLayout* _tmp83_;
436
 
        PangoAttrList* _tmp84_;
437
 
        PangoLayout* _tmp85_;
438
 
        PangoRectangle rect = {0};
439
 
        gint width = 0;
440
 
        gint text_width = 0;
441
 
        PangoLayout* _tmp86_;
442
 
        PangoRectangle _tmp87_ = {0};
443
 
        PangoRectangle _tmp88_;
444
 
        gint _tmp89_;
445
 
        GdkRectangle* _tmp90_;
446
 
        gint _tmp94_;
447
 
        gint _tmp95_;
448
 
        gint _tmp96_ = 0;
449
 
        PangoLayout* _tmp97_;
450
 
        gint _tmp98_;
451
 
        PangoLayout* _tmp99_;
452
 
        PangoLayout* _tmp100_;
453
 
        PangoAlignment align = 0;
454
 
        GtkWidget* _tmp101_;
455
 
        GtkTextDirection _tmp102_ = 0;
456
 
        PangoLayout* _tmp103_;
457
 
        PangoAlignment _tmp104_;
458
 
        g_return_val_if_fail (self != NULL, NULL);
459
 
        g_return_val_if_fail (widget != NULL, NULL);
460
 
        _tmp0_.x = 0;
461
 
        _tmp0_.y = (((-CONTACTS_CELL_RENDERER_SHAPE_IMAGE_SIZE) * 1024) * 7) / 10;
462
 
        _tmp0_.width = CONTACTS_CELL_RENDERER_SHAPE_IMAGE_SIZE * 1024;
463
 
        _tmp0_.height = CONTACTS_CELL_RENDERER_SHAPE_IMAGE_SIZE * 1024;
464
 
        r = _tmp0_;
465
 
        _tmp1_ = pango_attr_list_new ();
466
 
        attr_list = _tmp1_;
467
 
        _tmp2_ = g_strdup ("");
468
 
        str = _tmp2_;
469
 
        _tmp3_ = self->priv->_presence;
470
 
        _tmp4_ = contacts_contact_presence_to_icon (_tmp3_);
471
 
        iconname = _tmp4_;
472
 
        _tmp6_ = iconname;
473
 
        if (_tmp6_ != NULL) {
474
 
                gboolean _tmp7_;
475
 
                _tmp7_ = self->priv->_show_presence;
476
 
                _tmp5_ = _tmp7_;
477
 
        } else {
478
 
                _tmp5_ = FALSE;
479
 
        }
480
 
        _tmp8_ = _tmp5_;
481
 
        if (_tmp8_) {
482
 
                const gchar* _tmp9_;
483
 
                gchar* _tmp10_;
484
 
                ContactsCellRendererShapeIconShape icon_shape = {0};
485
 
                const gchar* _tmp11_;
486
 
                gchar* _tmp12_;
487
 
                PangoRectangle _tmp13_;
488
 
                PangoRectangle _tmp14_;
489
 
                ContactsCellRendererShapeIconShape _tmp15_;
490
 
                ContactsCellRendererShapeIconShape _tmp16_;
491
 
                ContactsCellRendererShapeIconShape* _tmp17_;
492
 
                PangoAttrShape* _tmp18_;
493
 
                PangoAttrShape* a;
494
 
                PangoAttrShape* _tmp19_;
495
 
                PangoAttrShape* _tmp20_;
496
 
                PangoAttrList* _tmp21_;
497
 
                PangoAttrShape* _tmp22_;
498
 
                const gchar* _tmp23_;
499
 
                gchar* _tmp24_;
500
 
                _tmp9_ = str;
501
 
                _tmp10_ = g_strconcat (_tmp9_, "*", NULL);
502
 
                _g_free0 (str);
503
 
                str = _tmp10_;
504
 
                memset (&icon_shape, 0, sizeof (ContactsCellRendererShapeIconShape));
505
 
                _tmp11_ = iconname;
506
 
                _tmp12_ = g_strdup (_tmp11_);
507
 
                _g_free0 (icon_shape.icon);
508
 
                icon_shape.icon = _tmp12_;
509
 
                _tmp13_ = r;
510
 
                _tmp14_ = r;
511
 
                _tmp15_ = icon_shape;
512
 
                _tmp16_ = _tmp15_;
513
 
                _tmp17_ = _contacts_cell_renderer_shape_icon_shape_dup0 (&_tmp16_);
514
 
                _tmp18_ = (PangoAttrShape*) pango_attr_shape_new_with_data (&_tmp13_, &_tmp14_, _tmp17_, ____lambda19__pango_attr_data_copy_func, _contacts_cell_renderer_shape_icon_shape_free0_);
515
 
                a = _tmp18_;
516
 
                _tmp19_ = a;
517
 
                ((PangoAttribute*) _tmp19_)->start_index = (guint) 0;
518
 
                _tmp20_ = a;
519
 
                ((PangoAttribute*) _tmp20_)->end_index = (guint) 1;
520
 
                _tmp21_ = attr_list;
521
 
                _tmp22_ = a;
522
 
                a = NULL;
523
 
                pango_attr_list_insert (_tmp21_, (PangoAttribute*) _tmp22_);
524
 
                _tmp23_ = str;
525
 
                _tmp24_ = g_strconcat (_tmp23_, " ", NULL);
526
 
                _g_free0 (str);
527
 
                str = _tmp24_;
528
 
                _pango_attribute_destroy0 (a);
529
 
                contacts_cell_renderer_shape_icon_shape_destroy (&icon_shape);
530
 
        }
531
 
        _tmp26_ = self->priv->_message;
532
 
        if (_tmp26_ != NULL) {
533
 
                gboolean _tmp27_ = FALSE;
534
 
                gboolean _tmp28_;
535
 
                gboolean _tmp30_;
536
 
                _tmp28_ = self->priv->_show_presence;
537
 
                if (!_tmp28_) {
538
 
                        _tmp27_ = TRUE;
539
 
                } else {
540
 
                        const gchar* _tmp29_;
541
 
                        _tmp29_ = iconname;
542
 
                        _tmp27_ = _tmp29_ != NULL;
543
 
                }
544
 
                _tmp30_ = _tmp27_;
545
 
                _tmp25_ = _tmp30_;
546
 
        } else {
547
 
                _tmp25_ = FALSE;
548
 
        }
549
 
        _tmp31_ = _tmp25_;
550
 
        if (_tmp31_) {
551
 
                const gchar* _tmp32_;
552
 
                gchar* _tmp33_;
553
 
                gchar* m;
554
 
                const gchar* _tmp34_;
555
 
                gint _tmp35_;
556
 
                gint _tmp36_;
557
 
                PangoAttrSize* _tmp39_;
558
 
                PangoAttrSize* attr;
559
 
                PangoAttrSize* _tmp40_;
560
 
                PangoAttrSize* _tmp41_;
561
 
                const gchar* _tmp42_;
562
 
                gint _tmp43_;
563
 
                gint _tmp44_;
564
 
                PangoAttrSize* _tmp45_;
565
 
                PangoAttrSize* _tmp46_;
566
 
                guint _tmp47_;
567
 
                const gchar* _tmp48_;
568
 
                gint _tmp49_;
569
 
                gint _tmp50_;
570
 
                PangoAttrList* _tmp51_;
571
 
                PangoAttrSize* _tmp52_;
572
 
                const gchar* _tmp53_;
573
 
                const gchar* _tmp54_;
574
 
                gchar* _tmp55_;
575
 
                gboolean _tmp56_ = FALSE;
576
 
                gboolean _tmp57_;
577
 
                gboolean _tmp59_;
578
 
                _tmp32_ = self->priv->_message;
579
 
                _tmp33_ = g_strdup (_tmp32_);
580
 
                m = _tmp33_;
581
 
                _tmp34_ = m;
582
 
                _tmp35_ = strlen (_tmp34_);
583
 
                _tmp36_ = _tmp35_;
584
 
                if (_tmp36_ == 0) {
585
 
                        FolksPresenceType _tmp37_;
586
 
                        gchar* _tmp38_ = NULL;
587
 
                        _tmp37_ = self->priv->_presence;
588
 
                        _tmp38_ = contacts_contact_presence_to_string (_tmp37_);
589
 
                        _g_free0 (m);
590
 
                        m = _tmp38_;
591
 
                }
592
 
                _tmp39_ = (PangoAttrSize*) pango_attr_size_new (9 * PANGO_SCALE);
593
 
                attr = _tmp39_;
594
 
                _tmp40_ = attr;
595
 
                _tmp40_->absolute = (guint) 1;
596
 
                _tmp41_ = attr;
597
 
                _tmp42_ = str;
598
 
                _tmp43_ = strlen (_tmp42_);
599
 
                _tmp44_ = _tmp43_;
600
 
                ((PangoAttribute*) _tmp41_)->start_index = (guint) _tmp44_;
601
 
                _tmp45_ = attr;
602
 
                _tmp46_ = attr;
603
 
                _tmp47_ = ((PangoAttribute*) _tmp46_)->start_index;
604
 
                _tmp48_ = m;
605
 
                _tmp49_ = strlen (_tmp48_);
606
 
                _tmp50_ = _tmp49_;
607
 
                ((PangoAttribute*) _tmp45_)->end_index = _tmp47_ + _tmp50_;
608
 
                _tmp51_ = attr_list;
609
 
                _tmp52_ = attr;
610
 
                attr = NULL;
611
 
                pango_attr_list_insert (_tmp51_, (PangoAttribute*) _tmp52_);
612
 
                _tmp53_ = str;
613
 
                _tmp54_ = m;
614
 
                _tmp55_ = g_strconcat (_tmp53_, _tmp54_, NULL);
615
 
                _g_free0 (str);
616
 
                str = _tmp55_;
617
 
                _tmp57_ = self->priv->_is_phone;
618
 
                if (_tmp57_) {
619
 
                        gboolean _tmp58_;
620
 
                        _tmp58_ = self->priv->_show_presence;
621
 
                        _tmp56_ = _tmp58_;
622
 
                } else {
623
 
                        _tmp56_ = FALSE;
624
 
                }
625
 
                _tmp59_ = _tmp56_;
626
 
                if (_tmp59_) {
627
 
                        ContactsCellRendererShapeIconShape icon_shape = {0};
628
 
                        gchar* _tmp60_;
629
 
                        PangoRectangle _tmp61_;
630
 
                        PangoRectangle _tmp62_;
631
 
                        ContactsCellRendererShapeIconShape _tmp63_;
632
 
                        ContactsCellRendererShapeIconShape _tmp64_;
633
 
                        ContactsCellRendererShapeIconShape* _tmp65_;
634
 
                        PangoAttrShape* _tmp66_;
635
 
                        PangoAttrShape* a;
636
 
                        PangoAttrShape* _tmp67_;
637
 
                        const gchar* _tmp68_;
638
 
                        gint _tmp69_;
639
 
                        gint _tmp70_;
640
 
                        const gchar* _tmp71_;
641
 
                        gchar* _tmp72_;
642
 
                        PangoAttrShape* _tmp73_;
643
 
                        const gchar* _tmp74_;
644
 
                        gint _tmp75_;
645
 
                        gint _tmp76_;
646
 
                        PangoAttrList* _tmp77_;
647
 
                        PangoAttrShape* _tmp78_;
648
 
                        memset (&icon_shape, 0, sizeof (ContactsCellRendererShapeIconShape));
649
 
                        _tmp60_ = g_strdup ("phone-symbolic");
650
 
                        _g_free0 (icon_shape.icon);
651
 
                        icon_shape.icon = _tmp60_;
652
 
                        _tmp61_ = r;
653
 
                        _tmp62_ = r;
654
 
                        _tmp63_ = icon_shape;
655
 
                        _tmp64_ = _tmp63_;
656
 
                        _tmp65_ = _contacts_cell_renderer_shape_icon_shape_dup0 (&_tmp64_);
657
 
                        _tmp66_ = (PangoAttrShape*) pango_attr_shape_new_with_data (&_tmp61_, &_tmp62_, _tmp65_, _____lambda20__pango_attr_data_copy_func, _contacts_cell_renderer_shape_icon_shape_free0_);
658
 
                        a = _tmp66_;
659
 
                        _tmp67_ = a;
660
 
                        _tmp68_ = str;
661
 
                        _tmp69_ = strlen (_tmp68_);
662
 
                        _tmp70_ = _tmp69_;
663
 
                        ((PangoAttribute*) _tmp67_)->start_index = (guint) _tmp70_;
664
 
                        _tmp71_ = str;
665
 
                        _tmp72_ = g_strconcat (_tmp71_, "*", NULL);
666
 
                        _g_free0 (str);
667
 
                        str = _tmp72_;
668
 
                        _tmp73_ = a;
669
 
                        _tmp74_ = str;
670
 
                        _tmp75_ = strlen (_tmp74_);
671
 
                        _tmp76_ = _tmp75_;
672
 
                        ((PangoAttribute*) _tmp73_)->end_index = (guint) _tmp76_;
673
 
                        _tmp77_ = attr_list;
674
 
                        _tmp78_ = a;
675
 
                        a = NULL;
676
 
                        pango_attr_list_insert (_tmp77_, (PangoAttribute*) _tmp78_);
677
 
                        _pango_attribute_destroy0 (a);
678
 
                        contacts_cell_renderer_shape_icon_shape_destroy (&icon_shape);
679
 
                }
680
 
                _pango_attribute_destroy0 (attr);
681
 
                _g_free0 (m);
682
 
        }
683
 
        _tmp79_ = widget;
684
 
        _tmp80_ = str;
685
 
        _tmp81_ = gtk_widget_create_pango_layout (_tmp79_, _tmp80_);
686
 
        _g_object_unref0 (layout);
687
 
        layout = _tmp81_;
688
 
        gtk_cell_renderer_get_padding ((GtkCellRenderer*) self, &_tmp82_, NULL);
689
 
        xpad = _tmp82_;
690
 
        _tmp83_ = layout;
691
 
        _tmp84_ = attr_list;
692
 
        pango_layout_set_attributes (_tmp83_, _tmp84_);
693
 
        _tmp85_ = layout;
694
 
        pango_layout_set_ellipsize (_tmp85_, PANGO_ELLIPSIZE_END);
695
 
        _tmp86_ = layout;
696
 
        pango_layout_get_extents (_tmp86_, NULL, &_tmp87_);
697
 
        rect = _tmp87_;
698
 
        _tmp88_ = rect;
699
 
        _tmp89_ = _tmp88_.width;
700
 
        text_width = _tmp89_;
701
 
        _tmp90_ = cell_area;
702
 
        if (_tmp90_ != NULL) {
703
 
                GdkRectangle* _tmp91_;
704
 
                gint _tmp92_;
705
 
                gint _tmp93_;
706
 
                _tmp91_ = cell_area;
707
 
                _tmp92_ = (*_tmp91_).width;
708
 
                _tmp93_ = xpad;
709
 
                width = (_tmp92_ - _tmp93_) * PANGO_SCALE;
710
 
        } else {
711
 
                width = CONTACTS_CELL_RENDERER_SHAPE_default_width * PANGO_SCALE;
712
 
        }
713
 
        _tmp94_ = width;
714
 
        _tmp95_ = text_width;
715
 
        _tmp96_ = MIN (_tmp94_, _tmp95_);
716
 
        width = _tmp96_;
717
 
        _tmp97_ = layout;
718
 
        _tmp98_ = width;
719
 
        pango_layout_set_width (_tmp97_, _tmp98_);
720
 
        _tmp99_ = layout;
721
 
        pango_layout_set_wrap (_tmp99_, PANGO_WRAP_WORD_CHAR);
722
 
        _tmp100_ = layout;
723
 
        pango_layout_set_height (_tmp100_, -1);
724
 
        _tmp101_ = widget;
725
 
        _tmp102_ = gtk_widget_get_direction (_tmp101_);
726
 
        if (_tmp102_ == GTK_TEXT_DIR_RTL) {
727
 
                align = PANGO_ALIGN_RIGHT;
728
 
        } else {
729
 
                align = PANGO_ALIGN_LEFT;
730
 
        }
731
 
        _tmp103_ = layout;
732
 
        _tmp104_ = align;
733
 
        pango_layout_set_alignment (_tmp103_, _tmp104_);
734
 
        result = layout;
735
 
        _g_free0 (iconname);
736
 
        _g_free0 (str);
737
 
        _pango_attr_list_unref0 (attr_list);
738
 
        return result;
739
 
}
740
 
 
741
 
 
742
 
static void contacts_cell_renderer_shape_real_get_size (GtkCellRenderer* base, GtkWidget* widget, GdkRectangle* cell_area, gint* x_offset, gint* y_offset, gint* width, gint* height) {
743
 
        ContactsCellRendererShape * self;
744
 
        gint _vala_x_offset = 0;
745
 
        gint _vala_y_offset = 0;
746
 
        gint _vala_width = 0;
747
 
        gint _vala_height = 0;
748
 
        self = (ContactsCellRendererShape*) base;
749
 
        g_return_if_fail (widget != NULL);
750
 
        _vala_height = 0;
751
 
        _vala_width = _vala_height;
752
 
        _vala_y_offset = _vala_width;
753
 
        _vala_x_offset = _vala_y_offset;
754
 
        if (x_offset) {
755
 
                *x_offset = _vala_x_offset;
756
 
        }
757
 
        if (y_offset) {
758
 
                *y_offset = _vala_y_offset;
759
 
        }
760
 
        if (width) {
761
 
                *width = _vala_width;
762
 
        }
763
 
        if (height) {
764
 
                *height = _vala_height;
765
 
        }
766
 
}
767
 
 
768
 
 
769
 
static void contacts_cell_renderer_shape_do_get_size (ContactsCellRendererShape* self, GtkWidget* widget, GdkRectangle* cell_area, PangoLayout* layout, gint* x_offset, gint* y_offset) {
770
 
        gint _vala_x_offset = 0;
771
 
        gint _vala_y_offset = 0;
772
 
        PangoRectangle rect = {0};
773
 
        gint xpad = 0;
774
 
        gint ypad = 0;
775
 
        gint _tmp0_ = 0;
776
 
        gint _tmp1_ = 0;
777
 
        PangoLayout* _tmp2_;
778
 
        PangoRectangle _tmp3_ = {0};
779
 
        GdkRectangle* _tmp4_;
780
 
        gint _tmp21_;
781
 
        g_return_if_fail (self != NULL);
782
 
        g_return_if_fail (widget != NULL);
783
 
        gtk_cell_renderer_get_padding ((GtkCellRenderer*) self, &_tmp0_, &_tmp1_);
784
 
        xpad = _tmp0_;
785
 
        ypad = _tmp1_;
786
 
        _tmp2_ = layout;
787
 
        pango_layout_get_pixel_extents (_tmp2_, NULL, &_tmp3_);
788
 
        rect = _tmp3_;
789
 
        _tmp4_ = cell_area;
790
 
        if (_tmp4_ != NULL) {
791
 
                PangoRectangle _tmp5_;
792
 
                gint _tmp6_;
793
 
                GdkRectangle* _tmp7_;
794
 
                gint _tmp8_;
795
 
                gint _tmp9_;
796
 
                gint _tmp10_ = 0;
797
 
                GtkWidget* _tmp11_;
798
 
                GtkTextDirection _tmp12_ = 0;
799
 
                gint _tmp19_;
800
 
                gint _tmp20_ = 0;
801
 
                _tmp5_ = rect;
802
 
                _tmp6_ = _tmp5_.width;
803
 
                _tmp7_ = cell_area;
804
 
                _tmp8_ = (*_tmp7_).width;
805
 
                _tmp9_ = xpad;
806
 
                _tmp10_ = MIN (_tmp6_, _tmp8_ - (2 * _tmp9_));
807
 
                rect.width = _tmp10_;
808
 
                _tmp11_ = widget;
809
 
                _tmp12_ = gtk_widget_get_direction (_tmp11_);
810
 
                if (_tmp12_ == GTK_TEXT_DIR_RTL) {
811
 
                        GdkRectangle* _tmp13_;
812
 
                        gint _tmp14_;
813
 
                        PangoRectangle _tmp15_;
814
 
                        gint _tmp16_;
815
 
                        gint _tmp17_;
816
 
                        _tmp13_ = cell_area;
817
 
                        _tmp14_ = (*_tmp13_).width;
818
 
                        _tmp15_ = rect;
819
 
                        _tmp16_ = _tmp15_.width;
820
 
                        _tmp17_ = xpad;
821
 
                        _vala_x_offset = _tmp14_ - (_tmp16_ + _tmp17_);
822
 
                } else {
823
 
                        gint _tmp18_;
824
 
                        _tmp18_ = xpad;
825
 
                        _vala_x_offset = _tmp18_;
826
 
                }
827
 
                _tmp19_ = _vala_x_offset;
828
 
                _tmp20_ = MAX (_tmp19_, 0);
829
 
                _vala_x_offset = _tmp20_;
830
 
        } else {
831
 
                _vala_x_offset = 0;
832
 
        }
833
 
        _tmp21_ = ypad;
834
 
        _vala_y_offset = _tmp21_;
835
 
        if (x_offset) {
836
 
                *x_offset = _vala_x_offset;
837
 
        }
838
 
        if (y_offset) {
839
 
                *y_offset = _vala_y_offset;
840
 
        }
841
 
}
842
 
 
843
 
 
844
 
static void contacts_cell_renderer_shape_real_render (GtkCellRenderer* base, cairo_t* cr, GtkWidget* widget, GdkRectangle* background_area, GdkRectangle* cell_area, GtkCellRendererState flags) {
845
 
        ContactsCellRendererShape * self;
846
 
        GtkStyleContext* context = NULL;
847
 
        PangoLayout* name_layout = NULL;
848
 
        PangoLayout* presence_layout = NULL;
849
 
        gint name_x_offset;
850
 
        gint presence_x_offset;
851
 
        gint name_y_offset;
852
 
        gint presence_y_offset;
853
 
        gint xpad = 0;
854
 
        PangoRectangle name_rect = {0};
855
 
        PangoRectangle presence_rect = {0};
856
 
        GtkWidget* _tmp0_;
857
 
        GtkWidget* _tmp1_;
858
 
        GtkWidget* _tmp2_;
859
 
        GtkStyleContext* _tmp3_ = NULL;
860
 
        GtkStyleContext* _tmp4_;
861
 
        gint _tmp5_ = 0;
862
 
        GtkWidget* _tmp6_;
863
 
        GdkRectangle _tmp7_;
864
 
        GtkCellRendererState _tmp8_;
865
 
        PangoLayout* _tmp9_ = NULL;
866
 
        GtkWidget* _tmp10_;
867
 
        GdkRectangle _tmp11_;
868
 
        PangoLayout* _tmp12_;
869
 
        gint _tmp13_ = 0;
870
 
        gint _tmp14_ = 0;
871
 
        PangoLayout* _tmp15_;
872
 
        PangoRectangle _tmp16_ = {0};
873
 
        gint _tmp17_;
874
 
        PangoRectangle _tmp18_;
875
 
        gint _tmp19_;
876
 
        PangoLayout* _tmp20_;
877
 
        GSList* _tmp21_ = NULL;
878
 
        guint _tmp22_ = 0U;
879
 
        cairo_t* _tmp37_;
880
 
        cairo_t* _tmp38_;
881
 
        GdkRectangle _tmp39_;
882
 
        cairo_t* _tmp40_;
883
 
        GtkStyleContext* _tmp41_;
884
 
        cairo_t* _tmp42_;
885
 
        GdkRectangle _tmp43_;
886
 
        gint _tmp44_;
887
 
        gint _tmp45_;
888
 
        GdkRectangle _tmp46_;
889
 
        gint _tmp47_;
890
 
        gint _tmp48_;
891
 
        PangoLayout* _tmp49_;
892
 
        PangoLayout* _tmp50_;
893
 
        cairo_t* _tmp63_;
894
 
        self = (ContactsCellRendererShape*) base;
895
 
        g_return_if_fail (cr != NULL);
896
 
        g_return_if_fail (widget != NULL);
897
 
        g_return_if_fail (background_area != NULL);
898
 
        g_return_if_fail (cell_area != NULL);
899
 
        name_x_offset = 0;
900
 
        presence_x_offset = 0;
901
 
        name_y_offset = 0;
902
 
        presence_y_offset = 0;
903
 
        _tmp0_ = widget;
904
 
        _tmp1_ = _g_object_ref0 (_tmp0_);
905
 
        _g_object_unref0 (self->priv->current_widget);
906
 
        self->priv->current_widget = _tmp1_;
907
 
        _tmp2_ = widget;
908
 
        _tmp3_ = gtk_widget_get_style_context (_tmp2_);
909
 
        _tmp4_ = _g_object_ref0 (_tmp3_);
910
 
        _g_object_unref0 (context);
911
 
        context = _tmp4_;
912
 
        gtk_cell_renderer_get_padding ((GtkCellRenderer*) self, &_tmp5_, NULL);
913
 
        xpad = _tmp5_;
914
 
        _tmp6_ = widget;
915
 
        _tmp7_ = *cell_area;
916
 
        _tmp8_ = flags;
917
 
        _tmp9_ = contacts_cell_renderer_shape_get_name_layout (self, _tmp6_, &_tmp7_, _tmp8_);
918
 
        _g_object_unref0 (name_layout);
919
 
        name_layout = _tmp9_;
920
 
        _tmp10_ = widget;
921
 
        _tmp11_ = *cell_area;
922
 
        _tmp12_ = name_layout;
923
 
        contacts_cell_renderer_shape_do_get_size (self, _tmp10_, &_tmp11_, _tmp12_, &_tmp13_, &_tmp14_);
924
 
        name_x_offset = _tmp13_;
925
 
        name_y_offset = _tmp14_;
926
 
        _tmp15_ = name_layout;
927
 
        pango_layout_get_pixel_extents (_tmp15_, NULL, &_tmp16_);
928
 
        name_rect = _tmp16_;
929
 
        _tmp17_ = name_x_offset;
930
 
        _tmp18_ = name_rect;
931
 
        _tmp19_ = _tmp18_.x;
932
 
        name_x_offset = _tmp17_ - _tmp19_;
933
 
        _g_object_unref0 (presence_layout);
934
 
        presence_layout = NULL;
935
 
        _tmp20_ = name_layout;
936
 
        _tmp21_ = pango_layout_get_lines_readonly (_tmp20_);
937
 
        _tmp22_ = g_slist_length (_tmp21_);
938
 
        if (_tmp22_ == ((guint) 1)) {
939
 
                GtkWidget* _tmp23_;
940
 
                GdkRectangle _tmp24_;
941
 
                GtkCellRendererState _tmp25_;
942
 
                PangoLayout* _tmp26_ = NULL;
943
 
                GtkWidget* _tmp27_;
944
 
                GdkRectangle _tmp28_;
945
 
                PangoLayout* _tmp29_;
946
 
                gint _tmp30_ = 0;
947
 
                gint _tmp31_ = 0;
948
 
                PangoLayout* _tmp32_;
949
 
                PangoRectangle _tmp33_ = {0};
950
 
                gint _tmp34_;
951
 
                PangoRectangle _tmp35_;
952
 
                gint _tmp36_;
953
 
                _tmp23_ = widget;
954
 
                _tmp24_ = *cell_area;
955
 
                _tmp25_ = flags;
956
 
                _tmp26_ = contacts_cell_renderer_shape_get_presence_layout (self, _tmp23_, &_tmp24_, _tmp25_);
957
 
                _g_object_unref0 (presence_layout);
958
 
                presence_layout = _tmp26_;
959
 
                _tmp27_ = widget;
960
 
                _tmp28_ = *cell_area;
961
 
                _tmp29_ = presence_layout;
962
 
                contacts_cell_renderer_shape_do_get_size (self, _tmp27_, &_tmp28_, _tmp29_, &_tmp30_, &_tmp31_);
963
 
                presence_x_offset = _tmp30_;
964
 
                presence_y_offset = _tmp31_;
965
 
                _tmp32_ = presence_layout;
966
 
                pango_layout_get_pixel_extents (_tmp32_, NULL, &_tmp33_);
967
 
                presence_rect = _tmp33_;
968
 
                _tmp34_ = presence_x_offset;
969
 
                _tmp35_ = presence_rect;
970
 
                _tmp36_ = _tmp35_.x;
971
 
                presence_x_offset = _tmp34_ - _tmp36_;
972
 
        }
973
 
        _tmp37_ = cr;
974
 
        cairo_save (_tmp37_);
975
 
        _tmp38_ = cr;
976
 
        _tmp39_ = *cell_area;
977
 
        gdk_cairo_rectangle (_tmp38_, &_tmp39_);
978
 
        _tmp40_ = cr;
979
 
        cairo_clip (_tmp40_);
980
 
        _tmp41_ = context;
981
 
        _tmp42_ = cr;
982
 
        _tmp43_ = *cell_area;
983
 
        _tmp44_ = _tmp43_.x;
984
 
        _tmp45_ = name_x_offset;
985
 
        _tmp46_ = *cell_area;
986
 
        _tmp47_ = _tmp46_.y;
987
 
        _tmp48_ = name_y_offset;
988
 
        _tmp49_ = name_layout;
989
 
        gtk_render_layout (_tmp41_, _tmp42_, (gdouble) (_tmp44_ + _tmp45_), (gdouble) (_tmp47_ + _tmp48_), _tmp49_);
990
 
        _tmp50_ = presence_layout;
991
 
        if (_tmp50_ != NULL) {
992
 
                GtkStyleContext* _tmp51_;
993
 
                cairo_t* _tmp52_;
994
 
                GdkRectangle _tmp53_;
995
 
                gint _tmp54_;
996
 
                gint _tmp55_;
997
 
                GdkRectangle _tmp56_;
998
 
                gint _tmp57_;
999
 
                gint _tmp58_;
1000
 
                gint _tmp59_;
1001
 
                PangoLayout* _tmp60_;
1002
 
                gint _tmp61_ = 0;
1003
 
                PangoLayout* _tmp62_;
1004
 
                _tmp51_ = context;
1005
 
                _tmp52_ = cr;
1006
 
                _tmp53_ = *cell_area;
1007
 
                _tmp54_ = _tmp53_.x;
1008
 
                _tmp55_ = presence_x_offset;
1009
 
                _tmp56_ = *cell_area;
1010
 
                _tmp57_ = _tmp56_.y;
1011
 
                _tmp58_ = presence_y_offset;
1012
 
                _tmp59_ = self->priv->renderer_height;
1013
 
                _tmp60_ = presence_layout;
1014
 
                _tmp61_ = pango_layout_get_baseline (_tmp60_);
1015
 
                _tmp62_ = presence_layout;
1016
 
                gtk_render_layout (_tmp51_, _tmp52_, (gdouble) (_tmp54_ + _tmp55_), (gdouble) ((((_tmp57_ + _tmp58_) + _tmp59_) - 11) - (_tmp61_ / PANGO_SCALE)), _tmp62_);
1017
 
        }
1018
 
        _tmp63_ = cr;
1019
 
        cairo_restore (_tmp63_);
1020
 
        _g_object_unref0 (presence_layout);
1021
 
        _g_object_unref0 (name_layout);
1022
 
        _g_object_unref0 (context);
1023
 
}
1024
 
 
1025
 
 
1026
 
static void contacts_cell_renderer_shape_real_get_preferred_width (GtkCellRenderer* base, GtkWidget* widget, gint* min_width, gint* nat_width) {
1027
 
        ContactsCellRendererShape * self;
1028
 
        gint _vala_min_width = 0;
1029
 
        gint _vala_nat_width = 0;
1030
 
        gint xpad = 0;
1031
 
        gint _tmp0_ = 0;
1032
 
        self = (ContactsCellRendererShape*) base;
1033
 
        g_return_if_fail (widget != NULL);
1034
 
        gtk_cell_renderer_get_padding ((GtkCellRenderer*) self, &_tmp0_, NULL);
1035
 
        xpad = _tmp0_;
1036
 
        _vala_min_width = xpad + CONTACTS_CELL_RENDERER_SHAPE_default_width;
1037
 
        _vala_nat_width = _vala_min_width;
1038
 
        if (min_width) {
1039
 
                *min_width = _vala_min_width;
1040
 
        }
1041
 
        if (nat_width) {
1042
 
                *nat_width = _vala_nat_width;
1043
 
        }
1044
 
}
1045
 
 
1046
 
 
1047
 
static void contacts_cell_renderer_shape_real_get_preferred_height_for_width (GtkCellRenderer* base, GtkWidget* widget, gint width, gint* minimum_height, gint* natural_height) {
1048
 
        ContactsCellRendererShape * self;
1049
 
        gint _vala_minimum_height = 0;
1050
 
        gint _vala_natural_height = 0;
1051
 
        gint ypad = 0;
1052
 
        gint _tmp0_ = 0;
1053
 
        gint _tmp1_;
1054
 
        gint _tmp2_;
1055
 
        self = (ContactsCellRendererShape*) base;
1056
 
        g_return_if_fail (widget != NULL);
1057
 
        gtk_cell_renderer_get_padding ((GtkCellRenderer*) self, NULL, &_tmp0_);
1058
 
        ypad = _tmp0_;
1059
 
        _tmp1_ = self->priv->renderer_height;
1060
 
        _vala_minimum_height = _tmp1_ + ypad;
1061
 
        _tmp2_ = self->priv->renderer_height;
1062
 
        _vala_natural_height = _tmp2_ + ypad;
1063
 
        if (minimum_height) {
1064
 
                *minimum_height = _vala_minimum_height;
1065
 
        }
1066
 
        if (natural_height) {
1067
 
                *natural_height = _vala_natural_height;
1068
 
        }
1069
 
}
1070
 
 
1071
 
 
1072
 
static void contacts_cell_renderer_shape_real_get_preferred_height (GtkCellRenderer* base, GtkWidget* widget, gint* minimum_size, gint* natural_size) {
1073
 
        ContactsCellRendererShape * self;
1074
 
        gint _vala_minimum_size = 0;
1075
 
        gint _vala_natural_size = 0;
1076
 
        gint min_width = 0;
1077
 
        GtkWidget* _tmp0_;
1078
 
        gint _tmp1_ = 0;
1079
 
        GtkWidget* _tmp2_;
1080
 
        gint _tmp3_ = 0;
1081
 
        gint _tmp4_ = 0;
1082
 
        self = (ContactsCellRendererShape*) base;
1083
 
        g_return_if_fail (widget != NULL);
1084
 
        _tmp0_ = widget;
1085
 
        gtk_cell_renderer_get_preferred_width ((GtkCellRenderer*) self, _tmp0_, &_tmp1_, NULL);
1086
 
        min_width = _tmp1_;
1087
 
        _tmp2_ = widget;
1088
 
        gtk_cell_renderer_get_preferred_height_for_width ((GtkCellRenderer*) self, _tmp2_, min_width, &_tmp3_, &_tmp4_);
1089
 
        _vala_minimum_size = _tmp3_;
1090
 
        _vala_natural_size = _tmp4_;
1091
 
        if (minimum_size) {
1092
 
                *minimum_size = _vala_minimum_size;
1093
 
        }
1094
 
        if (natural_size) {
1095
 
                *natural_size = _vala_natural_size;
1096
 
        }
1097
 
}
1098
 
 
1099
 
 
1100
 
void contacts_cell_renderer_shape_render_shape (ContactsCellRendererShape* self, cairo_t* cr, PangoAttrShape* attr, gboolean do_path) {
1101
 
        PangoAttrShape* _tmp0_;
1102
 
        PangoAttrShape* sattr;
1103
 
        GtkWidget* _tmp1_;
1104
 
        PangoAttrShape* _tmp2_;
1105
 
        gconstpointer _tmp3_;
1106
 
        const gchar* _tmp4_;
1107
 
        GdkPixbuf* _tmp5_ = NULL;
1108
 
        GdkPixbuf* pixbuf;
1109
 
        GdkPixbuf* _tmp6_;
1110
 
        g_return_if_fail (self != NULL);
1111
 
        g_return_if_fail (cr != NULL);
1112
 
        g_return_if_fail (attr != NULL);
1113
 
        _tmp0_ = attr;
1114
 
        sattr = (PangoAttrShape*) _tmp0_;
1115
 
        _tmp1_ = self->priv->current_widget;
1116
 
        _tmp2_ = sattr;
1117
 
        _tmp3_ = _tmp2_->data;
1118
 
        _tmp4_ = (*((ContactsCellRendererShapeIconShape*) _tmp3_)).icon;
1119
 
        _tmp5_ = contacts_cell_renderer_shape_create_symbolic_pixbuf (self, _tmp1_, _tmp4_, CONTACTS_CELL_RENDERER_SHAPE_IMAGE_SIZE);
1120
 
        pixbuf = _tmp5_;
1121
 
        _tmp6_ = pixbuf;
1122
 
        if (_tmp6_ != NULL) {
1123
 
                gdouble x = 0.0;
1124
 
                gdouble y = 0.0;
1125
 
                cairo_t* _tmp7_;
1126
 
                gdouble _tmp8_ = 0.0;
1127
 
                gdouble _tmp9_ = 0.0;
1128
 
                cairo_t* _tmp10_;
1129
 
                GdkPixbuf* _tmp11_;
1130
 
                gdouble _tmp12_;
1131
 
                gdouble _tmp13_;
1132
 
                cairo_t* _tmp14_;
1133
 
                _tmp7_ = cr;
1134
 
                cairo_get_current_point (_tmp7_, &_tmp8_, &_tmp9_);
1135
 
                x = _tmp8_;
1136
 
                y = _tmp9_;
1137
 
                _tmp10_ = cr;
1138
 
                _tmp11_ = pixbuf;
1139
 
                _tmp12_ = x;
1140
 
                _tmp13_ = y;
1141
 
                gdk_cairo_set_source_pixbuf (_tmp10_, _tmp11_, _tmp12_, _tmp13_ - (CONTACTS_CELL_RENDERER_SHAPE_IMAGE_SIZE * 0.7));
1142
 
                _tmp14_ = cr;
1143
 
                cairo_paint (_tmp14_);
1144
 
        }
1145
 
        _g_object_unref0 (pixbuf);
1146
 
}
1147
 
 
1148
 
 
1149
 
ContactsCellRendererShape* contacts_cell_renderer_shape_construct (GType object_type) {
1150
 
        ContactsCellRendererShape * self = NULL;
1151
 
        self = (ContactsCellRendererShape*) g_object_new (object_type, NULL);
1152
 
        return self;
1153
 
}
1154
 
 
1155
 
 
1156
 
ContactsCellRendererShape* contacts_cell_renderer_shape_new (void) {
1157
 
        return contacts_cell_renderer_shape_construct (CONTACTS_TYPE_CELL_RENDERER_SHAPE);
1158
 
}
1159
 
 
1160
 
 
1161
 
const gchar* contacts_cell_renderer_shape_get_name (ContactsCellRendererShape* self) {
1162
 
        const gchar* result;
1163
 
        const gchar* _tmp0_;
1164
 
        g_return_val_if_fail (self != NULL, NULL);
1165
 
        _tmp0_ = self->priv->_name;
1166
 
        result = _tmp0_;
1167
 
        return result;
1168
 
}
1169
 
 
1170
 
 
1171
 
void contacts_cell_renderer_shape_set_name (ContactsCellRendererShape* self, const gchar* value) {
1172
 
        const gchar* _tmp0_;
1173
 
        gchar* _tmp1_;
1174
 
        g_return_if_fail (self != NULL);
1175
 
        _tmp0_ = value;
1176
 
        _tmp1_ = g_strdup (_tmp0_);
1177
 
        _g_free0 (self->priv->_name);
1178
 
        self->priv->_name = _tmp1_;
1179
 
        g_object_notify ((GObject *) self, "name");
1180
 
}
1181
 
 
1182
 
 
1183
 
FolksPresenceType contacts_cell_renderer_shape_get_presence (ContactsCellRendererShape* self) {
1184
 
        FolksPresenceType result;
1185
 
        FolksPresenceType _tmp0_;
1186
 
        g_return_val_if_fail (self != NULL, 0);
1187
 
        _tmp0_ = self->priv->_presence;
1188
 
        result = _tmp0_;
1189
 
        return result;
1190
 
}
1191
 
 
1192
 
 
1193
 
void contacts_cell_renderer_shape_set_presence (ContactsCellRendererShape* self, FolksPresenceType value) {
1194
 
        FolksPresenceType _tmp0_;
1195
 
        g_return_if_fail (self != NULL);
1196
 
        _tmp0_ = value;
1197
 
        self->priv->_presence = _tmp0_;
1198
 
        g_object_notify ((GObject *) self, "presence");
1199
 
}
1200
 
 
1201
 
 
1202
 
const gchar* contacts_cell_renderer_shape_get_message (ContactsCellRendererShape* self) {
1203
 
        const gchar* result;
1204
 
        const gchar* _tmp0_;
1205
 
        g_return_val_if_fail (self != NULL, NULL);
1206
 
        _tmp0_ = self->priv->_message;
1207
 
        result = _tmp0_;
1208
 
        return result;
1209
 
}
1210
 
 
1211
 
 
1212
 
void contacts_cell_renderer_shape_set_message (ContactsCellRendererShape* self, const gchar* value) {
1213
 
        const gchar* _tmp0_;
1214
 
        gchar* _tmp1_;
1215
 
        g_return_if_fail (self != NULL);
1216
 
        _tmp0_ = value;
1217
 
        _tmp1_ = g_strdup (_tmp0_);
1218
 
        _g_free0 (self->priv->_message);
1219
 
        self->priv->_message = _tmp1_;
1220
 
        g_object_notify ((GObject *) self, "message");
1221
 
}
1222
 
 
1223
 
 
1224
 
gboolean contacts_cell_renderer_shape_get_is_phone (ContactsCellRendererShape* self) {
1225
 
        gboolean result;
1226
 
        gboolean _tmp0_;
1227
 
        g_return_val_if_fail (self != NULL, FALSE);
1228
 
        _tmp0_ = self->priv->_is_phone;
1229
 
        result = _tmp0_;
1230
 
        return result;
1231
 
}
1232
 
 
1233
 
 
1234
 
void contacts_cell_renderer_shape_set_is_phone (ContactsCellRendererShape* self, gboolean value) {
1235
 
        gboolean _tmp0_;
1236
 
        g_return_if_fail (self != NULL);
1237
 
        _tmp0_ = value;
1238
 
        self->priv->_is_phone = _tmp0_;
1239
 
        g_object_notify ((GObject *) self, "is-phone");
1240
 
}
1241
 
 
1242
 
 
1243
 
gboolean contacts_cell_renderer_shape_get_show_presence (ContactsCellRendererShape* self) {
1244
 
        gboolean result;
1245
 
        gboolean _tmp0_;
1246
 
        g_return_val_if_fail (self != NULL, FALSE);
1247
 
        _tmp0_ = self->priv->_show_presence;
1248
 
        result = _tmp0_;
1249
 
        return result;
1250
 
}
1251
 
 
1252
 
 
1253
 
void contacts_cell_renderer_shape_set_show_presence (ContactsCellRendererShape* self, gboolean value) {
1254
 
        gboolean _tmp0_;
1255
 
        g_return_if_fail (self != NULL);
1256
 
        _tmp0_ = value;
1257
 
        self->priv->_show_presence = _tmp0_;
1258
 
        g_object_notify ((GObject *) self, "show-presence");
1259
 
}
1260
 
 
1261
 
 
1262
 
static void contacts_cell_renderer_shape_icon_shape_copy (const ContactsCellRendererShapeIconShape* self, ContactsCellRendererShapeIconShape* dest) {
1263
 
        const gchar* _tmp0_;
1264
 
        gchar* _tmp1_;
1265
 
        _tmp0_ = (*self).icon;
1266
 
        _tmp1_ = g_strdup (_tmp0_);
1267
 
        _g_free0 ((*dest).icon);
1268
 
        (*dest).icon = _tmp1_;
1269
 
}
1270
 
 
1271
 
 
1272
 
static void contacts_cell_renderer_shape_icon_shape_destroy (ContactsCellRendererShapeIconShape* self) {
1273
 
        _g_free0 ((*self).icon);
1274
 
}
1275
 
 
1276
 
 
1277
 
static ContactsCellRendererShapeIconShape* contacts_cell_renderer_shape_icon_shape_dup (const ContactsCellRendererShapeIconShape* self) {
1278
 
        ContactsCellRendererShapeIconShape* dup;
1279
 
        dup = g_new0 (ContactsCellRendererShapeIconShape, 1);
1280
 
        contacts_cell_renderer_shape_icon_shape_copy (self, dup);
1281
 
        return dup;
1282
 
}
1283
 
 
1284
 
 
1285
 
static void contacts_cell_renderer_shape_icon_shape_free (ContactsCellRendererShapeIconShape* self) {
1286
 
        contacts_cell_renderer_shape_icon_shape_destroy (self);
1287
 
        g_free (self);
1288
 
}
1289
 
 
1290
 
 
1291
 
static GType contacts_cell_renderer_shape_icon_shape_get_type (void) {
1292
 
        static volatile gsize contacts_cell_renderer_shape_icon_shape_type_id__volatile = 0;
1293
 
        if (g_once_init_enter (&contacts_cell_renderer_shape_icon_shape_type_id__volatile)) {
1294
 
                GType contacts_cell_renderer_shape_icon_shape_type_id;
1295
 
                contacts_cell_renderer_shape_icon_shape_type_id = g_boxed_type_register_static ("ContactsCellRendererShapeIconShape", (GBoxedCopyFunc) contacts_cell_renderer_shape_icon_shape_dup, (GBoxedFreeFunc) contacts_cell_renderer_shape_icon_shape_free);
1296
 
                g_once_init_leave (&contacts_cell_renderer_shape_icon_shape_type_id__volatile, contacts_cell_renderer_shape_icon_shape_type_id);
1297
 
        }
1298
 
        return contacts_cell_renderer_shape_icon_shape_type_id__volatile;
1299
 
}
1300
 
 
1301
 
 
1302
 
static void contacts_cell_renderer_shape_class_init (ContactsCellRendererShapeClass * klass) {
1303
 
        contacts_cell_renderer_shape_parent_class = g_type_class_peek_parent (klass);
1304
 
        g_type_class_add_private (klass, sizeof (ContactsCellRendererShapePrivate));
1305
 
        GTK_CELL_RENDERER_CLASS (klass)->get_size = contacts_cell_renderer_shape_real_get_size;
1306
 
        GTK_CELL_RENDERER_CLASS (klass)->render = contacts_cell_renderer_shape_real_render;
1307
 
        GTK_CELL_RENDERER_CLASS (klass)->get_preferred_width = contacts_cell_renderer_shape_real_get_preferred_width;
1308
 
        GTK_CELL_RENDERER_CLASS (klass)->get_preferred_height_for_width = contacts_cell_renderer_shape_real_get_preferred_height_for_width;
1309
 
        GTK_CELL_RENDERER_CLASS (klass)->get_preferred_height = contacts_cell_renderer_shape_real_get_preferred_height;
1310
 
        G_OBJECT_CLASS (klass)->get_property = _vala_contacts_cell_renderer_shape_get_property;
1311
 
        G_OBJECT_CLASS (klass)->set_property = _vala_contacts_cell_renderer_shape_set_property;
1312
 
        G_OBJECT_CLASS (klass)->finalize = contacts_cell_renderer_shape_finalize;
1313
 
        g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_CELL_RENDERER_SHAPE_NAME, g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
1314
 
        g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_CELL_RENDERER_SHAPE_PRESENCE, g_param_spec_enum ("presence", "presence", "presence", FOLKS_TYPE_PRESENCE_TYPE, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
1315
 
        g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_CELL_RENDERER_SHAPE_MESSAGE, g_param_spec_string ("message", "message", "message", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
1316
 
        g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_CELL_RENDERER_SHAPE_IS_PHONE, g_param_spec_boolean ("is-phone", "is-phone", "is-phone", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
1317
 
        g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_CELL_RENDERER_SHAPE_SHOW_PRESENCE, g_param_spec_boolean ("show-presence", "show-presence", "show-presence", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
1318
 
}
1319
 
 
1320
 
 
1321
 
static void contacts_cell_renderer_shape_instance_init (ContactsCellRendererShape * self) {
1322
 
        self->priv = CONTACTS_CELL_RENDERER_SHAPE_GET_PRIVATE (self);
1323
 
        self->priv->renderer_height = CONTACTS_CONTACT_SMALL_AVATAR_SIZE;
1324
 
}
1325
 
 
1326
 
 
1327
 
static void contacts_cell_renderer_shape_finalize (GObject* obj) {
1328
 
        ContactsCellRendererShape * self;
1329
 
        self = CONTACTS_CELL_RENDERER_SHAPE (obj);
1330
 
        _g_object_unref0 (self->priv->current_widget);
1331
 
        _g_free0 (self->priv->_name);
1332
 
        _g_free0 (self->priv->_message);
1333
 
        G_OBJECT_CLASS (contacts_cell_renderer_shape_parent_class)->finalize (obj);
1334
 
}
1335
 
 
1336
 
 
1337
 
GType contacts_cell_renderer_shape_get_type (void) {
1338
 
        static volatile gsize contacts_cell_renderer_shape_type_id__volatile = 0;
1339
 
        if (g_once_init_enter (&contacts_cell_renderer_shape_type_id__volatile)) {
1340
 
                static const GTypeInfo g_define_type_info = { sizeof (ContactsCellRendererShapeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) contacts_cell_renderer_shape_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ContactsCellRendererShape), 0, (GInstanceInitFunc) contacts_cell_renderer_shape_instance_init, NULL };
1341
 
                GType contacts_cell_renderer_shape_type_id;
1342
 
                contacts_cell_renderer_shape_type_id = g_type_register_static (GTK_TYPE_CELL_RENDERER, "ContactsCellRendererShape", &g_define_type_info, 0);
1343
 
                g_once_init_leave (&contacts_cell_renderer_shape_type_id__volatile, contacts_cell_renderer_shape_type_id);
1344
 
        }
1345
 
        return contacts_cell_renderer_shape_type_id__volatile;
1346
 
}
1347
 
 
1348
 
 
1349
 
static void _vala_contacts_cell_renderer_shape_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
1350
 
        ContactsCellRendererShape * self;
1351
 
        self = CONTACTS_CELL_RENDERER_SHAPE (object);
1352
 
        switch (property_id) {
1353
 
                case CONTACTS_CELL_RENDERER_SHAPE_NAME:
1354
 
                g_value_set_string (value, contacts_cell_renderer_shape_get_name (self));
1355
 
                break;
1356
 
                case CONTACTS_CELL_RENDERER_SHAPE_PRESENCE:
1357
 
                g_value_set_enum (value, contacts_cell_renderer_shape_get_presence (self));
1358
 
                break;
1359
 
                case CONTACTS_CELL_RENDERER_SHAPE_MESSAGE:
1360
 
                g_value_set_string (value, contacts_cell_renderer_shape_get_message (self));
1361
 
                break;
1362
 
                case CONTACTS_CELL_RENDERER_SHAPE_IS_PHONE:
1363
 
                g_value_set_boolean (value, contacts_cell_renderer_shape_get_is_phone (self));
1364
 
                break;
1365
 
                case CONTACTS_CELL_RENDERER_SHAPE_SHOW_PRESENCE:
1366
 
                g_value_set_boolean (value, contacts_cell_renderer_shape_get_show_presence (self));
1367
 
                break;
1368
 
                default:
1369
 
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
1370
 
                break;
1371
 
        }
1372
 
}
1373
 
 
1374
 
 
1375
 
static void _vala_contacts_cell_renderer_shape_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
1376
 
        ContactsCellRendererShape * self;
1377
 
        self = CONTACTS_CELL_RENDERER_SHAPE (object);
1378
 
        switch (property_id) {
1379
 
                case CONTACTS_CELL_RENDERER_SHAPE_NAME:
1380
 
                contacts_cell_renderer_shape_set_name (self, g_value_get_string (value));
1381
 
                break;
1382
 
                case CONTACTS_CELL_RENDERER_SHAPE_PRESENCE:
1383
 
                contacts_cell_renderer_shape_set_presence (self, g_value_get_enum (value));
1384
 
                break;
1385
 
                case CONTACTS_CELL_RENDERER_SHAPE_MESSAGE:
1386
 
                contacts_cell_renderer_shape_set_message (self, g_value_get_string (value));
1387
 
                break;
1388
 
                case CONTACTS_CELL_RENDERER_SHAPE_IS_PHONE:
1389
 
                contacts_cell_renderer_shape_set_is_phone (self, g_value_get_boolean (value));
1390
 
                break;
1391
 
                case CONTACTS_CELL_RENDERER_SHAPE_SHOW_PRESENCE:
1392
 
                contacts_cell_renderer_shape_set_show_presence (self, g_value_get_boolean (value));
1393
 
                break;
1394
 
                default:
1395
 
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
1396
 
                break;
1397
 
        }
1398
 
}
1399
 
 
1400
 
 
1401