Debian Codegraph @

android/app/jni/extern/nfd-modified/README.md

raw
1 # Native File Dialog Modified Version!!! #
2
3 A tiny, neat C library that portably invokes native file open, folder select and save dialogs. Write dialog code once and have it pop up native dialogs on all supported platforms. Avoid linking large dependencies like wxWidgets and qt.
4
5 This is a modified version of Native File Dialog, tailored for Furnace.
6
7 Features:
8
9 - Lean C API, static library -- no ObjC, no C++, no STL.
10 - Zlib licensed.
11 - Consistent UTF-8 support on all platforms.
12 - Simple universal file filter syntax.
13 - Paid support available.
14 - Multiple file selection support.
15 - 64-bit and 32-bit friendly.
16 - GCC, Clang, Xcode, Mingw and Visual Studio supported.
17 - No third party dependencies for building or linking.
18 - Support for Vista's modern `IFileDialog` on Windows.
19 - Support for non-deprecated Cocoa APIs on OS X.
20 - GTK3 dialog on Linux.
21 - Optional Zenity support on Linux to avoid linking GTK.
22 - Tested, works alongside [http://www.libsdl.org](SDL2) on all platforms, for the game developers out there.
23
24 # Example Usage #
25
26 ```C
27 #include <nfd.h>
28 #include <stdio.h>
29 #include <stdlib.h>
30
31 int main( void )
32 {
33 nfdchar_t *outPath = NULL;
34 nfdresult_t result = NFD_OpenDialog( NULL, NULL, &outPath );
35
36 if ( result == NFD_OKAY ) {
37 puts("Success!");
38 puts(outPath);
39 free(outPath);
40 }
41 else if ( result == NFD_CANCEL ) {
42 puts("User pressed cancel.");
43 }
44 else {
45 printf("Error: %s\n", NFD_GetError() );
46 }
47
48 return 0;
49 }
50 ```
51
52 See self-documenting API [NFD.h](src/include/nfd.h) for more options.
53
54 # Screenshots #
55
56 ![Windows rendering a dialog](screens/open_win.png?raw=true)
57 ![GTK3 on Linux rendering a dialog](screens/open_gtk3.png?raw=true)
58 ![Cocoa on MacOS rendering a dialog](screens/open_cocoa.png?raw=true)
59
60 ## Changelog ##
61
62 - **Major** version increments denote API or ABI departure.
63 - **Minor** version increments denote build or trivial departures.
64 - **Micro** version increments just recompile and drop-in.
65
66 release | what's new | date
67 --------|-----------------------------|---------
68 1.0.0 | initial | oct 2014
69 1.1.0 | premake5; scons deprecated | aug 2016
70 1.1.1 | mingw support, build fixes | aug 2016
71 1.1.2 | test_pickfolder() added | aug 2016
72 1.1.3 | zenity linux backend added | nov 2017
73 <i></i> | fix char type in decls | nov 2017
74 1.1.4 | fix win32 memleaks | dec 2018
75 <i></i> | improve win32 errorhandling | dec 2018
76 <i></i> | macos fix focus bug | dec 2018
77 1.1.5 | win32 fix com reinitialize | aug 2019
78 1.1.6 | fix osx filter bug | aug 2019
79 <i></i> | remove deprecated scons | aug 2019
80 <i></i> | fix mingw compilation | aug 2019
81 <i></i> | -Wextra warning cleanup | aug 2019
82
83 ## Building ##
84
85 NFD uses [Premake5](https://premake.github.io/download.html) generated Makefiles and IDE project files. The generated project files are checked in under `build/` so you don't have to download and use Premake in most cases.
86
87 If you need to run Premake5 directly, further [build documentation](docs/build.md) is available.
88
89 Previously, NFD used SCons to build. As of 1.1.6, SCons support has been removed entirely.
90
91 `nfd.a` will be built for release builds, and `nfd_d.a` will be built for debug builds.
92
93 ### Makefiles ###
94
95 The makefile offers up to four options, with `release_x64` as the default.
96
97 make config=release_x86
98 make config=release_x64
99 make config=debug_x86
100 make config=debug_x64
101
102 ### Compiling Your Programs ###
103
104 1. Add `src/include` to your include search path.
105 2. Add `nfd.lib` or `nfd_d.lib` to the list of list of static libraries to link against (for release or debug, respectively).
106 3. Add `build/<debug|release>/<arch>` to the library search path.
107
108 #### Linux GTK ####
109
110 `apt-get libgtk-3-dev` installs the gtk dependency for library compilation.
111
112 On Linux, you have the option of compiling and linking against GTK. If you use it, the recommended way to compile is to include the arguments of `pkg-config --cflags --libs gtk+-3.0`.
113
114 #### Linux Zenity ####
115
116 Alternatively, you can use the Zenity backend by running the Makefile in `build/gmake_linux_zenity`. Zenity runs the dialog in its own address space, but requires the user to have Zenity correctly installed and configured on their system.
117
118 #### MacOS ####
119
120 On Mac OS, add `AppKit` to the list of frameworks.
121
122 #### Windows ####
123
124 On Windows, ensure you are linking against `comctl32.lib`.
125
126 ## Usage ##
127
128 See `NFD.h` for API calls. See `tests/*.c` for example code.
129
130 After compiling, `build/bin` contains compiled test programs. The appropriate subdirectory under `build/lib` contains the built library.
131
132 ## File Filter Syntax ##
133
134 There is a form of file filtering in every file dialog API, but no consistent means of supporting it. NFD provides support for filtering files by groups of extensions, providing its own descriptions (where applicable) for the extensions.
135
136 A wildcard filter is always added to every dialog.
137
138 ### Separators ###
139
140 - `;` Begin a new filter.
141 - `,` Add a separate type to the filter.
142
143 #### Examples ####
144
145 `txt` The default filter is for text files. There is a wildcard option in a dropdown.
146
147 `png,jpg;psd` The default filter is for png and jpg files. A second filter is available for psd files. There is a wildcard option in a dropdown.
148
149 `NULL` Wildcard only.
150
151 ## Iterating Over PathSets ##
152
153 See [test_opendialogmultiple.c](test/test_opendialogmultiple.c).
154
155 # Known Limitations #
156
157 I accept quality code patches, or will resolve these and other matters through support. See [contributing](docs/contributing.md) for details.
158
159 - No support for Windows XP's legacy dialogs such as `GetOpenFileName`.
160 - No support for file filter names -- ex: "Image Files" (*.png, *.jpg). Nameless filters are supported, however.
161 - GTK Zenity implementation's process exec error handling does not gracefully handle numerous error cases, choosing to abort rather than cleanup and return.
162 - GTK 3 spams one warning per dialog created.
163
164 # Copyright and Credit #
165
166 Copyright &copy; 2014-2019 [Frogtoss Games](http://www.frogtoss.com), Inc.
167 File [LICENSE](LICENSE) covers all files in this repo.
168
169 Native File Dialog by Michael Labbe
170 <[email protected]>
171
172 Tomasz Konojacki for [microutf8](http://puszcza.gnu.org.ua/software/microutf8/)
173
174 [Denis Kolodin](https://github.com/DenisKolodin) for mingw support.
175
176 [Tom Mason](https://github.com/wheybags) for Zenity support.
177
178 ## Support ##
179
180 Directed support for this work is available from the original author under a paid agreement.
181
182 [Contact Frogtoss Games](http://www.frogtoss.com/pages/contact.html).