summaryrefslogtreecommitdiff
path: root/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx
AgeCommit message (Collapse)Author
44 hourswipmaxim nikonov
2025-03-07Fix "fltk autotools build does not link against libXft" (#1202)ManoloFLTK
libXft was erroneously present in the link command when using Pango and Cairo. This is fixed by disconnecting the GUI scaling code from use of Xft. This commit also makes sure that when Wayland is used, pkg-config is available on the build machine. This allows to remove from file CMake/options.cmake code that was labelled with "FIXME".
2022-08-29Make hybrid Wayland/X11 platform.ManoloFLTK
2022-06-19Move input method support to Fl_Screen_Driver from Fl_Graphics_DriverManoloFLTK
2022-03-21Avoid using same name (p) for distinct members of derived classes.ManoloFLTK
2022-03-13Separate platform init functions from platform-specific driver filesManoloFLTK
2022-01-02Text input method for X11: fix for case when text widget is inside subwindow.ManoloFLTK
2021-12-12X11 platform: account for GUI scaling in location of input method aux window.ManoloFLTK
2021-03-21Remove unnecessary system includes from public headersAlbrecht Schlosser
Add includes of system headers in the implementation files where necessary.
2021-03-11Unification of scaled coordinate calculations in class ↵ManoloFLTK
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-01Remove duplicated code between derived classes of Fl_Graphics_Driver.ManoloFLTK
2021-02-16Use <config.h> when appropriate.ManoloFLTK
2021-02-16Create classes Fl_XXX_Gl_Window_Driver according to driver model.ManoloFLTK
2020-11-12Fix for issue #155 - continuedManoloFLTK
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-07-06Remove $Id$ tags, update URL's, and moreAlbrecht Schlosser
- 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.
2019-05-30X11+Pango: call pango_font_description_from_string() less oftenManoloFLTK
Previously, each time fl_font(fnum, fsize) was called, functions pango_font_description_free() and pango_font_description_from_string() would be called. Now, pango_font_description_from_string() is called only once, the first time an Fl_Font is used.
2018-04-19Reorganise access to the value of the GUI scaling factor with public getter ↵Manolo Gouy
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-05X11: Fix drawing of sliders with gtk+ scheme and GUI scaling >= 2 that left ↵Manolo Gouy
footprints when moved. The fix is to use the X11 graphics driver's line_delta_ private member variable also when drawing complex shapes with fl_begin_loop(). The gtk+ scheme does use fl_begin_loop() to draw its frames. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12821 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-03-15Fix a potential internal stack overflow in Xlib graphics driver.Albrecht Schlosser
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12752 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-03-13Improve and simplify X line and rect 16-bit clipping.Albrecht Schlosser
Back to 16-bit coordinate limit clipping (actually +/- (2**15 - 8). The clipping range is now constant, symmetrical, and stored in the driver object. Also fixed a bug in Liang-Barsky line clipping algorithm. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12744 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-03-10Remove useless #include statement.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12728 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-03-10Fl_Xlib_Graphics_Driver::scale_clip: restrict the computed X11 region to the ↵Manolo Gouy
16-bit coordinate space. This member function transforms the current clip region from FLTK units to pixel units multiplying FLTK units by the current value of the scale factor to get pixel units. The current clip region has been, by construction, restricted to the 16-bit coordinate space. But these data can evade this space after multiplication by the scale factor. Thus, it's necessary to enforce the 16-bit space here which is done with Fl_Xlib_Graphics_Driver::XRectangleRegion. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12727 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-02-07STR#3450: Draw text with OpenGL using textures on all platforms.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12650 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-31Replace FL/x.H with FL/platform.H - step 2 (STR #3435).Albrecht Schlosser
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
2017-12-18STR#3444: Add MacOS support for application rescaling (not quite complete)Manolo Gouy
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
2017-08-24X11 platform: cleaner implementation of changing the active drawing surface ↵Manolo Gouy
and maintaining clip regions. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12396 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-08-20Simplify using Fl_XXX_Graphics_Driver::copy_offscreen() instead of ↵Manolo Gouy
Fl_Scalable_Graphics_Driver::copy_offscreen_unscaled() git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12395 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-06-27Exact computation of scaled clipping region for X11 platform.Manolo Gouy
Each rectangular component of the clipping region is transformed exactly as by Fl_Xlib_Graphics_Driver::rectf_unscaled() git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12272 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-06-21Move line_width_ protected member variable from Fl_Xlib_Graphics_Driver to ↵Manolo Gouy
Fl_Scalable_Graphics_Driver git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12269 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-05-22Fix warnings: 'Fl_Xlib_Graphics_Driver::scale' hides overloaded virtual ↵Manolo Gouy
function [-Woverloaded-virtual] git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12242 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-05-17Introduce HiDPI + rescaling support for the X11 platform (+ partial support ↵Manolo Gouy
for WIN32) 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
2017-04-12Fix for STR#3374: Crash with pango enabled when changing default fontManolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12218 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-03-17Create Fl_Xlib_Graphics_Driver::scale_and_render_pixmap() to draw depth-4 or ↵Manolo Gouy
scaled RGB images using Xrender. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12210 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-03-17Remove class Fl_Translated_Xlib_Graphics_Driver and move its processing to ↵Manolo Gouy
Fl_Xlib_Graphics_Driver. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12205 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-12-21X11 platform: Add optional use of the pango library to draw text, gaining ↵Manolo Gouy
the possibility to draw text in any script supported by Unicode. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12153 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-11-16Replace global fl_line_width_ used only by X11 platform by ↵Manolo Gouy
Fl_Xlib_Graphics_Driver::line_width_ git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12114 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-10-07Remove Fl_Xlib_Graphics_Driver::global_gc() because identical to ↵Manolo Gouy
Fl_Graphics_Driver::global_gc() git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@12019 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-09-23Move font-related member functions from Fl_Screen_Driver to Fl_Graphics_Driver.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11968 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-09-21Restore building with X11 but not XftManolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11963 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-17Fixes for Linux for recent commits.Matthias Melcher
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11645 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-17virtualized some Region calls.Matthias Melcher
There is a deeper issue here: regions should be handled by the graphics driver that is associated with the Fl_Window of this widget... . git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11643 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-17virtualized Fl_Graphics_Driver::global_gc(), a function that should probably ↵Matthias Melcher
not exeist. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11641 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-17virtualizes fl_set_spot and fl_reset_spotMatthias Melcher
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11640 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-16Begin moving non window-related member functions out of Fl_X class.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11629 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-09Fix typos.Albrecht Schlosser
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11560 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-26Isolate the definition of the 3 public, OS-dependent types (Fl_Offscreen, ↵Manolo Gouy
Fl_Region, Fl_Bitmask). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11432 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-24Rewrite Fl::handle_(int e, Fl_Window* window) and Fl_Widget::damage() to ↵Manolo Gouy
remove their platform dependent parts git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11419 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-01Allow running fluid -c without opening the X11 display.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11259 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-26Use the FL_DOXYGEN preprocessor variable to remove all Doxygen warningsManolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11232 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-26Rename Fl_Xlib_Graphics_Driver.h to Fl_Xlib_Graphics_Driver.HManolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11224 ea41ed52-d2ee-0310-a9c1-e6b18d33e121