Commit Graph

6062 Commits

Author SHA1 Message Date
Albrecht Schlosser
80a22e97e8 Fl_Timeout: Remove compiler warning [-Wclass-memaccess]
Also: fix doxygen warning
2022-02-03 19:56:47 +01:00
Albrecht Schlosser
4eaa6dfd0d Remove platform #ifdef from macOS native filechooser 2022-02-03 19:38:33 +01:00
ManoloFLTK
2e6e0b9c36 Reorganize classes Fl_System_Driver and Fl_Screen_Driver
These virtual members are moved from Fl_Screen_Driver to Fl_System_Driver
- wait(double)
- ready()

These virtual members are moved from Fl_System_Driver to Fl_Screen_Driver
- copy(const char *stuff, int len, int clipboard, const char *type)
- void paste(Fl_Widget &widget, int clipboard, const char *type)
- clipboard_contains(const char *type)
- clipboard_notify_change()

These members are moved from Fl_X11_Screen_Driver to Fl_X11_System_Driver
- poll_or_select_with_delay(double time_to_wait)
- poll_or_select()
and are made virtual in preparation for the introduction of class
Fl_Unix_System_Driver.
2022-02-03 07:03:44 +01:00
ManoloFLTK
d9451a8669 Add platform-independent Fl_Screen_Driver::print_or_copy_window().
This member function is available for all platforms to print or copy the front window
with or without its titlebar.
2022-02-02 14:55:48 +01:00
ManoloFLTK
895ac51c69 macOS: add "Toggle printing of titlebar" to application menu - cont'd. 2022-02-02 11:19:09 +01:00
ManoloFLTK
935074ba0b macOS: add "Toggle printing of titlebar" to application menu. 2022-02-02 11:05:53 +01:00
Albrecht Schlosser
ec98dc113f CMake: Fix image libraries build if fallback is used
The CMake instructions would use the wrong image libs (png, jpeg, zlib)
if the fallback was active (OPTION_USE_SYSTEM_XXX) was true but the
header files were not present.

This had already been fixed for jpeg but not for the other two libs.
This commit rearranges the logic for all three libs.

Add information about builtin or system libraries to config summary.
2022-02-01 00:54:42 +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
Matthias Melcher
cf4a832e6a
Adding Text_Display color variables. (#384) 2022-01-30 22:14:40 +01:00
Matthias Melcher
cdb51045dd
Background color attribute for Fl_Text_Display. (#378)
* Background color attribute for Fl_Text_Display.

* Adding attributes.

* Avoid clipping horizontal

* Fl_Text_Display underlining.

* Better line positions

* Typos, testing.

* Documentation.
2022-01-27 23:50:06 +01:00
Matthias Melcher
5d9db35386 Fix for #381, backward function crash
when no menu item is selected.
2022-01-26 17:17:24 +01:00
Matthias Melcher
7308bcdb74
Preferences XDG path (#377)
* Preferences: remove CamelCase from public interface.

* Prefs: documentation.

* Prefs: updating Doxygen comments

* XDG conforming preferences path
2022-01-23 22:35:21 +01:00
Albrecht Schlosser
04ccc8cc46 Remove experimental platforms Android, Pico, SDL (PR #376)
... as discussed in fltk.coredev: "FLTK 1.4.0 release schedule"
https://groups.google.com/g/fltkcoredev/c/PDbHTRpXVh0/m/JqboexZ_AwAJ
2022-01-23 18:12:47 +01:00
Albrecht Schlosser
c0f5080cb0 Fix compiler warnings [-Wunused-variable]
... and missing return value [-Wreturn-type]
2022-01-21 13:38:26 +01:00
Matthias Melcher
09eff7243a
Fixing and upgrading Fl_Preferences (#374)
* Added filename function to Fl_Preferences

Static function to get filename before opening.
Member to get filename after opening.
Bug fixes for memory mapped preferences.

* ERROR is a macro on Windows, don't use it

* Added Fl_Preferences::dirty().

User can now check if the database will be written
when flushed or destroyed.
Flush returns a crude error code.

* Fl_Preferences::get binary data returns # of bytes read.

* Verified group deletion code

* Fl_Preferences ignores locale.

This will make .prefs files interchangeable
between different computers.

* Updating the Preferences Mode to ignore locale.

* Fixes in docs.
2022-01-19 16:08:29 +01:00
Albrecht Schlosser
788ca208f7 Rename FL/Fl_String_class.H to FL/Fl_String.H
This is part 2 of the final fix for a previous name clash on case
insensitive file systems (fl_string.h vs. Fl_String.H).
2022-01-16 19:47:16 +01:00
Albrecht Schlosser
92e9181a0a Rename FL/fl_string.h to FL/fl_string_functions.h
This is part 1 of the final fix for a previous name clash on case
insensitive file systems (fl_string.h vs. Fl_String.H).
2022-01-16 19:47:16 +01:00
ManoloFLTK
8213ba94aa Improve Fl_GTK_Native_File_Chooser_Driver in relation to FLTK windows.
Implement a new way to make the GTK file-chooser window modal-like
by preventing any event processing by other FLTK windows.
The new way is also no longer X11-specific.
2022-01-16 18:49:41 +01:00
ManoloFLTK
0f335ab440 Improve kdialog-based native file chooser.
Processing of all FLTK events as well as window resizing while the file chooser runs is suspended,
Normal event processing and resizing is restored when chooser closes.
2022-01-16 12:33:26 +01:00
ManoloFLTK
ebd0c81f7e Move make_transient() to Fl_Posix_System_Driver from Fl_Screen_Driver 2022-01-14 19:25:17 +01:00
Albrecht Schlosser
ab58971bcf Improve focus box drawing and documentation
Add new method
  Fl_Widget::draw_focus(Fl_Boxtype t, int x, int y, int w, int h, Fl_Color bg)

  ... with background color for correct contrast testing (in Fl_Tabs)

Draw the focus box of the "tabs" of Fl_Tabs widgets with the correct
  boxtype and background color.

Make 'unsigned int visible_focus()' const so it can be used in 'const'
  methods.

Do not draw the focus box if the per-widget focus box option is off.
2022-01-14 17:17:09 +01:00
Greg Ercolano
c45bf57c8f Fixes #369 2022-01-13 18:06:40 -08:00
Greg Ercolano
9c55ad4273 Fixes #362 2022-01-13 15:26:27 -08:00
Greg Ercolano
47cd9a11a0 Fixes issue #361. 2022-01-13 07:28:00 -08:00
ManoloFLTK
9a2b3ef798 Input Method support: have the auxiliary window follow when the focus window is moved. 2022-01-08 17:08:39 +01:00
Albrecht Schlosser
b12ed61548 Remove obsolete (dead) code from Fl_Group.cxx
This code had been inactive at least since Mar 29, 2018.
2022-01-08 16:23:01 +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
ManoloFLTK
27c175dad8 Add virtual void Fl_Graphics_Driver::set_status() and implement for X11 platform. 2022-01-07 07:50:36 +01:00
Albrecht Schlosser
9d474dfcdf Fix whitespace and Makefile dependencies
No code changes
2022-01-05 22:00:54 +01:00
ManoloFLTK
e80a2734e8 Fix build error with CMake when libjpeg???-dev package is absent from the system (Linux).
The error was visible under Linux if OPTION_USE_SYSTEM_LIBJPEG and OPTION_BUILD_SHARED_LIBS are  on.
2022-01-04 16:20:49 +01:00
ManoloFLTK
9164e3c489 Text input method for X11: fix for case when text widget is inside subwindow. 2022-01-02 17:44:55 +01:00
ManoloFLTK
eeb3e92eb2 Fix fullscreen window level corner cases on macOS - cont'd
See long discussion in PR#277 at
https://github.com/fltk/fltk/pull/277
2021-12-29 17:18:47 +01:00
Albrecht Schlosser
e186ee0af3 Fix compiler warning [-Wignored-qualifiers]
In function ‘int glutExtensionSupported(const char*)’:
  warning: type qualifiers ignored on cast result type
2021-12-20 02:03:38 +01:00
Matthias Melcher
0d435d51ac GitHub #328: removed stray ';' in Fluid code generation. 2021-12-20 01:23:59 +01:00
Albrecht Schlosser
e8961f10b8 Update fluid generated and .fl files (remove mac_shell...)
Commit updated .cxx files in src/ with fixed indenting

Remove `mac_shell_*' statements from fluid (.fl) files
2021-12-19 22:45:53 +01:00
ManoloFLTK
47164bf954 Fix for issue #344 : New/Delete Type Mismatch on Windows 2021-12-19 19:49:39 +01:00
ManoloFLTK
4d934e003a Add check against NULL pointer (fix for issue #338). 2021-12-19 08:50:25 +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
Matthias Melcher
6efc997a02
Updated Unicode utf8 byte limit in docs. 2021-12-17 21:27:17 +01:00
Matthias Melcher
d13f9e736c
GitHub #233, documenting style buffers and utf8. 2021-12-17 20:28:47 +01:00
Albrecht Schlosser
55e5c74e9e Fix broken build
sorry for the noise
2021-12-17 19:37:48 +01:00
Albrecht Schlosser
311d9a8ad4 Forms compatibility: use as_window() rather than type()
... and some more improvements and minor changes.

No functionality changes.

Note: this code is used in the fltk_forms library.
2021-12-17 19:00:34 +01:00
Albrecht Schlosser
d6ba66ca4b Fix a tiny documentation bug 2021-12-17 19:00:34 +01:00
ManoloFLTK
93a55f64c3 macOS platform: fix for issue #325 Disabling IM disables Greek and Cyrillic layouts
Thanks to Pierre Ossman who gave the fix.
2021-12-17 16:00:57 +01:00
Albrecht Schlosser
f57b074378 Fix trailing whitespace and a MSVC compiler warning
No code changes
2021-12-14 23:55:21 +01:00
ManoloFLTK
f76e579ffe Windows platform and Input Methods: improve GUI scaling support. 2021-12-14 16:06:25 +01:00
ManoloFLTK
3565aa1e60 Windows platform: account for GUI scaling when using input method. 2021-12-13 10:40:05 +01:00
YX
95d862fd5a Fix IME problem (issue #270) 2021-12-12 17:01:30 +01:00
ManoloFLTK
fae9f03cc9 X11 platform: account for GUI scaling in location of input method aux window. 2021-12-12 16:29:48 +01:00
ManoloFLTK
12d699a650 Win32 platform: add support of "PROCESS_PER_MONITOR_DPI_AWARE" set via manifest. 2021-12-11 16:39:11 +01:00
ManoloFLTK
0a8b1845fe Win32 platform: allow use of manifest to set the app's DpiAwareness level.
This fixes issue #309: FLTK 1.4 does not properly size window when using display scaling on Windows 10.

FLTK now tests whether the app's DpiAwareness has been previously set, presumably
via a manifest, before attempting to set it to FLTK's preferred level DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2
2021-12-11 11:40:02 +01:00
Albrecht Schlosser
a8cc340321 Stabilize resizing of common dialogs like fl_choice()
Thanks to Paul D. Hahn for finding these issues on his very old
"CentOS 6 linux with g++ 5.1" system.

For details see the very long thread "fl_choice() dialog apprearance
discrepancy problem in 1.4" (typo intentionally ignored):
https://groups.google.com/g/fltkgeneral/c/UQk3RRf-l4A/m/0GtPNv1CCQAJ
2021-12-10 17:09:28 +01:00
ManoloFLTK
08e59770aa Remove compiler warnings about unused parameters (issue #307) - cont'd 2021-12-09 11:40:55 +01:00
Albrecht Schlosser
b9c0933de2 Update dependencies (no code changes)
Done after the first large commit of fluid changes.
2021-12-08 19:23:01 +01:00
Matthias Melcher
17c8f73a88 STR 3460.C: Code Properties remembers the editor's scroll bar position. 2021-12-08 18:55:44 +01:00
ManoloFLTK
4bc25f7f9d Fix for issue #278 - continued : add CMake OPTION_USE_KDIALOG
Use of the kdialog command by class Fl_Naive_File_Chooser can now be turned off
at build-time through CMake OPTION_USE_KDIALOG.

If building via configure + make, set #define USE_KDIALOG to 0 in config.h before make.
2021-12-08 09:41:06 +01:00
ManoloFLTK
630517049f Fix for issue #278 - continued
Because kdialog can't select multiple directories, run the GTK chooser
when BROWSE_MULTI_DIRECTORY is used.
2021-12-07 12:57:49 +01:00
ManoloFLTK
663b93a807 Fix for issue #278: Can we use the qt/kde file picker instead of gtk?
Under the X11 platform, class Fl_Native_File_Chooser will behave as follows :
- if the KDE desktop is used and if command "kdialog" is available in the path,
the Qt/KDE file chooser is used;
- otherwise, if the GTK library is available at run-time,
the GTK file chooser is used;
- otherwise, the FLTK file chooser is used.

In addition, when Fl::OPTION_FNFC_USES_GTK is off, the FLTK file chooser
is always used.
2021-12-07 11:24:35 +01:00
ManoloFLTK
939d536b66 Fix for fltk.coredev "reentrant calls with Fl_Window::resize" - cont'd 2021-12-07 10:54:41 +01:00
Albrecht Schlosser
8334abe544 Fix whitespace errors (no code changes)
(1) convert tabs to spaces
(2) remove trailing whitespace
2021-12-06 19:56:40 +01:00
Albrecht Schlosser
39b5ae9e6e Fix Fl_Window::size_range() documentation (STR 3352)
"Tiny window problem if child group larger than window"

See Greg's comment 4: "something is wrong here: either the logic or
the docs are incorrect, not sure which."

It turned out that both were incorrect.

Since we fixed the code this commit completes the STR by fixing the
docs as well so they match the behavior.
2021-12-06 19:49:16 +01:00
ManoloFLTK
8bf62c67cf macOS platform: compute the screen number where a top window is mapped. 2021-12-06 10:18:29 +01:00
Albrecht Schlosser
9154291940 Fix filename in doxygen comment, update dependencies 2021-12-06 00:43:24 +01:00
Greg Ercolano
74dd5164d3 Fixes STR #3352: "tiny window problem if child group larger than window" 2021-12-05 12:26:25 -08:00
Albrecht Schlosser
cf58f7ae2b Fix MSVC compiler warnings 2021-12-05 21:00:15 +01:00
Albrecht Schlosser
a0724ab7c4 Add fl_message_icon_label() function (STR #2762)
This message icon label (usually one character) will be used in the
next call of one of the common dialogs.

test/ask.cxx: use fl_message_icon_label()
2021-12-04 20:36:11 +01:00
Albrecht Schlosser
130f864d1d Rename src/Fl_String.cxx to src/Fl_String_class.cxx
Sorry for the noise, still fixing a name class on case-insensitive
file systems (macOS and Windows).
2021-12-04 15:50:10 +01:00
Albrecht Schlosser
7a7e50df6e Rename FL/Fl_String.H to FL/Fl_String_class.H
The previous name existed already with different case (fl_string.h)
in the FL folder which broke the build on macOS and Windows.

This may be a temporary fix - until I find a better way.
2021-12-04 15:34:41 +01:00
Albrecht Schlosser
b6de09cff2 Re-enable nested (aka recursive) common dialogs (STR 3242, #282)
Apply Fl_Dialog_r10831.patch as given in STR 3242:
https://www.fltk.org/strfiles/3242/Fl_Dialog_r10831.patch

Reformat, add missing pieces, rename private members, cleanup...

Improve documentation, add fl_choice_n() (issue #282)

New methods fl_input_str() and fl_password_str() return Fl_String
2021-12-04 14:49:27 +01:00
Albrecht Schlosser
2404656266 Add minimal version of class Fl_String
This class will be used in fl_input_str() and fl_password_str().

Todo: add missing documentation ...
2021-12-04 13:40:29 +01:00
ManoloFLTK
596a937530 PostScript output: initialise member variables in Fl_Cairo_Graphics_Driver constructor.
Also, remove inadequate Fl_Surface_Device::push_current(this) call in Fl_Posix_Printer_Driver::begin_job().
2021-12-02 10:54:40 +01:00
ManoloFLTK
2db94dcb4c Hack to restore "configure --enable-x11" on macOS ≥ 11
Since macOS 11, configure --enable-x11 (and the equivalent with CMake)
fails when compiling fl_write_png.cxx in parsing of time.h.
The error happens only if png.h is included without time.h having
been included before.
The fix is to #include time.h before png.h

A better fix than his hack is desirable.
2021-12-01 13:38:55 +01:00
Greg Ercolano
36af6a5729 Solves Fl_Tree focus box artifacts on linux - fixes issue #299.
Nabbed the current code from Fl_Widget::draw_focus() which solves.
2021-11-27 10:20:47 -08:00
Greg Ercolano
84c09ae7b2 Fixes #297 - improvements for icon.cxx + icon() docs 2021-11-26 13:13:58 -08:00
ManoloFLTK
390fa9caa7 Fix for issue #254: remove hardware overlay support - cont'd. 2021-11-26 15:28:43 +01:00
ManoloFLTK
25eed24172 Removed following removal of support for X11 hardware overlay (issue #254) 2021-11-26 15:21:41 +01:00
ManoloFLTK
eb8b016fab Fix for issue #254: remove hardware overlay support . 2021-11-26 15:16:15 +01:00
ManoloFLTK
84cf249482 Fix for issue #253: Remove xdbe support 2021-11-26 15:01:54 +01:00
ManoloFLTK
2f50640732 X11+XRender platform: more accurate drawing of RGB images when GUI is scaled.
RGB images are now drawn to a size that exactly fit discretised rectangles when non
integral GUI scaling values are used.
2021-11-25 11:19:10 +01:00
ManoloFLTK
bf470919f7 Fix X11 platform bug when drawing transparent RGB image without XRender.
The bug would appear with test/device and when scaling up to 133% or above:
the background of the Porsche pixmap would be truncated.
The bug requires to set OPTION_XRENDERER=0 to appear.
2021-11-25 09:12:08 +01:00
Greg Ercolano
a900411ee2 Better solution for issue #296 2021-11-24 15:13:04 -08:00
Greg Ercolano
e97fd17e04 Solves Fl_Table_Row warning in issue #296 2021-11-24 14:57:44 -08:00
ManoloFLTK
7e484c614c Fix for [fltk.coredev] reentrant calls with Fl_Window::resize 2021-11-24 10:35:18 +01:00
Albrecht Schlosser
1ce3a84e9f Refactor and improve "Print front window" dialog
src/print_button.cxx: "Print front window" implementation (new file)

This is compiled and activated if USE_PRINT_BUTTON is defined.

The feature can be fine controlled by environment variable
  'FLTK_PRINT_BUTTON' (see docs in source file).
2021-11-19 18:50:53 +01:00
Albrecht Schlosser
4d31c5bd4f Fix doxygen docs of fl_draw_check()
.. as pointed out by Ian in fltk.coredev. Thanks.
2021-11-19 14:29:46 +01:00
Albrecht Schlosser
e6683d48e9 Disable check mark debugging 2021-11-18 15:14:22 +01:00
Albrecht Schlosser
0bc06e8f1a Reformat and move clipboard demo from examples to test folder
The clipboard demo is more a test program than an example and very
useful even if the examples are not built.

Also update dependencies.
2021-11-18 13:44:41 +01:00
ManoloFLTK
02754e43ce Fix Fl_Window::decorated_w() in some X11 situations. 2021-11-17 15:00:21 +01:00
ManoloFLTK
397226b75d Add use of fl_capture_window() by test/device
Also, rename fl_capture_window_part() to fl_capture_window().
2021-11-16 15:03:36 +01:00
Albrecht Schlosser
b2979b6425 Reformat to FLTK style, improve documentation
No code changes.

Replace '#define fl_clip ..' with an inline method.
2021-11-16 00:02:16 +01:00
Albrecht Schlosser
e4d8b94102 Add fl_draw_check() to draw better check marks (issue #68)
This new function can and should be used to draw check marks
in widgets that need it, e.g. Fl_Check_Browser (issue #68) and
Fl_Check_Button.
2021-11-15 14:41:31 +01:00
Albrecht Schlosser
d96c980d29 Fix "failed to build with pango libarary" (issue #291)
The error was reported for "centos 6 with devtoolset-6 installed
which contains gcc (GCC) 6.3.1 20170216 (Red Hat 6.3.1-3)".

The fix includes the missing header files *and* makes sure that the
correct conversions (to size_t) take place as in
src/drivers/PostScript/Fl_PostScript_image.cxx.
2021-11-14 13:06:25 +01:00
Albrecht Schlosser
6d1f5608ba Support all image depths (1-4) in fl_write_png() 2021-11-11 20:58:09 +01:00
Albrecht Schlosser
500e470d39 Refactor fluid: make fl_write_png() public
The new function fl_write_png() was moved to its own file and is now
publicly available ("exported") so other programs can use it.

This function was used in fluid to write a window screenshot (.png)
together with a template (.fl) to preferences storage.
2021-11-09 20:36:23 +01:00
ManoloFLTK
76a3ded549 Fix for issue #279 about detecting early retina with GL windows. 2021-11-05 15:21:56 +01:00
Albrecht Schlosser
a0654b59ac Fix X11 build with FLTK_CONSOLIDATE_MOTION turned off 2021-11-05 13:12:52 +01:00
Albrecht Schlosser
0ad192a27b Make "FLTK_CONSOLIDATE_MOTION" user-definable (issue #76)
This undocumented macro is used on X11 and macOS platforms to
consolidate mouse move events, i.e. to collect some events and send
them later as one event. The old macro name CONSOLIDATE_MOTION has been
renamed to FLTK_CONSOLIDATE_MOTION since it is now a "global" symbol.

Users can define FLTK_CONSOLIDATE_MOTION in their build system, e.g.
on the compiler commandline, as 0 or 1 to disable or enable this
feature, respectively.

In FLTK 1.3 the default was 0 (OFF) on macOS and 1 (ON) on X11.
In FLTK 1.4 the default is always 0 (OFF).
2021-11-05 12:46:21 +01:00
ManoloFLTK
995a48dd00 Consistently make Fl_Paged_Device::begin_page call Fl_Surface_Device::push_current. 2021-10-31 14:20:04 +01:00
Albrecht Schlosser
4d88fb6fbc Fix focus box drawing on X11 (partial fix for issue #156)
This fixes focus box drawing on X11 for some broken graphics
drivers with line width zero as discussed on issue #156 titled
"Incorrect rendering on Alpine Linux".

This title is not entirely correct. The issue has been observed on
other Linux distros as well if the "modesetting" driver is in effect.

This does not fix rectangle drawing (missing pixels) in general which
is obviously caused by a similar or the same driver issue.
2021-10-27 21:05:28 +02:00
Albrecht Schlosser
14f842708d Fix indenting, whitespace errors and dependencies
(no code changes)
2021-10-27 20:52:08 +02:00
ManoloFLTK
b6b1fcce41 Test wether preprocessor variable __BLOCKS__ is defined 2021-10-22 19:48:31 +02:00
ManoloFLTK
77b3557f3a Allow compiling with compiler without "blocks" support.
This corresponds to PR#284.
2021-10-22 18:33:56 +02:00
Albrecht Schlosser
6c2bc5b02f Fix a typo 2021-10-06 22:16:47 +02:00
Albrecht Schlosser
3ee8864bfc Simplify and fix the code of Fl_Scroll::bbox()
Declare Fl_Scroll::bbox() and Fl_Scroll::recalc_scrollbars() 'const'.
These methods don't change the Fl_Scroll widget.

Use Fl_Scroll::recalc_scrollbars() in Fl_Scroll::bbox() to simplify
the code and to avoid code duplication.

bbox() can now be called at any time and returns the correct values,
no matter if draw() has been called before.
2021-10-06 18:35:00 +02:00
ManoloFLTK
d2c41924a6 macOS: "Fix fullscreen window level corner cases"
This corresponds to changes of PR#277 (Author: Samuel Mannehed)
2021-10-06 11:11:59 +02:00
Albrecht Schlosser
cc82b742be Improve GIF error handling, terminate on some errors
There's not much we can do if we find unknown data in the main
parser loop. The best we can do is terminating.

If we find a GIF trailer (0x3b) this means logical end of file.
If we get there in the main loop the GIF file is empty (no image).

This behavior is consistent with many other image viewers including
browsers (Firefox and Chrome).
2021-10-02 18:40:36 +02:00
Albrecht Schlosser
59836fb19f Separate Fl_GIF_Image constructors with and w/o length arg
Document clearly that reading from memory w/o the length argument
(old constructor) is discouraged (deprecated).
2021-10-02 18:40:32 +02:00
Albrecht Schlosser
01ea77ed88 Refactor class Fl_Image_Reader to FLTK coding style
... and separate constructors for memory reader with and w/o length
argument for better documentation.
2021-10-01 19:03:02 +02:00
Albrecht Schlosser
66c0bf4811 Make Fl_Image_Reader::name() 'const' (#271)
Thanks to @wcout for finding this.
2021-09-28 16:07:49 +02:00
Albrecht Schlosser
32e02a6e8d Fix potential memory leak in GIF image reader (#271)
This could happen if a read error or end of file was encountered.
2021-09-28 15:11:55 +02:00
Albrecht Schlosser
e0d630ed72 Add error checking and improve constructor of Fl_BMP_Image
- use new features of Fl_Image_Reader (read error and EOF checks)
- add length argument to constructor reading from memory
2021-09-27 19:26:04 +02:00
Albrecht Schlosser
1d847fec00 Fix and improve Fl_GIF_Image (issue #271, #274)
- add error and EOF checks
- fix transparent pixel index outside ColorMap (#271)
- fix Fl_GIF_Image decoder bug (#274)
- add Fl_Image_Reader::skip(unsigned int)
- use new skip() method in GIF reader
2021-09-27 19:22:48 +02:00
Albrecht Schlosser
4075a14715 Clarify return values and fix a minor issue (#271)
Fix: Fl_Image_Reader::seek() would not clear the error flag when
reading from memory.
2021-09-25 20:19:51 +02:00
Albrecht Schlosser
bc0d18c1bb Enable error and EOF check in class Fl_Image_Reader (#271)
This is part 1 and a prerequisite for the fix of issue #271.
It enables the user of this internal class (Fl_{BMP|GIF}_Image)
to test for read errors and EOF (end of file) while reading.

The method used to read data from memory got an optional third
argument 'const long datasize = -1)' to limit the size of the
memory block of data provided to the image reader. Default is -1
which means "unlimited" (backwards compatibility).

Using only two arguments (w/o size limit) is deprecated and should
only be done if the data size is not available.
2021-09-25 19:33:22 +02:00
ManoloFLTK
0f12e96d13 macOS platform: facilitate use when another toolkit handles the system menu. 2021-09-24 17:56:35 +02:00
Albrecht Schlosser
828d3dd722 Fix malloc/delete mismatch (X11 only) 2021-09-12 13:37:53 +02:00
Albrecht Schlosser
418699fcea Fix two compiler warnings [-Wunused-variable] 2021-08-30 14:28:35 +02:00
Albrecht Schlosser
dc13b56915 Fix compiler warnings (Windows only)
src/Fl_Native_File_Chooser_WIN32.cxx:331:12: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
  331 |   while ( s=strchr(s,'\\') ) *s = '/';
      |           ~^~~~~~~~~~~~~~~

src/Fl_Native_File_Chooser_WIN32.cxx:336:12: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
  336 |   while ( s=strchr(s,'/') ) *s = '\\';
      |           ~^~~~~~~~~~~~~~
2021-08-30 14:16:49 +02:00
Duncan Gibson
6d78015071 add fl_filename_match comments as per STR3186
add Notes: section to fl_filename_match documentation
explaining case-sensitivity [or not] and use of \x

see also https://www.fltk.org/str.php?L3186
2021-08-28 15:12:38 +02:00
Albrecht Schlosser
29a56f87e3 Fix "Tooltip causing Window to 'unfocus' on Windows" (#261)
This fixes a regression introduced in FLTK 1.4 in commit
3bc5be71a3 ("Rewrite Fl_Tooltip.cxx
for the driver model").
2021-08-27 18:38:04 +02:00
Albrecht Schlosser
6ac305a508 Remove compiler warnings '-Wextra-semi' (see also PR #266)
I compiled with `-Wextra-semi -Werror=extra-semi` on Linux and Windows
(cross-compiled on Linux) and removed all "extra semicolon" warnings
I could find. I didn't check on macOS (yet).

Note: Linux configured with and w/o Pango but not w/o Xft. Compilation
with other options (e.g. Cairo) might still emit such warnings.
2021-08-27 14:52:43 +02:00
ManoloFLTK
33cf312a73 Fix problem in native file chooser with macOS 12 "Monterey" (beta). 2021-08-06 15:12:40 +02:00
ManoloFLTK
db7bb6cd98 Have Fl_Quartz_Copy_Surface_Driver account for current display scaling factor. 2021-08-05 19:21:05 +02:00
ManoloFLTK
e4ce39559a macOS: account for deprecation of [NSBitmapImageRep initWithFocusedViewRect:] in macOS 10.14 2021-08-04 18:25:37 +02:00
ManoloFLTK
fa49d29ec8 macOS: fix paste of image for macOS 11.x
With macOS 11.x, the pasteboard image can be found with floating point pixel values.
This changes makes FLTK process adequately such image data.
2021-08-03 18:08:33 +02:00
ManoloFLTK
ded0253bb7 Fix © year. 2021-07-24 18:10:16 +02:00
ManoloFLTK
39956805a4
Remove useless friend declaration. 2021-07-24 09:27:51 +02:00
Albrecht Schlosser
c6eccf6137 Call pthread's recursive mutex on Linux (Issue #245)
Add CMake test for PTHREAD_MUTEX_RECURSIVE

Add autoconf/configure compile test for PTHREAD_MUTEX_RECURSIVE

Replace "#ifdef PTHREAD_MUTEX_RECURSIVE"
   with "#ifdef HAVE_PTHREAD_MUTEX_RECURSIVE"
and define HAVE_PTHREAD_MUTEX_RECURSIVE in config.h
2021-07-21 12:16:20 +02:00
Albrecht Schlosser
787c67afea macOS: fix fltk_cairo shared library (issue #250)
- add missing dependencies to build the shared libfltk_cairo(.dylib)
- remove incorrect dependency on cairo from libfltk
- add cairo_test-shared demo (linked with shared libs)
2021-07-12 20:05:07 +02:00
Albrecht Schlosser
5cca79489b Harmonize and document syntax of config.h source files
- configh.in: add and improve comments, reorder statements
- configh.cmake.in: add comments, fix whitespace

- src/drivers/GDI/Fl_GDI_Graphics_Driver_line_style.cxx:
  fix trailing whitespace
2021-07-08 13:59:47 +02:00
Albrecht Schlosser
135ba3a7e1 macOS: Fl::add_timeout() must always create a new timer (#248)
The old version would reschedule an existing timer if a matching timer
existed already which was unique to macOS.

The new behavior is consistent on all platforms and allows to create
multiple timer entries with the same callback and userdata.
2021-07-08 10:10:58 +02:00
Albrecht Schlosser
87475c20d6 macOS: Fix a timer inconsistency and prevent a crash
Calling Fl::repeat_timeout() instead of Fl::add_timeout() to create
a timer would crash on macOS but fall back to Fl::add_timeout() on
Windows and Unix/Linux. Although this is documented as "undefined
behavior" a crash should always be avoided and the fallback is now
consistent on all major platforms.

In the future this may be documented as the standard behavior.
2021-07-07 15:35:14 +02:00
Albrecht Schlosser
1008cdfab2 Remove duplicate BOM check (#247)
Sorry for the noise, this was a "merge error".

Also, fix a typo.
2021-07-04 16:13:09 +02:00
Albrecht Schlosser
2e9d13c1a2 Fix svg image check (#247)
Thanks to @wcout for pointing out that "<svg\t" is a valid notation.

The overall length check (>= 5) is left in place intentionally.
2021-07-03 19:45:10 +02:00
Albrecht Schlosser
ce26f04f2d Check for valid length and simplify BOM check (#247) 2021-07-03 19:10:38 +02:00
ManoloFLTK
6361e7d1b7 Fix for issue #247 : loading SVG image with BOM. 2021-07-03 18:08:16 +02:00
Albrecht Schlosser
e3e8fe494d Fix FL_MOUSEWHEEL event coordinates in subwindow (#210)
Issue #210: "Fl::event_x() & event_y() doesn't take into account
  embedded window's coords with Mouse wheel events"

In fact the calculation of Fl::event_x() and Fl::event_y() used the
wrong window coordinates if the event was sent to a subwindow.
2021-07-01 18:42:03 +02:00
fire-eggs
55eee459d4 Fix use of variable out-of-scope (PR #242) 2021-06-27 14:34:17 +02:00
Albrecht Schlosser
75211977b2 Fix a potential memory leak (PR #241)
This is a hypothetical fix, since the condition `count == 0` may not
be true although `doit` has been allocated. In practice this should
not be possible since the same loop is executed twice in lines 463++
and 471++. But anyway, here it is...
2021-06-26 15:48:13 +02:00
fire-eggs
c21732705c Fix potential memory leak (#241)
Signed-off-by: Albrecht Schlosser <albrechts.fltk@online.de>
2021-06-26 15:46:56 +02:00
Albrecht Schlosser
713d1bfd7c Revert parts of and fix other 'constness' changes (#239, #181)
Some of the previous constness changes turned out to be incomplete,
others had to be reverted because some other driver methods could
not be made 'const' - particularly those calling open_display() to
get the requested information.
2021-06-18 18:46:17 +02:00
Albrecht Schlosser
f94ed7116c Make non-const Fl_Screen_Driver methods const (#181)
As requested by issue #181:
  "Fl_Screen_Driver.H non-const functions should be const"

Not all methods could be made 'const' because some screen related
methods call init() internally.
2021-06-16 14:24:05 +02:00
ManoloFLTK
465789951f Don't activate scaling shortcuts if platform doesn't support scaling. 2021-06-09 23:20:49 +02:00
Albrecht Schlosser
1bd57a20e6 Windows: Fix compiler warning, simplify code
src/Fl_Native_File_Chooser_WIN32.cxx:190:10:
  warning: ‘char* strncpy(char*, const char*, size_t)’ specified bound
  depends on the length of the source argument [-Wstringop-overflow=]
  190 |   strncpy(wp2, string, n);
      |   ~~~~~~~^~~~~~~~~~~~~~~~

Although there was no real problem with the code (the allocated buffer
was large enough), the code was questionable and there was redundant
code that could be simplified.
2021-05-31 14:14:37 +02:00
ManoloFLTK
b027d2ba57 Windows platform: use GDI+ to antialias oblique lines and curves. 2021-05-31 08:28:06 +02:00
ManoloFLTK
d95dd7acc4 New virtual member function Fl_Graphics_Driver::colored_rectf(). 2021-05-28 13:30:59 +02:00
ManoloFLTK
47ba6632b1 macOS: Avoid premature FL_RELEASE event at start of drag-n-drop operation.
This fixes this issue mentioned in fltk.general :
https://www.fltk.org/newsgroups.php?s40623+gfltk.general+v40638+T
2021-05-27 08:49:27 +02:00
Albrecht Schlosser
3b40d7a07f Fix trailing whitespace and formatting 2021-05-26 22:01:35 +02:00
Albrecht Schlosser
e4a972c3f3 Windows: fix fl_system() and fl_execvp() (STR 3438)
Use correct conversions to Windows "wide character" encoding and
use the appropriate wide character functions.
2021-05-26 21:52:58 +02:00
Albrecht Schlosser
12c0509806 X11: fix fl_clip_box() coordinates > 16-bit (STR 3134)
Pre-clip coordinates to 16-bit range before using X11 clipping
functions because X11 supports only 16-bit int's.
2021-05-26 15:25:36 +02:00
Albrecht Schlosser
0f3619ba0e Reimplement Fl_Group::delete_child(int) for Fl_Scroll 2021-05-25 17:41:00 +02:00
Albrecht Schlosser
9abbff2078 Add virtual int Fl_Group::delete_child(int n) (STR 3218)
This is a convenience method that does range checking (index n),
removes the child given by index n from the group and deletes it.
2021-05-25 17:39:20 +02:00
Albrecht Schlosser
3e0c30213b Suppress Visual Studio warnings in nanosvg code
- disable warning C4244 (conversion / data loss)
- restore #pragma warning after nanosvg includes
2021-05-07 16:48:54 +02:00
Albrecht Schlosser
374232e2f4 Fix MSVC 2010 and older not finding round()
Actually we don't know about some newer MSVC versions, but current
version MSVC 2019 works fine w/o defining round(). If other MSVC
versions need this as well we can change the version test or add
a compiler feature test to CMake (configure not required).
2021-05-07 15:48:24 +02:00
Albrecht Schlosser
4190cd5426 Fix Windows (Visual Studio) compiler warnings 2021-05-06 13:38:04 +02:00
Albrecht Schlosser
cce652f58c Fix compiler warning on macOS
Compiling drivers/Posix/Fl_Posix_System_Driver.cxx...
drivers/Posix/Fl_Posix_System_Driver.cxx:176:14: warning: unused function 'quadruple_dlopen' [-Wunused-function]
2021-05-03 21:42:00 +02:00
ManoloFLTK
9df287b415 Cleaner access to Fl_Gl_Window_Driver objects. 2021-04-29 10:40:18 +02:00
Albrecht Schlosser
f9e8ef0b7a Fix "Fl_Shared_Image: use of unitialized data" (#216)
- fix issue as proposed
- fix more potential access to uninitialized data issues
- document Fl_Shared_Image::add_handler()
- document typedef Fl_Shared_Image::Fl_Shared_Handler()
2021-04-28 13:36:34 +02:00
ManoloFLTK
3bc9017970 Slightly simplify gl_texture_fifo::compute_texture()
The font size is set to the value necessary for the GL scene before
computing the string width.
Virtual Fl_Gl_Window_Driver::effective_size() becomes unnecessary.
2021-04-27 09:09:08 +02:00
Albrecht Schlosser
7a7f3c3324 Avoid "Bogus FL_MOVE/FL_DRAG events" (#76)
Fix sending bogus events if CONSOLIDATE_MOTION is on.
2021-04-26 14:15:55 +02:00
Albrecht Schlosser
72901a626c Fix potential buffer overrun (WIN32 only) 2021-04-16 18:08:15 +02:00
ManoloFLTK
cacaa17499 Minor simplification in Fl_Gl_Window_Driver::capture_gl_rectangle() 2021-04-16 09:31:02 +02:00
ManoloFLTK
78aa959ab9 Fix Fl_Cairo_Graphics_Driver::rect and Fl_Cairo_Graphics_Driver::rectf 2021-04-14 13:59:16 +02:00
Daniel G
5c0fe8f411 Update Fl_WinAPI_Window_Driver.H
Fix copy paste error.
2021-04-13 12:23:01 +02:00
Albrecht Schlosser
22cb8a7fdb Make Fl_Input::handle_key() protected (#203)
... as requested in this comment:
https://github.com/fltk/fltk/issues/211#issuecomment-814235771
2021-04-07 19:14:25 +02:00
Albrecht Schlosser
7f969b5496 Remove static variable, fix gcc warning [-Wclobbered] (#203)
PR #203 "Multithread fix for PNG loading" includes a suggested fix
that moves the variable fp to the Fl_PNG_Image structure.

This commit fixes the threading issue by allocating the variable fp
with new, avoiding the [-Wclobbered] warning w/o using a static var.

The same issue is now also fixed in Fl_JPEG_Image.
2021-04-07 10:55:13 +02:00
ManoloFLTK
f8d1b83a0e Fix for issue #209: Gtk-CRITICAL messages from native file chooser
Thanks to K.R. for the fix.
2021-04-04 19:26:38 +02:00
ManoloFLTK
30725faf0a Move the X11-specific part of GTK native file chooser to Fl_X11_System_Driver 2021-03-31 18:58:34 +02:00
ManoloFLTK
2a6e9d9493 Fl_X11_System_Driver::probe_for_GTK() is now Fl_Posix_System_Driver::probe_for_GTK() 2021-03-31 10:58:03 +02:00
ManoloFLTK
778a4577d4 Move quadruple_dlopen() to Fl_Posix_System_Driver.cxx where it's used. 2021-03-31 10:39:06 +02:00
ManoloFLTK
ba03dde15c Move probe_for_GTK() to class Fl_Posix_System_Driver from Fl_X11_System_Driver.
Similarly move dlopen_or_dlsym().
This move is because GTK is not X11-specific.
2021-03-31 09:51:10 +02:00
ManoloFLTK
ef41409759 Add guard against multiple inclusion of header file. 2021-03-27 19:05:29 +01:00
ManoloFLTK
4657e988f7 Remove X11-specific code from platform-independent Fl_PostScript.cxx 2021-03-26 07:52:21 +01:00
Greg Ercolano
4951fd1801 Better fix for issue #206.
Albrecht caught a problem with my strncat use (see comments for 12d8da9c).

I noticed we have fl_strlcpy() and fl_strlcat() which is what was really
needed here.
2021-03-23 18:27:30 -07:00
Greg Ercolano
12d8da9cb6 Solve issue #206 warning. 2021-03-23 12:24:04 -07:00
Greg Ercolano
8a9e25cdac Optimization for pixel loop.
As per erco's comments on fltk.coredev, Mar 21 2021
in thread Subject: Re: 1.4 build failing on OSX for me
2021-03-23 12:18:41 -07:00
Albrecht Schlosser
5fb6713485 Remove unused #include statements
Cairo is not used in this file, math.h is not necessary, and stdio.h
is only required if USE_PANGO is false.
2021-03-22 22:57:24 +01:00
Greg Ercolano
d6d1d8afe4 Solve issue #204, wrong default for labelfgcolor()
FL_BLACK changed to FL_FOREGROUND_COLOR as per docs.
2021-03-22 07:58:47 -07:00
Albrecht Schlosser
62ff323b70 Add missing include file stdlib.h for abs(int)
This file was included (in math.h or elsewhere) on Linux and latest
macOS versions but maybe not in earlier macOS versions or with other
configuration options.
2021-03-22 00:13:47 +01:00
Albrecht Schlosser
edfe684419 Windows: fix fl_filename_isdir()
- convert filename from UTF-8 to "Windows wide chars"
- use GetFileAttributesW() instead of _stat()
2021-03-21 19:36:27 +01: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
Greg Ercolano
bd52db0b95 Added docs for public fl_vsnprintf() (STR #3413)
Applied vsnprintf_v2.patch from STR#3413 which documents
the previously undocumented function, so that it shows up
here in the doxygen docs:

    Files -> File List -> vsnprintf.c -> fl_vsnprintf()

This commit does not solve STR #3413, just adds the recommended documentation
for fl_vsnprintf(). Other functions in src/vsnprintf.c could use docs too.

See the bottom of comment #5 in the STR for recommendations to fully solve.
2021-03-19 09:22:01 -07:00
fire-eggs
0688c77c33 Fix stack corruption when loading GIF 2021-03-18 07:02:14 +01:00
ManoloFLTK
a4866ffc21 Partial fix for issue #188.
This fixes the inconsistency created by the possibility to change img->w() and img->h()
values. The fix is to use img->data_w() and img->data_h() that have constant values.
2021-03-15 15:12:25 +01:00
Albrecht Schlosser
a620ef5b37 Fix Linux build with --enable-pango 2021-03-15 15:06:23 +01:00
ManoloFLTK
1fbcae13bd Create class Fl_Cairo_Graphics_Driver.
That class is extracted from inside Fl_PostScript_Graphics_Driver and might
become handy in the future.
2021-03-15 14:09:50 +01:00
ManoloFLTK
a3cb4af739 Class Fl_PostScript_Graphics_Driver: better separation of what varies with USE_PANGO 2021-03-15 08:13:21 +01:00
ManoloFLTK
ce142e80df Fix fl_endpoints() for macOS platform that was not effective. 2021-03-13 20:06:28 +01:00
ManoloFLTK
368f18016c
Fast pango (#201)
* Cache single unicode character widths under Xft+Pango
2021-03-13 19:21:25 +01:00
ManoloFLTK
569fec25e0 Unification of scaled coordinate calculations in class Fl_Scalable_Graphics_Driver
Most coordinate calculations are done with the new inline function
 int Fl_Scalable_Graphics_Driver::floor(int coord)
that is used by both the Windows and X11 platforms.
2021-03-11 16:05:32 +01:00
ManoloFLTK
e19bfc0d8f Windows platform: accurate drawing area of RGB images with scaled GUI. 2021-03-02 12:11:30 +01:00
ManoloFLTK
42aa31b900 X11 platform: Accurately control RGB image drawing with GUI scaling. 2021-03-02 10:07:06 +01:00
ManoloFLTK
b771ee53b9 Remove duplicated code between derived classes of Fl_Graphics_Driver - cont'd. 2021-03-01 15:47:30 +01:00
ManoloFLTK
0623a8d4b9 Remove duplicated code between derived classes of Fl_Graphics_Driver. 2021-03-01 15:11:00 +01:00
ManoloFLTK
81a4b7329c Remove warnings about hidden virtual member functions. 2021-03-01 11:20:15 +01:00
Albrecht Schlosser
49a78bc482 Fix cairo build (autoconf + CMake) + README's
- rewrite to use pkg-config with both autoconf + CMake
- remove hardcoded library names
- fix build dependencies and search directories
- remove or replace old and unused variables
- update README files

To be done:
- implement fallback for autoconf/configure if pkg-config is missing
- fix pango build (uses cairo internally)
2021-03-01 10:45:59 +01:00
Albrecht Schlosser
ae41dc46b9 Update dependencies 2021-02-27 23:34:12 +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
88a3f7b7be Rename fl_remove_scale() to fl_override_scale() as discussed in fltk.general
Re: Can custom box type functions handle their own high-DPI screen scaling?
2021-02-27 08:18:01 +01:00
Albrecht Schlosser
5c1b69cd4f Fix Doxygen docs (unescaped '$') 2021-02-25 19:23:37 +01:00
ManoloFLTK
5bd467fa17 Add fl_remove_scale()/fl_restore_scale() to transiently draw without scaling factor.
This new API is a response to this message in fltk.general :
Can custom box type functions handle their own high-DPI screen scaling?
2021-02-25 11:07:07 +01:00
ManoloFLTK
bef46b5cb8 Improve precision of GUI scaling for Windows platform. 2021-02-24 14:52:47 +01:00
ManoloFLTK
28aaa4d4ce Simplify source code of Fl_GDI_Graphics_Driver::draw_rgb(Fl_RGB_Image *,…) 2021-02-22 11:34:14 +01:00
ManoloFLTK
dd75da6351 Remove VS compilation warnings about implicit type conversions. 2021-02-21 21:34:27 +01:00
ManoloFLTK
e387dbd30c Remove VS compilation warning messages about implicit type conversions. 2021-02-21 19:15:39 +01:00
ManoloFLTK
842cbf0f10 Fix for issue #192: focus box drawing incorrectly on OSX (e.g. 10.10.5) at scales >100% 2021-02-21 18:08:33 +01:00
Albrecht Schlosser
a274e1488b Fix #include statements, remove unnecessary includes 2021-02-21 14:04:44 +01:00
ManoloFLTK
32f926c360 Remove use of static global var gl_fontsize inside virtual member Fl_Gl_Window_Driver::alpha_mask_for_string() 2021-02-19 15:03:32 +01:00
Albrecht Schlosser
389760c1c6 Remove #include ".../config_lib.h" from remaining sources
... except src/Fl.cxx

Fl.cxx uses the FL_CFG_* macros to define the values of runtime
configuration options. This is now the only usage of config_lib.h.

Todo: we can probably implement these runtime config vars in another
way and finally remove config_lib.h.
2021-02-18 13:11:47 +01:00
Albrecht Schlosser
135b8b9c86 Update dependencies 2021-02-18 12:55:51 +01:00
Albrecht Schlosser
6236d4d466 Remove redundant definition of FL_CFG_GFX_OPENGL 2021-02-18 12:34:30 +01:00
ManoloFLTK
f333191312 Make clear we're calling a member function of class Fl_WinAPI_System_Driver. 2021-02-18 08:29:02 +01:00
ManoloFLTK
b3f0b853a5 Documentation: remove Doxygen warnings of undeclared members. 2021-02-17 08:39:15 +01:00
ManoloFLTK
6dce15bfe3 Include config.h rather than config_lib.h in fl_open_uri.cxx 2021-02-17 08:39:15 +01:00
ManoloFLTK
9fdd675eab Remove FL_CFG_SYS_POSIX and FL_CFG_SYS_WIN32 preprocessor vars from Fl_lock.cxx 2021-02-16 16:28:57 +01:00
ManoloFLTK
b709b2a2d3 Remove FL_CFG_WIN_COCOA preprocessor variable from Fl_Tree_Prefs.cxx 2021-02-16 15:50:15 +01:00
ManoloFLTK
32f7973073 Remove FL_CFG_SYS_POSIX preprocessor variable from Fl_get_key.cxx 2021-02-16 15:50:15 +01:00
ManoloFLTK
bf95eb1c09 Remove FL_CFG_SYS_POSIX preprocessor variable from fl_open_uri.cxx 2021-02-16 15:50:15 +01:00
ManoloFLTK
1298bf00f5 Remove FL_CFG_WIN_COCOA preprocessor variable from Fl_Sys_Menu_Bar.cxx 2021-02-16 15:50:15 +01:00
ManoloFLTK
35812f474b Include <config.h> in Fl_Gl_Window.cxx 2021-02-16 15:50:15 +01:00
ManoloFLTK
98265d81a2 Remove FL_CFG_WIN_X11 preprocessor variable from Fl_own_colormap.cxx 2021-02-16 15:50:15 +01:00
Albrecht Schlosser
e182c8bcd5 Fix whitespace errors (no code changes)
- remove trailing whitespace
- convert tabs to spaces (configure.ac)
2021-02-16 14:21:13 +01:00
ManoloFLTK
1d44c57747 Fix lowercase error in filenames. 2021-02-16 12:34:30 +01:00
ManoloFLTK
1f9c80854c Remove FL_CFG_WIN_X11 preprocessor variable from Fl_Native_File_Chooser_GTK.cxx 2021-02-16 12:08:56 +01:00
ManoloFLTK
d51481f95e Remove FL_CFG_SYS_WIN32 preprocessor variable from fl_draw_pixmap.cxx 2021-02-16 11:58:15 +01:00
ManoloFLTK
5f3d8bc634 Include <config.h> when possible - continued. 2021-02-16 11:23:57 +01:00
ManoloFLTK
d93fc2bfa6 Use <config.h> when appropriate. 2021-02-16 11:08:59 +01:00
ManoloFLTK
06793c50fb Create virtual Fl_RGB_Image* Fl_Gl_Window_Driver::capture_gl_rectangle() 2021-02-16 10:26:52 +01:00
ManoloFLTK
1adaa3def2 Create classes Fl_XXX_Gl_Window_Driver according to driver model. 2021-02-16 09:29:13 +01:00
ManoloFLTK
a723c0e889 PR #174: Skip the call to MonitorFromRect when it is not needed. 2021-02-15 21:07:24 +01:00
Albrecht Schlosser
bbaec9bd88 Update CMake and make files, minor edits only
There are no functional changes to be expected, mostly formatting
and comments.
2021-02-15 19:45:20 +01:00
ManoloFLTK
9fad601401 Remove compilation warnings issued by Visual Studio 2019. 2021-02-13 21:13:04 +01:00
ManoloFLTK
5ade8fcb09 Fix for issue #185 "Shared Image reload() loses initial dimensions" 2021-02-12 07:32:49 +01:00
Albrecht Schlosser
c7dc112d2e Fix missing export of fl_scroll() (issue #186) 2021-02-12 00:45:25 +01:00
Albrecht Schlosser
ff0543524b Fix X11 copy-paste and drag-and-drop target selection (#182)
Select the "best" target rather than a random one out of a list of
suitable targets. The old target selection algorithm would sometimes
select the wrong target and hence retrieve unexpected data.

This could happen in both copy-paste and drag-and-drop operations.

Note: backported to 1.3.6 (git current) as well
      (commit 7ce6d2cf5d).

Closes #182.
2021-02-11 15:51:37 +01:00
ManoloFLTK
ed5854d65a Fix for issue #185 in Fl_Shared_Image::reload()
This fix updates Fl_Shared_Image::reload() to account for the data_w() and data_h()
image members.
2021-02-11 09:12:12 +01:00
Albrecht Schlosser
d53d6f3bce Fix potential NULL pointer dereference 2021-02-10 14:11:04 +01:00
ManoloFLTK
818a2ab838 Windows scaling support: fix after WM_MOVE and in mouse_event()
The fix in mouse_event() makes sure the scale factor of the receiving window is correct
when distinct screens have distinct scale factor values.

The fix after WM_MOVE event makes sure a subwindow-containing window in a
multiple-screen desktop having distinct scale factor values is correctly rescaled.
2021-02-10 10:19:08 +01:00
ManoloFLTK
8eed8b9600 Scaling support under Windows: fix fullscreen window mode.
When scale was > 1, fullscreen window did not cover the task bar,
as seen with test/fullscreen.
2021-02-01 13:25:39 +01:00
ManoloFLTK
871e7063a2 Windows: restore "checkers" app that was damaged after handling of issue #155. 2021-01-25 18:58:05 +01:00
ManoloFLTK
7fdac3790a Windows: fix scaling problem in Fl_Tile.
The problem was visible with test/tile for fractional scaling values when
moving the vertical division.
2021-01-25 08:01:42 +01:00
Albrecht Schlosser
fba4d58509 Fix Fl_Help_View::find() (issue #179)
Fix search (string comparison) which had a few different issues.
Document the function, arguments, and details about string matching.

To do: correctly match complex HTML entities like "&euro;" with
Unicode code points >= U+0080 (UTF-8 multi byte encoding).
2021-01-08 14:57:34 +01:00
ComputerNerd
34da17cd85 Set errmsg to exterr instead of err which will always be zero. 2020-12-13 21:15:47 -06:00
ManoloFLTK
4f29313a80 Windows scaling: fix redraw after partial expose events.
Under XP (at least), WM_PAINT events occur where information of where to redraw
is mostly given by the system, in the window's update region. When the GUI is scaled,
that information must be un-scaled and then added to Fl_X::i(window)->region, for the
adequate part of the window to be painted.
2020-12-03 15:08:59 +01:00
ManoloFLTK
d1c7caec3b Improve Fl_Graphics_Driver::cache_size() when GUI is scaled.
The change lets this function enlarge the size only when strictly necessary
for image tiling.
2020-12-02 14:39:49 +01:00
ManoloFLTK
4171cbe0be Windows scaling: fix computation of border sizes.
The corrected error was to use, e.g.,
  int dx = W - w->w() * s;
which does not produce the desired integer value.
The correct writing is :
  int dx = W - int(w->w() * s);
2020-12-01 16:58:08 +01:00
ManoloFLTK
67bb631bd9 Scaling for Windows and X11: support rectangular loops. 2020-11-30 18:50:19 +01:00
ManoloFLTK
ff372c86d8 Fix for issue #123 - Windows platform 2020-11-29 09:48:23 +01:00
ManoloFLTK
f5f9043208 Windows: fix undrawn pixels at right and bottom of scaled windows. 2020-11-29 09:15:04 +01:00
ManoloFLTK
4291e9497b Fix for issue #123 - macOS platform 2020-11-27 17:49:49 +01:00
ManoloFLTK
d851106f47 Prevent compilation warning about uninitialized variables. 2020-11-27 09:17:33 +01:00
ManoloFLTK
d7985607d6 Fix for issue #123 - X11 platform
As discussed, only the window position becomes rounded to nearest integer value
when a fractional GUI scale factor is applied.
2020-11-25 09:21:44 +01:00
ManoloFLTK
c684505407 Fix for issue #163: Improve Xrender scaling quality 2020-11-24 10:05:36 +01:00
Greg Ercolano
a41d8c0e60 Fix issue #162 2020-11-22 18:18:02 -08:00
ManoloFLTK
a47c907fca Fix for STR #3424 and for issue #160 2020-11-22 10:16:21 +01:00
Albrecht Schlosser
f519aceb85 Update dependencies 2020-11-21 13:20:26 +01:00
ManoloFLTK
aa9e2e888e Fix for issue #159 - continued
Changes here concentrate the fix within static function alpha_blend() and thus
are visible only when drawing transparent images under X11 platform
without Xrender.
2020-11-20 10:33:46 +01:00
ManoloFLTK
aa140973a3 Remove compilation warnings about signed/unsigned comparison. 2020-11-19 16:13:02 +01:00
ManoloFLTK
e52e057cdf Fix for issue #159. 2020-11-19 15:59:48 +01:00
ManoloFLTK
3ec51f0b80 Remove unnecessary function call when macOS ≥ 10.6 2020-11-19 15:59:48 +01:00
ManoloFLTK
f56d43c9f6 Rename private member function with trailing underscore. 2020-11-19 15:59:48 +01:00
ManoloFLTK
0f6fb2ab5a Add comment about detection of macOS "Big Sur" 11.0 at run-time. 2020-11-19 15:59:48 +01:00
Albrecht Schlosser
5cb72ef065 Fix whitespace and minor formatting issues 2020-11-17 16:11:03 +01:00
ManoloFLTK
2931c29689 Replace virtual Fl_RGB_Image::cache_size() by virtual Fl_Image::cache_size() 2020-11-17 11:23:35 +01:00
ManoloFLTK
c227edef39 Fix for issue #155 - continued
This fix takes care of the Windows platform.
2020-11-13 10:02:43 +01:00
ManoloFLTK
a4bacf83c4 Fix for issue #155 - continued
Restores proper separation of what is in libfltk and what is in libfltk_images
2020-11-12 14:50:57 +01:00
ManoloFLTK
231159e16c Fix for issue #155 - continued
The issue lies in details how floating point scaled coordinates are converted
to integer values and its impact on the drawing of large SVG images.
This commit fixes the X11 platform.
The macOS platform is immune because drawing uses floating point
coordinates.
The Windows platform still needs fixing.
2020-11-12 07:46:12 +01:00
ManoloFLTK
df9749e6a8 Fix for issue #155 "SVG rendering spoiled by scaling". 2020-11-10 21:03:48 +01:00
ManoloFLTK
7b6d0a8196 Restore building with --disable-svg 2020-11-10 15:51:54 +01:00
ManoloFLTK
08b36fe4c8 Remove useless typedef declaration. 2020-11-10 15:51:54 +01:00
ManoloFLTK
9bd65d5993 Remove compilation warning that HAVE_DLFCN_H is undefined. 2020-11-10 15:51:54 +01:00
ManoloFLTK
b35010595a Simpler code and doc of Fl::screen_scale(int n, float factor) 2020-11-07 12:44:06 +01:00
ManoloFLTK
0d594319c1 Add extra argument to Fl_SVG_File_Surface constructor.
This makes processing of the underlying FILE object consistant by classes
Fl_SVG_File_Surface, Fl_EPS_File_Surface and Fl_PostScript_File_Surface.
2020-11-03 18:05:18 +01:00
ManoloFLTK
98a4e49204 Fix possible memory leak in Fl_WinAPI_Screen_Driver::read_win_rectangle_unscaled()
Thanks to "fire-eggs" for spotting it.
Also minor optimisations in Fl_X11_Screen_Driver::read_win_rectangle_unscaled() and
Fl_Cocoa_Screen_Driver::read_win_rectangle_unscaled().

This closes PR #151.
2020-11-02 13:13:53 +01:00
engelsman
f0af606708
Save fl_file_chooser directory on cancel (STR 3225) (#110)
* save fl_file_chooser directory on cancel (STR3225)

by default, the fl_file_chooser() starts in the current directory
if no filename is given, but the directory is reset to the "system
directory" if the dialog is cancelled without choosing a file.
This patch saves and restores the directory if no file is chosen.

See also https://www.fltk.org/str.php?L3225

* add fl_file_chooser() reinitialization comments
2020-11-02 11:38:30 +01:00
ManoloFLTK
1761523c9e Add Fl_PostScript_File_Device::close_command(Fl_PostScript_Close_Command cmd)
Also expand Doxygen doc of class Fl_Printer for the X11 platform.
2020-11-01 09:26:40 +01:00
ManoloFLTK
b540c65081 X11+GTK: remove warning when native file chooser runs on Wayland 2020-10-30 17:00:30 +01:00
ManoloFLTK
70da3a34b0 Fix PostScript driver for fl_draw_image(buf,X,Y,W,H,D,L) with negative D or L 2020-10-29 15:37:20 +01:00
ManoloFLTK
56318163e3 Cairo-based PostScript: fix image tiling 2020-10-29 10:32:17 +01:00
ManoloFLTK
bfb64aa01e Remove the "Print" window meant for debugging. 2020-10-28 17:34:05 +01:00
ManoloFLTK
8accc6e840
Pango ps (#148)
Use cairo-PostScript to output PostScript when pango is available.

This allows to draw in vectorial form any script.
Before, only the Latin script could be drawn to PostScript in vectorial form.
2020-10-28 17:19:05 +01:00
ManoloFLTK
f718943e6f Minor fix in doc of the Fl_Image_Surface constructor. 2020-10-14 13:36:50 +02:00
ManoloFLTK
966e15fe37 Simpler implementation of Fl_Quartz_Image_Surface_Driver::image() 2020-10-14 09:56:53 +02:00
ManoloFLTK
0d8385a652 Simpler macOS implementation of capture of window titlebars. 2020-10-12 21:05:38 +02:00
ManoloFLTK
5830226aab Change procedure to capture window titlebar for macOS ≥ 10.15
That is necessary to support macOS Big Sur because previous procedure
did not work for tabbed windows. The new procedure is potentially
usable from macOS 10.5, but tested at this stage for macOS ≥ 10.15.
2020-10-11 10:43:01 +02:00
ManoloFLTK
1a841795d1 Fl_Xlib_Font_Descriptor does not need char glok[64] when USE_XFT is on 2020-10-08 11:57:34 +02:00
ManoloFLTK
de4a5765bc Fix for issue #145 and for unbundled macOS apps. 2020-10-05 18:20:25 +02:00
ManoloFLTK
1e73216405 Fix issue #145: Native file dialog on macOS in the absence of another FLTK window. 2020-10-05 11:54:02 +02:00
ManoloFLTK
0c55cd1aca Create Fl_X11_System_Driver::dlopen_or_dlsym() for run-time addresses.
The intent is to gather in a single place of the X11 platform source code
all variable elements when using dlopen() and dlsym() system functions
(e.g., .so vs .dylib extension name, is RTLD_DEFAULT available, locations
to be sought).
Member function Fl_System_Driver::load() is created only to support
Fl_Plugin_Manager::load().
2020-10-04 08:21:07 +02:00
ManoloFLTK
46598229a9 Have Fl_X11_System_Driver::newUUID() use uuid_generate() if available at run-time.
The code falls back to the ad-hoc method if uuid_generate() isn't available.
2020-10-02 12:18:18 +02:00
ManoloFLTK
7f2e206279 Fix possible memory allocation error. 2020-09-30 14:41:19 +02:00
Greg Ercolano
a20c2103ec Solves issue #143. 2020-09-23 22:42:12 -07:00
ManoloFLTK
1d56c9e193 Add Doxygen doc of "static unsigned Fl_Graphics_Driver::need_pixmap_bg_color" 2020-09-23 12:46:28 +02:00
ManoloFLTK
a4a5720658 macOS: minor improvement of capture of window titlebar. 2020-09-21 18:20:07 +02:00
ManoloFLTK
5c5132f681 Fix when building with SDK 10.15 and running with 11.0 Big Sur
When FLTK runs under macOS "Big Sur", the OS appears as 11.0
if FLTK was built with SDK 11.0 and as 10.16 it it was built with
SDK 10.15.
2020-09-19 21:59:25 +02:00
ManoloFLTK
8ba68dd275 macOS: increase resolution when drawing window titlebars to PostScript 2020-09-19 15:26:02 +02:00
Albrecht Schlosser
360040d0bf Improve Fl_Menu_Item docs and inline deprecated methods
The deprecated methods are now calling the new methods to be
entirely compatible.

These methods should be removed in 1.5.0

(fix unrelated whitespace as well)
2020-09-18 17:17:36 +02:00
ManoloFLTK
49a94d2366 More detailed doc of Fl_Image_Surface::image() 2020-09-18 15:51:00 +02:00
Greg Ercolano
23232d8462 Noted unused variable in Fl_Text_Display.. 2020-09-17 09:26:22 -07:00
Greg Ercolano
6f04232dd9 Added Fl_Text_Display::style_buffer(), solves issue #138 2020-09-16 13:33:05 -07:00