~ubuntu-branches/ubuntu/maverick/telepathy-glib/maverick

« back to all changes in this revision

Viewing changes to telepathy-glib/dbus-properties-mixin.c

  • Committer: Bazaar Package Importer
  • Author(s): Simon McVittie
  • Date: 2010-05-10 17:59:54 UTC
  • mfrom: (1.6.1 upstream) (27.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20100510175954-bxvqq3xx0sy4itmp
Tags: 0.11.5-1
New upstream version with new API/ABI

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include <telepathy-glib/svc-generic.h>
27
27
#include <telepathy-glib/util.h>
28
28
 
 
29
#define DEBUG_FLAG TP_DEBUG_PROPERTIES
 
30
#include "telepathy-glib/debug-internal.h"
 
31
 
29
32
/**
30
33
 * SECTION:dbus-properties-mixin
31
34
 * @title: TpDBusPropertiesMixin
64
67
 *
65
68
 * Bitfield representing allowed access to a property.
66
69
 *
 
70
 * Since 0.11.5, there is a corresponding #GFlagsClass type,
 
71
 * %TP_TYPE_DBUS_PROPERTIES_MIXIN_FLAGS.
 
72
 *
67
73
 * Since: 0.7.3
68
74
 */
69
75
 
70
76
/**
 
77
 * TP_TYPE_DBUS_PROPERTIES_MIXIN_FLAGS:
 
78
 *
 
79
 * The #GFlagsClass type of #TpDBusPropertiesMixinFlags.
 
80
 *
 
81
 * Since: 0.11.5
 
82
 */
 
83
 
 
84
/**
71
85
 * TpDBusPropertiesMixinPropInfo:
72
86
 * @name: Quark representing the property's name
73
87
 * @flags: Flags representing read/write access to the property
348
362
 
349
363
  if (iface_info == NULL)
350
364
    {
351
 
      g_critical ("%s tried to implement undefined interface %s",
 
365
      CRITICAL ("%s tried to implement undefined interface %s",
352
366
          g_type_name (type), iface_impl->name);
353
367
      return FALSE;
354
368
    }
379
393
 
380
394
      if (prop_impl->mixin_priv == NULL)
381
395
        {
382
 
          g_critical ("%s tried to implement nonexistent property %s"
 
396
          CRITICAL ("%s tried to implement nonexistent property %s"
383
397
              " on interface %s", g_type_name (type), prop_impl->name,
384
398
              iface_impl->name);
385
399
          return FALSE;
389
403
  return TRUE;
390
404
}
391
405
 
 
406
/* if this assertion fails, TpDBusPropertiesMixinIfaceImpl.mixin_next (which
 
407
 * used to be a GCallback but is now a gpointer) will be an ABI break on this
 
408
 * architecture, so do some evil trick with unions or something */
 
409
tp_verify (sizeof (GCallback) == sizeof (gpointer));
392
410
 
393
411
/**
394
412
 * tp_dbus_properties_mixin_implement_interface:
464
482
      /* assert that we're not trying to implement the same interface twice */
465
483
      for (iter = next;
466
484
           iter != NULL && iter->name != NULL;
467
 
           iter = iter->mixin_next.priv)
 
485
           iter = iter->mixin_next)
468
486
        {
469
487
          TpDBusPropertiesMixinIfaceInfo *other_info = iter->mixin_priv;
470
488
 
472
490
 
473
491
          if (G_UNLIKELY (other_info->dbus_interface == iface))
474
492
            {
475
 
              g_critical ("type %s tried to implement interface %s with %s "
 
493
              CRITICAL ("type %s tried to implement interface %s with %s "
476
494
                  "twice", g_type_name (type), g_quark_to_string (iface),
477
495
                  G_STRFUNC);
478
496
              goto out;
493
511
 
494
512
              if (G_UNLIKELY (other_info->dbus_interface == iface))
495
513
                {
496
 
                  g_critical ("type %s tried to implement interface %s with %s "
 
514
                  CRITICAL ("type %s tried to implement interface %s with %s "
497
515
                      "and also in static data", g_type_name (type),
498
516
                      g_quark_to_string (iface), G_STRFUNC);
499
517
                  goto out;
503
521
#endif
504
522
 
505
523
      /* form a linked list */
506
 
      iface_impl->mixin_next.priv = next;
 
524
      iface_impl->mixin_next = next;
507
525
      g_type_set_qdata (type, extras_quark, iface_impl);
508
526
    }
509
527
 
593
611
 
594
612
          if (G_UNLIKELY (iface_quark == other_info->dbus_interface))
595
613
            {
596
 
              g_critical ("type %s tried to implement interface %s in static "
 
614
              CRITICAL ("type %s tried to implement interface %s in static "
597
615
                  "data twice", g_type_name (type), iface_impl->name);
598
616
              goto out;
599
617
            }
646
664
 
647
665
      for (iface_impl = g_type_get_qdata (type, extras_quark);
648
666
           iface_impl != NULL;
649
 
           iface_impl = iface_impl->mixin_next.priv)
 
667
           iface_impl = iface_impl->mixin_next)
650
668
        {
651
669
          iface_info = iface_impl->mixin_priv;
652
670