From 0693c70f577624e66fd660a888f2d2bcd3fc180b Mon Sep 17 00:00:00 2001 From: Greg Ercolano Date: Fri, 10 Jul 2020 21:49:00 -0700 Subject: First pass at fixing issue 99 A lot of code touched because low level functions needed to pass up error messages reliably, and this had to propagate up the entire driver hierarchy. Tested OK *in English* on: > Linux > OSX 10.10.x > Windows VS2017 > Windows mingw64 I have no way to test on Android, but it might work. TODO: Needs testing in other languages to verify proper UTF8 error messages, esp. with Windows VS, due to complexities with FormatMessage() -- see get_ms_errmsg() --- src/drivers/WinAPI/Fl_WinAPI_System_Driver.H | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/drivers/WinAPI/Fl_WinAPI_System_Driver.H') diff --git a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H index e6446923d..91b230d5f 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H +++ b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H @@ -68,7 +68,9 @@ public: // these 2 are in Fl_get_key_win32.cxx virtual int event_key(int k); virtual int get_key(int k); - virtual int filename_list(const char *d, dirent ***list, int (*sort)(struct dirent **, struct dirent **) ); + virtual int filename_list(const char *d, dirent ***list, + int (*sort)(struct dirent **, struct dirent **), + char *errmsg=NULL, int errmsg_sz=0); virtual int filename_expand(char *to,int tolen, const char *from); virtual int filename_relative(char *to, int tolen, const char *from, const char *base); virtual int filename_absolute(char *to, int tolen, const char *from); @@ -78,7 +80,9 @@ public: virtual int open_uri(const char *uri, char *msg, int msglen); virtual int use_recent_tooltip_fix() {return 1;} virtual int file_browser_load_filesystem(Fl_File_Browser *browser, char *filename, int lname, Fl_File_Icon *icon); - virtual int file_browser_load_directory(const char *directory, char *filename, size_t name_size, dirent ***pfiles, Fl_File_Sort_F *sort); + virtual int file_browser_load_directory(const char *directory, char *filename, size_t name_size, + dirent ***pfiles, Fl_File_Sort_F *sort, + char *errmsg=NULL, int errmsg_sz=0); virtual void newUUID(char *uuidBuffer); virtual char *preference_rootnode(Fl_Preferences *prefs, Fl_Preferences::Root root, const char *vendor, const char *application); -- cgit v1.2.3