summaryrefslogtreecommitdiff
path: root/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx
AgeCommit message (Collapse)Author
2025-11-01Fix UTF-8 documentation'Matthias Melcher
Fix Unicode buffer allocation
2025-11-01Improve docs for UTF-8 calls (1/2)(#125)Matthias Melcher
2025-03-17Fix comparison that's always trueAlbrecht Schlosser
... because base_dir[0] and dest_dir[0] are *signed* chars.
2025-03-17Windows: fix "heap-use-after-free" in home_directory_name()Albrecht Schlosser
Calling getenv() twice with different output vars and accessing both later could cause "heap-use-after-free" error in some Windows versions. The result of home_directory_name() would be unpredictable. Found using Wine and/or MSYS2/clang/libc++ with Address Sanitizer.
2025-02-05Fix typos and trailing whitespaceAlbrecht Schlosser
Also replace 'MSWindows' with 'Windows' where appropriate, leaving only old documents like README files from 1.3 and older as-is.
2024-12-21FLUID: Improve path handling on Windows.MatthiasWM
2023-12-13#840: Fixes fixed buffer size in Fl::args_to_utf8()MatthiasWM
2023-11-29Add commandline conversion for Windows (no-op on other platforms)Albrecht Schlosser
- add Fl::args_to_utf8() to convert commandline arguments to UTF-8 This new function closes the gap that previously only Visual Studio applications converted their commandlines to UTF-8. Tested with MinGW, MSYS2/MinGW-w64, and Visual Studio (2019).
2023-10-11Fixes fl_filename_relative on Linux, Mac, and Windows (#787)Matthias Melcher
* fixed filename_relative for Linux * Fixing fl_filename_relative for MSWindows. * Update documentation * Fixed docs. * Fixes Linux and macOS builds
2023-09-05Adds some convenience methods.Matthias Melcher
fl_filename_absolute can no generate a path using arbitrary source paths. Fl_Menu_ adds find_item_with_user_data and find_item_with_argument Fl_String adds find(string, start)
2023-04-24Windows: define _WIN32_IE for older MinGW versions (#710)Albrecht Schlosser
... if _WIN32_IE is not defined. Older MinGW versions would otherwise not define SHGFP_TYPE_CURRENT which is needed since commit 5a4e7caa54bab9da2061b0003bb546aa0da6ea1b that fixes GitHub issue #710: "Fl_Preferences not stored on Windows 10". This commit is based on Ian's work as discussed in fltk.coredev, thread "fltk-1.4 build error in Fl_WinAPI_System_Driver.cxx with 32-bit mingw" on Apr 20, 2023.
2023-03-27Windows: use SHGetFolderPathW() for application data folder (#710)Albrecht Schlosser
See GitHub issue #710: "Fl_Preferences not stored on Windows 10" Summary: don't use the undocumented registry key "Shell Folders", use function SHGetFolderPathW() instead although this function is meanwhile deprecated (but available since Windows XP). Note: tested with 32-bit build running on Windows XP (works).
2022-12-17Remove further unused code after 12da87bManoloFLTK
2022-12-17Remove useless Fl_System_Driver members after 12da87bManoloFLTK
2022-11-15Add support of .svgz image files to fluidManoloFLTK
The prototype of the public Fl_SVG_Image constructor is expanded to allow construction from in-memory, gzip'ed binary data.
2022-09-26Replace all calls to sprintf() by calls to snprintf().ManoloFLTK
2022-06-12Issue #141: fl_filename_absolute bugs fixed for MSWindows.MatthiasWM
2022-04-03Remove '#include <sys/stat.h>' from FL/platform_types.hAlbrecht Schlosser
- Add this include statement only where needed. - Rename Fl_System_Driver::stat() to flstat(). This fixes an issue when using some (!) MinGW 64-bit build systems that obviously '#define stat _stat64' or similar. This would result in compiler problems if 'stat()' is a member function of Fl_System_Driver.
2022-03-23Remove vsscanf_l() call from Win32 driver (it appears to be a BSD-ism and ↵ian.macarthur
unsupported by the MS tools) and rename several clocale specific methods from "name" to "vname" since they take a va_list not a variable list of arguments.
2022-03-13Separate platform init functions from platform-specific driver filesManoloFLTK
2022-01-19Fixing and upgrading Fl_Preferences (#374)Matthias Melcher
* Added filename function to Fl_Preferences Static function to get filename before opening. Member to get filename after opening. Bug fixes for memory mapped preferences. * ERROR is a macro on Windows, don't use it * Added Fl_Preferences::dirty(). User can now check if the database will be written when flushed or destroyed. Flush returns a crude error code. * Fl_Preferences::get binary data returns # of bytes read. * Verified group deletion code * Fl_Preferences ignores locale. This will make .prefs files interchangeable between different computers. * Updating the Preferences Mode to ignore locale. * Fixes in docs.
2022-01-16Rename FL/fl_string.h to FL/fl_string_functions.hAlbrecht Schlosser
This is part 1 of the final fix for a previous name clash on case insensitive file systems (fl_string.h vs. Fl_String.H).
2021-05-26Fix trailing whitespace and formattingAlbrecht Schlosser
2021-05-26Windows: fix fl_system() and fl_execvp() (STR 3438)Albrecht Schlosser
Use correct conversions to Windows "wide character" encoding and use the appropriate wide character functions.
2021-03-21Windows: fix fl_filename_isdir()Albrecht Schlosser
- convert filename from UTF-8 to "Windows wide chars" - use GetFileAttributesW() instead of _stat()
2021-02-18Make clear we're calling a member function of class Fl_WinAPI_System_Driver.ManoloFLTK
2021-02-16Remove FL_CFG_SYS_POSIX and FL_CFG_SYS_WIN32 preprocessor vars from Fl_lock.cxxManoloFLTK
2021-02-16Use <config.h> when appropriate.ManoloFLTK
2020-10-04Create Fl_X11_System_Driver::dlopen_or_dlsym() for run-time addresses.ManoloFLTK
The intent is to gather in a single place of the X11 platform source code all variable elements when using dlopen() and dlsym() system functions (e.g., .so vs .dylib extension name, is RTLD_DEFAULT available, locations to be sought). Member function Fl_System_Driver::load() is created only to support Fl_Plugin_Manager::load().
2020-08-01Remove unneeded strdup from example, fold tabsGreg Ercolano
2020-08-01Implement + deploy fl_strdup()Greg Ercolano
2020-07-14First pass at fixing issue 99Greg Ercolano
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()
2020-07-06Remove $Id$ tags, update URL's, and moreAlbrecht Schlosser
- remove obsolete svn '$Id$' tags from all source files - update .fl files and generated files accordingly - replace 'http://www.fltk.org' URL's with 'https://...' - replace bug report URL 'str.php' with 'bugs.php' - remove trailing whitespace - fix other whitespace errors flagged by Git - add and/or fix missing or wrong standard headers - convert tabs to spaces in all source files The only relevant code changes are in the fluid/ folder where some .fl files and other source files were used to generate the '$Id' headers and footers.
2020-02-10Implement fl_putenv() as cross-platform putenv()Albrecht Schlosser
2020-01-03Fixed previous commit for MSWindows.MatthiasM
2020-01-03Linux/MSWindows: improved Fl_Preferences file path checkingMatthias Melcher
2019-12-31Limiting file access for Fl_Preferences.Matthias Melcher
Added Fl_Preferences::file_access() and various flags that make it possible to limit or completely deny file access to the preferences system, either for the core library or for the application or both.
2018-02-09Replace "WIN32" with "_WIN32" or "Windows".Albrecht Schlosser
Replace compiler/preprocessor/platform macro "WIN32" with "_WIN32". Replace "WIN32" in text and documentation with "Windows". Replace "MSWindows" with "Windows". To do: README.Windows.txt (and maybe other documentation as well) needs updates. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12655 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-11-11Refactor Fl_WinAPI_System_Driver string conversion and more.Albrecht Schlosser
Remove duplicated code by using local (static) string conversion functions. This makes the code better maintainable and removes redundancies. Rename some variables (particularly one-letter names) to more useful names, minor code reformatting to be more compatible with the CMP. To do: check for potential memory leaks, maybe free temporary buffers. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12556 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-11-10Add missing platform wrapper fl_chdir() for chdir().Albrecht Schlosser
Tested under Windows and Linux, but not yet used in library code. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12549 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-10-15Rename fl_open_ext() parameter 'translation' to 'binary'.Albrecht Schlosser
The default (0) is 'text' mode, non-zero is 'binary' mode on platforms that distinguish text and binary mode. Currently Windows is the only supported platform that needs this. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12500 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-10-12Add fl_open_ext() to control whether the file is opened in binary/text mode.Manolo Gouy
This new function allows to write Fl_SVG_Image::fl_gzopen() in a completely platform-independent way. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12489 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-10-04Undo commit at r.12475 that is not adequate.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12476 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-10-04Fl_SVG_Image class: add support for compressed .svgz image files.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12475 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-09-19Convert the initialisation of global variables fl_local_shift, ↵Manolo Gouy
fl_local_meta, etc... using the driver approach. This avoids repeating the default values "Shift", "Meta", etc... for several platforms. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12463 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-09-19Fl_XXX_System_Driver::clocale_printf() : use thread-specific, locale-setting ↵Manolo Gouy
APIs where possible This commit uses thread-specific, locale-setting functions under Linux and MSWindows-Visual Studio They are already used by the Mac OS system driver, when possible. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12461 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-03-07Add to Fl_System_Driver support for measuring time with split second resolution.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12187 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-10-19Add one more argument to virtual ↵Manolo Gouy
Fl_System_Driver::file_browser_load_filesystem() giving length of the filename argument git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@12050 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-07-23Fix Fl_X11_System_Driver::utf8locale() that did not work when no locale is set.Manolo Gouy
Also, minor simplification of Fl_WinAPI_System_Driver::utf8locale(). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11846 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-12Begin to rewrite Fl_File_Chooser2.cxx for the driver model.Manolo Gouy
The parts with case-insensitive filename comparisons for WIN32 and for WIN32 but not CYGWIN still have to be rewritten. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11588 ea41ed52-d2ee-0310-a9c1-e6b18d33e121