summaryrefslogtreecommitdiff
path: root/FL/Fl_Native_File_Chooser.H
diff options
context:
space:
mode:
Diffstat (limited to 'FL/Fl_Native_File_Chooser.H')
-rw-r--r--FL/Fl_Native_File_Chooser.H25
1 files changed, 16 insertions, 9 deletions
diff --git a/FL/Fl_Native_File_Chooser.H b/FL/Fl_Native_File_Chooser.H
index dbc4b0cf1..1a9912a29 100644
--- a/FL/Fl_Native_File_Chooser.H
+++ b/FL/Fl_Native_File_Chooser.H
@@ -26,11 +26,16 @@
// Use Windows' chooser
#ifdef WIN32
// #define _WIN32_WINNT 0x0501 // needed for OPENFILENAME's 'FlagsEx'
-# include <stdio.h>
-# include <stdlib.h> // malloc
+#if defined(FL_LIBRARY) || FLTK_ABI_VERSION < 10304
# include <windows.h>
-# include <commdlg.h> // OPENFILENAME, GetOpenFileName()
-# include <shlobj.h> // BROWSEINFO, SHBrowseForFolder()
+# include <commdlg.h> // OPENFILENAMEW, GetOpenFileName()
+# include <shlobj.h> // BROWSEINFOW, SHBrowseForFolder()
+typedef OPENFILENAMEW fl_OPENFILENAMEW;
+typedef BROWSEINFOW fl_BROWSEINFOW;
+#else
+typedef void fl_OPENFILENAMEW;
+typedef void fl_BROWSEINFOW;
+#endif
#endif
// Use Apple's chooser
@@ -41,7 +46,6 @@
// All else falls back to FLTK's own chooser
#if ! defined(__APPLE__) && !defined(WIN32)
# include <FL/Fl_File_Chooser.H>
-# include <unistd.h> // _POSIX_NAME_MAX
#else
# include <FL/filename.H> // FL_EXPORT
#endif
@@ -154,8 +158,13 @@ public:
private:
int _btype; // kind-of browser to show()
int _options; // general options
- OPENFILENAMEW _ofn; // GetOpenFileName() & GetSaveFileName() struct
- BROWSEINFOW _binf; // SHBrowseForFolder() struct
+#if FLTK_ABI_VERSION >= 10304
+ fl_OPENFILENAMEW *_ofn_ptr; // GetOpenFileName() & GetSaveFileName() struct
+ fl_BROWSEINFOW *_binf_ptr; // SHBrowseForFolder() struct
+#else
+ fl_OPENFILENAMEW _ofn;
+ fl_BROWSEINFOW _binf;
+#endif
char **_pathnames; // array of pathnames
int _tpathnames; // total pathnames
char *_directory; // default pathname to use
@@ -173,13 +182,11 @@ private:
void set_single_pathname(const char *s);
void add_pathname(const char *s);
- void FreePIDL(LPITEMIDLIST pidl);
void ClearOFN();
void ClearBINF();
void Win2Unix(char *s);
void Unix2Win(char *s);
int showfile();
- static int CALLBACK Dir_CB(HWND win, UINT msg, LPARAM param, LPARAM data);
int showdir();
void parse_filter(const char *);