~ubuntu-branches/ubuntu/quantal/vala/quantal

« back to all changes in this revision

Viewing changes to vala/valasymbol.c

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-09-20 19:57:26 UTC
  • mfrom: (1.5.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20100920195726-cbxb3q400aj1hoqr
Tags: 0.10.0-0ubuntu1
* New upstream release
* debian/patches/90_revert_use_new_gir_version.patch:
  - don't build with new GIR

Show diffs side-by-side

added added

removed removed

Lines of Context:
361
361
        gboolean _external;
362
362
        ValaScope* _owner;
363
363
        ValaScope* _scope;
 
364
        char* _gir_name;
364
365
};
365
366
 
366
367
typedef enum  {
435
436
void vala_symbol_set_comment (ValaSymbol* self, ValaComment* value);
436
437
ValaScope* vala_scope_new (ValaSymbol* owner);
437
438
ValaScope* vala_scope_construct (GType object_type, ValaSymbol* owner);
 
439
char* vala_symbol_get_full_gir_name (ValaSymbol* self);
 
440
const char* vala_symbol_get_gir_name (ValaSymbol* self);
 
441
const char* vala_symbol_get_name (ValaSymbol* self);
438
442
char* vala_symbol_get_full_name (ValaSymbol* self);
439
 
const char* vala_symbol_get_name (ValaSymbol* self);
440
443
char* vala_symbol_get_cprefix (ValaSymbol* self);
441
444
static char* vala_symbol_real_get_cprefix (ValaSymbol* self);
442
445
char* vala_symbol_get_lower_case_cname (ValaSymbol* self, const char* infix);
510
513
ValaSymbol* vala_scope_get_owner (ValaScope* self);
511
514
void vala_symbol_set_owner (ValaSymbol* self, ValaScope* value);
512
515
void vala_scope_set_parent_scope (ValaScope* self, ValaScope* value);
 
516
void vala_symbol_set_gir_name (ValaSymbol* self, const char* value);
513
517
gboolean vala_symbol_get_active (ValaSymbol* self);
514
518
void vala_symbol_set_active (ValaSymbol* self, gboolean value);
515
519
gboolean vala_symbol_get_used (ValaSymbol* self);
638
642
 
639
643
 
640
644
/**
 
645
 * Returns the fully expanded GIR name of this symbol
 
646
 *
 
647
 * @return full GIR name
 
648
 */
 
649
char* vala_symbol_get_full_gir_name (ValaSymbol* self) {
 
650
        char* result = NULL;
 
651
        char* _tmp0_;
 
652
        gboolean _tmp1_;
 
653
        g_return_val_if_fail (self != NULL, NULL);
 
654
        if (vala_symbol_get_parent_symbol (self) == NULL) {
 
655
                result = g_strdup (vala_symbol_get_gir_name (self));
 
656
                return result;
 
657
        }
 
658
        if (self->priv->_name == NULL) {
 
659
                result = vala_symbol_get_full_gir_name (vala_symbol_get_parent_symbol (self));
 
660
                return result;
 
661
        }
 
662
        if ((_tmp1_ = (_tmp0_ = vala_symbol_get_full_gir_name (vala_symbol_get_parent_symbol (self))) == NULL, _g_free0 (_tmp0_), _tmp1_)) {
 
663
                result = g_strdup (vala_symbol_get_gir_name (self));
 
664
                return result;
 
665
        }
 
666
        if (g_str_has_prefix (self->priv->_name, ".")) {
 
667
                char* _tmp2_;
 
668
                char* _tmp3_;
 
669
                result = (_tmp3_ = g_strdup_printf ("%s%s", _tmp2_ = vala_symbol_get_full_gir_name (vala_symbol_get_parent_symbol (self)), vala_symbol_get_gir_name (self)), _g_free0 (_tmp2_), _tmp3_);
 
670
                return result;
 
671
        } else {
 
672
                char* _tmp4_;
 
673
                char* _tmp5_;
 
674
                result = (_tmp5_ = g_strdup_printf ("%s.%s", _tmp4_ = vala_symbol_get_full_gir_name (vala_symbol_get_parent_symbol (self)), vala_symbol_get_gir_name (self)), _g_free0 (_tmp4_), _tmp5_);
 
675
                return result;
 
676
        }
 
677
}
 
678
 
 
679
 
 
680
/**
641
681
 * Returns the fully expanded name of this symbol for use in
642
682
 * human-readable messages.
643
683
 *
1250
1290
}
1251
1291
 
1252
1292
 
 
1293
const char* vala_symbol_get_gir_name (ValaSymbol* self) {
 
1294
        const char* result;
 
1295
        const char* _tmp0_;
 
1296
        g_return_val_if_fail (self != NULL, NULL);
 
1297
        _tmp0_ = NULL;
 
1298
        if (self->priv->_gir_name == NULL) {
 
1299
                _tmp0_ = self->priv->_name;
 
1300
        } else {
 
1301
                _tmp0_ = self->priv->_gir_name;
 
1302
        }
 
1303
        result = _tmp0_;
 
1304
        return result;
 
1305
}
 
1306
 
 
1307
 
 
1308
void vala_symbol_set_gir_name (ValaSymbol* self, const char* value) {
 
1309
        char* _tmp0_;
 
1310
        g_return_if_fail (self != NULL);
 
1311
        self->priv->_gir_name = (_tmp0_ = g_strdup (value), _g_free0 (self->priv->_gir_name), _tmp0_);
 
1312
}
 
1313
 
 
1314
 
1253
1315
const char* vala_symbol_get_name (ValaSymbol* self) {
1254
1316
        const char* result;
1255
1317
        g_return_val_if_fail (self != NULL, NULL);
1441
1503
        self->priv->_deprecated = FALSE;
1442
1504
        self->priv->_deprecated_since = NULL;
1443
1505
        self->priv->_replacement = NULL;
 
1506
        self->priv->_gir_name = NULL;
1444
1507
}
1445
1508
 
1446
1509
 
1453
1516
        _vala_comment_unref0 (self->priv->_comment);
1454
1517
        _vala_collection_object_unref0 (self->priv->cheader_filenames);
1455
1518
        _vala_scope_unref0 (self->priv->_scope);
 
1519
        _g_free0 (self->priv->_gir_name);
1456
1520
        VALA_CODE_NODE_CLASS (vala_symbol_parent_class)->finalize (obj);
1457
1521
}
1458
1522