Commit Graph

9618 Commits

Author SHA1 Message Date
Albrecht Schlosser cc6a7d008b Remove obsolete config variable 'HAVE_LIBPNG_PNG_H'
This variable has never been used in the code. Configure and CMake
look for a *working* libpng (HAVE_PNG) and set variable HAVE_PNG_H
if the header <png.h> can be included.

The alternative to include <libpng/png.h> is always used in the #else
clause and doesn't need its own config variable. Configure and CMake
log what they find, hence this extra variable is not necessary.
2022-04-04 21:10:25 +02:00
ManoloFLTK 2ee27e39db Catch also Fl_Posix_System_Driver after rename stat -> flstat in Fl_System_Driver 2022-04-04 08:30:43 +02:00
Albrecht Schlosser 228d04d0e0 Build and use fluid-cmd on Windows for .fl files (#224, #293)
On Windows fluid.exe is a "GUI" program and does not allow console
output which can be a problem in automated builds. In Visual Studio
the fluid GUI program would pop up console windows when generating
.cxx and .h files from .fl files.

The new (additional) fluid-cmd.exe is built as console application
for users that need it and it is used in the FLTK build process on
Windows to convert the .fl files.
2022-04-03 23:47:23 +02:00
Albrecht Schlosser 5a8b9d9130 Improve libpng header search (notably on macOS)
Fix usage of internal cache variables so users can switch between
system and builtin libpng reliably.
2022-04-03 23:34:09 +02:00
Albrecht Schlosser 9a7af11108 Silence compiler warnings [-Wunused-but-set-variable] 2022-04-03 22:30:59 +02:00
Albrecht Schlosser 717a7d266b Remove '#include <sys/stat.h>' from FL/platform_types.h
- 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-04-03 22:01:41 +02:00
ManoloFLTK 9aba7c9db0 Fl_Wayland_Window_Driver::scroll() when GUI scaling >= 2. 2022-04-01 14:52:47 +02:00
ManoloFLTK d992a12403 Merge remote-tracking branch 'refs/remotes/origin/master' 2022-04-01 14:36:41 +02:00
ManoloFLTK a53efd73d7 Fix regression introduced with d9a6ec8 visible in test/scroll. 2022-04-01 14:36:33 +02:00
Albrecht Schlosser e91d65cd2f Fix whitespace errors (no code changes) 2022-03-31 16:00:11 +02:00
Albrecht Schlosser 34d02a3ddf Update .clang-format control file 2022-03-31 15:57:10 +02:00
ManoloFLTK d9a6ec88e4 Add support of Fl_Region to the Cairo graphics driver
and remove it from the Wayland graphics driver.
2022-03-31 10:36:01 +02:00
Albrecht Schlosser a638f5a545 Add method Fl_Shared_Image::image()
This public method returns a pointer to the internal Fl_Image
object (const Fl_Image *). This is only for reference, the internal
image must not be modified by user code but it can be inspected and
copied to another image.
2022-03-30 15:56:27 +02:00
Albrecht Schlosser df4503ea2c Export fl_cmap to be able to build shared FLTK libraries 2022-03-27 17:13:16 +02:00
Albrecht Schlosser b037472649 Move src/cmap.cxx to util/cmap.cxx (utilities folder)
Regenerated src/fl_cmap.h with less spaces, updated copyright year.
Only whitespace and comments are changed in this file.

Note that src/cmap.cxx is not compiled to build the FLTK libs,
it's only used to generate src/fl_cmap.h.
2022-03-27 17:05:55 +02:00
ManoloFLTK dc8c4b5676 Wayland: replace public fl_event_time by static wld_event_time. 2022-03-27 09:20:30 +02:00
Albrecht Schlosser 2b8f3a757a CMake: Don't install man pages of game programs (issue #23)
I decided not to install the man pages for consistency because we
don't install the executable programs. The instructions are commented
out only so they can be activated easily if this will be changed,
i.e. if we decide to install the test/game programs in the future.

Closes #23
2022-03-26 20:04:04 +01:00
Albrecht Schlosser 9cf1afda62 CMake: Remove obsolete platform dependent instructions
The intended effect (building a Windows "GUI" application), is
correctly achieved using the "WIN32" option of add_executable()
selectively where appropriate rather than setting this platform
specific option for *all* (Windows) executables when using GNU
compilers (MinGW, MSYS2, Cygwin, ...).
2022-03-26 18:53:05 +01:00
Albrecht Schlosser 111b858e12 CMake/MSVC: limit "/utf-8" to VS 2015 and later (PR #415)
According to PR #415 this switch was added in Visual Studio 2015
Update 3. However, version "1900" does not distinguish updates,
hence Visual Studio 2015 up to Update 2 may fail to compile with
this addition. Installing the updates would obviously fix this.
2022-03-26 18:13:47 +01:00
ZJUGKC 6f06265e86 Add UTF-8 encoding support in setup.cmake for MSVC (PR #415)
The source files are all encoded by UTF-8 without BOM. This will raise
warnings and errors when compiling by the MSVC with some active code
pages (ACP). The file `test/ask.cxx` contains such characters with UTF-8
encoding. Adding `/utf-8` here is equivalent to specifying
`/source-charset:utf-8 /execution-charset:utf-8`, and all warnings and
errors are removed.
2022-03-26 18:00:50 +01:00
YX e9b1c2fed0 Add `const` to Fl_Image::fail() (PR #415) 2022-03-26 17:55:13 +01:00
Albrecht Schlosser fc250a3aa2 Update documentation and dependencies 2022-03-25 17:27:46 +01:00
Albrecht Schlosser 3fb66056d6 CMake: add missing variable initialization
Although CMake uses previously undefined variables like empty strings
it could happen that variables set in the calling context by other
projects initialized some variables with unexpected values.

Example: FLTK_LIBRARIES could have been initialized by previous
  execution of 'find_package(FLTK ...)' in a project using FLTK
2022-03-25 17:27:46 +01:00
ManoloFLTK 0ab3ca7cf6 Remove documentation of non-existant function return values. 2022-03-25 16:54:53 +01:00
ManoloFLTK 427e4dbc7a Remove platform-dependent type Fl_Bitmask (not in documented public API). 2022-03-24 10:00:01 +01:00
ManoloFLTK 70f61a63f4 Merge remote-tracking branch 'refs/remotes/origin/master' 2022-03-24 06:30:33 +01:00
ManoloFLTK 194164054b Remove useless virtual member function overrides. 2022-03-24 06:30:27 +01:00
ian.macarthur 29c6d6c679 Remove vsscanf_l() call from Win32 driver (it appears to be a BSD-ism and 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-23 19:46:35 +01:00
ManoloFLTK 54ecae9bda Create struct wld_window *Fl_Wayland_Window_Driver::wld_window to replace eventually fl_window. 2022-03-23 14:11:49 +01:00
ManoloFLTK 2d71a95b5d Wayland: replace global fl_display by function struct wl_display *fl_wl_display(). 2022-03-23 11:37:25 +01:00
ManoloFLTK 4c854dbbc3 Remove unnecessary libEGL-devel Fedora package from requirements list. 2022-03-23 09:03:12 +01:00
ManoloFLTK 26a78c4992 Fix for issue #419: Wayland: scale/resize issue. 2022-03-23 07:57:17 +01:00
ManoloFLTK 52015f2a26 Restore CMake build with OPTION_USE_GL=0 2022-03-22 22:16:03 +01:00
ManoloFLTK da5efb95d5 Add support of configure --enable-wayland --disable-gl - Cont'd. 2022-03-22 21:47:22 +01:00
ManoloFLTK 7432079632 Add support of configure --enable-wayland --disable-gl 2022-03-22 21:28:29 +01:00
ManoloFLTK 61d72c76d2 Restore building when HAVE_GL is 0 2022-03-22 20:43:02 +01:00
ManoloFLTK 94d2f81daa Add autoconf for configure-based builds. 2022-03-22 16:24:26 +01:00
ManoloFLTK 6cc394a39e Merge remote-tracking branch 'refs/remotes/origin/master' 2022-03-22 08:16:56 +01:00
ManoloFLTK ffbc66321c Add Wayland build recipe for Fedora. 2022-03-22 08:16:42 +01:00
Albrecht Schlosser f1b00c6637 Fix driver definitions of vsnprintf() and vsscanf()
These two functions are fully defined in the platform specific driver
methods, there's no need to define them in the base class.

This quick fix returns 0 from the base class method. The main reason
was to avoid a compiler error of MSVC 2010 and earlier, i.e. before
MSVC 2012.

Todo: int Fl_WinAPI_System_Driver::clocale_sscanf() needs to be fixed
because '_vsscanf_l()' (with lower case 'L' for 'locale') does not
exist in MSVC 2010 and earlier. It is not clear yet in which version
it was added - current MS docs show it in MSVC 2015 and later.
2022-03-21 17:16:14 +01:00
Albrecht Schlosser 34b89f8466 MSVC: use fl_snprintf() rather than snprintf()
Note that this fix includes "../src/flstring.h" which makes the source
file no longer compileable without the full source code, e.g. by
using "fltk-config --compile ...". This might be fixed later. (?)
2022-03-21 17:05:32 +01:00
Albrecht Schlosser fa84b58cd5 Fix silly MSVC 2010 parser warnings
Code like "void copy(const char */*stuff*/, ...)" would issue the
warning "'*/' seen outside comment" which is formally true but ...

These warnings don't appear with newer MS compilers, but I fixed them
anyway.
2022-03-21 17:03:13 +01:00
Albrecht Schlosser 35c212ef3b Fix MSVC 2010 warning: using 'this' in initializer list
This is a legitimate warning although it probably didn't do any harm.
2022-03-21 16:57:32 +01:00
Albrecht Schlosser 9e16f3439e Fix MSVC 2010 warning/error: declare variables in C early
... before other code gets executed in a block. The warning or errors
generated were MORE than confusing.
2022-03-21 16:55:07 +01:00
ManoloFLTK ff4cf80891 Avoid using same name (p) for distinct members of derived classes - cont'd. 2022-03-21 16:10:34 +01:00
ManoloFLTK d87b62ea69 Avoid using same name (p) for distinct members of derived classes. 2022-03-21 15:56:50 +01:00
ManoloFLTK bf5b902180 Rename member Fl_Graphics_Driver::p to xpoint to avoid shadowing. 2022-03-21 14:39:00 +01:00
ManoloFLTK 49dae86edf Fix for issue #418 : some warnings about unused functions. 2022-03-21 12:12:07 +01:00
ManoloFLTK a9412b41bb Issue #359 RFE: access the MacOS windowid . 2022-03-21 11:41:51 +01:00
ManoloFLTK 7e76929aff Fix for issue #416: Fl_Xlib_Graphics_Driver_font_xft.cxx has a libasan error. 2022-03-21 10:31:09 +01:00