Corresponds to STR #3320
1) HiDPI support consists in detecting the adequate scaling factor for the screen on which
FLTK maps a window, and scaling all FLTK units by this factor. FLTK tries to detect the correct
value of this factor at startup (see more details below). Environment variable
FLTK_SCALING_FACTOR can also be used to set this value.
2) Rescaling support consists in changing the scaling factor of all FLTK windows
in reply to ctrl/+/-/0/ keystrokes.
More details for the various platforms :
- X11: Support is very advanced. Some details need still to be improved.
Automatic detection of the correct starting value of the scaling factor works well
with the gnome desktop. The present code contains no support for this on
other desktops. FLTK_SCALING_FACTOR provides a workaround.
-WIN32: Support is incomplete at this point, although many test
applications have partial or complete HiDPI and scaling support.
The current value of the system's scaling factor is correctly detected
at application startup. Apps respond to changes of this value in real time.
Support needs to define the FLTK_HIDPI_SUPPORT preprocessor variable
at compile time. This way, standard builds produce a code with the
default WIN32 HiDPI support, that is, where all graphics goes to an internal
buffer that gets enlarged by the system and then mapped to the HiDPI
display. To experiment with (or develop) the new HiDPI support requires
a modified build procedure in which FLTK_HIDPI_SUPPORT is defined
at compile time. When the support will be complete, the requirement for the
definition of this preprocessor variable will be removed. The present commit
contains support for a single scaling factor. Eventually, per-screen scaling
factors should be implemented, as done for X11.
- MacOS: this commit does not give new HiDPI for this platform.
Eventually, window rescaling in reply to command/+/-/0/ is desirable.
Per-screen scaling factor makes no sense on this platform because
the OS itself takes care of the difference between the resolutions of
traditional and retina displays.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12239 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This ensures API compatibility with FLTK 1.3 where Fl_Surface_Device->set_current()
is used to change the current drawing surface.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12125 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Documentation has been fixed and clarified, and ld() handling is now
consistent in Fl_(RGB_)Image, their subclasses and fl_draw_image()
and similar functions.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@12029 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
An already present CR/LF combination causes us to jump two characters,
but we failed to update the length counter when doing this.
This also makes sure we handle the corner case of a CR as the last
character.
Note: porting Pierre Ossman's commit (svn r11873) to branch-1.3-porting.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11913 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Under Windows 10:
when the user sets the value of "Change the size of text, apps and other items" in display settings
to above 100 %, the computation of Fl_Window::decorated_w() and decorated_h() has to
take the scaling factor into account.
This factor is also necessary to draw correctly window title bars.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11893 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
IDE generated with CMake, still many warnings, but compiles and runs.
Note: we *must* get rid of all VisualStudio-specific #define's like:
#define unlink _unlink
This one led to a compilation error (not a warning).
src/Fl_File_Icon.cxx: I had to add _MSC_VER (WIN32) distinction as in
previous code (FLTK 1.3). Obviously MinGW is more Unixy than MS VC++
since MinGW compiled and linked the code. Needs a better fix ...
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11580 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Use instead an API internal to each platform code base.
fl_read_image() is used only for its documented feature
of reading inside the current window or an offscreen buffer.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11518 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This file contained nearly only platform-specific code.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11507 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
File fl_utf8.h defines the xchar type with a platform-dependent value (wchar_t or unsigned short).
But it is used exclusively by WIN32 code (0 use in cross-platform code, 0 use in APPLE
or in USE_X11 code).
Thus, we can just get rid of this type and replace it by wchar_t where it is used.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11459 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
File src/Fl_win32.cxx is now compiled instead of included in Fl.cxx.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11420 ea41ed52-d2ee-0310-a9c1-e6b18d33e121