#include "ToolProvider.h" #include "AgentCore.h" namespace app { /* Keep these in one place: every platform tool of the front end uses one of * them, so the engine's availability gate and the policy UI agree. */ const char *const kDesktopOnly[] = {"desktop", NULL}; const char *const kAndroidOnly[] = {"android", NULL}; int registerPlatformTools(AgentCore *core) { if (!core) return 0; int n = 0; #if defined(__ANDROID__) n += platformRegisterAndroid(core); #elif defined(__APPLE__) n += platformRegisterMac(core); #elif defined(_WIN32) n += platformRegisterWindows(core); #elif defined(__linux__) n += platformRegisterLinux(core); #endif /* Qt is not a platform API: these exist wherever the window does. */ n += registerQtTools(core); /* A service may have appeared or gone since the last probe (a desktop * session starting, the notification daemon coming up). */ cst_tool_meta_reload(); return n; } void unregisterPlatformTools(AgentCore *core) { if (!core) return; core->unregisterOwner(QStringLiteral("app:linux")); core->unregisterOwner(QStringLiteral("app:windows")); core->unregisterOwner(QStringLiteral("app:macos")); core->unregisterOwner(QStringLiteral("app:android")); core->unregisterOwner(QStringLiteral("app:qt")); } } // namespace app