Commit Graph

9263 Commits

Author SHA1 Message Date
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
c3857517b0 Improve documentation chapter "Basics"
Add '-ldl' to example command line and other minor changes
2021-09-21 20:29:02 +02:00
Albrecht Schlosser
54213b95fe Doxygen docs: convert doxygen input file to current version
CMake only: "current" version means the doxygen version available
on the system where docs are generated.

Todo: do the same for autoconf/make builds.
2021-09-21 20:28:02 +02:00
Albrecht Schlosser
a774e120bc Update nanosvg library to latest upstream version
commit ccdb1995134d340a93fb20e3a3d323ccb3838dd0
Merge: 3cdd4a9 419782d
Author: Mikko Mononen <memononen@gmail.com>
Date:   Fri Sep 3 21:24:42 2021 +0300

    Merge pull request #198 from ctrlcctrlv/CVE_2019_1000032

    Fix decimal values in color fields (nsvg__parseColorRGB, nsvg__parseColorHex)
2021-09-13 19:31:27 +02:00
Albrecht Schlosser
828d3dd722 Fix malloc/delete mismatch (X11 only) 2021-09-12 13:37:53 +02:00
Albrecht Schlosser
cc0657d7a7 Improve documentation of Fl_Image (Issue #272)
Try to explain what count() returns and what data() contains which
can be different by image type.
2021-09-09 17:53:54 +02:00
Greg Ercolano
9e0f140f0a Remove stray tab 2021-09-01 10:05:36 -07:00
Albrecht Schlosser
0f57e272a7 Fix MSVC 'fileno' warning in example program (#109) 2021-08-31 18:12:41 +02:00
Albrecht Schlosser
ef86d9aced Fix more MSVC warnings in test apps (#109)
- test/checkers.cxx
 - test/cube.cxx
 - test/offscreen.cxx
 - test/unittest_simple_terminal.cxx
 - test/utf8.cxx
2021-08-31 17:49:31 +02:00
Albrecht Schlosser
e5310144b7 Fix MSVC 'GLfloat' warnings in test apps (#109) 2021-08-31 17:18:18 +02:00
Albrecht Schlosser
2b29e921db Fix MSVC compiler warnings in test/icon.cxx (#109)
Also:

- remove unnecessary 'size_t' conversions from FL/fl_casts.H
- add reverse conversions from integer types to 'void *'
2021-08-31 16:52:54 +02:00
Albrecht Schlosser
c91713fd88 Fix MSVC warnings in test/fonts.cxx (issue #109) 2021-08-31 00:26:56 +02:00
Albrecht Schlosser
c8c1f51db7 Fix MSVC "fileno" warnings in fluid 2021-08-30 23:45:16 +02:00
Albrecht Schlosser
1a8b94162d Fix Windows (VS) compiler warnings in fluid 2021-08-30 23:45:16 +02:00
Albrecht Schlosser
ed3ec2d036 Add experimental FL/fl_casts.H (issue #109) 2021-08-30 23:43:55 +02:00
fire-eggs
753631a0b5 Fix MSVC compiler warnings (PR #267) 2021-08-30 22:13:32 +02:00
Greg Ercolano
975d34de43 Fix VS2017 'pclose' error, and DIR formatting 2021-08-30 11:56:21 -07: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
Albrecht Schlosser
2ce8183bee Fix compiler warnings (Windows, MSVC) 2021-08-30 13:56:28 +02:00
Albrecht Schlosser
d4b210a763 Remove unused declaration of Fl_Char 2021-08-30 12:02:16 +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
Albrecht Schlosser
23c54e7a4b GitHub Actions (Linux): add 'apt-get update'
Error was:

E: Failed to fetch http://azure.archive.ubuntu.com/ubuntu/pool/main/m/mesa/libegl-mesa0_21.0.3-0ubuntu0.2~20.04.1_amd64.deb  404  Not Found [IP: 52.147.219.192 80]
E: Failed to fetch http://azure.archive.ubuntu.com/ubuntu/pool/main/m/mesa/libgl1-mesa-dev_21.0.3-0ubuntu0.2~20.04.1_amd64.deb  404  Not Found [IP: 52.147.219.192 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Error: Process completed with exit code 100.
2021-08-27 13:49:01 +02:00
tetsuhaut
29dd21bcef Remove an extra semicolon
One less warning, yay !
2021-08-27 12:58:25 +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
Albrecht Schlosser
410a01c6db Add CMake compatibility functions and macros
CMake/compatibility.cmake: define functions and macros to be used
  if a particular CMake functionality requires a higher CMake version
  than FLTK's minimum CMake version, see 'cmake_minimum_required(...)'
  in the root CMakeLists.txt.

Note: target_link_directories() is available since CMake 3.13
2021-07-26 17:40:26 +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
Michael R Sweet
15f1b6b5c4
Fix macOS Apple Silicon architecture name (arm64) 2021-07-17 11:24:26 -04: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
26c46cc022 Prevent CMake from expanding comments
Unfortunately CMake doesn't check for comments and expands the
example syntax! Is this a CMake bug? Anyway, this is fixed now.
2021-07-08 14:30:13 +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