Commit Graph

7257 Commits

Author SHA1 Message Date
ManoloFLTK
a0ff3f6f5c Fix Scaling window up/down also scales X/Y position on secondary displays only (#925) 2024-03-04 16:25:45 +01:00
ManoloFLTK
7777a503ad Implement Fl_Wayland_Screen_Driver::base_scale(int numscreen) 2024-03-04 16:20:54 +01:00
ManoloFLTK
5ba756e60a X11: improve moving window back & forth across screens (#919) 2024-03-04 10:10:04 +01:00
ManoloFLTK
f87aad7464 Use Fl_Window_Driver::is_resizable() to check whether window can be resized 2024-03-03 23:06:59 +01:00
ManoloFLTK
bbbc3a739c X11: Window scaling makes window lose resizable status if resizable_ is NULL (#923) 2024-03-03 20:53:16 +01:00
ManoloFLTK
130f5b6dc1 A window needs is_resizable() true to obey fullscreen() or maximize() 2024-03-03 17:50:49 +01:00
Albrecht Schlosser
d832ab742a Fix Visual Studio compiler warnings 2024-03-03 16:15:43 +01:00
Greg Ercolano
257e20e929 Added Fl_Terminal::text() and docs 2024-03-02 22:47:45 -08:00
Matthias Melcher
f1c9b198bb Promote fl_strlcpy to <FL/fl_string_functions.h> 2024-03-02 23:49:35 +01:00
ManoloFLTK
7fea97c7a7 Fix regression introduced at 41740ca for non resizable windows - cont'd 2024-03-02 20:02:11 +01:00
ManoloFLTK
b74099c5fd Add OPTION_SIMPLE_ZOOM_SHORTCUT to fine tune zoom-in shortcut 2024-03-02 17:25:10 +01:00
ManoloFLTK
a76229972e macOS: remove test that became useless after 5f20698 2024-03-02 08:12:54 +01:00
ManoloFLTK
34b8801fed Windows: fix moving window with Windows+Shift+arrow (#919) 2024-03-01 18:30:20 +01:00
ManoloFLTK
cc15700bdb Windows: improve changing scale values of display while app runs. 2024-03-01 14:00:43 +01:00
ManoloFLTK
266647d2a7 Windows: fix issue if moving window back & forth across screens (#919) 2024-03-01 12:20:10 +01:00
ManoloFLTK
0eef561e7b Windows: make Ctrl/+/-/0/ scaling system-wide if all screens have same DPI 2024-03-01 11:11:15 +01:00
ManoloFLTK
5f2069871d Move recognition of Ctrl= out of Fl::test_shortcut(unsigned) 2024-02-29 07:17:31 +01:00
Albrecht Schlosser
367826979d Fix a typo and the URL to an STR in a comment
no code changes
2024-02-28 15:54:02 +01:00
ManoloFLTK
f4fb973c5d Simplify code to recognize GUI rescaling shortcuts 2024-02-28 09:13:35 +01:00
ManoloFLTK
eb3977ac43 Fix regression introduced at 41740ca for non resizable windows 2024-02-27 18:52:25 +01:00
ManoloFLTK
fc46e771cd Improve prioritization of event handlers added at open display time 2024-02-27 16:20:25 +01:00
ManoloFLTK
746cbf861a Minor optimization of macOS automatic Window menu 2024-02-27 13:46:41 +01:00
ManoloFLTK
4863f959c8 macOS: Window menu of system menubar follows changes in active window 2024-02-27 09:13:41 +01:00
ManoloFLTK
f35ae7122d Stop GUI scaling when window is maximized or full screen (#919)
Don't rescale when any top window on same screen as focus window is fullscreen or maximized
2024-02-27 08:46:40 +01:00
ManoloFLTK
3f794d3abe Allow FL_COMMAND+'+' as macOS system menu shortcuts - cont'd 2024-02-26 17:48:18 +01:00
ManoloFLTK
0818d4ec5b Fix: Fl_Window::fullscreen() does not work correctly on Mac (#920) 2024-02-26 12:15:47 +01:00
ManoloFLTK
41740caa2e Don't rescale when top window is fullscreen or maximized (#919) 2024-02-26 11:00:42 +01:00
ManoloFLTK
2ea5291821 Allow FL_COMMAND+'+' and FL_CTRL+'0' as menu shortcuts 2024-02-26 10:46:28 +01:00
Albrecht Schlosser
f288aea10a Fix Fl_Group::resize() for groups w/o resizable() (#917)
Improve code comments to clarify which cases are handled in a code
block and why this is done. Subwindows have some special needs.
2024-02-23 19:21:26 +01:00
ManoloFLTK
957becbe28 Fix: fl_height(int, int) decreases the font size after each call (#915) 2024-02-21 09:38:24 +01:00
ManoloFLTK
681e22a452 Add scale_handler first so it has least priority of all handlers 2024-02-20 21:47:43 +01:00
ManoloFLTK
69d7991acc FL_MENU_TOGGLE/RADIO items do not update in macOS menu bar (#916) 2024-02-20 18:41:12 +01:00
ManoloFLTK
ba5ed296e9 Improve implementation of the macOS Window menu
The macOS Window menu is connected to the item array of the  macOS menubar
via FL_SUBMENU_POINTER. This facilitates memorization of pointers
to items of the macOS menubar because the item array no longer changes
each time a window opens of gets closed.
2024-02-20 16:00:01 +01:00
Matthias Melcher
2f343ad64d
Fix Terminal character position and add word selection (#906)
* Improve horizontal interactive selection
* Using half-character positions to implement selection
  similar to Fl_Input.
* Add word and line selection
* Fix vertical position of text
2024-02-18 13:29:37 +01:00
Greg Ercolano
58a1496389 Fixed Fl_Terminal xterm color 39/49 handling, and other mods.
Fixed a bug in the handling of xterm color 39 + 49, which avoids
applying Dim/Bold if default color is the special "see through" color
0xffffff00. A test will be added to test/terminal to excercise this
in a follow up commit.

Renamed CharStyle::?gcolor_uchar() -> CharStyle::?gcolor_xterm()
for a consistent naming convention.

Changed fltk_fg_color() from a static func to a CharStyle method
because it needs to access the defaultcolor for the special cases
for xterm colors 39 and 49.

Made CharStyle::attr_color() private, as per Jonathan Griffitts request
in issue #909.

Improved docs regarding effects of Dim/Bold for xterm and non-xterm color
methods.

Fl_Terminal::text?gcolor_xterm() methods now use CharStyle::?gcolor_xterm()
methods, removing the duplicate code logic.
2024-02-16 13:10:06 -08:00
Greg Ercolano
1069ebc1b6 Fix Fl_Terminal xterm CharStyle charflags (#909) 2024-02-16 04:46:05 -08:00
ManoloFLTK
cf551ddf5a Improve recognition of re-scaling shortcuts - cont'd 2024-02-11 19:10:39 +01:00
ManoloFLTK
2776071144 Improve recognition of re-scaling shortcuts w/ various keyboard layouts 2024-02-11 11:07:03 +01:00
ManoloFLTK
63b0bcf599 KDE+X11 keyboard stops working after menu display (#904) 2024-02-11 08:23:23 +01:00
ManoloFLTK
fc6d364057 Change parameters of Fl_Wayland_Window_Driver::delete_cursor() 2024-02-09 10:04:13 +01:00
ManoloFLTK
1fdb1f7944 Improve Fl_Wayland_Window_Driver::hide() 2024-02-08 15:18:18 +01:00
Albrecht Schlosser
fd5cd80935 Introduce "Modern CMake" in FLTK
This is a big commit and there are too many changes to list them all.
The main changes are:

- rename all CMake build options to 'FLTK_*'
- export library targets with namespace (prefix) 'fltk::'
- standardize shared library target names with suffix '-shared'
- set public build properties on libraries for consumers
- document library names and aliases in README.CMake.txt
- document changes in "Migrating Code from FLTK 1.3 to 1.4"
- partial backwards compatibility for old user projects

Included but not directly related changes:

- fix Windows (Visual Studio) DLL build
- add CMake function fl_debug_target() to show target properties
- don't build test programs if FLTK is a subproject
- internal: reformat CMake code: remove space before '('

Thanks to Matthias and Manolo for their help, testing, and feeback.
2024-02-07 18:37:34 +01:00
Albrecht Schlosser
1cf6fdfa85 Fix Fl_Window::default_size_range() (#901)
Thanks to Manolo for the patch.
2024-02-07 12:38:58 +01:00
ManoloFLTK
a651c89c85 Fix window moving in Fl_Wayland_Window_Driver::resize() 2024-02-06 09:24:31 +01:00
ManoloFLTK
676e976cb6 Fl_Window_Driver::set_popup_window(), Fl_Screen_Driver::screen_boundaries_known()
Fl_Window_Driver::set_popup_window() is to be used to declare a window should be
positioned relatively to a previously mapped other window.  This allows a platform
to process such windows differently from other windows if needed.
Menu and tooltip windows are so declared.

A call to Fl_Window_Driver::set_popup_window() also allows to distinguish a real
menu or tooltip window from a window marked by Fl_Window::set_menu_window()
or by Fl_Window::set_tooltip_window() but that's not a real menu or tooltip.

New member function bool Fl_Screen_Driver::screen_boundaries_known() returns
true by default. A platform where the position of windows inside a screen is hidden
(e.g., Wayland) returns false. This allows FLTK to refrain from trying to make sure
a computed position is inside a screen.
2024-02-05 12:39:10 +01:00
ManoloFLTK
0da00995a8 Shorten parameter list of Fl_Wayland_Window_Driver::delete_cursor_(bool) 2024-02-04 16:55:01 +01:00
ManoloFLTK
865aed4eec Wayland: fix setting cursor to FL_NO_CURSOR 2024-02-03 16:04:06 +01:00
Albrecht Schlosser
b21a3910a9 Improve documentation of Fl_Native_File_Chooser
Document restrictions imposed by the new system file chooser dialogs,
particularly by 'kdialog' and 'zenity' (Unix/X11/Wayland only).
2024-01-31 18:50:25 +01:00
Matthias Melcher
faff63130c Fix cached GL context on all platforms (#737) 2024-01-29 14:01:41 +01:00
Matthias Melcher
c40b165353 Fix OpenGL context caching on macOS (#737) 2024-01-29 13:42:05 +01:00
Matthias Melcher
d9612e3cc7
RFC: Different approach to Editor tutorial (see #189) (#883)
Update test/editor code and tutorial (#189, #883)

Different, sequential approach to Editor tutorial
Co-authored-by: Albrecht Schlosser <albrechts.fltk@online.de>
2024-01-29 11:43:34 +01:00
Matthias Melcher
fa8799bcef Fix animated gif reloading (#897) 2024-01-28 00:14:49 +01:00
Matthias Melcher
444ee8bc36 Fix warning for out of range index. 2024-01-27 17:54:49 +01:00
Matthias Melcher
4123605aab Fix inlined animated GIFs with NULL name (#897) 2024-01-27 16:27:34 +01:00
Greg Ercolano
f2544509c1 Fix mousewheel problem with Fl_Text_Editor (issue #879)
When an Fl_Text_Editor ended up under the mouse, it took
mousewheel events for itself, freezing navigation of a
parent's Fl_Scroll.

Patch handles mousewheel events for both up/down and left/right
by checking:

    > If editor has no scrollbar (e.g. no content to scroll to),
      then mousewheel events for that scrollbar are ignored
      so the parent can be navigated.

    > If editor has a scrollbar, it handles wheel events until scroller reaches
      an extreme position (e.g. top or bottom), it starts ignoring wheel events
      so the parent can be navigated.
2024-01-25 08:09:25 -08:00
Greg Ercolano
6a887bf69b Fix small typos in Anim GIF docs 2024-01-24 14:10:54 -08:00
ManoloFLTK
8a4aa619e4 Fix "Wrong tooltip position on Wayland …" - cont'd (#894) 2024-01-23 12:36:50 +01:00
ManoloFLTK
da8d6c8d77 Fix "Wrong tooltip position on Wayland with secondary monitor" (#894) 2024-01-23 10:40:25 +01:00
Albrecht Schlosser
5cc5a60e09 Fl_Preferences: fix missing '/' (#891)
Without the '/' FLTK 1.4 wouldn't fall back to the 1.3 prefs folder
even if it existed.
2024-01-22 21:13:19 +01:00
Matthias Melcher
667adac6dd Fix warning. 2024-01-22 21:06:04 +01:00
Matthias Melcher
7b01f0b39f Fixes mouse pointer visibility for popups (#890) 2024-01-22 20:58:48 +01:00
Matthias Melcher
595d2df049 Fix wrong path var and typos 2024-01-22 20:36:12 +01:00
Matthias Melcher
baa3c6ddc0
Fix User Preferences file search order for Unix (#891) 2024-01-22 20:20:52 +01:00
ManoloFLTK
45422a7d19 Add popup_window() virtual member functions to Fl_Window_Driver 2024-01-22 09:52:35 +01:00
ManoloFLTK
12854fd8e5 Fix Wayland: crash with set_menu_window() - cont'd (#892) 2024-01-21 10:57:45 +01:00
ManoloFLTK
2481bfe430 Fix Wayland: crash with set_menu_window() - cont'd (#892) 2024-01-21 10:41:18 +01:00
ManoloFLTK
ab8c84447e Fix "Wayland: crash with set_menu_window()" - cont'd (#892) 2024-01-21 08:39:46 +01:00
ManoloFLTK
2fbf5bed0d Fix "Wayland: crash with set_menu_window()" (#892)
Fixes also a similar crash occuring after use of set_tooltip_window().
Two bool member variables are added to class Fl_Window_Driver
to indicate true FLTK menu windows (i.e., created by Fl_Menu_Item::pulldown())
and true FLTK tooltip windows (i.e., Fl_Tooltip).
2024-01-21 08:30:49 +01:00
Albrecht Schlosser
b5b839e4f0 Fix compiler warning [-Wmaybe-uninitialized]
'buf' could indeed be used uninitialized if the switch statement
below was executed with an unknown style (no default case).
2024-01-19 19:38:11 +01:00
Matthias Melcher
ed757454eb Fix crash in Fl_Preferences for deformed group name (#891) 2024-01-19 11:47:41 +01:00
ManoloFLTK
13d412f82f Wayland: add necessary initializations after commit b7fba46 2024-01-19 09:32:57 +01:00
ManoloFLTK
01f2f760b6 Create struct wl_callback_listener *Fl_Wayland_Graphics_Driver::p_surface_frame_listener 2024-01-18 08:51:31 +01:00
ManoloFLTK
b7fba465ce Wayland: throttle resize operations also for top-level GL windows
Member cb of struct wld_buffer is replaced by member frame_cb of struct wld_window.
This allows frame_cb to be used both for non-GL and for top-level GL windows.
2024-01-18 08:10:33 +01:00
Matthias Melcher
554bccbecd Synchronize mouse and keyboard callbacks for Fl_Button (#877)
Keyboard behavior for button types was not consistent with mouse
click behavior. This change avoids callbacks when pressed radio buttons
are pressed again.
2024-01-17 20:24:47 +01:00
Matthias Melcher
a038e55783 Restore original Fl_Button event behavior(#877)
Previous commits introduced too many changes to Fl_Button callbacks,
creating problems in user apps. This is the base for a second much
more specific fix to event flags.
2024-01-17 18:54:07 +01:00
ManoloFLTK
0dfa37f4c0 Wayland + full-size subwindow resizing issue - cont'd (#878)
Implement a less strict handling of resizing of a decorated window entirely covered
by a subwindow where throttling of fast resize commands is guided by the
value of the in_use member variable of the window's wld_buffer.
2024-01-17 11:43:00 +01:00
Greg Ercolano
e5abb3bc86 Fixed issue number reference. 2024-01-15 15:10:54 -08:00
Greg Ercolano
d3914ef90e Addresses issue #879 2024-01-15 14:52:58 -08:00
Greg Ercolano
3142eb2fda Small code fixups
> Enabled -Wall -Wextra -Wpedantic to catch errors
    - Silenced resulting "unused parameters" warnings
    - Fixed char omission in protected Fl_Terminal::insert_char() methods
> Self doc code and better comments in RingBuffer::resize()
> Changed private RingBuffer::clear_disp_row() -> clear_disp_rows()
> Added private RingBuffer::hist_rows()/disp_rows() setter methods
> Added private RingBuffer::offset_adjust() method for adjusting RingBuffer offset_
> Fixed comment typos
> Remove white space inside outer parens of while()/if()/etc
2024-01-15 14:33:17 -08:00
Matthias Melcher
31daa83f2b #877: Formatting, comments, debug output 2024-01-14 16:58:34 +01:00
Matthias Melcher
da6791d492 #877L: Formatting, Unused variable. 2024-01-14 15:48:33 +01:00
ManoloFLTK
c44bea787f #842 - cont'd: fix typos in documentation. 2024-01-14 14:32:46 +01:00
Matthias Melcher
5c90938aa3 #887: Fixes FLTK file chooser not releasing preview image.
...when hidden
2024-01-14 01:42:05 +01:00
Matthias Melcher
be1c96b98a #889: Fixes missing return statement. 2024-01-14 00:52:41 +01:00
Matthias Melcher
e0a334840d #842: Documents args() color values and how they apply 2024-01-13 23:07:13 +01:00
Matthias Melcher
826eb39d68 #877: Fixes shortcut callbacks for Fl_Button
- this commit does rewrite some of the logic,
hoping to make thing more, um, logical. The bits
react mostly the same and hopefully as expected.
Everything is documented in the Fl_Button ctor.
2024-01-13 22:36:35 +01:00
ManoloFLTK
a6e5b5b35b Remove compilation warning
converting to non pointer type "int" from NULL (-Wconversion-null)
2024-01-13 21:08:41 +01:00
Albrecht Schlosser
92b48c3936 Fix yet another typo in documentation 2024-01-13 20:05:34 +01:00
Albrecht Schlosser
0f1a803eb8 Fix doxygen docs (typo, undocumented parameter) 2024-01-13 20:01:23 +01:00
Matthias Melcher
332a87aa43 #887: Fixes Fl_Shared_Image reference counting
- adds documentation to all calls
- changes implementation details on ::copy()
and copy(w,h)
2024-01-13 19:32:32 +01:00
ManoloFLTK
994b5824dc Wayland: fix processing of keypad keys - cont'd (#881) 2024-01-13 10:48:52 +01:00
ManoloFLTK
421e917f03 Comment out debug statement 2024-01-11 17:21:49 +01:00
Greg Ercolano
c9534460f7 Solves issue #882. 2024-01-11 08:20:16 -08:00
Greg Ercolano
d9125d76cb Solves issue #884: single quote zenity/kdialog 2024-01-11 07:50:09 -08:00
Matthias Melcher
a237743c8b #885: Fixes keyboard text selection in Fl_Text_Editor 2024-01-11 16:20:55 +01:00
Greg Ercolano
dc70a04100 Add Fl_String not-equal test 2024-01-10 21:32:02 -08:00
Greg Ercolano
08e64283aa Add textattrib() get method+docs
Requested by Jonathan Griffitts during rust bindings.
2024-01-10 09:10:07 -08:00
ManoloFLTK
2db1929985 Wayland: fix processing of keypad keys - tidying (#881) 2024-01-07 10:14:40 +01:00
Albrecht Schlosser
b4697c33ff Remove Fl_Simple_Terminal (replaced by Fl_Terminal)
... as discussed previously.
2024-01-06 18:29:25 +01:00
Albrecht Schlosser
37eefe5548 Wld: Add missing keypad key to keypad translation table (#881)
Keypad key 'Del' aka '.' (or ',') was missing in the key translation
table for Fl::e_original_keysym.

Also: add DEBUG_KEYBOARD macro to enable/disable keyboard debugging
code easier.
2024-01-06 17:56:04 +01:00
ManoloFLTK
516f9e7885 Fix "When zooming window, the window size range must be adjusted" (#880) 2024-01-06 14:52:57 +01:00
ManoloFLTK
e1cd6dec4a Wld: Fix e_original_keysym for keypad number keys + NumLock off (#881) 2024-01-06 12:38:24 +01:00
ManoloFLTK
a893cc3f5e Wayland: fix processing of '.' keypad key (#881) 2024-01-06 09:22:40 +01:00
ManoloFLTK
bc28433f2e Wayland: numeric keypad keys don't work as intended - cont'd (#881) 2024-01-05 19:34:46 +01:00
ManoloFLTK
944b5e7072 Wayland: numeric keypad keys don't work as intended (#881) 2024-01-05 19:05:36 +01:00
Albrecht Schlosser
3b1ea22d1d Remove unused variables [-Wunused-variable] 2024-01-04 15:29:07 +01:00
Matthias Melcher
71d3cdd337 Removes debugging printf. 2024-01-04 01:27:40 +01:00
Matthias Melcher
46c9cf2f10 #797: Improves Fl_Tile resize behaviour
- if a tile with a size range is resize smaller than the
minimum size of all children, the children will now no
longer shrink, and expanding will make them work
again as expected.
2024-01-04 01:26:40 +01:00
Matthias Melcher
a09c75e9bc Adds Fl_Input RMB menu translation to test/preferences
This also updates the RMB menu labels before every popup so
that changing the labels after creating the widgets still reflects
that change correctly.
2023-12-28 15:43:21 +01:00
ManoloFLTK
30f2ec8185 Fix for bug in Mutter Wayland compositor (#878) - cont'd
Add more tests to do additional operations under stricter conditions
2023-12-28 11:28:47 +01:00
ManoloFLTK
6143764885 Fix for bug in Mutter Wayland compositor (#878)
Mutter implements too strictly this rule expected from compositors about "frame callbacks" :
"A server should avoid signaling the frame callbacks if the surface is not visible in any way,
e.g. the surface is off-screen, or completely obscured by other opaque surfaces."
When a window is being interactively resized, it makes no sense to create a frame callback
for an entirely covered surface but then never signal the surface can be redrawn,
because this blocks the resize operation.

Neither KWin nor Weston have this problem.
2023-12-28 09:59:51 +01:00
ManoloFLTK
73bd4a53dd Fix position of 1-button Fl_Message windows 2023-12-27 12:15:25 +01:00
ManoloFLTK
bb5cb5b6d4 Wld: export only member functions for ./configure --enable-shared (#872) 2023-12-26 16:00:44 +01:00
Albrecht Schlosser
1d73c0195c Improve docs and add two new Fl_Menu_Item methods (#875)
This addresses some issues pointed out by GitHub Issue #875.

Documentation lacked details about Fl_Multi_Label assignment and
correct memory handling.

The new methods
 - Fl_Menu_Item::image_label(const Fl_Image *) and
 - Fl_Menu_Item::multi_label(const Fl_Multi_Label *)
provide a cleaner interface to assign images and Fl_Multi_Label's
to menu items.

examples/howto-menu-with-images.cxx: carify some issues, fix leak,
  and use new Fl_Menu_Item::multi_label(const Fl_Multi_Label *).
2023-12-23 20:08:18 +01:00
Albrecht Schlosser
016c36c917 Fix memory free() mismatch (#875)
This issue was revealed during testing for GitHub Issue #875.

"ERROR: AddressSanitizer: attempting free on address which was not
malloc()-ed", reported by examples/howto-menu-with-images.cxx if
the window object was released at the end of the program, causing
Fl_Menu_::clear() to be called.

The issue was caused by casting all supported label types to
'const char *' which are stored in Fl_Menu_Item::text and then trying
to free() all text strings in Fl_Menu_::clear() under certain
conditions.

Now images and Fl_Multi_Label's are no longer (tried to be) free'd.
2023-12-23 20:05:48 +01:00
ManoloFLTK
f59702e290 A more cross-platform way to fix issue #876 2023-12-22 09:16:48 +01:00
ManoloFLTK
fcf91e51c0 Fix "Fl_Plugin_Manager::loadAll doesn't work correct" (#876) 2023-12-21 17:12:13 +01:00
ManoloFLTK
e466fe20c8 Fix "Fl_Input popup menu customize doesn't work" (#874) 2023-12-21 15:23:38 +01:00
ManoloFLTK
42ff55026e Fix "commit 96bacd3 may crash on X11" (#873) 2023-12-21 14:22:08 +01:00
Albrecht Schlosser
76a2c95f07 Fix a typo, trailing whitespace, and dependencies 2023-12-21 14:03:04 +01:00
ManoloFLTK
3984639270 Restore "configure --enable-shared" under Linux (#872) 2023-12-20 23:42:45 +01:00
Albrecht Schlosser
5df5daf78e Make the 'Forms' compatibility library 'fltk_forms' optional
This library is no longer needed in FLTK itself. There is only one
demo program (test/forms.cxx) that uses it if it is built. The demo
program displays a message if fltk_forms is not available.

The default is 'enabled' for backwards compatibility but this may
be changed to 'disabled' in a future version.
2023-12-20 17:33:37 +01:00
ManoloFLTK
96bacd3f9d Procedure to instruct FLTK to use given X11 connexion (#149) 2023-12-19 15:48:26 +01:00
Greg Ercolano
1e6ac9c9bb Fix issue #871 for html causing crashes 2023-12-18 11:32:34 -08:00
ManoloFLTK
46b2f50750 Wayland: Menu items are accessible when mouse is over another win (#869) 2023-12-18 07:49:02 +01:00
Matthias Melcher
469d3ef3d5 #842: Enables command line color arguments on macOS 2023-12-16 21:59:43 +01:00
Greg Ercolano
c0d7fe9af9 Small doc clarification 2023-12-16 07:39:17 -08:00
Matthias Melcher
f7eb21d92e Fixes fl_message_position for widgets and subwindows
-  https://groups.google.com/d/msgid/fltkcoredev/902a753e-7430-4302-b384-c30c7d45e3bfn%40googlegroups.com.
2023-12-16 14:45:40 +01:00
Matthias Melcher
046bf23a5d Adds mouse wheel input to Fl_Counter 2023-12-16 14:22:22 +01:00
Matthias Melcher
ca028872e7 #868: Suppress warning about unused private members of Fl_Shortcut_Button 2023-12-16 14:07:08 +01:00
Albrecht Schlosser
411c3df1cb Fix memory leak in Fl_Terminal (#867) 2023-12-16 01:37:21 +01:00
Albrecht Schlosser
e951db4c49 Fix C++ comments in C file 2023-12-15 20:03:35 +01:00
MatthiasWM
fdf578d936 #840: Fixes fixed buffer size in Fl::args_to_utf8() (fl_call_main) 2023-12-15 12:56:06 +01:00
ManoloFLTK
673fa2e09c FLTK implementation of the "GTK Shell" Wayland protocol - cont'd
The loop over all libdecor-gtk decorations is now made using libdecor's
data structures, rather than using FLTK's mapped window list.
2023-12-14 07:55:31 +01:00
MatthiasWM
6ac3e8e230 #840: Fixes fixed buffer size in Fl::args_to_utf8() 2023-12-13 20:00:49 +01:00
Albrecht Schlosser
0c712e50bc Fix X11 '_NET_ACTIVE_WINDOW' message (STR 3396)
Send a valid timestamp rather than 0.

For details see STR 3396.
2023-12-13 19:07:30 +01:00
Matthias Melcher
41dd84016d #862: Removes default shortcut from Fl_Shortcut_Button
- the current UI for fallback/default/original shortcut was
confusing, so I remove it until we find something better. I
kept the values so we can reinstate a better interface without
changing the API.
2023-12-13 16:55:16 +01:00
ManoloFLTK
0936c2a55d FLTK implementation of the "GTK Shell" Wayland protocol - cont'd
The pointer_enter() function now checks that its non-FLTK wl_surface  argument
is the wl_surface of the titlebar of a GTK-decorated window.
2023-12-13 14:48:08 +01:00
Greg Ercolano
eedc5bdc0e Allow walk while selection is being made 2023-12-13 02:52:03 -08:00
ManoloFLTK
9738e52511 macOS platform + GLUT: fix crash with glut_test - cont'd 2023-12-13 10:41:15 +01:00
ManoloFLTK
36d34983bb Wayland+GLUT: fix crash in glut_test application - cont'd 2023-12-13 10:17:22 +01:00
Greg Ercolano
817966f215 Address hang in issue #866 2023-12-12 13:47:55 -08:00
Matthias Melcher
c10183379f #188: Fixes Fl_Shared_Image ref count and find op
- ported froward from 1.3.9
- fixes ref count for original and other images
- fixes binary search issues
2023-12-12 22:44:49 +01:00
Matthias Melcher
32b10cb626 #863: Fixes Fl_tile resize behavior when scaling window 2023-12-12 22:07:39 +01:00
ManoloFLTK
04cf2c4c7d Wayland+GLUT: fix crash in glut_test application 2023-12-12 21:17:42 +01:00
ManoloFLTK
a20bace4e1 macOS platform + GLUT: fix crash with glut_test app 2023-12-12 19:46:38 +01:00
Kyriet
5e3681c22a Documentation: Improve doc comment for ~Fl_Group 2023-12-10 22:04:08 +01:00
ManoloFLTK
861bc339c0 Replace wl_output_destroy() by wl_output_release() when possible 2023-12-10 12:48:06 +01:00
Albrecht Schlosser
094ee9e953 Documentation: remove obsolete deprecation warning
This warning was only useful when we used Fl_String in our public
interface which is no longer true.
2023-12-09 19:45:42 +01:00
Matthias Melcher
81a9cb74c3 #862: Fixes Fl_Shortut to swallow all FL_SHORCUT events if hot. 2023-12-08 15:09:42 +01:00
ManoloFLTK
d963dde3ef Document Fl_Image_Surface::mask() with commented code example 2023-12-07 15:01:23 +01:00
Greg Ercolano
2571f20111 Solve issue 856: manolo's parameter names 2023-12-06 12:14:45 -08:00
ManoloFLTK
18ccbb4a4f Wayland: much lighter but partial implementation of the "GTK Shell" protocol
Only the middle-button click gesture is implemented which avoids interference
with what libdecor does with right-click and double-click.
2023-12-05 22:53:26 +01:00
Matthias Melcher
7a69c22bd7 #856: FLUID: improved Declaration dialog
Also makes enum comment in Fl_File_Chooser.fl manageable.
Not backward compatible: don't try to recreate the
File Chooser with older FLUID versions.
2023-12-05 17:54:13 +01:00
ManoloFLTK
538ad1828f Wayland+CMake: use set_source_files_properties() for libdecor - cont'd 2023-12-05 16:09:36 +01:00
ManoloFLTK
7bbfa06e38 Wayland+CMake: use set_source_files_properties() for libdecor 2023-12-05 08:52:21 +01:00
Greg Ercolano
c3849b0a97 Fix issue 854 - append_ansi() len fix 2023-12-04 09:30:54 -08:00
Albrecht Schlosser
a73a14347d Fix compiler warnings
fluid/code.cxx: unused variable

src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx:
  function may return address of local variable [-Wreturn-local-addr]
2023-12-04 16:50:23 +01:00
ManoloFLTK
3e61ec7044 New member function Fl_Image_Surface::mask(Fl_RGB_Image*) 2023-12-04 12:34:44 +01:00
Greg Ercolano
b9ac6bd728 Solves issue #856: improve Fl_File_Chooser enum docs 2023-12-03 18:10:33 -08:00
Albrecht Schlosser
9950c8e082 Improve contrast of check marks and radio buttons (#443)
- add fl_draw_radio(...) to standardize radio button drawing
- src/Fl_Light_Button.cxx: use fl_contrast() to determine color of
  radio button and check (light) button check marks, and use
  new fl_draw_radio() method
- src/Fl_Menu.cxx: same as src/Fl_Light_Button.cxx and use
  fl_draw_check() instead of "manually" drawing the check mark
  (forgotten in an earlier update)
2023-12-02 19:34:29 +01:00
ManoloFLTK
f72748bb45 Wayland: make OPTION_USE_SYSTEM_LIBDECOR ON by default
This commit makes the default FLTK build setting use libdecor
as packaged in Linux when the build system contains packages
libdecor-0-dev and libdecor-0-plugin-1-gtk in version ≥ 0.2.0.
Otherwise, FLTK uses the bundled version of libdecor.
This includes situations where package libdecor-0-dev is
present in an earlier version.
2023-12-02 09:28:08 +01:00
Matthias Melcher
96730f80cb Adds some possible NULL references and small fixes 2023-12-01 16:53:27 +01:00
Matthias Melcher
1077d74958 Fixes name conflict in X11 GL swap_interval 2023-12-01 02:33:38 +01:00
ManoloFLTK
7472e41ccc Wayland: use GTK Shell also with system libdecor 2023-11-30 19:36:06 +01:00
Matthias Melcher
a69fc0c9e5 Fixes anonymous union intialisation for C++98 2023-11-30 15:55:37 +01:00
Greg Ercolano
38aff7d9b4 solve issue 853: make scrollbar public 2023-11-29 08:29:24 -08:00
Albrecht Schlosser
727bd94560 Add commandline conversion for Windows (no-op on other platforms)
- add Fl::args_to_utf8() to convert commandline arguments to UTF-8

This new function closes the gap that previously only Visual Studio
applications converted their commandlines to UTF-8.

Tested with MinGW, MSYS2/MinGW-w64, and Visual Studio (2019).
2023-11-29 16:29:54 +01:00
Matthias Melcher
49af3d88e3 Adds OpenGL swap interval documentation. 2023-11-29 14:02:50 +01:00
MatthiasWM
06e2bd7f0e Merge branch 'master' of https://github.com/fltk/fltk 2023-11-29 13:16:35 +01:00
MatthiasWM
75c879e2ff Implements swap_interval for MSWindows. 2023-11-29 13:16:24 +01:00
Matthias Melcher
82e838f1fd Adds OpenGL swap_interval for Wayland and X11. 2023-11-28 16:35:39 +01:00
ManoloFLTK
59bdb45566 Rearrange PostScript graphics driver code redundant with Cairo driver 2023-11-28 15:05:58 +01:00
ManoloFLTK
12af9dad3e Remove PostScript graphics driver code redundant with Cairo driver 2023-11-28 09:06:17 +01:00
Albrecht Schlosser
57371365d8 Fix compiler warning, dependencies, and trailing whitespace
The benign warning was:
  ‘Fl_Browser_::hscrollbar’ will be initialized after [-Wreorder]
  ‘int Fl_Browser_::linespacing_’ ...
2023-11-27 15:33:53 +01:00
ManoloFLTK
6ea31316fb Cairo graphics driver: Improve drawing of Fl_Pixmap and Fl_Bitmap 2023-11-27 12:15:21 +01:00
ManoloFLTK
f6d2ba651b Cairo graphics driver: Improve drawing of Fl_Pixmap and Fl_Bitmap 2023-11-27 10:02:59 +01:00
Matthias Melcher
f3348e8120 Adds GL swap control for X11 2023-11-26 21:44:00 +01:00
Matthias Melcher
6817e821af STR 1373: adds vsync control to OpenGL contexts on macOS
Windows and X11 to follow, no idea about Wayland.
2023-11-26 12:37:59 +01:00
Matthias Melcher
102437f1ee Restores mouse pointer before popping up cut/copy/paste menu
on Fl_Input and Fl_Text_Display
Also adds &ndash; to Help View
2023-11-26 12:00:09 +01:00
Matthias Melcher
39a3212fc3 Adds pulldown menu to Fl_Text_Display and ..._Editor 2023-11-25 22:52:00 +01:00
Matthias Melcher
c097f63ff8 Cleans up Fl_Input right mouse button menu 2023-11-25 22:08:05 +01:00
Matthias Melcher
7bef4ebf78 STR 749: Adds cut/copy/paste popup menu to Fl_Input 2023-11-25 21:42:27 +01:00
Albrecht Schlosser
09242ee16d Fix and improve fl_call_main.c
- add missing NULL pointer at end of argv
- fix #if condition for compilation

Todo: another update will follow soon, using a standardized FLTK
interface for argument conversion to UTF-8 for non-MSVC builds.
2023-11-25 21:17:27 +01:00
Matthias Melcher
34ed30fe1a Adds linespacing() to Fl_Browser_ and all derived widgets 2023-11-25 18:20:08 +01:00
Greg Ercolano
0080850092 Fl_Terminal better name for flags -> charflags 2023-11-25 06:56:38 -08:00
ManoloFLTK
4f894e4745 Cairo graphics driver: Improve drawing of Fl_Pixmap and Fl_Bitmap
Previously, these objects were drawn slightly blurred on HighDPI.
This commit has them resized to the pixel size of the area where
they are being drawn and then drawn.
2023-11-25 12:09:54 +01:00
Matthias Melcher
0beab855a0 Stabilizes Fl_Tile size_range mode.
- improved documentation
- new tile resize strategy
- robust against zero sized children
2023-11-23 17:19:20 +01:00
Matthias Melcher
b6be421a1f Added safety when calling Text_Display methods
- before assigning a buffer (Github #845)
- also fixed a warning form unused arg in Fl_Terminal
2023-11-23 15:16:34 +01:00
Matthias Melcher
de2dd0cddf Adds zero size check in Fl_Tile::on_move 2023-11-23 00:03:35 +01:00
Matthias Melcher
f8d915cfe6 Fixes warning in Fl_Tile by Doxygen 2023-11-22 22:17:35 +01:00
Matthias Melcher
c961f84086 Fixes warning and errors. 2023-11-22 14:51:59 +01:00
Matthias Melcher
81e26b9089 Adding size range settings to Fl_Tile, initial commit.
- some documentation missing
- Fl_Tile::resize() not satisfying yet
- minimums work, maximums currently ignored
- 0 size children may make program hang
2023-11-22 14:45:13 +01:00
Greg Ercolano
9383f172a8 Fl_Terminal docs: Added some tables 2023-11-21 14:41:15 -08:00
Greg Ercolano
c568056244 Added output_translate(): controls lf -> crlf translation 2023-11-21 11:24:27 -08:00
Greg Ercolano
11e6fb5911 Fl::check() docs fix: example indented 2023-11-20 13:36:55 -08:00
Greg Ercolano
7c95aa7c79 Change Fl_Terminal default color() 0x0 -> FL_BLACK 2023-11-20 13:33:08 -08:00
Greg Ercolano
6252131017 Solve issue 837, doc some protected methods. 2023-11-20 09:26:40 -08:00
ManoloFLTK
eb9dd202b2 Fix Fl_Wayland_Image_Surface_Driver c'tor 2023-11-20 10:56:36 +01:00
Greg Ercolano
bc8b186398 Doc all pub/prot members, remove unused, add todo
- Made sure all public+protected members are documented.

- Reclassified some private -> protected:
   > vscroll_width()

- Removed signatures for unimplemented (non-existant) methods:
   > u8c_cursor(void)
   > history_use(int,bool)
   > cursor_h()

- Reclassified some protected -> private:
   > x_to_glob_col()
   > xy_to_glob_rowcol()
   > is_hist_ring_row()
   > is_disp_ring_row()
   > handle_ctrl()
   > is_printable()
   > is_ctrl()
   ..etc..
   > handle_selection_autoscroll()
   > handle_selection()
   > is_redraw_style

- Add todo for ESC 7 and ESC 8
- Small code formatting mods
- Small typos
2023-11-19 22:46:04 -08:00
Albrecht Schlosser
7e8994c4a2 Windows/MSVC: Fix wide char commandline handling (#840)
Windows programs (subsystem:windows, not Windows console programs)
compiled with Visual Studio need a WinMain entry point. The commandline
arguments handled by this function are now properly converted to UTF-8
before the standard main() entry point is called.

This applies only to Visual Studio! Note that some build systems like
MinGW and/or MSYS2 may still have issues with some Unicode (non-ASCII)
commandline arguments.
2023-11-19 19:08:53 +01:00
Albrecht Schlosser
44bb080c0f Remove friend declaration from Fl_Window.H (see STR 3354)
Although this was not strictly necessary I decided to implement the
proposed patch, but in a slightly different way.

This adds a static public method for internal use only but it wouldn't
do any harm if a user called it.
2023-11-17 16:55:37 +01:00
Greg Ercolano
38fc08c15f Added clear(), some methods protected->public
New public methods:

    void clear(void);
    void clear(Fl_Color val);

old protected methods made public:

    void clear_screen(bool scroll_to_hist=true);      // ESC [ 2 J
    void clear_screen_home(bool scroll_to_hist=true); // ESC [ H ESC [ 2 J
    void cursor_home(void);                           // ESC [ 0 H

test/terminal modified to test these, and added separate tests
for both the API and ANSI code ways to do these ops.
2023-11-16 15:45:29 -08:00
Matthias Melcher
d1d38090fb Fixes return type of Fl_Input_::dvalue() 2023-11-15 22:45:20 +01:00
Albrecht Schlosser
6f021d4830 CMake: Raise cmake_minimum_required from 3.12 to 3.15
Remove code that checks CMake versions lower than 3.15
2023-11-15 21:30:12 +01:00
Albrecht Schlosser
45fd145370 Remove mention of Fl_Simple_Terminal 2023-11-15 14:11:25 +01:00
ManoloFLTK
dd1c2fc843 Wayland: fix moving top-level window around with mouse 2023-11-15 11:48:45 +01:00
Greg Ercolano
605328e045 Added textcolor() and color(), doc fixes.
textcolor() needed for consistency, color() behavior documented.

Both added to the test/terminal app.

Elaborated on the special background "see through" color value + behavior,
tested with color() in test/terminal app.
2023-11-14 12:23:23 -08:00
Albrecht Schlosser
4b315d190c Fix dependencies and whitespace issues 2023-11-14 18:14:48 +01:00
erco77
6842a43a31
Fl_Terminal widget (#800)
Pull Fl_Terminal widget from Greg's fork
2023-11-14 07:01:52 -08:00
ManoloFLTK
888dc5f5c5 Have libdecor-gtk implement the "GTK Shell" protocol 2023-11-12 19:13:35 +01:00
ManoloFLTK
768dcf2c11 Fix: Potential NULL pointer dereference in Fl_Image_Surface c'tor (#834) 2023-11-12 08:56:51 +01:00
ManoloFLTK
ce9ba4ba08 Remove unseless code in Fl_Wayland_Screen_Driver.cxx 2023-11-12 08:40:37 +01:00
ManoloFLTK
ff134f0081 Wayland: make fl_close_display() free more resources 2023-11-09 07:58:08 +01:00
ManoloFLTK
5989caf070 Wayland: fix crash in editor after return from switching user 2023-11-08 10:25:08 +01:00
ManoloFLTK
93b26e4d3b Let Wayland FLTK client apps survive switching user 2023-11-08 09:18:30 +01:00
Matthias Melcher
214b133298 Fixes initial calculation of line number in Fl_Text_Display (#830) 2023-11-07 15:09:08 +01:00
Matthias Melcher
90d7737254 Fix buttons overlapping icon in message box (#826) 2023-11-07 14:28:22 +01:00
Matthias Melcher
d7768b76d0 FLUID: Adds template for tutorial.
Tutorial still to be written.
Also adds convenience methods to Fl_Input_
for getting and setting numeric values.
2023-11-07 14:28:22 +01:00
ManoloFLTK
8b31954d66 "hitting esc to close fltk app blows out the window manager" (#821) 2023-11-07 11:32:12 +01:00
ManoloFLTK
acc96cdf56 CHANGES.txt: add Fl_Grid, Fl_Window::maximize()
Also, remove stray virtual keyword.
2023-11-06 07:44:55 +01:00
ManoloFLTK
6a607c8282 maximize method for Fl_Window (macOS) (#820) - cont'd 2023-11-06 00:05:18 +01:00
Matthias Melcher
f3b490134e Fixes text input widget undo propagation.
If not handled, undo propagates to other random widgets,
and if none takes it, it is resent as a redo to all widgets.
2023-11-05 22:19:03 +01:00
ManoloFLTK
0ae927a00e Add Fl_Window::maximize() and Fl_Window::un_maximize() 2023-11-05 19:42:55 +01:00
ManoloFLTK
d4d72cfdaf Related to "FLTK doesn't work normal on platform of rockchip" (#817) 2023-11-03 22:10:01 +01:00
ManoloFLTK
eb3afb2033 Wayland copy: destroy data_source object before creating new one 2023-11-03 15:16:36 +01:00
ManoloFLTK
a3f4c62826 Wayland copy: destroy data_source object before creating new one 2023-11-03 13:12:32 +01:00
ManoloFLTK
c0c0ea18aa Fix "fltk 1.4.x: hangs during paste in fluid code editor" (#818) 2023-11-03 12:50:18 +01:00
ManoloFLTK
040607b595 Minor change in Fl_Wayland_Graphics_Driver::copy_offscreen() 2023-11-02 09:08:16 +01:00
ManoloFLTK
914ee02c5f Fix typos in documentation 2023-11-01 12:26:54 +01:00
Albrecht Schlosser
c47fd75bcd Fix typos 2023-10-31 18:22:42 +01:00
ManoloFLTK
9a00f07c4f Move the Fl_String class to the DriverDeveloper Doxygen group 2023-10-31 18:01:53 +01:00
ManoloFLTK
8b603b9f1b Move private classes to the DriverDeveloper Doxygen group
Classes moved are
-Fl_Int_Vector
-Fl_Kdialog_Native_File_Chooser_Driver
-Fl_Zenity_Native_File_Chooser_Driver
2023-10-31 17:51:32 +01:00
ManoloFLTK
0e41ca820d Remove 81615bb causing GL window to blink when resizing on macOS (#813) 2023-10-31 16:52:59 +01:00
ManoloFLTK
99826a5fba Minor simplification in Fl_X11_Window_Driver::flush_double(int) 2023-10-30 18:27:12 +01:00
Matthias Melcher
aab6afd32c FLUID: Documentation and typos. 2023-10-27 16:09:06 +02:00
ManoloFLTK
06d12892f9 Fix "Wayland: Overlay windows look blurred" - cont'd (#808) 2023-10-25 15:20:34 +02:00
ManoloFLTK
35d8504263 Fix "Wayland: Overlay windows look blurred" - cont'd (#808) 2023-10-25 13:02:34 +02:00
ManoloFLTK
a5e8fbcca0 Fix "Wayland: Overlay windows look blurred" (#808) 2023-10-24 23:09:09 +02:00
ManoloFLTK
0636c0b3e6 Wayland: implement scale factor windows as popups - cont'd 2023-10-24 19:25:59 +02:00
Albrecht Schlosser
e391dc1bf9 Fix Fl_Flex::resize() and layout() (#811)
Remove "too optimistic optimization" in resize(). Resize must always
call layout() to recalculate widget positions.
2023-10-24 18:13:11 +02:00
Albrecht Schlosser
5a8a28cbb5 Remove test/debug statements from Fl_Table.cxx 2023-10-24 12:51:40 +02:00
ManoloFLTK
3868ea90bd Wayland: implement scale factor windows as popups - cont'd 2023-10-24 09:43:23 +02:00
Matthias Melcher
b9758f564f FLUID: Fixes two minor bugs
* Fl_Grid mixed up gap_ro_ vs. gap_col_ once
* Code formatting warning
2023-10-23 18:28:52 +02:00
ManoloFLTK
e0aae4401a Use #ifdef FLTK_USE_SVG instead of #if FLTK_USE_SVG 2023-10-23 16:40:48 +02:00
ManoloFLTK
3307a1281f Prepare Fl_Wayland_Screen_driver.cxx for removal of Fl_Int_Vector 2023-10-23 16:21:16 +02:00
ManoloFLTK
fa1f00cc46 Wayland: simpler implementation of transient scale factor windows 2023-10-23 15:00:34 +02:00
ManoloFLTK
234c153853 Avoid macOS 14 warning message when app is launched from command line 2023-10-23 12:13:29 +02:00
ManoloFLTK
39a157a7dd Wayland: implement transient scale factor windows as popups
as discussed in issue #794.
Also, fix for macOS the use of the FL_FOCUS event for these transient windows
2023-10-23 11:15:04 +02:00
Matthias Melcher
17baeceb7a FLUID: Positioning grid cells intuitively.
User can now drag widgets from the toolbox into the grid
or use the context menu to add them into the corresponding
cell. If no position is indicated, now children are added at the
first free cell.
2023-10-23 01:36:55 +02:00
Albrecht Schlosser
1209e9dcd7 Make Fl_String and Fl_Int_Vector private (#789)
- add CMake option 'OPTION_USE_STD'
- add configure option '--enable-use_std'
- move FL/Fl_String.H to src/Fl_String.H
- move FL/Fl_Int_Vector.H to src/Fl_Int_Vector.H
- remove Fl_String from demo program examples/callbacks.cxx
- remove Fl_Int_Vector from public header FL/Fl_Table.H
- some methods of Fl_Table are no longer inline
- add CMake option OPTION_USE_STD to allow std::string in some
  selected functions and methods

Experimental, may be removed before release:

- use either Fl_Int_Vector or std::vector in Fl_Table depending
  on CMake OPTION_USE_STD or configure --enable-use_std

Move all fl_filename* functions that use Fl_String to fluid

Main changes in fluid:
 - add fluid_filename.h and .cxx
 - include "fluid_filename.h" rather than <FL/filename.H>

Update fl_input(), fl_password() and test/ask

- add maxchar parameter to fl_input() and fl_password()
- fl_input_str() and fl_password_str() are optional and return
  std::string if enabled (FLTK_USE_STD)
2023-10-22 19:35:17 +02:00
Matthias Melcher
12c88f6506 FLUID: removes duplicate code 2023-10-22 01:57:08 +02:00
Matthias Melcher
b4fd7037ac FLUID: more Fl_Grid settings 2023-10-22 01:51:53 +02:00
Albrecht Schlosser
d102e466d6 Remove duplicated code that was commented out, fix includes
... and prevent confusing doxygen
2023-10-21 21:39:36 +02:00
Albrecht Schlosser
3289c8b947 Fix compiler warning [-Wreturn-type]
"control reaches end of non-void function"
2023-10-21 21:38:38 +02:00
Matthias Melcher
bbf0ea664d Removes dependency on Fl_Preferences::get/set(.., Fl_String, ...) 2023-10-21 18:41:57 +02:00
Matthias Melcher
0c35212467 FLUID: grid becomes a bit more interactive 2023-10-21 17:45:40 +02:00
Matthias Melcher
f8d7ee6f5c FLUID: adding a subset of Fl_Grid child parameters. 2023-10-21 13:20:11 +02:00
ManoloFLTK
7a434575ac Fix "Keyboard sometimes stops working after Ctrl/+ or Ctrl/-" (#794) 2023-10-21 09:46:20 +02:00
Matthias Melcher
9817536cfd FLUID: basic Fl_Grid support
* no settings for children yet
* ne good interactive editing for children
2023-10-20 19:00:52 +02:00
Albrecht Schlosser
757b5c1227 Fix ctrl/+/- in cube demo
- Fl_Grid: force layout() on resize() - needed for GL subwindows

- test/cube.cxx:
  - use end() in constructor of class cube_box
  - ensure not to change the current group when adding a button
2023-10-20 11:28:08 +02:00
Albrecht Schlosser
450248d20e Check that a widget is a child of its Fl_Grid parent
... when assigning it to a cell. This is required for consistency.
2023-10-19 19:23:59 +02:00
ManoloFLTK
ff7958e57a Fix "Keyboard sometimes stops working after Ctrl/+ or Ctrl/-" (#794) 2023-10-19 11:00:30 +02:00
ManoloFLTK
c1d9376934 Fix for "Keyboard sometimes stops working after Ctrl/+ or Ctrl/-" (#794) 2023-10-19 08:27:59 +02:00
Albrecht Schlosser
56af338cfd Fix Fl_Tile::set_cursor() which was broken
... since commit 6ba7b49baf.
2023-10-18 17:00:48 +02:00
Albrecht Schlosser
27a779b235 Fix trailing whitespace 2023-10-18 15:00:37 +02:00
ManoloFLTK
c27009e52c launching a binary from the command line hangs on macOS Sonoma (#799) 2023-10-18 07:21:20 +02:00
ManoloFLTK
9f141aefc6 Fix drawing points in complex shape mode with Cairo (#792) 2023-10-17 21:14:34 +02:00
ManoloFLTK
c62501c93a launching a binary from the command line hangs on macOS Sonoma (#799) 2023-10-17 19:02:34 +02:00
ManoloFLTK
50b04b565b Fix Crashes and warnings when Fl_Double_Window is smaller than 1x1 (#798) 2023-10-17 09:37:01 +02:00
Albrecht Schlosser
38871c5b31 Add Fl_Grid widget and test and demo programs
- FL/Fl_Grid.H: header file
- src/Fl_Grid.cxx: implementation

- examples/grid-simple.cxx: simple example program
- test/cube.cxx:            use Fl_Grid for layout
- test/grid_alignment.cxx:  test cell alignment and other functions
- test/grid_buttons.cxx:    demo program as discussed in fltk.general
- test/grid_login.cxx:      like test/flex_login.cxx but with Fl_Grid
- test/flex_login.cxx:      modified to match test/grid_login.cxx
2023-10-16 22:18:24 +02:00
Albrecht Schlosser
e7b790ae31 Fix Windows (MSVC) compiler warnings
warning C4244: '=': conversion from 'double' to 'time_t',
  possible loss of data

warning C4244: 'return': conversion from 'time_t' to 'long',
  possible loss of data
2023-10-16 22:04:12 +02:00
ManoloFLTK
010b179489 Remove Doxygen warning in Fl_Tile.cxx line 185
The warning was
warning: End of list marker found without any preceding list items.
2023-10-16 21:11:34 +02:00
ManoloFLTK
ae4ed35229 Add virtual void Fl_Graphics_Driver::draw_circle() 2023-10-16 20:53:55 +02:00
ManoloFLTK
15fe9d9880 Fix Drawing artifact with radio buttons under Cairo (#792) - cont'd 2023-10-16 16:38:13 +02:00
ManoloFLTK
09e06dc703 Fix indentation 2023-10-16 14:51:50 +02:00
Albrecht Schlosser
6ba7b49baf Improve subclassing cababilities of Fl_Tile (STR 2791)
- remove static variables and functions
- make move_intersection() virtual
- add (protected) cursor access methods

These changes were inspired by STR 2791 where the user proposing an
enhancement was not able to subclass Fl_Tile properly. This commit
fixes the mentioned issues and enables subclassing without copying
internal code.
2023-10-16 13:33:40 +02:00
ManoloFLTK
da5331b592 Open
Fix Drawing artifact with round check buttons in menu under Cairo (#792)
2023-10-16 12:47:06 +02:00
Albrecht Schlosser
4964a15c01 Improve small radio buttons by using fl_draw_circle()
This removes duplicated code as intended when fl_draw_circle()
was introduced.
2023-10-15 12:25:21 +02:00
Albrecht Schlosser
fd6accec24 Fix small circle drawing and add doxygen \since statement
src/fl_draw.cxx: improve documentation, add \since 1.4.0,
  simplify scaling code, use forgotten 'color' argument to set the
  circle color.

src/fl_draw_arrow.cxx: add doxygen \since statement
2023-10-15 11:30:19 +02:00
Matthias Melcher
56ad8f8a78 Draws nicer small circles if display is scaled up. 2023-10-14 14:57:29 +02:00
ManoloFLTK
ded5839d9c Improve Fl_Wayland_Window_Driver::take_focus() 2023-10-14 09:43:35 +02:00
Albrecht Schlosser
01038e832a Fix trailing whitespace and dependencies 2023-10-13 19:08:30 +02:00
ManoloFLTK
6958e5d615 Drawing artifact with round check buttons in menu under Cairo (#792) 2023-10-13 15:30:12 +02:00
ManoloFLTK
c274ae1365 Remove obsolete comments 2023-10-13 15:30:12 +02:00
Matthias Melcher
58b13b868e FLUID: allow mousewheel events on coordinate input
MACOS: make sure that even small mouse wheel deltas count at least as 1 unit
2023-10-13 13:59:01 +02:00
Matthias Melcher
b1321bb97e #748: Adds option to choose menu window boxtype
...independently from the menu button or menu bar boxtype
2023-10-13 12:49:26 +02:00
Matthias Melcher
d7a5e5099c Fixes conversion warning. 2023-10-11 23:33:31 +02:00
Matthias Melcher
c41b3a1a64
Fixes fl_filename_relative on Linux, Mac, and Windows (#787)
* fixed filename_relative for Linux
* Fixing fl_filename_relative for MSWindows.
* Update documentation
* Fixed docs.
* Fixes Linux and macOS builds
2023-10-11 23:26:36 +02:00
Matthias Melcher
33b601e574
Synchronize all arrow colors and inactive drawing (#791) 2023-10-11 23:25:52 +02:00
ManoloFLTK
86cadec162 macOS: remove availability warning 2023-10-11 10:53:03 +02:00
ManoloFLTK
00aab5e698 Add legit #pragma clang diagnostic ignored "-Wdeprecated-declarations" 2023-10-11 10:17:31 +02:00
leen
fcaae03537
Fix default color of ATTR_GRAMMAR/ATTR_SPELLING (#790) 2023-10-10 22:03:40 +02:00
ManoloFLTK
bb7e1635ad macOS: remove a bunch of deprecation warnings 2023-10-09 11:16:36 +02:00
ManoloFLTK
d1436f4f63 Clean long source lines in Fl_Wayland_Graphics_Driver.cxx 2023-10-09 09:11:20 +02:00
ManoloFLTK
da15a12ffe Fix " Wayland compilation warnings" (#788) 2023-10-09 08:11:54 +02:00
Albrecht Schlosser
1fd6f0dd3a Fix STR 3458: "GLUT compatibility mode segfaults"
... "when there's no current window".

Silently ignore GLUT function calls that need a current window if the
current window is NULL, return 0 from functions that return an 'int'.

Check if window is shown in Fl_X11_Gl_Window_Driver::swap_buffers().
This would issue "XRequest.nnn: GLXBadDrawable 0x0" on X11 otherwise.

Note: the chosen implementation to ignore GLUT calls silently appears
to be compatible with GLUT (3.7) whereas FreeGLUT 3.0 would issue error
messages and exit. The latter could be implemented as well but would
be much more work.
2023-10-07 17:14:11 +02:00
ManoloFLTK
f6690a9742 Fix: macOS runtime warning makeKeyWindow... (#785) 2023-10-06 19:02:09 +02:00
ManoloFLTK
4d9805537b Change prototype to Fl::now(double offset = 0) 2023-10-06 16:23:08 +02:00
ManoloFLTK
6571bd2f28 Wayland: whitespace only changes 2023-10-05 17:07:55 +02:00
ManoloFLTK
e8f633cf2f Wayland: remove useless code 2023-10-04 10:24:27 +02:00
ManoloFLTK
aa14ffe6a1 Fix fltk.coredev: mandelbrot demo segfault under Wayland 2023-10-03 21:56:01 +02:00
Albrecht Schlosser
f8bf7e5da4 Avoid integer overflow on Windows in delta time calculation
See comment in the code. This makes the implementation more future
proof although it's still problematic starting around 2038.
2023-10-03 16:37:59 +02:00
ManoloFLTK
4132590d8c Wayland: add security test to avoid NULL pointer dereferencing 2023-10-03 08:13:33 +02:00
Matthias Melcher
76b16d8cef Fixes Fl_Tabs clipping offset 2023-09-30 13:41:49 +02:00
Albrecht Schlosser
a1f47148a3 Remove unused variable, silence compiler warning
warning: unused variable ‘dy’ [-Wunused-variable]
2023-09-29 16:27:03 +02:00
Matthias Melcher
144d7d3529 Adds Fl_Menu_::prev_mvalue() (#685) 2023-09-29 15:22:47 +02:00
Matthias Melcher
25a9af2f06 Fixes overlapping tabs (#718)
* corrects clipping of overlapping tabs
* fixes some issues with exotic box types
like rounded boxes
2023-09-29 14:12:39 +02:00
Matthias Melcher
f3eae58c52 Draw parent window backdrop on Fl_Tabs (#718) 2023-09-29 14:12:39 +02:00
ManoloFLTK
ff0a3a9d59 Wayland: throttle window redraws during interactive resizes (#776) 2023-09-29 12:29:52 +02:00
Matthias Melcher
c073c1fca7 Fix for CLEAR flag in Fl_Preferences
Fixed warning in new Fl_Preferences constructor
2023-09-27 12:26:35 +02:00
Matthias Melcher
71b8e77935
FLUID: adds greatly enhanced Shell Commands (#774)
The user can add an arbitrary number of highly configurable 
shell commands through the setting panel. The commands can
be saved as user preferences, inside the .fl file, or exported
to an external file. Shell scripts can be limited to individual 
platforms, can have shortcut keys, etc. .

* documentation will follow
* support to call `fltk-config` will follow
2023-09-26 16:01:03 +02:00
ManoloFLTK
2bbdd49465 Remove "warning: extended initializer lists only available with …" 2023-09-26 15:38:21 +02:00
ManoloFLTK
75273c06c5 Add Fl_Timestamp Fl::distant_past()
Can be handy when Fl::seconds_since() is used early at program startup
2023-09-26 12:31:20 +02:00
Matthias Melcher
0a2f05a2fe FLUID: Fixes regression #777
Wrote wrong path in #inlude statement under certain
conditions. Also removed 'snap' tag if not needed.
2023-09-26 00:29:26 +02:00
ManoloFLTK
b8fa522ca4 New member function Fl_Wayland_Graphics_Driver::create_wld_buffer()
The previous member Fl_Wayland_Graphics_Driver::create_shm_buffer() is now
renamed to create_wld_buffer() and divided in 2 parts:
- one is related to the draw buffer;
- the other is related to the wl_buffer and is what is now called create_shm_buffer().
This allows to delay creation of the wl_buffer until absolutely necessary,
done inside Fl_Wayland_Graphics_Driver::buffer_commit().
2023-09-25 16:40:01 +02:00
ManoloFLTK
59b251cc39 Slightly simpler Fl_Wayland_Window_Driver::flush()
and beef up description of Wayland's mechanism to throttle screen redrawing.
2023-09-24 09:52:48 +02:00
Albrecht Schlosser
c02ecbcae2 Regenerate src/Fl_File_Chooser.cxx from its fluid source file 2023-09-22 14:03:34 +02:00
Albrecht Schlosser
43ff6f0c32 Update dependencies 2023-09-22 14:03:34 +02:00
ManoloFLTK
220dd47bea Increase reuse of mmap'ed data by FLTK Wayland buffer factory 2023-09-22 11:51:24 +02:00
Greg Ercolano
cee69943e5 Small FNFC doc clarification; "pilots" -> "presets" 2023-09-20 23:34:43 -07:00
ManoloFLTK
a26e12590c Step back commit 8248183 that's unsatisfactory while resizing windows 2023-09-18 13:06:13 +02:00
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