Commit Graph

253 Commits

Author SHA1 Message Date
Albrecht Schlosser abf28f0b70 Improve and clarify documentation 2024-11-01 18:24:06 +01: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 a0a91d4854 More detailed documentation of how Fl::event_state() differs between platforms 2024-08-23 16:25:11 +02:00
Albrecht Schlosser 317e06e5a3 X11: fix extraneous (undefined) event state bits
- Restrict FL_BUTTONS mask to only three valic mouse buttons.
  Pseudo mouse buttons 4-7 are used for FL_MOUSEWHEEL events and
  are no longer reflected in Fl::event_buttons().
- Return only state of mouse buttons 1-3 in Fl::event_buttons().
  Buttons 4-7 are not "sticky" (used for FL_MOUSEWHEEL).
- Keep undefined keyboard related bits in Fl::event_state() for
  backwards compatibility and transparency. These bits may be masked
  out in a later release.
- Document Fl::event_state() bits for X11 in src/Fl_x.cxx.

Note: this is a bug fix for X11 only, Wayland and other platforms are
not affected.
2024-07-07 20:25:12 +02:00
Albrecht Schlosser d9c8cebfbe Remove trailing whitespace
no code changes
2024-06-21 18:10:33 +02:00
Albrecht Schlosser 456d53c403
Add Fl::remove_next_timeout(...) to remove only one timeout (#992)
This method also returns the data pointer of the removed timeout.

This new method is generally useful for user code and particularly
necessary to fix issue #991.

Co-authored-by: Albrecht Schlosser <albrechts.fltk@online.de>
2024-06-21 17:35:01 +02:00
Matthias Melcher 281ec24c8f Box types can now defined and draw their own focus frame, STR 2145, #659 2024-04-26 12:42:11 +02:00
ManoloFLTK 5ec7176e81 Fix for Fl_Native_File_Chooser::filter_value() - cont'd (#899) 2024-04-22 18:35:59 +02:00
ManoloFLTK abfc8ee52f Fix: Fl_Native_File_Chooser::filter_value() [Kdialog] always returns 0 (#899)
- remove build option FLTK_USE_KDIALOG replaced by an Fl::option() option
- new run-time option OPTION_FNFC_USES_KDIALOG
- make options OPTION_FNFC_USES_KDIALOG and OPTION_FNFC_USES_ZENITY
false by default
- add mention of new program fltk-options in the doc of Fl::option()
- change logic of choice of the native file chooser under X11/Wayland:
the zenity and kdialog choosers are opt-in; otherwise the GTK file chooser
is used, unless opted out with  OPTION_FNFC_USES_GTK
- document that zenity may be interesting for sandboxed apps
- document that both zenity and kdialog make member functions
Fl_Native_File_Chooser::filter_value() inoperable
2024-04-22 16:34:08 +02:00
Albrecht Schlosser 3ac16f1dc4 Fix compiler warning, part 1 of #946 2024-04-04 22:59:08 +02:00
ManoloFLTK 4db9391525 Update doc about Ctrl/+/-/0/ zoom shortcuts 2024-03-03 08:15:42 +01:00
ManoloFLTK b74099c5fd Add OPTION_SIMPLE_ZOOM_SHORTCUT to fine tune zoom-in shortcut 2024-03-02 17:25:10 +01:00
ManoloFLTK fc46e771cd Improve prioritization of event handlers added at open display time 2024-02-27 16:20:25 +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 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
ManoloFLTK 994f5d058b Fix: Fl::clipboard_contains() cannot query selection buffer (#690) 2023-11-01 10:41:51 +01:00
ManoloFLTK f20e2188fd Change prototype to Fl::now(double offset = 0) - cont'd 2023-10-06 17:11:43 +02:00
ManoloFLTK 4d9805537b Change prototype to Fl::now(double offset = 0) 2023-10-06 16:23:08 +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 94a75b012f Fixes a bunch of typos in comments. 2023-08-26 15:17:28 +02:00
Albrecht Schlosser 0f41797b7a Cairo: introduce Fl::cairo_flush() in FLTK API
Flushing the Cairo context is necessary on Windows to make Cairo
drawings appear on the device (screen). This new method makes it easy
for user code to do this correctly after using Cairo drawings.

- add Fl::cairo_flush(cairo_t *)
- document Fl::cairo_flush(cairo_t *)
- reformat Cairo doxygen docs and code (partially)
- use the new method in Fl_Cairo_Window
- use the new method in test/cairo_test.cxx
- other minor (text) changes in test/cairo_test.cxx
- add test/cairo_test to the demo menu (test/demo.menu)
2023-03-14 19:51:34 +01:00
Matthias Melcher ffadc23cab
Expose elapsed time API (#670) 2023-02-09 14:48:39 +01:00
Matthias Melcher 18aaa32e45 STR 2658: documentation fixes on Fl::set_fonts 2023-01-20 12:35:56 +01:00
Albrecht Schlosser 8dd3ff8e12 X11: Optionally copy selection buffer to clipboard (STR 3229)
The new method Fl::selection_to_clipboard(int) enables copying
selection data to the clipboard on X11 if it is set to 1.

This feature was requested by STR 3229 and the implementation was
inspired by an `xterm` feature named "Select to Clipboard" which can
be enabled by 'ctrl + middle mouse button + "Select to Clipboard"'
in an xterm window.
2023-01-06 16:45:22 +01:00
Matthias Melcher 4bff15278e Adding Fl::hide_all_windows() 2023-01-05 15:20:13 +01:00
Matthias Melcher 8826dca106
Add close buttons for individual tabs in Fl_Tabs (#628)
Add close buttons for Fl_Tabs
Introducing callback reasons
FLUID shows all FL_WHEN_... options
Adding Fl_Tabs overflow types
Improved test/tabs to show new features
2023-01-05 13:51:30 +01:00
Albrecht Schlosser 9aa7cab532 Clarify and improve Fl::scheme() related documentation 2023-01-03 17:11:00 +01:00
ManoloFLTK 41f37613ec Derive Fl_Zenity_Native_File_Chooser_Driver from Fl_Kdialog_Native_…
Also add Fl::option(OPTION_FNFC_USES_ZENITY)
2022-12-16 16:21:23 +01:00
ManoloFLTK 19c1ab504f Use correct syntax to befriend a class 2022-12-11 08:50:59 +01:00
ManoloFLTK df059de37e "Public members Fl::awake_ring_*_ should be private" (#559) - cont'd 2022-12-10 10:19:54 +01:00
ManoloFLTK 59be6a7ef9 Fix for "Public members Fl::awake_ring_*_ should be private" (#559) 2022-12-09 18:50:04 +01:00
ManoloFLTK 4b945a3086 Wayland/X11 hybrid: use "bool fl_disable_wayland;" declaration. 2022-11-05 19:47:37 +01:00
Albrecht Schlosser da11526bb8 Improve and clarify documentation of timeout functions
Some functions didn't document the handling of arguments properly,
particularly Fl::has_timeout() and Fl::remove_timeout().

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

Unfortunately there have been some inconsistencies (likely unexpected
behavior) which have been preserved and which are now documented.
2022-10-20 19:36:03 +02:00
ManoloFLTK 07fd2628fe Hybrid Wayland/X11 platform: improve control of chosen backend. 2022-08-30 17:37:55 +02:00
ManoloFLTK b24379133f Add int Fl::system(const char *command) static member function. 2022-08-20 09:57:00 +02:00
Matthias Melcher db0a1f4bae
OpenGL implementation of all `fl_` "Drawing Fast Shapes" graphics calls (#385)
* Fix build system for unites,

* Updated unittest to check OpenGL drawing.

Making sure that OpenGL drawing is exactly the same
as native drawing to make FLTK widget rendering
look the same in GL windows.

* Make OpenGL optional.

* Implemented clipping in OpenGL

* unites drawing fast shapes

* Fixed CMake

* Updating unittest.

Added tests for fl_pi and fl_arc (int)
Renamed tab to render complex shapes.

* Improved OpenGL FLTK drawing emulation.

* Fixed GTK ROUND DOWN BOX

* Fixing Makefile for unittest

* Correctly aligning OpenGL text.

* Fixed text alignment in GL windows.

Explained the "FLTK over GL " example in Cube.

* Overlapping test.

* Better GL graphics alignment.

* Drawing the focus rect.

* Adding Alpha Channel support for GL.

* Added FLTK-on-GL documentation.
2022-02-06 15:22:24 +01:00
Albrecht Schlosser 29d9e31c51
Consolidate timeout handling across platforms (#379)
Add Fl_Timeout class

Move platform independent code of Fl::wait() to main part

- basic timeout handling
- Fl::run_checks()
- Fl::run_idle()
- Fl::idle()
- waiting time calculation (next timeout)
- remove platform dependent "screen driver" stuff
2022-01-31 22:27:17 +01:00
ManoloFLTK 5bab46940c Re-organize cross-platform support for text input methods.
FLTK 1.3 supports complex text input methods (TIMs) for the 3 platforms
(X11, Windows, macOS). This support has an interface with FLTK that is
common for X11 and Windows, via (undocumented) functions fl_set_spot(),
fl_set_status() and fl_reset_spot().
In contrast, and because it's been developed independently, the
interface between the macOS TIM and FLTK 1.3 is completely different :
static functions FL::insertion_point_location() and Fl::reset_marked_text().

The present change implements a single TIM/FLTK interface
used by all platforms based on functions fl_set_spot() and
fl_reset_spot().

The previous macOS-specific functions FL::insertion_point_location() and
Fl::reset_marked_text() are maintained only for compatibility with 1.3
and deprecated.
2022-01-07 16:34:54 +01:00
Albrecht Schlosser 5438954d8c Generate FL/fl_config.h rather than FL/abi-version.h
... as discussed in fltk.coredev in thread "RFC: introduce public
config header <FL/fl_config.h>", see:
https://groups.google.com/g/fltkcoredev/c/xLCs1AIXMVo/m/MHZpQggzAQAJ

- Rename abi-version.h to fl_config.h, rename input files,
  update dependencies, .gitignore, CMake, configure and Makefiles.

- Include Cairo options in FL/fl_config.h

- Rename FLTK_USE_CAIRO to FLTK_HAVE_CAIROEXT for consistency.

- Include <FL/fl_config.h> in config.h and wherever necessary,
  fix include order (move FL/Fl.H to the top) and more.

- Move USE_X11 to fl_config.h and rename to FLTK_USE_X11

- Do not include <config.h> in Cairo demo program which is no
  longer required in Cairo programs since FLTK 1.4.0
2021-12-18 22:44:08 +01:00
Albrecht Schlosser 1afbbb4aef Documentation updates (formatting)
no code changes
2021-10-17 13:39:40 +02:00
Albrecht Schlosser ed3ec2d036 Add experimental FL/fl_casts.H (issue #109) 2021-08-30 23:43:55 +02:00
tetsuhaut 29dd21bcef Remove an extra semicolon
One less warning, yay !
2021-08-27 12:58:25 +02:00
Albrecht Schlosser 41266df7ae Remove unnecessary system includes from public headers
Add includes of system headers in the implementation files
where necessary.
2021-03-21 00:42:28 +01:00
Albrecht Schlosser 08d9b3e10d Remove config_lib.h and runtime configuration info
... as discussed in fltk.coredev.
2021-02-27 15:09:12 +01:00
ManoloFLTK 018134161d Documentation: clarify how keypad keys are named. 2020-11-23 11:44:42 +01:00
ManoloFLTK 5132bb6a06 Clarify doc about how FLTK_SCALING_FACTOR operates. 2020-11-03 08:13:45 +01:00
Albrecht Schlosser b65d3a249d Customize corner radius for rounded box/frame (#130)
Make maximum box corner radius and shadow width configurable.
See Fl::box_border_radius_max() and Fl::box_shadow_width().

Documentation: update image of box types.

Fixes #130
2020-09-01 12:35:48 +02:00
Albrecht Schlosser f09e17c3c5 Remove $Id$ tags, update URL's, and more
- remove obsolete svn '$Id$' tags from all source files
- update .fl files and generated files accordingly
- replace 'http://www.fltk.org' URL's with 'https://...'
- replace bug report URL 'str.php' with 'bugs.php'
- remove trailing whitespace
- fix other whitespace errors flagged by Git
- add and/or fix missing or wrong standard headers
- convert tabs to spaces in all source files

The only relevant code changes are in the fluid/ folder where
some .fl files and other source files were used to generate
the '$Id' headers and footers.
2020-07-06 20:28:20 +02:00
Albrecht Schlosser 3b249de60a Clarify documentation (STR 3532)
Make clear that Fl::repeat_timeout() must only be called for the
same timeout it is handling. Related STR's:

https://www.fltk.org/str.php?L3532
https://www.fltk.org/str.php?L3516
2020-06-30 15:28:35 +02:00