From 560d902f4d2bf4ba3bb2edba6436080ee7d5a5ac Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Sat, 10 Sep 2022 12:31:13 -0400 Subject: Add applaunchd gRPC API wrapper Changes: - Add applaunchd gRPC API wrapper in applauncher directory, clients can include AppLauncherClient.h to use it. - To facilitate generating protobuf and gRPC code with protoc, switch from CMake to meson for building. While the code generation can be done in CMake, it is a lot more straightforward with meson, and if use of this library continues meson will be easier to maintain. Known issues: - The behavior of the client implementation here with respect to the server side (i.e. applaunchd) going away is currently robust, but could stand improvement with some further investigation. As the code stands, starting applications works when applaunchd becomes available again, but the streaming status RPC that is tied to window activation in the homescreen does not reconnect, and there seem to be some things that need to be resolved with respect to Qt object connection expiry to do so. If the Qt demos continue to be used in a significant fashion, this may be worth picking up. Bug-AGL: SPEC-4559 Signed-off-by: Scott Murray Change-Id: I5cb480d4ce4d1cb944ebfd4114fb305f09f28ea3 --- applauncher/AppLauncherClient.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 applauncher/AppLauncherClient.h (limited to 'applauncher/AppLauncherClient.h') diff --git a/applauncher/AppLauncherClient.h b/applauncher/AppLauncherClient.h new file mode 100644 index 0000000..91723ab --- /dev/null +++ b/applauncher/AppLauncherClient.h @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright (C) 2022 Konsulko Group + */ + +#ifndef APPLAUNCHER_CLIENT_H +#define APPLAUNCHER_CLIENT_H + +#include +#include +#include + +class AppLauncherGrpcClient; + +class AppLauncherClient : public QObject +{ + Q_OBJECT + +public: + explicit AppLauncherClient(QObject *parent = Q_NULLPTR); + virtual ~AppLauncherClient(); + + Q_INVOKABLE bool startApplication(const QString &id); + Q_INVOKABLE bool listApplications(QList> &list); + +public slots: + void sendStatusEvent(const QString &id, const QString &status); + +signals: + void appStatusEvent(const QString &id, const QString &status); + +private: + AppLauncherGrpcClient *m_launcher; +}; + +#endif // APPLAUNCHER_CLIENT_H -- cgit 1.2.3-korg