From f2bb3ea76cae066113683641043d835c53658301 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Thu, 6 Nov 2014 21:33:09 +0000 Subject: 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 --- FL/Fl_Native_File_Chooser.H | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'FL/Fl_Native_File_Chooser.H') 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 -# include // malloc +#if defined(FL_LIBRARY) || FLTK_ABI_VERSION < 10304 # include -# include // OPENFILENAME, GetOpenFileName() -# include // BROWSEINFO, SHBrowseForFolder() +# include // OPENFILENAMEW, GetOpenFileName() +# include // 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 -# include // _POSIX_NAME_MAX #else # include // 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 *); -- cgit v1.2.3