summaryrefslogtreecommitdiff
path: root/FL
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2014-11-06 21:33:09 +0000
committerManolo Gouy <Manolo>2014-11-06 21:33:09 +0000
commitf2bb3ea76cae066113683641043d835c53658301 (patch)
tree72793e6147a3bec67b28de12fcac8e938c4e5dae /FL
parentbd1446a6eb5b845179bb850c0f371a323141e8b0 (diff)
The Fl_Native_File_Chooser class contains, under WIN32, two system-defined structures
(OPENFILENAMEW and BROWSEINFOW). This forces any application program that uses Fl_Native_File_Chooser to include file windows.h. This is corrected by using in the Fl_Native_File_Chooser class pointers to the 2 structures. The changes are protected by #if FLTK_ABI_VERSION >= 10304 for ABI compatibility. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10437 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL')
-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 *);