mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-20 06:37:40 +00:00
Gentoo doesn't use systemd. `libelogind` or `basu` implement some aspects of systemd, so we use that on Gentoo (or rather when `libsystemd` is not available but `libelogind` or `basu` is). Patch from https://forums.gentoo.org/viewtopic.php?p=8850566. See also https://community.software.sil.org/t/keyman-for-gentoo-linux/9615. Cherry-pick-of: #12889
38 lines
781 B
C++
38 lines
781 B
C++
#ifndef __KEYMANSYSTEMSERVICE_H__
|
|
#define __KEYMANSYSTEMSERVICE_H__
|
|
|
|
#include "config.h"
|
|
#include <list>
|
|
#if DBUS_IMPLEMENTATION == SYSTEMD
|
|
#include <systemd/sd-bus.h>
|
|
#else
|
|
#include <basu/sd-bus.h>
|
|
#endif
|
|
#include "KeyboardDevice.h"
|
|
|
|
using namespace std;
|
|
|
|
class KeymanSystemService {
|
|
private:
|
|
std::list<KeyboardDevice *>* kbd_devices = NULL;
|
|
sd_bus_slot *slot = NULL;
|
|
sd_bus *bus = NULL;
|
|
bool failed = false;
|
|
|
|
void GetKbdDevices();
|
|
|
|
public:
|
|
KeymanSystemService();
|
|
~KeymanSystemService();
|
|
|
|
bool
|
|
Failed() {
|
|
return failed;
|
|
}
|
|
|
|
int Loop();
|
|
void SetCapsLockIndicatorOnDevices(uint32_t state);
|
|
uint32_t GetCapsLockIndicatorOnDevices();
|
|
};
|
|
|
|
#endif // __KEYMANSYSTEMSERVICE_H__
|