28 #include "model/ipc_api.h"
29 #include "model/wx_instance_chk.h"
31 #if defined(__linux__) && !defined(__ANDROID__)
32 #include "model/dbus_client.h"
43 std::unique_ptr<LocalClientApi> LocalClientApi::GetClient() {
48 return DummyIpcServer::GetInstance();
54 return DummyInstanceChk::GetInstance();
58 #elif defined(__linux__)
59 static bool UseDbus() {
60 return getenv(
"FLATPAK_ID") != 0 || getenv(
"OCPN_FORCE_DBUS");
63 std::unique_ptr<LocalClientApi> LocalClientApi::GetClient() {
67 return std::unique_ptr<LocalClientApi>(
new IpcClient);
79 return DbusServer::GetInstance();
81 return GetWxInstanceChk();
85 std::unique_ptr<LocalClientApi> LocalClientApi::GetClient() {
86 return std::unique_ptr<LocalClientApi>(
new IpcClient());
90 return IpcConnection::GetInstance();
96 return GetWxInstanceChk();
Implement LocalClientApi on linux using Dbus mechanisms.
Common interface for all instance checkers.
static InstanceCheck & GetInstance()
Started by IpcServer on filesystem fifo/socket connects.
Base interface for local server command handling.
static void ReleaseInstance()
Release Instance.
static LocalServerApi & GetInstance()
Thin wrapper for wxSingleInstanceChecker implementing InstanceCheck.
DBus interface header file.