Commit Graph

1111 Commits

Author SHA1 Message Date
Albrecht Schlosser
fd5cd80935 Introduce "Modern CMake" in FLTK
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.
2024-02-07 18:37:34 +01:00
Matthias Melcher
78ae78b118 Add dynamic title to test/editor 2024-02-06 21:25:43 +01:00
Matthias Melcher
d9612e3cc7
RFC: Different approach to Editor tutorial (see #189) (#883)
Update test/editor code and tutorial (#189, #883)

Different, sequential approach to Editor tutorial
Co-authored-by: Albrecht Schlosser <albrechts.fltk@online.de>
2024-01-29 11:43:34 +01:00
ManoloFLTK
01f2f760b6 Create struct wl_callback_listener *Fl_Wayland_Graphics_Driver::p_surface_frame_listener 2024-01-18 08:51:31 +01:00
ManoloFLTK
b7fba465ce Wayland: throttle resize operations also for top-level GL windows
Member cb of struct wld_buffer is replaced by member frame_cb of struct wld_window.
This allows frame_cb to be used both for non-GL and for top-level GL windows.
2024-01-18 08:10:33 +01:00
Albrecht Schlosser
32514e6d2b Quote doxygen command where necessary
... if the doxygen path includes spaces.

Done for configure/make + CMake.
2024-01-11 01:47:07 +01:00
ManoloFLTK
30f2ec8185 Fix for bug in Mutter Wayland compositor (#878) - cont'd
Add more tests to do additional operations under stricter conditions
2023-12-28 11:28:47 +01:00
Albrecht Schlosser
76a2c95f07 Fix a typo, trailing whitespace, and dependencies 2023-12-21 14:03:04 +01:00
ManoloFLTK
bc5d7e77aa Remove typos in the documentation of fl_x11_use_display() 2023-12-19 19:36:07 +01:00
ManoloFLTK
96bacd3f9d Procedure to instruct FLTK to use given X11 connexion (#149) 2023-12-19 15:48:26 +01:00
ManoloFLTK
f38d1cf424 Documentation: fix outdated statements of quantities being expressed in pixels 2023-12-12 10:08:08 +01:00
Greg Ercolano
3fb9bae040 Fl_Grid: Added show_grid(1) screenshot 2023-12-09 08:20:31 -08:00
ManoloFLTK
bf7d53006c Complete and update documentation of Wayland buffers 2023-12-09 10:38:05 +01:00
ManoloFLTK
63ba44dc29 Document FLTK implementation of the "GTK Shell" Wayland protocol 2023-12-08 18:04:04 +01:00
ManoloFLTK
d963dde3ef Document Fl_Image_Surface::mask() with commented code example 2023-12-07 15:01:23 +01:00
ManoloFLTK
ddf81baa65 Update "Previous versions of bundled libraries" 2023-12-07 11:57:27 +01:00
Albrecht Schlosser
cb0930190a Remove remaining 'pronounced "fulltick"' statements
+ fix source URL in fltk.spec.in
 + fix some typos
2023-12-05 17:01:51 +01:00
ManoloFLTK
3e61ec7044 New member function Fl_Image_Surface::mask(Fl_RGB_Image*) 2023-12-04 12:34:44 +01:00
Albrecht Schlosser
384b546dc6 Upgrade bundled nanosvg library to latest upstream commit
commit 706eb0618249507c1700cef4a518f73e546b1c38 (upstream/master)
Author: Mikko Mononen <memononen@gmail.com>
Date:   Wed Nov 22 22:47:18 2023 +0200

    Merge pull request #249 from wcout/issue_240

    Fix for #240: Bug: "else" missing

+ FLTK specific extensions, see documentation/src/bundled-libs.dox
2023-12-02 23:32:17 +01:00
ManoloFLTK
0aa8e28be0 Update libdecor to commit 060fe761 dated 1-dec-2023 2023-12-02 16:59:52 +01:00
ManoloFLTK
f72748bb45 Wayland: make OPTION_USE_SYSTEM_LIBDECOR ON by default
This commit makes the default FLTK build setting use libdecor
as packaged in Linux when the build system contains packages
libdecor-0-dev and libdecor-0-plugin-1-gtk in version ≥ 0.2.0.
Otherwise, FLTK uses the bundled version of libdecor.
This includes situations where package libdecor-0-dev is
present in an earlier version.
2023-12-02 09:28:08 +01:00
ManoloFLTK
a1a3a31090 Set date of last update to bundled libdecor 2023-11-29 18:11:34 +01:00
Matthias Melcher
8041a62e59 Adds Callback Reason to FAQ on Fl_Window::callback 2023-11-22 22:31:59 +01:00
Albrecht Schlosser
6f7e1f4fb7 Enhance documentation of event processing 2023-11-17 15:25:21 +01:00
ManoloFLTK
fe0298e9e6 Doc: describe fl_disable_wayland in "Operating System Issues" section 2023-11-15 15:58:28 +01:00
Albrecht Schlosser
4b315d190c Fix dependencies and whitespace issues 2023-11-14 18:14:48 +01:00
erco77
6842a43a31
Fl_Terminal widget (#800)
Pull Fl_Terminal widget from Greg's fork
2023-11-14 07:01:52 -08:00
ManoloFLTK
914ee02c5f Fix typos in documentation 2023-11-01 12:26:54 +01:00
ManoloFLTK
c0e4410776 Update libdecor to commit c6c780c1 dated 2023-10-10 2023-10-29 10:28:27 +01:00
Matthias Melcher
ab6ef9d52f FLUID: Stops overriding Ctrl-0 shortcut. #802
Ctrl-0 is used by FLTK globally to zoom all windows back to 100%,
so FLUID should not override that. Loading the previous file is now
Ctrl-1 instead of Ctrl-0.
2023-10-23 00:52:30 +02:00
Albrecht Schlosser
49900e3710 Update documentation with Fl_Flex and Fl_Grid widgets 2023-10-17 18:24:14 +02:00
Albrecht Schlosser
38871c5b31 Add Fl_Grid widget and test and demo programs
- 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-16 22:18:24 +02:00
Albrecht Schlosser
cfa1a3bd40 Enhance info about documentation generation
- update build requirements
- clarify CMake options
- make clear that a POSIX shell and some Unix tools are required
  to build the PDF documentation
2023-10-03 09:19:36 +02:00
ManoloFLTK
74e63d9077 Wayland: document throttling redraws during interactive resizes 2023-10-03 08:12:13 +02:00
ManoloFLTK
b8fa522ca4 New member function Fl_Wayland_Graphics_Driver::create_wld_buffer()
The previous member Fl_Wayland_Graphics_Driver::create_shm_buffer() is now
renamed to create_wld_buffer() and divided in 2 parts:
- one is related to the draw buffer;
- the other is related to the wl_buffer and is what is now called create_shm_buffer().
This allows to delay creation of the wl_buffer until absolutely necessary,
done inside Fl_Wayland_Graphics_Driver::buffer_commit().
2023-09-25 16:40:01 +02:00
ManoloFLTK
59b251cc39 Slightly simpler Fl_Wayland_Window_Driver::flush()
and beef up description of Wayland's mechanism to throttle screen redrawing.
2023-09-24 09:52:48 +02:00
ManoloFLTK
220dd47bea Increase reuse of mmap'ed data by FLTK Wayland buffer factory 2023-09-22 11:51:24 +02:00
ManoloFLTK
5fa994fcfc Wayland.dox: rephrase how FLTK and Wayland interact 2023-09-17 07:28:05 +02:00
ManoloFLTK
5e15c34512 Wayland.dox: mention preprocessor variable FLTK_USE_WAYLAND 2023-09-16 07:18:41 +02:00
ManoloFLTK
aca9d09cb9 Wayland.dox: add miscellaneous complementary information 2023-09-15 11:31:08 +02:00
ManoloFLTK
c5433d6c1e Update libdecor to commit 422abaf9 dated 2023-09-07
The libdecor commit title is "libdecor-gtk: handle touch events"
2023-09-13 11:51:39 +02:00
Albrecht Schlosser
f5afea3421 Update Doxyfile.in again, now using all defined doxygen tags
The process to generate the docs now uses the full Doxyfile as given
by `doxygen -u Doxyfile.in` with a specific doxygen version, in this
commit version 1.8.14.

There's only one addition: 'HTML_COLORSTYLE = TOGGLE' which has been
added to doxygen in version 1.9.5. We're using it now to give the user
the choice to select a "dark mode" or "light mode" theme if the docs
are generated with doxygen 1.9.5 or later.

Unknown doxygen tags are now filtered silently and logged in files
documentation/Doxyfile_error.log and documentation/Doxybook_error.log,
respectively.
2023-09-07 18:34:04 +02:00
Albrecht Schlosser
41ca8f2050 Update Doxyfile.in from doxygen version 1.5.5 to 1.8.14
Most (if not all) doxygen tags introduced after 1.5.5 are commented out
  to avoid doxygen warnings about obsolete or unknown tags, except
  those tags that need a specific value.

Add 'HTML_COLORSTYLE = TOGGLE' (since 1.9.5) for better user experience.
  With this tag users can switch between dark and light mode *if*
  the docs were generated with doxygen 1.9.5 or later.

Enable search engine.

Log doxygen conversion errors and warnings to Doxy*_error.log,
  i.e. silence the doxygen conversion process.

documentation/src/index.dox: Remove background color from html
  index page for better contrast when using dark mode.
2023-09-07 18:34:04 +02:00
Matthias Melcher
d7dc491b5a Adds images for documentation of compact buttons. 2023-09-03 00:10:24 +02:00
ManoloFLTK
0caa2c99c2 Special (UTF-8) characters in PDF docs maybe not rendered correctly (#772)
Use an image to display the table of the detailed description of class
Fl_PostScript_File_Device in PDF format, and keep using a dynamic table
for the HTML format.

Replace use of the '⌘' character in file drawing.dox by text 'cmd'.
2023-08-31 12:51:16 +02:00
Albrecht Schlosser
3ff53dc201 Improve doxygen documentation generation
Under configure+make it is not possible to enable driver documentation.
Therefore the '@DRIVER_DOCS@' variable must always be cleared.
Add a comment on how to build the driver docs using the Makefile.

Simplify CMake whitespace (trailing LF) handling.

Make sure we find the correct source dir even if FLTK is included
in a sub build (s/CMAKE_SOURCE_DIR/FLTK_SOURCE_DIR/).
2023-08-30 17:24:39 +02:00
Albrecht Schlosser
854b671cdc Doxygen docs w/configure/make: convert config to current version
The intermediate files 'Doxyfile' and 'Doxybook' are now converted
to the current Doxygen version and the short form ('-s') when using
configure+make as it was already done in CMake builds.

This is to avoid Doxygen warnings and for better readability
of the Doxygen config files which are created during the build.
2023-08-30 15:56:17 +02:00
Albrecht Schlosser
be657471e7 Documentation/PDF: always use the configured doxygen executable
... to create the LaTeX header file used by doxygen.

This fix applies to both configure/make and CMake.

The existing version used `doxygen` which erroneously ran the doxygen
version from the current 'PATH' which might issue doxygen warnings and
potentially create a wrong LaTeX header file if the configured doxygen
program was not the one in the user's path.
2023-08-29 17:25:10 +02:00
ManoloFLTK
b328c1f902 Wayland.dox: some rephrasing 2023-08-28 10:16:01 +02:00
ManoloFLTK
a3702923fc Wayland.dox: give more details about progressive drawing 2023-08-26 18:28:56 +02:00
ManoloFLTK
d9d474c593 Wayland.dox: add paragraph about rendering under Wayland 2023-08-25 16:19:12 +02:00
ManoloFLTK
afc60b2503 Update to libdecor ca6e6b68 dated 25-aug-2023 2023-08-25 15:06:27 +02:00
ManoloFLTK
85ec2642c0 Wayland.dox: remove obsolete paragraph. 2023-08-24 17:03:42 +02:00
ManoloFLTK
f456f2550a Upgrade bundled zlib to version 1.3 dated 18-aug-2023 2023-08-23 12:29:03 +02:00
ManoloFLTK
3384776f8e Improve handling of type Fl_Offscreen under Wayland
Type Fl_Offscreen is now to be cast to cairo_t*.
Also, make sure the dimensions of GL windows are
multiples of the screen scale factor.
2023-08-18 18:02:35 +02:00
Matthias Melcher
10d9010ed9
Improved, yet compatible, widget callback system using macros (#729)
* adds FL/fl_callback.macros.H
* adds FL_FUNCTION_CALLBACK_n(widget, function, [type, data])
* adds FL_METHOD_CALLBACK_n(widget, class, instance, method, [type, data])
* adds FL_INLINE_CALLBACK_n(widget, [type, name, data], callback_body)
* adds `examples/callback`
* full documentation
2023-08-15 11:36:58 +02:00
Matthias Melcher
01075687cf #765: Replaces uncommon escape sequence.
Missing return value in docs.
2023-08-12 23:05:03 +02:00
ManoloFLTK
27c3d0b780 Wayland: improve layout of struct fl_wld_draw_buffer 2023-08-08 16:08:53 +02:00
ManoloFLTK
e12eb99b5d Wayland: add test to avoid null pointer dereferencing 2023-07-31 19:26:37 +02:00
ManoloFLTK
7feddabd24 Implement Fl_Wayland_Screen_Driver::poll_or_select_with_delay(double) 2023-07-31 16:29:15 +02:00
ManoloFLTK
d9fa2c6082 Wayland.dox: add info about the xdg decoration protocol
Also, use KWin to name the KDE desktop's Wayland compositor.
2023-07-28 15:27:38 +02:00
ManoloFLTK
3a22531348 Upgrade bundled libpng to version 1.6.40 2023-07-24 19:56:56 +02:00
ManoloFLTK
fa0aa95443 libdecor: update with upstream source code as of 2023-JUL-15 2023-07-22 14:23:08 +02:00
Matthias Melcher
f8ebde4da4 Documentation: screenshot updates 2023-07-14 18:10:17 +02:00
ManoloFLTK
f8d0b591ab Documentation: correct spelling errors 2023-07-14 18:00:34 +02:00
ManoloFLTK
6f05af3c12 Wayland: add control of targeted screen by fullscreen windows 2023-07-13 18:19:01 +02:00
ManoloFLTK
18befa5e81 Add details to documentation of Fl_Wayland_Gl_Window_Driver::swap_buffers() 2023-07-08 09:23:38 +02:00
ManoloFLTK
69cb274415 Documentation: beef-up the OpenGL section of wayland.dox 2023-06-28 11:12:57 +02:00
ManoloFLTK
0b6dcd14d9 Documentation: add a few updates to intro.dox 2023-06-28 09:35:25 +02:00
ManoloFLTK
f5879ae228 Slight simplification of Fl_Wayland_Gl_Window_Driver::swap_buffers()
Also, reorder members of class Fl_Wayland_Gl_Window_Driver
2023-06-27 09:05:46 +02:00
ManoloFLTK
eca471eee6 Wayland.dox: add a few more detailed explanations 2023-06-21 21:05:47 +02:00
ManoloFLTK
c43cf2f192 Wayland: improve support of multi-display setups 2023-06-19 17:48:37 +02:00
ManoloFLTK
3166416e4c libdecor: update with upstream source code as of 2023-jun-6 2023-06-13 07:42:44 +02:00
ManoloFLTK
7d7edcf50f Documentation: remove « "FLTK", pronounced "fulltick" » 2023-06-07 16:42:14 +02:00
ManoloFLTK
87dec3af9c libdecor: update with upstream source code as of 2023-may-26 2023-06-07 15:58:12 +02:00
ManoloFLTK
64eafbefd6 Fix "Fl::get_font_name() with Pango is inconsistent" (#732) 2023-06-05 16:05:27 +02:00
ManoloFLTK
5be3fbf913 Improve re-use of client/compositor shared memory by Wayland buffers 2023-06-05 11:00:33 +02:00
ManoloFLTK
56e94c4cdc Wayland.dox: details about destruction of wl_shm_pool objects 2023-06-01 18:11:56 +02:00
ManoloFLTK
1abf1dd712 Wayland.dox: add "Menu windows and other popups" and miscellaneous 2023-05-28 19:55:50 +02:00
ManoloFLTK
7020356df9 Slightly re-organize class Fl_Wayland_Window_Driver 2023-05-22 09:05:07 +02:00
Albrecht Schlosser
a4c6c18b3d Fix doxygen doc generation and document platform specific files
Pure platform specific files like 'src/*_win32.cxx' are excluded from
doxygen processing and don't need doxygen specific guard macros.

Document this fact prominently at the beginning of each file.

Fix exclude patterns and remove duplicates from Doxyfile.in.
2023-05-09 22:36:41 +02:00
ManoloFLTK
a94fed77e4 Wayland: clearer procedure to complete initialisation of screen data 2023-05-03 08:50:19 +02:00
ManoloFLTK
cad6e63296 libdecor: update with upstream source code as of 2023-may-2
This will allow to create narrow decorated windows without crash.
2023-05-02 11:35:28 +02:00
ManoloFLTK
caaa11a96f Standardize API to "graphics context" across platforms
Rename fl_wl_cairo() to fl_wl_gc()
Add function cairo_t* fl_cairo_gc() under OPTION_USE_CAIRO
2023-04-13 10:02:40 +02:00
Albrecht Schlosser
9e00bd2606 Document the new 'fltk-config' features (#647, #656)
fltk-config has been extended to allow more than one source file
and additional compiler flags and link libraries. This commit adds
documentation (no functional changes).
2023-04-11 18:38:08 +02:00
ManoloFLTK
eaf50f4779 Wayland.dox: add "Fractional scaling" paragraph 2023-04-08 21:08:19 +02:00
ManoloFLTK
c149091deb Wayland: fix reporting of relative location of multiple displays 2023-04-07 10:14:11 +02:00
ManoloFLTK
6f0e9b6580 Wayland.dox: beef up information related to listeners 2023-04-06 11:37:06 +02:00
ManoloFLTK
0c930b9ca3 Wayland: limit copied pixels when window update is a region 2023-04-05 23:21:43 +02:00
ManoloFLTK
1d0e63ea78 Improve member function Fl_Wayland_Screen_Driver::surface_to_window()
Rename it to Fl_Wayland_Window_Driver::surface_to_window() and
avoid loop over all mapped FLTK windows that used to be performed.
2023-04-03 15:25:19 +02:00
ManoloFLTK
6aa6866d80 Wayland: move "struct seat" inside class Fl_Wayland_Screen_Driver 2023-03-27 11:31:26 +02:00
ManoloFLTK
dcb4c39956 Wayland: remove compilation warning (#706)
drivers/Wayland/Fl_Wayland_Window_Driver.cxx:1515:47: warning: declaration ‘struct wld_window::custom_cursor’ does not declare anything
2023-03-23 18:42:02 +01:00
ManoloFLTK
1a8d6662ce osissues.dox: add "The Wayland/X11 hybrid library" 2023-03-21 10:43:53 +01:00
ManoloFLTK
8178d95eb6 Add documentation of 0S-specific fl_mac_gc() 2023-03-20 11:09:58 +01:00
Matthias Melcher
f37347dd6e
Fix and consolidate settings dialogs (#346, #703) 2023-03-19 20:04:01 +01:00
ManoloFLTK
3edab90f38 Wayland.dox: document recent changes about custom cursors 2023-03-13 11:32:06 +01:00
ManoloFLTK
eeb9267e6e Wayland: add support for multiple high or low DPI displays 2023-03-13 10:38:28 +01:00
Albrecht Schlosser
0f3b5ded8f Fix dependencies, typos, trailing whitespace, and formatting
No code changes.
2023-03-09 18:28:37 +01:00
Albrecht Schlosser
5175192755 CMake: build shared libs with OPTION_CAIROEXT (issue #250)
- 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-03-09 17:34:05 +01:00
ManoloFLTK
dd5dccb30f Wayland.dox: more details about window positioning 2023-03-08 17:52:21 +01:00