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.
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.
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.
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)
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."
* 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
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
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.
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
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()
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>
- 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.
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.
- 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.
(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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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. ?
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.
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.
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.
o Added mention of drag+drop / FL_TREE_SELECT_SINGLE_DRAGGABLE
to list of features on main Fl_Tree doxygen page.
o Whitespace mods to FL_TREE_SELECT_* to fix doxygen 1.8.5
whitespace sensitivity that was causing single sentence
to break into two when spanning multiple "///>" comments
for last item in an enum (doesn't end in ",")
This commit adds a cairo_surface flush after calling the draw callback.
This fixes the test/cairo_test demo program under Windows.
At least under Windows the Cairo callback used in Fl_Cairo_Window
didn't draw anything with current Windows 10, MinGW (32-bit) and
Cairo 1.15.12 for Windows. It worked well under Linux though. Anyway,
the flush should do no harm.
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
Note: PDF generation "worked" with the previous configuration up to
doxygen 1.8.6 on my "old" Ubuntu 14.04 system but did no longer work
with doxygen 1.8.7 - 1.8.13 (the latter on Ubuntu 18.04).
Tests showed that 1.8.14 is seriously broken and git:master (aka 1.8.15,
but not yet released as of today) is not usable as well. Hopefully there
will be some doxygen fixes in the future.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13010 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
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
The original intention of FL_PORTING was to mark all places in the
source code where changes are required to port FLTK to a new platform.
Thanks to the driver system, this approach has become somewhat
misleading, so I removed all references.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12969 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Tested on Windows and Linux (not tested on MacOS/Android).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12951 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This allows to keep class Fl_Screen_Driver away from the public API.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12926 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This function is replaced by static Fl_Window_Driver* Fl_Window_Driver::(const Fl_Window *win).
The purpose is to have class Fl_Window_Driver outside from FLTK ABI.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12915 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
The new function names begin_job() and begin_page() better match end_job() and end_page() with which
they must be used by pair.
The old names start_job() and start_page() are maintained for API compatibility with FLTK 1.3.x
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12910 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
which tries to keep the menu synchronized with the Fl_Input field,
assuming there's a match.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12908 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Change Fl_Cocoa_Screen_Driver::read_win_rectangle() so it captures only
from the current window and ignores its subwindows, as do other Fl_Screen_Driver derived classes.
Remove Fl_Cocoa_Printer_Driver::print_window_part() that is no longer necessary.
Remove Fl_Printer::print_widget() and Fl_Printer::print_window_part() that
are no longer necessary.
Stop Fl_Widget_Surface::print_window_part() from being virtual because its platform-independent
implementation should suffice.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12894 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
The caller no longer needs to call Fl_Image_Surface::get_offscreen_before_delete() before object deletion,
because the object destructor knows the offscreen has not been created by the Fl_Image_Surface constructor.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12874 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Graphics drivers now use up to 6 virtual member functions to support Fl_Image
drawing in the context of GUI and image rescaling :
virtual void draw_pixmap(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy)
virtual void draw_bitmap(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy)
virtual void draw_rgb(Fl_RGB_Image *rgb, int XP, int YP, int WP, int HP, int cx, int cy)
and
virtual void draw_fixed(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy)
virtual void draw_fixed(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy)
virtual void draw_fixed(Fl_RGB_Image *rgb, int XP, int YP, int WP, int HP, int cx, int cy)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12828 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Fl_Rect.H is no longer included by Fl_Group.H to avoid unnecessary
dependencies on Fl_Rect.H. Currently it is only needed to access the
array returned by the protected method bounds().
Also clarified documentation.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12827 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Method name follows Fl_Tree::linespacing().
Implemented similarly to Fl::scrollbar_size(), since its use crosses Fl_Menu_Item and 'menuwindow' classes.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12815 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
The docs of class Fl_Image and of Fl_Image::scale() are beefed up.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12784 ea41ed52-d2ee-0310-a9c1-e6b18d33e121