After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 750587 - JNI: get_n_accessible_children is not implemented
JNI: get_n_accessible_children is not implemented
Status: RESOLVED NOTABUG
Product: java-atk-wrapper
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: java-atk-wrapper maintainer(s)
java-atk-wrapper maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-06-08 17:52 UTC by Magdalen Berns (irc magpie)
Modified: 2015-06-14 21:14 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Magdalen Berns (irc magpie) 2015-06-08 17:52:46 UTC
The wrapper is using atk_class->get_n_children to define a function, jaw_object_get_n_children.

However, the function it looks for should be atk_class->get_n_accessible_children since atk_class->get_n_children is not a function in the AtkObject base class.
Comment 1 Magdalen Berns (irc magpie) 2015-06-08 18:10:24 UTC
Actually it seems this might actually just be a documentation issue for ATK.[1] 

jawobject.c:54:12: error: 'AtkObjectClass {aka struct _AtkObjectClass}' has no member named 'get_n_accessible_children'

Will cc Alejandro to get confirmation.

[1] https://developer.gnome.org/atk/unstable/AtkObject.html#atk-object-get-n-accessible-children
Comment 2 Alejandro Piñeiro Iglesias (IRC: infapi00) 2015-06-08 18:16:19 UTC
(In reply to Magdalen Berns (irc magpie) from comment #0)
> The wrapper is using atk_class->get_n_children to define a function,
> jaw_object_get_n_children.

Note that this is correct. Take a look to atk_class pointer:
https://git.gnome.org/browse/atk/tree/atk/atkobject.h#n550

The function pointer is named (*get_n_children). 

> However, the function it looks for should be
> atk_class->get_n_accessible_children 

Anyway I understand the confusion as the public ATK method is called atk_object_get_n_accessible_children:

https://git.gnome.org/browse/atk/tree/atk/atkobject.h#n700

This name mismatch was always confusing (at least to me). There are some ways to solve this name mismatch, but Im not sure if it is worth at this point, as would involve adding new API and glue code to ensure that nothing breaks.

> since atk_class->get_n_children is not
> a function in the AtkObject base class.

As I mentioned it is.
Comment 3 Alejandro Piñeiro Iglesias (IRC: infapi00) 2015-06-08 18:19:13 UTC
(In reply to Magdalen Berns (irc magpie) from comment #1)
> Actually it seems this might actually just be a documentation issue for
> ATK.[1] 
> 
> jawobject.c:54:12: error: 'AtkObjectClass {aka struct _AtkObjectClass}' has
> no member named 'get_n_accessible_children'
> 
> Will cc Alejandro to get confirmation.

Mid-air collision ;) I hope my previous comment explains the situation. Having said so ...

> [1]
> https://developer.gnome.org/atk/unstable/AtkObject.html#atk-object-get-n-
> accessible-children

... about documentation, do you mean document on atk_object_get_n_accessible_children that there is a name mismatch on the atk_class in the case that you want to redefine that method?
Comment 4 Magdalen Berns (irc magpie) 2015-06-09 10:55:52 UTC
(In reply to Alejandro Piñeiro Iglesias (IRC: infapi00) from comment #3)
> (In reply to Magdalen Berns (irc magpie) from comment #1)
> > Actually it seems this might actually just be a documentation issue for
> > ATK.[1] 
> > 
> > jawobject.c:54:12: error: 'AtkObjectClass {aka struct _AtkObjectClass}' has
> > no member named 'get_n_accessible_children'
> > 
> > Will cc Alejandro to get confirmation.
> 
> Mid-air collision ;) I hope my previous comment explains the situation.
> Having said so ...
> 
> > [1]
> > https://developer.gnome.org/atk/unstable/AtkObject.html#atk-object-get-n-
> > accessible-children
> 
> ... about documentation, do you mean document on
> atk_object_get_n_accessible_children that there is a name mismatch on the
> atk_class in the case that you want to redefine that method?

I guess I could do something like:

  atk_class->get_n_children = jaw_object_get_n_accessible_children;

which might make it less confusing to those looking for jaw_object_get_n_accessible_children.

Do you think that would that make more sense?
Comment 5 Alejandro Piñeiro Iglesias (IRC: infapi00) 2015-06-10 16:50:52 UTC
(In reply to Magdalen Berns (irc magpie) from comment #4)
> (In reply to Alejandro Piñeiro Iglesias (IRC: infapi00) from comment #3)
> > (In reply to Magdalen Berns (irc magpie) from comment #1)
> > > Actually it seems this might actually just be a documentation issue for
> > > ATK.[1] 
> > > 
> > > jawobject.c:54:12: error: 'AtkObjectClass {aka struct _AtkObjectClass}' has
> > > no member named 'get_n_accessible_children'
> > > 
> > > Will cc Alejandro to get confirmation.
> > 
> > Mid-air collision ;) I hope my previous comment explains the situation.
> > Having said so ...
> > 
> > > [1]
> > > https://developer.gnome.org/atk/unstable/AtkObject.html#atk-object-get-n-
> > > accessible-children
> > 
> > ... about documentation, do you mean document on
> > atk_object_get_n_accessible_children that there is a name mismatch on the
> > atk_class in the case that you want to redefine that method?
> 
> I guess I could do something like:
> 
>   atk_class->get_n_children = jaw_object_get_n_accessible_children;
> 
> which might make it less confusing to those looking for
> jaw_object_get_n_accessible_children.
> 
> Do you think that would that make more sense?

Well, take into account that jaw_object_get_n_accessible_children would be a private method, the implementation of that virtual method. No one outside of JAW would use it. at-spi2 will only use atk_object_get_n_accessible_children. at-spi2 doesn't care how you call the specific method that implement it. So as I just mentioned, how you call the specific method that implements atk_class->get_n_children is a implementation detail on your library. So use the name that it is less confusing for you. 

FWIW, on clutter I just used ...get_n_children:
https://git.gnome.org/browse/clutter/tree/clutter/cally/cally-actor.c#n284

And gtk developers do something similar:
https://git.gnome.org/browse/gtk+/tree/gtk/a11y/gtkcontaineraccessible.c#n198

So again, you can have a private method called jaw_object_get_n_accessible_children or jaw_object_get_n_children, as you prefer.
Comment 6 Magdalen Berns (irc magpie) 2015-06-14 21:14:43 UTC
Thanks for the info. That's really useful. I reckon if it ain't broke, there's no need to fix it so I'll leave it as is.