Commit Graph

11226 Commits

Author SHA1 Message Date
Greg Ercolano
eb4916344b Clear screen also clears attributes/xterm modes (#911)
Clear was setting characters to a space using the current style,
but if the style left Dim/Bold/Inverse (etc) enabled, that was being
used to affect the clear character, and thus affected clearing screen.

Seems weird tho; what if one wants to do a cleol (\033[K) on a screen
that is all inverted text; is there no way to use inverse mode for
clearing to the end of line? Or to delete a character?
2024-02-17 07:59:42 -08:00
ManoloFLTK
3ecadc0a8e Update bundled libjpeg to version 9f 2024-02-17 12:20:28 +01:00
ManoloFLTK
bf938da079 Update bundled libpng to version 1.6.42 2024-02-17 12:20:28 +01:00
ManoloFLTK
b90437119d Update bundled zlib to version 1.3.1 2024-02-17 12:20:28 +01:00
Greg Ercolano
00cdb1757f Added attribute checks to test/terminal for recent changes. 2024-02-16 13:14:15 -08:00
Greg Ercolano
58a1496389 Fixed Fl_Terminal xterm color 39/49 handling, and other mods.
Fixed a bug in the handling of xterm color 39 + 49, which avoids
applying Dim/Bold if default color is the special "see through" color
0xffffff00. A test will be added to test/terminal to excercise this
in a follow up commit.

Renamed CharStyle::?gcolor_uchar() -> CharStyle::?gcolor_xterm()
for a consistent naming convention.

Changed fltk_fg_color() from a static func to a CharStyle method
because it needs to access the defaultcolor for the special cases
for xterm colors 39 and 49.

Made CharStyle::attr_color() private, as per Jonathan Griffitts request
in issue #909.

Improved docs regarding effects of Dim/Bold for xterm and non-xterm color
methods.

Fl_Terminal::text?gcolor_xterm() methods now use CharStyle::?gcolor_xterm()
methods, removing the duplicate code logic.
2024-02-16 13:10:06 -08:00
Greg Ercolano
1069ebc1b6 Fix Fl_Terminal xterm CharStyle charflags (#909) 2024-02-16 04:46:05 -08:00
Greg Ercolano
cc562761c2 Fix text overflow in fluid widget panel (#908)
Made fonts slightly smaller,
enlarged/moved some widgets in Alignment: group.
2024-02-15 09:25:28 -08:00
Albrecht Schlosser
0987c763ec CMake: fix "LIBDECOR_PLUGIN_DIR" undefined error
This could happen on Linux if built with CMake option
  "-DFLTK_USE_SYSTEM_LIBDECOR=OFF"
2024-02-14 22:57:55 +01:00
Albrecht Schlosser
b282ee0335 CMake: remove unintended debug output 2024-02-14 17:51:51 +01:00
Albrecht Schlosser
7992b0b9ab CMake: fix installation on macOS
fluid and fltk-options are now installed correctly as bundles and as
stand-alone executables side by side in the 'bin' folder relative
to CMAKE_INSTALL_PREFIX.

This works but the installation folders may be changed in the future.

Targets fltk::fluid is now exported correctly so

  find_package(FLTK CONFIG ...)

works with both the build folder and an installed version.
2024-02-14 17:06:10 +01:00
Albrecht Schlosser
cd3cb62770 CMake: simplify resources.cmake
Note: CheckIncludeFiles caches the result in an 'internal' variable.
Hence mark_as_advanced() is not necessary for these variables.
2024-02-13 16:15:46 +01:00
Albrecht Schlosser
0771bc6cee CMake: improve formatting, remove debug statements 2024-02-13 15:10:06 +01:00
Albrecht Schlosser
bddcecd28a CMake: set FLTK_VERSION and FLTK_FLUID_EXECUTABLE in the cache
This is useful if FLTK is built as a subproject, for instance by
using FetchContent.
2024-02-12 16:53:20 +01:00
ManoloFLTK
cf551ddf5a Improve recognition of re-scaling shortcuts - cont'd 2024-02-11 19:10:39 +01:00
Albrecht Schlosser
4ea058da0a Update examples/CMakeLists.txt to modern CMake
Also: set build requirement of OpenGL3 tests to C++11 to enable
building in C++98 mode (if the compiler allows C++11).

Note: this may be removed in 1.5.0 when FLTK requires C++11 anyway.
2024-02-11 16:06:17 +01:00
ManoloFLTK
2776071144 Improve recognition of re-scaling shortcuts w/ various keyboard layouts 2024-02-11 11:07:03 +01:00
ManoloFLTK
63b0bcf599 KDE+X11 keyboard stops working after menu display (#904) 2024-02-11 08:23:23 +01:00
Albrecht Schlosser
179c5d3521 CMake: fix some weird internal dependencies (Wayland/X11)
Improve recognition of Wayland and X11 specific build options and
remove duplicates from required dependencies (FLTK_LDLIBS) used in
fltk-config.

This should also fix the GitLab CI build process.

To do: the logic to find the dependencies of Wayland and X11 is
currently suboptimal. This will be improved in a later commit.
2024-02-10 16:27:38 +01:00
Matthias Melcher
a7bc26e12a FLUID: Fix double reverse logic in FL_COMMAND handling 2024-02-10 14:55:52 +01:00
Matthias Melcher
1ed14867e6 Fixes FLUID shortcut generation
and makes the C++ code human readable
2024-02-10 14:28:33 +01:00
Albrecht Schlosser
f4af40fe55 Modern CMake: export shared libraries and fltk-options 2024-02-10 14:19:09 +01:00
Albrecht Schlosser
809ceea075 Fix Cairo related build issues (missing Cairo lib)
... particularly for shared libs
2024-02-09 19:41:45 +01:00
Albrecht Schlosser
ede53b8a50 Fix cairo_test-shared build as well (#902) 2024-02-09 17:35:26 +01:00
ManoloFLTK
ffeaeec5bd Move FLTK_USE_SVG from config.h to FL/fl_config.h 2024-02-09 13:36:16 +01:00
Albrecht Schlosser
3895068aa1 Fix "cairo_test fails to link due to undefined's" (#902)
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-09 12:38:14 +01:00
ManoloFLTK
fc6d364057 Change parameters of Fl_Wayland_Window_Driver::delete_cursor() 2024-02-09 10:04:13 +01:00
Albrecht Schlosser
c83164fbcc CMake cleanup: fix alignment 2024-02-08 19:31:40 +01:00
Albrecht Schlosser
2ee5ca7ef3 CMake cleanup: mark two more cache variables "advanced" 2024-02-08 19:18:37 +01:00
ManoloFLTK
1fdb1f7944 Improve Fl_Wayland_Window_Driver::hide() 2024-02-08 15:18:18 +01:00
Albrecht Schlosser
a1d3bf182e Fix GitHub CI build and minor CMake issues
- GitHub CI: fix wrong CMake option name
- fl_add_library: disable debug output (MSVC), fix formatting
2024-02-07 20:03:29 +01:00
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
Albrecht Schlosser
1cf6fdfa85 Fix Fl_Window::default_size_range() (#901)
Thanks to Manolo for the patch.
2024-02-07 12:38:58 +01:00
Matthias Melcher
f0c1eff069 Fix typo in function name in editor. 2024-02-06 22:00:11 +01:00
Matthias Melcher
78ae78b118 Add dynamic title to test/editor 2024-02-06 21:25:43 +01:00
ManoloFLTK
6d98c6a8b1
Restore 3-way close window dialog (#900) 2024-02-06 20:27:18 +01:00
ManoloFLTK
a651c89c85 Fix window moving in Fl_Wayland_Window_Driver::resize() 2024-02-06 09:24:31 +01:00
ManoloFLTK
676e976cb6 Fl_Window_Driver::set_popup_window(), Fl_Screen_Driver::screen_boundaries_known()
Fl_Window_Driver::set_popup_window() is to be used to declare a window should be
positioned relatively to a previously mapped other window.  This allows a platform
to process such windows differently from other windows if needed.
Menu and tooltip windows are so declared.

A call to Fl_Window_Driver::set_popup_window() also allows to distinguish a real
menu or tooltip window from a window marked by Fl_Window::set_menu_window()
or by Fl_Window::set_tooltip_window() but that's not a real menu or tooltip.

New member function bool Fl_Screen_Driver::screen_boundaries_known() returns
true by default. A platform where the position of windows inside a screen is hidden
(e.g., Wayland) returns false. This allows FLTK to refrain from trying to make sure
a computed position is inside a screen.
2024-02-05 12:39:10 +01:00
ManoloFLTK
0da00995a8 Shorten parameter list of Fl_Wayland_Window_Driver::delete_cursor_(bool) 2024-02-04 16:55:01 +01:00
ManoloFLTK
865aed4eec Wayland: fix setting cursor to FL_NO_CURSOR 2024-02-03 16:04:06 +01:00
Albrecht Schlosser
b21a3910a9 Improve documentation of Fl_Native_File_Chooser
Document restrictions imposed by the new system file chooser dialogs,
particularly by 'kdialog' and 'zenity' (Unix/X11/Wayland only).
2024-01-31 18:50:25 +01:00
Matthias Melcher
faff63130c Fix cached GL context on all platforms (#737) 2024-01-29 14:01:41 +01:00
Matthias Melcher
c40b165353 Fix OpenGL context caching on macOS (#737) 2024-01-29 13:42:05 +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
Matthias Melcher
fa8799bcef Fix animated gif reloading (#897) 2024-01-28 00:14:49 +01:00
Matthias Melcher
444ee8bc36 Fix warning for out of range index. 2024-01-27 17:54:49 +01:00
Matthias Melcher
4123605aab Fix inlined animated GIFs with NULL name (#897) 2024-01-27 16:27:34 +01:00
Greg Ercolano
f2544509c1 Fix mousewheel problem with Fl_Text_Editor (issue #879)
When an Fl_Text_Editor ended up under the mouse, it took
mousewheel events for itself, freezing navigation of a
parent's Fl_Scroll.

Patch handles mousewheel events for both up/down and left/right
by checking:

    > If editor has no scrollbar (e.g. no content to scroll to),
      then mousewheel events for that scrollbar are ignored
      so the parent can be navigated.

    > If editor has a scrollbar, it handles wheel events until scroller reaches
      an extreme position (e.g. top or bottom), it starts ignoring wheel events
      so the parent can be navigated.
2024-01-25 08:09:25 -08:00
Greg Ercolano
6a887bf69b Fix small typos in Anim GIF docs 2024-01-24 14:10:54 -08:00
ManoloFLTK
8a4aa619e4 Fix "Wrong tooltip position on Wayland …" - cont'd (#894) 2024-01-23 12:36:50 +01:00