[1.0] simplify TpPresenceMixin
Submitted by Simon McVittie
Assigned to Simon McVittie
Description
Now that we have SimplePresence:
TpPresenceStatusOptionalArgumentSpec should go away altogether.
TpPresenceStatusSpec should replace
gboolean self;
const TpPresenceStatusOptionalArgumentSpec *optional_arguments;
with
typedef enum {
/*`< flags >`*/
TP_PRESENCE_STATUS_SPEC_FLAGS_NONE = 0,
TP_PRESENCE_STATUS_SPEC_FLAGS_CAN_SET_ON_SELF = (1 << 1),
TP_PRESENCE_STATUS_SPEC_FLAGS_HAS_MESSAGE = (1 << 2)
} TpPresenceStatusSpecFlags;
TpPresenceStatusSpecFlags flags;
(or possibly a pair of gbooleans but I think it's clearer as a flags word).
The vfuncs in TpPresenceMixinClass should move to a GInterface that the Connection implements (TpPresenceMixable?), to allow for introspection in future. The data should hang off the object using qdata so explicit finalize isn't needed; eventually we'd only need void tp_presence_mixin_init (TpPresenceMixable *self), although for the moment we'll still need tp_presence_mixin_iface_init() and tp_presence_mixin_init_dbus_properties().
tp_presence_status_new should be replaced by:
TpPresenceStatus *tp_presence_status_new (guint which, const gchar *message) G_GNUC_WARN_UNUSED_RESULT;
or maybe even
TpPresenceStatus *tp_presence_status_new (TpPresenceMixable *self, const TpPresenceStatusSpec *spec, const gchar *message) G_GNUC_WARN_UNUSED_RESULT;
TpPresenceMixinStatusAvailableFunc should take a const TpPresenceStatusSpec * too.
Version: git master