Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Features:
- Support for non-deprecated Cocoa APIs on OS X.
- GTK3 dialog on Linux.
- Optional Zenity support on Linux to avoid linking GTK.
- Haiku support
- Tested, works alongside [http://www.libsdl.org](SDL2) on all platforms, for the game developers out there.

# Example Usage #
Expand Down Expand Up @@ -54,6 +55,7 @@ See self-documenting API [NFD.h](src/include/nfd.h) for more options.
![Windows rendering a dialog](screens/open_win.png?raw=true)
![GTK3 on Linux rendering a dialog](screens/open_gtk3.png?raw=true)
![Cocoa on MacOS rendering a dialog](screens/open_cocoa.png?raw=true)
![Haiku](screens/open_haiku.png?raw=true)

## Changelog ##

Expand Down Expand Up @@ -155,6 +157,9 @@ On Mac OS, add `AppKit` to the list of frameworks.

On Windows, ensure you are linking against `comctl32.lib`.

#### Haiku ####
On Haiku, you need to link to `libtracker` and `libbe`.

## Usage ##

See `NFD.h` for API calls. See `tests/*.c` for example code.
Expand Down Expand Up @@ -195,6 +200,7 @@ I accept quality code patches, or will resolve these and other matters through s
- It errors out if Zenity is not installed on the user's system
- This backend's process exec error handling does not gracefully handle numerous error cases, choosing to abort rather than cleanup and return.
- Unlike the other backends, the Zenity backend does not return implied extensions from filterlists. [#95](https://github.com/mlabbe/nativefiledialog/issues/95 "Issue 95")
- On Haiku, the file open dialog either shows only allowed files or all files, which is chosen at build time.

# Copyright and Credit #

Expand All @@ -210,6 +216,8 @@ Tomasz Konojacki for [microutf8](http://puszcza.gnu.org.ua/software/microutf8/)

[Tom Mason](https://github.com/wheybags) for Zenity support.

[Puck Meerburg](https://github.com/puckipedia/nativefiledialog) for Haiku support.

Various pull requests and bugfixes -- thanks to the original authors.

## Support ##
Expand Down
11 changes: 11 additions & 0 deletions build/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ workspace "NativeFileDialog"
platforms {"x64", "x86"}
filter "system:linux or system:macosx"
platforms {"arm64"}
filter "system:haiku"
platforms {"x86", "x64"}

objdir(path.join(build_dir, "obj/"))

Expand Down Expand Up @@ -105,6 +107,9 @@ workspace "NativeFileDialog"
language "C"
files {root_dir.."src/nfd_cocoa.m"}

filter "system:haiku"
language "C++"
files {root_dir.."src/nfd_haiku.cpp"}


filter {"system:linux", "options:linux_backend=gtk3"}
Expand Down Expand Up @@ -174,6 +179,10 @@ local make_test = function(name)
filter {"system:macosx"}
links {"Foundation.framework", "AppKit.framework"}

filter {"system:haiku"}
-- should link to stdc++.r4 for gcc2
links {"be", "tracker", "stdc++"}

filter {"configurations:Debug", "system:linux", "options:linux_backend=gtk3"}
linkoptions {"-lnfd_d `pkg-config --libs gtk+-3.0`"}
filter {"configurations:Debug", "system:linux", "options:linux_backend=zenity"}
Expand Down Expand Up @@ -231,6 +240,7 @@ newaction
premake_do_action("gmake", "linux", true,{})
premake_do_action("gmake", "linux", true,{linux_backend='zenity'})
premake_do_action("gmake", "macosx", true,{})
premake_do_action("gmake", "haiku", true,{})
premake_do_action("gmake", "windows", true,{})
end
}
Expand Down Expand Up @@ -276,6 +286,7 @@ newaction
"xcode4",
"gmake_linux",
"gmake_macosx",
"gmake_haiku",
"gmake_windows"
}

Expand Down
Binary file added screens/open_haiku.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions src/ftg_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@
/* broad test for OSes that are vaguely POSIX compliant */
#if defined(__linux__) || defined(__APPLE__) || defined(ANDROID) || \
defined(TARGET_OS_IPHONE) || defined(TARGET_IPHONE_SIMULATOR) || \
defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__EMSCRIPTEN__)
defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__EMSCRIPTEN__) || \
defined(__HAIKU__)
# define FTG_POSIX_LIKE 1
#endif

Expand Down Expand Up @@ -399,7 +400,7 @@ typedef struct ftg_dirhandle_s ftg_dirhandle_t;
#elif defined(_WIN32)
typedef int64_t ftg_off_t;
typedef wchar_t ftg_wchar_t;
#elif defined(__FreeBSD__) || defined(__OpenBSD__)
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__HAIKU__)
typedef off_t ftg_off_t;
#elif defined(FTG_WASM)
typedef off_t ftg_off_t;
Expand Down
Loading