Commit Graph

117 Commits

Author SHA1 Message Date
Matthias Melcher
44c874b731
Use FL_OVERRIDE for all overridden virtual methods (#611)
FL_OVERRIDE is defined as `override` for C++11 and higher
FL_OVERRIDE is defined as `override` for VisualC 2015 and newer
Don't interfere with Fl_Widget::override()
2022-12-30 19:14:36 +01:00
Matthias Melcher
9f92972729
Implement fl_complex_polygon() for OpenGL (#570) 2022-12-05 19:27:12 +01:00
Matthias Melcher
bf825f8ebd
Add a unit test for drawing complex shapes (#565) 2022-11-30 22:40:52 +01:00
ManoloFLTK
bc3bbb7ca0 Remove useless fl_matrix member variable of class Fl_Graphics_Driver 2022-11-30 18:57:39 +01:00
ManoloFLTK
b7ce83c02b Remove superfluous friend declarations from class Fl_Graphics_Driver 2022-11-30 16:11:32 +01:00
ManoloFLTK
00884f28e2 Fix for issue [Cairo]: Arrows have a "gap" (#561)
The problem to fix is that the arrow drawn by draw_arrow1() in src/fl_symbols.cxx
displays a faint clear line between the stem and head of the arrow with the Cairo
graphics driver.

This occurs because draw_arrow1() draws the arrow in 2 steps (a rectangle +
a triangle) and the Cairo driver is configured to use antialiasing when filling
polygons. The antialiasing produces the faint line between stem and head.

Why does draw_arrow1() draw a rectangle + a triangle rather than a
7-vertex polygon? That's because the X11 graphics driver fails with its polygon-
drawing function when the polygon is also rotated: the polygon is drawn
empty.

We want to keep using antialiasing under Cairo for polygons because
the result is better with non horizontal/vertical polygon edges.

This implementation changes function draw_arrow1() which draws
the arrow as a 7-vertex filled polygon except when the graphics driver
returns false for its virtual member function can_fill_non_convex_polygon().
In that situation, draw_arrow1() draws, as before, a rectangle + a triangle.
The new, virtual member function can_fill_non_convex_polygon() returns
true except for the X11 graphics driver. Therefore, draw_arrow1() is effectively
unchanged under the X11 driver.
2022-11-29 12:28:31 +01:00
Matthias Melcher
b16309f13e
Refactor code to make rounded rectangles accessible (#553)
This adds fl_rounded_rect and fl_rounded_rectf so the
user can draw rounded rectangles. This uses existing and
optimised code that is rearranged.
2022-11-24 12:47:49 +01:00
ManoloFLTK
1df79078b7 Remove duplications between Fl_Graphics_Driver and derived classes. 2022-10-10 16:58:48 +02:00
ManoloFLTK
71069b8570 Add necessary virtual qualifier to ~Fl_Font_Descriptor() and derived. 2022-09-08 16:04:09 +02:00
ManoloFLTK
ce2f024bce Fl_Graphics_Driver: remove unused virtual qualifiers. 2022-08-19 10:47:42 +02:00
ManoloFLTK
4ae905cc9d Change prototype of virtual Fl_Graphics_Driver::pango_font_description(). 2022-07-20 08:37: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
ManoloFLTK
02870242ee Move input method support to Fl_Screen_Driver from Fl_Graphics_Driver 2022-06-19 10:23:24 +02:00
ManoloFLTK
4b30f78567 Remove warning: 'virtual void Fl_Graphics_Driver::xyline(int, int, int, int)' was hidden. 2022-05-11 15:57:44 +02:00
ManoloFLTK
427e4dbc7a Remove platform-dependent type Fl_Bitmask (not in documented public API). 2022-03-24 10:00:01 +01:00
ManoloFLTK
d87b62ea69 Avoid using same name (p) for distinct members of derived classes. 2022-03-21 15:56:50 +01:00
ManoloFLTK
bf5b902180 Rename member Fl_Graphics_Driver::p to xpoint to avoid shadowing. 2022-03-21 14:39:00 +01:00
ManoloFLTK
27c175dad8 Add virtual void Fl_Graphics_Driver::set_status() and implement for X11 platform. 2022-01-07 07:50:36 +01:00
ManoloFLTK
5a7a70b895 Remove compiler warnings about unused parameters (issue #307) 2021-12-09 08:09:51 +01: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
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
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
Albrecht Schlosser
67bd27a2be Fix comments and documentation 2021-02-12 00:39:13 +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
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
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
4324acc6f6 Avoid "unused argument" compiler warnings with -Wextra after #include <fl_draw.H> 2019-03-12 10:55:01 +01:00
Matthias Melcher
452a410a3e STR #2714: remove new shadow lint for MacOS 2019-02-02 17:47:55 +01:00
ManoloFLTK
d2870d6f7d Define useful implementations of Fl_Graphics_Driver::push_no_clip() and pop_clip(). 2018-12-04 15:11:03 +01:00
ManoloFLTK
b985b884f8 Give a meaningful default implementation to a few more member functions of class Fl_Graphics_Driver. 2018-12-04 12:57:32 +01:00
Manolo Gouy
cd399d9898 Support for GUI scaling: add API to get/set the scaling factor value.
Also, define an FLTK event triggered when the scaling is changed and an option
to disable the transient window showing the new scaling factor.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13011 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-08-08 20:08:10 +00:00
Manolo Gouy
99cf1dd858 Make Fl_Graphics_Driver::newMainGraphicsDriver() public rather than private.
An FLTK app may be interested in calling it.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12991 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-07-10 10:51:02 +00:00
Manolo Gouy
51389ca460 Add examples/SVG_File_Surface.cxx and refer to it in the doc of class Fl_Surface_Device
This example code shows how to subclass Fl_Surface_Device and Fl_Graphics_Driver to
endow FLTK with a new kind of graphics output.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12980 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-06-27 09:27:04 +00:00
Matthias Melcher
b8e97d7c28 Doxygen only: fixed all block comments starting with an asterisk to space-only, fixed doxygen keywords prepended with @ to use a backward slash instead. No code was changed.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12970 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-06-23 20:50:22 +00:00
Matthias Melcher
a9fd08ff5a Doxygen: created Group to document drivers, disabled by default
Uncomment `ENABLED_SECTIONS += DriverDev` in documentation/Doxyfile.in
to enable driver documentation.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12968 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-06-23 16:47:40 +00:00
Manolo Gouy
32b35e62d2 Turn static function Fl_Graphics_Driver * Fl_Graphics_Driver::newMainGraphicsDriver() private.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12943 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-06-15 07:42:17 +00:00
Manolo Gouy
41eb376060 Make member function Fl_Image_Surface::get_offscreen_before_delete() be private.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12904 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-05-06 15:03:04 +00:00
Manolo Gouy
ccae86b291 Remove useless #include <FL/Fl_Shared_Image.H> following usage of the new Fl_Image::scale() member function.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12903 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-05-06 10:20:45 +00:00
Manolo Gouy
aab1b72af4 Improve fl_overlay_rect() when GUI is scaled.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12901 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-05-06 06:46:40 +00:00
Manolo Gouy
929efec855 Expand the doc of class Fl_Graphics_Driver.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12876 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-04-27 16:50:27 +00:00
Manolo Gouy
54b697cd49 Reorganise access to the value of the GUI scaling factor with public getter and protected, virtual setter member functions.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12858 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-04-19 10:39:46 +00:00
Manolo Gouy
d375918a5e Documentation: place Doxygen doc next to function implementation
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12857 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-04-19 08:43:19 +00:00