Bug 14828

Summary: TpChannel: make the struct layout public for read-only access
Product: Telepathy Reporter: Simon McVittie <smcv>
Component: tp-glibAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on: 14180    
Bug Blocks:    

Description Simon McVittie 2008-03-05 05:07:38 UTC
12:58 < Zdra> smcv: what about adding gboolean tp_channel_is_ready(channel) 
              {return self->ready}
12:59 < Zdra> it's more convenient than gboolean ready; g_object_get (G_OBJECT 
              (channel), "ready", &ready);
13:00 < smcv> Zdra: it'll be a public member of the struct, when the struct 
              becomes public
13:00 < Zdra> smcv: ah, you are planning to move the struct as public
13:01 < smcv> yeah, that's why it has a TpChannelPrivate part
13:01 < smcv> I haven't quite decided how groups are going to work, though
13:01 < smcv> so I don't want to make any guarantees about the contents
Comment 1 Alberto Mardegan 2008-03-05 23:38:47 UTC
Since we cannot know for sure that in the future we'd add some interfaces or data that might turn out to be extremely useful to have them as public read-only members in the struct, what about adding a

const TpChannelXxxData *tp_channel_get_xxx_interface_data (TpChannel *);

that returns a pointer to an read-only structure containing data specific to the Xxx (Group, for instance) interface?
In this way we can add data structs for all interfaces for which this might be useful.

This is only about interfaces; I also think that the base properties of TpChannel should be exposed in its structure, but probably not any interface-specific data.
Comment 2 Simon McVittie 2008-03-06 02:56:09 UTC
(In reply to comment #1)
> Since we cannot know for sure that in the future we'd add some interfaces or
> data that might turn out to be extremely useful to have them as public
> read-only members in the struct, what about adding a
> 
> const TpChannelXxxData *tp_channel_get_xxx_interface_data (TpChannel *);
> 
> that returns a pointer to an read-only structure containing data specific to
> the Xxx (Group, for instance) interface?

I plan to do exactly that for all other interfaces, but I think Group is sufficiently fundamental that it ought to go in the "base" struct, which is why #14180 blocks this bug.
Comment 3 Simon McVittie 2008-07-17 07:17:42 UTC
Taking a cue from the new Gtk policy, I've decided not to expose any public struct members - I've been adding function-based accessors instead.

Fixed in darcs, will be in 0.7.12.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.