MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / NFD_OpenDialogMultipleN

Function NFD_OpenDialogMultipleN

extern/nfd/nfd_gtk.cpp:445–479  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

443}
444
445nfdresult_t NFD_OpenDialogMultipleN(const nfdpathset_t** outPaths,
446 const nfdnfilteritem_t* filterList,
447 nfdfiltersize_t filterCount,
448 const nfdnchar_t* defaultPath) {
449 GtkWidget* widget = gtk_file_chooser_dialog_new("Open Files",
450 nullptr,
451 GTK_FILE_CHOOSER_ACTION_OPEN,
452 "_Cancel",
453 GTK_RESPONSE_CANCEL,
454 "_Open",
455 GTK_RESPONSE_ACCEPT,
456 nullptr);
457
458 // guard to destroy the widget when returning from this function
459 Widget_Guard widgetGuard(widget);
460
461 // set select multiple
462 gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(widget), TRUE);
463
464 /* Build the filter list */
465 AddFiltersToDialog(GTK_FILE_CHOOSER(widget), filterList, filterCount);
466
467 /* Set the default path */
468 SetDefaultPath(GTK_FILE_CHOOSER(widget), defaultPath);
469
470 if (RunDialogWithFocus(GTK_DIALOG(widget)) == GTK_RESPONSE_ACCEPT) {
471 // write out the file name
472 GSList* fileList = gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(widget));
473
474 *outPaths = static_cast<void*>(fileList);
475 return NFD_OKAY;
476 } else {
477 return NFD_CANCEL;
478 }
479}
480
481nfdresult_t NFD_SaveDialogN(nfdnchar_t** outPath,
482 const nfdnfilteritem_t* filterList,

Callers

nothing calls this directly

Calls 3

RunDialogWithFocusFunction · 0.85
AddFiltersToDialogFunction · 0.70
SetDefaultPathFunction · 0.70

Tested by

no test coverage detected