Commit Graph

9223 Commits

Author SHA1 Message Date
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
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
fire-eggs
571ff10553 Fix "failure to call pclose" (#240) 2021-06-26 14:46:39 +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
Albrecht Schlosser
986a8b33a2 Fix keyboard demo international keyboards
Fl::event_key() display needs to be converted to UTF-8 for keycodes
outside the ASCII range (0xa0 - 0xff). Such keycodes can be found
on international keyboards.
2021-06-11 13:25:31 +02:00
Albrecht Schlosser
d0874f1058 Reformat bundled lib 'makedepend' files
The new 'makedpend' format in the bundled libs is one line per
dependency, sorted, like all the other makedepend files.

libpng: add ARM platform files
2021-06-10 12:32:19 +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
3c84894f19 Windows: Fix compiler warning: unused variable 2021-05-31 14:20:08 +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
538079c7a0 Clarify demo code and add comment with "translated" string
Add the example string in binary "latin1" (ISO-8859-1) encoding
in a comment as clear text for reference (code is UTF-8 encoded).
2021-05-26 22:05:16 +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
da4d16b59a Update fluid tutorial on CubeView and demo code
Format code according to the CMP, add instructions on how to copy
the code to the fluid tutorial, and update the tutorial with the
current code of test/CubeView.h and test/CubeView.cxx.
2021-05-21 20:08:12 +02:00
Albrecht Schlosser
cbee4880f4 Update README.macOS.md (minor fixes) 2021-05-13 16:21:52 +02:00
Albrecht Schlosser
773467dee4 Refactor macOS bundle generation to avoid "quarantine"
macOS Big Sur 11.3 introduced a new "security feature" such that
app bundles created from existing bundle templates in downloaded
files (tar distibutions, expanded) could no longer be executed
without unsetting the "quarantine" attribute. This commit fixes
this by creating all bundles from scratch.

Known *workaround* for older tarballs and snapshots:

  $ xattr -d -r com.apple.quarantine xxx.app
2021-05-13 16:18:13 +02:00
Albrecht Schlosser
64296707d9 Include bitmap files rather than copying the source code
There's no need to blow up the source file by including the bitmap
file literally in the source code. Use '#include' instead.

Another benefit is that the original source file is referenced in
the source code so it is not accidentally removed.
2021-05-08 15:23:17 +02:00
Albrecht Schlosser
2f73df4f3e Rename 'srs.xbm' to its original name 'sorceress.xbm' 2021-05-08 15:21:23 +02:00
Albrecht Schlosser
b5cdd2fa71 Update copyright in fluid bundle (macOS: Info.plist) 2021-05-07 16:50:52 +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
0bd1c2e239
Add GitHub Actions Badge to README.md 2021-05-06 12:59:55 +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
Albrecht Schlosser
08a8e78d6e Fix compiler warning
Apple clang version 12.0.5 (clang-1205.0.22.9)
Target: arm64-apple-darwin20.4.0

Warning appeared after upgrade to Xcode 12.5 in several files,
example:

In file included from Fl_Scroll.cxx:19:
../FL/Fl_Scroll.H:102:17: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage]
  typedef struct {
                ^
                 ScrollInfo
../FL/Fl_Scroll.H:104:5: note: type is not C-compatible due to this member declaration
    typedef struct { int x,y,w,h; } Fl_Region_XYWH;
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../FL/Fl_Scroll.H:128:5: note: type is given name 'ScrollInfo' for linkage purposes by this typedef declaration
  } ScrollInfo;
    ^
2021-05-03 21:23:29 +02:00
Albrecht Schlosser
1684eb7efe Fix a type (comment only) 2021-05-02 17:04:16 +02:00
Albrecht Schlosser
5c85a4ea95 Enhance CMake build configuration summary 2021-04-30 19:48:17 +02:00
Albrecht Schlosser
a484541d4b CMake: improve detection and configuration of image libs
Also: fix old (pre 3.13) link_directories() usage
2021-04-30 19:47:47 +02:00
Albrecht Schlosser
2555e3b37e Fix build with Cairo for CMake < 3.13
target_link_directories() was introduced in CMake 3.13
2021-04-30 12:46:58 +02:00
Albrecht Schlosser
4ba92a99bb Document how to build universal apps for macOS 2021-04-29 18:32:19 +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
Albrecht Schlosser
189f7ec3ac Fix version number in doxygen docs
... when generated with configure/make.
2021-04-28 12:48:52 +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