Commit Graph

10239 Commits

Author SHA1 Message Date
ManoloFLTK
82ac84a7c8 Fix "undefined reference to png_init_filter_functions_vsx" (#652)
Add two auxiliary source files needed to properly build libpng
for the ppc64 architecture.
2023-01-14 09:10:35 +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
a29c0e36fd Add Fl_Scheme_Choice to examples/tree-custom-draw-items
- add Fl_Scheme_Choice widget for quick scheme selection
- fix label alignment of selection box
- set selection_color()
- set selectbox()
- make the tree the resizable() of the window
2023-01-12 19:21:09 +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
Matthias Melcher
76a5c7b081 FLUID: Fix wrong use of Fl_Scroll::position() 2023-01-12 14:38:11 +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
8235967dcc Fix "Compilation warning: 'NSOpenGLContext' on macOS 11" !#646) 2023-01-11 09:32:31 +01:00
Matthias Melcher
f576faf2a6 Fix new warnings in CI 2023-01-10 17:07:03 +01:00
Albrecht Schlosser
5e133c1e88
CI: Enable compiler warnings in CI builds (#648)
'-Wall -Wunused -Wsuggest-override'
depending on the C++ standard, either
- C++98 (Linux/X11)
- C++11 (Linux/Wayland)
- C++20 (macOS)
2023-01-10 16:31:49 +01:00
Matthias Melcher
cf2d2fc5e0 Fix compiler warning in test/tabs 2023-01-10 15:20:05 +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
Greg Ercolano
1324c623fe Add new Fl_Rect::inset(lt,top,rt,bot) method 2023-01-08 09:42:58 -08: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
Greg Ercolano
69773338b9 Include OS error if reap_editor() fails 2023-01-05 15:46:33 -08: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
9ef9bbe80e
Adding color to test/mandelbrot (#634) 2023-01-05 14:10:46 +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
Albrecht Schlosser
b5b88d5f0d Remove unused variable, fix "type issue" (#445, part 2)
This commit removes the unused variable as suggested in the discussion
of issue #445: "type issue in fluid/ExternalCodeEditor_WIN32.cxx"

... although the compiler would remove it anyway. ;-)
2023-01-04 20:25:49 +01:00
ManoloFLTK
ae240340ab Fix for "Fl_Native_File_Chooser_MAC.mm compilation warning" (#627) 2023-01-04 18:02:29 +01:00