1) add Wayland code that prevent subwindows from leaking outside their parent.
This does not cover GL subwindows.
2) add macOS code that prevent GL subwindows from leaking outside their parent.
This fixes issue #494 for the macOS platform.
N.B.: Wayland GL subwindows are not prevented from leaking because no solution
that would not require any change in client applications was found. Code that
would cover Wayland GL subwindows but would require client applications to always
use the FL_ALPHA flag is included in this commit in commented out form.
Conflicting demands arise in the implementation of class Fl_Xlib_Graphics_Driver
for drawing images with the XRender library :
1) Issue #163 leads to use a bilinear filter to draw-and-scale images.
2) This tends to blur the edges of drawn areas which is bad for tiled images
(that is because the edges get alpha values, even for an opaque source image).
This commit resolves the conflict adding a means to detect whether the library
is busy drawing a tiled image. If so, the bilinear filter is not applied, drawn areas
don't have blurred edges, resulting in a nice tiling.
With this commit, these test apps perform correctly:
- tiled_image is correct at all scaling factor values also when modified
to use a depth-3 or a depth-4 Fl_RGB_Image as tile;
- unittests - Drawing Images is correct at all scaling factor values;
- pixmap_browser scales correctly up and down JPEG and PNG images.
Support different margin sizes on all four edges. Default margin
and gap size is now 0 (compatible with Fl_Pack).
Doxygen: move the description from the constructor to the class
declaration which constitutes a "description".
Make some methods virtual and/or 'const'.
Clarify demo programs, make them even more "FLTK style".
This work is based on the repository and latest commit:
https://github.com/osen/FL_Flex.git
commit 36e4ed75a00daac825b87e81295818b4650991f5
Author: Karsten Pedersen <...>
Date: Fri Apr 23 12:06:16 2021 +0000
Added Fltk (LGPL) license.
This widget is similar to Fl_Pack and supports either one row or one
column of widgets but has some more features. Test and demo programs
are included:
test/flex_login.cxx: simple "login window" demo program
test/flex_demo.cxx: slightly more complex demo program
The original demo programs can still be compiled and built with
the new widget provided you '#include <FL/Fl_Flex.H>'.
Backwards compatible methods are included (except debug()).
The original widget has been modified to match FLTK standards and
enhanced in several ways, including:
- support box frames
- add HORIZONTAL and VERTICAL enum values (as in Fl_Pack)
- add horizontal() method (as in Fl_Pack)
- use type() rather than internal 'direction' variable
- add standard widget constructor (x, y, w, h, label)
- add margin and gap accessors rather than hard coding constants
- improve test and demo programs
- add documentation
- replace <vector> with array as required by FLTK CMP
- rename camelCase method names, keeping old names for compatibility:
- change 'setSize(Fl_Widget*, int)' to 'set_size(Fl_Widget*, int)'
- change 'bool isSetSize(Fl_Widget*)' to 'int set_size(Fl_Widget*)'
- remove debug() method
- add a way to "unset" fixed size: set_size(Fl_Widget *, 0)
- add layout() method to force recalculation of children
- unify resizeRow() and resizeCol() methods to avoid code duplication
- improve widget size calculation.
This widget overrides FL_NO_BOX internally by FL_UP_BOX for all
practical purposes, e.g. draw(). This has been this way since
its initial release and can't be changed.
- emphasize that Fl_Image::copy(W, H) creates an image with
w() == data_w() == W and h() == data_h() == H
- clarify some more docs of Fl_Image methods (ensure that data_w()
and data_h() are used where appropriate rather than w() and h()
- improve wording, examples, and formatting of related docs.
Closes#431
Copying an image does not (and must not) change the original object,
hence copy() should always be 'const'.
This is *necessary* if the given Fl_Image object is 'const'.
- Add this include statement only where needed.
- Rename Fl_System_Driver::stat() to flstat().
This fixes an issue when using some (!) MinGW 64-bit build systems
that obviously '#define stat _stat64' or similar. This would
result in compiler problems if 'stat()' is a member function of
Fl_System_Driver.
This public method returns a pointer to the internal Fl_Image
object (const Fl_Image *). This is only for reference, the internal
image must not be modified by user code but it can be inspected and
copied to another image.