Commit Graph

1368 Commits

Author SHA1 Message Date
ManoloFLTK
afc16b3331 Remove from Doxygen files information about removed configure-based build system. 2025-09-08 12:49:41 +02:00
Albrecht Schlosser
80e561c78e Improve test/threads demo program
- format "Max Prime" output as integer number
- use a fixed font for better readability
- close all windows when the user closes one of them
- use standard background and text colors
2025-07-14 16:53:23 +02:00
Albrecht Schlosser
5d68428a00 Fix trailing whitespace and convert a few tabs to spaces
... according to CMP
2025-07-08 15:25:14 +02:00
Matthias Melcher
2a1677802f Fl_Help_View: Restoring bad includes for back compatibility 2025-07-05 20:39:55 +02:00
Albrecht Schlosser
9a5bdf40a4 Enable building "extra tests" with a newer C++ standard
"extra tests" are defined in test/CMakeLists.txt for FLTK devs to allow
quickly building test programs with minimal edits. The new feature
can be used to set a higher C++ standard for these test programs.
See instructions in test/CMakeLists.txt.

Note: this is only intended to be used for quick tests and *must* not
  be committed and pushed to the main repository for obvious reasons.
2025-07-02 17:19:22 +02:00
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
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
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
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
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
fc91880faf
Reactivating Mergeback functionality. (#1226)
Reactivated code.
Various fixes.
New documentation.
2025-04-15 14:47:24 +02:00
Matthias Melcher
f4978a0149 Adding the FL_MENU_CHATTY flag to Fl_Menu_Item.
If set, menu items will also call the callback when highlighting changes.
The reason is given with Fl::callback_reason(). #941
2025-04-01 17:00:56 +02:00
Matthias Melcher
0eb6bb8e6d Fixing a few more compiler warnings. 2025-03-30 00:51:34 +01:00
Matthias Melcher
b2b5e47ede Somewhat better example for dynamic tooltip. 2025-03-30 00:25:18 +01:00
Matthias Melcher
61c2b798be Adding missing overrides 2025-03-29 23:52:29 +01:00
Matthias Melcher
5dd1062df5 Adding FL_BEFORE_MENU event to classes derived from Fl_Menu_ 2025-03-29 23:36:19 +01:00
Matthias Melcher
b7189192e2 Adds a new event FL_TOOLTIP_EVENT...
... and Fl_Tootip::override_text() to allow users to dynamically
generate tooltips.
2025-03-29 22:40:18 +01:00
Albrecht Schlosser
1ccafa83b2 Remove obsolete build option 'FLTK_OPTION_STD'
This option is no longer needed since FLTK 1.5 always requires C++11.
2025-03-19 14:44:16 +01:00
Albrecht Schlosser
5b648d2cfc Fix out-of-bounds access in test/checkers.cxx
For details please see description in the source code in
  test/checkers.cxx lines 620++

This commit also disables unused code: function dumpnode() which is
  used only in VT100 mode.
2025-03-18 20:31:48 +01:00
Matthias Melcher
51a55bc736
Fluid: restructuring and rejuvenation of the source code.
* Add classes for application and project
* Removed all globals from Fluid.h
* Extracting args and project history into their own classes
* Moving globals into Application class
* Initialize values inside headers for some classes.
* Undo functionality wrapped in a class inside Project.
* File reader and writer are now linked to a project.
* Avoid global project access
* Nodes (former Types) will be managed by a new Tree class.
* Removed static members (hidden globals) form Node/Fl_Type.
* Adding Tree iterator.
* Use nullptr instead of 0, NULL, or 0L
* Renamed Fl_..._Type to ..._Node, FL_OVERRIDE -> override
* Renaming ..._type to ...::prototype
* Splitting Widget Panel into multiple files.
* Moved callback code into widget panel file.
* Cleaning up Fluid_Image -> Image_asset
* Moving Fd_Snap_Action into new namespace fld::app::Snap_Action etc.
* Moved mergeback into proj folder.
* `enum ID` is now `enum class Type`.
2025-03-16 17:16:12 -04:00
Albrecht Schlosser
8838e976a0 More (mostly) documentation updates for FLTK 1.5.0
All files: remove autoconf/configure related stuff, update links.

- README.txt: describe prerequisites, provide generic instructions
  on how to use CMake to build FLTK
- test/demo.cxx: remove code used for configure/make build
- test/CMakeLists.txt: remove obsolete 'target_compile_definitions()'
2025-03-10 15:43:12 +01:00
Albrecht Schlosser
347d35a8c0 Update README and configure related stuff for 1.5.0
- remove configure stuff from more README files
- move documentation/README.txt to README.documentation.txt
2025-03-08 17:10:32 +01:00
Albrecht Schlosser
7d58f06a20 Remove 'configure' from README's and sources (partially)
More to come...
2025-03-08 15:19:48 +01:00
Matthias Melcher
6acda521cc Removes the remaining references to Fl_String.
Still to do: rename fl_filename... to fl_filename..._str
and introduce into core library.
2025-03-07 01:15:57 +01:00
Matthias Melcher
3068c7a0af Fl_String is now just an alias for std::string.
All mentions of Fl_String will be replaced with std::string
and the Fl_String implementation will be removed.
2025-03-07 00:12:40 +01:00
Albrecht Schlosser
dc07f927f1 Fl_Group: convert array of children to std::vector
Note: this is only a hidden implementation detail: all concerned
variables are private, and the code is simplified (less error prone).

Size of Fl_Group on 64-bit Linux: 168 -> 176 Bytes (+8 Bytes).

test/group.cxx: test for Fl_Group::{add, insert, remove} etc.
2025-03-06 18:31:31 +01:00
Albrecht Schlosser
191b33e0de Update version numbers to 1.5.0 2025-03-06 18:16:03 +01:00
Albrecht Schlosser
e2ca1a39c8 Remove autotools (configure/make) support 2025-03-06 17:12:52 +01:00
Albrecht Schlosser
45476d093c test/editor: ensure buffer termination
... in source file and documentation
2025-02-19 17:14:25 +01:00
ManoloFLTK
af5b2cf464 fullscreen test app: prevent combination of fullscreen + maximize
Also, use more explicit button names
2025-02-03 12:22:07 +01:00
ManoloFLTK
2a58560b7d tedst/utf8: Change default font used under Windows for "Unicode Display Test"
The Windows doc at https://learn.microsoft.com/en-us/typography/font-list/arial-unicode-ms
 of the "Arial Unicode MS" font reads
"The font was included with Office but not Windows. …
We stopped servicing and updating Arial Unicode and no longer install it as part of Office."
Using that font is therefore not the best choice.
This commmit uses "Microsoft Sans Serif" instead available in all Windows versions
since Windows 2000.
2025-01-19 18:39:38 +01:00
Albrecht Schlosser
6784ae807c Fix compiler warnings (VS 2019)
Found with warning level: /W3
2024-12-10 23:12:22 +01:00
Albrecht Schlosser
fe8177ea2c Update Fluid (.fl) files for release 1.4.1 2024-12-09 20:46:01 +01:00
Matthias Melcher
e24de6f89c glpuzzle: smoother animation at 72fps 2024-12-06 13:25:13 +01:00
Matthias Melcher
c61e3f63f6 glpuzzle: fixes timer and trackball max speed
Using 50fps instead of maximum render speed.
Trackball limited to non-head-spinning speeds.
2024-12-06 13:21:28 +01:00
Albrecht Schlosser
ff161187e7 Improve timer statistics in test/cube demo
These timer statistics are useful to see the interaction of OpenGL
drawing and FLTK timers (Fl::add_timer + Fl::repeat_timer).
2024-12-04 16:42:53 +01:00
Matthias Melcher
fe8a94d236 Fixes warning in cube.cxx. 2024-12-04 16:13:07 +01:00
ManoloFLTK
167dba8817 Fi: Building with FLTK_BUILD_GL=0 fails on systems without opengl installed (#1151) 2024-12-03 17:12:49 +01:00
Albrecht Schlosser
5160567728 Use a constant frame rate (25 fps) in test/cube demo
The old version was "synchronized" by calling Fl::check() in a loop
which resulted in the highest speed possible on any platform.

It turned out that this was way too fast on the Wayland platform as
`valerius` posted on IRC/Matrix on Nov 30, 2024. Citation:
"anyone else notice the cube demo on Wayland is mega ultra hyper speed?".

I took the opportunity to change the demo to use a timer with a given
frame rate (see constant 'FPS') to synchronize drawing.
Note: the 'speed' slider is independent of the drawing frequency.

Finally this commit adds statistics output when the 'Stats / Exit' button
is pressed like

  Iterations =  304, runtime = 12.167 sec, fps = 24.99, requested: 25

with the requested frame rate (default = 25) and allows the user to
continue to see more statistics.

To do (very likely not in 1.4.x):
 1. integrate running statistics in the display
 2. make the desired frame rate variable at runtime (new slider)
2024-12-01 16:43:31 +01:00
Albrecht Schlosser
12ea6a0288 Enable building the CubeView demo w/o requiring '<config.h>'
This allows to build the CubeView demo from the unmodified FLTK sources
w/o having to provide a 'config.h' file by defining HAVE_GL=1 on the
compiler commandline. See also comment in test/CubeView.h.

test/CubeMain.cxx: don't include <config.h> at all (not needed)

test/CubeView.h: #include <config.h> only if HAVE_GL is not defined
2024-11-29 16:19:22 +01:00
Albrecht Schlosser
d547e19567 MSVC: Fix array allocation in test/fltk-versions (#1131) 2024-11-18 02:08:56 +01:00
Albrecht Schlosser
6c6f6b7dd9 Finish release 1.4.0
1) Improve and clarify documentation:
 - update, reformat, and reorder parts of CREDITS.txt
 - make sure that documentation appears in doxygen docs
 - add '\since 1.4.0' to documentation of new methods and functions
 - remove doxygen's '\brief' where not required (we're using
   JAVADOC_AUTOBRIEF = YES)
 - clarify screen scaling, scaling factor, and related stuff
- add more info about backwards compatibility for X11 specific code

2) Update dependencies
2024-11-17 20:01:46 +01:00
Albrecht Schlosser
7b9af35847 Improve 'test/fltk-versions' demo program
- add code to get the platform and backend
- display platform and backend on screen
- improve and simplify layout (using Fl_Grid)
- add version check indicator
2024-11-17 18:12:45 +01:00
Albrecht Schlosser
9d708a1b5a Fix compiler warning [-Wsign-compare]
Note: it is *unusual* (not FLTK style) that Fl_Window::border()
  returns 'unsigned int' instead of 'int'.

This should be investigated in FLTK 1.5 but maybe we can't change it:
  it's been so already in FLTK 1.3 and maybe earlier.
2024-11-01 16:35:03 +01:00
ManoloFLTK
818e2b77d1 Wayland: Fix issue in maximization of a borderless window (#1099)
Also fixes scenarios mixing fullscreen and maximization:
- maximize
- set fullscreen
- unset fullscreen
- un-maximize
with and without window border.
2024-11-01 15:43:18 +01:00
ManoloFLTK
0ac1379985 macOS: prevent changing window border while window is fullscreen 2024-10-31 15:15:33 +01:00
Albrecht Schlosser
975cd3b4fd Remove unnecessary casts from glut demo programs
These casts are no longer useful since commit 5cd9f6fb80:
"STR #3323: glutAddMenuEntry now has a const label argument"
2024-10-18 17:01:34 +02:00
Albrecht Schlosser
a6a0a65edf Update or remove version numbers, update copyright years
Note: one goal is to have to edit fewer version numbers in source
files for each release.

We may be able to generate some files by the build procedure (CMake)
to avoid editing them in the future (1.5.0 or later).
2024-10-15 20:42:26 +02:00
Albrecht Schlosser
16d59008c2 Add option to test scaling shortcuts in test/menubar
Note: if enabled, then the usual global scaling shortcuts don't work
  and scaling by shortcuts is disabled.

This is intended for testing and not for normal usage.
2024-10-07 14:27:01 +02:00
Matthias Melcher
18bda5315d Update Widget order in test/keyboard. 2024-10-07 11:59:49 +02:00