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 649804 - AtkAction would be better with add/remove methods
AtkAction would be better with add/remove methods
Status: RESOLVED OBSOLETE
Product: atk
Classification: Platform
Component: atk
unspecified
Other Linux
: Normal normal
: ---
Assigned To: ATK maintainer(s)
ATK maintainer(s)
Depends on:
Blocks: 638537
 
 
Reported: 2011-05-09 15:00 UTC by Alejandro Piñeiro Iglesias (IRC: infapi00)
Modified: 2021-06-10 11:27 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Alejandro Piñeiro Iglesias (IRC: infapi00) 2011-05-09 15:00:30 UTC
Right now AtkAction are targetted to implement it and define all the actions on that implementation. But this makes complex to implement things like this:

a)
Object A: defines X actions

Object B (A subclass): define Y additional actions.

Accessible object for Object B would required to redefine AtkAction and being sure that call his parent to get the proper number of actions and all the actions.

b) 
Object A: defines X actions

Object B (A subclass): redefines one action

Object B would require to implement AtkAction, and probably reimplement all those X actions.

So I propose to improve AtkAction by adding add/remove functions. And probably adding the registration stuff on AtkAction, so Object A and Object B would just require to be sure that add/remove the proper actions.

Probably that would also good to create a "action dictionary" with some common-toolkit.

This approach is used on Gail (gailcell) and on CallyActor:

http://git.gnome.org/browse/clutter/tree/clutter/cally/cally-actor.h
Comment 1 Alejandro Piñeiro Iglesias (IRC: infapi00) 2011-05-12 16:34:34 UTC
ATK 2011 Hackfest Conclusion:

 * It doesn't solve any real problem, Alejandro Piñeiro just felt that would make code cleaner
 * People not sure if it is really worth at this moment, as it is more like a nitpick
 * In the case of cally that wouldn't require a lot of changes, but in the case of gail yes.
 * It is an ATK2 thing, so as it is a low priority thing, we can consider it later.
Comment 2 André Klapper 2011-06-23 22:06:14 UTC
[Mass-reassigning open atk bug reports for better trackability as requested in https://bugzilla.gnome.org/show_bug.cgi?id=653179 .
PLEASE NOTE:
If you have watched the previous assignee of this bug report as a workaround for actually getting notified of changes in atk bugs, you yourself will now have to add atk-maint@gnome.bugs to your watchlist at the bottom of https://bugzilla.gnome.org/userprefs.cgi?tab=email to keep watching atk bug reports in GNOME Bugzilla.
Sorry for the noise: Feel free to filter for this comment in order to mass-delete the triggered bugmail.]
Comment 3 Alejandro Piñeiro Iglesias (IRC: infapi00) 2012-01-21 14:43:28 UTC
ATK 2012 Hackfest additional conclusions:

  * It would be good to have a signal to emit if a action is added/removed
    * Bad idea to emit those during creation time
  * But this could be problematic with the fact that do_action is based on the index
    * Deprecate that method
    * Add a do_action_by_name method
Comment 4 Sascha Silbe 2012-07-30 15:45:40 UTC
Having an interface to add (and maybe remove) actions would be very useful for custom widgets like we use in Sugar [1]. To give a concrete example:
Our "owner icon" (XO icon representing the user [2]) is derived from GtkEventBox and exposes a context menu ("Palette" in Sugar terms) on right-click or hover. This is a new action (probably "menu") that our subclass adds. GtkEventBox itself has no actions defined at all. With the current ATK API, we have to provide our own custom instance of AtkObject/AtkAction instead of just calling a single method like we do for names, descriptions, roles and relationships.


[1] https://wiki.sugarlabs.org/go/What_is_Sugar%3F
[2] https://wiki.sugarlabs.org/go/Human_Interface_Guidelines#Home
Comment 5 Sascha Silbe 2012-07-30 15:52:52 UTC
Forgot to mention: In Sugar, Palettes can be attached to many different widgets. With a setter method, we'd only need to add a single line of code to take care of all cases. With the current API, we will need custom AtkObject instances for all the different widgets that can have a Palette.
Comment 6 Alejandro Piñeiro Iglesias (IRC: infapi00) 2012-07-30 16:04:06 UTC
(In reply to comment #5)
> Forgot to mention: In Sugar, Palettes can be attached to many different
> widgets. With a setter method, we'd only need to add a single line of code to
> take care of all cases. With the current API, we will need custom AtkObject
> instances for all the different widgets that can have a Palette.

This is a good point that I forgot to mention on the original description. Adding that _add/_remove API would allow to add actions per instance, instead of just per-class.
Comment 7 André Klapper 2021-06-10 11:27:20 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version of atk, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a ticket at
  https://gitlab.gnome.org/GNOME/atk/-/issues/

Thank you for your understanding and your help.