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 */
4
/* -*- Mode: vala; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 8 -*- */
6
* Copyright (C) 2011 Alexander Larsson <alexl@redhat.com>
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.
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.
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/>.
23
#include <glib-object.h>
27
#include <folks/folks.h>
28
#include <gdk-pixbuf/gdk-pixbuf.h>
30
#include <pango/pango.h>
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))
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)))
53
#define CONTACTS_CELL_RENDERER_SHAPE_TYPE_ICON_SHAPE (contacts_cell_renderer_shape_icon_shape_get_type ())
54
typedef struct _ContactsCellRendererShapeIconShape ContactsCellRendererShapeIconShape;
56
struct _ContactsCellRendererShape {
57
GtkCellRenderer parent_instance;
58
ContactsCellRendererShapePrivate * priv;
61
struct _ContactsCellRendererShapeClass {
62
GtkCellRendererClass parent_class;
65
struct _ContactsCellRendererShapePrivate {
66
GtkWidget* current_widget;
68
FolksPresenceType _presence;
71
gboolean _show_presence;
75
struct _ContactsCellRendererShapeIconShape {
80
static gpointer contacts_cell_renderer_shape_parent_class = NULL;
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))
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
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);
134
static gpointer _g_object_ref0 (gpointer self) {
135
return self ? g_object_ref (self) : NULL;
139
static GdkPixbuf* contacts_cell_renderer_shape_create_symbolic_pixbuf (ContactsCellRendererShape* self, GtkWidget* widget, const gchar* icon_name, gint size) {
140
GdkPixbuf* result = NULL;
142
GdkScreen* _tmp1_ = NULL;
146
GtkIconTheme* _tmp4_ = NULL;
147
GtkIconTheme* _tmp5_;
148
GtkIconTheme* icon_theme;
149
GtkIconTheme* _tmp6_;
152
GtkIconInfo* _tmp9_ = NULL;
154
GtkIconInfo* _tmp10_;
156
GtkStyleContext* _tmp12_ = NULL;
157
GtkStyleContext* _tmp13_;
158
GtkStyleContext* context;
159
GtkStyleContext* _tmp14_;
160
gboolean is_symbolic = FALSE;
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);
168
_tmp1_ = gtk_widget_get_screen (_tmp0_);
169
_tmp2_ = _g_object_ref0 (_tmp1_);
172
_tmp4_ = gtk_icon_theme_get_for_screen (_tmp3_);
173
_tmp5_ = _g_object_ref0 (_tmp4_);
178
_tmp9_ = gtk_icon_theme_lookup_icon (_tmp6_, _tmp7_, _tmp8_, GTK_ICON_LOOKUP_USE_BUILTIN);
181
if (_tmp10_ == NULL) {
183
_gtk_icon_info_free0 (info);
184
_g_object_unref0 (icon_theme);
185
_g_object_unref0 (screen);
189
_tmp12_ = gtk_widget_get_style_context (_tmp11_);
190
_tmp13_ = _g_object_ref0 (_tmp12_);
193
gtk_style_context_save (_tmp14_);
196
GtkIconInfo* _tmp15_;
197
GtkStyleContext* _tmp16_;
198
gboolean _tmp17_ = FALSE;
199
GdkPixbuf* _tmp18_ = NULL;
203
_tmp18_ = gtk_icon_info_load_symbolic_for_context (_tmp15_, _tmp16_, &_tmp17_, &_inner_error_);
204
is_symbolic = _tmp17_;
206
if (_inner_error_ != NULL) {
207
goto __catch3_g_error;
209
_g_object_unref0 (pixbuf);
217
_inner_error_ = NULL;
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_);
232
gtk_style_context_restore (_tmp20_);
234
_g_object_unref0 (context);
235
_gtk_icon_info_free0 (info);
236
_g_object_unref0 (icon_theme);
237
_g_object_unref0 (screen);
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;
246
PangoAttrList* _tmp0_;
247
PangoAttrList* attr_list;
250
PangoLayout* _tmp3_ = NULL;
251
PangoAttrSize* _tmp4_;
253
PangoAttrSize* _tmp5_;
254
PangoAttrSize* _tmp6_;
255
PangoAttrSize* _tmp7_;
256
PangoAttrSize* _tmp8_;
258
const gchar* _tmp10_;
261
PangoAttrList* _tmp13_;
262
PangoAttrSize* _tmp14_;
263
PangoLayout* _tmp15_;
264
PangoAttrList* _tmp16_;
266
PangoLayout* _tmp18_;
267
PangoRectangle rect = {0};
270
PangoLayout* _tmp19_;
271
PangoRectangle _tmp20_ = {0};
272
PangoRectangle _tmp21_;
274
GdkRectangle* _tmp23_;
278
PangoLayout* _tmp30_;
280
PangoLayout* _tmp32_;
281
PangoLayout* _tmp33_;
282
PangoAlignment align = 0;
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 ();
292
_tmp2_ = self->priv->_name;
293
_tmp3_ = gtk_widget_create_pango_layout (_tmp1_, _tmp2_);
294
_g_object_unref0 (layout);
296
_tmp4_ = (PangoAttrSize*) pango_attr_size_new (13 * PANGO_SCALE);
299
_tmp5_->absolute = (guint) 1;
301
((PangoAttribute*) _tmp6_)->start_index = (guint) 0;
304
_tmp9_ = ((PangoAttribute*) _tmp8_)->start_index;
305
_tmp10_ = self->priv->_name;
306
_tmp11_ = strlen (_tmp10_);
308
((PangoAttribute*) _tmp7_)->end_index = _tmp9_ + _tmp12_;
312
pango_attr_list_insert (_tmp13_, (PangoAttribute*) _tmp14_);
315
pango_layout_set_attributes (_tmp15_, _tmp16_);
316
gtk_cell_renderer_get_padding ((GtkCellRenderer*) self, &_tmp17_, NULL);
319
pango_layout_set_ellipsize (_tmp18_, PANGO_ELLIPSIZE_END);
321
pango_layout_get_extents (_tmp19_, NULL, &_tmp20_);
324
_tmp22_ = _tmp21_.width;
325
text_width = _tmp22_;
327
if (_tmp23_ != NULL) {
328
GdkRectangle* _tmp24_;
332
_tmp25_ = (*_tmp24_).width;
334
width = (_tmp25_ - _tmp26_) * PANGO_SCALE;
336
width = CONTACTS_CELL_RENDERER_SHAPE_default_width * PANGO_SCALE;
339
_tmp28_ = text_width;
340
_tmp29_ = MIN (_tmp27_, _tmp28_);
344
pango_layout_set_width (_tmp30_, _tmp31_);
346
pango_layout_set_wrap (_tmp32_, PANGO_WRAP_WORD_CHAR);
348
pango_layout_set_height (_tmp33_, -2);
350
_tmp35_ = gtk_widget_get_direction (_tmp34_);
351
if (_tmp35_ == GTK_TEXT_DIR_RTL) {
352
align = PANGO_ALIGN_RIGHT;
354
align = PANGO_ALIGN_LEFT;
358
pango_layout_set_alignment (_tmp36_, _tmp37_);
360
_pango_attribute_destroy0 (attr);
361
_pango_attr_list_unref0 (attr_list);
366
static gpointer _contacts_cell_renderer_shape_icon_shape_dup0 (gpointer self) {
367
return self ? contacts_cell_renderer_shape_icon_shape_dup (self) : NULL;
371
static ContactsCellRendererShapeIconShape* ___lambda19_ (ContactsCellRendererShapeIconShape* s) {
372
ContactsCellRendererShapeIconShape* result = NULL;
373
ContactsCellRendererShapeIconShape* _tmp0_;
374
ContactsCellRendererShapeIconShape* _tmp1_;
376
_tmp1_ = _contacts_cell_renderer_shape_icon_shape_dup0 (_tmp0_);
382
static gpointer ____lambda19__pango_attr_data_copy_func (gconstpointer data) {
384
result = ___lambda19_ (data);
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));
394
static ContactsCellRendererShapeIconShape* ____lambda20_ (ContactsCellRendererShapeIconShape* s) {
395
ContactsCellRendererShapeIconShape* result = NULL;
396
ContactsCellRendererShapeIconShape* _tmp0_;
397
ContactsCellRendererShapeIconShape* _tmp1_;
399
_tmp1_ = _contacts_cell_renderer_shape_icon_shape_dup0 (_tmp0_);
405
static gpointer _____lambda20__pango_attr_data_copy_func (gconstpointer data) {
407
result = ____lambda20_ (data);
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;
416
PangoRectangle _tmp0_ = {0};
418
PangoAttrList* _tmp1_;
419
PangoAttrList* attr_list;
422
FolksPresenceType _tmp3_;
423
gchar* _tmp4_ = NULL;
425
gboolean _tmp5_ = FALSE;
428
gboolean _tmp25_ = FALSE;
429
const gchar* _tmp26_;
432
const gchar* _tmp80_;
433
PangoLayout* _tmp81_ = NULL;
435
PangoLayout* _tmp83_;
436
PangoAttrList* _tmp84_;
437
PangoLayout* _tmp85_;
438
PangoRectangle rect = {0};
441
PangoLayout* _tmp86_;
442
PangoRectangle _tmp87_ = {0};
443
PangoRectangle _tmp88_;
445
GdkRectangle* _tmp90_;
449
PangoLayout* _tmp97_;
451
PangoLayout* _tmp99_;
452
PangoLayout* _tmp100_;
453
PangoAlignment align = 0;
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);
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;
465
_tmp1_ = pango_attr_list_new ();
467
_tmp2_ = g_strdup ("");
469
_tmp3_ = self->priv->_presence;
470
_tmp4_ = contacts_contact_presence_to_icon (_tmp3_);
473
if (_tmp6_ != NULL) {
475
_tmp7_ = self->priv->_show_presence;
484
ContactsCellRendererShapeIconShape icon_shape = {0};
485
const gchar* _tmp11_;
487
PangoRectangle _tmp13_;
488
PangoRectangle _tmp14_;
489
ContactsCellRendererShapeIconShape _tmp15_;
490
ContactsCellRendererShapeIconShape _tmp16_;
491
ContactsCellRendererShapeIconShape* _tmp17_;
492
PangoAttrShape* _tmp18_;
494
PangoAttrShape* _tmp19_;
495
PangoAttrShape* _tmp20_;
496
PangoAttrList* _tmp21_;
497
PangoAttrShape* _tmp22_;
498
const gchar* _tmp23_;
501
_tmp10_ = g_strconcat (_tmp9_, "*", NULL);
504
memset (&icon_shape, 0, sizeof (ContactsCellRendererShapeIconShape));
506
_tmp12_ = g_strdup (_tmp11_);
507
_g_free0 (icon_shape.icon);
508
icon_shape.icon = _tmp12_;
511
_tmp15_ = icon_shape;
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_);
517
((PangoAttribute*) _tmp19_)->start_index = (guint) 0;
519
((PangoAttribute*) _tmp20_)->end_index = (guint) 1;
523
pango_attr_list_insert (_tmp21_, (PangoAttribute*) _tmp22_);
525
_tmp24_ = g_strconcat (_tmp23_, " ", NULL);
528
_pango_attribute_destroy0 (a);
529
contacts_cell_renderer_shape_icon_shape_destroy (&icon_shape);
531
_tmp26_ = self->priv->_message;
532
if (_tmp26_ != NULL) {
533
gboolean _tmp27_ = FALSE;
536
_tmp28_ = self->priv->_show_presence;
540
const gchar* _tmp29_;
542
_tmp27_ = _tmp29_ != NULL;
551
const gchar* _tmp32_;
554
const gchar* _tmp34_;
557
PangoAttrSize* _tmp39_;
559
PangoAttrSize* _tmp40_;
560
PangoAttrSize* _tmp41_;
561
const gchar* _tmp42_;
564
PangoAttrSize* _tmp45_;
565
PangoAttrSize* _tmp46_;
567
const gchar* _tmp48_;
570
PangoAttrList* _tmp51_;
571
PangoAttrSize* _tmp52_;
572
const gchar* _tmp53_;
573
const gchar* _tmp54_;
575
gboolean _tmp56_ = FALSE;
578
_tmp32_ = self->priv->_message;
579
_tmp33_ = g_strdup (_tmp32_);
582
_tmp35_ = strlen (_tmp34_);
585
FolksPresenceType _tmp37_;
586
gchar* _tmp38_ = NULL;
587
_tmp37_ = self->priv->_presence;
588
_tmp38_ = contacts_contact_presence_to_string (_tmp37_);
592
_tmp39_ = (PangoAttrSize*) pango_attr_size_new (9 * PANGO_SCALE);
595
_tmp40_->absolute = (guint) 1;
598
_tmp43_ = strlen (_tmp42_);
600
((PangoAttribute*) _tmp41_)->start_index = (guint) _tmp44_;
603
_tmp47_ = ((PangoAttribute*) _tmp46_)->start_index;
605
_tmp49_ = strlen (_tmp48_);
607
((PangoAttribute*) _tmp45_)->end_index = _tmp47_ + _tmp50_;
611
pango_attr_list_insert (_tmp51_, (PangoAttribute*) _tmp52_);
614
_tmp55_ = g_strconcat (_tmp53_, _tmp54_, NULL);
617
_tmp57_ = self->priv->_is_phone;
620
_tmp58_ = self->priv->_show_presence;
627
ContactsCellRendererShapeIconShape icon_shape = {0};
629
PangoRectangle _tmp61_;
630
PangoRectangle _tmp62_;
631
ContactsCellRendererShapeIconShape _tmp63_;
632
ContactsCellRendererShapeIconShape _tmp64_;
633
ContactsCellRendererShapeIconShape* _tmp65_;
634
PangoAttrShape* _tmp66_;
636
PangoAttrShape* _tmp67_;
637
const gchar* _tmp68_;
640
const gchar* _tmp71_;
642
PangoAttrShape* _tmp73_;
643
const gchar* _tmp74_;
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_;
654
_tmp63_ = icon_shape;
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_);
661
_tmp69_ = strlen (_tmp68_);
663
((PangoAttribute*) _tmp67_)->start_index = (guint) _tmp70_;
665
_tmp72_ = g_strconcat (_tmp71_, "*", NULL);
670
_tmp75_ = strlen (_tmp74_);
672
((PangoAttribute*) _tmp73_)->end_index = (guint) _tmp76_;
676
pango_attr_list_insert (_tmp77_, (PangoAttribute*) _tmp78_);
677
_pango_attribute_destroy0 (a);
678
contacts_cell_renderer_shape_icon_shape_destroy (&icon_shape);
680
_pango_attribute_destroy0 (attr);
685
_tmp81_ = gtk_widget_create_pango_layout (_tmp79_, _tmp80_);
686
_g_object_unref0 (layout);
688
gtk_cell_renderer_get_padding ((GtkCellRenderer*) self, &_tmp82_, NULL);
692
pango_layout_set_attributes (_tmp83_, _tmp84_);
694
pango_layout_set_ellipsize (_tmp85_, PANGO_ELLIPSIZE_END);
696
pango_layout_get_extents (_tmp86_, NULL, &_tmp87_);
699
_tmp89_ = _tmp88_.width;
700
text_width = _tmp89_;
702
if (_tmp90_ != NULL) {
703
GdkRectangle* _tmp91_;
707
_tmp92_ = (*_tmp91_).width;
709
width = (_tmp92_ - _tmp93_) * PANGO_SCALE;
711
width = CONTACTS_CELL_RENDERER_SHAPE_default_width * PANGO_SCALE;
714
_tmp95_ = text_width;
715
_tmp96_ = MIN (_tmp94_, _tmp95_);
719
pango_layout_set_width (_tmp97_, _tmp98_);
721
pango_layout_set_wrap (_tmp99_, PANGO_WRAP_WORD_CHAR);
723
pango_layout_set_height (_tmp100_, -1);
725
_tmp102_ = gtk_widget_get_direction (_tmp101_);
726
if (_tmp102_ == GTK_TEXT_DIR_RTL) {
727
align = PANGO_ALIGN_RIGHT;
729
align = PANGO_ALIGN_LEFT;
733
pango_layout_set_alignment (_tmp103_, _tmp104_);
737
_pango_attr_list_unref0 (attr_list);
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);
751
_vala_width = _vala_height;
752
_vala_y_offset = _vala_width;
753
_vala_x_offset = _vala_y_offset;
755
*x_offset = _vala_x_offset;
758
*y_offset = _vala_y_offset;
761
*width = _vala_width;
764
*height = _vala_height;
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};
778
PangoRectangle _tmp3_ = {0};
779
GdkRectangle* _tmp4_;
781
g_return_if_fail (self != NULL);
782
g_return_if_fail (widget != NULL);
783
gtk_cell_renderer_get_padding ((GtkCellRenderer*) self, &_tmp0_, &_tmp1_);
787
pango_layout_get_pixel_extents (_tmp2_, NULL, &_tmp3_);
790
if (_tmp4_ != NULL) {
791
PangoRectangle _tmp5_;
793
GdkRectangle* _tmp7_;
798
GtkTextDirection _tmp12_ = 0;
802
_tmp6_ = _tmp5_.width;
804
_tmp8_ = (*_tmp7_).width;
806
_tmp10_ = MIN (_tmp6_, _tmp8_ - (2 * _tmp9_));
807
rect.width = _tmp10_;
809
_tmp12_ = gtk_widget_get_direction (_tmp11_);
810
if (_tmp12_ == GTK_TEXT_DIR_RTL) {
811
GdkRectangle* _tmp13_;
813
PangoRectangle _tmp15_;
817
_tmp14_ = (*_tmp13_).width;
819
_tmp16_ = _tmp15_.width;
821
_vala_x_offset = _tmp14_ - (_tmp16_ + _tmp17_);
825
_vala_x_offset = _tmp18_;
827
_tmp19_ = _vala_x_offset;
828
_tmp20_ = MAX (_tmp19_, 0);
829
_vala_x_offset = _tmp20_;
834
_vala_y_offset = _tmp21_;
836
*x_offset = _vala_x_offset;
839
*y_offset = _vala_y_offset;
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;
850
gint presence_x_offset;
852
gint presence_y_offset;
854
PangoRectangle name_rect = {0};
855
PangoRectangle presence_rect = {0};
859
GtkStyleContext* _tmp3_ = NULL;
860
GtkStyleContext* _tmp4_;
864
GtkCellRendererState _tmp8_;
865
PangoLayout* _tmp9_ = NULL;
867
GdkRectangle _tmp11_;
868
PangoLayout* _tmp12_;
871
PangoLayout* _tmp15_;
872
PangoRectangle _tmp16_ = {0};
874
PangoRectangle _tmp18_;
876
PangoLayout* _tmp20_;
877
GSList* _tmp21_ = NULL;
881
GdkRectangle _tmp39_;
883
GtkStyleContext* _tmp41_;
885
GdkRectangle _tmp43_;
888
GdkRectangle _tmp46_;
891
PangoLayout* _tmp49_;
892
PangoLayout* _tmp50_;
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);
900
presence_x_offset = 0;
902
presence_y_offset = 0;
904
_tmp1_ = _g_object_ref0 (_tmp0_);
905
_g_object_unref0 (self->priv->current_widget);
906
self->priv->current_widget = _tmp1_;
908
_tmp3_ = gtk_widget_get_style_context (_tmp2_);
909
_tmp4_ = _g_object_ref0 (_tmp3_);
910
_g_object_unref0 (context);
912
gtk_cell_renderer_get_padding ((GtkCellRenderer*) self, &_tmp5_, NULL);
917
_tmp9_ = contacts_cell_renderer_shape_get_name_layout (self, _tmp6_, &_tmp7_, _tmp8_);
918
_g_object_unref0 (name_layout);
919
name_layout = _tmp9_;
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_);
929
_tmp17_ = name_x_offset;
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)) {
940
GdkRectangle _tmp24_;
941
GtkCellRendererState _tmp25_;
942
PangoLayout* _tmp26_ = NULL;
944
GdkRectangle _tmp28_;
945
PangoLayout* _tmp29_;
948
PangoLayout* _tmp32_;
949
PangoRectangle _tmp33_ = {0};
951
PangoRectangle _tmp35_;
954
_tmp24_ = *cell_area;
956
_tmp26_ = contacts_cell_renderer_shape_get_presence_layout (self, _tmp23_, &_tmp24_, _tmp25_);
957
_g_object_unref0 (presence_layout);
958
presence_layout = _tmp26_;
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;
971
presence_x_offset = _tmp34_ - _tmp36_;
974
cairo_save (_tmp37_);
976
_tmp39_ = *cell_area;
977
gdk_cairo_rectangle (_tmp38_, &_tmp39_);
979
cairo_clip (_tmp40_);
982
_tmp43_ = *cell_area;
984
_tmp45_ = name_x_offset;
985
_tmp46_ = *cell_area;
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_;
994
GdkRectangle _tmp53_;
997
GdkRectangle _tmp56_;
1001
PangoLayout* _tmp60_;
1003
PangoLayout* _tmp62_;
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_);
1019
cairo_restore (_tmp63_);
1020
_g_object_unref0 (presence_layout);
1021
_g_object_unref0 (name_layout);
1022
_g_object_unref0 (context);
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;
1032
self = (ContactsCellRendererShape*) base;
1033
g_return_if_fail (widget != NULL);
1034
gtk_cell_renderer_get_padding ((GtkCellRenderer*) self, &_tmp0_, NULL);
1036
_vala_min_width = xpad + CONTACTS_CELL_RENDERER_SHAPE_default_width;
1037
_vala_nat_width = _vala_min_width;
1039
*min_width = _vala_min_width;
1042
*nat_width = _vala_nat_width;
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;
1055
self = (ContactsCellRendererShape*) base;
1056
g_return_if_fail (widget != NULL);
1057
gtk_cell_renderer_get_padding ((GtkCellRenderer*) self, NULL, &_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;
1066
if (natural_height) {
1067
*natural_height = _vala_natural_height;
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;
1082
self = (ContactsCellRendererShape*) base;
1083
g_return_if_fail (widget != NULL);
1085
gtk_cell_renderer_get_preferred_width ((GtkCellRenderer*) self, _tmp0_, &_tmp1_, NULL);
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_;
1092
*minimum_size = _vala_minimum_size;
1095
*natural_size = _vala_natural_size;
1100
void contacts_cell_renderer_shape_render_shape (ContactsCellRendererShape* self, cairo_t* cr, PangoAttrShape* attr, gboolean do_path) {
1101
PangoAttrShape* _tmp0_;
1102
PangoAttrShape* sattr;
1104
PangoAttrShape* _tmp2_;
1105
gconstpointer _tmp3_;
1106
const gchar* _tmp4_;
1107
GdkPixbuf* _tmp5_ = NULL;
1110
g_return_if_fail (self != NULL);
1111
g_return_if_fail (cr != NULL);
1112
g_return_if_fail (attr != NULL);
1114
sattr = (PangoAttrShape*) _tmp0_;
1115
_tmp1_ = self->priv->current_widget;
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);
1122
if (_tmp6_ != NULL) {
1126
gdouble _tmp8_ = 0.0;
1127
gdouble _tmp9_ = 0.0;
1134
cairo_get_current_point (_tmp7_, &_tmp8_, &_tmp9_);
1141
gdk_cairo_set_source_pixbuf (_tmp10_, _tmp11_, _tmp12_, _tmp13_ - (CONTACTS_CELL_RENDERER_SHAPE_IMAGE_SIZE * 0.7));
1143
cairo_paint (_tmp14_);
1145
_g_object_unref0 (pixbuf);
1149
ContactsCellRendererShape* contacts_cell_renderer_shape_construct (GType object_type) {
1150
ContactsCellRendererShape * self = NULL;
1151
self = (ContactsCellRendererShape*) g_object_new (object_type, NULL);
1156
ContactsCellRendererShape* contacts_cell_renderer_shape_new (void) {
1157
return contacts_cell_renderer_shape_construct (CONTACTS_TYPE_CELL_RENDERER_SHAPE);
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;
1171
void contacts_cell_renderer_shape_set_name (ContactsCellRendererShape* self, const gchar* value) {
1172
const gchar* _tmp0_;
1174
g_return_if_fail (self != NULL);
1176
_tmp1_ = g_strdup (_tmp0_);
1177
_g_free0 (self->priv->_name);
1178
self->priv->_name = _tmp1_;
1179
g_object_notify ((GObject *) self, "name");
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;
1193
void contacts_cell_renderer_shape_set_presence (ContactsCellRendererShape* self, FolksPresenceType value) {
1194
FolksPresenceType _tmp0_;
1195
g_return_if_fail (self != NULL);
1197
self->priv->_presence = _tmp0_;
1198
g_object_notify ((GObject *) self, "presence");
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;
1212
void contacts_cell_renderer_shape_set_message (ContactsCellRendererShape* self, const gchar* value) {
1213
const gchar* _tmp0_;
1215
g_return_if_fail (self != NULL);
1217
_tmp1_ = g_strdup (_tmp0_);
1218
_g_free0 (self->priv->_message);
1219
self->priv->_message = _tmp1_;
1220
g_object_notify ((GObject *) self, "message");
1224
gboolean contacts_cell_renderer_shape_get_is_phone (ContactsCellRendererShape* self) {
1227
g_return_val_if_fail (self != NULL, FALSE);
1228
_tmp0_ = self->priv->_is_phone;
1234
void contacts_cell_renderer_shape_set_is_phone (ContactsCellRendererShape* self, gboolean value) {
1236
g_return_if_fail (self != NULL);
1238
self->priv->_is_phone = _tmp0_;
1239
g_object_notify ((GObject *) self, "is-phone");
1243
gboolean contacts_cell_renderer_shape_get_show_presence (ContactsCellRendererShape* self) {
1246
g_return_val_if_fail (self != NULL, FALSE);
1247
_tmp0_ = self->priv->_show_presence;
1253
void contacts_cell_renderer_shape_set_show_presence (ContactsCellRendererShape* self, gboolean value) {
1255
g_return_if_fail (self != NULL);
1257
self->priv->_show_presence = _tmp0_;
1258
g_object_notify ((GObject *) self, "show-presence");
1262
static void contacts_cell_renderer_shape_icon_shape_copy (const ContactsCellRendererShapeIconShape* self, ContactsCellRendererShapeIconShape* dest) {
1263
const gchar* _tmp0_;
1265
_tmp0_ = (*self).icon;
1266
_tmp1_ = g_strdup (_tmp0_);
1267
_g_free0 ((*dest).icon);
1268
(*dest).icon = _tmp1_;
1272
static void contacts_cell_renderer_shape_icon_shape_destroy (ContactsCellRendererShapeIconShape* self) {
1273
_g_free0 ((*self).icon);
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);
1285
static void contacts_cell_renderer_shape_icon_shape_free (ContactsCellRendererShapeIconShape* self) {
1286
contacts_cell_renderer_shape_icon_shape_destroy (self);
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);
1298
return contacts_cell_renderer_shape_icon_shape_type_id__volatile;
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));
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;
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);
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);
1345
return contacts_cell_renderer_shape_type_id__volatile;
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));
1356
case CONTACTS_CELL_RENDERER_SHAPE_PRESENCE:
1357
g_value_set_enum (value, contacts_cell_renderer_shape_get_presence (self));
1359
case CONTACTS_CELL_RENDERER_SHAPE_MESSAGE:
1360
g_value_set_string (value, contacts_cell_renderer_shape_get_message (self));
1362
case CONTACTS_CELL_RENDERER_SHAPE_IS_PHONE:
1363
g_value_set_boolean (value, contacts_cell_renderer_shape_get_is_phone (self));
1365
case CONTACTS_CELL_RENDERER_SHAPE_SHOW_PRESENCE:
1366
g_value_set_boolean (value, contacts_cell_renderer_shape_get_show_presence (self));
1369
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
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));
1382
case CONTACTS_CELL_RENDERER_SHAPE_PRESENCE:
1383
contacts_cell_renderer_shape_set_presence (self, g_value_get_enum (value));
1385
case CONTACTS_CELL_RENDERER_SHAPE_MESSAGE:
1386
contacts_cell_renderer_shape_set_message (self, g_value_get_string (value));
1388
case CONTACTS_CELL_RENDERER_SHAPE_IS_PHONE:
1389
contacts_cell_renderer_shape_set_is_phone (self, g_value_get_boolean (value));
1391
case CONTACTS_CELL_RENDERER_SHAPE_SHOW_PRESENCE:
1392
contacts_cell_renderer_shape_set_show_presence (self, g_value_get_boolean (value));
1395
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);