MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ open_file() [1/2]

MAYAFLUX_API void MayaFlux::Portal::System::Dialog::open_file ( ChooserCallback  callback,
std::vector< ChooserFilter filters = {},
std::filesystem::path  start_dir = {} 
)

Present a native open-file dialog, delivering the result via callback.

Primitive overload. The callback receives a ChooserResult and is responsible for checking and unwrapping it. Invoked exactly once on the platform backend thread; callers that need thread affinity must marshal the result themselves.

Parameters
callbackInvoked with the chosen path or a SystemDialogError.
filtersExtension filter groups shown in the dialog.
start_dirDirectory the dialog opens in. Platform default if empty.

Definition at line 8 of file Chooser.cpp.

12{
13 auto* backend = get_backend();
14 if (!backend) {
15 MF_ERROR(Journal::Component::Portal, Journal::Context::API,
16 "Chooser::open_file: Portal::System not initialized");
17 callback(std::unexpected(Core::SystemDialogError::BackendError));
18 return;
19 }
20 backend->open_file(std::move(callback), std::move(filters), std::move(start_dir));
21}
#define MF_ERROR(comp, ctx,...)
Core::SystemBackend * get_backend()
Access the active platform backend.
Definition System.cpp:22

References MayaFlux::Journal::API, MayaFlux::Core::BackendError, MayaFlux::Portal::System::get_backend(), MF_ERROR, and MayaFlux::Journal::Portal.

+ Here is the call graph for this function: