geode/loader/src/platform/windows/nfdwin.hpp
HJfod 72bbffa79d Great Geode cleanup project
- move all platform sources to one central folder under src/platform/name
 - don't add obj-c sources on windows or platform files from other platforms on all platforms
2022-11-28 19:45:23 +02:00

62 lines
1.1 KiB
C++

/*
Native File Dialog
http://www.frogtoss.com/labs
*/
/**
* Copied from https://github.com/mlabbe/nativefiledialog
* Modified to be modern Geode-fitting C++
*/
#include <Geode/DefaultInclude.hpp>
#ifdef GEODE_IS_WINDOWS
#ifdef __MINGW32__
// Explicitly setting NTDDI version, this is necessary for the MinGW compiler
#define NTDDI_VERSION NTDDI_VISTA
#define _WIN32_WINNT _WIN32_WINNT_VISTA
#endif
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
/* only locally define UNICODE in this compilation unit */
#ifndef UNICODE
#define UNICODE
#endif
#include <wchar.h>
#include <stdio.h>
#include <assert.h>
#include <windows.h>
#include <shobjidl.h>
#include <stdint.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#define NFD_MAX_STRLEN 256
#define _NFD_UNUSED(x) ((void)x)
#define NFD_UTF8_BOM "\xEF\xBB\xBF"
#include <stddef.h>
USE_GEODE_NAMESPACE();
enum class NFDMode {
OpenFile,
OpenFiles,
SaveFile,
OpenFolder,
};
Result<> nfdPick(
NFDMode mode,
file::FilePickOptions const& options,
void* result
);
#endif