Commit Graph

2295 Commits

Author SHA1 Message Date
Albrecht Schlosser
a3a60ed27c Improve and clarify documentation of fl_beep() 2022-11-11 16:43:33 +01:00
Greg Ercolano
d68f927a13 Document Fl_Multiline_Output keynav and caret cursor 2022-11-07 17:08:14 -08:00
Greg Ercolano
9605b82e08 Added missing const on some methods 2022-11-07 10:59:19 -08:00
Greg Ercolano
6f24175e64 Added assignment by index example, doc clarifications. 2022-11-07 10:33:35 -08:00
Greg Ercolano
2a43a12b7b Added empty(), ensure size() enlarges new vals = 0 2022-11-07 10:33:35 -08:00
Greg Ercolano
8b72f0c668 Add doxygen docs for Fl_Int_Vector.
While adding the docs, noticed some things that need modification
for proper public use. These are highlighted as \todo items and
\warning items, which will be fixed in a separate commit forthcoming. -erco
2022-11-06 20:21:46 -08:00
Albrecht Schlosser
f904f4c4ec Fix Fl_Help_View <OL> numbers (Issue #153, STR 3290)
Started with @wcout's patch (see Issue #153, STR 3290), modified
patch for CMP conformance, restructured methods, and finally:

- used Fl_Int_Vector instead of 'fl_data_container'
- removed fl_data_container

Thanks for the working patch to @wcout.
2022-11-06 16:40:17 +01:00
Albrecht Schlosser
bb7129dae2 Use the new Fl_Int_Vector class in Fl_Table
Replace local IntVector with Fl_Int_Vector
2022-11-06 16:32:29 +01:00
Albrecht Schlosser
8b92935b1e Add Fl_Int_Vector: "an STL-ish vector without templates"
Code copied from Fl_Table and reformatted.

Thanks to Greg for the original code.
2022-11-06 16:32:29 +01:00
ManoloFLTK
4b945a3086 Wayland/X11 hybrid: use "bool fl_disable_wayland;" declaration. 2022-11-05 19:47:37 +01:00
Albrecht Schlosser
b426a3d7c0 Fix two rare potential bugs (NULL pointer dereferencing)
Both bugs can happen if a widget doesn't have an associated window()
or in similar situations. These fixes returns NULL to prevent crashes.

Bugs observed in special test scenarios, not real-life programs.
2022-11-05 19:31:59 +01:00
Albrecht Schlosser
2446ec5d62 Implement Fl_Scroll::on_insert()
This fixes the scrollbar order when children are inserted rather than
at some indefinite time later, for instance in draw().

This commit will very likely make Fl_Scroll::fix_scrollbar_order()
obsolete but this method is kept as is for tests and verification.
2022-11-03 19:11:59 +01:00
Albrecht Schlosser
0ebb113584 Implement destructor of Fl_Scroll and fix inconsistencies 2022-11-03 18:58:28 +01:00
Matthias Melcher
33f01ecb83
Added Fl_Group::on_insert/on_remove/on_move (#527) 2022-11-01 20:45:31 +01:00
Albrecht Schlosser
c570bd8f96 Fix trailing whitespace 2022-11-01 20:06:22 +01:00
Albrecht Schlosser
a918292547 Fix removal and deletion of the resizable() of Fl_Group
If the resizable() of an Fl_Group is deleted it is automatically
removed from the group.

New: to avoid dangling resizable() pointers the resizable widget
is set to the group itself.
2022-10-28 17:37:18 +02:00
Greg Ercolano
c7ffd8e72a Doc proper removal/destruction of a widget from its group.
This modification as per small thread on fltk.coredev:
Sep 19, 2022, Subject: Addition to Fl_Group docs
2022-10-21 23:44:08 -07:00
Albrecht Schlosser
da11526bb8 Improve and clarify documentation of timeout functions
Some functions didn't document the handling of arguments properly,
particularly Fl::has_timeout() and Fl::remove_timeout().

This is now fixed by documenting the correct behavior that was
preserved (re-implemented) from FLTK 1.3.x in the new class Fl_Timeout.

Unfortunately there have been some inconsistencies (likely unexpected
behavior) which have been preserved and which are now documented.
2022-10-20 19:36:03 +02:00
ManoloFLTK
761e24b17d Document fl_circle() with and w/o complex drawing API (#511) 2022-10-13 10:16:06 +02:00
ManoloFLTK
1df79078b7 Remove duplications between Fl_Graphics_Driver and derived classes. 2022-10-10 16:58:48 +02:00
Albrecht Schlosser
2a856dafd4 Remove superfluous center alignment from images
Doxygen uses a <div> with center alignment for images, hence
adding HTML center alignment for image is not only superfluous
but was also inconsistent.

Also removed some more unnecessary HTML tags, updated copyright year.
2022-10-09 19:35:20 +02:00
ManoloFLTK
f2532964cc Class Fl_Single_Window declares but doesn't implement method make_current().
Also, add missing doc for methods Fl_XXX_Window::show(int, char**).
2022-10-07 09:21:37 +02:00
ManoloFLTK
5f189aa213 Make Windows-specific HICON-using functions visible in doc. 2022-10-06 13:15:16 +02:00
ManoloFLTK
da66e21e1d Support of FLTK widgets in OpenGL 3 windows - cont'd.
This commit allows to switch between FL_DOUBLE / FL_SINGLE modes
in widget-containing GL3 windows.
Demo program examples/OpenGL3test is modified to show FLTK widgets
even if the platform does not support OpenGL 3.
2022-09-29 09:39:21 +02:00
ManoloFLTK
59fc60ea4c Simpler code to support FLTK widgets in macOS OpenGL 3 windows.
Also, the application-level code to add widgets to a GL3 window becomes
platform-independent.
2022-09-27 14:12:39 +02:00
ManoloFLTK
89f9671b40 Add cross-platform support for adding widgets to an OpenGL3-based Fl_Gl_Window.
Under non-macOS platforms, the key is to call glUseProgram(0); after having used OpenGL 3
which allows to then use OpenGL 1 and draw FLTK widgets over the OpenGL3 scene.

Under macOS, this is impossible because macOS GL3 contexts are not compatible
with GL1. The solution implemented here is to create an additional Fl_Gl_Window
placed above and sized as the GL3-based window, to give it a non opaque,
GL1-based context, and to put the FLTK widgets in that additional window.
2022-09-25 16:39:40 +02:00
ManoloFLTK
8bbedd65a8 Fix issue #501: build error under macOS 10.10 2022-09-22 20:12:40 +02:00
ManoloFLTK
debbba19ec Improve docs of Fl_Copy_Surface and use of OpenGL 3. 2022-09-21 15:15:55 +02:00
ManoloFLTK
add3f0566c Add Doxygen description of FL_FREE_COLOR. 2022-09-18 11:57:15 +02:00
ManoloFLTK
d028f0b37d Fix fl_read_image() under hybrid Wayland/X11 platform.
Function fl_read_image() obliges to keep a minimal use of global variable fl_window
also under the Wayland platform, even if its type (Window) makes little sense for
the hybrid library because it has its X11 value (given by X11/X.h) which is not
meaningful for the Wayland leg of the hybrid platform.

Virtual member function Fl_Surface_Device::as_image_surface() becomes useless.
2022-09-11 19:45:48 +02:00
ManoloFLTK
203e7b7098 New OPTION_WAYLAND_ONLY for CMake to build pure Wayland platform. 2022-09-09 15:19:15 +02:00
ManoloFLTK
71069b8570 Add necessary virtual qualifier to ~Fl_Font_Descriptor() and derived. 2022-09-08 16:04:09 +02:00
ManoloFLTK
13e05f4204 Improve support of child windows that may leak outside their parent window.
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.
2022-09-07 14:40:16 +02:00
ManoloFLTK
07fd2628fe Hybrid Wayland/X11 platform: improve control of chosen backend. 2022-08-30 17:37:55 +02:00
ManoloFLTK
fcdc2f0e10 Attempt to improve fl_disable_wayland(). 2022-08-30 12:58:57 +02:00
Albrecht Schlosser
c20e7d9efc Update dependencies, fix trailing whitespace 2022-08-29 14:26:28 +02:00
ManoloFLTK
c720aae515 Make hybrid Wayland/X11 platform. 2022-08-29 12:15:32 +02:00
Albrecht Schlosser
6a546d4e9c Fix dependencies and whitespace errors
No "real" code changes, but dependencies can affect building.
2022-08-25 22:04:59 +02:00
ManoloFLTK
4611327672 Comment-only changes. 2022-08-23 09:04:14 +02:00
ManoloFLTK
1631e39187 Add FL_EXPORT directives erroneously removed at 7deff86. 2022-08-23 09:02:06 +02:00
ManoloFLTK
7deff86b5d Remove FL_EXPORT qualifier from platform-specific class declarations. 2022-08-20 10:16:32 +02:00
ManoloFLTK
b24379133f Add int Fl::system(const char *command) static member function. 2022-08-20 09:57:00 +02:00
ManoloFLTK
ce2f024bce Fl_Graphics_Driver: remove unused virtual qualifiers. 2022-08-19 10:47:42 +02:00
ManoloFLTK
b8c227a8f2 Fix Fl_Xlib_Graphics_Driver for drawing tiled images.
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.
2022-08-10 10:53:29 +02:00
Albrecht Schlosser
713d276b1c Fl_Flex: support different margin sizes, improve docs
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".
2022-08-07 16:00:41 +02:00
Albrecht Schlosser
f37aca15e9 Add Fl_Flex widget from Karsten Pedersen (issue #255)
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.
2022-08-01 15:33:20 +02:00
ManoloFLTK
cd60ea17b0 Add Fl_PostScript_File_Device::set_current() and end_current() members. 2022-07-24 08:46:52 +02:00
ManoloFLTK
4ae905cc9d Change prototype of virtual Fl_Graphics_Driver::pango_font_description(). 2022-07-20 08:37:21 +02:00
Albrecht Schlosser
d73327e181 Document that Fl_Help_View can't be used with FL_NO_BOX
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.
2022-07-14 20:05:21 +02:00
ManoloFLTK
f097141662 Move member q_width from class Fl_Font_Descriptor to Fl_Quartz_Font_Descriptor.
That's because this member is used only in Fl_Quartz_Font_Descriptor.
2022-07-06 10:18:40 +02:00