Commit Graph

6591 Commits

Author SHA1 Message Date
ManoloFLTK
18c363a0d9 Use fl_tolower() for case-insensitive Unicode-aware comparisons 2023-02-06 18:48:43 +01:00
ManoloFLTK
55cb8081c7 Don't assume strcasecmp() is a function because of Visual studio C 2023-02-06 16:30:56 +01:00
ManoloFLTK
e0b45688a7 Add necessary #include "flstring.h" 2023-02-06 16:15:22 +01:00
ManoloFLTK
dc51880e28 Fix "\todo Add a flag to ignore case" from Fl_Browser_.cxx 2023-02-06 15:26:53 +01:00
ManoloFLTK
587687629e Fix "\todo Make comparison UTF-8 aware" in numericsort.c 2023-02-06 13:17:24 +01:00
ManoloFLTK
57a87f7053 Fix "\todo provide user documentation for fl_set_status function" 2023-02-06 11:17:31 +01:00
ManoloFLTK
a56c48079e Fix "\todo Complete documentation of class Fl_String"
Also
- fix "\todo Unicode?" in Fl_Text_Display::display_insert() after verification
- fix "\todo [Internal] The user_data value must be implemented using \p fl_intptr_t"
because that's now in place.
2023-02-06 10:34:47 +01:00
ManoloFLTK
589c1f31c3 Improve doc of Fl_Widget::test_shortcut() methods
This removes a \todo item.
2023-02-05 11:45:23 +01:00
Matthias Melcher
1aa6c4fed8
Fix position() methods that shadow Fl_Widget::position()
* `FL_DEPRECATED` macro to mark `position()` method that shadow `Fl_Widget::position()` #69 (#666)
2023-02-02 20:54:19 +01:00
ManoloFLTK
6276822e9e Allow cmake -DOPTION_APPLE_X11=On without -U__APPLE__ 2023-02-02 18:48:24 +01:00
Albrecht Schlosser
4e75549e7b Update dependencies and fix whitespace errors
- replace tabs with spaces
- remove trailing whitespace
2023-02-02 17:09:14 +01:00
Albrecht Schlosser
fb00fb3d66 Minimize and fix include statements of Fl_Int_Vector
- replace <FL/Fl.H> with <FL/Fl_Export.H> in public header
- add missing <string.h> in implementation
2023-02-02 17:00:28 +01:00
ManoloFLTK
16dff07994 Fix "Native file chooser on Linux fails with BROWSE_MULTI_FILE" (#669) 2023-02-02 15:20:55 +01:00
ManoloFLTK
ddc213d91c Add preliminary support of Wayland under macOS
Wayland under macOS is WIP at
  https://github.com/owl-compositor/owl
2023-02-02 14:39:11 +01:00
ManoloFLTK
96fd8a5f7a Wayland: use fl_wl_find() instead of fl_find() 2023-02-01 09:30:09 +01:00
ManoloFLTK
94c918a1ae Fix miscellaneous #include directives 2023-01-31 18:22:04 +01:00
ManoloFLTK
eaaf5ba90c Fix crash in Zenity filechooser with badly formed filter (#665) 2023-01-31 17:37:20 +01:00
ManoloFLTK
8ef592db1e Fix crash in Zenity filechooser with badly formed filter (#665) 2023-01-31 17:01:30 +01:00
ManoloFLTK
f75f05e7b7 Fix crash in Zenity filechooser with badly formed filter (#665) 2023-01-31 15:37:33 +01:00
ManoloFLTK
9bf2726bce Fix "Native Filechooser (Zenity) crashes on second invocation" (#665) 2023-01-31 13:13:48 +01:00
ManoloFLTK
1045538ed0 Fix launching of unbundled app from /tmp 2023-01-30 20:08:18 +01:00
ManoloFLTK
95f926fd01 Document that Fl::add_fd() opens display under macOS 2023-01-30 07:39:20 +01:00
Albrecht Schlosser
86a0a28815 Fix comments and remove a 'todo' item from docs
Comments and docs only, no code changes.
2023-01-28 16:09:54 +01:00
ManoloFLTK
d604c37c90 Fix for [fltk.coredev] native file chooser crash 2023-01-27 08:35:38 +01:00
Matthias Melcher
e2028c66fe STR 2936: FLUID: option to ignore syntax check in DeclBlock 2023-01-26 16:32:17 +01:00
ManoloFLTK
1581662d00 Simpler Fl_Wayland_Gl_Window_Driver::resize() is enough 2023-01-26 16:04:06 +01:00
Matthias Melcher
179771acd2
Fixing FLUID file corruption from issue #653 (#662)
Removing all globals in file writer (#653 )
Fix some static analyser complaints
Valgrind: handle width==0 in GfxDrivers on Wayland and X11
Don't use `Fl_Input_::static_value`, it accesses previous
buffer that may be deleted
Project file write encapsulated, removing globals
Encapsulating project file reader, removing states in glbals
Project i/o increased source code readability
2023-01-26 15:23:43 +01:00
Matthias Melcher
3a7c9fe978 STR 2639 Fixes Fl_Pack resize behaviour
FLUID cleanups
FLUID Fl_Pack support improvement
FLUID fix error in handling live mode resizables
2023-01-23 16:08:59 +01:00
ManoloFLTK
17467b48bd Wayland: remove useless member variables of struct output 2023-01-23 08:11:10 +01:00
wcout
2ddfd9d949
Animated GIF support (Fl_Anim_GIF_Image class) (#375) 2023-01-21 17:27:58 +01:00
Matthias Melcher
2c595e8dde STR 2822: function to count bytes in a UTF-8 string 2023-01-20 16:13:00 +01:00
Matthias Melcher
b19c0e4f63 STR 2894: pressed_menubutton_ now protected in Fl_Menu_Button 2023-01-20 15:22:21 +01:00
Matthias Melcher
4f3f2bb30b STR 2909: Fl_Tile now forwards FL_RELEASE event to children 2023-01-20 14:04:22 +01:00
Matthias Melcher
ab5cc5866d STR 3408: Fl_Scroll draws background inactive if needed 2023-01-20 13:51:17 +01:00
Matthias Melcher
f4620329f1 STR 3461: fix menu linespacing 2023-01-20 13:44:13 +01:00
ManoloFLTK
35b7473e70 Wayland menus: support tall popup menu + Sway support 2023-01-16 17:07:22 +01:00
ManoloFLTK
ff3906bec0 Wayland menus: support tall popup menu 2023-01-16 16:00:54 +01:00
Albrecht Schlosser
f44bdfb7cf Fl_Chart: minor update and additional documentation
Add forgotten parameter docs and some minor code fixes.
2023-01-16 00:08:47 +01:00
Albrecht Schlosser
dde2d21b5d Improve deriving from Fl_Chart (STR 2022)
This commit makes the local, static drawing functions in the source
file available for subclasses by converting them to static protected
methods as requested by STR 2022.

The source and header files have been reformatted according to the
CMP, documentation for the new protected methods was added.

Source code *functionality* has not been changed.

This resolves and closes STR 2022.

Todo:
 - investigate whether these drawing methods wouldn't better be
   member functions and "convert" them if applicable
 - investigate whether the internal struct FL_CHART_ENTRY could become
   a local part of the Fl_Chart class, maybe Fl_Chart::Entry.
 - rename private member variables with trailing underscore (see CMP)
2023-01-15 23:48:00 +01:00
ManoloFLTK
761aa5e485 Rename static member Fl_Wayland_Window_Driver::tall_popup to new_popup
The new name reflects better the role of this bool member variable.
Also, add explanatory comments about the use of this variable.
2023-01-15 10:18:50 +01:00
ManoloFLTK
37775538c4 Extend commit a4b33f8 to other uses of function convert_crlf()
Helper function convert_crlf() from file fl_wayland_clipboard_dnd.cxx has been
repaired by commit a4b33f8 (13 jan 2023). But the same function was also in
file Fl_cocoa.mm. This commit moves the repaired code to class Fl_Screen_Driver
and has both fl_wayland_clipboard_dnd.cxx and Fl_cocoa.mm use it.
2023-01-14 09:56:09 +01:00
ManoloFLTK
c8b4a56735 Add missing initialisation after dynamic memory allocation 2023-01-14 08:16:23 +01:00
Albrecht Schlosser
a4fdf92d06 Fix set_fonts() in Xlib/xft and Cairo Graphics_Driver
src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx:
 - fix font_name_process() out of bounds memory access
 - unify/align font_name_process() code (see also Xlib/xft)
 - fix font name string allocation

src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx
 - unify/align font_name_process() code (see also Cairo_Graphics)
 - fix font name string allocation

Todo: move common code to Fl_Graphics_Driver or another common file.
2023-01-13 22:39:23 +01:00
ManoloFLTK
f3e21ddad2 Fix for "Rename Fl_X* Fl_Window::i private class member" (#223) 2023-01-13 21:16:17 +01:00
ManoloFLTK
dd6b9b90ee Wayland menus: add missing use of scaling factor 2023-01-13 19:37:06 +01:00
Albrecht Schlosser
59bf6dc059 Fix "alloc-dealloc-mismatch" in Fl_Native_File_Chooser_Kdialog
Error was reported by Address Sanitizer (ASAN) when picking a file.
Platform: Unix/Linux.

==1734703==ERROR: AddressSanitizer: alloc-dealloc-mismatch (malloc vs operator delete []) on 0x607000108420
    #0 0x7f3357d846ef in operator delete[](void*) ../../../../src/libsanitizer/asan/asan_new_delete.cc:168
    #1 0x4e195f in Fl_Native_File_Chooser_Driver::strfree(char*) ../../src/Fl_Native_File_Chooser.cxx:262
...
0x607000108420 is located 0 bytes inside of 66-byte region [0x607000108420,0x607000108462)
allocated by thread T0 here:
    #0 0x7f3357d0a3ed in __interceptor_strdup ../../../../src/libsanitizer/asan/asan_interceptors.cc:445
    #1 0x57951a in Fl_Kdialog_Native_File_Chooser_Driver::filter(char const*) ../../src/Fl_Native_File_Chooser_Kdialog.cxx:245
    #2 0x4e14a0 in Fl_Native_File_Chooser::filter(char const*) ../../src/Fl_Native_File_Chooser.cxx:176
2023-01-13 18:15:51 +01:00
Albrecht Schlosser
a4b33f8e76 Wayland: Fix "heap-buffer-overflow" error
- replace strchr() with memchr() because buffer is not nul-terminated
- fix '*(p+1)' potentially accessing memory out of bounds

This fix also prevents
- multiple memmove() calls
- multiple searches from the beginning of the string
2023-01-13 16:44:06 +01:00
Albrecht Schlosser
54e75dc902 Improve debug output of Fl_String
- add newline (\n) before string output
- remove quotes (')
2023-01-13 16:41:40 +01:00
ManoloFLTK
6a5c326c39 Fix for "Screen resolution change (win32)" (#651) 2023-01-13 15:15:02 +01:00
ManoloFLTK
7dd7cfcf95 Wayland Fix "Error "heap-use-after-free" when scaling twice" (#650) 2023-01-12 21:28:03 +01:00
ManoloFLTK
66860c2e83 Improve "Implementation note about menu windows under Wayland" 2023-01-12 21:27:17 +01:00
Albrecht Schlosser
bafd3fd3d7 Add Fl_Scheme_Choice widget and use it in test programs
This widget offers the selection of all known FLTK schemes as a simple
widget based on Fl_Choice.

Some test and demo programs use Fl_Scheme_Choice to enable the developer
or user to switch schemes quickly for comparison.

Todo:
 - add features to add new schemes during runtime (partially done)
 - update status when the scheme is changed by Fl::scheme("...")
2023-01-12 19:21:09 +01:00
Albrecht Schlosser
79832b679f Add the initial version of class Fl_Scheme
This basic version of class Fl_Scheme contains only static methods that
are needed for Fl_Scheme_Choice and further extensions.
2023-01-12 19:21:09 +01:00
ManoloFLTK
b375d07d32 New static member Fl_Window *Fl_Wayland_Window_Driver::previous_floatingtitle 2023-01-12 11:58:53 +01:00
ManoloFLTK
62e33973a1 New static member bool Fl_Wayland_Window_Driver::tall_popup 2023-01-12 11:36:20 +01:00
ManoloFLTK
32b966ef8f Remove repeated code in classes menuwindow and menutitle 2023-01-12 10:33:41 +01:00
ManoloFLTK
b8d9f2282f Remove useless #include directives 2023-01-12 10:33:41 +01:00
ManoloFLTK
8a8a4c793e Simpler implementation of Fl_Window_Driver::scroll_to_selected_item() 2023-01-12 09:03:53 +01:00
ManoloFLTK
86a6d4e3d3 Wayland menus: remove useless Fl_Window_Driver::extra_menutitle() 2023-01-12 08:28:06 +01:00
Albrecht Schlosser
0bd156e219 Fix buffer overflow in Fl_Tree_Item::show_self() 2023-01-12 00:06:05 +01:00
ManoloFLTK
ccfc479e43 Fix "Wayland: compilation warnings" (#649) 2023-01-11 23:53:34 +01:00
ManoloFLTK
bd1e759771 Fix "Long line crashes Fl_Hold_Browser" (#645)
This is in fact a regression introduced at commit be0f06e.
2023-01-11 18:18:22 +01:00
ManoloFLTK
9210e3efbf Wayland: Further improved implementation of menu windows
Tall menus now work also as single popup window and show the correct selected item.

Groups of popups with a menutitle, an associated menuwindow, and possibly submenus
are constructed around the menuwindow, the menutitle being a child popup of the
menuwindow. This positions these popup groups better than before.
2023-01-11 17:40:38 +01:00
ManoloFLTK
dc4c443bfc Fix ";" inadvertently written "," 2023-01-11 09:36:54 +01:00
ManoloFLTK
9bdaf5a84d Virtual member Fl_Window_Driver::makeWindow() now returns void 2023-01-09 17:35:38 +01:00
ManoloFLTK
a5b431e35e Wayland: Possibly better way to complete popup construction 2023-01-09 17:11:21 +01:00
ManoloFLTK
a6dd0adac7 Doc only: fix for "Fl::awake() and Fl::add_timeout()" (#524) 2023-01-09 15:07:59 +01:00
ManoloFLTK
13ce93330a Wayland: fix Fl::event_key(int) 2023-01-09 10:06:29 +01:00
Matthias Melcher
7d167b3cf1
FLUID: add drag'n'drop for images (#642)
FLUID dnd for desktop images into the design
Documentation for fl_access
2023-01-08 19:43:31 +01:00
ManoloFLTK
09db3a6dea Fix "Xrender blurs adjacent images with bilinear scaling" (#633)
Many thanks to @wcout for providing this fix.

Xrender now draws images in the same way when tiling images
or not when FL_RGB_SCALING_BILINEAR is on.
This allows to remove static bool Fl_Tiled_Image::drawing_tiled_image()
which becomes unused.
2023-01-08 11:17:03 +01:00
ManoloFLTK
222b2ea2e8 Wayland: Improved implementation of menu windows 2023-01-08 09:30:51 +01:00
Matthias Melcher
6ada45f1f2 Fix missing parameter documentation 2023-01-08 01:07:04 +01:00
Greg Ercolano
8e16286ebb Fix Fl_Spinner draw problem - closes #638 2023-01-07 09:35:53 -08:00
ManoloFLTK
18f2854656 Fix for "Shift-Ctrl-C shortcut in fluid not working on newer linux OS's" (#637) 2023-01-07 15:36:02 +01:00
Albrecht Schlosser
8dd3ff8e12 X11: Optionally copy selection buffer to clipboard (STR 3229)
The new method Fl::selection_to_clipboard(int) enables copying
selection data to the clipboard on X11 if it is set to 1.

This feature was requested by STR 3229 and the implementation was
inspired by an `xterm` feature named "Select to Clipboard" which can
be enabled by 'ctrl + middle mouse button + "Select to Clipboard"'
in an xterm window.
2023-01-06 16:45:22 +01:00
Matthias Melcher
e0830305a2 Add Fl_Tabs dragging in pulldown mode 2023-01-05 23:17:02 +01:00
Matthias Melcher
4bff15278e Adding Fl::hide_all_windows() 2023-01-05 15:20:13 +01:00
Matthias Melcher
8826dca106
Add close buttons for individual tabs in Fl_Tabs (#628)
Add close buttons for Fl_Tabs
Introducing callback reasons
FLUID shows all FL_WHEN_... options
Adding Fl_Tabs overflow types
Improved test/tabs to show new features
2023-01-05 13:51:30 +01:00
Albrecht Schlosser
4d1a508c7e Refactor drawing small circles: add fl_draw_circle()
This method can be used to draw small circles as part of the GUI.
It is independent of the current scheme.

Very small circles are approximated by drawing several rectangles.
2023-01-05 01:06:25 +01:00
ManoloFLTK
ae240340ab Fix for "Fl_Native_File_Chooser_MAC.mm compilation warning" (#627) 2023-01-04 18:02:29 +01:00
ManoloFLTK
13f2ea664a Cairo/Pango: compute character widths fast and string widths accurately
This commit has Fl_Cairo_Graphics_Driver compute string widths in 2 ways:
1) when the string contains several unicode characters, the width of the
whole string is computed, accounting for kerning when it occurs;
2) when the string contains a single unicode character, its width is
computed, memorised, and re-used next time it's necessary.

The effect of this approach is
- Fl_Text_Display is fast because it uses memorised single character widths repeatedly
- Fl_Input is drawn accurately because the cursor position is determined
by string widths, not by sums of character widths.
2023-01-04 17:23:13 +01:00
Albrecht Schlosser
9aa7cab532 Clarify and improve Fl::scheme() related documentation 2023-01-03 17:11:00 +01:00
Albrecht Schlosser
22a830c496 Fix missing include file for Visual Studio
... if GDIPLUS is disabled.

Thanks to Winfried Szukalski for reporting this.
2023-01-02 21:21:04 +01:00
Albrecht Schlosser
99a1daf1a9 Modify 'oxy' scheme's "choice arrow" for consistency
The "choice arrow" used two "down-arrows" which was different than
all the other schemes. Changed to up-arrow and down-arrow to make
this more consistent.

The exception is the default scheme (none or base) which uses only
one down-arrow.
2023-01-02 18:15:00 +01:00
Albrecht Schlosser
e8f2602032 Fix box frame sizes of "round" boxes in scheme 'oxy' 2023-01-02 18:00:47 +01:00
Albrecht Schlosser
a1ebe027be Fix a doxygen warning and improve "file list" contents
FL/Fl_Group.H: add `\brief` keyword
src/Fl_Group.cxx: fix warning: the '#' in '#include' must be escaped
2023-01-02 15:56:56 +01:00
Matthias Melcher
a63ad76603
FLUID refactor and macOS warnings removed (#623)
P renamed to g_project
class Project renamed to class Fluid_Project
fixes macOS type cast warnings
2023-01-01 20:05:42 +01:00
Albrecht Schlosser
23e8d831a8 Add a missing FL_OVERRIDE flag 2023-01-01 18:02:46 +01:00
Adam Chyła
bfe730ecbf
Remove commented fl_beep calls (#620) 2022-12-30 23:15:53 +01:00
Matthias Melcher
473b5d8b5b Fixing false FL_OVERRIDE 2022-12-30 20:54:03 +01:00
Matthias Melcher
96f080a212 Fix uninitialised struct in SVG reader 2022-12-30 20:49:48 +01:00
Matthias Melcher
44c874b731
Use FL_OVERRIDE for all overridden virtual methods (#611)
FL_OVERRIDE is defined as `override` for C++11 and higher
FL_OVERRIDE is defined as `override` for VisualC 2015 and newer
Don't interfere with Fl_Widget::override()
2022-12-30 19:14:36 +01:00
Albrecht Schlosser
f58a93a159 Fix misleading indentation (warning: [-Wmisleading-indentation]) 2022-12-30 17:32:01 +01:00
ManoloFLTK
b2a38f793f Wayland+FreeBSD: fix "test/mandelbrot crashes on rightclick" (#618) 2022-12-30 09:40:58 +01:00
ManoloFLTK
7e4306af6b Fix "Focus is lost leaving full screen on macOS 13" (#608) 2022-12-29 15:54:32 +01:00
Albrecht Schlosser
78cf29ba29 Improve and extend fl_contrast() (#370)
- Add internal fl_contrast_cielab() as the new default.
- Keep old function as internal fl_contrast_legacy().
- Add fl_contrast_mode() to switch between fl_contrast() functions.
- Add fl_contrast_level() to fine tune fl_contrast() per mode.
- Add option to register and use a custom contrast function.
- Add test/contrast.cxx test program.
- Move all fl_contrast() related code to a new file src/fl_contrast.cxx.
- Add fl_lightness() convenience function for perceived lightness.
- Add fl_luminance() convenience function for physical luminance.
2022-12-28 18:16:23 +01:00
ManoloFLTK
31327cd649 Fix for Two compiler warnings (#615) - cont'd
The Page_Format and Page_Layout  enums have been conceived for them to be combinable
into a single int value.
2022-12-28 16:58:52 +01:00
ManoloFLTK
72b8054ecc Fix compiler warnings on Windows with mingw-w64 CMAKE_CXX_STANDARD=20 (#615) 2022-12-28 09:32:01 +01:00
ManoloFLTK
7601bd832c Wayland: remove un-needed #include directives 2022-12-28 09:08:52 +01:00
ManoloFLTK
bb96cfac44 Wayland: remove un-necessary Fl_Wayland_Gl_Window_Driver::gl_event_queue 2022-12-28 08:55:02 +01:00
ManoloFLTK
86adfe0dbe Wayland: simplify function struct wl_display *fl_wl_display() 2022-12-28 08:43:22 +01:00
Albrecht Schlosser
b6cdb8ef25 Fix doxygen warnings (typos in argument names) 2022-12-27 19:26:34 +01:00
ManoloFLTK
e73b2da5e4 Wayland: Dropdown menu moves when navigated (#613) - cont'd
Menu windows containing sub-menus are now processed differently.
2022-12-27 13:15:31 +01:00
ManoloFLTK
694df9d7e6 Wayland: Fix for "Dropdown menu moves when navigated" (#613)
This commit uses Wayland popup positionning methods to handle common
menu windows and prevents them from expanding below display bottom or above top.
The previous algorithm remains in place for menu windows higher than
the display height. Further changes for these big menus may come later.
2022-12-26 08:13:27 +01:00
ManoloFLTK
b26db74dd0 Fix for "Fatal error while communicating with the Wayland server" (#610)
This commit should fix: once the mouse leaves the app window area and returns back to it
(app loses focus and gets it again) the crash happens.
2022-12-24 11:13:02 +01:00
Matthias Melcher
6ea1f73d93 Missing parentheses 2022-12-22 00:33:08 +01:00
Matthias Melcher
d98c663893
Fix compilation on old gcc (#606)
* Fixing char* use in FLUID
* Fixing const cast
2022-12-22 00:18:01 +01:00
Albrecht Schlosser
1d212b7a03 Clean up class Fl_String (part of issue #601)
- remove static variable 'string_count'
- improve and document methods debug() and hexdump()

This commit does not resolve issue 601 but removes some development
leftovers.

Methods debug() and hexdump() left for debugging as requested.
2022-12-20 20:05:15 +01:00
Albrecht Schlosser
004ea67203 Update dependencies, remove trailing whitespace 2022-12-19 15:23:20 +01:00
Albrecht Schlosser
62f68128bf Fix compiler warning (unused variable) 2022-12-19 15:21:38 +01:00
ManoloFLTK
84c5992d9f Complete Fl_Cairo_Graphics_Driver::restore_clip()
The driver's clip_ member was not updated to the new Cairo clip state
which rendered function Fl_Cairo_Graphics_Driver::clip_box() inaccurate.
2022-12-19 10:22:22 +01:00
Greg Ercolano
e7630e045a Added ansi_show_unknown(bool) (default off)
It may be useful to some to have the terminal emit an error character
to show unknown escape sequences. Off by default, unknown escape sequences
are silently ignored. If enabled, '¿' is inserted instead.
2022-12-18 13:21:22 -08:00
ManoloFLTK
b246b6650a Fix "link errors connected with recent Zenity dialog feature" (#602) 2022-12-18 09:29:37 +01:00
Greg Ercolano
993b7da3b5 ESC sequences can traverse append(), unicode support for backspace
This is basically a rewrite of the ESC handler, keeping state
in the class, so ESC sequences can continued between called
to append() (such as when reading data from a pipe in blocks).

New private class 'Fl_Escape_Seq' handles parsing and state info.
It also has careful bounds checking during parsing.

Backspace supports Unicode, and the unicode chars can straddle
across append() operations as well.

Private variables in Fl_Simple_Terminal renamed _xxx to xxx_
to improve CMP compliance.
2022-12-17 20:53:54 -08:00
Matthias Melcher
8586c257ab Update SVG binary constructor documentation 2022-12-17 23:44:42 +01:00
ManoloFLTK
b9852ff58f Add cross-platform fl_close_fd(int fd) to close a file descriptor 2022-12-17 19:13:30 +01:00
ManoloFLTK
5b6d5f9279 Remove further unused code after 12da87b 2022-12-17 19:12:53 +01:00
ManoloFLTK
2c1bb09578 Remove useless Fl_System_Driver members after 12da87b 2022-12-17 18:20:53 +01:00
Matthias Melcher
12da87ba0c
Adding length checks for in-memory image data (see #542) (#592)
SVG is now decompressed in memory
Bitmap invalid array length handling to return an error
RGB Image data reader to return error if image data is too short
FLUID: Add size argument to bitmap and JPEG data
2022-12-17 16:01:35 +01:00
Greg Ercolano
118bf55c38 Added backspace handling to simple terminal ansi() mode
This addresses a comment from MoAlyousef in issue #577
	on 12/15/2022 requesting backspace processing.
2022-12-16 10:48:32 -08:00
ManoloFLTK
41f37613ec Derive Fl_Zenity_Native_File_Chooser_Driver from Fl_Kdialog_Native_…
Also add Fl::option(OPTION_FNFC_USES_ZENITY)
2022-12-16 16:21:23 +01:00
Trent McPheron
576271fb04 Add Zenity-based file chooser based on the KDialog one (HugLifeTiZ)
If available, it is used on Linux regardless of the current desktop because
it offers free XDG portal integration, which means it picks the correct file
chooser on all desktops, and allows for meaningful file selection in sandbox
environments like Flatpak.
2022-12-16 16:21:23 +01:00
ManoloFLTK
2ddb27f0f2 Fix for "Recent macos build issues" (#598) 2022-12-16 08:06:41 +01:00
Albrecht Schlosser
44a2547394
Rename some Fl_Flex methods for FLTK compliance (#594)
Change some method names to comply with FLTK style as discussed
in fltk.coredev, thread "Fl_Flex method name question".

* Rename Fl_Flex::margins(...) to Fl_Flex::margin(...)
  (use singular form for all margin related methods)

* Remove Fl_Flex::setSize() and isSetSize() "backwards compatibility" methods

* Rename Fl_Flex::set_size(...) to fixed(...)

Note: the latter affects existing (pre-release) fluid (.fl) files: you may
  want to edit and replace "set_size_tuples" with "fixed_size_tuples"
2022-12-15 16:46:40 +01:00
ManoloFLTK
2fd1866f49 macOS: Add "Show hidden files" button to native file chooser 2022-12-15 12:10:41 +01:00
Albrecht Schlosser
64d8c913be Fix trailing whitespace and dependencies 2022-12-13 15:58:56 +01:00
Albrecht Schlosser
b82ea16d69 Fix compiler warning [-Wmaybe-uninitialized]
Fl_BMP_Image.cxx:228:30: warning: ‘width’ may be used uninitialized in this function
  228 |       int maskSize = (((width*Bpp+3)&~3)*height) + ...
      |                         ~~~~~^~~~
2022-12-13 15:51:54 +01:00
Matthias Melcher
a5adbd99ca
Add option to bind images to a widget (#589)
Adding image binding to FLUID as well
2022-12-10 23:22:24 +01:00
ManoloFLTK
8dcd121d44 Text positioning different in 1.4.x vs 1.3.x (#568) - cont'd
@wcout reports that we get better results if function pango_font_metrics_get_height()
is not used until version 1.50.6 and above of libpango. The difference is specially visible
with underscore characters in unscaled, standard DPI displays. This commit does that.
2022-12-10 19:00:09 +01:00
Matthias Melcher
a23c77c5a1
Defer opening the display as much as possible (#586) 2022-12-10 16:21:07 +01:00
Matthias Melcher
60d6e9be14 Fixes some VC compiler warnings 2022-12-10 16:03:29 +01:00
Albrecht Schlosser
8dea6505e9 Windows: fix memory leak caused by RegisterDragDrop (#569)
- call RevokeDragDrop() when the window is hidden
- do not delete the *static* FLDropTarget object
2022-12-10 15:03:30 +01:00
Matthias Melcher
5673072271
Fixes OpenGL complex polygons when scaling (#576)
Also fixes gap()
2022-12-10 13:10:36 +01:00
ManoloFLTK
df059de37e "Public members Fl::awake_ring_*_ should be private" (#559) - cont'd 2022-12-10 10:19:54 +01:00
Albrecht Schlosser
ceb268fd34 Suppress (GitHub CI/wayland) compiler warning
[ 15%] Building CXX object src/CMakeFiles/fltk.dir/Fl_Text_Display.cxx.o
.../fltk/src/Fl_Text_Display.cxx: In constructor ‘Fl_Text_Display::Fl_Text_Display(int, int, int, int, const char*)’:
.../fltk/src/Fl_Text_Display.cxx:122:57: warning: ‘void* __builtin_memset(void*, int, long unsigned int)’ writing between 4 and 8589934584 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
  122 |     for (int i=1; i<mNVisibleLines; i++) mLineStarts[i] = -1;
      |                                          ~~~~~~~~~~~~~~~^~~~
.../fltk/src/Fl_Text_Display.cxx:120:39: note: at offset 4 into destination object of size 4 allocated by ‘operator new []’
  120 |   mLineStarts = new int[mNVisibleLines];
      |                                       ^

This warning is IMHO obsolete because the code in question should not
be executed at all (mNVisibleLines == 1). However, the compiler seems
to substitute this with '__builtin_memset(...)' and analyzes "correctly"
that memory at offset 4 would be overwritten but not that the written
size would be 0.

The "fix" uses a compiler macro and #if to clarify that this code must
not be executed and should not be compiled (see comment why this code
exists).
2022-12-09 18:56:09 +01:00
ManoloFLTK
59be6a7ef9 Fix for "Public members Fl::awake_ring_*_ should be private" (#559) 2022-12-09 18:50:04 +01:00
ManoloFLTK
36ef15963a Comment only: put Fl_Display_Cairo_Graphics_Driver in class hierarchy 2022-12-09 18:47:55 +01:00
ManoloFLTK
eb2572deaf Add new Wayland-specific fl_wl_compositor() function 2022-12-09 17:06:35 +01:00
wcout
632661fa64 Fix Fl_Text_Display drawing of line numbers (#578)
The formerly undrawn rectangle beneath (or above) the line numbers is now filled with FL_BACKGROUND_COLOR.
Additionally the small rectangle between the scrollbars is now filled with FL_BACKGROUND_COLOR instead of FL_GRAY for consistency.
2022-12-09 16:55:06 +01:00
ManoloFLTK
36cd0a397c New Fl_ICO_Image class to read Windows .ico icon files
Many thanks to @darealshinji for contributing all the code
for this new FLTK image class (see branch Fl_ICO_Image of https://github.com/darealshinji/fltk).
2022-12-09 10:43:20 +01:00
Albrecht Schlosser
0bb30d8f92 Fix typo in comment 2022-12-08 20:40:03 +01:00
Albrecht Schlosser
823dc5acc4 Fix compilation warning, update dependencies
Warning: variable ‘j’ set but not used [-Wunused-but-set-variable]
2022-12-08 19:09:18 +01:00
ManoloFLTK
b9a9f7f10c Simpler prototype of Fl_Wayland_Graphics_Driver::buffer_commit() member - cont'd 2022-12-08 15:22:08 +01:00
ManoloFLTK
503492db78 Simplify prototype of Fl_Wayland_Graphics_Driver::buffer_commit() member 2022-12-08 10:16:06 +01:00
ManoloFLTK
cbd37a2870 Wayland: fix progressive drawing as in test/mandelbrot 2022-12-07 08:46:50 +01:00
ManoloFLTK
90c7e6bcb1 Fix issue #537 without damaging test/mandelbrot 2022-12-06 14:46:11 +01:00
Matthias Melcher
0d485b34a2
Fixing fl_complex_polygon() compilation for WIN32 (#571) 2022-12-05 19:57:30 +01:00
Matthias Melcher
9f92972729
Implement fl_complex_polygon() for OpenGL (#570) 2022-12-05 19:27:12 +01:00
ManoloFLTK
a8923a0fd4 Wayland: remove regression in mandelbrot introduced by 1a5d657
The panel was drawn solid black when test/mandelbrot was unfocussed.
2022-12-04 12:29:24 +01:00
ManoloFLTK
1b938ab8b1 Fl_Cairo_Graphics_Driver: simpler way to construct font from name+size 2022-12-04 09:31:24 +01:00
ManoloFLTK
70e19a9e00 Fix dotted line drawing under Cairo graphics driver 2022-12-03 06:38:25 +01:00
ManoloFLTK
e5c3caeb6b Fix text drawn by pango is offset +1 pixel on x and y) (#568) 2022-12-02 16:14:38 +01:00
Matthias Melcher
bf825f8ebd
Add a unit test for drawing complex shapes (#565) 2022-11-30 22:40:52 +01:00
ManoloFLTK
bc3bbb7ca0 Remove useless fl_matrix member variable of class Fl_Graphics_Driver 2022-11-30 18:57:39 +01:00
ManoloFLTK
67817f696c Remove small files fl_XXX_gl_platform_init.cxx
The single-function content of these files is moved to Fl_XXX_Gl_Window_Driver.cxx.
2022-11-30 17:51:35 +01:00
ManoloFLTK
00884f28e2 Fix for issue [Cairo]: Arrows have a "gap" (#561)
The problem to fix is that the arrow drawn by draw_arrow1() in src/fl_symbols.cxx
displays a faint clear line between the stem and head of the arrow with the Cairo
graphics driver.

This occurs because draw_arrow1() draws the arrow in 2 steps (a rectangle +
a triangle) and the Cairo driver is configured to use antialiasing when filling
polygons. The antialiasing produces the faint line between stem and head.

Why does draw_arrow1() draw a rectangle + a triangle rather than a
7-vertex polygon? That's because the X11 graphics driver fails with its polygon-
drawing function when the polygon is also rotated: the polygon is drawn
empty.

We want to keep using antialiasing under Cairo for polygons because
the result is better with non horizontal/vertical polygon edges.

This implementation changes function draw_arrow1() which draws
the arrow as a 7-vertex filled polygon except when the graphics driver
returns false for its virtual member function can_fill_non_convex_polygon().
In that situation, draw_arrow1() draws, as before, a rectangle + a triangle.
The new, virtual member function can_fill_non_convex_polygon() returns
true except for the X11 graphics driver. Therefore, draw_arrow1() is effectively
unchanged under the X11 driver.
2022-11-29 12:28:31 +01:00
ManoloFLTK
7a42a80caf Undoing commit at f7a1777 that breaks X11 drawing
Under X11, rotated arrows loose their inside color with f7a1777
2022-11-29 10:46:39 +01:00
ManoloFLTK
f7a1777017 Fix for issue: Arrows have a "gap" (#561) 2022-11-29 09:47:08 +01:00
ManoloFLTK
401b3dc008 Doc: repeat that screens are numbered starting from 0 in the API 2022-11-28 10:08:44 +01:00
Matthias Melcher
c827292ec9 Fix forgotten name change 2022-11-27 15:35:50 +01:00
ManoloFLTK
acf7254fe8 macOS+OpenGL3: remove "warning: gl.h and gl3.h are both included" 2022-11-27 08:06:33 +01:00
Albrecht Schlosser
8ec935b4ce Simplify and improve "oxy" arrow drawing functions
- change drawing arrows from lines to polygons
- remove superfluous functions
- add more comments
2022-11-26 21:56:38 +01:00
Matthias Melcher
87fe29372c
Local undo per Fl_Text_Buffer and Fl_Input_ (#557) 2022-11-26 20:28:12 +01:00
Albrecht Schlosser
191aeefc4a Make the value box size of Fl_Value_Slider user settable (STR 3222)
For a very simple test program see STR 3222, File 2:
https://www.fltk.org/strfiles/3222/value_slider.cxx

Known issues:
 - range checking of the value box size is very limited
 - resizing the widget does not change the value box size
 - drawing issues are possible if the value box size and the widget
   size are not compatible (e.g. value box too large)
2022-11-26 19:56:32 +01:00
Matthias Melcher
6e5c472cf9
Handle Fluid project settings better (#556)
Fix allocation bug in Fl_String
2022-11-26 01:35:50 +01:00
ManoloFLTK
4de491d02e Make Fl_XXX_Graphics_Driver::create_bitmask() a static member function 2022-11-25 15:53:28 +01:00
Albrecht Schlosser
cda501f914 Fix silly Visual Studio compiler warnings in oxy scheme 2022-11-25 15:09:30 +01:00
Matthias Melcher
ffc2caea07 Avoid thin gray line in round box in hires 2022-11-25 12:53:54 +01:00
Matthias Melcher
09697c4738 Fix GDI graphics driver use for bitmasks 2022-11-25 10:52:46 +01:00
Albrecht Schlosser
b1ba37c5ba Add "Oxy" scheme (STR 2675, STR 3477)
This commit is similar to the patch given in STR 3477, oxy_v5.diff:
https://www.fltk.org/strfiles/3477/oxy_v5.diff

... with modifications, and updated to current FLTK code.
2022-11-25 00:00:48 +01:00
Albrecht Schlosser
40f376a6f7 Fix two new Visual Studio compiler warnings 2022-11-24 17:29:26 +01:00
ManoloFLTK
c3011e32e4 Improve text drawing above GL3 scene under macOS 2022-11-24 15:48:39 +01:00
ManoloFLTK
be0f06e791 Remove two "warning: pointer xxx used after void* realloc()" messages 2022-11-24 14:35:47 +01:00
Albrecht Schlosser
c1ba9f31ec Fix two Visual Studio compiler warnings
+ fix trailing whitespace (fluid)
2022-11-24 12:51:26 +01:00
Matthias Melcher
b16309f13e
Refactor code to make rounded rectangles accessible (#553)
This adds fl_rounded_rect and fl_rounded_rectf so the
user can draw rounded rectangles. This uses existing and
optimised code that is rearranged.
2022-11-24 12:47:49 +01:00
Matthias Melcher
12dccaf711
Check boundary conditions in Cocoa scroll code (#554) 2022-11-24 12:44:08 +01:00
ManoloFLTK
e19d2d98ba OpenGL3 under macOS: simpler implementation of support of child widgets 2022-11-24 09:13:40 +01:00
ManoloFLTK
b6c5de7c05 Restore build with HAVE_GL = 1 and HAVE_GL_GLU_H = 0 2022-11-23 18:12:33 +01:00
ManoloFLTK
27a6fd9609 Configure-based build: control presence of GL-related packages 2022-11-23 17:24:59 +01:00
Albrecht Schlosser
b684f70ad7 Update remaining "arrow drawing" in menus
Use the new standard arrow drawing methods (whose style depends on
the active scheme) for "arrows" used in Fl_Menu and Fl_Menu_Button.

To do: maybe we need some "fine tuning" of arrow sizes in some of
the modified widgets using the new "arrow drawing" methods.
2022-11-23 15:21:34 +01:00
Albrecht Schlosser
5e4643621b Save and restore current color when drawing arrows
Make sure we don't change the current color after we finish drawing.
2022-11-23 15:21:34 +01:00
Albrecht Schlosser
bd18d9de26 Fix border size of FL_PLASTIC_UP_BOX 2022-11-23 15:21:34 +01:00
Matthias Melcher
35f2827d1f
Keep indicator that menubar is still active (#551) 2022-11-23 12:33:14 +01:00
ManoloFLTK
42b74919e5 Improve Fl_Cocoa_Gl_Window_Driver::switch_to_GL1() to support multiple GL3 windows 2022-11-23 11:59:49 +01:00
Matthias Melcher
73b24c2104
Add missing FL_RELEASE event after dnd() (#549)
On X11, FLTK would not send a required FL_RELEASE
event to the data source window.
2022-11-23 10:33:34 +01:00
ManoloFLTK
d215ddef81 Fix for issue #412 for the Wayland backend
The problem was that after a drag-n-drop within a window, text selection
by shift+arrow key stopped working.

Also, improves drag-n-drop within a window by leaving insertion point
at end of dragged text.
2022-11-23 09:33:41 +01:00
ManoloFLTK
4dcced5b29 Wayland+CMake: stop forcing GTK_FOUND to 0
This removes the cause of this developer's message
  # FIXME: This needs to be redesigned! Forcing GTK_FOUND to 0 (NO) is a bad
  # FIXME: idea because there could be unwanted side effects. AlbrechtS
2022-11-23 05:59:57 +01:00
Albrecht Schlosser
39bb38447b Update dependencies 2022-11-22 19:35:34 +01:00
Albrecht Schlosser
ecc47d0cc3 Refactor and simplify "arrow drawing" in widgets
"Arrows" in widgets are those GUI elements mostly represented by
triangles pointing in a particular direction as in scrollbars,
choice widgets, some menus, valuators and Fl_Counter widgets.

The code has been simplified and standardized such that all these
GUI elements are drawn identically per FLTK scheme.

Widget authors no longer need to write code to calculate arrow sizes
and draw polygons etc.

Different schemes can and do implement different drawing functions.

Todo: see comments "FIXME_ARROW" in src/Fl_Menu_Button.cxx and
      src/Fl_Menu.cxx
2022-11-22 19:32:54 +01:00
ManoloFLTK
4daec2a940 macOS: Fix release of extra NSView holding child widgets of GL window 2022-11-22 19:18:29 +01:00
Matthias Melcher
495b2395c1
Fix selection extension in Fl_Text_*, issue 196 (#550)
Selecting a text range programmatically would not sync
some variables with the actual selection. This also fixes
a crash bug in macOS when dragging text that was
selected by buffer()->select() only.
2022-11-22 16:18:56 +01:00
Albrecht Schlosser
be928430a6 Fix Fl_Group::insert() and Fl_Scroll::on_move() 2022-11-20 14:11:19 +01:00
ManoloFLTK
8a53fc9611 Replace #if FLTK_USE_X11 by #ifdef FLTK_USE_X11 2022-11-20 07:33:08 +01:00
ManoloFLTK
615b731783 CMake+Wayland: check for presence of required software modules
Also, remove hardcoded path to wayland-protocols when
CMake version ≥ 3.4
2022-11-18 09:10:22 +01:00
Matthias Melcher
72415b534d
Fix rearranging children in Fl_Scroll (#546)
Implement Fl_Scroll::on_move()
Fix indexing in Fl_Group::on_move()
2022-11-17 08:34:06 +01:00
ManoloFLTK
402764f5c1 Remove development stage "Using Wayland backend" message 2022-11-17 07:31:37 +01:00
ManoloFLTK
167a3268c9 Fix "Cairo: Scaled images draw with wrong size" (#537) 2022-11-17 07:14:20 +01:00
Albrecht Schlosser
624eda17bc Fix whitespace errors and dependencies
(no code changes)
2022-11-16 21:10:14 +01:00
ManoloFLTK
7f8f7c5b85 Add support of .svgz image files to fluid
The  prototype of the public Fl_SVG_Image constructor is expanded
to allow construction from in-memory, gzip'ed binary data.
2022-11-15 10:09:01 +01:00
Albrecht Schlosser
d1054c5f6c Fix yet another Visual Studio compiler warning 2022-11-14 19:08:02 +01:00
Matthias Melcher
350038983f Removed FIXME comment that was already solved. 2022-11-12 15:19:08 +01:00
Albrecht Schlosser
8d636d931e Fix Visual Studio compiler warnings 2022-11-11 19:27:00 +01:00
Albrecht Schlosser
74b9d5fb05 Remove redundant doxygen docs of fl_beep()
Also add a comment to all platform driver implementations.
2022-11-11 16:52:08 +01:00
Albrecht Schlosser
a3a60ed27c Improve and clarify documentation of fl_beep() 2022-11-11 16:43:33 +01:00
ManoloFLTK
f41861976b Wayland: remove unneeded friend declarations 2022-11-09 15:49:02 +01:00
Matthias Melcher
3ff8a4ae8a Fixed uninitialised variable. 2022-11-09 01:34:52 +01:00
ManoloFLTK
1a41178e77 Wayland: improve processing of the -display command line argument 2022-11-08 08:16:55 +01:00
ManoloFLTK
402b08cb6e Wayland: show keyboard modifiers during mouse clicks (#534) 2022-11-08 08:09:12 +01:00
ManoloFLTK
9c793a383f Wayland: cancel drag-n-drop after Fl::pushed(0) (#525) 2022-11-08 07:22:16 +01:00
Greg Ercolano
d68f927a13 Document Fl_Multiline_Output keynav and caret cursor 2022-11-07 17:08:14 -08:00
Greg Ercolano
89e1aad897 Removed an obsolete \warning. 2022-11-07 11:28:52 -08:00
Greg Ercolano
2a43a12b7b Added empty(), ensure size() enlarges new vals = 0 2022-11-07 10:33:35 -08:00
ManoloFLTK
38536d8918 Fix initialisation of hybrid Wayland/X11 platform
Also, terminate Wayland drag-and-drop operation after Fl::pushed(0).
2022-11-07 09:02:22 +01:00
ManoloFLTK
089584da9f Remove Fl_X11_System_Driver.{H,o} 2022-11-07 07:08:42 +01:00
ManoloFLTK
6e9f72adce Delete src/drivers/X11/Fl_X11_System_Driver.* 2022-11-07 06:54:09 +01:00
ManoloFLTK
c6a854ef91 Delete src/drivers/Wayland/Fl_Wayland_System_Driver.* 2022-11-07 06:50:59 +01:00
ManoloFLTK
37bf3835b0 Create class Fl_Unix_Screen_Driver used by X11 and Wayland platforms 2022-11-07 06:49:40 +01:00
Greg Ercolano
8b72f0c668 Add doxygen docs for Fl_Int_Vector.
While adding the docs, noticed some things that need modification
for proper public use. These are highlighted as \todo items and
\warning items, which will be fixed in a separate commit forthcoming. -erco
2022-11-06 20:21:46 -08:00
DieSkaarj
38d40365f8
Check for child visibility in Fl_Scroll (#432)
Calculate scroll area only according to visible children.

Note: "visible" means in this context: "not hidden" - as opposed
to being invisible because the widget doesn't have a background
and a label.
2022-11-06 18:34:42 +01:00
Albrecht Schlosser
f904f4c4ec Fix Fl_Help_View <OL> numbers (Issue #153, STR 3290)
Started with @wcout's patch (see Issue #153, STR 3290), modified
patch for CMP conformance, restructured methods, and finally:

- used Fl_Int_Vector instead of 'fl_data_container'
- removed fl_data_container

Thanks for the working patch to @wcout.
2022-11-06 16:40:17 +01:00
Albrecht Schlosser
bb7129dae2 Use the new Fl_Int_Vector class in Fl_Table
Replace local IntVector with Fl_Int_Vector
2022-11-06 16:32:29 +01:00
Albrecht Schlosser
8b92935b1e Add Fl_Int_Vector: "an STL-ish vector without templates"
Code copied from Fl_Table and reformatted.

Thanks to Greg for the original code.
2022-11-06 16:32:29 +01:00
ManoloFLTK
44219594d1 Check return value from call to gtk_init_check() 2022-11-06 08:11:05 +01:00
ManoloFLTK
6ccd71697d Allow using native file chooser on Darwin + XQuartz + (homebrew or fink) 2022-11-06 07:58:38 +01:00
ManoloFLTK
4b945a3086 Wayland/X11 hybrid: use "bool fl_disable_wayland;" declaration. 2022-11-05 19:47:37 +01:00
Albrecht Schlosser
b426a3d7c0 Fix two rare potential bugs (NULL pointer dereferencing)
Both bugs can happen if a widget doesn't have an associated window()
or in similar situations. These fixes returns NULL to prevent crashes.

Bugs observed in special test scenarios, not real-life programs.
2022-11-05 19:31:59 +01:00
ManoloFLTK
918395e091 Wayland: simpler handling of the z-order of subwindows
It's not necessary to call wl_subsurface_place_above() because
"A new sub-surface is initially added as the top-most in the stack of its siblings and parent."
2022-11-05 15:28:39 +01:00
ManoloFLTK
425bd5865d Wayland DnD: make insertion cursor follow DnD cursor. 2022-11-04 15:06:45 +01:00
ManoloFLTK
eb679f99a8 Wayland DnD: allow cancel with Fl::pushed(0) as under X11 (#525)
This is a partial fix of issue #525 that reproduces under Wayland the "unofficial",
X11-specific way to cancel a Dnd operation by calling Fl::pushed(0).
2022-11-04 12:37:26 +01:00
Albrecht Schlosser
2446ec5d62 Implement Fl_Scroll::on_insert()
This fixes the scrollbar order when children are inserted rather than
at some indefinite time later, for instance in draw().

This commit will very likely make Fl_Scroll::fix_scrollbar_order()
obsolete but this method is kept as is for tests and verification.
2022-11-03 19:11:59 +01:00
Albrecht Schlosser
0ebb113584 Implement destructor of Fl_Scroll and fix inconsistencies 2022-11-03 18:58:28 +01:00
ManoloFLTK
a5d2b5ed45 libdecor: update from source git repo (commit e87dcfda)
This brings the GTK plugin inside the master libdecor git repo.
2022-11-03 08:16:49 +01:00
Matthias Melcher
33f01ecb83
Added Fl_Group::on_insert/on_remove/on_move (#527) 2022-11-01 20:45:31 +01:00
Albrecht Schlosser
c570bd8f96 Fix trailing whitespace 2022-11-01 20:06:22 +01:00
Albrecht Schlosser
414ad1dce7 Remove unnecessary include files, update dependencies 2022-11-01 20:04:37 +01:00
Albrecht Schlosser
a09b0e2357 Remove reversal of children in Fl_Group::clear()
See implementation note in src/Fl_Group.cxx: Fl_Group::clear().
2022-11-01 17:25:07 +01:00
Matthias Melcher
93ea93ee2b
Fluid support for Fl_Flex (#523) and some Fl_Flex improvements
* Adding Fluid support for Fl_Flex, margins, and gap.

* Fluid Fl_Flex mostly working. Fixed in Fl_Flex::set_size().

* Fluid Flex live mode works, interactive dragging works

* Fluid Flex: adding check box for fixed children

* Fluid Flex: visual flexibility indicator in guides.

* Fluid Flex: bug in generated code.

* Fix formatting

* Fixing Tooltip, fixing resize issue PR #518.

* Removing unused variables.

Co-authored-by: Albrecht Schlosser <albrechts.fltk@online.de>
2022-11-01 13:30:05 +01:00
ManoloFLTK
31ec6f623a Wayland platform: fix problem with fl_pie() (#512 - cont'd) 2022-10-30 11:46:08 +01:00
ManoloFLTK
7403e333da Wayland platform: fix problem with fl_pie() (#512 - cont'd) 2022-10-30 11:33:10 +01:00
Albrecht Schlosser
a918292547 Fix removal and deletion of the resizable() of Fl_Group
If the resizable() of an Fl_Group is deleted it is automatically
removed from the group.

New: to avoid dangling resizable() pointers the resizable widget
is set to the group itself.
2022-10-28 17:37:18 +02:00
ManoloFLTK
f9acdb6edb Repair commit e0c3fe9 to fix #521 which destroyed DnD from Wayland
It turns out it's necessary to memorize 2 event serial numbers :
- serial changed at each pointer and key event;
- pointer_enter_serial changed when pointer enters a surface
because this one and not any other is needed for exact cursor changes
by wl_pointer_set_cursor() in do_set_cursor().
2022-10-25 19:08:12 +02:00
ManoloFLTK
84cdc1ba12 Fix drag-n-drop from X11 FLTK app to Wayland app (#519) 2022-10-25 15:00:51 +02:00
ManoloFLTK
e0c3fe939f Fix problem with cursor point of action after FL_PUSH (#521) 2022-10-25 10:44:36 +02:00
ManoloFLTK
b0d4c2fd4c Include stdint.h may be needed for uint32_t (#522) 2022-10-24 05:30:33 +02:00
ManoloFLTK
e69d45cde8 Make Fl::display(const char *) active also for the Wayland platform. 2022-10-23 12:19:44 +02:00
Albrecht Schlosser
da11526bb8 Improve and clarify documentation of timeout functions
Some functions didn't document the handling of arguments properly,
particularly Fl::has_timeout() and Fl::remove_timeout().

This is now fixed by documenting the correct behavior that was
preserved (re-implemented) from FLTK 1.3.x in the new class Fl_Timeout.

Unfortunately there have been some inconsistencies (likely unexpected
behavior) which have been preserved and which are now documented.
2022-10-20 19:36:03 +02:00
ManoloFLTK
eca61ab98a Wayland drag-n-drop: send FL_DND_LEAVE when the dragging mouse leaves the window 2022-10-20 08:30:54 +02:00
ManoloFLTK
24c63c0774 Wayland drag-n-drop: handle subwindows as other platforms do (#516)
The d-n-d target window is now always the top-level window even if the
mouse is over a subwindow. That's what all other platforms do.
Global var fl_dnd_target_surface memorise what's the current d-n-d target
surface and follows changes from top-window to subwindows.
2022-10-19 12:28:04 +02:00
ManoloFLTK
857462529b Allow DnD from Wayland FLTK app to X11 FLTK app (#516) 2022-10-17 19:16:01 +02:00
ManoloFLTK
a944758aea Wayland drag-n-drop to Fl_Window: send necessary FL_ENTER event (#516)
Drag-n-drop under Wayland was OK in general except when the drop target is an Fl_Window
because the belowmouse object is not set in this configuration.
Processing an FL_ENTER event before the FL_DND_RELEASE event fixes that.
2022-10-17 10:32:41 +02:00