Commit Graph

6835 Commits

Author SHA1 Message Date
ManoloFLTK be07e5448f Improve reuse of mmap'ed data by Wayland buffers 2023-09-17 13:05:50 +02:00
ManoloFLTK 824818303c Restore Doxygen doc of fl_graphics_driver 2023-09-17 09:00:48 +02:00
Albrecht Schlosser ede381c005 Fix Visual Studio shared library build
Todo: fluid-shared can't (yet) be built agains the shared fltk lib
  because of some linker errors. Needs investigation.

Note: fluid-shared is basically a test program to demonstrate linking
  against the shared FLTK libs but doesn't work yet using VS (MSVC).
  This is no problem for the functionality.
2023-09-12 23:18:46 +02:00
Matthias Melcher 5ef29202ed Fixes Fl_Tabs to be more robust.
No children in Fl_Tabs should no longer crash the draw
method. Also, drawing an Fl_Tabs with no children inside
is now defined and documented.
2023-09-06 17:02:13 +02:00
Matthias Melcher 6bb5a81cee Adds some convenience methods.
fl_filename_absolute can no generate a path using arbitrary source paths.
Fl_Menu_ adds find_item_with_user_data and find_item_with_argument
Fl_String adds find(string, start)
2023-09-05 14:45:57 +02:00
Albrecht Schlosser b2a41e08c3 Introduce Fl_Flex::need_layout() to optimize layout calculation
This is intended to reduce layout calculation and resizing of child
widgets until necessary before the Fl_Flex widget and all its
children are drawn in Fl_Flex::draw().

With this commit users no longer need to call layout() to layout the
Fl_Flex widget and its children properly unless they change widget
sizes or show/hide children.
2023-09-04 16:16:42 +02:00
Matthias Melcher 5e8adebac2 Adds compact buttons feature to create keypads.
See test/buttons for an example.
2023-09-03 00:09:40 +02:00
Matthias Melcher 502fa72eb4 #718: Fixes drawing issues for Fl_Tabs
Tabs were drawn incorrectly when children's box was not FL_NO_BOX
Current solution is cleaned up and always redraws tabs area
without leaving breadcrumbs behind
2023-09-02 20:56:57 +02:00
ManoloFLTK 2e88b5efd1 Remove Doxygen warnings in processing of class Fl_Tabs 2023-08-31 12:41:02 +02:00
Matthias Melcher 443ce62300 #718: Fixes Fl_Tabs overlapping calculations
This method should greatly improve the overlapping calculations.
Tested with super wide and super many tabs.
Also documented every method in the class.
2023-08-30 20:03:44 +02:00
Matthias Melcher b5a1da9612 FLUID: minor fixes 2023-08-29 22:50:12 +02:00
Albrecht Schlosser ad5e49464b Document some protected methods and variables of Fl_Tabs
Todo: There are more protected methods that should be documented,
particularly the virtual ones that might be overridden by subclasses.
2023-08-29 15:19:07 +02:00
Matthias Melcher 5da15de174 FLUID: simplified worker handling 2023-08-29 01:38:39 +02:00
Albrecht Schlosser d11c412f95 CMake: Make compile definitions 'FL_LIBRARY' and 'FL_DLL' private
... so they are not inherited by consumers of the library.

Remove 'add_definitions(-DFL_LIBRARY)' from src/CMakeLists.txt
  This is not necessary, see CMake/fl_add_library.cmake

Don't set obsolete property 'CLEAN_DIRECT_OUTPUT' which was removed
in CMake 2.8.0.
2023-08-28 15:21:58 +02:00
ManoloFLTK b328c1f902 Wayland.dox: some rephrasing 2023-08-28 10:16:01 +02:00
ManoloFLTK d245a157b6 Slightly simpler handle_close() in Fl_Wayland_Window_Driver.cxx 2023-08-27 16:46:16 +02:00
ManoloFLTK 7e3aabf80e Remove useless function prototype declaration 2023-08-27 08:06:16 +02:00
ManoloFLTK 2f5e1b2230 Fix typos in Doxygen text for fl_filename_absolute/relative() 2023-08-26 18:38:38 +02:00
Matthias Melcher 92ac709b7e Adds safe versions of fl_filename_*, returning Fl_String 2023-08-26 16:48:28 +02:00
Matthias Melcher 3ed43363cd FLUID: fixes file path calculation bug 2023-08-26 16:10:02 +02:00
ManoloFLTK ee0f173d9f Undo commit 5ea7a04 which requires Mutter V12
That commit's goal was to use an algorithm that does not assume
that number keys are at keycodes 10-19, which may not hold with
"special" keyboards. Unfortunately, the new algorithm requires
Mutter V12 and fails with Mutter V11, used by Debian 12.
2023-08-23 15:59:04 +02:00
ManoloFLTK c61d6bc46a Wayland: fix regression in menu positioning brought by c43cf2f 2023-08-22 15:33:13 +02:00
ManoloFLTK ac7c3297fa Undo commit 0a31225 which killed "caps lock" 2023-08-20 19:20:25 +02:00
ManoloFLTK 0a312259a2 Simpler function process_wld_key(() 2023-08-20 18:58:37 +02:00
ManoloFLTK 5ea7a0465e Wayland: process number keys independently of keyboard layout
The new algorithm supports alternate keyboard layouts, e.g., Dvorak.
2023-08-20 16:29:14 +02:00
ManoloFLTK fc339b4319 Remove redundant initialisation 2023-08-20 09:34:44 +02:00
ManoloFLTK 442faf9462 Create class function Fl_Wayland_Graphics_Driver::custom_offscreen() 2023-08-20 09:10:55 +02:00
ManoloFLTK 3384776f8e Improve handling of type Fl_Offscreen under Wayland
Type Fl_Offscreen is now to be cast to cairo_t*.
Also, make sure the dimensions of GL windows are
multiples of the screen scale factor.
2023-08-18 18:02:35 +02:00
ManoloFLTK 336bd01f16 X11 platform: give number keys layout-independent keysym's
Without this, the sudoku app is unusable with a French keyboard
2023-08-16 12:35:50 +02:00
Matthias Melcher 10d9010ed9
Improved, yet compatible, widget callback system using macros (#729)
* adds FL/fl_callback.macros.H
* adds FL_FUNCTION_CALLBACK_n(widget, function, [type, data])
* adds FL_METHOD_CALLBACK_n(widget, class, instance, method, [type, data])
* adds FL_INLINE_CALLBACK_n(widget, [type, name, data], callback_body)
* adds `examples/callback`
* full documentation
2023-08-15 11:36:58 +02:00
ManoloFLTK e6440ca0a8 Wayland mouse wheel support: compositors can behave differently 2023-08-15 08:44:53 +02:00
Albrecht Schlosser 3c7610ec23 Handle shift + mousewheel event on Wayland (STR 3521)
Pressing the shift key while using the mousewheel changes
horizontal to vertical scrolling and vice versa. This allows users
with a standard mouse with only one scrollwheel to use it for both
scrolling directions.

This concludes "handling shift + mousewheel" for all supported platforms.
2023-08-14 16:57:33 +02:00
Albrecht Schlosser 847901623a Handle shift + mousewheel event on Windows (STR 3521)
Pressing the shift key while using the mousewheel changes
horizontal to vertical scrolling and vice versa. This allows users
with a standard mouse with only one scrollwheel to use it for both
scrolling directions.

Note: other mice that have either two buttons or a scroll ball can
generate both horizontal and vertical scrolling in one action. This
commit does not affect such behavior.

This patch is different than the one in file 'scroll.patch' (STR 3521).
It takes care of distinct mousewheel delta calculation for vertical
and horizontal mousewheels and avoids the "fallthrough" case.

Note: macOS takes care of this, there's no special handling required.

To do: the Wayland platform still needs to be updated.
2023-08-13 17:44:00 +02:00
Albrecht Schlosser 8c5c7aa7f4 Handle shift + mousewheel event on Linux (STR 3521)
Pressing the shift key while using the mousewheel changes
horizontal to vertical scrolling and vice versa. This allows users
with a standard mouse with only one scroll button to use it for both
scrolling directions.

Note: other mice that have either two buttons or a scroll ball can
generate both horizontal and vertical scrolling in one action. This
commit does not affect such behavior.

This patch has been provided by Manolo in file 'scroll.patch'
(see STR 3521).
2023-08-13 17:07:26 +02:00
Matthias Melcher 5e484524c8 Fl_Tabs now supports horizontal mouse wheel events. 2023-08-13 14:32:41 +02:00
Aditya Siram 17d0a4cc5f Fix access to Cairo context. 2023-08-12 23:18:09 +02:00
Albrecht Schlosser 76fb2d5b79 Reformat code, remove obsolete comments
No effective code changes, i.e. only formatting, indents and comments.
2023-08-10 15:40:45 +02:00
Albrecht Schlosser dbb77b9657 Improve docs of Fl::hide_all_windows()
+ update fluid dependencies

No code changes.
2023-08-10 15:16:01 +02:00
ManoloFLTK 21fdd42838 macOS: add extra comment explaining need for PPC-specific source code 2023-08-09 21:15:20 +02:00
Sergey Fedorov 356ccc4b70 Fl_cocoa.mm: fix Apple macro for PPC case 2023-08-09 21:07:01 +02:00
ManoloFLTK 1943fe54c8 Wayland: fix fl_read_image() from offscreen buffer 2023-08-09 10:31:36 +02:00
ManoloFLTK 27c3d0b780 Wayland: improve layout of struct fl_wld_draw_buffer 2023-08-08 16:08:53 +02:00
ManoloFLTK 45d119eb3c Move repeated code to Fl_Wayland_Graphics_Driver::cairo_init() 2023-08-08 09:05:12 +02:00
ManoloFLTK a98aaecf97 Fix for Broken "cube" demo (#762)
This commit fixes an error in the cube demo appearing specifically with the AMD Radeon GPU.
2023-08-07 19:16:38 +02:00
Albrecht Schlosser 5bcd6ca8f2 Revert "#733 partial: Adds rotation gesture event on MacOS"
This reverts commit 3049e6394a
as agreed upon in GitHub Issue #733.
2023-08-05 16:37:38 +02:00
Matthias Melcher 3049e6394a #733 partial: Adds rotation gesture event on MacOS 2023-08-05 12:19:42 +02:00
ManoloFLTK 2953db58c7 Let FLTK give more detailed description of a Wayland fatal error
Wayland protocol error messages now give the protocol name and the error code.
2023-08-05 12:09:13 +02:00
Albrecht Schlosser 157d27606f Fix typos in documentation of fl_overlay_rect() etc. (#735)
Thanks to Matt for the improved docs, I just fixed some typos and
added '()'s for better doxygen comments of functions.
2023-08-04 21:30:11 +02:00
Matthias Melcher c5f5973c90 #735: better comments on fl_overlay_rect() 2023-08-04 19:30:27 +02:00
ManoloFLTK c427f037ce Improve procedure to close decorated Wayland window
Libdecor complicates what should be simple, to close a decorated window,
because it uses the titlebar after return from the closing callback function.
Thus, FLTK delays the sending of the FL_CLOSE event to the window,
only when libdecor runs in CSD mode.
2023-08-04 19:14:13 +02:00
Matthias Melcher ee4ab86c3c #211: adds optional parameter for Fl_Input_::drawtext()
Does not change the original API but adds a function and
keeps the original automatic.
2023-08-03 17:35:27 +02:00
ManoloFLTK 0bf6a4b044 Slightly improve Fl_Wayland_Screen_Driver::poll_or_select_with_delay() 2023-08-03 08:12:08 +02:00
Matthias Melcher 79d3b8d69d #762: saves all frequently used OpenGL attributes
When rendering the OpenGL layer, this prepares the FLTK rendering
parameters and restores them after FLTK rendering.
2023-08-02 20:24:46 +02:00
ManoloFLTK e49f2008a6 Fix Fl_Wayland_Image_Surface_Driver::end_current() 2023-08-02 16:10:41 +02:00
ManoloFLTK b440c26e65 Wayland: fix window closing with Sway's kill command or app menu 2023-08-02 10:04:45 +02:00
ManoloFLTK e12eb99b5d Wayland: add test to avoid null pointer dereferencing 2023-07-31 19:26:37 +02:00
ManoloFLTK 7feddabd24 Implement Fl_Wayland_Screen_Driver::poll_or_select_with_delay(double) 2023-07-31 16:29:15 +02:00
ManoloFLTK b1ab37eeff Wayland: simpler use of function eglChooseConfig() 2023-07-29 14:16:18 +02:00
Albrecht Schlosser b9a89c92ea Fl_Shortcut_Button: Silence compiler warnings
Part 1: [-Wreorder] 'shortcut_value’ will be initialized after ...
Part 2: [-Wunused]  unused variable 'Y'
2023-07-28 17:42:59 +02:00
ManoloFLTK d9fa2c6082 Wayland.dox: add info about the xdg decoration protocol
Also, use KWin to name the KDE desktop's Wayland compositor.
2023-07-28 15:27:38 +02:00
Matthias Melcher f0375d6213 Adds default shortcut to Fl_Shortcut_Button. 2023-07-22 15:30:17 +02:00
ManoloFLTK cdd617d094 Wayland: slightly improve procedure to close toplevel window 2023-07-21 15:34:24 +02:00
Albrecht Schlosser 4ec02555ef Fix missing (new) source file in fluid and dependencies
New file: Fl_Button_Type.cxx
2023-07-19 23:42:50 +02:00
Albrecht Schlosser 9ee8cdc727 Fix textcolor of transient scale display (#756)
Make background color and text (label) color of the transient scale
display consistent with tooltip colors.
2023-07-19 16:17:51 +02:00
ManoloFLTK 4dffa31520 Documentation: add detail about primary monitor 2023-07-15 08:41:57 +02:00
Albrecht Schlosser 1259275316 Keep sending FL_DRAG until all mouse buttons are released
The old version would send FL_MOVE events after dragging with more
than one mouse buttons pressed, as soon as the first button was
released.

The new version sends FL_DRAG until the last mouse button is released
and then FL_MOVE, as usual.

This change affects dragging only if more than one mouse button is
pushed and held while dragging. The order of pushing and releasing
mouse buttons does not affect the behavior.
2023-07-14 18:02:17 +02:00
ManoloFLTK 6f05af3c12 Wayland: add control of targeted screen by fullscreen windows 2023-07-13 18:19:01 +02:00
Albrecht Schlosser 580a531ef5 Clamp input values of Fl_Color_Chooser (#749)
Note: this may be somewhat confusing if the user enters out-of-range
values manually because they are overwritten immediately with valid
input but the effects seen in issue #749 are IMHO worse.
2023-07-13 14:34:25 +02:00
Albrecht Schlosser 44840af076 Wayland: keep mouse button state across push/release events
Notes:

(1) Fl::e_state holds the current state of all mouse buttons which is
    returned by Fl::event_buttons() - "plural form".

(2) Fl::e_keysym holds the "key" of the current event which can be a
    mouse button, returned by Fl::event_button() - "singular form".
2023-07-12 18:49:01 +02:00
Albrecht Schlosser 858c3cad86 Fix Wayland FL_RELEASE events reporting wrong button
... in Fl::event_button().

This can be seen when two buttons have been pressed simultaneously
and then released (see test/handle_events.cxx).
2023-07-12 18:05:07 +02:00
Matthias Melcher 9826b345ac corrects default popup menu box type for Fl_Choice (#748) 2023-07-12 13:18:48 +02:00
ManoloFLTK c47cbf4402 More detailed documentation of Fl::screen_xywh() 2023-07-10 09:18:26 +02:00
Mohammed Alyousef d939375a52 Update CMakeLists.txt 2023-07-09 08:11:42 +02:00
ManoloFLTK 3d03a5426b Improve documentation of Fl::screen_num(int x, int y) 2023-07-07 15:11:26 +02:00
Albrecht Schlosser 66bf6ea346 Clarify documentation of Fl_Window::size_range()
Document typical (recommended) usage and platform specific behavior.
2023-06-28 16:01:15 +02:00
ManoloFLTK 8bb29e823c Have Fl_Wayland_Window_Driver use Fl::add_check() when adequate 2023-06-28 08:47:21 +02:00
ManoloFLTK f5879ae228 Slight simplification of Fl_Wayland_Gl_Window_Driver::swap_buffers()
Also, reorder members of class Fl_Wayland_Gl_Window_Driver
2023-06-27 09:05:46 +02:00
ManoloFLTK 81615bbe0b Fix Fl_Cocoa_Gl_Window_Driver::resize()
The additional [NSOpenGLContext flushBuffer] messages appear necessary when an Fl_Tile contains
2 or more GL subwindows.
2023-06-26 15:00:52 +02:00
ManoloFLTK 5196d66825 Wayland: improve mapping and hiding of GL (subs)windows 2023-06-24 09:23:01 +02:00
ManoloFLTK 38381ef544 Slightly simpler Fl_Wayland_Window_Driver::hide() 2023-06-23 10:03:30 +02:00
ManoloFLTK c43cf2f192 Wayland: improve support of multi-display setups 2023-06-19 17:48:37 +02:00
ManoloFLTK 742af8a31a Wayland: fix menutitle windows with scaled, multiple display 2023-06-13 14:39:03 +02:00
ManoloFLTK 2b430aa951 Fix "Cannot link if built with OPTION_PRINT_SUPPORT=OFF" (#734) 2023-06-12 15:35:51 +02:00
ManoloFLTK 033ad1d732 Fix "Fl::get_font_name() with Pango is inconsistent"-cont'd (#732) 2023-06-06 16:55:05 +02:00
ManoloFLTK bba90ce005 Fix "Fl::get_font_name() with Pango is inconsistent"-cont'd (#732) 2023-06-06 08:27:52 +02:00
ManoloFLTK 11c38c3e41 Fix "Fl::get_font_name() with Pango is inconsistent"-cont'd (#732) 2023-06-06 08:22:32 +02:00
ManoloFLTK fcca08d841 Fix "Fl::get_font_name() with Pango is inconsistent"-cont'd (#732) 2023-06-05 17:28:34 +02:00
ManoloFLTK 64eafbefd6 Fix "Fl::get_font_name() with Pango is inconsistent" (#732) 2023-06-05 16:05:27 +02:00
ManoloFLTK 5be3fbf913 Improve re-use of client/compositor shared memory by Wayland buffers 2023-06-05 11:00:33 +02:00
ManoloFLTK 06fc052e5c Fix "Huge memory leak under Wayland" (#730) 2023-06-01 17:09:16 +02:00
ManoloFLTK c3217094db Slightly simplify Fl_Wayland_Window_Driver::makeWindow() 2023-05-31 07:05:18 +02:00
ManoloFLTK 4c057c57ae Slightly improve Fl_Wayland_Window_Driver::flush() 2023-05-22 17:46:08 +02:00
ManoloFLTK 7020356df9 Slightly re-organize class Fl_Wayland_Window_Driver 2023-05-22 09:05:07 +02:00
ManoloFLTK 60440632ee Fix name of static member variable Fl_Wayland_Screen_Driver::wl_display
and add explanatory comment.
2023-05-20 06:05:34 +02:00
ManoloFLTK 89454508a2 Fix Fl_Simple_Terminal::append(str, len) assumes a null terminated string (#728) 2023-05-19 18:57:18 +02:00
ManoloFLTK 033880673a Add null-pointer check for tall menu window under Wayland+KDE 2023-05-17 09:39:39 +02:00
ManoloFLTK e5ac5678dc Fix handling of tall menu windows with the KDE Wayland compositor
Unfortunately (sigh), the KDE Wayland compositor does not seem to support
correctly, that is, as described by the Wayland protocol, popup windows
that are taller than the display : there is no means to make it draw such popup
so that part of it is above the screen top, whereas the 3 other tested compositors
(Mutter, Weston, Sway) don't have this problem.

This commit implements a new approach to draw tall menu windows, and uses
it only with the KDE compositor : instead of asking the compositor to slide the
menu window up, the menu window remains at a fixed position and the graphics
inside the window is slided up.

This requires to add a member variable, int offset_y, to class menuwindow, that
gets used only for the Wayland platform and that contains the vertical offset by which
graphics to the menu window is moved, expressed in FLTK units. An accessor
to the address of this member variable is added to class Fl_Window_Driver.
2023-05-15 12:40:24 +02:00
ManoloFLTK 1555132df1 Wayland: improve tall menu window support with xdg_positioner_set_offset() 2023-05-13 16:29:51 +02:00
ManoloFLTK 7a50c8234a Wayland: slightly simpler surface_enter() for toplevel GL windows 2023-05-12 08:47:56 +02:00
ManoloFLTK 7ef6b9f802 Wayland: fix opening GL top-level window on 2-screen system - cont'd 2023-05-11 18:59:34 +02:00
ManoloFLTK 37abac2d8e Wayland: fix opening GL top-level window on 2-screen system 2023-05-11 18:42:07 +02:00
Albrecht Schlosser a4c6c18b3d Fix doxygen doc generation and document platform specific files
Pure platform specific files like 'src/*_win32.cxx' are excluded from
doxygen processing and don't need doxygen specific guard macros.

Document this fact prominently at the beginning of each file.

Fix exclude patterns and remove duplicates from Doxyfile.in.
2023-05-09 22:36:41 +02:00
ManoloFLTK 89a2b1a7a8 Fl_Wayland_Screen_Driver::get_system_scheme() is not needed 2023-05-03 14:17:10 +02:00
ManoloFLTK a94fed77e4 Wayland: clearer procedure to complete initialisation of screen data 2023-05-03 08:50:19 +02:00
ManoloFLTK 9ffeef7697 Wayland: problem with menus on secondary monitor - cont'd (#724) 2023-05-02 17:59:08 +02:00
ManoloFLTK ef5bf60239 Wayland: problem with dropdown menus on secondary monitor (#724) 2023-05-02 14:50:33 +02:00
ManoloFLTK 0394a27074 Wayland: wl_cursor_theme_load() may return NULL 2023-05-01 21:41:26 +02:00
ManoloFLTK 02c7ee5128 Fix regression in Fl::screeen_xywh() introduced at 9ea0cc8 2023-05-01 21:10:43 +02:00
ManoloFLTK ae65a6bf99 Check return values of calls to libxkbcommon functions (#727) 2023-05-01 17:36:36 +02:00
ManoloFLTK 3e2c8d5a95 Allow building Wayland platform without dbus - cont'd (#726)
CMake-based building without dbus is made possible
2023-04-30 21:36:19 +02:00
Matthias Melcher a2929b15ba Undid old change in Windows code that causes undesired results (STR 1115)
Windows created when another window was grab()'d would always become
dependents under WIN32, hiding them when the grabbed window was hidden.
2023-04-30 20:08:44 +02:00
ManoloFLTK 7a8343e7e4 Fix crash reported in issues #723 and #724 2023-04-29 17:06:55 +02:00
ManoloFLTK 52a15632a6 Make sure Wayland surface size is integer multiple of wld_ scale 2023-04-28 11:27:32 +02:00
ManoloFLTK 04e996ee81 Improve integration with the OWL Wayland compositor 2023-04-28 09:47:20 +02:00
ManoloFLTK 9ea0cc89fb Slightly simpler Fl_Wayland_Screen_Driver::open_display_platform() 2023-04-27 17:06:46 +02:00
ManoloFLTK e82e709bcc Multiline Fl_Input: fix move up/down in non ASCII text 2023-04-26 08:25:32 +02:00
ManoloFLTK 58bd71f26d Wayland filename drag-n-drop: fix final null byte 2023-04-25 16:49:45 +02:00
ManoloFLTK 8489a245ee Wayland: accept all data_device_manager protocol versions 2023-04-25 10:25:34 +02:00
ManoloFLTK 1ae25242bd Wayland: set required version of wl_seat protocol to 2 2023-04-25 09:35:46 +02:00
Albrecht Schlosser 6f77f40aad Windows: define _WIN32_IE for older MinGW versions (#710)
... if _WIN32_IE is not defined. Older MinGW versions would
otherwise not define SHGFP_TYPE_CURRENT which is needed since
commit 5a4e7caa54 that fixes
GitHub issue #710: "Fl_Preferences not stored on Windows 10".

This commit is based on Ian's work as discussed in fltk.coredev, thread
"fltk-1.4 build error in Fl_WinAPI_System_Driver.cxx with 32-bit mingw"
on Apr 20, 2023.
2023-04-24 14:26:56 +02:00
ManoloFLTK 4bf9172a8e Replace internal fl_create_offscreen() calls by new Fl_Image_Surface 2023-04-23 10:03:02 +02:00
ManoloFLTK 897a6910b6 Slightly simpler Fl_Wayland_Graphics_Driver::copy_offscreen() 2023-04-23 09:37:36 +02:00
ManoloFLTK 544ab551e1 Remove superfluous #include directive 2023-04-21 23:48:23 +02:00
ManoloFLTK fe972185c0 Fl_Window_Driver::destroy_double_buffer() does not need overrides 2023-04-21 16:27:08 +02:00
ManoloFLTK f8f7e101f3 Remove unnecessary Fl_Window_Driver::flush_Fl_Window() 2023-04-21 14:33:26 +02:00
ManoloFLTK 9a00f36113 Wayland: keep window resizable after native file chooser - cont'd 2023-04-20 16:45:18 +02:00
ManoloFLTK bcab001eb5 Wayland: keep window resizable after native file chooser 2023-04-20 15:29:40 +02:00
ManoloFLTK 8d79e4ad43 Inform Wayland compositor that most FLTK windows are opaque 2023-04-20 10:06:43 +02:00
ZJUGKC 385cabf3aa
Add const qualifiers to can_undo and can_redo (#720) 2023-04-17 16:12:03 +02:00
ManoloFLTK 54ef53d4ae Move constant expression out of loop 2023-04-17 10:28:27 +02:00
ManoloFLTK 256e368368 Wayland: account for memorised keyboard surface before wl_surface_destroy() 2023-04-17 08:19:59 +02:00
Albrecht Schlosser ac76239db7 Remove scheme specific initialization from Fl_Tree_Prefs
This initialization would prevent changing the 'selectbox' type
automatically when changing the FLTK scheme.

It would also require to set the FLTK scheme *before* the constructor
of Fl_Tree_Prefs (i.e. Fl_Tree) is executed which is unexpected and
error prone for user code.

It is up to the user program to set another boxtype after the
constructor if needed.
2023-04-15 20:31:35 +02:00
ManoloFLTK 1a7ed133d0 Fix for "Wayland: heap-use-after-free after popup/pulldown" (#719) 2023-04-14 19:09:38 +02:00
ManoloFLTK 7091df8c93 Restore building with macOS SDK 10.9 and earlier 2023-04-14 17:57:33 +02:00
Matthias Melcher e18b5353cd Fixed leak in Fl_Text_Buffer #716 2023-04-14 16:54:11 +02:00
Matthias Melcher afd3fde5de Memory leak in Input_ #716 2023-04-14 16:32:36 +02:00
ManoloFLTK 7e2defc10d macOS: remove calls to deprecated API 2023-04-14 15:24:18 +02:00
ManoloFLTK 0fe118aa94 Remove duplication of Pango standard font names
And move each array of standard font names to appropriate font-related source file
2023-04-14 08:15:50 +02:00
Albrecht Schlosser 4bc63da34d Fix compiler warnings [-Wpedantic]
Remove extra semicolons after function definitions
2023-04-13 20:27:00 +02:00
ManoloFLTK 232a5399d7 Lower Pango required version from 1.22 to 1.16 2023-04-13 14:32:51 +02:00
ManoloFLTK caaa11a96f Standardize API to "graphics context" across platforms
Rename fl_wl_cairo() to fl_wl_gc()
Add function cairo_t* fl_cairo_gc() under OPTION_USE_CAIRO
2023-04-13 10:02:40 +02:00
ManoloFLTK e6c9deb4a4 Wayland: limit copied pixels when window update is a region - cont'd
Simpler Fl_Wayland_Window_Driver::flush_overlay() is enough.
2023-04-12 15:01:35 +02:00
ManoloFLTK 2d263a830a Wayland: limit copied pixels when window update is a region - cont'd
Handle Fl_Overlay_Window objects
2023-04-12 00:32:20 +02:00
Albrecht Schlosser 7d8195140c Add public accessor methods Fl_Widget::needs_keyboard()
- add public getter and setter for
- document the new methods
- document that these methods are not yet used internally
- remove unnecessary friend declaration 'NEEDS_KEYBOARD' flag
- simplify Fl::focus(Fl_Widget *) using the new methods.
2023-04-11 16:38:24 +02:00
Albrecht Schlosser 3835b72e2f Fix CMake generation for minimal CMake version (3.2.3)
Unfortunately `execute_process(COMMAND pkg-config ...)` used for
CMake versions lower than 3.4 appends a trailing newline ('\n')
to the output variable which must be removed.

Replace double slash '//' returned by pkg-config with a single '/'
for consistency (applies to all CMake versions).

Tested with CMake 3.2.3 but we should probably raise the minimal
CMake version to a more recent version in the future.
2023-04-10 16:19:09 +02:00
Albrecht Schlosser 027e738655 Fix compiler warning [-Wsign-compare] 2023-04-10 15:58:05 +02:00
ManoloFLTK 4c567a4dd9 Fix "Giant cursor on Wayland + fractional scaling" (#713) 2023-04-08 06:50:56 +02:00
ManoloFLTK 0691833375 Wayland: non-resizable windows are positioned in the wrong place (#711) - cont'd
That is also expected to be the fix for #712
2023-04-07 15:47:01 +02:00
ManoloFLTK ad8dd440d2 Wayland: fix for issue #712 (hopefully) 2023-04-07 14:47:03 +02:00
ManoloFLTK c149091deb Wayland: fix reporting of relative location of multiple displays 2023-04-07 10:14:11 +02:00
ManoloFLTK 0c930b9ca3 Wayland: limit copied pixels when window update is a region 2023-04-05 23:21:43 +02:00
ManoloFLTK 5cedb9e174 Wayland backend draws everything two or three times - cont'd (#708) 2023-04-05 14:57:38 +02:00
ManoloFLTK e790a3a185 Remove superfluous #include directives 2023-04-04 15:30:18 +02:00
ManoloFLTK 74cd7817af Remove unneeded #include directives 2023-04-03 16:11:24 +02:00
ManoloFLTK 1d0e63ea78 Improve member function Fl_Wayland_Screen_Driver::surface_to_window()
Rename it to Fl_Wayland_Window_Driver::surface_to_window() and
avoid loop over all mapped FLTK windows that used to be performed.
2023-04-03 15:25:19 +02:00
ManoloFLTK cebf6b5368 Wayland: update comment about differences between compositors
Mutter goes back to what it did in earlier versions.
Fortunately, FLTK can handle this change.
2023-04-03 11:20:26 +02:00
ManoloFLTK 7e08bd7e26 Wayland + Weston: fix focus loss after click on titlebar 2023-04-03 08:21:07 +02:00
ManoloFLTK e239d00cad Fix "Wayland: non-resizable windows are positioned in the wrong place" (#711) 2023-04-02 18:05:36 +02:00
ManoloFLTK 64ac7b47b8 Improve detection of the location of Wayland protocol files across OSes 2023-03-29 15:25:29 +02:00
ManoloFLTK 70252b0c1a Improve Wayland support of Fl::event_key(int)
Key pressed when the Wayland window acquires focus are now detected.
2023-03-29 12:53:39 +02:00
ManoloFLTK a681aa803c Complete explanatory comment about Weston compositor 2023-03-29 09:30:30 +02:00
ManoloFLTK 43c4bd1031 Wayland: improve switching window to/from fullscreen mode
The call to Fl_Window::fullscreen() can be made before or after the window is show()'n
Tested compositors: Mutter, Plasma, Weston.
2023-03-29 08:49:14 +02:00
ManoloFLTK 5e101bc00c Wayland + Plasma: fix switching fullscreen mode for borderless window 2023-03-28 14:39:11 +02:00
ManoloFLTK 43a9c70d8c Wayland: fix regression in test/fullscreen
Commit e918d94 to fix issue #708 broke turning back from fullscreen state
for borderless window, visible in test/fullscreen.
2023-03-28 05:10:52 +02:00
Albrecht Schlosser 5a4e7caa54 Windows: use SHGetFolderPathW() for application data folder (#710)
See GitHub issue #710: "Fl_Preferences not stored on Windows 10"

Summary: don't use the undocumented registry key "Shell Folders",
use function SHGetFolderPathW() instead although this function is
meanwhile deprecated (but available since Windows XP).

Note: tested with 32-bit build running on Windows XP (works).
2023-03-27 19:51:09 +02:00
ManoloFLTK 6aa6866d80 Wayland: move "struct seat" inside class Fl_Wayland_Screen_Driver 2023-03-27 11:31:26 +02:00
ManoloFLTK 31b5d5b562 Complete Fl_Wayland_Screen_Driver::close_display() 2023-03-27 11:06:17 +02:00
ManoloFLTK cce40848ce Improve methods Fl_Wayland_Screen_Driver::en/disable_im() 2023-03-26 17:38:44 +02:00
ManoloFLTK a242e4a65d Implement methods Fl_Wayland_Screen_Driver::en/disable_im() 2023-03-26 11:04:01 +02:00
Albrecht Schlosser 16338ff4e4 Wayland: remove compilation warning (#706) - cont'd
The previous attempt to fix this issue in commit
dcb4c39956 missed to remove the keyword
'struct' in the offending statement. This new commit actually removes
the compiler warning.
2023-03-25 16:40:52 +01:00
ManoloFLTK 40537ae335 Wayland: slightly simpler writing of function wl_keyboard_key() 2023-03-25 15:52:03 +01:00
ManoloFLTK 9aa62f4492 Add Fl_Cairo_Graphics_Driver::focus_rect() override
This allows to bypass what looks like a Cairo bug:
FLTK_SCALING_FACTOR=1.7   bin/test/tabs
click on tab2
---> crash

But no crash with other scaling factor values (e.g., 1.8).
2023-03-25 15:31:30 +01:00
ManoloFLTK 9d7e680925 Wayland: Fl::get_key(c) for lower case letters different behavior from X11 (#404) 2023-03-25 14:51:57 +01:00
ManoloFLTK 9f9e584919 Wayland Fl_Copy_Surface and Fl::copy() issues (#707) - cont'd 2023-03-24 16:56:25 +01:00
ManoloFLTK e918d94b67 Fix: Wayland backend draws everything two or three times (#708) 2023-03-24 15:34:35 +01:00
ManoloFLTK dcb4c39956 Wayland: remove compilation warning (#706)
drivers/Wayland/Fl_Wayland_Window_Driver.cxx:1515:47: warning: declaration ‘struct wld_window::custom_cursor’ does not declare anything
2023-03-23 18:42:02 +01:00
Albrecht Schlosser aebf2fec39 Improve Fl_Cairo_Window documentation (typos + indentation)
Also fix a doxygen warning in Fl_String.
2023-03-23 13:26:14 +01:00
ManoloFLTK b98aa7bee6 Remove extraneous Wayland-related comment from Windows code 2023-03-22 21:05:28 +01:00
Albrecht Schlosser 8b327d1ddd Fix option CAIRO_EXT in combination with X11 on macOS
This modification became necessary since "__APPLE__" is no longer
undefined by the build system when X11 is used on macOS.
2023-03-22 21:01:36 +01:00
ManoloFLTK 2c03959511 CMake: check for presence of needed Wayland protocol source files 2023-03-22 10:45:24 +01:00
ManoloFLTK 41c94c4d87 Wayland: attempt to improve registry_handle_global_remove()
This function still needs to be tested on a true multi-display Unix box
2023-03-20 10:39:55 +01:00
ManoloFLTK ad3ead111a Simulate one display for OWL Wayland compositor 2023-03-20 09:57:36 +01:00
Matthias Melcher f9004352b4 Fix gl_rect and OGL::fl_point #688 2023-03-18 20:14:39 +01:00
Matthias Melcher 5c482f9d9b
Fix and update alignment #346 (#701)
* interactive layout alignment rewritten
* interface for new alignment rules
* new alignment dialog box
* user defined layout rules added
* layout rules can be stored in projects, settings, and external files
* Valgrind verification
2023-03-18 17:33:27 +01:00
ManoloFLTK a9fb6a979f Rename bool variable for better clarity 2023-03-16 10:41:54 +01:00
ManoloFLTK 0eb6a0e193 Fix Fl_Wayland_Screen_Driver::get_mouse() for scale factor effect 2023-03-14 16:59:29 +01:00
ManoloFLTK add43cd3fc Wayland: add support for multiple high or low DPI displays - cont'd 2023-03-14 11:50:44 +01:00
ManoloFLTK 16448d5ba8 Wayland: improve cursor_surface_enter() 2023-03-14 08:09:39 +01:00
ManoloFLTK 8aafe6cf69 Fix Fl_Wayland_Window_Driver::set_cursor_4args() 2023-03-13 15:31:12 +01:00
ManoloFLTK 9980dc6fa1 Remove unused variable 2023-03-13 12:31:25 +01:00
ManoloFLTK eeb9267e6e Wayland: add support for multiple high or low DPI displays 2023-03-13 10:38:28 +01:00
ManoloFLTK 73a2ca5261 Fix c'tor of Fl_Wayland_Image_Surface_Driver for HighDPI displays 2023-03-10 13:17:53 +01:00
ManoloFLTK 2ee688dae9 Improve member function Fl_Wayland_Gl_Window_Driver::make_current_before() 2023-03-10 10:17:20 +01:00
Albrecht Schlosser 0f3b5ded8f Fix dependencies, typos, trailing whitespace, and formatting
No code changes.
2023-03-09 18:28:37 +01:00
Albrecht Schlosser 8b1ec4c531 Fix Visual Studio (MSVC) compiler warnings 2023-03-09 17:47:51 +01:00
ManoloFLTK 2527632054 Fix gl_overlay under Wayland 2023-03-09 17:41:37 +01:00
Albrecht Schlosser 5175192755 CMake: build shared libs with OPTION_CAIROEXT (issue #250)
- remove separate libfltk_cairo to avoid cyclic dependencies, but
- keep a dummy libfltk_cairo in 1.4.0 for backwards compatibility
- move cairo/Fl_Cairo.cxx to src/Fl_Cairo.cxx
- add preliminary Cairo support for Visual Studio (MSVC)

Static linking is not affected by this change, but users building
with hand-made Makefiles will have to remove libfltk_cairo starting
with FLTK 1.4.0. The dummy library can be linked for backwards
compatibility but it will be removed later (in 1.4.x or 1.5.0).

The shared FLTK library libfltk.{so|dylib|dll|..} depends on libcairo
if and only if FLTK is built with one of the Cairo options. This has
always been the case for OPTION_CAIROEXT but is now also true if only
OPTION_CAIRO is selected, i.e. FLTK programs linked with a Cairo
enabled shared FLTK library will also be linked with libcairo. The same
is true for configure options --enable-cairo and --enable-cairoext,
respectively.

Preliminary Cairo support for MSVC now detects a Cairo installation
using the CMake variable FLTK_CAIRO_DIR which must be set by the user.
Note that this feature is temporary and may be changed in the future
for a better and more comfortable version.
2023-03-09 17:34:05 +01:00
ManoloFLTK e32d4bcab9 Fix Fl_Wayland_Screen_Driver::x() and friends 2023-03-09 16:56:57 +01:00
ManoloFLTK e409b01ba6 Remove useless repetition from array dead_keys[] 2023-03-08 12:19:09 +01:00
ManoloFLTK b14172401d Fix: Shift-Tab not "reverse navigating" on some platforms (#696) 2023-03-08 09:04:55 +01:00
ManoloFLTK f89a9f9efc DnD of filenames: make Wayland behave as Windows and macOS
and also add more detailed documentation of platform-specific behaviors.
2023-03-06 11:08:04 +01:00
ManoloFLTK a52811567e Wayland: improve DnD of filenames to allow space-containing names 2023-03-05 11:54:55 +01:00
ManoloFLTK 5ae92f034a Simpler use of member variable wl_registry in class Fl_Wayland_Screen_Driver 2023-03-04 08:34:10 +01:00
ManoloFLTK b438d448fb Remove unused variable declaration + fix in wayland.dox 2023-03-03 18:00:44 +01:00
ManoloFLTK 77c6877374 Reorder members of class Fl_Wayland_Screen_Driver 2023-03-03 16:47:49 +01:00
ManoloFLTK 37764fcd28 Improve Fl_Wayland_Window_Driver::wld_scale() 2023-03-03 09:28:12 +01:00
ManoloFLTK 8f24d7f295 Fix typos in Doxygen documentation 2023-03-02 12:15:14 +01:00
ManoloFLTK 86c238c000 Add Fl_Wayland_Window_Driver::wld_scale() member function 2023-03-02 11:36:26 +01:00
Matthias Melcher 04be85c636 Improved Fl_String capacity increments 2023-03-01 15:21:49 +01:00
Matthias Melcher a3d89f7e28 Fix malloc/delete mismatch 2023-02-27 14:17:25 +01:00
Matthias Melcher 13cd927ab4
Add Fl_String to Fl_Preferences (#687) 2023-02-25 22:44:39 +01:00
Albrecht Schlosser 314ad2310e Derive internal Fl_Help_View buffer from Fl_String
Refactor the internal class HV_Edit_Buffer by deriving it from the
the recently extended Fl_String class.

The class HV_Edit_Buffer still needs some "special" methods but the
code could be simplified substantially.
2023-02-24 14:14:16 +01:00
Matthias Melcher 9f87af8ad9
Fl_String refactoring and extension (#683)
- add true unittest and Fl_String testing
- interface and printout are similar to gtest
  without requiring external linkage.
  just run `unittest --core`.
- new Fl_String API
- extended API to fl_input_str and fl_password_str
- co-authored-by: Albrecht Schlosser <albrechts.fltk@online.de>
2023-02-23 15:42:05 +01:00
Albrecht Schlosser ce45bcae2f Silence false positive gcc warning (#682)
... and fix a typo.

This warning was reported for gcc 12.2 (MinGW-w64 / MSYS2) but may have
appeared in earlier gcc versions (gcc 9.4 is not affected).

It's very likely that this warning needs '-O2' or '-O3' to be issued.
2023-02-21 12:46:47 +01:00
Matthias Melcher 2971625418 Add GLUT_ELAPSED_TIME simulation 2023-02-20 13:40:27 +01:00
ManoloFLTK 6f4cf105b1 Remove 2 compilation warnings under Windows with mingw64
Compiling Fl_Native_File_Chooser_WIN32.cxx...
fl_dnd_win32.cxx:436:11: warning: private field 'm_EnumF' is not used [-Wunused-private-field]
  FLEnum *m_EnumF;
          ^
1 warning generated.

Fl_Native_File_Chooser_WIN32.cxx:378:19: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
  bool unixpath = IsUnixPath(_directory) | IsUnixPath(_preset_file);    // caller uses unix paths?
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                         ||
Fl_Native_File_Chooser_WIN32.cxx:378:19: note: cast one or both operands to int to silence this warning
1 warning generated.
2023-02-20 12:43:36 +01:00
ManoloFLTK 147bda5471 Rename fd_callback() to wayland_socket_callback() 2023-02-19 08:53:00 +01:00
ManoloFLTK 2af43ef4c8 Remove special FL_CURSOR_NONE implementation in Wayland 2023-02-17 16:24:41 +01:00
ManoloFLTK e84a1730ad Wayland: improve and document support of FL_CURSOR_NONE 2023-02-17 09:52:34 +01:00
ManoloFLTK f6b87790cc Wayland: new struct wl_cursor *custom_cursor member variable 2023-02-15 22:52:20 +01:00
Matthias Melcher 6fbfaba19d
Move class Fl_Shortcut_Button from FLUID to core (#677) (#680) 2023-02-15 15:24:25 +01:00
ManoloFLTK a4d0f7d269 Wayland: allow Fl_Window::cursor(Fl_Cursor) for whole window 2023-02-15 12:20:26 +01:00
ManoloFLTK 9ff67f013e Wayland: add support of Fl_Window::default_cursor(Fl_Cursor) 2023-02-15 06:43:39 +01:00
ManoloFLTK 868ab9696f Rename class Fl_Display_Cairo_Graphics_Driver to Fl_X11_Cairo_Graphics_Driver 2023-02-14 11:52:21 +01:00
ManoloFLTK b055b82eb2 Use libdecor/src/os-compatibility.h to declare os_create_anonymous_file() 2023-02-14 10:44:15 +01:00
ManoloFLTK 8038b1f1ad Update doc of Fl_Image::copy() after new Fl_Anim_GIF_Image class 2023-02-14 08:51:42 +01:00
ManoloFLTK 3d0b96b095 Remove unneeded list of wayland seats 2023-02-13 16:54:16 +01:00
ManoloFLTK 9958016a47 Windows: minor change to support build with mingw64 4.9
This old compiler is available as a cross compiler from macOS to 64-bit Windows.
2023-02-13 12:24:27 +01:00
ManoloFLTK f459fdb637 Allow scaled image in Fl_Window::cursor(const Fl_RGB_Image *, int, int) 2023-02-13 12:11:04 +01:00
ManoloFLTK bb74d263e2 Wayland: add necessary check to support OWL 2023-02-12 08:52:09 +01:00
Matthias Melcher 5a25641317
Very controlled GDIplus startup and shutdown #635 (#679)
Fall back to GDI if GDIplus is not available
2023-02-11 19:14:23 +01:00
ManoloFLTK 740c56ce15 Wayland: improve support for FL_CURSOR_{NONE, HELP} 2023-02-11 14:36:58 +01:00
Matthias Melcher d9b519f969 Infinite undo: fix compiler warning 2023-02-10 17:21:47 +01:00
Matthias Melcher 7f87c847ba
Unlimited undo/redo for Fl_Input_ and Fl_Text_Buffer (#558) (#676) 2023-02-10 17:13:20 +01:00
Matthias Melcher 72f8604381 Don't for a box type for pulldowns (#675) 2023-02-10 16:58:33 +01:00
Albrecht Schlosser d7f21d9568 Remove dead code and comments (Windows only)
Most of the old code was a leftover of STR 3454 (which fixed winsock
issues).

Also removed an old comment about usage of Windows WSAAsyncSelect()
and why it had been removed (related to Windows socket functions).
2023-02-10 13:31:07 +01:00
Albrecht Schlosser 2239ecc4a1 Fix typos in documentation and comments
(no code changes)
2023-02-10 13:13:36 +01:00
Matthias Melcher ffadc23cab
Expose elapsed time API (#670) 2023-02-09 14:48:39 +01:00
ManoloFLTK 3cbbe7be2c Remove XOR-based code that was unused and incomplete (#673) 2023-02-07 15:26:46 +01:00
ManoloFLTK a496be9178 Fix "\todo TextDPosToLineAndCol does not exist" 2023-02-07 15:00:03 +01:00
ManoloFLTK afb44149d9 Fix "\todo TextDEndOfLine and BufEndOfLine functions don't exist" 2023-02-07 14:32:26 +01:00
ManoloFLTK 7a8771d3c4 macOS+XQuartz: support new homebrew name for GTK2 shared lib 2023-02-07 12:47:42 +01:00
ManoloFLTK 160eb2926d Remove usage of __APPLE_QUARTZ__ (#673) 2023-02-06 21:42:40 +01:00
ManoloFLTK f1b2e92f07 Use fl_utf_strcasecmp() for Unicode-aware case-insensitive comparisons 2023-02-06 18:48:43 +01:00
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