Commit Graph

2338 Commits

Author SHA1 Message Date
ManoloFLTK 27c175dad8 Add virtual void Fl_Graphics_Driver::set_status() and implement for X11 platform. 2022-01-07 07:50:36 +01:00
Albrecht Schlosser 9d474dfcdf Fix whitespace and Makefile dependencies
No code changes
2022-01-05 22:00:54 +01:00
ManoloFLTK fc1efc7957 Create FL/x11.H holding declarations specific to X11 platform. 2022-01-05 07:46:57 +01:00
ManoloFLTK 3f2166ea91 Introduction of FL/fl_config.h - continued 2022-01-04 18:36:56 +01:00
Albrecht Schlosser 5438954d8c Generate FL/fl_config.h rather than FL/abi-version.h
... as discussed in fltk.coredev in thread "RFC: introduce public
config header <FL/fl_config.h>", see:
https://groups.google.com/g/fltkcoredev/c/xLCs1AIXMVo/m/MHZpQggzAQAJ

- Rename abi-version.h to fl_config.h, rename input files,
  update dependencies, .gitignore, CMake, configure and Makefiles.

- Include Cairo options in FL/fl_config.h

- Rename FLTK_USE_CAIRO to FLTK_HAVE_CAIROEXT for consistency.

- Include <FL/fl_config.h> in config.h and wherever necessary,
  fix include order (move FL/Fl.H to the top) and more.

- Move USE_X11 to fl_config.h and rename to FLTK_USE_X11

- Do not include <config.h> in Cairo demo program which is no
  longer required in Cairo programs since FLTK 1.4.0
2021-12-18 22:44:08 +01:00
Matthias Melcher bd7011a1d3
Github #237: scrollbar.align documentation. 2021-12-17 20:06:25 +01:00
ManoloFLTK 5a7a70b895 Remove compiler warnings about unused parameters (issue #307) 2021-12-09 08:09:51 +01:00
Greg Ercolano c1edba3137 Solves issue #308. 2021-12-08 10:26:10 -08:00
Albrecht Schlosser eb7fb00801 Improve Fl_Scroll docs regarding its bounding box
Make clear that outside labels of widgets are not considered when
calculating the bounding box of the children (scroll area) and
include a hint to add an invisible box if necessary.
2021-12-08 14:22:40 +01:00
ManoloFLTK 663b93a807 Fix for issue #278: Can we use the qt/kde file picker instead of gtk?
Under the X11 platform, class Fl_Native_File_Chooser will behave as follows :
- if the KDE desktop is used and if command "kdialog" is available in the path,
the Qt/KDE file chooser is used;
- otherwise, if the GTK library is available at run-time,
the GTK file chooser is used;
- otherwise, the FLTK file chooser is used.

In addition, when Fl::OPTION_FNFC_USES_GTK is off, the FLTK file chooser
is always used.
2021-12-07 11:24:35 +01:00
Albrecht Schlosser 39b5ae9e6e Fix Fl_Window::size_range() documentation (STR 3352)
"Tiny window problem if child group larger than window"

See Greg's comment 4: "something is wrong here: either the logic or
the docs are incorrect, not sure which."

It turned out that both were incorrect.

Since we fixed the code this commit completes the STR by fixing the
docs as well so they match the behavior.
2021-12-06 19:49:16 +01:00
Albrecht Schlosser a0724ab7c4 Add fl_message_icon_label() function (STR #2762)
This message icon label (usually one character) will be used in the
next call of one of the common dialogs.

test/ask.cxx: use fl_message_icon_label()
2021-12-04 20:36:11 +01:00
Albrecht Schlosser 7a7e50df6e Rename FL/Fl_String.H to FL/Fl_String_class.H
The previous name existed already with different case (fl_string.h)
in the FL folder which broke the build on macOS and Windows.

This may be a temporary fix - until I find a better way.
2021-12-04 15:34:41 +01:00
Albrecht Schlosser b6de09cff2 Re-enable nested (aka recursive) common dialogs (STR 3242, #282)
Apply Fl_Dialog_r10831.patch as given in STR 3242:
https://www.fltk.org/strfiles/3242/Fl_Dialog_r10831.patch

Reformat, add missing pieces, rename private members, cleanup...

Improve documentation, add fl_choice_n() (issue #282)

New methods fl_input_str() and fl_password_str() return Fl_String
2021-12-04 14:49:27 +01:00
Albrecht Schlosser 2404656266 Add minimal version of class Fl_String
This class will be used in fl_input_str() and fl_password_str().

Todo: add missing documentation ...
2021-12-04 13:40:29 +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 397226b75d Add use of fl_capture_window() by test/device
Also, rename fl_capture_window_part() to fl_capture_window().
2021-11-16 15:03:36 +01:00
Albrecht Schlosser af0bb7e6c9 Add rectangle drawing functions with Fl_Rect 2021-11-16 00:30:34 +01:00
Albrecht Schlosser b2979b6425 Reformat to FLTK style, improve documentation
No code changes.

Replace '#define fl_clip ..' with an inline method.
2021-11-16 00:02:16 +01:00
Albrecht Schlosser e4d8b94102 Add fl_draw_check() to draw better check marks (issue #68)
This new function can and should be used to draw check marks
in widgets that need it, e.g. Fl_Check_Browser (issue #68) and
Fl_Check_Button.
2021-11-15 14:41:31 +01:00
Albrecht Schlosser 6d1f5608ba Support all image depths (1-4) in fl_write_png() 2021-11-11 20:58:09 +01:00
Albrecht Schlosser 500e470d39 Refactor fluid: make fl_write_png() public
The new function fl_write_png() was moved to its own file and is now
publicly available ("exported") so other programs can use it.

This function was used in fluid to write a window screenshot (.png)
together with a template (.fl) to preferences storage.
2021-11-09 20:36:23 +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
ManoloFLTK 96034b5657 Add documentation of Fl_Surface_Device::end_current(). 2021-10-31 06:47:28 +01: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 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 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 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 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
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 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
Albrecht Schlosser d4b210a763 Remove unused declaration of Fl_Char 2021-08-30 12:02:16 +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
tetsuhaut 29dd21bcef Remove an extra semicolon
One less warning, yay !
2021-08-27 12:58:25 +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 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 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
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 22cb8a7fdb Make Fl_Input::handle_key() protected (#203)
... as requested in this comment:
https://github.com/fltk/fltk/issues/211#issuecomment-814235771
2021-04-07 19:14:25 +02:00
ManoloFLTK 4657e988f7 Remove X11-specific code from platform-independent Fl_PostScript.cxx 2021-03-26 07:52:21 +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
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
ManoloFLTK b771ee53b9 Remove duplicated code between derived classes of Fl_Graphics_Driver - cont'd. 2021-03-01 15:47:30 +01:00
ManoloFLTK 0623a8d4b9 Remove duplicated code between derived classes of Fl_Graphics_Driver. 2021-03-01 15:11:00 +01:00
ManoloFLTK 81a4b7329c Remove warnings about hidden virtual member functions. 2021-03-01 11:20:15 +01:00
Albrecht Schlosser 08d9b3e10d Remove config_lib.h and runtime configuration info
... as discussed in fltk.coredev.
2021-02-27 15:09:12 +01:00
ManoloFLTK c83490fe30 Rename forgotten occurrence of fl_remove_scale() in Doxygen data. 2021-02-27 09:08:22 +01:00
ManoloFLTK 88a3f7b7be Rename fl_remove_scale() to fl_override_scale() as discussed in fltk.general
Re: Can custom box type functions handle their own high-DPI screen scaling?
2021-02-27 08:18:01 +01:00
ManoloFLTK 5bd467fa17 Add fl_remove_scale()/fl_restore_scale() to transiently draw without scaling factor.
This new API is a response to this message in fltk.general :
Can custom box type functions handle their own high-DPI screen scaling?
2021-02-25 11:07:07 +01:00
ManoloFLTK bef46b5cb8 Improve precision of GUI scaling for Windows platform. 2021-02-24 14:52:47 +01:00
ManoloFLTK d51481f95e Remove FL_CFG_SYS_WIN32 preprocessor variable from fl_draw_pixmap.cxx 2021-02-16 11:58:15 +01:00
ManoloFLTK 06793c50fb Create virtual Fl_RGB_Image* Fl_Gl_Window_Driver::capture_gl_rectangle() 2021-02-16 10:26:52 +01:00
Albrecht Schlosser bbaec9bd88 Update CMake and make files, minor edits only
There are no functional changes to be expected, mostly formatting
and comments.
2021-02-15 19:45:20 +01:00
Albrecht Schlosser 67bd27a2be Fix comments and documentation 2021-02-12 00:39:13 +01:00
Albrecht Schlosser 246291fe51 Make Fl_Gl_Window::gl_driver() private (#184)
The driver stuff should be private. The only usage I found was in
class _Fl_Gl_Overlay which is now a 'friend class'.
2021-01-29 14:11:19 +01:00
Albrecht Schlosser d7af409f42 Remove "Figure x.y: " from html image captions
... as discussed in fltk.coredev for easier maintenance.

Also edit some minor issues.
2021-01-13 22:52:33 +01:00
ManoloFLTK 018134161d Documentation: clarify how keypad keys are named. 2020-11-23 11:44:42 +01:00
ManoloFLTK f56d43c9f6 Rename private member function with trailing underscore. 2020-11-19 15:59:48 +01:00
Albrecht Schlosser 5cb72ef065 Fix whitespace and minor formatting issues 2020-11-17 16:11:03 +01:00
ManoloFLTK 2931c29689 Replace virtual Fl_RGB_Image::cache_size() by virtual Fl_Image::cache_size() 2020-11-17 11:23:35 +01:00
ManoloFLTK 18ae6c84eb Remove unnecessary friend declaration in class Fl_SVG_Image 2020-11-14 10:06:51 +01:00
ManoloFLTK a4bacf83c4 Fix for issue #155 - continued
Restores proper separation of what is in libfltk and what is in libfltk_images
2020-11-12 14:50:57 +01:00
ManoloFLTK 231159e16c Fix for issue #155 - continued
The issue lies in details how floating point scaled coordinates are converted
to integer values and its impact on the drawing of large SVG images.
This commit fixes the X11 platform.
The macOS platform is immune because drawing uses floating point
coordinates.
The Windows platform still needs fixing.
2020-11-12 07:46:12 +01:00
ManoloFLTK 0d594319c1 Add extra argument to Fl_SVG_File_Surface constructor.
This makes processing of the underlying FILE object consistant by classes
Fl_SVG_File_Surface, Fl_EPS_File_Surface and Fl_PostScript_File_Surface.
2020-11-03 18:05:18 +01:00
ManoloFLTK 5132bb6a06 Clarify doc about how FLTK_SCALING_FACTOR operates. 2020-11-03 08:13:45 +01:00
ManoloFLTK 1761523c9e Add Fl_PostScript_File_Device::close_command(Fl_PostScript_Close_Command cmd)
Also expand Doxygen doc of class Fl_Printer for the X11 platform.
2020-11-01 09:26:40 +01:00
ManoloFLTK 8accc6e840
Pango ps (#148)
Use cairo-PostScript to output PostScript when pango is available.

This allows to draw in vectorial form any script.
Before, only the Latin script could be drawn to PostScript in vectorial form.
2020-10-28 17:19:05 +01:00
ManoloFLTK 0d8385a652 Simpler macOS implementation of capture of window titlebars. 2020-10-12 21:05:38 +02:00
ManoloFLTK 27c791ae8a More documentation of enum Fl_Paged_Device::Page_Format 2020-09-27 17:28:42 +02:00
ManoloFLTK d20c68a495 More Doxygen information for enum Fl_Paged_Device::Page_Format. 2020-09-25 16:13:45 +02:00
Albrecht Schlosser f072cec13f Improve and clarify documentation 2020-09-21 13:45:46 +02:00
Albrecht Schlosser 360040d0bf Improve Fl_Menu_Item docs and inline deprecated methods
The deprecated methods are now calling the new methods to be
entirely compatible.

These methods should be removed in 1.5.0

(fix unrelated whitespace as well)
2020-09-18 17:17:36 +02:00
ManoloFLTK b279c11d34 Fix use of "\deprecated" Doxygen commands. 2020-09-18 15:51:00 +02:00
Albrecht Schlosser 2392589f05 Return 1 from Fl_Menu_Item::value() for checked items
Previously (FLTK 1.3.x) the return value of a checked menu item
was FL_MENU_VALUE (4) but the docs warned explicitly:

"You should not rely on a particular value, only zero or non-zero."
2020-09-18 13:41:16 +02:00
Greg Ercolano 6f04232dd9 Added Fl_Text_Display::style_buffer(), solves issue #138 2020-09-16 13:33:05 -07:00
ManoloFLTK dcea1dafe1 More detailed doc of Fl_Window::decorated_w() and decorated_h(). 2020-09-09 18:00:24 +02:00
Albrecht Schlosser 0e4137f66b
Fix Fl_Check_Browser.{H|cxx} indentation (#121) (#132)
* Fix Fl_Check_Browser.{H|cxx} indentation (#121)

... and some more whitespace errors as proposed by Greg
... in issue #121: Fl_Check_Browser--whitespace-patch.txt

Fixes #121

* Fix copyright years
2020-09-06 20:02:02 +02:00
Albrecht Schlosser b65d3a249d Customize corner radius for rounded box/frame (#130)
Make maximum box corner radius and shadow width configurable.
See Fl::box_border_radius_max() and Fl::box_shadow_width().

Documentation: update image of box types.

Fixes #130
2020-09-01 12:35:48 +02:00
Albrecht Schlosser a4f6badfcd Improve 'Fl_When' enum documentation 2020-08-24 15:14:48 +02:00
ManoloFLTK 32c316b78f Add Fl_Window::screen_num(int) to fully control window location
on multi-screen systems having distinct per-screen scaling factors.
2020-08-14 16:44:20 +02:00
Greg Ercolano 2141c63628 Implement + deploy fl_strdup() 2020-08-01 14:19:40 -07:00
ManoloFLTK 889acc7d74 Fix use of an SVG image in Fl_Tiled_Image when display is rescaled. 2020-07-30 17:41:35 +02:00
Albrecht Schlosser bfb3b3abd8 Remove typedefs Fl_String and Fl_CString
These unused typedefs are not used anywhere and should not be defined
at all.

Remove typedef 'Fl_String' as decided in fltk.coredev.
Remove typedef 'Fl_CString' as well for the same reason.
2020-07-24 20:12:06 +02:00
Duncan Gibson 46c1500bf3 fix doxygen links in Fl_Group.H
fix dead links to Fl_Group::resizable(Fl_Box *box)
reorder paragraphs to highlight different behaviour
add link to new "How does resizing work?" chapter in dox
2020-07-15 19:43:21 +02:00
Greg Ercolano 0693c70f57 First pass at fixing issue 99
A lot of code touched because low level functions needed to pass up
error messages reliably, and this had to propagate up the entire
driver hierarchy.

Tested OK *in English* on:
     > Linux
     > OSX 10.10.x
     > Windows VS2017
     > Windows mingw64
I have no way to test on Android, but it might work.

TODO: Needs testing in other languages to verify proper UTF8 error messages,
      esp. with Windows VS, due to complexities with FormatMessage() -- see get_ms_errmsg()
2020-07-14 12:52:56 +02:00
Albrecht Schlosser 9925b0f128 Update Fl_Window docs, fix typos
No source code changes
2020-07-12 18:06:03 +02:00
ManoloFLTK 2984fe638c Fix for building without print support (GitHub issue #98). 2020-07-11 12:21:25 +02:00
Robert Schumacher 8d5eed3c82 Convert Fl_Group::array_ to union to better represent its behavior
Amended by Albrecht:

- rename union member variables as discussed
- add comments to new array_ union members

Fixes #96

Signed-off-by: Albrecht Schlosser <albrechts.fltk@online.de>
2020-07-10 18:09:28 +02:00
ManoloFLTK 2f0be9d537 Add member function FILE* Fl_PostScript_File_Device::file() 2020-07-06 21:01:42 +02:00
Albrecht Schlosser f09e17c3c5 Remove $Id$ tags, update URL's, and more
- remove obsolete svn '$Id$' tags from all source files
- update .fl files and generated files accordingly
- replace 'http://www.fltk.org' URL's with 'https://...'
- replace bug report URL 'str.php' with 'bugs.php'
- remove trailing whitespace
- fix other whitespace errors flagged by Git
- add and/or fix missing or wrong standard headers
- convert tabs to spaces in all source files

The only relevant code changes are in the fluid/ folder where
some .fl files and other source files were used to generate
the '$Id' headers and footers.
2020-07-06 20:28:20 +02:00
ManoloFLTK b0e0c355ed Update doc of Fl_Help_View following addition of html entity &dagger; 2020-07-01 16:10:31 +02:00
Albrecht Schlosser 3b249de60a Clarify documentation (STR 3532)
Make clear that Fl::repeat_timeout() must only be called for the
same timeout it is handling. Related STR's:

https://www.fltk.org/str.php?L3532
https://www.fltk.org/str.php?L3516
2020-06-30 15:28:35 +02:00
ManoloFLTK 8d4b0c15f7 Move class Fl_SVG_File_Surface from libfltk to libfltk_images.
File examples/SVG_File_Surface.cxx is no longer useful because it was a very
partial implementation of what is now class Fl_SVG_File_Surface.
2020-06-29 11:36:09 +02:00
ManoloFLTK 26e6c3f930 Add classes Fl_SVG_File_Surface and Fl_EPS_File_Surface to draw to SVG and EPS.
Test programs device and pixmap_browser use these new classes.
Class Fl_SVG_File_Surface can be optionally made non functional using the
--disable-svg configure option or turning off OPTION_USE_SVG in CMake.
Class Fl_EPS_File_Surface can be optionally made non functional using the
--disable-print configure option or turning off OPTION_PRINT_SUPPORT in CMake.
2020-06-27 09:56:00 +02:00
ManoloFLTK 76da518b97 Document who's responsible for deletion of widget's image labels. 2020-06-18 10:21:28 +02:00
ManoloFLTK 46b89686df Allow using an Fl_SVG_Image object as window icon.
Fix for issue #90: Setting an svg image as a window icon causes a segfault.
2020-06-15 19:05:47 +02:00
Albrecht Schlosser 3d00b8db4c Improve Fl_SVG_Image docs
- add 'can_expand' optional parameter to scale()
- don't expose name and e-mail of the nanosvg author in docs
- format example code according to the FLTK coding style
- fix (some) trailing spaces

FTR: all examples compile and work well with current FLTK 1.4.
2020-06-07 16:57:40 +02:00
Albrecht Schlosser 1dd4929585 Add two virtual methods to class Fl_Image
(1) The new virtual method Fl_Image::release() which is equivalent to
  'delete this' automatically extends to Fl_Shared_Image::release()
  which makes the latter method virtual.

  This new method in the base class makes Fl_Image::release() callable
  on all objects derived from Fl_Image.

(2) Add virtual method Fl_Shared_Image *Fl_Image::as_shared_image()

  This new method can be used to detect whether an Fl_Image instance
  is an Fl_Shared_Image or not.
2020-06-06 06:27:47 +02:00
Albrecht Schlosser ec15ac6c89 Fix documentation typos and formatting 2020-05-24 14:18:08 +02:00
ManoloFLTK 7f7e0e4ea1 Replace Fl_Window_Driver::is_a_rescale() by Fl_Window::is_a_rescale()
so it can be called by any user code.
2020-05-08 17:08:33 +02:00
Albrecht Schlosser 46253603de Extend fl_message_position() with 'center' option
Add argument 'center' to position the message box centered over
  the given x/y coordinates.

Add another method to supply a widget or window to center the
  message box over.

Fix documentation and don't use INT_MIN to avoid having to
  include limits.h in user code.
2020-05-07 17:43:04 +02:00
airbrett ee7577a897 Add (x,y) positioning mode to common dialogs
Add new function to set (x,y) position.
Reset to previous mode after innards is called by fl_* function.
Use magic number for preferred position state.

Note: several commits squashed and commit messages edited by AlbrechtS.
2020-05-07 14:59:19 +02:00
ManoloFLTK 4b94485efd Doc: more detail about fl_clip_region() when drawing elsewhere than on the display 2020-04-26 11:31:31 +02:00
ManoloFLTK 2878fa95ab Add optional argument to Fl_Printer::begin_job() to inform caller when an error occurs.
This solves an issue raised in fltk.general :  Fl_Printer errors - how can I interpret them?
    https://www.fltk.org/newsgroups.php?s38419+gfltk.general+v38427
2020-04-22 16:01:33 +02:00
Albrecht Schlosser dec1938f3c Make draw() protected (Fl_Tree + Fl_Table)
Widget draw() methods must be protected per FLTK convention.
2020-04-20 13:30:48 +02:00
Albrecht Schlosser 40ed1dca41 Fix formatting of Fl_Wizard.H
Fix white space and comments only, no code changes.
2020-04-20 13:28:59 +02:00
Mohammed Alyousef f203cb8c61 Make draw method protected in Fl_Wizard 2020-04-20 12:52:55 +02:00
Mohammed Alyousef 29ec4e0e55 Fix int highlight() comment 2020-04-15 00:35:32 +02:00
ManoloFLTK 7793fa812a Update standard file headers 2020-04-05 16:53:37 +02:00
ManoloFLTK f4029aebde Merge remote-tracking branch 'refs/remotes/origin/master' 2020-03-28 07:13:34 +01:00
ManoloFLTK 6105a95202 Doc: make clear that nanosvg doesn't render image elements. 2020-03-28 07:13:11 +01:00
Albrecht Schlosser 09352ddab0 Update documentation, fix typos 2020-03-26 14:21:33 +01:00
Albrecht Schlosser 8a7d4c9f61 Remove CodeWarrior "support"
Metrowerks CodeWarrior was an ancient macOS compiler (discontinued
since 2005) that defined the macro __MWERKS__. Code using this macro
and several comments have been removed.
2020-03-11 14:38:02 +01:00
Albrecht Schlosser 1ffcef2373 Update Fl_Text_Display documentation
No code changes except minor formatting and trailing whitespace.
2020-03-08 12:33:06 +01:00
Albrecht Schlosser 3746b8986e Clarify documentation of Fl_Pack 2020-03-03 17:29:00 +01:00
ManoloFLTK 87c994e2f8 Fl_Sys_Menu_Bar: make it strict equivalent of Fl_Menu_Bar outside macOS 2020-02-28 16:47:44 +01:00
Albrecht Schlosser 4c1b92eb52 Implement fl_putenv() as cross-platform putenv() 2020-02-10 12:10:40 +01:00
Albrecht Schlosser 97554a88cc Move fl_font(face, size) to fl_draw.cxx
I believe this is a better place.

Also: add FL_EXPORT since it's no longer inline.
2020-02-03 17:30:54 +01:00
Albrecht Schlosser dd3485c57a Fix regression calling fl_font() w/o draw context
According to the documentation fl_font(face, size) may be called
"outside a draw context if necessary to call fl_width()".

This worked in 1.3.5 but did not in 1.4 (so far). I reworded the
docs to make clear that other measurement functions can be called
as well and refactored the code to make sure that fl_font(face, size)
will open the display if necessary.
2020-02-03 16:35:28 +01:00
Albrecht Schlosser b8ab77e39c Don't "export" X11 specific fl_open_display() function
The X11 specific overloaded function fl_open_display(Display *)
has never been documented but exposed (and "exported" in the ABI)
in FL/platform.H which is not necessary. This internal function
is now static and no longer exposed in the ABI.

Don't confuse with fl_open_display() w/o arguments which is still
exported and declared in FL/platform.H.
2020-02-03 15:58:13 +01:00
Albrecht Schlosser f93b825b08 Update Fl::keyboard_screen_scaling()
- make the internal variable static
- make it callable after fl_open_display()
- document that it's currently only usable to switch scaling off
2020-01-31 15:48:21 +01:00
ManoloFLTK 4ba6cef0b9 Add Fl::keyboard_screen_scaling(int) to control recognition of ctrl/+/-/0/ 2020-01-31 09:42:36 +01:00
ManoloFLTK d1afac2150 Add a "Preview" switch to the GTK native file chooser.
The button state is recorded in a preference so is recovered the next
time the GTK file chooser runs.
2020-01-31 08:07:57 +01:00
ManoloFLTK 325c4b8666 New public static variable bool Fl_Image::register_images_done
Allows an app to detect whether fl_register_images() was called or not.
2020-01-30 18:54:18 +01:00
ManoloFLTK b45a18a231 Fix Doxygen formatting problem. 2020-01-28 18:36:03 +01:00
ManoloFLTK 1e9e742245 Fix 2 typos in Fl_Widget::shortcut_label() Doxygen doc. 2020-01-26 19:23:59 +01:00
ManoloFLTK 3384fe93df Add Fl_Widget::shortcut_label(int) to control effect of '&' in some widget labels 2020-01-26 19:15:30 +01:00
Albrecht Schlosser 9fa1c3182e Fix documentation of Fl_Shortcut
Unfortunately this typedef for shortcuts in Fl_Menu_Items etc.
can currently not be used with the full (21-bit) range of Unicode.

These restrictions are now documented but should be removed in a
future version, if possible.
2020-01-26 14:30:33 +01:00
Albrecht Schlosser fc36bfd88b Improve documentation of clipping functions
Clarify functionality of fl_not_clipped() and fl_clip_box().

Add developer documentation for Fl_Graphics_Driver::clip_box().

Documentation only, no code changes in this commit.
2020-01-20 12:51:47 +01:00
Matthias Melcher afcc79c3f7 Merge remote-tracking branch 'refs/remotes/origin/master' 2020-01-14 19:22:03 +01:00
Matthias Melcher ed80d9cef0 Fixed some documentation for Fl_Preferences and fl_make_path. 2020-01-14 19:21:58 +01:00
Albrecht Schlosser 1e2b0af443 Combine image readers in class Fl_Image_Reader
This new class is explicitly internal and undocumented. We can
rename and/or redefine or extend it as we need.

This work is based on Matt's recent update with separate internal
classes BMPReader and GIFReader which have been replaced by
Fl_Image_Reader.
2020-01-13 22:41:13 +01:00
Matthias Melcher 7e0c82637d Updated image readers.
Removed duplicate code from Fl_JPEG_Image, updated and unified Doxygen comments. Avoiding name conflict in new protected functions.
2020-01-10 18:46:45 +01:00
Albrecht Schlosser 3f1f871585 Drop 1.0 compatibility; document 1.4 migration
The FLTK 1.0 compatibility support by defining macro 'FLTK_1_0_COMPAT'
did no longer work since FLTK 1.3.x and nobody complained. Hence we
can safely remove this "feature".

Documentation changes:

 - Drop chapter 'Migrating Code from FLTK 1.0 to 1.1'
 - Drop chapter 'Migrating Code from FLTK 1.1 to 1.3'
 - Add  chapter 'Migrating Code from FLTK 1.3 to 1.4'

The removed chapters are still available in FLTK 1.3 docs.
2020-01-08 18:41:50 +01:00
ManoloFLTK d2e2077544 Fix Doxygen description of the constructors. 2020-01-05 15:51:47 +01:00
Matthias Melcher 1ba9e64ba9 Added code to read GIF files from memory (GitHub issue #33, 2/2) 2020-01-03 21:37:52 +01:00
Matthias Melcher 86893a90cb Added code to read BMP files from memory (GitHub issue #33, 1/2) 2020-01-03 21:10:00 +01:00
Matthias Melcher db6fa8bf86 Merge remote-tracking branch 'refs/remotes/origin/master' 2019-12-31 18:33:01 +01:00
Matthias Melcher c0237a1f04 Limiting file access for Fl_Preferences.
Added Fl_Preferences::file_access() and various flags that make it possible to limit or completely deny file access to the preferences system, either for the core library or for the application or both.
2019-12-31 18:30:04 +01:00
Greg Ercolano a624d9be2d Small docs addition for issue#45. 2019-12-30 07:25:06 -08:00
ManoloFLTK 2445797e45 Reorganise use of virtual member function Fl_Surface_Device::end_current() 2019-11-07 14:28:20 +01:00
ManoloFLTK 20ab318875 Link Doxygen doc of Fl_Widget::label(text) to relevant part of FLTK programming manual. 2019-11-06 11:09:34 +01:00
ManoloFLTK 4f8e692f30 Add default value of 0 for 1st arg of member function Fl_Printer::begin_job(). 2019-10-22 13:16:14 +02:00
ManoloFLTK c549b7acbd X11 platform: use Gnome printer dialog when the GTK library is available at run-time
The code to determine whether the GTK library is available is now in Fl_X11_System_Driver::probe_for_GTK()
called both by Fl_Printer::begin_job() and Fl_Native_File_Chooser.
New Fl::option OPTION_PRINTER_USES_GTK allows to deactivate use of
the Gnome print dialog.

Minor change in Fl_Native_File_Chooser: GTK version 3 is searched before version 2,
whereas the search order was the opposite before.
2019-09-15 15:57:29 +02:00
Greg Ercolano 62e39e5559 Added new method Fl_Tree_Item::event_on_item() 2019-08-27 16:53:57 -07:00
ManoloFLTK 4a58bf4dc2 Add example "Fitting an SVG image to a resizable Fl_Box" to doc of Fl_SVG_Image. 2019-08-27 18:38:56 +02:00
Greg Ercolano 4870cde0a6 More fixes for STR #3527; handle usericons, etc 2019-08-25 01:13:35 -07:00
Greg Ercolano 521a5ef17c Fixes STR #3527: Fl_Tree small drags on open/close icons change selection 2019-08-24 23:07:21 -07:00
Albrecht Schlosser 292739664f Support copy function in Fl_Color_Chooser
Users can press ctrl-c (or ctrl-x) while using the fl_color_chooser()
function or the Fl_Color_Chooser widget to copy the current color
selection to the clipboard.
2019-08-12 19:07:28 +02:00
ManoloFLTK 716e7b18f3 Better definition of 'struct dirent' for the MinGW32 compiler 2019-08-04 09:35:42 +02:00
Greg Ercolano 9e4c207e27 Added example images for Fl_[Hold/Multi]_Browser 2019-07-26 13:32:18 -07:00
Greg Ercolano a51012db9b Modified indent + bracing for author's example code 2019-07-26 12:18:52 -07:00
Greg Ercolano c03583a8bc Add small code example, moved widget screenshot higher on doc page 2019-07-26 12:14:49 -07:00
ManoloFLTK 8c7b7eea4b Fl_Copy_Surface: more detailed Doxygen description. 2019-07-20 08:59:15 +02:00
Albrecht Schlosser 42b8cb7bb8 Add method Fl_Menu_::menu_end() (STR 3523)
This method can be called after all menu modifications to make sure
the menu() array is relocated (copied from the internal working area)
to a private place owned by the Fl_Menu_ instance.

menu_end() is now called in Fl_Menu_Button::popup() to make sure
the menu array is in private storage.

This fixes STR 3523 w/o user code changes. Calling menu_end() is
in most cases optional.

Todo: call menu_end() where useful (or necessary), e.g. in
  Fl_Choice, Fl_Menu_Bar, etc. ?
2019-06-27 16:04:03 +02:00
Greg Ercolano fe08c686be Last commit typo: latex docs fix 2019-06-06 11:14:08 -07:00
Greg Ercolano bca3ae0b17 Added example for mac Application -> Preferences 2019-06-06 11:09:29 -07:00
ManoloFLTK a471c67f67 Add default argument values to reimplementations of Fl_Widget_Surface::draw_decorated_window 2019-05-25 18:39:26 +02:00
ManoloFLTK fce4923212 Merge remote-tracking branch 'origin/master' 2019-05-25 11:59:48 +02:00
ManoloFLTK 0d3a374396 Call virtual member Fl_Surface_Device::end_current() when necessary
Rename member function Fl_Surface_Device::end_current_() to end_current(),
set it protected, and make it called by the destructor of all classes
derived from Fl_Surface_Device that re-implement end_current().
This way, end_current() runs equally if Fl_Surface_Device()::pop_current()
is called before or after the drawing surface is deleted.
2019-05-25 11:59:16 +02:00
Albrecht Schlosser f711bb7cfc Fix version of removal of deprecated method
Removal of methods breaks the ABI, hence we need to wait until 1.5.0
2019-05-25 11:32:37 +02:00
ManoloFLTK bf50352afe Remove Fl_Copy_Surface_Driver::draw_decorated_window() that is unnecessary 2019-05-24 14:05:41 +02:00
ManoloFLTK 46fa9d2625 Fix Doxygen comment badly processed by Doxygen 1.8.15 2019-05-22 21:45:12 +02:00
ManoloFLTK b2c027fa83 Implement Fl_Quartz_Copy_Surface_Driver::draw_decorated_window()
The window title is copied in vectorial form when the titlebar is layer-backed.
2019-05-22 21:33:02 +02:00
Albrecht Schlosser 5df7a7678a Document Fl_File_Input::errorcolor() as deprecated
Fl_File_Input::errorcolor() and Fl_File_Input::errorcolor(Fl_Color)
have not been used anywhere. Marked as deprecated.
2019-05-15 18:31:46 +02:00
Albrecht Schlosser c4a755bdf8 Fix some links in documentation
Particularly to Doxygen docs and NEdit which appears to have moved
to sourceforge (according to Wikipedia), see
https://en.wikipedia.org/wiki/NEdit

Note: nedit.org exists but shows some non-English text.
2019-05-15 17:16:11 +02:00
ManoloFLTK 874ccfe645 Fix Doxygen doc of Fl_Window::border(int) and border() 2019-05-09 10:49:03 +02:00
ManoloFLTK 172063b2ad macOS: yet simpler implementation of window resize and rescale. 2019-04-28 15:31:02 +02:00
ManoloFLTK 0067952e1a Correct typo in Doxygen doc 2019-04-14 19:10:08 +02:00
ManoloFLTK 52f4aa5546 Doxygen doc: rewording for more clarity. 2019-04-14 19:07:14 +02:00
ManoloFLTK bb5ef3b1d0 Doxygen: rewording for more clarity. 2019-04-14 09:54:55 +02:00
ManoloFLTK 0f6cbd1cda Doxygen: rewording for more clarity. 2019-04-14 09:27:41 +02:00
ManoloFLTK a65d7818be More explicit short doc of Fl_Multi_Label. 2019-04-14 08:57:17 +02:00
ManoloFLTK 5ad95da98e Further Doxygen doc about OpenGL and HighDPI. 2019-04-13 08:32:35 +02:00
ManoloFLTK f55729ed32 Doxygen: describe better support for OpenGL on HighDPI displays. 2019-04-12 18:47:42 +02:00
ManoloFLTK 4abaeba539 Doxygen: make explanation of how PostScript text works always visible. 2019-04-12 11:29:08 +02:00
ManoloFLTK 1280370fc8 Move Doxygen comments next to member function bodies. 2019-04-12 10:36:02 +02:00
ManoloFLTK d50d0a3069 Remove function body from Fl_Widget_Surface class declaration. 2019-04-12 10:32:46 +02:00
ManoloFLTK cb7dbc34d7 Make member function Fl_Surface_Device::driver(Fl_Graphics_Driver*) protected. 2019-04-10 15:20:00 +02:00
ManoloFLTK 7a0bebb22f New virtual member function bool Fl_Surface_Device::is_current() 2019-04-10 13:14:04 +02:00
ManoloFLTK 8286e37b18 Add public function Fl_RGB_Image *fl_capture_window_part()
In the context of HighDPI screens, the API of function fl_read_image()
is inadequate because a rectangle of size WxH drawing units
of a window may contain many more than W*H pixels.

Function fl_capture_window_part() returns an Fl_RGB_Image
object whose drawing size matches the size of the rectangle
and whose data size matches the, possibly larger, size in pixels
of the corresponding area of the mapped window.
2019-04-09 18:50:18 +02:00
ManoloFLTK c66caf5dce Simpler implementation of Fl_Cocoa_Window_Driver::resize() 2019-04-07 09:09:33 +02:00
ManoloFLTK e3e195a09c Use \deprecated Doxygen command where necessary 2019-03-26 13:57:41 +01:00
ManoloFLTK 4324acc6f6 Avoid "unused argument" compiler warnings with -Wextra after #include <fl_draw.H> 2019-03-12 10:55:01 +01:00
ManoloFLTK 21c0134931 New member function const Fl_Image* Fl_Window::shape() replaces int Fl_Window::is_shaped()
The new function allows to get the window's shaping image
and delete it after use, if appropriate.
2019-02-23 10:21:27 +01:00
Albrecht Schlosser 79af685c28 Fix typos 2019-02-09 21:21:48 +01:00
ManoloFLTK 65916c106e Remove Fl_Image::as_rgb_image() virtual member function.
It's not used in the library, so its utility remains to be proven.
2019-02-06 17:22:28 +01:00
Matthias Melcher 0cac8d52e3 Fl_Roller can now be controlled via the mouse wheel (STR #3120). 2019-02-04 23:12:02 +01:00
Matthias Melcher 017754453e Typo 2019-02-03 00:49:03 +01:00
Matthias Melcher 2be4d720ab Tooltips hide by themselves after 12 seconds (STR #2584). 2019-02-02 23:56:45 +01:00
Matthias Melcher c97990e517 Removed all shadow lint in header files (STR #2714). 2019-02-02 22:29:53 +01:00
Matthias Melcher 5cd9f6fb80 STR #3323: glutAddMenuEntry now has a const label argument 2019-02-02 22:16:16 +01:00