5#ifdef MAYAFLUX_PLATFORM_LINUX
7#elif defined(MAYAFLUX_PLATFORM_WINDOWS)
9#elif defined(MAYAFLUX_PLATFORM_MACOS)
18 bool g_initialized {};
19 std::unique_ptr<Core::SystemBackend> g_backend;
24 return g_backend.get();
31 "Portal::System already initialized");
36 "Initializing Portal::System...");
38#ifdef MAYAFLUX_PLATFORM_LINUX
39 g_backend = std::make_unique<Core::DBusBackend>();
40#elif defined(MAYAFLUX_PLATFORM_WINDOWS)
41 g_backend = std::make_unique<Core::COMBackend>();
42#elif defined(MAYAFLUX_PLATFORM_MACOS)
43 g_backend = std::make_unique<Core::NSBackend>();
46 if (!g_backend || !g_backend->initialize()) {
48 "Portal::System: backend initialization failed");
55 "Portal::System initialized");
66 "Portal::System stopped");
76 g_backend->shutdown();
80 g_initialized =
false;
82 "Portal::System shutdown complete");
#define MF_INFO(comp, ctx,...)
#define MF_ERROR(comp, ctx,...)
#define MF_WARN(comp, ctx,...)
Abstract interface for native OS service backends.
@ API
API calls from external code.
@ Portal
High-level user-facing API layer.
bool initialize()
Initialize Portal::System.
bool is_initialized()
Return true if Portal::System has been initialized.
void shutdown()
Shutdown Portal::System and release all resources.
Core::SystemBackend * get_backend()
Access the active platform backend.
void stop()
Stop active Portal::System operations.