summaryrefslogtreecommitdiff
path: root/test/CMakeLists.txt
AgeCommit message (Collapse)Author
3 dayswip: forkmaxim nikonov
10 daysCMake: add try_compile() to figure out if Pen/Tablet is supportedAlbrecht Schlosser
This test is specifically intended to disable Pen/Tablet support on classic MinGW (32-bit) platforms that lack required symbol definitions although Pen/Tablet support might be supported by the Windows system. This test can be extended for other platforms, but for now it's performed only on Windows.
2026-01-08Add CMake option FLTK_OPTION_PEN_SUPPORT (default: ON)Albrecht Schlosser
This option can be used to disable pen/tablet support if there are build problems on a particular platform or build system (e.g. MinGW) so users can continue to build FLTK 1.5. Users can also choose to disable pen support if they don't need it.
2025-11-17Add pen/stylus/tablet API and driver for macOS (#1326)Matthias Melcher
* define the pen/tablet support API * add pen event handler stub as a fallback * add pen device test "penpal". * Add macOS pen/stylus/tablet driver. * Add Oxygen documentation.
2025-07-02Enable building "extra tests" with a newer C++ standardAlbrecht Schlosser
"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-05-08Simplify CMake build config for test and demo programsAlbrecht Schlosser
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-04-21Fix "fully support ... own shared libraries" (#1238)Albrecht Schlosser
- 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-03-10More (mostly) documentation updates for FLTK 1.5.0Albrecht Schlosser
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-06Fl_Group: convert array of children to std::vectorAlbrecht Schlosser
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.
2024-12-03Fi: Building with FLTK_BUILD_GL=0 fails on systems without opengl installed ↵ManoloFLTK
(#1151)
2024-07-21Update docs and screenshot for fl_line_style() (#1016)Albrecht Schlosser
As a follow-up to the discussion I used the posted screenshot demo (thanks to Greg), redesigned it using Fl_Grid, and added it as a new test program, including Makefiles and CMakeLists.txt. New file: test/line_style_docs.cxx to create screenshot. Note that the old test/line_style.cxx is not obsolete, it can be used to test the line styles interactively. Docs have been updated in both chapter "Drawing Things" and the function description. Also added the new demo to test/demo.menu under "Images for Manual...".
2024-05-01CMake: simplify compiler detection for '-Wshadow' testAlbrecht Schlosser
2024-04-22Enable 'shadow_variables' test on macOS using AppleClangAlbrecht Schlosser
The CMake compiler ID on macOS is AppleClang rather than Clang. This commit checks for this compiler ID as well.
2024-04-18Add missing 'x11.H' to exclusion list (STR 2728)Albrecht Schlosser
2024-04-18Test public headers for shadowed variables (STR 2728)Albrecht Schlosser
This program is built only when using CMake and a GNU or Clang compiler to detect shadowed variables in header files. Developers should fix such warnings whenever they see them during the build to avoid user reports.
2024-03-16Improve linking of test/cairo_test.cxx demo programAlbrecht Schlosser
With modern CMake libcairo doesn't need to linked explicitly in the test/cairo_test.cxx demo program. Either '-lcairo' is implied by linking with fltk::fltk or it is not used at all. This fixes a linker warning on macOS: "ld: warning: ignoring duplicate libraries ..."
2024-03-09Add another keyboard event test program test/handle_keys.cxxAlbrecht Schlosser
This program logs all keyboard events to a built-in Fl_Terminal widget. WIP: version 0.80
2024-02-09Fix Cairo related build issues (missing Cairo lib)Albrecht Schlosser
... particularly for shared libs
2024-02-09Fix cairo_test-shared build as well (#902)Albrecht Schlosser
2024-02-09Fix "cairo_test fails to link due to undefined's" (#902)Albrecht Schlosser
Restore "too much optimized" CMake code. The issue would only be visible if neither FLTK_GRAPHICS_CAIRO nor FLTK_BACKEND_WAYLAND was active.
2024-02-07Introduce "Modern CMake" in FLTKAlbrecht Schlosser
This is a big commit and there are too many changes to list them all. The main changes are: - rename all CMake build options to 'FLTK_*' - export library targets with namespace (prefix) 'fltk::' - standardize shared library target names with suffix '-shared' - set public build properties on libraries for consumers - document library names and aliases in README.CMake.txt - document changes in "Migrating Code from FLTK 1.3 to 1.4" - partial backwards compatibility for old user projects Included but not directly related changes: - fix Windows (Visual Studio) DLL build - add CMake function fl_debug_target() to show target properties - don't build test programs if FLTK is a subproject - internal: reformat CMake code: remove space before '(' Thanks to Matthias and Manolo for their help, testing, and feeback.
2023-12-20Make the 'Forms' compatibility library 'fltk_forms' optionalAlbrecht Schlosser
This library is no longer needed in FLTK itself. There is only one demo program (test/forms.cxx) that uses it if it is built. The demo program displays a message if fltk_forms is not available. The default is 'enabled' for backwards compatibility but this may be changed to 'disabled' in a future version.
2023-11-18Add Fl_Grid based dialog demo programAlbrecht Schlosser
This is a new test program for Fl_Grid based layout and a proof of concept for a future dialog class based on Fl_Grid.
2023-11-14Fl_Terminal widget (#800)erco77
Pull Fl_Terminal widget from Greg's fork
2023-11-03CMake: Refactor building OpenGL and "shared" demo programsAlbrecht Schlosser
Define GLDEMO_LIBS and GLDEMO_SHARED: these definitions can be used to build OpenGL demo programs that can also be built w/o OpenGL Examples: fullscreen, handle_events, unittests
2023-10-16Add Fl_Grid widget and test and demo programsAlbrecht Schlosser
- FL/Fl_Grid.H: header file - src/Fl_Grid.cxx: implementation - examples/grid-simple.cxx: simple example program - test/cube.cxx: use Fl_Grid for layout - test/grid_alignment.cxx: test cell alignment and other functions - test/grid_buttons.cxx: demo program as discussed in fltk.general - test/grid_login.cxx: like test/flex_login.cxx but with Fl_Grid - test/flex_login.cxx: modified to match test/grid_login.cxx
2023-10-07Fix STR 3458: "GLUT compatibility mode segfaults"Albrecht Schlosser
... "when there's no current window". Silently ignore GLUT function calls that need a current window if the current window is NULL, return 0 from functions that return an 'int'. Check if window is shown in Fl_X11_Gl_Window_Driver::swap_buffers(). This would issue "XRequest.nnn: GLXBadDrawable 0x0" on X11 otherwise. Note: the chosen implementation to ignore GLUT calls silently appears to be compatible with GLUT (3.7) whereas FreeGLUT 3.0 would issue error messages and exit. The latter could be implemented as well but would be much more work.
2023-09-12Fix Visual Studio shared library buildAlbrecht Schlosser
Todo: fluid-shared can't (yet) be built agains the shared fltk lib because of some linker errors. Needs investigation. Note: fluid-shared is basically a test program to demonstrate linking against the shared FLTK libs but doesn't work yet using VS (MSVC). This is no problem for the functionality.
2023-08-15Undoing previous changesMatthias Melcher
2023-08-15Lot's of changes, must rethink UI.Matthias Melcher
2023-08-15Sudoku into smaller pieces.Matthias Melcher
2023-08-15Adding generatorMatthias Melcher
2023-03-09CMake: build shared libs with OPTION_CAIROEXT (issue #250)Albrecht Schlosser
- remove separate libfltk_cairo to avoid cyclic dependencies, but - keep a dummy libfltk_cairo in 1.4.0 for backwards compatibility - move cairo/Fl_Cairo.cxx to src/Fl_Cairo.cxx - add preliminary Cairo support for Visual Studio (MSVC) Static linking is not affected by this change, but users building with hand-made Makefiles will have to remove libfltk_cairo starting with FLTK 1.4.0. The dummy library can be linked for backwards compatibility but it will be removed later (in 1.4.x or 1.5.0). The shared FLTK library libfltk.{so|dylib|dll|..} depends on libcairo if and only if FLTK is built with one of the Cairo options. This has always been the case for OPTION_CAIROEXT but is now also true if only OPTION_CAIRO is selected, i.e. FLTK programs linked with a Cairo enabled shared FLTK library will also be linked with libcairo. The same is true for configure options --enable-cairo and --enable-cairoext, respectively. Preliminary Cairo support for MSVC now detects a Cairo installation using the CMake variable FLTK_CAIRO_DIR which must be set by the user. Note that this feature is temporary and may be changed in the future for a better and more comfortable version.
2023-02-23Fl_String refactoring and extension (#683)Matthias Melcher
- add true unittest and Fl_String testing - interface and printout are similar to gtest without requiring external linkage. just run `unittest --core`. - new Fl_String API - extended API to fl_input_str and fl_password_str - co-authored-by: Albrecht Schlosser <albrechts.fltk@online.de>
2023-01-21Animated GIF support (Fl_Anim_GIF_Image class) (#375)wcout
2022-12-28Improve and extend fl_contrast() (#370)Albrecht Schlosser
- Add internal fl_contrast_cielab() as the new default. - Keep old function as internal fl_contrast_legacy(). - Add fl_contrast_mode() to switch between fl_contrast() functions. - Add fl_contrast_level() to fine tune fl_contrast() per mode. - Add option to register and use a custom contrast function. - Add test/contrast.cxx test program. - Move all fl_contrast() related code to a new file src/fl_contrast.cxx. - Add fl_lightness() convenience function for perceived lightness. - Add fl_luminance() convenience function for physical luminance.
2022-12-17Make unittest conform to CMP (#597)Matthias Melcher
Update unittest README
2022-12-11Added Unicode Boxes unittest and README-unittests.txtGreg Ercolano
This test helps check for issues with multiline widgets drawing text properly. The README-unittests.txt was added to help developers add new unit tests easily.
2022-08-01Add Fl_Flex widget from Karsten Pedersen (issue #255)Albrecht Schlosser
This work is based on the repository and latest commit: https://github.com/osen/FL_Flex.git commit 36e4ed75a00daac825b87e81295818b4650991f5 Author: Karsten Pedersen <...> Date: Fri Apr 23 12:06:16 2021 +0000 Added Fltk (LGPL) license. This widget is similar to Fl_Pack and supports either one row or one column of widgets but has some more features. Test and demo programs are included: test/flex_login.cxx: simple "login window" demo program test/flex_demo.cxx: slightly more complex demo program The original demo programs can still be compiled and built with the new widget provided you '#include <FL/Fl_Flex.H>'. Backwards compatible methods are included (except debug()). The original widget has been modified to match FLTK standards and enhanced in several ways, including: - support box frames - add HORIZONTAL and VERTICAL enum values (as in Fl_Pack) - add horizontal() method (as in Fl_Pack) - use type() rather than internal 'direction' variable - add standard widget constructor (x, y, w, h, label) - add margin and gap accessors rather than hard coding constants - improve test and demo programs - add documentation - replace <vector> with array as required by FLTK CMP - rename camelCase method names, keeping old names for compatibility: - change 'setSize(Fl_Widget*, int)' to 'set_size(Fl_Widget*, int)' - change 'bool isSetSize(Fl_Widget*)' to 'int set_size(Fl_Widget*)' - remove debug() method - add a way to "unset" fixed size: set_size(Fl_Widget *, 0) - add layout() method to force recalculation of children - unify resizeRow() and resizeCol() methods to avoid code duplication - improve widget size calculation.
2022-04-09Fix build of test/unittests with shared librariesAlbrecht Schlosser
- set variables UNITTEST_LIBS and UNITTEST_LIBS_SHARED appropriately - use these variables in build instructions This includes normal and shared builds with and w/o OpenGL.
2022-02-06OpenGL implementation of all `fl_` "Drawing Fast Shapes" graphics calls (#385)Matthias Melcher
* Fix build system for unites, * Updated unittest to check OpenGL drawing. Making sure that OpenGL drawing is exactly the same as native drawing to make FLTK widget rendering look the same in GL windows. * Make OpenGL optional. * Implemented clipping in OpenGL * unites drawing fast shapes * Fixed CMake * Updating unittest. Added tests for fl_pi and fl_arc (int) Renamed tab to render complex shapes. * Improved OpenGL FLTK drawing emulation. * Fixed GTK ROUND DOWN BOX * Fixing Makefile for unittest * Correctly aligning OpenGL text. * Fixed text alignment in GL windows. Explained the "FLTK over GL " example in Cube. * Overlapping test. * Better GL graphics alignment. * Drawing the focus rect. * Adding Alpha Channel support for GL. * Added FLTK-on-GL documentation.
2022-01-23Remove experimental platforms Android, Pico, SDL (PR #376)Albrecht Schlosser
... as discussed in fltk.coredev: "FLTK 1.4.0 release schedule" https://groups.google.com/g/fltkcoredev/c/PDbHTRpXVh0/m/JqboexZ_AwAJ
2021-12-08Documentation on widget coordinates and layout, plus new test programs (#304)engelsman
Add coordinates and layout section to user manual add section to user manual to clarify the use of window-relative coordinates in both Fl_Group and Fl_Window containers, and include brief descriptions of current layout manager widgets in one place. add test/coordinates.cxx, test/wizard.cxx and related screenshots under documentation/src. update CMakeLists.txt, Makefile and .gitignore for new files. Co-authored-by: Albrecht Schlosser <albrechts.fltk@online.de>
2021-11-18Reformat and move clipboard demo from examples to test folderAlbrecht Schlosser
The clipboard demo is more a test program than an example and very useful even if the examples are not built. Also update dependencies.
2021-11-08Add new resize example to test and dox (PR #165)Duncan Gibson
add example(s) showing Albrecht's innovative overlap resizable technique to the "How does resizing work?" documentation and tests See "resizable question" original discussion thread under: https://www.fltk.org/newsgroups.php?gfltk.general+v:39635
2021-10-06CMake: Simplify adding test programs for developersAlbrecht Schlosser
The intention is to make it more convenient for developers to add one or more test programs for their tests by editing only one variable (extra_tests).
2021-07-12macOS: fix fltk_cairo shared library (issue #250)Albrecht Schlosser
- add missing dependencies to build the shared libfltk_cairo(.dylib) - remove incorrect dependency on cairo from libfltk - add cairo_test-shared demo (linked with shared libs)
2021-05-13Refactor macOS bundle generation to avoid "quarantine"Albrecht Schlosser
macOS Big Sur 11.3 introduced a new "security feature" such that app bundles created from existing bundle templates in downloaded files (tar distibutions, expanded) could no longer be executed without unsetting the "quarantine" attribute. This commit fixes this by creating all bundles from scratch. Known *workaround* for older tarballs and snapshots: $ xattr -d -r com.apple.quarantine xxx.app
2021-04-22Fix handle_events demo build w/o OpenGLAlbrecht Schlosser
test/handle_events.cxx can optionally be built with an Fl_Gl_Window, but this doesn't work if OpenGL support (libfltk_gl) is disabled.
2021-02-08Add event handling test and demo programAlbrecht Schlosser
This is intended to be used as (a) an example of event handling and (b) a test program to visualize many event related variables This first version is compatible with FLTK 1.3.x but lacks the screen scaling factor under 1.3.x (which is always assumed to be 100%). Note: this does not reflect any system or monitor related settings.