Commit Graph

12071 Commits

Author SHA1 Message Date
Albrecht Schlosser
dbd54b8557 Add wrap mode to clipboard viewer
- use Fl_Flex to arrange multiple buttons
- switch buttons dynamically depending on tabs (text or image)
2025-07-01 11:03:41 +02:00
Matthias Melcher
42b2388610 Improve bilinear image scaling below 50%
The original code can not scale well below 50%. To improve
filtering in a fast way, huge images are scaled by powers of
two before fine scaling using the original bilinear scale.
2025-06-30 14:56:26 +02:00
Matthias Melcher
3459e43ca8 FLUID: Move i18n settings into its own class 2025-06-27 14:34:49 +02:00
Albrecht Schlosser
088d98389c Improve threads demo test/threads.cxx (#1263)
- Replace Fl_Browser with Fl_Terminal which uses a constant buffer size

- Don't lock the GUI for every single prime. Collect primes for at
  least 0.25 seconds before calling Fl::awake(handler, buffer)

- Use (two) alternate buffers for collecting prime data.

- Use Fl::lock() *only* to protect thread data at initialization time.

Observation on Debian 12, CPU: 12-core, 12th Gen Intel Core i7-1260P:
  speedup > factor 4, using multiple cores,
  GUI fully functional: scrolling the display, resizing, ...
  Tested natively (X11 + Wayland) and cross-compiled for Windows,
  using `wine`.
2025-06-22 16:46:44 +02:00
MatthiasWM
acd77fa8dc Fix Windows compile error from previous commit. 2025-06-19 17:54:31 +02:00
Matthias Melcher
2a7b3c81c1 Ensure that the 'awake' pipe does not overflow (#1263) 2025-06-19 16:04:56 +02:00
Matthias Melcher
eadea6a992 Update Fl::await() and friends API and documentation
This creates the base for #1263, but does not fix it yet.
2025-06-19 15:33:38 +02:00
ManoloFLTK
3d13dfefa9 Fix in window titlebar capture to support macOS 26 Tahoe 2025-06-11 18:43:03 +02:00
ManoloFLTK
ac294f7348 Fix "Selecting menus from the menubar under Wayland when in fullscreen" (#1264) 2025-06-10 17:03:29 +02:00
Albrecht Schlosser
340caa2dc3 Fix usage of 'volatile' in src/Fl_JPEG_Image.cxx (#1207)
- allocate a new struct 'load_stat' on the heap
- use struct load_stat to open image file (fp) and for error counters

The previous fix of #1207 unfortunately decremented volatile variables
which caused (plausible) compiler warnings by clang.
2025-06-06 16:10:35 +02:00
ManoloFLTK
5293beea6f Restore building for Linux w/o cairo and w/o xft 2025-06-05 15:56:09 +02:00
Albrecht Schlosser
7897bbc04f Fix several compiler warnings [-Wextra-semi]
Example:
  warning: extra ‘;’ after in-class function definition [-Wextra-semi]

Also: replace 'FL_OVERRIDE' with 'override' in all modified files
2025-06-05 09:50:07 +02:00
Albrecht Schlosser
2d2f474794 Fix compiler warning warning [-Wundef]
warning: "_WIN32" is not defined, evaluates to 0 [-Wundef]
2025-06-05 09:50:07 +02:00
ManoloFLTK
e2683f36d4 macOS: protect uses of __block by #if defined(__BLOCKS__) condition 2025-06-03 18:27:45 +02:00
ManoloFLTK
b371c1185c Add build option FLTK_USE_DBUS to allow build w/o dbus (PR #1252)
Thanks to @lanodan for most of the source code.
2025-06-03 16:19:27 +02:00
ManoloFLTK
85be70efa5 Restore use of build option FLTK_USE_POLL 2025-06-03 08:23:04 +02:00
ManoloFLTK
9a5e3b95b8 Fix for #1260 - part 4: fix when menu button is in subwindow under Wayland 2025-05-30 21:38:13 +02:00
ManoloFLTK
c13594f999 Fix for #1260 - part3: fix exploration of menu button window under Wayland 2025-05-30 17:59:16 +02:00
ManoloFLTK
86a8d138f2 Fix for #1260 - part2: improve position of menu button window under Wayland 2025-05-30 16:44:26 +02:00
ManoloFLTK
ac0a5d52cb Wayland: fix "A flag to set how menus should show up" (#1260) 2025-05-29 17:42:16 +02:00
Albrecht Schlosser
3bc379bc4e Fix usage of FLTK_BACKEND_WAYLAND and FLTK_USE_WAYLAND
- Do not change or remove the cache variable FLTK_BACKEND_WAYLAND:
  this is an option set (and must only be changed) by the user.
- CMake/options.cmake: check Wayland availability if option
  FLTK_BACKEND_WAYLAND is ON and set the result variable
  FLTK_USE_WAYLAND accordingly.
- Replace FLTK_BACKEND_WAYLAND with FLTK_USE_WAYLAND everywhere
  else, except as noted above: in options.cmake.
2025-05-28 21:13:10 +02:00
Albrecht Schlosser
1a6322f8e1 Update makesrcdist to reflect packaging (CPack) and more
- remove conversion of fltk.spec.in to fltk.spec
- improve code related to working directory (variables)
- remove old (disabled) debug code
- create a standard MD5SUM file for verification of packages
- improve comments and output of instructions
2025-05-24 15:44:48 +02:00
Albrecht Schlosser
0bc621bc00 Enable CPack support to build binary packages and installers
This minimal implementation works and enables basic (mostly default)
CPack support to build binary packages of FLTK (RPM, TGZ, NSIS, ...).

Users need the required tools like `rpmbuild` to build a particular
type of package or installer.

Using EPM or rpmbuild directly with a provided "list" file has
been discontinued: fltk.list.in (EPM) and fltk.spec.in (RPM) have
consequently been deleted.

README.CPack.txt: basic documentation
2025-05-24 15:42:47 +02:00
ManoloFLTK
19684ae9d4 Update bundled libdecor to last upstream version (May 14, 2025) 2025-05-21 17:57:38 +02:00
ManoloFLTK
7347d6e2f6 Add change necessary to support new class Fl_Native_Input, possibly as addon
The added if() statement's condition is always false in FLTK before addition to it
of class Fl_Native_Input. Therefore, the present modification is effectless unless
this new class is added to the library, either in its core or as an addon.
2025-05-21 08:08:18 +02:00
Albrecht Schlosser
0960f1c066 Fl_Window::free_position() must not be deprecated
This method was erroneously declared 'deprecated' in previous versions.

However, this method is public and calls the *protected* method
Fl_Window::force_position(). Therefore it is kept as a regular
public method.
2025-05-14 19:05:04 +02:00
Albrecht Schlosser
3114ef0e2f Fix doxygen warnings
1. src/Fl_add_idle.cxx: add missing parameter docs

2. FL/fl_draw.H: rename 1st parameter of fl_draw_pixmap(...) from
   'data' to 'cdata'.

The 2nd warning appears to be caused by a 'friend' declaration in
  FL/Fl_Graphics_Driver.H, line 98:
    'friend FL_EXPORT int fl_draw_pixmap(const char*const* cdata, ...)'

This 'friend' declaration seems to "confuse" some (newer?) doxygen
versions, definitely doxygen 1.13.2.
2025-05-14 17:05:20 +02:00
Albrecht Schlosser
9b1379e688 Remove deprecated function Fl::set_idle()
This turned out to be more complicated than just to delete a function
because it was used internally, and the callback signatures were a bit
flaky. I also added a lot of documentation to clarify matters.

FL/Fl.H: document idle callback signatures, make some internal
  functions of class Fl private, add public Fl::idle() accessor (read-
  only), add Fl::add_idle(Fl_Old_Idle_Handler cb) to enable using
  old-style idle callbacks w/o 'data' argument.

FL/forms.H: replace Fl::set_idle() with Fl::add_idle().

src/Fl.cxx: rename private Fl::idle_ with trailing underscore.

src/Fl_System_Driver.cxx: use new public accessor Fl::idle() to access
  Fl::idle_ which is now private.

src/Fl_add_idle.cxx: improve documentation, clarify idle callback
  matching, add example code in docs, rename methods,  add overloaded
  Fl::add_idle(Fl_Old_Idle_Handler cb).

src/Fl_win32.cxx: use public Fl::idle() rather than private member.
src/drivers/Unix/Fl_Unix_System_Driver.cxx: same as above.
src/Fl_cocoa.mm: same as above.
2025-05-13 21:08:51 +02:00
Albrecht Schlosser
4d0c1a2a28 Add more documentation about ABI checking and a script to do it
misc/abi-check: This new script can be used (on Linux) to check ABI
  compatibility between patch releases. It does everything required
  in one execution (after installing the prerequisites once).
  Documentation is included in the script. It may be modified for
  other platforms, or ABI checking can be done manually.

README.abi-version.txt: add a chapter regarding ABI checks

misc/abi-compliance-checker.txt: update documentation on how to run
  misc/abi-check. In previous versions (1.4) building was done using
  configure/make. Thus this file was almost completely rewritten.

documentation/src/migration_1_4.dox: an unrelated but tiny correction.
2025-05-11 22:16:16 +02:00
Albrecht Schlosser
facda9a087 Remove obsolete class Fl_String
Note: it's still in branch-1.4 and in git history for reference
2025-05-11 16:47:45 +02:00
Matthias Melcher
82b2001735 Fix unused parameter 2025-05-11 12:48:10 +02:00
Matthias Melcher
c28237d756 Set default DPI to 300 in fl_write_png
Previously, the DPI value was completely random, resulting
in some interesting scaling when reading the png in other apps.
2025-05-11 12:34:04 +02:00
Matthias Melcher
74b0dc7d95 Fix address sanitizer exception for macOS native file chooser
The `memcmp` call would crash in Adress sanitizer if the memory compare
would run into an undefined buffer. `memcmp` is not guaranteed to stop
reading a buffer if a difference is found.
2025-05-11 12:30:22 +02:00
ManoloFLTK
95709ae0ad Wayland: remove crash when resizing hidden subwindow 2025-05-10 21:22:29 +02:00
Greg Ercolano
f8a7e299b0 Fl_Terminal doc fixes, private->protected for utf8_char_at_*() 2025-05-09 09:29:10 -07:00
ManoloFLTK
bca167d03a Fix erroneous #include directive 2025-05-09 10:14:57 +02:00
ManoloFLTK
043bac6f8d Remove declaration of Fl_Scalable_Graphics_Driver from FL/Fl_Graphics_Driver.H
and declare it in non-public header src/Fl_Scalable_Graphics_Driver.H which also
declares classes Fl_Font_Descriptor and Fl_Fontdesc.
2025-05-09 09:51:36 +02:00
Albrecht Schlosser
bcf51371d2 Simplify CMake build config for test and demo programs
Define platform specific library names as CMake variables so they can
be used to build demo programs w/o platform specific instructions.

This includes optional components (e.g. OpenGL) and the MSVC specific
extra object library (call_main) and the fact that we build only one
"monolithic" shared library with MSVC.

Also, enable building FLTK Forms library in CI builds.
2025-05-08 21:34:13 +02:00
Albrecht Schlosser
4d55983833 Remove hardcoded version numbers (part 2) and more documentation
The goal is to change the version number for a new release only in
CMakeLists.txt. This is the second step.

This commit also adds a chapter "Migrating Code from FLTK 1.4 to 1.5".

Details:

- documentation/CMakeLists.txt: configure 'version.dox'
- fluid/documentation/CMakeLists.txt: same as above
- documentation/Doxyfile.in: add "Migrating Code from FLTK 1.4 to 1.5"
- documentation/src/index.dox: include 'version.dox' and 'migrating...'
- fluid/documentation/src/index.dox: same as above
- documentation/src/preface.dox: include 'version.dox'
- documentation/version.dox.in: input to CMake configure 'version.dox'
- fluid/documentation/version.dox.in: same as above
- documentation/src/migration_1_4.dox: update links
- documentation/src/migration_1_5.dox: new documentation chapter
2025-05-07 21:21:35 +02:00
Albrecht Schlosser
d54dbd3d6c Fix a typo and improve formatting in README.md 2025-05-06 20:11:31 +02:00
Albrecht Schlosser
53491f2ca0 Remove hardcoded version numbers: part 1
The goal is to change the version number for a new release only in
CMakeLists.txt. This is the first step.

Details:

- CMake/gen_config.cmake: this new file is included to generate the
  header files config.h (private, root directory), and FL/fl_config.h
  (public, can be installed). This file implements also ABI version
  checks (removed from FL/Enumerations.H and with more checks).
  Warnings are issued if the chosen ABI version is invalid.
- CMake/export.cmake: code to generate 'config.h' was moved to
  CMake/gen_config.cmake.
- CMake/options.cmake: set default of FLTK_BUILD_FORMS=OFF + comments
- CMakeLists.txt: move generation of FL/fl_config.h to gen_config.cmake,
  add API and ABI versions to CMake summary,
- FL/Enumerations.H: remove most of the version number details which
  are now included in FL/fl_config.h. This needed also some doxygen
  related changes.
- README.CMake.txt: improve docs of FL_ABI_VERSION and some more.
  Reflect the new default of CMake option FLTK_BUILD_FORMS (OFF).
- documentation/Doxyfile.in: add FL/fl_config.h to file list. This
  file is created in the build tree (and may be "installed").
- fl_config.h.in: add version number details that have been moved here
  from Enumerations.H (used to generate FL/fl_config.h).
2025-05-06 19:25:53 +02:00
Albrecht Schlosser
9ba11949ca Rename config header input files to better names
Up to FLTK 1.4 we had two distinct input files for each header file:
one for configure and one for CMake. Since 1.5 we have only one input
file for each header which can now have a more appropriate name.

1) configh.cmake.in   -> config.h.in
2) fl_config.cmake.in -> fl_config.h.in
2025-05-05 14:52:02 +02:00
Albrecht Schlosser
d7c705864e Documentation: clarify version numbers and fix minor issues
Remove references to "current" version numbers, use 1.2.3 as example
for clarity and to simplify version number updates.

Also: minor textual fixes (typos), unwrap lines, etc..

Todo: Documentation states:
  "This file is not actively maintained any more, but is left here
   as a reference, until the doxygen documentation is completed."

  Check if the documentation generated by doxygen from source files
  contains everything needed so this file can be removed.
2025-05-01 19:18:48 +02:00
Albrecht Schlosser
719642b5d6 Fix Doxygen warning for older Doxygen versions
Note: doxygen versions < 1.9.6 are not recommended for PDF docs
      but *may* work for HTML documentation.
2025-04-29 20:16:11 +02:00
Albrecht Schlosser
e0802889d4 macOS: disable automatic code signing when using Xcode
This is the default. Users can still override this if they have
  a valid certificate.
2025-04-28 18:36:09 +02:00
Matthias Melcher
9af8abc080 Fix forgotten run_pdflatex call (1.5) 2025-04-23 15:47:31 +02:00
Albrecht Schlosser
1066b69c8e Fix "fully support ... own shared libraries" (#1238)
- If shared libraries are built, then fluid, fltk-options, and the
  "games" are linked against the shared FLTK libraries. On some
  platforms the static and the shared versions of fluid and
  fltk-options are built. The games are only built if
  FLTK_BUILD_TEST is enabled.

- The CMake 'install' target now installs the games (if built)
  and their man pages on all platforms (no matter if that is
  useful, for instance on Windows).

- On macOS 'CMAKE_INSTALL_RPATH' is set so *installed* programs
  automatically find their shared FLTK libraries. The "shared"
  versions of fluid and fltk-options got their own '.plist' files.
  This works for both the executables themselves as well as those
  included in bundles. There may be more to do on the macOS platform.
2025-04-21 19:50:12 +02:00
Matthias Melcher
48e22d246d Fluid: update documentation scripts
TeX and pdf generation untested at this point
2025-04-18 21:40:37 +02:00
Albrecht Schlosser
374f22b8bf Remove unused code from Fl_Wayland_Window_Driver (#1248)
This commit removes the unused static method

  Fl_Wayland_Window_Driver::resize_after_screen_change(void *data)

and related data as discussed in the context of PR #1248.
2025-04-18 18:23:28 +02:00
Timothy Lee
002b69f8fe Fix "heap-use-after-free" in resize_after_screen_change() (#1248)
When a native window is destroyed, make sure the callback to
Fl_WinAPI_Window_Driver::resize_after_screen_change() is removed.

Added by Albrecht-S:

Thanks for the original fix to Timothy Lee (@timothytylee).

src/drivers/X11/Fl_X11_Window_Driver.cxx: equivalent fix for X11
  as discussed on GitHub PR #1248
2025-04-18 18:15:06 +02:00