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
Each image has now two sizes implemented as follows:
- the pixel size is stored in private members pixel_w_ and pixel_h_
with public accessors pixel_w() and pixel_h()
- the FLTK size is stored in private members w_ and h_ and read by w() and h()
- when the image is constructed, the two sizes have the same value
- the protected w(int) and h(int) member functions set both FLTK and pixel sizes.
- the public scale(int, int) member function is essentially nothing but
set the FLTK size and don't change the pixel size.
- when the image is drawn, its FLTK size determines how big it is drawn, its pixel
size determines how much data are available to draw it.
FLTK 1.3.4 with FL_ABI_VERSION=10304 contained an equivalent member function
but only for the Fl_Shared_Image class.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12776 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
improved Fl_Rect_Region class instead of Fl_Rect. Commented out
complex clipping.
Android lib and apps now use C++11 because they can (and I like it).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12741 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Also, added rectangular clipping which works.
Expanding now to a more complex clipping scheme to make multiple
windows work.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12739 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Android has no classic window manager, so FLTK has to
make sure that popup windows, dialog boxes and multi
window interfaces work as expectd.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12729 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
At this point, Windows FLTK apps detect HighDPI displays and rescale their GUI accordingly. They also
all reply to ctrl/+/-/0/ keystrokes to enlarge/shrink/reset their windows.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12723 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
The Android example files in directory Android/... are not touched.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12702 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
instead of the deprecated Fl_Surface_Device::set_current().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12688 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
These were introduced at r12647, that is, during development of the 1.4 API.
These functions provided windowless support only on the MacOS platform,
where this can be obtained without those functions.
Windowless support on other platforms would require changing the event
loop. There's no evidence from STR's there's a demand for windowless mode
on other platforms.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12680 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This became unused when window scaling no longer involved window destruction/recreation.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12668 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Most other platform-dependent types of FL/platform_types.h are also documented.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12663 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Replace compiler/preprocessor/platform macro "WIN32" with "_WIN32".
Replace "WIN32" in text and documentation with "Windows".
Replace "MSWindows" with "Windows".
To do: README.Windows.txt (and maybe other documentation as well)
needs updates.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12655 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit also simplifies the platform-dependent support of fl_read_image():
only Fl_XXX_Screen_Driver::read_win_rectangle() contains platform-specific
code to capture pixels from the current window or from an offscreen buffer.
Platform-independent function Fl_Screen_Driver::traverse_to_gl_subwindows()
captures subwindows that intersect with the area fl_read_image() targets.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12653 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Because these functions are related to Fl_Screen_Driver::wait(double)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12652 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
The default handling of cmd-Q/Quit program under MacOS was to terminate the
program if all its windows are closed without returning from FLTK's event loop.
This was running against a strong design feature of FLTK that programs
should always complete their event loop and return from main() when cleanly
terminating.
In the new code for the MacOS platform, cmd-Q/Quit program no longer terminates
the program. Instead, the event loop is interrupted and a call to Fl::program_should_quit()
allows to detect that program termination has been requested, if necessary.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12647 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This file is not used in the normal build process but was intended to
be used as a template for a platform specific file. This is likely
obsolete anyway since the new driver approach no longer uses #ifdef's
to separate platform specific code.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12643 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
The check whether mac.H or win32.H were included directly was wrong
after the recent rename of x.H to platform.H.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12642 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This second step replaces FL/x.H with FL/platform.H in all source files.
Dependencies have been adjusted as well.
This commit completes the replacement of FL/x.H with FL/platform.H.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12641 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This first step replaces FL/x.H with FL/platform.H but keeps a small
FL/x.H that #include's FL/platform.H for backwards compatibility.
Documentation sources in documentation/src/*.dox have been fixed,
but references in other source files need to be fixed in another step.
Dependencies have been adjusted.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12640 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Fl_Boxtype enum values with leading underscore are reserved and should
not be used. Use the name w/o leading underscore instead.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12633 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
With this, most MacOS FLTK app can be scaled with command/+/-/0/ keystrokes.
A scaling problem remains, visible in test/cube, where the "Test" string is not positioned correctly.
GLUT apps can also be scaled (across platforms).
SVG images are re-rasterized after app scaling for optimal drawing.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12594 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
organize member initialization first, method calls last.
Also:
Reorg'ed member initialization to match order in .H
to detect missing member inits.
Noticed member mModifyingTabDistance is unused.
Tagged with XXX: but left in place, since it's
a protected member, and might be utilized by user code.
We should probably remove this member.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12570 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Tested under Windows and Linux, but not yet used in library code.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12549 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Applying guyben's patch (with small mods suggested by albrecht & greg in comments 7-11).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12511 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
The default (0) is 'text' mode, non-zero is 'binary' mode on platforms
that distinguish text and binary mode.
Currently Windows is the only supported platform that needs this.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12500 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This new function allows to write Fl_SVG_Image::fl_gzopen() in a completely platform-independent way.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12489 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Compilation error message:
src/Fl_SVG_Image.cxx:80:21: error: out-of-line definition of 'gzopen64' does
not match any declaration in 'Fl_SVG_Image'; did you mean 'gzopen'?
void* Fl_SVG_Image::gzopen(const char *fname) {
^~~~~~
gzopen
/usr/include/zlib.h:1709:20: note: expanded from macro 'gzopen'
# define gzopen gzopen64
^
The culprit was the macro defined in zlib.h (above).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12479 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This public, inline, and read-only accessor is intended for debugging
purposes but can be useful for user code as well.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12472 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This avoids repeating the default values "Shift", "Meta", etc... for several platforms.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12463 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
The following is valid, documented, "standard markdown" for headers in doxygen:
This is a level 1 header
========================
This is a level 2 header
------------------------
Upgrading doxygen from 1.7.4 to 1.8.13 fixed the problem.
So beware of 1.7.4 wrt to these kinds of header markdown;
the result in the docs was no header, the header text + underbars
were appearing inline with the text, crlfs removed.
Not sure exactly what version of doxygen this was fixed in;
a search in their bugzilla for 'headers' seemed to show no
directly relevant matches, other than maybe bug #681898.
https://bugzilla.gnome.org/show_bug.cgi?id=681898
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12459 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This has been working fine for years, not sure what version of doxygen dropped this.
I'm running 1.7.4 here, and that trick isn't working for the Fl_Browser_.H docs.
Changed to using <B> and </B> and <BR> which seems to work OK in both HTML and PDF
generation.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12458 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Removed obsolete '\todo' item from docs (done with recent commits).
Removed redundant code from label assignment (e.g. use FL_IMAGE_LABEL
instead of label type assignment + use of _FL_IMAGE_LABEL).
See recent commits.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12448 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Some labeltypes and boxtypes were missing a #define for the enum
without a leading underscore and the corresponding setup function
to initialize the internal table of boxtypes and labeltypes, for
instance _FL_MULTI_LABEL. This is now fixed so (hopefully) all boxtypes
and labeltypes can and _should_ be used w/o leading underscore.
Note: if there are still boxtypes or labeltypes that can't be used w/o
leading underscore this should be considered a bug and is to be fixed ASAP.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12443 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Consequently, remove the trailing _ from its name reserved for private class members.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12433 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This allows to use the virtual function mechanism to adapt scaled image drawing both to the
image type and the graphics driver type.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12410 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Possible side effect: programs that relied upon inclusion of unrelated
system headers by FL/Fl_Table.H or FL/Fl_Table_Row.H may fail to compile.
Removed include files (some only on certain platforms, list may be incomplete):
#include <FL/Fl.H> // moved to implementation (.cxx)
#include <FL/Fl_Box.H> // moved to implementation (.cxx)
#include <FL/Fl_Scrollbar.H> // moved to implementation (.cxx)
#include <sys/types.h>
#include <string.h> // memcpy
#include <malloc.h> // WINDOWS only: malloc/realloc
#include <stdlib.h> // UNIX: malloc/realloc
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12390 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Fl_Text_Selection got a new method length() and returns 0 in length()
and in all offsets (start(), end(), position()) if no text is selected
(selected() == false).
The behavior in FLTK 1.3 and earlier versions (returning undefined
values if !selected()) was confusing.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12356 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Windows are now rescaled with a call to Fl_Window::resize() which has been slightly modified.
Static member variable bool Fl_Window_Driver::in_resize_after_scale_change is created,
and is true if and only if Fl_Window::resize() is called by Fl_Window_Driver::resize_after_scale_change().
This new flag allows Fl_Window::resize() to perform correctly the rescaling of the window.
Fl_Gl_Window::resize() and Fl_Double_Window::resize() also consult the value of
the Fl_Window_Driver::in_resize_after_scale_change flag.
The platform-specific Fl_WinAPI_Window_Driver::resize() and Fl_X11_Window_Driver::resize()
also use the Fl_Window_Driver::in_resize_after_scale_change flag.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12349 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Clarify that all variants of do_callback() call clear_changed() after
the callback and that 'long Fl_Widget::argument()' may truncate the
user_data value on some (particularly Windows 64-bit) platforms.
Some code has been reformatted and refactored with better variable names,
but there are no effective code changes.
Obsolete, inactive code was removed.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12345 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
It is really an accessor to protected method Fl_Window::flush().
Rename it to Fl_Window_Driver::flush_Fl_Window to reflect that.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12340 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
The new method Fl_Group::bounds() replaces Fl_Group::sizes() whose
internal array structure was not documented.
Fl_Group::bounds() uses the new and documented class Fl_Rect for its
internal structure.
src/Fl_Tile.cxx now uses bounds() instead of sizes().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12302 ea41ed52-d2ee-0310-a9c1-e6b18d33e121