Commit Graph

943 Commits

Author SHA1 Message Date
ManoloFLTK
390fa9caa7 Fix for issue #254: remove hardware overlay support - cont'd. 2021-11-26 15:28:43 +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
ManoloFLTK
7e484c614c Fix for [fltk.coredev] reentrant calls with Fl_Window::resize 2021-11-24 10:35:18 +01:00
ManoloFLTK
02754e43ce Fix Fl_Window::decorated_w() in some X11 situations. 2021-11-17 15:00:21 +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
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
Albrecht Schlosser
828d3dd722 Fix malloc/delete mismatch (X11 only) 2021-09-12 13:37:53 +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
db7bb6cd98 Have Fl_Quartz_Copy_Surface_Driver account for current display scaling factor. 2021-08-05 19:21:05 +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
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
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
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
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
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
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
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
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
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
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
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