filedialog 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/gempush.yml +31 -0
  3. data/.gitignore +13 -0
  4. data/.gitmodules +3 -0
  5. data/.rubocop.yml +19 -0
  6. data/Gemfile +10 -0
  7. data/Gemfile.lock +30 -0
  8. data/LICENSE +674 -0
  9. data/README.md +22 -0
  10. data/Rakefile +35 -0
  11. data/bin/console +25 -0
  12. data/deps/filedialogbuilddeps.rb +49 -0
  13. data/deps/nativefiledialog/.github/ISSUE_TEMPLATE/bug_report.md +32 -0
  14. data/deps/nativefiledialog/.gitignore +181 -0
  15. data/deps/nativefiledialog/LICENSE +16 -0
  16. data/deps/nativefiledialog/README.md +180 -0
  17. data/deps/nativefiledialog/build/dont_run_premake.txt +1 -0
  18. data/deps/nativefiledialog/build/gmake_linux/Makefile +101 -0
  19. data/deps/nativefiledialog/build/gmake_linux/nfd.make +192 -0
  20. data/deps/nativefiledialog/build/gmake_linux/test_opendialog.make +188 -0
  21. data/deps/nativefiledialog/build/gmake_linux/test_opendialogmultiple.make +188 -0
  22. data/deps/nativefiledialog/build/gmake_linux/test_pickfolder.make +188 -0
  23. data/deps/nativefiledialog/build/gmake_linux/test_savedialog.make +188 -0
  24. data/deps/nativefiledialog/build/gmake_linux_zenity/Makefile +101 -0
  25. data/deps/nativefiledialog/build/gmake_linux_zenity/nfd.make +192 -0
  26. data/deps/nativefiledialog/build/gmake_linux_zenity/test_opendialog.make +188 -0
  27. data/deps/nativefiledialog/build/gmake_linux_zenity/test_opendialogmultiple.make +188 -0
  28. data/deps/nativefiledialog/build/gmake_linux_zenity/test_pickfolder.make +188 -0
  29. data/deps/nativefiledialog/build/gmake_linux_zenity/test_savedialog.make +188 -0
  30. data/deps/nativefiledialog/build/gmake_macosx/Makefile +85 -0
  31. data/deps/nativefiledialog/build/gmake_macosx/nfd.make +154 -0
  32. data/deps/nativefiledialog/build/gmake_macosx/test_opendialog.make +150 -0
  33. data/deps/nativefiledialog/build/gmake_macosx/test_opendialogmultiple.make +150 -0
  34. data/deps/nativefiledialog/build/gmake_macosx/test_pickfolder.make +150 -0
  35. data/deps/nativefiledialog/build/gmake_macosx/test_savedialog.make +150 -0
  36. data/deps/nativefiledialog/build/gmake_windows/Makefile +101 -0
  37. data/deps/nativefiledialog/build/gmake_windows/nfd.make +192 -0
  38. data/deps/nativefiledialog/build/gmake_windows/test_opendialog.make +188 -0
  39. data/deps/nativefiledialog/build/gmake_windows/test_opendialogmultiple.make +188 -0
  40. data/deps/nativefiledialog/build/gmake_windows/test_pickfolder.make +188 -0
  41. data/deps/nativefiledialog/build/gmake_windows/test_savedialog.make +188 -0
  42. data/deps/nativefiledialog/build/premake5.lua +265 -0
  43. data/deps/nativefiledialog/build/vs2010/NativeFileDialog.sln +78 -0
  44. data/deps/nativefiledialog/build/vs2010/nfd.vcxproj +168 -0
  45. data/deps/nativefiledialog/build/vs2010/nfd.vcxproj.filters +20 -0
  46. data/deps/nativefiledialog/build/vs2010/test_opendialog.vcxproj +182 -0
  47. data/deps/nativefiledialog/build/vs2010/test_opendialogmultiple.vcxproj +182 -0
  48. data/deps/nativefiledialog/build/vs2010/test_pickfolder.vcxproj +182 -0
  49. data/deps/nativefiledialog/build/vs2010/test_savedialog.vcxproj +182 -0
  50. data/deps/nativefiledialog/build/xcode4/NativeFileDialog.xcworkspace/contents.xcworkspacedata +19 -0
  51. data/deps/nativefiledialog/build/xcode4/nfd.xcodeproj/project.pbxproj +228 -0
  52. data/deps/nativefiledialog/build/xcode4/test_opendialog.xcodeproj/project.pbxproj +294 -0
  53. data/deps/nativefiledialog/build/xcode4/test_opendialogmultiple.xcodeproj/project.pbxproj +294 -0
  54. data/deps/nativefiledialog/build/xcode4/test_pickfolder.xcodeproj/project.pbxproj +294 -0
  55. data/deps/nativefiledialog/build/xcode4/test_savedialog.xcodeproj/project.pbxproj +294 -0
  56. data/deps/nativefiledialog/docs/build.md +39 -0
  57. data/deps/nativefiledialog/docs/contributing.md +25 -0
  58. data/deps/nativefiledialog/screens/open_cocoa.png +0 -0
  59. data/deps/nativefiledialog/screens/open_gtk3.png +0 -0
  60. data/deps/nativefiledialog/screens/open_win.png +0 -0
  61. data/deps/nativefiledialog/src/common.h +21 -0
  62. data/deps/nativefiledialog/src/include/nfd.h +74 -0
  63. data/deps/nativefiledialog/src/nfd_cocoa.m +286 -0
  64. data/deps/nativefiledialog/src/nfd_common.c +142 -0
  65. data/deps/nativefiledialog/src/nfd_common.h +39 -0
  66. data/deps/nativefiledialog/src/nfd_gtk.c +379 -0
  67. data/deps/nativefiledialog/src/nfd_win.cpp +762 -0
  68. data/deps/nativefiledialog/src/nfd_zenity.c +307 -0
  69. data/deps/nativefiledialog/src/simple_exec.h +218 -0
  70. data/deps/nativefiledialog/test/test_opendialog.c +29 -0
  71. data/deps/nativefiledialog/test/test_opendialogmultiple.c +32 -0
  72. data/deps/nativefiledialog/test/test_pickfolder.c +29 -0
  73. data/deps/nativefiledialog/test/test_savedialog.c +28 -0
  74. data/ext/filedialog/extconf.rb +58 -0
  75. data/ext/filedialog/filedialog.c +118 -0
  76. data/filedialog.gemspec +48 -0
  77. data/lib/filedialog.rb +50 -0
  78. data/lib/filedialog/version.rb +5 -0
  79. metadata +137 -0
@@ -0,0 +1,294 @@
1
+ // !$*UTF8*$!
2
+ {
3
+ archiveVersion = 1;
4
+ classes = {
5
+ };
6
+ objectVersion = 46;
7
+ objects = {
8
+
9
+ /* Begin PBXBuildFile section */
10
+ 62D586CEA6E958009ABADD0E /* libnfd.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 164F31368771D2283D387F76 /* libnfd.a */; };
11
+ B762408A248A4EFC261D3ECA /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 893A8412D69D7A444CBC7A52 /* AppKit.framework */; };
12
+ BDAA66E6806AC758DD9FA526 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B74DEAE2FBBE6E0B3A914EE /* Foundation.framework */; };
13
+ D68362BE2DE8D5B0DFF6F0FE /* test_savedialog.c in Sources */ = {isa = PBXBuildFile; fileRef = 8B1CE406BD162EB836F56A46 /* test_savedialog.c */; };
14
+ /* End PBXBuildFile section */
15
+
16
+ /* Begin PBXContainerItemProxy section */
17
+ 57D02ABA51362C2C44D188FA /* PBXContainerItemProxy */ = {
18
+ isa = PBXContainerItemProxy;
19
+ containerPortal = 360631F05E40EAA245DC7830 /* nfd.xcodeproj */;
20
+ proxyType = 2;
21
+ remoteGlobalIDString = 4E280AA77CCE5E99D60FB8E7;
22
+ remoteInfo = libnfd.a;
23
+ };
24
+ AA0A9D53A3709EC5970BFB93 /* PBXContainerItemProxy */ = {
25
+ isa = PBXContainerItemProxy;
26
+ containerPortal = 360631F05E40EAA245DC7830 /* nfd.xcodeproj */;
27
+ proxyType = 1;
28
+ remoteGlobalIDString = ED35A9AD9188475FA3C08FED;
29
+ remoteInfo = libnfd.a;
30
+ };
31
+ /* End PBXContainerItemProxy section */
32
+
33
+ /* Begin PBXFileReference section */
34
+ 34DE87E75B04B799C20BAE27 /* test_savedialog */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = test_savedialog; path = test_savedialog; sourceTree = BUILT_PRODUCTS_DIR; };
35
+ 360631F05E40EAA245DC7830 /* libnfd.a */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "nfd.xcodeproj"; path = nfd.xcodeproj; sourceTree = SOURCE_ROOT; };
36
+ 4B74DEAE2FBBE6E0B3A914EE /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
37
+ 893A8412D69D7A444CBC7A52 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
38
+ 8B1CE406BD162EB836F56A46 /* test_savedialog.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = test_savedialog.c; path = ../../test/test_savedialog.c; sourceTree = "<group>"; };
39
+ /* End PBXFileReference section */
40
+
41
+ /* Begin PBXFrameworksBuildPhase section */
42
+ 8152A1D72440C889B366A817 /* Frameworks */ = {
43
+ isa = PBXFrameworksBuildPhase;
44
+ buildActionMask = 2147483647;
45
+ files = (
46
+ BDAA66E6806AC758DD9FA526 /* Foundation.framework in Frameworks */,
47
+ B762408A248A4EFC261D3ECA /* AppKit.framework in Frameworks */,
48
+ 62D586CEA6E958009ABADD0E /* libnfd.a in Frameworks */,
49
+ );
50
+ runOnlyForDeploymentPostprocessing = 0;
51
+ };
52
+ /* End PBXFrameworksBuildPhase section */
53
+
54
+ /* Begin PBXGroup section */
55
+ 5D4848BA745AE3EC6476DEFA /* Products */ = {
56
+ isa = PBXGroup;
57
+ children = (
58
+ 164F31368771D2283D387F76 /* libnfd.a */,
59
+ );
60
+ name = Products;
61
+ sourceTree = "<group>";
62
+ };
63
+ 9D968EAA920D05DCE0E0A4EA /* Projects */ = {
64
+ isa = PBXGroup;
65
+ children = (
66
+ 360631F05E40EAA245DC7830 /* nfd.xcodeproj */,
67
+ 360631F05E40EAA245DC7830 /* nfd.xcodeproj */,
68
+ );
69
+ name = Projects;
70
+ sourceTree = "<group>";
71
+ };
72
+ A6C936B49B3FADE6EA134CF4 /* Products */ = {
73
+ isa = PBXGroup;
74
+ children = (
75
+ 34DE87E75B04B799C20BAE27 /* test_savedialog */,
76
+ );
77
+ name = Products;
78
+ sourceTree = "<group>";
79
+ };
80
+ BBF76781A7E87333FA200DC1 /* Frameworks */ = {
81
+ isa = PBXGroup;
82
+ children = (
83
+ 4B74DEAE2FBBE6E0B3A914EE /* Foundation.framework */,
84
+ 893A8412D69D7A444CBC7A52 /* AppKit.framework */,
85
+ );
86
+ name = Frameworks;
87
+ sourceTree = "<group>";
88
+ };
89
+ D43C4D1E26C27810F906DB5E /* test_savedialog */ = {
90
+ isa = PBXGroup;
91
+ children = (
92
+ 8B1CE406BD162EB836F56A46 /* test_savedialog.c */,
93
+ BBF76781A7E87333FA200DC1 /* Frameworks */,
94
+ A6C936B49B3FADE6EA134CF4 /* Products */,
95
+ 9D968EAA920D05DCE0E0A4EA /* Projects */,
96
+ );
97
+ name = test_savedialog;
98
+ sourceTree = "<group>";
99
+ };
100
+ /* End PBXGroup section */
101
+
102
+ /* Begin PBXNativeTarget section */
103
+ EC717EEDE5D7805FD972DD2D /* test_savedialog */ = {
104
+ isa = PBXNativeTarget;
105
+ buildConfigurationList = 6F8DEA36127C10E8A1A1F076 /* Build configuration list for PBXNativeTarget "test_savedialog" */;
106
+ buildPhases = (
107
+ F13A227794284929234E28B7 /* Resources */,
108
+ 5AE73BCEFDD562808CFB420E /* Sources */,
109
+ 8152A1D72440C889B366A817 /* Frameworks */,
110
+ );
111
+ buildRules = (
112
+ );
113
+ dependencies = (
114
+ 4B0085C3621320F5522F1C03 /* PBXTargetDependency */,
115
+ 4B0085C3621320F5522F1C03 /* PBXTargetDependency */,
116
+ );
117
+ name = test_savedialog;
118
+ productInstallPath = "$(HOME)/bin";
119
+ productName = test_savedialog;
120
+ productReference = 34DE87E75B04B799C20BAE27 /* test_savedialog */;
121
+ productType = "com.apple.product-type.tool";
122
+ };
123
+ /* End PBXNativeTarget section */
124
+
125
+ /* Begin PBXProject section */
126
+ 08FB7793FE84155DC02AAC07 /* Project object */ = {
127
+ isa = PBXProject;
128
+ buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "test_savedialog" */;
129
+ compatibilityVersion = "Xcode 3.2";
130
+ hasScannedForEncodings = 1;
131
+ mainGroup = D43C4D1E26C27810F906DB5E /* test_savedialog */;
132
+ projectDirPath = "";
133
+ projectReferences = (
134
+ {
135
+ ProductGroup = 5D4848BA745AE3EC6476DEFA /* Products */;
136
+ ProjectRef = 360631F05E40EAA245DC7830 /* nfd.xcodeproj */;
137
+ },
138
+ {
139
+ ProductGroup = 5D4848BA745AE3EC6476DEFA /* Products */;
140
+ ProjectRef = 360631F05E40EAA245DC7830 /* nfd.xcodeproj */;
141
+ },
142
+ );
143
+ projectRoot = "";
144
+ targets = (
145
+ EC717EEDE5D7805FD972DD2D /* test_savedialog */,
146
+ );
147
+ };
148
+ /* End PBXProject section */
149
+
150
+ /* Begin PBXReferenceProxy section */
151
+ 164F31368771D2283D387F76 /* libnfd.a */ = {
152
+ isa = PBXReferenceProxy;
153
+ fileType = archive.ar;
154
+ path = libnfd.a;
155
+ remoteRef = 57D02ABA51362C2C44D188FA /* PBXContainerItemProxy */;
156
+ sourceTree = BUILT_PRODUCTS_DIR;
157
+ };
158
+ /* End PBXReferenceProxy section */
159
+
160
+ /* Begin PBXResourcesBuildPhase section */
161
+ F13A227794284929234E28B7 /* Resources */ = {
162
+ isa = PBXResourcesBuildPhase;
163
+ buildActionMask = 2147483647;
164
+ files = (
165
+ );
166
+ runOnlyForDeploymentPostprocessing = 0;
167
+ };
168
+ /* End PBXResourcesBuildPhase section */
169
+
170
+ /* Begin PBXSourcesBuildPhase section */
171
+ 5AE73BCEFDD562808CFB420E /* Sources */ = {
172
+ isa = PBXSourcesBuildPhase;
173
+ buildActionMask = 2147483647;
174
+ files = (
175
+ D68362BE2DE8D5B0DFF6F0FE /* test_savedialog.c in Sources */,
176
+ );
177
+ runOnlyForDeploymentPostprocessing = 0;
178
+ };
179
+ /* End PBXSourcesBuildPhase section */
180
+
181
+ /* Begin PBXTargetDependency section */
182
+ 4B0085C3621320F5522F1C03 /* PBXTargetDependency */ = {
183
+ isa = PBXTargetDependency;
184
+ name = libnfd.a;
185
+ targetProxy = AA0A9D53A3709EC5970BFB93 /* PBXContainerItemProxy */;
186
+ };
187
+ /* End PBXTargetDependency section */
188
+
189
+ /* Begin PBXVariantGroup section */
190
+ /* End PBXVariantGroup section */
191
+
192
+ /* Begin XCBuildConfiguration section */
193
+ 0EFAC8E73520F8999C27EF27 /* Release */ = {
194
+ isa = XCBuildConfiguration;
195
+ buildSettings = {
196
+ CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
197
+ CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
198
+ GCC_OPTIMIZATION_LEVEL = 3;
199
+ GCC_PREPROCESSOR_DEFINITIONS = (
200
+ NDEBUG,
201
+ );
202
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
203
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
204
+ GCC_WARN_UNUSED_VARIABLE = YES;
205
+ LIBRARY_SEARCH_PATHS = (
206
+ ../lib/Release/x64,
207
+ );
208
+ OBJROOT = obj/x64/Release/test_savedialog;
209
+ ONLY_ACTIVE_ARCH = NO;
210
+ SYMROOT = ../bin;
211
+ USER_HEADER_SEARCH_PATHS = (
212
+ ../../src/include,
213
+ );
214
+ };
215
+ name = Release;
216
+ };
217
+ 0F8CFFFCD2F8C1AE119C663C /* Debug */ = {
218
+ isa = XCBuildConfiguration;
219
+ buildSettings = {
220
+ ALWAYS_SEARCH_USER_PATHS = NO;
221
+ CONFIGURATION_BUILD_DIR = ../bin;
222
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
223
+ GCC_DYNAMIC_NO_PIC = NO;
224
+ INSTALL_PATH = /usr/local/bin;
225
+ PRODUCT_NAME = test_savedialog_d;
226
+ };
227
+ name = Debug;
228
+ };
229
+ 6D9009F6BAF3002831120036 /* Release */ = {
230
+ isa = XCBuildConfiguration;
231
+ buildSettings = {
232
+ ALWAYS_SEARCH_USER_PATHS = NO;
233
+ CONFIGURATION_BUILD_DIR = ../bin;
234
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
235
+ GCC_DYNAMIC_NO_PIC = NO;
236
+ INSTALL_PATH = /usr/local/bin;
237
+ PRODUCT_NAME = test_savedialog;
238
+ };
239
+ name = Release;
240
+ };
241
+ B5BD5F6DCCCFFA9FBCEBF5AD /* Debug */ = {
242
+ isa = XCBuildConfiguration;
243
+ buildSettings = {
244
+ CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
245
+ CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
246
+ COPY_PHASE_STRIP = NO;
247
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
248
+ GCC_OPTIMIZATION_LEVEL = 0;
249
+ GCC_PREPROCESSOR_DEFINITIONS = (
250
+ DEBUG,
251
+ );
252
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
253
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
254
+ GCC_WARN_UNUSED_VARIABLE = YES;
255
+ LIBRARY_SEARCH_PATHS = (
256
+ ../lib/Debug/x64,
257
+ );
258
+ OBJROOT = obj/x64/Debug/test_savedialog;
259
+ ONLY_ACTIVE_ARCH = YES;
260
+ OTHER_LDFLAGS = (
261
+ "-lnfd_d",
262
+ );
263
+ SYMROOT = ../bin;
264
+ USER_HEADER_SEARCH_PATHS = (
265
+ ../../src/include,
266
+ );
267
+ };
268
+ name = Debug;
269
+ };
270
+ /* End XCBuildConfiguration section */
271
+
272
+ /* Begin XCConfigurationList section */
273
+ 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "test_savedialog" */ = {
274
+ isa = XCConfigurationList;
275
+ buildConfigurations = (
276
+ 0EFAC8E73520F8999C27EF27 /* Release */,
277
+ B5BD5F6DCCCFFA9FBCEBF5AD /* Debug */,
278
+ );
279
+ defaultConfigurationIsVisible = 0;
280
+ defaultConfigurationName = Release;
281
+ };
282
+ 6F8DEA36127C10E8A1A1F076 /* Build configuration list for PBXNativeTarget "test_savedialog" */ = {
283
+ isa = XCConfigurationList;
284
+ buildConfigurations = (
285
+ 6D9009F6BAF3002831120036 /* Release */,
286
+ 0F8CFFFCD2F8C1AE119C663C /* Debug */,
287
+ );
288
+ defaultConfigurationIsVisible = 0;
289
+ defaultConfigurationName = Release;
290
+ };
291
+ /* End XCConfigurationList section */
292
+ };
293
+ rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
294
+ }
@@ -0,0 +1,39 @@
1
+ # Building NFD #
2
+
3
+ Most of the building instructions are included in [README.md](/README.md). This file just contains apocrypha.
4
+
5
+ ## Running Premake5 Directly ##
6
+
7
+ *You shouldn't have to run Premake5 directly to build Native File Dialog. This is for package maintainers or people with exotic demands only!*
8
+
9
+ 1. [Clone premake-core](https://github.com/premake/premake-core)
10
+ 2. [Follow instructions on how to build premake](https://github.com/premake/premake-core/wiki/Building-Premake)
11
+ 3. `cd` to `build`
12
+ 4. Type `premake5 <type>`, where <type> is the build you want to create.
13
+
14
+ ### Package Maintainer Only ###
15
+
16
+ I support a custom Premake action: `premake5 dist`, which generates all of the checked in project types in subdirectories. It is useful to run this command if you are submitting a pull request to test all of the supported premake configurations. Do not check in the built projects; I will do so while accepting your pull request.
17
+
18
+ ## SCons build (deprecated) ##
19
+
20
+ As of 1.1.6, the deprecated and unmaintained SCons support is removed.
21
+
22
+ ## Compiling with Mingw ##
23
+
24
+ Use the Makefile in `build/gmake_windows` to build Native File Dialog with mingw. Mingw has many distributions and not all of them are reliable. Here is what worked for me, the primary author of Native File Dialog:
25
+
26
+ 1. Use mingw64, not mingw32. Downloaded from [sourceforge.net](https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe/download).
27
+ 2. When prompted in the intsaller, install the basic compiler and g++.
28
+ 3. Add the installed bin dir to command prompt path.
29
+ 4. Run `set CC=g++` to enforce `g++` instead of the default, `cc` for compiling and linking.
30
+ 5. In `build/gmake_windows`, run `mingw32-make config=release_x64 clean`. Running clean ensures no Visual Studio build products conflict which can cause link errors.
31
+ 6. Now run `mingw32-make config=release_x64`.
32
+
33
+ The author has not attempted to build or even install an x86 toolchain for mingw.
34
+
35
+ If you report an issue, be sure to run make with `verbose=1` so commands are visible.
36
+
37
+ ## Adding NFD source directly to your project ##
38
+
39
+ Lots of developers add NFD source directly to their projects instead of using the included build scripts. As of 1.1.6, this is an acknowledged approach to building. Of course, everyone has a slightly different toolchain with various warnings and linters enabled. If you run a linter or catch a warning, please consider submitting a pull request to help NFD build cleanly for everyone.
@@ -0,0 +1,25 @@
1
+ # Pull Requests #
2
+
3
+ I have had to turn away a number of pull requests due to avoidable circumstances. Please read this file before submitting a pull request. Also look at existing, rejected pull requests which state the reason for rejection.
4
+
5
+ Here are the rules:
6
+
7
+ - **Submit pull requests to the devel branch**. The library must be tested on every compiler and OS, so there is no way I am going to just put your change in the master before it has been sync'd and tested on a number of machines. Master branch is depended upon by hundreds of projects.
8
+
9
+ - **Test your changes on all platforms and compilers that you can.** Also, state which platforms you have tested your code on. 32-bit or 64-bit. Clang or GCC. Visual Studio or Mingw. I have to test all these to accept pull requests, so I prioritize changes that respect my time.
10
+
11
+ - **Submit Premake build changes only**. As of 1.1, SCons is deprecated. Also, do not submit altered generated projects. I will re-run Premake to re-generate them to ensure that I can still generate the project prior to admitting your pull request.
12
+
13
+ - **Do not alter existing behavior to support your desired behavior**. For instance, rewriting file open dialogs to behave differently, while trading off functionality for compatibility, will get you rejected. Consider creating an additional code path. Instead of altering `nfd_win.cpp` to support Windows XP, create `nfd_win_legacy.cpp`, which exists alongside the newer file dialog.
14
+
15
+ - **Do not submit anything I can't verify or maintain**. If you add support for a compiler, include from-scratch install instructions that you have tested yourself. Accepting a pull request means I am now the maintainer of your code, so I must understand what it does and how to test it.
16
+
17
+ - **Do not change the externally facing API**. NFD needs to maintain ABI compatibility.
18
+
19
+ ## Submitting Cloud Autobuild systems ##
20
+
21
+ I have received a few pull requests for Travis and AppVeyor-based autobuilding which I have not accepted. NativeFileDialog is officially covered by my private BuildBot network which supports all three target OSes, both CPU architectures and four compilers. I take the view that having a redundant, lesser autobuild system does not improve coverage: it gives a false positive when partial building succeeds. Please do not invest time into cloud-based building with the hope of a pull request being accepted.
22
+
23
+ ## Contact Me ##
24
+
25
+ Despite all of the "do nots" above, I am happy to recieve new pull requests! If you have any questions about style, or what I would need to accept your specific request, please contact me ahead of submitting the pull request by opening an issue on Github with your question. I will do my best to answer you.
@@ -0,0 +1,21 @@
1
+ /*
2
+ Native File Dialog
3
+
4
+ Internal, common across platforms
5
+
6
+ http://www.frogtoss.com/labs
7
+ */
8
+
9
+
10
+ #ifndef _NFD_COMMON_H
11
+ #define _NFD_COMMON_H
12
+
13
+ #define NFD_MAX_STRLEN 256
14
+ #define _NFD_UNUSED(x) ((void)x)
15
+
16
+ void *NFDi_Malloc( size_t bytes );
17
+ void NFDi_Free( void *ptr );
18
+ void NFDi_SetError( const char *msg );
19
+ void NFDi_SafeStrncpy( char *dst, const char *src, size_t maxCopy );
20
+
21
+ #endif
@@ -0,0 +1,74 @@
1
+ /*
2
+ Native File Dialog
3
+
4
+ User API
5
+
6
+ http://www.frogtoss.com/labs
7
+ */
8
+
9
+
10
+ #ifndef _NFD_H
11
+ #define _NFD_H
12
+
13
+ #ifdef __cplusplus
14
+ extern "C" {
15
+ #endif
16
+
17
+ #include <stddef.h>
18
+
19
+ /* denotes UTF-8 char */
20
+ typedef char nfdchar_t;
21
+
22
+ /* opaque data structure -- see NFD_PathSet_* */
23
+ typedef struct {
24
+ nfdchar_t *buf;
25
+ size_t *indices; /* byte offsets into buf */
26
+ size_t count; /* number of indices into buf */
27
+ }nfdpathset_t;
28
+
29
+ typedef enum {
30
+ NFD_ERROR, /* programmatic error */
31
+ NFD_OKAY, /* user pressed okay, or successful return */
32
+ NFD_CANCEL /* user pressed cancel */
33
+ }nfdresult_t;
34
+
35
+
36
+ /* nfd_<targetplatform>.c */
37
+
38
+ /* single file open dialog */
39
+ nfdresult_t NFD_OpenDialog( const nfdchar_t *filterList,
40
+ const nfdchar_t *defaultPath,
41
+ nfdchar_t **outPath );
42
+
43
+ /* multiple file open dialog */
44
+ nfdresult_t NFD_OpenDialogMultiple( const nfdchar_t *filterList,
45
+ const nfdchar_t *defaultPath,
46
+ nfdpathset_t *outPaths );
47
+
48
+ /* save dialog */
49
+ nfdresult_t NFD_SaveDialog( const nfdchar_t *filterList,
50
+ const nfdchar_t *defaultPath,
51
+ nfdchar_t **outPath );
52
+
53
+
54
+ /* select folder dialog */
55
+ nfdresult_t NFD_PickFolder( const nfdchar_t *defaultPath,
56
+ nfdchar_t **outPath);
57
+
58
+ /* nfd_common.c */
59
+
60
+ /* get last error -- set when nfdresult_t returns NFD_ERROR */
61
+ const char *NFD_GetError( void );
62
+ /* get the number of entries stored in pathSet */
63
+ size_t NFD_PathSet_GetCount( const nfdpathset_t *pathSet );
64
+ /* Get the UTF-8 path at offset index */
65
+ nfdchar_t *NFD_PathSet_GetPath( const nfdpathset_t *pathSet, size_t index );
66
+ /* Free the pathSet */
67
+ void NFD_PathSet_Free( nfdpathset_t *pathSet );
68
+
69
+
70
+ #ifdef __cplusplus
71
+ }
72
+ #endif
73
+
74
+ #endif