Commit Graph

12404 Commits

Author SHA1 Message Date
Albrecht Schlosser
b9ff72c573 Revert "Prefix user-set window class name" (Windows only)
... introduced in commit 81c965f8e2.

Note: we must not change the xclass (WNDCLASS) set by the user.

Setting another xclass() in FLTK demo programs where the name might
conflict with system WNDCLASS's is the better choice.
2026-02-08 17:44:58 +01:00
Albrecht Schlosser
6cb0ce6615 Add missing FL_EXPORT macro 2026-02-07 20:29:04 +01:00
Albrecht Schlosser
75df975c5e Fix compiler warning (remove debug output statement) 2026-02-07 20:28:27 +01:00
Albrecht Schlosser
8b4af06a96 CMake: don't export unnecessary executable files
Exporting executable files means that they would appear in the CMake
config files as "imported targets". This could break the config files
of Linux and other distributions if such executables are not installed
when building FLTK programs.

The only executable files that need to be exported are the `fluid`
executables that may be used to convert .fl files during building.
2026-02-07 20:08:23 +01:00
ManoloFLTK
2521c8a519 X11 platform: Fl::enable_im() crashes without input methods (#1364) 2026-02-06 07:30:39 +01:00
ManoloFLTK
e33176ebe0 Mention in CHANGES.txt the new minimal required version of macOS. 2026-02-06 07:29:09 +01:00
Albrecht Schlosser
75fc94d6c7 Improve test/utf8 demo by using Fl_Grid and more
- separate layout and contents of example text widgets
- use Fl_Grid for more flexibility in the layout of the main window
- reformat some parts but not all code to FLTK style
- add comments, fix font style calculation ("near fixed pitch")
- add tooltips with user instructions to some of the widgets
- add "rainbow" emoji as colored emoji example
- reformat contents of the "unichar drop box"
2026-02-04 16:49:48 +01:00
Albrecht Schlosser
54712fd388 Fix compiler warning, rename confusing variable, format code
- fix: comparison of integer expressions of different signedness
- rename confusing variable 'l' to 'len' (l can be confused with 1)
- minor comment and code formatting

This commit should not change the behavior.
2026-02-02 20:07:41 +01:00
Albrecht Schlosser
db4aa25e99 Windows: define required Windows version for Pen/Tablet support
This is necessary for some (not all!) Windows toolchains that
define the required symbols only for Windows 8 and later.
2026-02-02 19:48:41 +01:00
ManoloFLTK
95e5b1b9c5 macOS: remove code present only to support macOS versions 10.6 and earlier - cont'd. 2026-02-02 13:13:11 +01:00
ManoloFLTK
3f56b8091d macOS: remove code present only to support macOS versions 10.6 and earlier.
It's possible to build and run FLTK 1.5 with its use of C++11 for macOS 10.7 and SDK 10.7.
This commit makes 10.7 the required minimal version of macOS to build and run FLTK 1.5.
2026-02-02 12:41:03 +01:00
Albrecht Schlosser
26387c3538 Fix obvious indenting errors after removal of old code
... by commit e0405d2135
2026-02-01 18:17:13 +01:00
ManoloFLTK
e0405d2135 macOS: remove code present only to support macOS versions 10.3 and 10.4.
This is a first step towards removing the code related to support of old macOS versions
that are not compatible with C++11 which FLTK 1.5 requires.
2026-02-01 16:32:21 +01:00
ManoloFLTK
4be596a306 Restore usability with macOS SDK < 10.12 2026-02-01 15:28:59 +01:00
ManoloFLTK
6406437830 Improve documentation of functions dedicated to processing of emoji sequences. 2026-02-01 15:28:06 +01:00
ManoloFLTK
38aaabb059 Avoid leaving file descriptor open after failed call to mkstemp() 2026-02-01 15:28:06 +01:00
Albrecht Schlosser
ea18e097a7 Fix typo in CMake config file 2026-02-01 14:46:06 +01:00
ManoloFLTK
8c8bc16905 Fix in Fl_Text_Buffer::next_char() necessary for empty buffer. 2026-01-30 09:04:24 +01:00
ManoloFLTK
4a81cfac9c Wayland paste and DnD: fix minor issue revealed by valgrind - cont'd. 2026-01-30 09:02:56 +01:00
ManoloFLTK
4c5b1df4c8 Emoji support: fix in Fl_Text_Buffer::next_char() necessary for keycap emoji sequences. 2026-01-30 08:37:05 +01:00
ManoloFLTK
6678458b41 Wayland paste and DnD: fix minor issue revealed by valgrind. 2026-01-30 08:33:16 +01:00
Albrecht Schlosser
e9966b7e31 CMake: add try_compile() to figure out if Pen/Tablet is supported
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-29 17:43:21 +01:00
ManoloFLTK
bed38ba3f5 Emojis: add support of keycap emoji sequences.
- It is expected that all emojis listed in the Wikipedia "emoji" article
as of early 2026 are recognized as single glyphs by FLTK text widgets.
- Document functions fl_utf8_{next|previous}_composed_char()
relatively to the notion of "emoji sequence".
- Remove signed/unsigned comparison compilation warnings.
2026-01-29 13:04:35 +01:00
ManoloFLTK
445d26bb71 Improve usage of std::map::key_comp() member in fl_wayland_clipboard_dnd.cxx 2026-01-28 16:31:36 +01:00
ManoloFLTK
149bc2ca3b Improve usage of std::map objects in fl_wayland_clipboard_dnd.cxx 2026-01-28 16:21:22 +01:00
ManoloFLTK
d74b342141 Fix typo in documentation of fl_utf8len1(). 2026-01-28 12:52:42 +01:00
ManoloFLTK
37aeed359a Wayland: improve handling of priorities between diverse clipboard mime-types. 2026-01-27 16:21:36 +01:00
Albrecht Schlosser
38fbd41896 Remove usage of fl_utf8froma(), improve layout of test/utf8
- use demo strings in UTF-8 encoding rather than converting them
  which also simplifies the code
- replace some hard-coded width and pos. values with constants
- enlarge width of text widgets (left column) of the main window
- replace display of Unicode range U+D800 ... U+DFFF with a text
  explaining that this space is used by UTF-16 surrogate pairs to
  prevent warning messages about invalid Unicode text.
2026-01-26 18:46:29 +01:00
ManoloFLTK
1a285f43ec Modify fl_utf8toa() to make it account for composed emojis. 2026-01-26 15:40:35 +01:00
ManoloFLTK
f61d54e71d Improve documentation of fl_utf8_{next|from}_composed_char() 2026-01-26 10:24:33 +01:00
ManoloFLTK
521f7b3c5b Let text widgets handle gracefully composed unicode characters - Cont'd.
This commit adds support of another type of composed characters: flags.
It also fixes Fl_Text_Buffer::prev_char() and Fl_Text_Buffer::next_char()
that must use Fl_Text_Buffer::byte_at() to access to the content of the text buffer.
2026-01-26 09:17:18 +01:00
ManoloFLTK
188aa0be0e Fix "Setting window custom cursor from SVG image crashes" - cont'd (#1363) 2026-01-24 16:43:12 +01:00
ManoloFLTK
bd4ad3e4a0 Let Fl_Text_Editor and Fl_Input handle gracefully composed unicode characters. 2026-01-24 16:15:47 +01:00
ManoloFLTK
84b5623132 Wayland: use UTF8 text from clipboard when available. 2026-01-23 19:16:23 +01:00
ManoloFLTK
dd9cb9f042 Wayland: add support of recoded UTF8 text in clipboard. 2026-01-23 18:41:19 +01:00
ManoloFLTK
05a3f82a5c Fix "Setting window custom cursor from SVG image crashes" (#1363) 2026-01-22 14:27:13 +01:00
ManoloFLTK
14a5f705c8 Improve handling of text containing context-dependent unicode points.
This commit makes platforms Windows and macOS compute string widths
with the same mechanism as what is in place for platforms Wayland/X11:
- the width of a string containing a single codepoint is computed and
memorized in the table of character widths;
- the width of a string containing several codepoints is computed as
such rather than as the sum of the widths of its composing characters.

The result is that FLTK text widgets input and draw correctly also
complex emojis encoded with context-dependent codepoints.
Function fl_utf8_remove_context_dependent() is no longer necessary.
2026-01-21 14:00:26 +01:00
ManoloFLTK
2f7d7adfcf Update bundled libpng to last upstream version 1.6.54 2026-01-20 18:01:12 +01:00
ManoloFLTK
d30ca18664 Improve docu of member variable Fl_SVG_Image::proportional - cont'd (#1361) 2026-01-20 17:08:08 +01:00
ManoloFLTK
4644521f8c Move call to fl_utf8_remove_context_dependent() to more appropriate place. 2026-01-20 11:41:45 +01:00
ManoloFLTK
138624fa27 Remove possible NULL dereference introduced at commit 61e75e4 2026-01-20 09:51:39 +01:00
ManoloFLTK
61e75e4a12 All platforms use same code to remove context-dependent codepoints from text input.
This commit introduces function fl_utf8_remove_context_dependent() that removes
from an UTF-8 string its context-dependent codepoints. Platforms macOS, Wayland
and X11 call this function to process UTF-8 text received from a character palette
as input to FLTK text. This makes sure FLTK text-editing widgets process textual input
equally and consistently across platforms, especially emojis entered via a palette.

Platform Windows creates a series of separate system events to input an emoji
via the character palette. For this reason, function fl_utf8_remove_context_dependent()
is not used by this platform which does internally the same filtering of context-
dependent codepoints.
2026-01-19 16:34:50 +01:00
ManoloFLTK
59d93554b3 Windows: error dragging window between differently scaled display - cont'd (#1127) 2026-01-19 11:08:29 +01:00
ManoloFLTK
bde474e0af Windows: error dragging window between differently scaled display - cont'd (#1127) 2026-01-19 10:01:30 +01:00
ManoloFLTK
f3cbce2e92 Emoji input: remove context-dependent unicode points from output of emoji palette.
The character palette allowing to input emojis in text generates in some cases a series
of unicode points to represent a single emoji. These series contain various kinds of
unicode points with context-dependent meaning. This commit prevents such context-
dependent unicodepoints from being inserted in FLTK text because FLTK text edition
mechanism is not ready to handle properly context dependency in edited UTF-8 text.
2026-01-18 18:04:06 +01:00
ManoloFLTK
20157f7caa Restore emojis support under recent macOS versions - cont'd (#1360)
This commit improves how FLTK follows changes to the focus window under macOS.
2026-01-16 11:02:37 +01:00
ManoloFLTK
fbc3f7a69f Improve documentation of member variable Fl_SVG_Image::proportional (#1361) 2026-01-15 19:12:56 +01:00
ManoloFLTK
81c965f8e2 Partial fix for the Windows platform of the emoji issue (#1360)
This fixes input of emojis to Fl_Input and Fl_Text_editor widgets under Windows with the emoji palette.
Most emojis have a Unicode point > 0xFFFF and therefore are encoded as a surrogate pair
by Windows which uses UTF-16. Thus, Windows sends 2 consecutive WM_CHAR messages to the
window and gives one member of the pair each time. After the second WM_CHAR message arrived
FLTK is able to enter the emoji in its text. Windows may also send "variation selectors" and
zero-width Unicode points when dealing with emojis. FLTK just skips them.
Windows also translates some Unicode emojis into 1 emoji + 1 other Unicode point: for example
"woman pilot" produces "pilot emoji" + "woman" unicode point. FLTK now handles
this gracefuly.

This fix also prefixes the windows class names with "FLTK-" under Windows to prevent
collisions with Windows-reserved class names. That fix is necessary for the emoji palette
to be usable in some scenarios. That fix is still under debate and may evolve in latter commits.
2026-01-14 16:16:25 +01:00
Albrecht Schlosser
d38b699432 util/cmap: link against libm only if it was found 2026-01-13 17:02:51 +01:00
Albrecht Schlosser
afacd1b8fe Fix documentation (comment only) 2026-01-13 16:50:24 +01:00