Re: About making public gtk accessibility headers



On 08/08/2012 12:35 AM, Matthias Clasen wrote:
> On Tue, Aug 7, 2012 at 12:58 PM, Piñeiro <apinheiro igalia com> wrote:
>> On 08/07/2012 03:17 PM, Matthias Clasen wrote:
>
>
>> BTW. At this moment we can't implement d) directly using
>> gtk_widget_class_set_accessible_type at this moment. As it is said on his
>> documentation [2] "The given type must be a subtype of the type used for
>> accessibles of the parent class. ".
> Hmm, the docs do say that, indeed. But the code doesn't enforce it.
>

>From the code:

void
gtk_widget_class_set_accessible_type (GtkWidgetClass *widget_class,
                                                             
GType           type)
{
  GtkWidgetClassPrivate *priv;

  g_return_if_fail (GTK_IS_WIDGET_CLASS (widget_class));
  g_return_if_fail (g_type_is_a (type,
widget_class->priv->accessible_type));

This return_if_fail is the line enforcing it. If the new type is not a
type of the current assigned accessible type, it returns. In the case of
evince and EvView, gtkcontainer class init will set the accessible_type
to GtkContainerAccessible.

Anyway, it is true that I'm wrong (Mario Sanchez pointed me that). It is
possible to implement directly d), you just need to reimplement
gtkwidget virtual method get_accessible. Sorry for the noise.

But as I said doing that will enforce third party applications to
reimplement a lot of stuff. After a look to gtkaccessible (the only one
empty), this is basically empty. In the case of EvView, EvViewAccessible
should reimplement the atk interfaces implemented at gtkwidgetaccessible
(ie: AtkComponent interface, about ) and the ones at gtkwidgetcontainer.
When IMHO, it shouldn't be required.

BR

-- 
Alejandro Piñeiro Iglesias



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]