GNOME Bugzilla – Bug 750587
JNI: get_n_accessible_children is not implemented
Last modified: 2015-06-14 21:14:43 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.
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
(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.
(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?
(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?
(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.
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.