API enhancement for 2.8.0

Paul Aurich paul at darkrain42.org
Mon Apr 11 02:28:22 EDT 2011


On 2011-04-04 05:13, Andrew Victor wrote:
> hi Elliott,
> 
>>> It will provide a mechanism for prpl's to provide some
>>> context-sensitive help on Request UI forms.
> 
>>> ============================================================
>>> --- libpurple/request.h f3460d06e7653696508046113ed3205809fb4add
>>> +++ libpurple/request.h 105dff1d6175f3637652a91a0aaf8475fb91e709
>>> @@ -108,6 +108,7 @@ struct _PurpleRequestField
>>>        char *id;
>>>        char *label;
>>>        char *type_hint;
>>> +       char *tooltip;
>>>
>>>        gboolean visible;
>>>        gboolean required;
>>
>> I'm not sure what the macro stuff around it does, but I don't think
>> this is ABI compatible, and would have to wait for 3.0.0. Perhaps
>> something could be done with the type_hint field. It's a string that
>> could potentially hold some sort of tooltip, but since the semantics
>> aren't really defined, I don't know how ABI-compatible that would be
>> considered.
> 
> I thought ABI/API changes where being accepted for 2.8.0?
> There have been some merged already (eg, add_buddy_with_invite,
> add_buddies_with_invite, etc)

API additions: yes.
ABI changes (a.k.a. breakage): no

Without speaking for Elliott, the issue I see with the above is that it
adds a "tooltip" entry in the middle of the struct (which is defined in
a .h, and part of the public API).  This both changes the size of the
struct and the offsets of everything after it (the latter point here is
more important).

Moving 'tooltip' to the end of the struct would *probably* be acceptable
(since only request.c should be malloc()ing the struct.

>>> +               if (tooltip != NULL)
>>> +                       gtk_widget_set_tooltip_text(textview, tooltip);
>>
>> Why are you checking for NULL here? Doesn't
>> gtk_widget_set_tooltip_text handle it? I would assume that would mean
>> "remove the current tooltip", though I don't think the libpurple API
>> would be able to do that anyway.
> 
> The GTK documentation isn't clear on what tooltip-text=NULL would do.

This should be investigated (and possibly tested), since tooltip-text=""
might show a blank tooltip, which would be horrid.

~Paul

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 897 bytes
Desc: OpenPGP digital signature
URL: <http://pidgin.im/pipermail/devel/attachments/20110410/f4204926/attachment.sig>


More information about the Devel mailing list