mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-05 08:25:32 +00:00
This change contains various changes and refactorings which together allows the integration tests to pass again. One of the important changs is `DbusTestHelper` which listens to a DBus signal for a sentinel message and then simulates the sentinel key press. Getting this to work also requires processing sd-bus messages which hooks into the glib event loop and is implemented in `EventSource`. Fixes: #13204
27 lines
501 B
C++
27 lines
501 B
C++
#ifndef __EVENTSOURCE_H__
|
|
#define __EVENTSOURCE_H__
|
|
|
|
#include "config.h"
|
|
#include <glib.h>
|
|
#if DBUS_IMPLEMENTATION == SYSTEMD
|
|
#include <systemd/sd-bus.h>
|
|
#else
|
|
#include <basu/sd-bus.h>
|
|
#endif
|
|
|
|
// An event source used to poll sd-bus for messages
|
|
class EventSource {
|
|
public:
|
|
static EventSource* Create(sd_bus* bus);
|
|
static void Destroy(EventSource* source);
|
|
|
|
gboolean Check() const;
|
|
gboolean Dispatch();
|
|
|
|
private:
|
|
GSource base;
|
|
GPollFD pollFd;
|
|
sd_bus* bus;
|
|
};
|
|
|
|
#endif // __EVENTSOURCE_H__
|