summaryrefslogtreecommitdiff
path: root/atspi/atspi-event-listener.c
Commit message (Collapse)AuthorAgeFilesLines
* Reformat all the *.[ch] files with clang-formatFederico Mena Quintero2022-12-061-387/+402
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I ran this on each directory with C files: clang-format -i *.[ch] "-i" is the in-place option. I also adjusted the order of #includes for some files which failed to build after that: Clang-format reorders blocks of #include directives alphabetically, but they can be grouped and separated by blank lines. If there is a blank line between blocks, like #include "zork.h" #include "bar.h" #include "foo.h" then it will not put zork.h after the other two. The last two header files will be sorted alphabetically. We can adjust the formatting of chunks of code by hand with comments like these: /* clang-format off */ this code { is, formatted, by, hand; } /* clang-format on */ See https://clang.llvm.org/docs/ClangFormat.html for the general manual and https://clang.llvm.org/docs/ClangFormatStyleOptions.html for the style options and the comments described above.
* Docs: Move to gi-docgenThomas Booker2022-09-281-0/+12
|
* Add an "announcement" event/signal to allow objects to send notificationsMike Gorse2022-08-041-0/+1
| | | | Fixes #63
* Rename _atspi_dbus_return_accessible_from_iter to _atspi_dbus_consume_accessibleFederico Mena Quintero2022-07-121-1/+1
| | | | Makes it clear that the iter is being advanced, hopefully?
* Revert "Add an "announcement" event/signal to allow objects to send ↵Mike Gorse2022-07-021-1/+0
| | | | | | | | notifications" This breaks ABI for atk. Reverting for now. This reverts commit 28d732a20180b5b3f07cb0079b9d9943b881b929.
* Add atspi_event_listener_register_with_appMike Gorse2022-07-021-25/+97
| | | | | | Allows an event listener to be registered only for a given application. Fixes #52
* Add an "announcement" event/signal to allow objects to send notificationsMike Gorse2022-07-021-0/+1
| | | | Fixes #63
* Remove unused field BusDataClosure.dataFederico Mena Quintero2022-06-021-1/+1
| | | | | | | | | | | | | | | | The comment "TODO this is still memory leak on c->data" from destroy_deferred_message_item() caught my eye, so I went looking for what uses it. defer_message() is the only place that creates BusDataClosure structs, and gets passed the data field. However, the only caller of defer_message() is dbus_connection_add_filter(), and *that* call is done with both NULL user_data and free_data_function. So, defer_message() will always get data=NULL. This commit also removes all the "void *user_data" arguments from the functions called by process_deferred_message(); they just got passed the closure->data but none of them actually use it.
* _atspi_dbus_handle_event(): assert that the event source is not NULL before ↵Federico Mena Quintero2021-12-141-0/+2
| | | | | | | | | | | | | | processing the event Once we demarshal, the event.source should not be NULL. It can come from the message path if it is *not* being a ScreenReader event, or from a variant argument. Fixes static-scan warnings of this sort: ../../../atspi/atspi-event-listener.c:248:9: warning: Access to field 'accessible_parent' results in a dereference of a null pointer (loaded from field 'source') [core.NullDereference] if (event->source->accessible_parent) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* _atspi_dbus_handle_event(): return early if the category or interface name ↵Federico Mena Quintero2021-12-141-0/+7
| | | | | | | | | | | is NULL I don't know why the interface would be NULL, but dbus_message_get_interface() can return that. We return DBUS_HANDLER_RESULT_NOT_YET_HANDLED in the same way as the other error case, but note that the caller of this function ignores the return value.
* Fix double free when removing event listenersMike Gorse2021-04-211-1/+4
| | | | Fixes https://gitlab.gnome.org/GNOME/at-spi2-core/issues/35
* Fix an invalid free introduced in 2.39.90, along with some warningsMike Gorse2021-02-221-2/+3
| | | | Fixes https://gitlab.gnome.org/GNOME/at-spi2-core/issues/30
* Fix memory leaksBartlomiej Grzelewski2021-02-121-0/+8
| | | | | | | | | | | * Release memory before pointer overwrite. * Reduce memory leaks reported in ref_accessible. * Remove leak connected with atspi_state_type_get_type. * Remove memory leak in atspi_event_listener_register_from_callback_full. * Reduce memory leaks reported on program exit. Change-Id: Ifde65dd44643f2e58442cf70809703f979436e09
* Fix handling of event listener removals during an event callbackMike Gorse2020-09-021-2/+29
| | | | | | We should not modify event_listeners while we are iterating through it. Otherwise, we may crash. If an event listener is removed from within an event callback, then defer the removal until the callback has ended.
* Merge branch 'patch-1' into 'master'Mike Gorse2020-08-101-1/+1
|\ | | | | | | | | Keep indentation See merge request GNOME/at-spi2-core!47
| * Keep indentationShinwoo Kim2020-08-101-1/+1
| |
* | Fix possible memory leakMike Gorse2020-08-101-0/+1
|/ | | | Thanks to Shimwoo Kim for spotting.
* Fix use after free when an event listener is destroyedMike Gorse2020-06-161-6/+4
| | | | | | Properly remove event listeners from the list when they are deregistered. Fixes a crash that can happen when orca exits. Similar issue to https://gitlab.gnome.org/GNOME/at-spi2-core/issues/22
* Use the event name when sending screen reader events over dbusMike Gorse2020-05-271-31/+1
| | | | | | | | | For screen reader events, look at the name of the signal and convert it, rather than hard-coding "RegionChanged." This is necessary to allow screen_reader_signal_watcher to process signals that will be added in the future. https://gitlab.gnome.org/GNOME/orca/issues/36
* Fix use after free when freeing an eventMike Gorse2019-09-041-1/+1
|
* Relicense as LGPL 2.1Mike Gorse2019-08-281-4/+4
| | | | Fixes https://gitlab.gnome.org/GNOME/at-spi2-core/issues/2
* Fix outdated FSF addressMike Gorse2019-08-271-2/+2
|
* Add a sender to the AtspiEvent struct.Mike Gorse2019-07-181-1/+6
| | | | | | | | | | Normally, this is set to the application / root accessible from the application corresponding to the event source, but screen-reader-generated events are actually generated by the screen reader. The sender is set based on the application that sent the signal over dbus, so, in the latter case, this will be set to the screen reader. Per discussion at https://gitlab.gnome.org/GNOME/orca/issues/36
* Refactor the API for the screen reader to notify listeners of its statusMike Gorse2019-07-181-79/+58
| | | | | | | Remove atspi_text_notify_reading_position, and instead add a region_changed signal. Also make the dbus API more like the API used for other events. Per discussion at https://gitlab.gnome.org/GNOME/orca/issues/36
* More updates related to reading position notificationsMike Gorse2019-05-051-53/+93
| | | | | | | | | Allow a client to receive notifications through AtspiEventListeners. This involves special casing, since the event is generated by the screen reader, not the GUI, and is, thus, handled by a different DBus interface, but, from the client's perspective, it looks like a normal AT-SPI event. Also renamed atspi_text_notify_read_position to atspi_text_notify_reading_position and fixed a few warnings.
* Include strings.h for strcasecmpMike Gorse2019-03-031-0/+1
| | | | Fixes https://gitlab.gnome.org/GNOME/at-spi2-core/issues/5
* atspi: Update error logsTapasweni Pathak2018-10-041-3/+3
| | | | Error logs has different naming convention in atspi/ files.
* Fix a couple of introspection issuesRico Tzschichholz2017-07-031-0/+12
| | | | | | This mainly restores the gir entry for AtspiApplication. https://bugzilla.gnome.org/show_bug.cgi?id=784481
* atspi-event-listener: Plug a memory leakRui Matos2016-04-111-0/+3
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=764688
* Fix reversed check for NULL childOwen W. Taylor2015-10-241-1/+1
| | | | | | | The check for an unknown child path resulting in a NULL child added in a614d447f was backwards. https://bugzilla.gnome.org/show_bug.cgi?id=755951
* Don't crash if we get a object:children-changed event with a non-existent childOwen W. Taylor2015-10-121-0/+2
| | | | | | | | If we get a :children-changed event with the path for the child not matching any accessible in the application, event->any_data would end up with a NULL child, triggering a crash. https://bugzilla.gnome.org/show_bug.cgi?id=755951
* Modified cache API to include index and child count rather than childrenMike Gorse2015-08-141-7/+13
| | | | | | | | | | | | | | | The original cache API was problematic for QT AT-SPI because it forces enumeration of all children, preventing lazy instantiation of objects. The API now sends the object's index in parent and child count (or -1 if not known / children should not be cached) rather than an array of children. Also made cache of children a GPtrArray rather than a GList, since it may contain holes. If an object has not yet been instantiated for a particular child, then its value will be set to NULL, and atspi_accessible_get_child_at_index will make a dbus call to fetch the child, at which point it will be cached. https://bugzilla.gnome.org/show_bug.cgi?id=650090
* Fix lifecycle of an accessible's cacheMike Gorse2014-07-191-1/+1
| | | | | When a cache is referenced in response to an event, it is supposed to be unref'd after the event handler has been called.
* Add a check NULL of the source accessible handling an eventAlejandro Piñeiro2014-03-171-0/+5
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=726243
* Don't pass empty property array to RegisterEventMike Gorse2014-02-241-6/+13
| | | | | | | | | | | | | | Apparently, for some reason unknown to me, it is sometimes possible for a jhbuild session to be running an at-spi2-registryd from the system directory, rather than the jhbuild install, so it is useful to be compatible with at-spi2-registryd <= 3.10. So, for now, if no properties are being requested with an event, then let's leave off the (empty) array. Also modify at-spi2-registryd to accept the old form of RegisterEvent. We may want to revert this eventually; it would be cleaner not to send two different forms of RegisterEvent.
* Allow caching of data sent with events and requesting such dataMike Gorse2014-02-011-12/+86
| | | | | | | | | | | | | Add atspi_event_listener_register_full, to request that particular data be sent with an event, and cache the data for the duration of the event callback. This also extends the D-Bus protocol, adding an a{sv} to an event to send this data along, but we will still read events without this array added for backwards compatibility (and compatibilllity with QT-AT-SPI, which does not send this data for now). https://bugzilla.gnome.org/show_bug.cgi?id=708695
* Make AtspiEventListenerCb not call for a const datumMike Gorse2013-10-101-1/+1
| | | | | AtspiEventListenerCb is currently defined as (transfer full), so the caller owns the struct and needs to free it, so it should not be const.
* skipping atspi_event_listener_[register/deregister]_no_dataAlejandro Piñeiro2013-08-291-2/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=707010
* Skip atspi_(event|device)_listener_new_simpleMike Gorse2013-07-151-1/+1
| | | | | | These are intended as C convenience functions. Gjs doesn't support having a GDestroyNotify without a user_data and prints out a warning, so might as well skip for purposes of introspection.
* Fix some warningsMike Gorse2013-02-041-1/+0
|
* Make documentation for atspi_event_listener_new() appear.Patrick Welche2012-12-171-1/+1
|
* Fix a crash when parsing eventsMike Gorse2012-12-041-0/+3
| | | | | If an event listener specifies a detail for an event, but an event arrives with an empty detail, then libatspi might crash.
* Re-register keystroke listeners if the registry goes away and returnsMike Gorse2012-11-201-11/+36
|
* Only call an event listener once per eventMike Gorse2012-10-261-0/+13
| | | | | If an event listener is registered for an event more than once (ie, registering both the event and its superset), then only notify it once.
* Update cache in response to role change notificationsMike Gorse2012-10-051-0/+12
| | | | | | | | We update the cache in response to name, description, and parent property-change signals, but we were missing code to handle signals for role changes. https://bugzilla.gnome.org/show_bug.cgi?id=685469
* Don't leak errorsWilliam Jon McCann2012-09-141-11/+9
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=684033
* Code clean-upsMike Gorse2012-07-181-19/+4
| | | | | There isn't really any point in checking for GLib functions returning NULL due to lack of memory, since they just abort instead.
* Fix abort on an error while removing a match ruleMike Gorse2012-07-081-6/+6
|
* Invalidate states when receiving a focus eventMike Gorse2012-02-211-0/+5
| | | | | | | | | | | Sometimes we get "focus" events from gtk, but the cache still does not indicate that the object has STATE_FOCUSED. Really should get to the bottom of this but don't have time to investigate more right now. Might be some kind of issue with the accessible being added to the cache before it is fully initialized--perhaps AddAccessible really doesn't make sense. https://bugzilla.gnome.org/show_bug.cgi?id=663992
* Don't g_object_unref a NULL object for event variantMike Gorse2012-02-191-1/+2
| | | | | | If we get an event with what appears to be an accessible as the variant but we do not succeed in marshalling the accessible (possibly because it is the null path), do not unref the null object. Stops a glib warning.