mirror of
https://github.com/fltk/fltk.git
synced 2026-02-05 07:49:50 +08:00
+ build screenshot programs if option FLTK_BUILD_SCREENSHOTS=ON: don't `EXCLUDE_FROM_ALL` because the option must be set anyway.
Screenshot Programs for FLTK Documentation
Contents
All programs in this subdirectory of the FLTK source tree are intended to
be used for screenshot generation for the documentation.
Each program should open one window (maybe more in the future) that can be
used as an image for our documentation. Here should be programs developed
only for the documentation that are not included in the /test/ or /examples/
folders.
Rationale
Creating screenshots "manually" and storing only the results as (PNG)
images should be avoided. There *should* be a source file for each image
in the `documentation/images` directory. Many of the existing images can
be reproduced by programs in the /test/ folder, but some images used for
illustration can currently not be reproduced easily by developers if
necessary or wanted.
These programs are NOT intended to be used automatically by documentation
generation. All screenshots generated by these programs shall be checked
in (committed) to the FLTK repository for consistency.
Development Status
Source files for screenshots are collected here. As of today (Jan. 2026)
Screenshots must be taken manually but this shall be simplified later.
This folder is in an early development phase. For now the most important
point is to collect the code to prepare for future changes.
Future Development
The intention is to use a commandline to automate screenshot generation or
to output one or more specific screenshot images per program automatically,
similar to the code screenshot generation and Fluid's documentation.
Details are yet to be defined.
Build System
The programs in this directory are not built by default in the standard
FLTK build.
CMake Option FLTK_BUILD_SCREENSHOTS
CMake option FLTK_BUILD_SCREENSHOTS (Default: 'OFF') can be set to 'ON'
to build all screenshot programs.
Developers are advised to set FLTK_BUILD_SCREENSHOTS=ON to build the
screenshot programs to verify that they compile and work.
Adding New Screenshot Programs
To add a new program, add the source code here, and add it to the list
of programs in CMakeLists.txt. All programs should be built with similar
options (using fltk::fltk and fltk::images).
Some programs may also use fltk::gl for OpenGL screenshots.
Note: CMake and some of its supported "generators" (like Ninja) need
unique "target" names throughout the entire build system. To avoid
conflicts all programs in this folder will be built using a target
name with the prefix 'scr_' in folder `bin/screenshots/`.
The program is not affected by this prefix.
Example:
source file name: unicode.cxx
CMake target name: scr_unicode
Executable: bin/screenshots/unicode (.exe, .app)