Commit Graph

240 Commits

Author SHA1 Message Date
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
Albrecht Schlosser
f93b825b08 Update Fl::keyboard_screen_scaling()
- make the internal variable static
- make it callable after fl_open_display()
- document that it's currently only usable to switch scaling off
2020-01-31 15:48:21 +01:00
ManoloFLTK
4ba6cef0b9 Add Fl::keyboard_screen_scaling(int) to control recognition of ctrl/+/-/0/ 2020-01-31 09:42:36 +01:00
ManoloFLTK
b45a18a231 Fix Doxygen formatting problem. 2020-01-28 18:36:03 +01:00
ManoloFLTK
c549b7acbd X11 platform: use Gnome printer dialog when the GTK library is available at run-time
The code to determine whether the GTK library is available is now in Fl_X11_System_Driver::probe_for_GTK()
called both by Fl_Printer::begin_job() and Fl_Native_File_Chooser.
New Fl::option OPTION_PRINTER_USES_GTK allows to deactivate use of
the Gnome print dialog.

Minor change in Fl_Native_File_Chooser: GTK version 3 is searched before version 2,
whereas the search order was the opposite before.
2019-09-15 15:57:29 +02:00
ManoloFLTK
46fa9d2625 Fix Doxygen comment badly processed by Doxygen 1.8.15 2019-05-22 21:45:12 +02:00
ManoloFLTK
f9228e55b3 Better Doxygen explanation of the use of Fl::paste(). 2018-12-05 14:53:27 +01:00
Manolo Gouy
a9e2a78bb0 Improve the documentation of scaling factor-related operations.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13013 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-08-09 11:51:38 +00:00
Manolo Gouy
cd399d9898 Support for GUI scaling: add API to get/set the scaling factor value.
Also, define an FLTK event triggered when the scaling is changed and an option
to disable the transient window showing the new scaling factor.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13011 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-08-08 20:08:10 +00:00
Manolo Gouy
c886fe9c33 Add documentation for Fl::reset_marked_text() and Fl::insertion_point_location().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12930 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-05-24 10:58:47 +00:00
Manolo Gouy
ce71c4b679 Add Fl::screen_scale(int) function to get the scaling factor value of a screen.
This allows to keep class Fl_Screen_Driver away from the public API.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12926 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-05-22 17:00:27 +00:00
Greg Ercolano
309d9a61b9 Added Fl::menu_linespacing() to solve STR# 2927.
Method name follows Fl_Tree::linespacing().
Implemented similarly to Fl::scrollbar_size(), since its use crosses Fl_Menu_Item and 'menuwindow' classes.



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12815 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-03-31 17:17:37 +00:00
Albrecht Schlosser
6dbe7ca8ed Fix a doxygen warning, update copyright.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12773 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-03-18 15:25:08 +00:00
Manolo Gouy
06b925964d Remove Fl::run_also_windowless() and FL::wait_also_windowless() from planned public FLTK 1.4 API.
These were introduced at r12647, that is, during development of the 1.4 API.
These functions provided windowless support only on the MacOS platform,
where this can be obtained without those functions.
Windowless support on other platforms would require changing the event 
loop. There's no evidence from STR's there's a demand for windowless mode
on other platforms.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12680 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-02-20 09:08:38 +00:00