Commit Graph

9280 Commits

Author SHA1 Message Date
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
1afbbb4aef Documentation updates (formatting)
no code changes
2021-10-17 13:39:40 +02:00
Albrecht Schlosser
8863ef7901 Avoid multiple definition of macro __fl_attr()
This could happen if both FL/fl_ask.H and fluid/Fl_Type.h were
included in the same file.
2021-10-17 12:24:39 +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
Albrecht Schlosser
cf20474d7c CMake: Simplify adding test programs for developers
The intention is to make it more convenient for developers to add
one or more test programs for their tests by editing only one
variable (extra_tests).
2021-10-06 18:17:55 +02:00
ManoloFLTK
a6f02f86fa Attempt to use "git commit --amend" 2021-10-06 11:14:56 +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
ManoloFLTK
802eb5468b macOS: "Fix fullscreen window level corner cases"
This corresponds to changes of PR#277
2021-10-06 09:48:18 +02:00
Albrecht Schlosser
10da46a5a6 Improve documentation about library build folders and more
lib/README.txt: clarify where built libraries are located

documentation/src/basics.dox: clarify (C++) compiler command usage
  and improve documentation of the fltk-config script
2021-10-04 14:42:32 +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
b6a69db9a6 Rename 'fileno()' method to 'get_fileno()' for MinGW
See fltk.coredev thread "fltk-1.4 fluid build broken on 32-bit mingw"
https://groups.google.com/g/fltkcoredev/c/W9LWbsNuGZg/m/MW1BVAkeAgAJ

This regression was introduced in commit c8c1f51db7 in an
attempt to fix a Visual Studio (MSVC) warning but broke "old" MinGW
builds that define 'fileno' as a macro.
2021-09-28 12:40:43 +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
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