~ubuntu-branches/ubuntu/utopic/gnome-contacts/utopic

« back to all changes in this revision

Viewing changes to src/contacts-utils.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-06-05 12:37:30 UTC
  • mfrom: (1.3.9)
  • Revision ID: package-import@ubuntu.com-20130605123730-8gbbil6rxy9agv78
Tags: 3.8.2-0ubuntu1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* contacts-utils.c generated by valac 0.19.0.2-fa647, the Vala compiler
 
1
/* contacts-utils.c generated by valac 0.20.0.5-3c0efc, the Vala compiler
2
2
 * generated from contacts-utils.vala, do not modify */
3
3
 
4
4
/* -*- Mode: vala; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 8 -*- */
100
100
void contacts_utils_cairo_ellipsis (cairo_t* cr, gdouble xc, gdouble yc, gdouble xradius, gdouble yradius, gdouble angle1, gdouble angle2);
101
101
void contacts_utils_cairo_rounded_box (cairo_t* cr, gint x, gint y, gint width, gint height, gint radius);
102
102
static gunichar contacts_utils_strip_char (gunichar ch);
 
103
gboolean contacts_utils_string_is_empty (const gchar* str);
103
104
gchar* contacts_utils_canonicalize_for_search (const gchar* str);
104
105
void contacts_utils_grab_widget_later (GtkWidget* widget);
105
106
static Block37Data* block37_data_ref (Block37Data* _data37_);
624
625
}
625
626
 
626
627
 
 
628
static gboolean string_get_next_char (const gchar* self, gint* index, gunichar* c) {
 
629
        gunichar _vala_c = 0U;
 
630
        gboolean result = FALSE;
 
631
        gint _tmp0_;
 
632
        gunichar _tmp1_ = 0U;
 
633
        gunichar _tmp2_;
 
634
        g_return_val_if_fail (self != NULL, FALSE);
 
635
        _tmp0_ = *index;
 
636
        _tmp1_ = g_utf8_get_char (((gchar*) self) + _tmp0_);
 
637
        _vala_c = _tmp1_;
 
638
        _tmp2_ = _vala_c;
 
639
        if (_tmp2_ != ((gunichar) 0)) {
 
640
                gint _tmp3_;
 
641
                gchar* _tmp4_ = NULL;
 
642
                _tmp3_ = *index;
 
643
                _tmp4_ = g_utf8_next_char (((gchar*) self) + _tmp3_);
 
644
                *index = (gint) (_tmp4_ - ((gchar*) self));
 
645
                result = TRUE;
 
646
                if (c) {
 
647
                        *c = _vala_c;
 
648
                }
 
649
                return result;
 
650
        } else {
 
651
                result = FALSE;
 
652
                if (c) {
 
653
                        *c = _vala_c;
 
654
                }
 
655
                return result;
 
656
        }
 
657
        if (c) {
 
658
                *c = _vala_c;
 
659
        }
 
660
}
 
661
 
 
662
 
 
663
gboolean contacts_utils_string_is_empty (const gchar* str) {
 
664
        gboolean result = FALSE;
 
665
        gunichar c = 0U;
 
666
        g_return_val_if_fail (str != NULL, FALSE);
 
667
        {
 
668
                gint i;
 
669
                i = 0;
 
670
                {
 
671
                        gboolean _tmp0_;
 
672
                        _tmp0_ = TRUE;
 
673
                        while (TRUE) {
 
674
                                gboolean _tmp1_;
 
675
                                const gchar* _tmp2_;
 
676
                                gunichar _tmp3_ = 0U;
 
677
                                gboolean _tmp4_ = FALSE;
 
678
                                gunichar _tmp5_;
 
679
                                gboolean _tmp6_ = FALSE;
 
680
                                _tmp1_ = _tmp0_;
 
681
                                if (!_tmp1_) {
 
682
                                }
 
683
                                _tmp0_ = FALSE;
 
684
                                _tmp2_ = str;
 
685
                                _tmp4_ = string_get_next_char (_tmp2_, &i, &_tmp3_);
 
686
                                c = _tmp3_;
 
687
                                if (!_tmp4_) {
 
688
                                        break;
 
689
                                }
 
690
                                _tmp5_ = c;
 
691
                                _tmp6_ = g_unichar_isspace (_tmp5_);
 
692
                                if (!_tmp6_) {
 
693
                                        result = FALSE;
 
694
                                        return result;
 
695
                                }
 
696
                        }
 
697
                }
 
698
        }
 
699
        result = TRUE;
 
700
        return result;
 
701
}
 
702
 
 
703
 
627
704
static gchar string_get (const gchar* self, glong index) {
628
705
        gchar result = '\0';
629
706
        glong _tmp0_;