Commit Graph

2736 Commits

Author SHA1 Message Date
Matthias Melcher
d3dca07339 #146: Add access to scrollbars widget in Fl_Help_View
- new methods are Fl_Help_View::scrollbar()
and  Fl_Help_View::hscrollbar(), taking inspiration from
Fl_Browser.
2025-07-08 14:36:24 +02:00
Matthias Melcher
5c33d3051f Fl_Help_View: Subclassing minor comment chages 2025-07-07 15:47:00 +02:00
Albrecht Schlosser
bdde3e5d2b Fl_Table_Row: replace private class CharVector with std::vector
FL/Fl_Table_Row.H: use `std::vector<uint8_t> _rowselect;`,
  remove declaration of class `CharVector`

src/Fl_Table_Row.cxx: remove implementation of class `CharVector`,
  simplify loops (use range based for loops),
  use resize() to change vector size.

Unify copyright year of Fl_Table* headers and implementation.
2025-07-07 14:55:55 +02:00
Albrecht Schlosser
51cca24d04 Add missing and remove unnecessary #include statements
Note: if user code requires a header, then user code must #include it.
2025-07-07 11:58:49 +02:00
Matthias Melcher
2a1677802f Fl_Help_View: Restoring bad includes for back compatibility 2025-07-05 20:39:55 +02:00
Matthias Melcher
e12c42a0cd Fl_Help_View: Revert some changes 2025-07-05 19:47:03 +02:00
Matthias Melcher
ccc294f9f7 Fl_Help_View: Thin out header file
- remove unnecessary include.
2025-07-05 17:48:30 +02:00
Matthias Melcher
5fb38897b7 Fl_Help_View: Refactor to use PIMPL
- using a Pointer to Implementation instead of having
a huge Fl_Help_View class. This improves build speed
(smaller header fiel) and allows us to fix the
implementation while keeping the ABI unchanged.
2025-07-05 17:35:41 +02:00
Matthias Melcher
b28afecb46 Fl_Help_View: C++ formatting fix. 2025-07-05 15:29:42 +02:00
Matthias Melcher
5d9961c1c3 Fl_Help_View: Finl formatting and documentation
- restructure header file
- sort source file reflecting header
- documentation of text selection
2025-07-05 15:25:11 +02:00
Matthias Melcher
d3c6135c08 Fl_Help_View: Improve selection
- users can now select text in multiple Help Views
- users can now select text that is also a link
- selections draws dimmed if not focused
2025-07-05 13:42:28 +02:00
Matthias Melcher
53665045d3 Fl_Help_View: Changes some more formatting
- streamlines callbacks
- removes unused function
- header file not finished yet!
2025-07-04 16:31:59 +02:00
Matthias Melcher
4e1450d750 Fl_Help_View: Refactoring static sizes
- replaced Fl_Int_Vector with std::vector<int>
- removed static buffers in path arrangement methods
- NULL to nullptr
2025-07-03 19:58:56 +02:00
Matthias Melcher
f0fa9fc8f8 Fl_Help_View: Improve formatting and Doxygen comments 2025-07-03 13:55:29 +02:00
Matthias Melcher
872e2b8fb6 Fl_Help_View: Refactor more strings and dynamic lists. 2025-07-03 00:39:53 +02:00
Matthias Melcher
5919dbb6af Fl_Help_View: Reformat and comments 2025-07-02 22:59:46 +02:00
Matthias Melcher
69431ef51f Fl_Help_View: Refactor Fl_Help_Link to C++11 2025-07-02 20:45:54 +02:00
Matthias Melcher
e4d43a3951 Help_View: Improve target line management 2025-07-02 17:54:43 +02:00
Albrecht Schlosser
a05ae33e20 Remove deprecated methods and functions
In FLTK 1.5 we remove most (but not all) methods and functions that
were deprecated in FLTK 1.3 or earlier.
2025-07-02 17:19:52 +02:00
Matthias Melcher
5bf1333f07 Set Fl_Menu_Item::setonly() to deprecated
for the version without the starting argument.
2025-07-02 15:42:46 +02:00
Albrecht Schlosser
a34711daeb Remove FLTK 1.4 ABI guards 2025-07-01 11:04:52 +02:00
Matthias Melcher
42b2388610 Improve bilinear image scaling below 50%
The original code can not scale well below 50%. To improve
filtering in a fast way, huge images are scaled by powers of
two before fine scaling using the original bilinear scale.
2025-06-30 14:56:26 +02:00
Matthias Melcher
eadea6a992 Update Fl::await() and friends API and documentation
This creates the base for #1263, but does not fix it yet.
2025-06-19 15:33:38 +02:00
Albrecht Schlosser
7897bbc04f Fix several compiler warnings [-Wextra-semi]
Example:
  warning: extra ‘;’ after in-class function definition [-Wextra-semi]

Also: replace 'FL_OVERRIDE' with 'override' in all modified files
2025-06-05 09:50:07 +02:00
Albrecht Schlosser
0960f1c066 Fl_Window::free_position() must not be deprecated
This method was erroneously declared 'deprecated' in previous versions.

However, this method is public and calls the *protected* method
Fl_Window::force_position(). Therefore it is kept as a regular
public method.
2025-05-14 19:05:04 +02:00
Albrecht Schlosser
3114ef0e2f Fix doxygen warnings
1. src/Fl_add_idle.cxx: add missing parameter docs

2. FL/fl_draw.H: rename 1st parameter of fl_draw_pixmap(...) from
   'data' to 'cdata'.

The 2nd warning appears to be caused by a 'friend' declaration in
  FL/Fl_Graphics_Driver.H, line 98:
    'friend FL_EXPORT int fl_draw_pixmap(const char*const* cdata, ...)'

This 'friend' declaration seems to "confuse" some (newer?) doxygen
versions, definitely doxygen 1.13.2.
2025-05-14 17:05:20 +02:00
Albrecht Schlosser
9b1379e688 Remove deprecated function Fl::set_idle()
This turned out to be more complicated than just to delete a function
because it was used internally, and the callback signatures were a bit
flaky. I also added a lot of documentation to clarify matters.

FL/Fl.H: document idle callback signatures, make some internal
  functions of class Fl private, add public Fl::idle() accessor (read-
  only), add Fl::add_idle(Fl_Old_Idle_Handler cb) to enable using
  old-style idle callbacks w/o 'data' argument.

FL/forms.H: replace Fl::set_idle() with Fl::add_idle().

src/Fl.cxx: rename private Fl::idle_ with trailing underscore.

src/Fl_System_Driver.cxx: use new public accessor Fl::idle() to access
  Fl::idle_ which is now private.

src/Fl_add_idle.cxx: improve documentation, clarify idle callback
  matching, add example code in docs, rename methods,  add overloaded
  Fl::add_idle(Fl_Old_Idle_Handler cb).

src/Fl_win32.cxx: use public Fl::idle() rather than private member.
src/drivers/Unix/Fl_Unix_System_Driver.cxx: same as above.
src/Fl_cocoa.mm: same as above.
2025-05-13 21:08:51 +02:00
Matthias Melcher
82b2001735 Fix unused parameter 2025-05-11 12:48:10 +02:00
Greg Ercolano
f8a7e299b0 Fl_Terminal doc fixes, private->protected for utf8_char_at_*() 2025-05-09 09:29:10 -07:00
ManoloFLTK
043bac6f8d Remove declaration of Fl_Scalable_Graphics_Driver from FL/Fl_Graphics_Driver.H
and declare it in non-public header src/Fl_Scalable_Graphics_Driver.H which also
declares classes Fl_Font_Descriptor and Fl_Fontdesc.
2025-05-09 09:51:36 +02:00
Albrecht Schlosser
53491f2ca0 Remove hardcoded version numbers: part 1
The goal is to change the version number for a new release only in
CMakeLists.txt. This is the first step.

Details:

- CMake/gen_config.cmake: this new file is included to generate the
  header files config.h (private, root directory), and FL/fl_config.h
  (public, can be installed). This file implements also ABI version
  checks (removed from FL/Enumerations.H and with more checks).
  Warnings are issued if the chosen ABI version is invalid.
- CMake/export.cmake: code to generate 'config.h' was moved to
  CMake/gen_config.cmake.
- CMake/options.cmake: set default of FLTK_BUILD_FORMS=OFF + comments
- CMakeLists.txt: move generation of FL/fl_config.h to gen_config.cmake,
  add API and ABI versions to CMake summary,
- FL/Enumerations.H: remove most of the version number details which
  are now included in FL/fl_config.h. This needed also some doxygen
  related changes.
- README.CMake.txt: improve docs of FL_ABI_VERSION and some more.
  Reflect the new default of CMake option FLTK_BUILD_FORMS (OFF).
- documentation/Doxyfile.in: add FL/fl_config.h to file list. This
  file is created in the build tree (and may be "installed").
- fl_config.h.in: add version number details that have been moved here
  from Enumerations.H (used to generate FL/fl_config.h).
2025-05-06 19:25:53 +02:00
Albrecht Schlosser
719642b5d6 Fix Doxygen warning for older Doxygen versions
Note: doxygen versions < 1.9.6 are not recommended for PDF docs
      but *may* work for HTML documentation.
2025-04-29 20:16:11 +02:00
Matthias Melcher
f4978a0149 Adding the FL_MENU_CHATTY flag to Fl_Menu_Item.
If set, menu items will also call the callback when highlighting changes.
The reason is given with Fl::callback_reason(). #941
2025-04-01 17:00:56 +02:00
Matthias Melcher
5dd1062df5 Adding FL_BEFORE_MENU event to classes derived from Fl_Menu_ 2025-03-29 23:36:19 +01:00
Matthias Melcher
b7189192e2 Adds a new event FL_TOOLTIP_EVENT...
... and Fl_Tootip::override_text() to allow users to dynamically
generate tooltips.
2025-03-29 22:40:18 +01:00
Albrecht Schlosser
cb86a37676 Allow FL_ABI_VERSION = FL_API_VERSION + 1
... so users can enable ABI features designated for the *next* release
when using FLTK from Git (or snapshots) before the API version has
been raised for that release.
2025-03-29 21:03:18 +01:00
Greg Ercolano
9e1e043af3 Changed two connector methods to virtual
For reference, see fltk.general thread started Mar 26 2025, entitled:
    "Make some Fl_Tree_Item methods virtual?"
2025-03-28 12:54:16 -07:00
Albrecht Schlosser
1ccafa83b2 Remove obsolete build option 'FLTK_OPTION_STD'
This option is no longer needed since FLTK 1.5 always requires C++11.
2025-03-19 14:44:16 +01:00
Albrecht Schlosser
b252e5e45c Remove libfltk_cairo (fltk::cairo)
This library is no longer needed and was "empty" for backwards
compatibility since FLTK 1.4.0.
2025-03-16 00:10:53 +01:00
Matthias Melcher
1186b4e255 Making fl_filename_... public for std::string.
New functions append "_str" to the function name to
avoid ambiguities when calling them. So
'char *fl_filename_name(const char *)' becomes
'std::string fl_filename_name_str(const std::string &)'
2025-03-07 20:26:03 +01:00
Matthias Melcher
3068c7a0af Fl_String is now just an alias for std::string.
All mentions of Fl_String will be replaced with std::string
and the Fl_String implementation will be removed.
2025-03-07 00:12:40 +01:00
Albrecht Schlosser
27101536f6 Define FL_OVERRIDE unconditionally as 'override'
FLTK 1.5 requires at least C++11, hence we can always use 'override'.

To do: the FL_OVERRIDE macro can be replaced by 'override' everywhere
in the FLTK code. There are more than 2400 occurrences and this
would be a large commit. Therefore it's not done right now...

Note: user code may continue to use FL_OVERRIDE.
2025-03-06 19:23:25 +01:00
Albrecht Schlosser
dc07f927f1 Fl_Group: convert array of children to std::vector
Note: this is only a hidden implementation detail: all concerned
variables are private, and the code is simplified (less error prone).

Size of Fl_Group on 64-bit Linux: 168 -> 176 Bytes (+8 Bytes).

test/group.cxx: test for Fl_Group::{add, insert, remove} etc.
2025-03-06 18:31:31 +01:00
Albrecht Schlosser
191b33e0de Update version numbers to 1.5.0 2025-03-06 18:16:03 +01:00
Albrecht Schlosser
e2ca1a39c8 Remove autotools (configure/make) support 2025-03-06 17:12:52 +01:00
ManoloFLTK
880636eb12 Fix "Windows: dotted lines may be drawn solid when GUI is rescaled" (#1214) 2025-03-04 16:04:10 +01:00
Albrecht Schlosser
02af6a57eb Bump version numbers to 1.4.2 2025-02-21 16:25:39 +01:00
Albrecht Schlosser
18ea5bcb20 Improve documentation of Fl_Box constructors (#1194)
Separate both constructor types and document parameters.
2025-01-29 14:33:07 +01:00
Albrecht Schlosser
a6f51105d0 Improve and reorder Fl_Tabs documentation
Note: this also removes the (not working) suggestion to add an invisible
box to an Fl_Scroll-type child of Fl_Tabs.
2025-01-16 15:42:45 +01:00
Albrecht Schlosser
d5461c55a7 Document issues with Fl_Scroll as children of Fl_Tabs (#1175)
Unfortunately this *appears* to be a new constraint caused by the great
new features of Fl_Tabs like overflow handling etc. and fixing drawing
issues in the tab area (since FLTK 1.4).

However, this conflict has already been there in 1.3 but didn't cause
visual artifacts in normal use.
2025-01-15 16:11:15 +01:00
Albrecht Schlosser
546a3168f6 Fix typos in documentation of Fl_Tabs 2025-01-15 16:05:01 +01:00
Albrecht Schlosser
a48ebc5db0 Fix return value of Fl_Table_Row::row_selected(int) (PR #1187)
As discussed in the context of PR #1187 the previous return value '-1'
was misleading and undocumented. The docs mentioned only '1' and '0'.

User code that used the return value as documented (like a `bool`)
would make the wrong decision if the return value was '-1': true
(selected) instead false (out of range).

This commit fixes the code by doing what the docs define and clarifies
the documentation.

Further documentation improvements of Fl_Table (example code used a
method that is not defined in Fl_Table) and of Fl_Table_Row are
included as well.

Doxygen docs of two methods of Fl_Table_Row moved to the .cxx file
where they belong according to the CMP.
2025-01-14 15:21:42 +01:00
Matthias Melcher
ca786597f7 Add Fl_Valuator destructor.
This is required by Swig to generate code for wrapping
FLTK for Python and potentially other languages. It has
no impact on the API or ABI.
2025-01-03 14:40:59 -06:00
ManoloFLTK
6c7b005a95 Remove duplication and typo in documentation of Fl::copy() 2025-01-02 15:47:35 +01:00
Albrecht Schlosser
0e6b20d957 Put ABI breaking changes under ABI guards (#1139)
This reverts the improvement of #1139 in the default build which is
now only available with FL_ABI_VERSION=10401 or higher.

Users that need this improvement need to build with the required
ABI version by setting it with configure or CMake.
2024-12-12 16:40:11 +01:00
Albrecht Schlosser
fe8177ea2c Update Fluid (.fl) files for release 1.4.1 2024-12-09 20:46:01 +01:00
Albrecht Schlosser
99a6286288 Bump version numbers for release 1.4.1
To do: update CHANGES.txt with real info.
2024-12-09 20:46:01 +01:00
Matthias Melcher
d1ba7fbf50 Giving access to some Fl_Text_Display member variables (#1153)
And typos in FLUID source code docs.
2024-12-07 17:31:14 +01:00
ManoloFLTK
be6966bda6 Add missing FL_EXPORT qualifier 2024-11-27 08:38:37 +01:00
ManoloFLTK
3633b342fd Restore pixmap drawing under X11-noCairo broken by 0952d59 2024-11-27 08:23:35 +01:00
Albrecht Schlosser
403981a293 Fix compiler warning (g++ 14) [-Wstringop-overflow]
New compiler warning detected by g++ 14.2.0 building with CMake
  in Release mode. This *temporary* fix suppresses the warning but uses
  even larger fixed size buffers.

Todo: these nasty warnings caused by using fixed buffer sizes should
  be removed by using std::string in FLTK 1.5.0.
2024-11-24 19:53:23 +01:00
Albrecht Schlosser
801125b9a4 Increase clipping stack size (#1139) 2024-11-23 16:01:59 +01:00
ManoloFLTK
1f05a0df44 Fix fl_draw_image sometimes crashes when window is scaled - cont'd (#1134) 2024-11-20 08:01:40 +01:00
ManoloFLTK
c6d480352b Add 2 other missing FL_EXPORT qualifiers 2024-11-19 15:47:23 +01:00
ManoloFLTK
e6d18cf713 Add 2 missing FL_EXPORT qualifiers 2024-11-19 15:37:05 +01:00
ManoloFLTK
619677b75c Fix fl_draw_image sometimes crashes when window is scaled (#1134) 2024-11-19 15:26:47 +01:00
ManoloFLTK
2337214e4e Fix for Windows and X11: Rounding issues with Fl_RGB_Image::draw() (#1120) 2024-11-12 10:56:19 +01:00
ManoloFLTK
37144c06a1 Undo 6f6a375 that does not properly support macOS SDK 15.x (#1103) 2024-11-04 04:50:31 +01:00
ManoloFLTK
6f6a375fca Recent macOS SDKs badly define MAC_OS_X_VERSION_MAX_ALLOWED
and the correct information is in __MAC_OS_X_VERSION_MAX_ALLOWED
2024-11-03 14:27:28 +01:00
Albrecht Schlosser
abf28f0b70 Improve and clarify documentation 2024-11-01 18:24:06 +01:00
ManoloFLTK
818e2b77d1 Wayland: Fix issue in maximization of a borderless window (#1099)
Also fixes scenarios mixing fullscreen and maximization:
- maximize
- set fullscreen
- unset fullscreen
- un-maximize
with and without window border.
2024-11-01 15:43:18 +01:00
Albrecht Schlosser
56cf5684dc Make Fl_Window::flush() public for consistency with subclasses
... as discussed on fltk.general recently

Note: this method was already public in all subclasses of Fl_Window.
2024-10-30 14:30:08 +01:00
Albrecht Schlosser
c0e07d3452 Add range check to Fl_Group::child(int)
Returns NULL if n is out of range to prevent accessing undefined
memory.
2024-10-25 02:39:47 +02:00
Albrecht Schlosser
74d827f71f Remove FL_MENU_RESERVED bit mask in favor of better documentation
This bit mask was added in commit 53b40f4138 in an attempt
to *document* reserved bits but it turned out that this mask could
have negative side effects on some newer compilers by propagating
the enum to an 'unsigned int' and issuing compiler warnings.

See this comment and follow-up's in fltk.general:
https://groups.google.com/g/fltkgeneral/c/7xrDkbkxiyw/m/rzEIJ7XhAgAJ
2024-10-19 15:58:51 +02:00
Matthias Melcher
737137cf78 Fixes Fl_Text_Display line number calculation. (#1088) 2024-10-19 15:53:29 +02:00
Albrecht Schlosser
04c8dd9d26 Add forgotten FL_OVERRIDE attribute 2024-10-18 19:18:23 +02:00
Albrecht Schlosser
89309ebbf2 Add missing *public* methods of Fl_Single_Window
- void make_current()
- void flush()
2024-10-18 16:30:23 +02:00
ManoloFLTK
f269367d41 Clarify the documentation of class Fl_Callback_User_Data 2024-10-17 14:10:38 +02:00
Albrecht Schlosser
d589c05b17 Fix documentation typos and trailing whitespace 2024-10-15 18:59:28 +02:00
Matthias Melcher
a0f1d5bc5e Fl_Preferences documentation update. 2024-10-10 11:46:31 +02:00
Albrecht Schlosser
05d78e8ebd Improve documentation on mouse and keyboard events 2024-10-07 16:13:11 +02:00
Albrecht Schlosser
4f4a9be15b Support mouse buttons 4 + 5 (aka "side buttons") (#1076, #1068)
This work is based on PR 1068 (patch by @CendioHalim) and
extended to store button status (4,5) in Fl::event_state() like
it's done for other mouse buttons (1-3).

Changes:
- new symbol: FL_BUTTON4 = side button 1 = "back"
- new symbol: FL_BUTTON5 = side button 2 = "forward"
- modified  : FL_BUTTONS now includes bits for two side buttons

Note: the status of these new buttons is not maintained by X11,
  therefore we need to maintain them in internal variables for
  this platform.
2024-10-06 18:53:03 +02:00
ManoloFLTK
b95a7eccd9 Fix Doxygen problems with fl_draw() functions. 2024-08-28 10:05:17 +02:00
Matthias Melcher
ec05f78d98 Adding horiizonatl and vertical label margin
- sizeof(Fl_Widget) not increased
- label positions can be adjusted
- try it out in test/label app
- full support in FLUD
2024-08-27 15:13:32 +02:00
ManoloFLTK
a0a91d4854 More detailed documentation of how Fl::event_state() differs between platforms 2024-08-23 16:25:11 +02:00
Matthias Melcher
cfc54a3b19 Adding Fl_Widget::label_image_spacing() (#1039)
- May need a better method name.
- This makes the gap between the image in a label and
the label text user settable.
- Can be tested using test/label app
2024-08-14 01:52:37 +02:00
Matthias Melcher
325ac336c7 Adding gap parameter to fl_draw(...)
This allows the user to define the spacing between a
possible imge and the text.
2024-08-14 00:35:55 +02:00
Greg Ercolano
85d1d904ec Small doc fixes (\See -> \see) 2024-08-12 18:31:05 -07:00
Greg Ercolano
f825fca43c Improve handling of malformed ANSI. (#950) 2024-08-12 18:00:54 -07:00
Matthias Melcher
3922ef67c1 Further accelerating Fl_Text_Display (#596)
This commit adds lazy evaluation for the wrapped line calculation,
making scrolling much more interactive.
2024-08-12 12:22:25 +02:00
ManoloFLTK
eaf62a99dc Documentation: improve description of how to use drawing surfaces 2024-08-10 23:14:56 +02:00
Albrecht Schlosser
666bbda70e Fix tabs, trailing spaces, and update dependencies 2024-08-10 20:32:19 +02:00
mid-kid
b83a6abe01 Configure/make: Quote variables that may contain spaces
This allows installing FLTK to directories that contain spaces.
2024-08-10 16:28:37 +02:00
Matthias Melcher
9bb9cb3f96 Optimize Fl_Text_Display scrolling speed (#596). 2024-08-04 00:32:11 +02:00
Matthias Melcher
803ad5ace9 Fixes missing default argument in Fl_Fill_Dial constructor. 2024-08-03 19:06:23 +02:00
Matthias Melcher
68f437b63e Improve visibility of selected tab in Fl_Tabs (#1032). 2024-08-03 15:26:03 +02:00
Matthias Melcher
97b1df805e Better Fl_Tabs callback handling. 2024-08-03 13:05:31 +02:00
Matthias Melcher
abb2971654 Fix Fl_Tabs callback in Overflow mode (#1031). 2024-08-02 21:15:18 +02:00
Matthias Melcher
089f31018b Add RMB pulldown menu to Fl_Help_View, #75
- append underscores to private varaibles per CMP
- add public Fl_Help_View::copy() and Fl_Help_View::text_selected()
- add public Fl_Help_View::copy_menu_text
- fixes some of the focus handling
- add pulldown menu to copy selected text
2024-07-29 14:03:16 +02:00
Matthias Melcher
5cafae4a3a Remove FL_AUTO_DELETE_EVENT feature
It's not ripe for release yet and possibly not even needed
according to pyFLTK maintainers.
Added: 8cffbd6941
2024-07-28 16:32:36 +02:00