summaryrefslogtreecommitdiff
path: root/registryd
Commit message (Collapse)AuthorAgeFilesLines
* Use g_new0 instead of g_mallocFederico Mena Quintero2022-12-121-5/+3
| | | | Also, g_new0 can't fail, so don't check its result value.
* spi_dec_init_mouse_listener() - remove no-op functionFederico Mena Quintero2022-12-091-28/+0
| | | | | All its code was inside an "#ifdef GRAB_BUTTON", which is not defined anywhere. Anyway, we don't do mouse grabs here anymore.
* Remove unused enum variantsFederico Mena Quintero2022-12-091-2/+0
|
* Rename de-marshaller.[ch] to marshal-dbus.[ch]Federico Mena Quintero2022-12-085-5/+5
| | | | | | | I'll put all the libdbus-based marshallers in that file. Later I want to have a marshal-gdbus.[ch] counterpart, to let us port things gradually to gdbus.
* Reformat all the *.[ch] files with clang-formatFederico Mena Quintero2022-12-0618-1894/+1972
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove a couple of unused macrosFederico Mena Quintero2022-12-061-3/+0
|
* Remove unnecessary includesFederico Mena Quintero2022-12-061-2/+0
|
* Move X11-specific prototypes to deviceeventcontroller-x11.hFederico Mena Quintero2022-12-063-8/+8
| | | | This removes "HAVE_X11" from deviceeventcontroller.h
* Remove superfluous includeFederico Mena Quintero2022-12-061-3/+0
|
* SpiDEController: Remove the have_mouse_listener fieldFederico Mena Quintero2022-12-052-8/+5
| | | | | | It's never set, and always remained as FALSE. On the other hand, we lave have_mouse_event_listener, which *is* used.
* append_mouse_listener(): Remove unused functionFederico Mena Quintero2022-12-051-18/+0
|
* notify_mouse_listener(): Remove unused functionFederico Mena Quintero2022-12-051-22/+0
|
* spi_controller_deregister_device_listener(): Remove unused functionFederico Mena Quintero2022-12-051-17/+0
|
* spi_remove_device_listeners(): Remove the part that dealt with mouse_listenersFederico Mena Quintero2022-12-051-10/+0
| | | | There are no mouse_listeners created anymore.
* spi_listener_clone(): Remove unused functionFederico Mena Quintero2022-12-051-11/+0
|
* spi_listener_clone_free(): Remove unused functionFederico Mena Quintero2022-12-051-8/+0
|
* spi_dec_set_unlatch_pending(): Remove unused functionFederico Mena Quintero2022-12-051-11/+0
|
* Remove variable that is set but never usedFederico Mena Quintero2022-12-051-4/+0
|
* Remove the other is_consumedFederico Mena Quintero2022-12-051-8/+1
| | | | And simplify the call to XAllowEvents() since now there is only one case.
* Remove one auxiliary is_consumedFederico Mena Quintero2022-12-051-9/+2
| | | | It was used for the return value of spi_controller_notify_mouselisteners.
* Remove another auxiliary variable that was used to call ↵Federico Mena Quintero2022-12-051-11/+0
| | | | spi_controller_notify_mouselisteners
* Remove one auxiliary variable that was used to call ↵Federico Mena Quintero2022-12-051-13/+0
| | | | spi_controller_notify_mouselisteners
* spi_controller_notify_mouselisteners(): RemoveFederico Mena Quintero2022-12-053-72/+1
| | | | | | | | | | | | This function immediately returns FALSE if there are no controller->mouse_listeners. The only place that ever added to the controller->mouse_listeners list was spi_controller_register_device_listener(), which we removed in the last commit. So, remove the function altogether and make the two callers do as if it just returned FALSE.
* spi_controller_register_device_listener() - remove the case for ↵Federico Mena Quintero2022-12-052-15/+1
| | | | | | | | | | | | | | SPI_DEVICE_TYPE_MOUSE The only place where spi_controller_register_device_listener() is called is from impl_register_keystroke_listener(), but that function only ever creates listeners of type SPI_DEVICE_TYPE_MOUSE. Along with that, remove the SPI_DEVICE_TYPE_MOUSE enum variant as well, leaving only SPI_DEVICE_TYPE_KBD. This will let us remove a bunch of code related to mouse_listeners, which is not used.
* Rename variable to match the argument it representsFederico Mena Quintero2022-12-051-3/+3
|
* Fix indentationFederico Mena Quintero2022-12-051-1/+1
|
* Make function staticFederico Mena Quintero2022-12-051-1/+1
|
* spi_dbus_add_disconnect_match() - g_strdup_printf() can't failFederico Mena Quintero2022-12-051-17/+13
| | | | Remove the unhappy path.
* deviceeventcontroller.c: Remove the DeregisterDeviceEventListener methodFederico Mena Quintero2022-12-051-38/+0
| | | | It is unused.
* deviceeventcontroller.c: Remove the RegisterDeviceEventListener methodFederico Mena Quintero2022-12-051-30/+0
| | | | Per the previous commit, it is unused.
* deviceeventcontroller.c: Remove the code for the GetDeviceEventListeners methodFederico Mena Quintero2022-12-051-23/+0
| | | | | This was meant to query listeners for mouse events. However, that is done via the Registry's GetRegisteredEvents method now.
* Rename handle_dec_method_from_idle to handle_messageFederico Mena Quintero2022-12-011-2/+2
|
* handle_dec_method_from_idle(): Use the controller->bus directly instead of ↵Federico Mena Quintero2022-12-011-3/+3
| | | | taking a bus argument
* deviceeventcontroller.c: Pass the controller directly instead of a user_dataFederico Mena Quintero2022-12-011-33/+23
|
* deviceeventcontroller.c: Remove the bus argument from all the impl_ functionsFederico Mena Quintero2022-12-011-35/+22
| | | | It is not used in any of them.
* SpiDEController: don't push the controller itself into the message_queueFederico Mena Quintero2022-12-011-2/+0
| | | | | | | | | | | | | | These two pointers were pushed at the same time into controller->message_queue: message to be processed later user_data / controller And later they were popped to handle the message. But since we now weave the controller via the user_data everywhere, there's no need to keep an extra copy in the message_queue. This also leaves homogeneous elements, of the same type, in the message_queue, for peace of mind.
* deviceeventcontroller.c: Don't use a saved_controller global variableFederico Mena Quintero2022-12-011-13/+15
| | | | Use the user_data to pass the controller around.
* SpiDEController: turn have_mouse_* into fields rather than global variablesFederico Mena Quintero2022-12-012-13/+12
|
* spi_device_event_controller_stop_poll_mouse(): Take a SpiDEController even ↵Federico Mena Quintero2022-12-013-3/+3
| | | | if it is not used yet
* Make mouse_mask_state a field of SpiDEController instead of a global variableFederico Mena Quintero2022-12-012-12/+13
|
* spi_dec_poll_mouse_*(): immediately cast the user data to the SpiDEControllerFederico Mena Quintero2022-12-011-4/+8
| | | | This makes it clear what the data is, and we'll use it in the next commit.
* Remove unused prototypeFederico Mena Quintero2022-11-111-2/+0
|
* struct _SpiDEController: remove unused registry fieldFederico Mena Quintero2022-11-111-1/+0
|
* spi_device_event_controller_start_poll_mouse() - take an SpiDEController, ↵Federico Mena Quintero2022-11-113-4/+4
| | | | | | | | not a registry This function was just extracting the registry->dec, but it's cleaner if it doesn't peek at the registry's internals. Instead, the registry can call this function with the DEC it already knows about.
* Decouple the construction of SpiDEController and SpiRegistryFederico Mena Quintero2022-11-115-8/+7
| | | | | | | | | | | | | | | spi_registry_dec_new() would take an SpiRegistry argument, and directly set "reg->dec = self" in it. Instead, we do this now: * spi_registry_dec_new() no longer takes a registry argument; it was made independent from it in the previous commit. * In registry-main.c, we first create the DEC, and then we pass it as an argument to spi_registry_new(), which now takes an SpiDEController argument. The registry object only uses the DEC in spi_remove_device_listeners() when an application is removed.
* Remove unused argumentFederico Mena Quintero2022-11-111-3/+2
| | | | | | | Accessibility_DeviceEventListener_NotifyEvent() does not use its "registry" argument. Calls to this function were the only place where dec->registry was purportedly used, so removing the argument will allow us to decouple the Device Event Controller from the Registry.
* Move spi_clear_error_state() to the X11 codeFederico Mena Quintero2022-11-103-13/+8
| | | | | | | Both deviceeventcontroller.c and deviceeventcontroller-x11.c had static spi_error_code variables, but spi_clear_error_state() was looking at a different variable than the one set by the X error handler. I think this was just an oversight.
* call_set_id() - take the application's id as an argumentFederico Mena Quintero2022-11-071-5/+5
| | | | | Don't pull it out of the registry right there. This also moves the responsibility for incrementing the current id to the caller.
* Rename variableFederico Mena Quintero2022-11-071-2/+2
|
* Rename set_id() to call_set_id()Federico Mena Quintero2022-11-071-2/+2
|