Commit Graph

12337 Commits

Author SHA1 Message Date
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
ManoloFLTK
1c1b6c12f4 Restore emojis support under recent macOS versions - cont'd (#1360)
Detect Ctrl+Command+Space to open character palette only if not used before as shortcut.
2026-01-12 17:03:19 +01:00
ManoloFLTK
306de09987 Restore emojis support under recent macOS versions - cont'd (#1360)
This makes FLTK open the character palette when typing Ctrl+Command+Space or Function+e
2026-01-12 16:34:30 +01:00
ManoloFLTK
69669256d4 Restore emojis support under recent macOS versions (#1360) 2026-01-12 11:21:48 +01:00
ManoloFLTK
afbdbb25b9 Function Fl::Private::cairo_make_current(void *gc) is not used anywhere in FLTK 2026-01-12 09:42:39 +01:00
ManoloFLTK
4cc0c8f44a Update wayland documentation about function wayland_socket_callback(). 2026-01-11 21:03:23 +01:00
ManoloFLTK
9a5688f000 Fix "Drawing to the wrong window with cairo and X11" (#1358) 2026-01-11 19:11:28 +01:00
ManoloFLTK
7c3b1f00f5 Don't pretend Wayland supports Fl::add_system_handler(). 2026-01-11 19:03:31 +01:00
ManoloFLTK
7b6a779fd3 Fix "Wayland: NULL pointer dereference in Fl::cairo_make_current()" (#1359) 2026-01-11 12:09:41 +01:00
ManoloFLTK
e59a5dc804 Windows: improve moving window across screens with distinct scale factors - cont'd 2026-01-10 12:36:23 +01:00
ManoloFLTK
fc3e6a1c53 Windows: improve moving window across screens with distinct scale factors - cont'd 2026-01-10 12:05:01 +01:00
ManoloFLTK
8914914735 Remove un-necessary code from Fl_Wayland_Window_Driver::resize() function 2026-01-09 11:19:45 +01:00
Albrecht Schlosser
4908dfd72a Add CMake option FLTK_OPTION_PEN_SUPPORT (default: ON)
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.
2026-01-08 21:22:03 +01:00
Albrecht Schlosser
7fae181d95 Documentation: replace HTML table with Doxygen table
... for better readability in the source code.

Note: the documentation output is identical.
2026-01-08 19:05:16 +01:00
ManoloFLTK
bc05edd385 Wayland: use the "Cursor shape" protocol - Cont'd 2026-01-08 10:51:56 +01:00
ManoloFLTK
145d05c365 Documentation: add "Cursor shape" to table of used Wayland interfaces 2026-01-08 10:37:01 +01:00
Matthias Melcher
dc07fcdb6e Fix callback forwarding in Fl_Input_Choice.
Widget would always call CHANGED but never
RELEASE events, no matter how the when()
flags were set.
2026-01-07 13:18:29 +01:00
Matthias Melcher
52452f117f Remove event names that would be generated by fl_eventname_str 2026-01-07 11:34:29 +01:00