std::uint64_t Token
Definition main_thread_dispatcher.hpp:24
Cross-platform introspection of the active main loop.
Definition message_loop_integration.hpp:84
static void register_kind(MainThreadDispatcher::Token token, MainLoopKind kind)
Register the kind tag for a custom backend.
static bool available()
Convenience: any non-None backend is registered.
static void unregister_kind(MainThreadDispatcher::Token token)
Clear the kind tag for a token registered via register_kind.
static MainLoopKind active_kind()
Returns the kind of native loop currently active, or None.
static bool call_sync(Task task)
Forwards to MainThreadDispatcher::call_sync().
static bool is_main_thread()
Forwards to MainThreadDispatcher::is_main_thread().
static std::string_view active_name()
Human-readable name for diagnostics ("cocoa", "win32", "glib", "x11", "wayland", "custom",...
static MainLoopPumpResult pump_main_loop_for(std::chrono::milliseconds max_duration)
Service the native process main loop for at most max_duration.
static bool post(Task task)
Forwards to MainThreadDispatcher::call_async().
Definition child_process_manager.hpp:18
MainLoopKind
The kind of native main loop currently integrated.
Definition message_loop_integration.hpp:58
@ None
No native main loop integration.
Definition message_loop_integration.hpp:59
@ Cocoa
macOS / iOS NSRunLoop / CFRunLoop.
Definition message_loop_integration.hpp:60
@ Custom
Caller-registered loop (SDL, custom dispatcher).
Definition message_loop_integration.hpp:65
@ Win32
Windows MsgWaitForMultipleObjects / GetMessage.
Definition message_loop_integration.hpp:61
@ Wayland
Wayland wl_display_dispatch loop.
Definition message_loop_integration.hpp:64
@ X11
Bare X11 XNextEvent loop.
Definition message_loop_integration.hpp:63
@ GLib
Linux glib GMainLoop (GNOME / GTK hosts).
Definition message_loop_integration.hpp:62
MainLoopPumpResult
Outcome of a bounded native-main-loop service slice.
Definition message_loop_integration.hpp:69
@ HandledSource
At least one native source was handled.
Definition message_loop_integration.hpp:70
@ Finished
The native loop has no sources or timers.
Definition message_loop_integration.hpp:73
@ TimedOut
The bounded interval elapsed without a source.
Definition message_loop_integration.hpp:71
@ Unsupported
This platform has no bounded pump implementation.
Definition message_loop_integration.hpp:74
@ Stopped
The native loop was explicitly stopped.
Definition message_loop_integration.hpp:72
@ WrongThread
The call was not made on the process main thread.
Definition message_loop_integration.hpp:75
std::function< void()> Task
Definition event_loop.hpp:18