Commit Graph

5593 Commits

Author SHA1 Message Date
ManoloFLTK 6d24a355f0 Support case when captured window is fullscreen: no titlebar. 2020-05-04 11:33:43 +02:00
Albrecht Schlosser 70d41b06a9 Reformat src/cmap.cxx and regen src/fl_cmap.h
- remove obsolete code / comments (see Git for history)
- add copyright to generated file src/fl_cmap.h
- generate copyright year in src/fl_cmap.h automatically
- add color indices as comments to color values
- remove $Id header
- replace $Id trailer with a more useful comment
2020-04-29 14:48:00 +02:00
ManoloFLTK 9fe77c6ff5 Minor readability doc change. 2020-04-29 11:24:00 +02:00
Albrecht Schlosser c1b2e030c5 Update dependencies and .gitignore 2020-04-28 21:20:01 +02:00
ManoloFLTK dd48bc52dd Misc doc improvements. 2020-04-24 09:30:01 +02:00
ManoloFLTK 255db6c8c4 Doc change with intent to make it clearer. 2020-04-24 08:17:52 +02:00
ManoloFLTK c4342630f0 Update © year. 2020-04-23 11:30:06 +02:00
ManoloFLTK f11a80482a Check for success of the FormatMessageW() call. 2020-04-23 11:28:18 +02:00
ManoloFLTK 2ced142adc Match variable type (DWORD) and format specifier 2020-04-22 16:58:48 +02:00
ManoloFLTK 2878fa95ab Add optional argument to Fl_Printer::begin_job() to inform caller when an error occurs.
This solves an issue raised in fltk.general :  Fl_Printer errors - how can I interpret them?
    https://www.fltk.org/newsgroups.php?s38419+gfltk.general+v38427
2020-04-22 16:01:33 +02:00
ManoloFLTK b3d46711be Slightly improve drawing of window titlebars. 2020-04-21 09:45:43 +02:00
ManoloFLTK e3ad0ee441 Avoid useless multiplication by 1 operations. 2020-04-21 09:38:39 +02:00
ManoloFLTK b4dd1d36dd Make sure output file name extension is visible. 2020-04-14 21:13:04 +02:00
ManoloFLTK f3e83d3ce5 MacOS: show print chooser panel as a sheet. 2020-04-12 17:18:44 +02:00
ManoloFLTK 6a01871f32 Give example of use of Fl_Native_File_Chooser::USE_FILTER_EXT option. 2020-04-10 18:41:24 +02:00
ManoloFLTK 84b753e7e9 Fix regression in Fl_Native_File_Chooser under macOS when USE_FILTER_EXT is ON. 2020-04-10 18:41:24 +02:00
ManoloFLTK 8e92ce49a8 Move Fl_Image_Reader.cxx to libfltk_images where it belongs. 2020-04-07 10:44:20 +02:00
ManoloFLTK 7793fa812a Update standard file headers 2020-04-05 16:53:37 +02:00
ManoloFLTK e8185abf22 Fix Fl_X11_Window_Driver::capture_titlebar_and_borders() for resizable window. 2020-04-03 16:32:28 +02:00
Albrecht Schlosser 09352ddab0 Update documentation, fix typos 2020-03-26 14:21:33 +01:00
ManoloFLTK 24f9e7e7c4 Fix for issue #65: FLTK breaks when resize request is denied
Under Windows, window resize requests sent by the program are now ignored,
which is what happens under X11 and macOS.
Previously, the window would become frozen.
2020-03-25 12:16:03 +01:00
Albrecht Schlosser 09d35ee9d5 Fix a typo 2020-03-20 15:40:00 +01:00
ManoloFLTK 10a9a0440e Rewrite Fl_Xlib_Graphics_Driver::get_font_name() with less lines of code. 2020-03-20 10:47:19 +01:00
ManoloFLTK 214f14db8a Fix Fl::get_font_name() under X11+Xft-Pango 2020-03-20 10:20:30 +01:00
ManoloFLTK a66fea7527 Minor rewriting for more readable code. 2020-03-15 08:16:59 +01:00
ManoloFLTK 4b2dbe3bb4 Fix when using Fl_Scroll inside Fl_Overlay_Window 2020-03-12 21:38:13 +01:00
Albrecht Schlosser 8a7d4c9f61 Remove CodeWarrior "support"
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.
2020-03-11 14:38:02 +01:00
ManoloFLTK 55132049c7 Complete fix for "[fltk.general] scroll and overlay window" dated 7 march 2020. 2020-03-10 06:37:47 +01:00
ManoloFLTK a1115f13e3 Improve use of fl_scroll within Fl_Overlay_Window on macOS.
This is a partial fix for "[fltk.general] scroll and overlay window"
dated 7 march 2020.
Mixing of Fl_Scroll and Fl_Overlay_Window is now OK also
on a retina display, but there are still problems when the window
is scaled.
2020-03-08 20:16:34 +01:00
Albrecht Schlosser 1ffcef2373 Update Fl_Text_Display documentation
No code changes except minor formatting and trailing whitespace.
2020-03-08 12:33:06 +01:00
ManoloFLTK 735d73bb59 Merge remote-tracking branch 'refs/remotes/origin/master' 2020-03-03 19:03:53 +01:00
ManoloFLTK 8f142b938a Fix for STR#3534 to draw correctly Fl_Tiled_Image's on non-display surfaces. 2020-03-03 19:03:29 +01:00
Albrecht Schlosser 3746b8986e Clarify documentation of Fl_Pack 2020-03-03 17:29:00 +01:00
Albrecht Schlosser 0d7a9e7f37 Clarify Fl_File_Chooser documentation 2020-03-02 19:34:24 +01:00
ManoloFLTK 87c994e2f8 Fl_Sys_Menu_Bar: make it strict equivalent of Fl_Menu_Bar outside macOS 2020-02-28 16:47:44 +01:00
ManoloFLTK e18de6ff03 Fix the Fl_RGB_Image(Fl_Pixmap *pxm) c'tor when pxm is scaled. 2020-02-22 07:15:08 +01:00
Albrecht Schlosser 6db6440441 Fix static analyzer issues in Fl_Text_Display
Remove unused variables and unused code to silence warnings.
2020-02-11 18:41:49 +01:00
Albrecht Schlosser 8ea4b5b5b1 Fix static analyzer errors and warnings
Fix several bugs found by scan-build (more to come).
https://clang-analyzer.llvm.org/scan-build.html

See also current travis-ci build log with static analyzer, e.g.
https://travis-ci.com/fltk/fltk/jobs/285426415
(link may become invalid in the future).
2020-02-11 15:46:46 +01:00
Albrecht Schlosser 924289a40c X11: Fix X Input Methods (XIM) (STR 3502, 3192)
Revert commit 958d912ffc using 'XSetLocaleModifiers("@im=");'
which was incorrect (STR 3192).

Apply fix for STR 3502, using 'XSetLocaleModifiers("");' which appears
to be the correct solution for using X Input Methods (XIM).

This has also been backported to FLTK 1.3.6 in branch-1.3, see
commit 219ae5e455.
2020-02-10 13:38:26 +01:00
Albrecht Schlosser 4c1b92eb52 Implement fl_putenv() as cross-platform putenv() 2020-02-10 12:10:40 +01:00
Albrecht Schlosser dcb848ca3e Remove empty file from compilation 2020-02-09 16:08:46 +01:00
darealshinji 71dc3269cd Eliminate -Wunknown-pragmas and -Wsign-compare warnings on GCC 2020-02-09 15:31:57 +01:00
ManoloFLTK 707b81b626 Restore macOS capacity to turn window fullscreen encompassing several screens. 2020-02-09 11:17:49 +01:00
ManoloFLTK 83bd04e0a3 Fix Fl_Cocoa_Window_Driver::resize when called before the window is show()'n. 2020-02-07 17:11:22 +01:00
ManoloFLTK d068fbf9de Fix state of visible() flag after Fl_Window(x, y, w, h, t).
The doc states:
"Top-level windows initially have visible() set to 0 and parent() set to NULL.
Subwindows initially have visible() set to 1 and parent() set to the parent window pointer."
The first statement was not satisfied when a window was constructed
with the Fl_Window(x, y, w, h, t) constructor.
2020-02-07 15:23:50 +01:00
ManoloFLTK 7cb0c2311c Fix computation of Fl_Window::decorated_h() on macOS when screen is scaled. 2020-02-06 16:01:19 +01:00
Albrecht Schlosser 97554a88cc Move fl_font(face, size) to fl_draw.cxx
I believe this is a better place.

Also: add FL_EXPORT since it's no longer inline.
2020-02-03 17:30:54 +01:00
Albrecht Schlosser dd3485c57a Fix regression calling fl_font() w/o draw context
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.
2020-02-03 16:35:28 +01:00
Albrecht Schlosser b8ab77e39c Don't "export" X11 specific fl_open_display() function
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.
2020-02-03 15:58:13 +01:00
Albrecht Schlosser a9bdb7a7b4 Fix disabling of deprecated warnings
Fix cut'n'paste error: needs #pragma pop instead of push.
2020-01-31 15:54:51 +01:00
Albrecht Schlosser f93b825b08 Update Fl::keyboard_screen_scaling()
- make the internal variable static
- make it callable after fl_open_display()
- document that it's currently only usable to switch scaling off
2020-01-31 15:48:21 +01:00
Albrecht Schlosser 65a798f9a2 Disable X11 "deprecated declaration" warning
... for GCC >= 4.6 and clang compilers.

This annoying warning exists on X11 (Linux/Unix/macOS) platforms
because we need to use XKeycodeToKeysym() although it is deprecated.
See STR 2913 for discussion and details.
2020-01-31 15:06:21 +01:00
Albrecht Schlosser a71c5f4c10 Fix typo 2020-01-31 13:13:49 +01:00
ManoloFLTK 4ba6cef0b9 Add Fl::keyboard_screen_scaling(int) to control recognition of ctrl/+/-/0/ 2020-01-31 09:42:36 +01:00
ManoloFLTK d1afac2150 Add a "Preview" switch to the GTK native file chooser.
The button state is recorded in a preference so is recovered the next
time the GTK file chooser runs.
2020-01-31 08:07:57 +01:00
ManoloFLTK 325c4b8666 New public static variable bool Fl_Image::register_images_done
Allows an app to detect whether fl_register_images() was called or not.
2020-01-30 18:54:18 +01:00
ManoloFLTK fbf20b7225 Protect against situation where HAVE_DLSYM && HAVE_DLFCN_H && !defined(RTLD_DEFAULT) 2020-01-30 18:49:34 +01:00
ManoloFLTK 982892a98b Restore compilability when HAVE_DLFCN_H = 0 2020-01-27 17:38:46 +01:00
ManoloFLTK 62cc0bba74 Restore compilability when HAVE_DLFCN_H = 0 2020-01-27 17:34:56 +01:00
ManoloFLTK 794eb962eb GTK printer chooser: add code to support choice of paper size and orientation 2020-01-24 18:05:46 +01:00
ManoloFLTK 59295b52a1 Remove unnecessary extern declaration 2020-01-23 15:44:14 +01:00
ManoloFLTK a47df74431 Fix preservation of the caller's locale when running GTK dialogs.
There are now 2 kinds of GTK libraries (V2 and V3) and two dialogs
the file chooser and the printer chooser.
2020-01-22 18:44:49 +01:00
Albrecht Schlosser bcc2f4c575 Fix Fl_PostScript_Graphics_Driver::clip_box() 2020-01-20 12:56:32 +01:00
Albrecht Schlosser fc36bfd88b Improve documentation of clipping functions
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.
2020-01-20 12:51:47 +01:00
ManoloFLTK 6aa9357b17 Have Fl_Quartz_Copy_Surface_Driver use retina resolution for resulting bitmap 2020-01-19 12:02:51 +01:00
ManoloFLTK ea09ea1009 Use visible size information when copying macOS image from clipboard. 2020-01-18 17:09:10 +01:00
ManoloFLTK 0a7b5b19bf Make Fl::screen_scale(int, float) functional also after initial window display. 2020-01-17 15:07:06 +01:00
Albrecht Schlosser 3e4baae6fc Fix DND in read-only Fl_Input (Fl_Output)
See report in fltk.coredev as of today (Jan 16, 2020):
  "Fl_Input in readonly mode - wrong behaviour".

Summary: Drag and drop within a read-only Fl_Input (i.e. Fl_Output)
  widget would not insert the dragged text (correct) but removed
  the dragged text from the widget (error). This is now fixed.
2020-01-16 17:12:24 +01:00
OKAMURA, Yasunobu dd3bf0791e Fix JIS Keyboard dead keys 2020-01-16 16:17:36 +01:00
Albrecht Schlosser 33825df108 Don't include 'src/flstring.h' in menubar demo
src/flstring.h should only be used in library code because it
  includes <config.h>.

Document this fact in src/flstring.h.
2020-01-16 15:59:00 +01:00
Albrecht Schlosser dfaab4ae90 Fix uninitialized vars in calls to fl_clip_box() (issue #6)
The main fixes are only to avoid static code analyzer warnings reported
in issue #5, but there are also minor bug fixes included. These bug
fixes are more of theoretical concerns though.

Close #6.
2020-01-15 21:23:26 +01:00
ManoloFLTK 3265d439f3 Slightly improve Fl_Quartz_Graphics_Driver::copy_offscreen() when macOS ≥ 10.4 2020-01-15 18:18:59 +01:00
Matthias Melcher afcc79c3f7 Merge remote-tracking branch 'refs/remotes/origin/master' 2020-01-14 19:22:03 +01:00
Matthias Melcher ed80d9cef0 Fixed some documentation for Fl_Preferences and fl_make_path. 2020-01-14 19:21:58 +01:00
ManoloFLTK d598f9ea06 Fix typo in comment 2020-01-14 16:31:47 +01:00
Albrecht Schlosser 2437a75d5f Add missing Fl_Image_Reader files
Forgot to add these files. Sorry for the noise.
2020-01-13 23:15:00 +01:00
Albrecht Schlosser 115a6025f6 Fix Doxygen warnings and errors 2020-01-13 23:11:35 +01:00
Albrecht Schlosser 1e2b0af443 Combine image readers in class Fl_Image_Reader
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.
2020-01-13 22:41:13 +01:00
ManoloFLTK c90baf9492 Bring main window to front when it's not there. 2020-01-13 18:01:29 +01:00
ManoloFLTK 2990717d6e Implement Fl_Window::icon() and default_icon() for macOS
The implementation is effective for macOS 10.10 and above.
Demo program test/device uses the new implementation.
2020-01-11 14:57:58 +01:00
Matthias Melcher 006d71c663 Improved documentation of Fl_Preferences.
Detailed information on how preference file paths are generated, and preliminary docs what happens if that fails. Documentation, on what FLTK die pre 1.4 when any of this failed. Also, a little TODO list for me that I will hopefully get to in the next days.
2020-01-11 00:19:58 +01:00
Matthias Melcher 7e0c82637d Updated image readers.
Removed duplicate code from Fl_JPEG_Image, updated and unified Doxygen comments. Avoiding name conflict in new protected functions.
2020-01-10 18:46:45 +01:00
Albrecht Schlosser 2411336e84 Fix X11 RTL text clipping (STR 2798) - part 2
Yet another fix for RTL text...
2020-01-09 00:35:42 +01:00
Albrecht Schlosser 2df013931b Improve X11 coordinate clipping for text (STR 2798)
Text outside the 16-bit X11 coordinate space must be clipped before
calling X11 draw functions, otherwise text might appear anywhere
in the window because X11 would "truncate" the coordinates instead
of proper clipping (X11 handles only 16-bit coordinates).
2020-01-08 19:50:35 +01:00
ManoloFLTK d2e2077544 Fix Doxygen description of the constructors. 2020-01-05 15:51:47 +01:00
Albrecht Schlosser 97e30260ec Update dependencies and .gitignore 2020-01-04 01:54:30 +01:00
Matthias Melcher 9c5888aa34 MacOS: Added the original code to the Fl_Preferences path that would search $HOME first, and only if that fails, we try other ways to find the home directory. This should be highly compatible with what we had first. 2020-01-04 00:51:22 +01:00
Matthias Melcher 618024827e Merge remote-tracking branch 'refs/remotes/origin/master' 2020-01-03 21:38:18 +01:00
Matthias Melcher 1ba9e64ba9 Added code to read GIF files from memory (GitHub issue #33, 2/2) 2020-01-03 21:37:52 +01:00
Matthias Melcher 86893a90cb Added code to read BMP files from memory (GitHub issue #33, 1/2) 2020-01-03 21:10:00 +01:00
MatthiasM 27d22aeed6 Fixed previous commit for MSWindows. 2020-01-03 18:13:14 +01:00
MatthiasWM c82d3878a4 Linux build: typos and stupidities to prev. commit 2020-01-03 17:55:08 +01:00
Matthias Melcher 462b681679 Linux/MSWindows: improved Fl_Preferences file path checking 2020-01-03 17:42:22 +01:00
Matthias Melcher 8147199a41 macOS: checking Fl_Preferences file path improved
zlib: removed warning
2020-01-03 17:05:52 +01:00
Matthias Melcher db6fa8bf86 Merge remote-tracking branch 'refs/remotes/origin/master' 2019-12-31 18:33:01 +01:00
Matthias Melcher c0237a1f04 Limiting file access for Fl_Preferences.
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.
2019-12-31 18:30:04 +01:00
ManoloFLTK a234ba7f33 Merge branch 'master' of https://github.com/fltk/fltk 2019-12-27 12:27:33 +01:00
ManoloFLTK 07c2ba56da Have Fl_Pack::draw() call Fl_Group::init_sizes() on its parent group.
Fl_Pack::draw() sometimes resizes itself. This must be followed
by a call to Fl_Group::init_sizes() as indicated in that function's doc:
"If you rearrange the widgets in your group, call this method to register
the new arrangement with the Fl_Group that contains them."
2019-12-27 12:14:26 +01:00
Albrecht Schlosser 3701950a90 Fix rare early timeouts in Fl_Clock (STR 3516).
This is the main patch for Fl_Clock discussed in STR 3516. Although
the root cause under Linux (in Fl::add_timeout()) has been fixed
in a previous commit (35a3e7cc1) early timeouts may still occur,
e.g. under Windows in a Virtualbox environment.

This commit reverts bab61a93d and replaces it with the patch proposed
by Manolo and further discussed in STR 3516.
2019-12-26 18:13:03 +01:00
Albrecht Schlosser 35a3e7cc16 Fix Fl::add_timeout() under Linux (STR 3516)
See comment 14 (excerpt):

"The current implementation basically handles add_timeout() the same
way as repeat_timeout(), i.e. add_timeout() *calls* repeat_timeout().
However, repeat_timeout() intentionally *corrects* the timeout value
by the value found in the global variable 'missed_timeout_by' which
is set when the timer expires, directly before the timer callback
is called. This variable is never reset."

This commit resets the variable as necessary in Fl::add_timeout().
2019-12-26 17:19:05 +01:00
Matthias Melcher 70179b618a Merge remote-tracking branch 'refs/remotes/origin/master' 2019-12-23 14:35:41 +01:00
Matthias Melcher bd77a6e976 Android Image driver was incomplete and did not compile. 2019-12-22 18:47:27 +01:00
ManoloFLTK f68dee3288 Fix problems after closing full-screen window
macOS strangely sends NSViewFrameDidChangeNotification and a drawRect: message to its content view
after having sent to the window the close message. That is apparently new in 10.15.2
2019-12-20 10:59:19 +01:00
ManoloFLTK 896112ca82 Merge branch 'master' of https://github.com/fltk/fltk 2019-12-19 18:25:48 +01:00
ManoloFLTK 803a472c5f Fix support of screen scaling under macOS 2019-12-19 18:25:09 +01:00
Albrecht Schlosser 0a124ac7e1 Fix Fl::add_timeout() in draw() under Linux (STR 3188)
Timeouts queued during Fl_Widget::draw() - called by Fl::flush() -
would not be serviced unless other events were processed. For
Details see STR 3188.
2019-12-09 17:53:58 +01:00
ManoloFLTK ee9ada9678 Undo commit b1bcd1f that was not necessary. 2019-11-09 07:21:56 +01:00
ManoloFLTK b1bcd1f19f Safer control of memory allocation of aux_bitmap member of FLView 2019-11-08 21:02:43 +01:00
ManoloFLTK cc4801133f X11 + pango: Sort font names ignoring case. 2019-11-08 10:09:18 +01:00
ManoloFLTK 2445797e45 Reorganise use of virtual member function Fl_Surface_Device::end_current() 2019-11-07 14:28:20 +01:00
ManoloFLTK 4abb0d0a25 Comments only: place new class Fl_GTK_Printer_Driver in the inheritance description. 2019-11-05 17:17:37 +01:00
ManoloFLTK da29db9f9c Slightly simpler code to support fl_overlay_rect() on HighDPI screens. 2019-11-02 11:41:42 +01:00
ManoloFLTK ecdb386f3d Fix HiDPI support under X11 to read/draw RGB image from/to display. 2019-11-01 14:32:07 +01:00
ManoloFLTK 04ec829bfb Fix fl_overlay_rect() under X11 on HighDPI display.
The mandelbrot demo program is fixed.
2019-11-01 08:26:22 +01:00
ManoloFLTK 031a7a8414 Merge remote-tracking branch 'refs/remotes/origin/master' 2019-10-30 21:14:15 +01:00
ManoloFLTK 527327b8e4 Restore CMake support of Darwin + XQuartz + fink test platform 2019-10-30 21:13:52 +01:00
Albrecht Schlosser 1f9d027bb6 Fix typo and debug output when loading libgtk
A recent commit changed the library name, supposedly unintended.

While testing I found that the debug statements generated confusing
output (both "selected GTK-3" and "selected GTK-2") when GTK-3 was
available.
2019-10-30 19:00:12 +01:00
ManoloFLTK 98f16ae397 Fix path to header file 2019-10-30 17:48:05 +01:00
ManoloFLTK 2f64c6a861 Concentrate source code that supports Darwin + XQuartz + fink as test platform 2019-10-30 17:25:49 +01:00
ManoloFLTK d1e346a7d2 Restore support of OpenGL on retina without Fl::use_high_res_GL(1)
Apparently the default value of the wantsBestResolutionOpenGLSurface
property changed with macOS Catalina 10.15
2019-10-26 08:47:25 +02:00
ManoloFLTK 4f8e692f30 Add default value of 0 for 1st arg of member function Fl_Printer::begin_job(). 2019-10-22 13:16:14 +02:00
ManoloFLTK 80f5740468 Avoid useless code when drawing directly. 2019-10-20 15:37:05 +02:00
ManoloFLTK 4d350b61c1 Rewrite for macOS 10.15 Catalina
Another way to support what occurs under macOS 10.15 where the bitmap graphics context
prepared by the system when drawRect: runs sometimes changes its number of bytes/row
even if the width and height are unchanged.
This is expected to perform better when the number of bytes/row alternates between
two values.
2019-10-14 15:41:53 +02:00
ManoloFLTK 9863fef25a Fix for macOS Catalina 10.15
Under Catalina, the bitmap graphics context prepared by the system when drawRect: runs
sometimes changes its number of bytes/row even if the width and height are unchanged.
2019-10-12 16:02:00 +02:00
ManoloFLTK 72e712efbd Faster processing of layer-backed views used with MacOS ≥ 10.14
Calls to CGBitmapContextCreateImage() and CGContextDrawImage() are replaced
by faster calls to memcpy().
2019-10-09 11:49:24 +02:00
ManoloFLTK 940b7ba13d Faster drawing of layer-based windows if entirely redrawn 2019-09-24 12:57:29 +02:00
ManoloFLTK c549b7acbd X11 platform: use Gnome printer dialog when the GTK library is available at run-time
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.
2019-09-15 15:57:29 +02:00
ManoloFLTK 000807cc1d Fix use of Xrender extension with old, 16-bit framebuffers.
Subject "Bug in 1.4 Displaying PNG under x64 Kernel x86 app." in fltk.general
contains a report by Darren Legge that presents the problem,
and a later post stating the code modification does fix the problem.
2019-09-11 16:06:19 +02:00
Albrecht Schlosser cb387bd6ff Fix remaining compiler warnings of (STR 3529)
src/Fl_File_Chooser2.cxx
src/Fl_File_Icon2.cxx
src/Fl_Help_View.cxx

The only known warnings are now in src/Fl_x.cxx as mentioned in
comment #1.
2019-08-29 18:43:11 +02:00
Greg Ercolano 62e39e5559 Added new method Fl_Tree_Item::event_on_item() 2019-08-27 16:53:57 -07:00
Greg Ercolano 3340b33bf1 Added NULL checks in Fl_Tree_Item::move() 2019-08-27 16:46:36 -07:00
Greg Ercolano 0d329a4699 Fix STR #3432: fixed drag+drop on folder
With reference to Sanch's patch from the STR, plus some extra mods
for handling edge conditions (such as root()) and comment clarifications.
2019-08-27 16:39:43 -07:00
ManoloFLTK 17d155d916 Fix window moving between retina/non-retina display with a GL subwindow. 2019-08-27 17:44:31 +02:00
Greg Ercolano 4870cde0a6 More fixes for STR #3527; handle usericons, etc 2019-08-25 01:13:35 -07:00
Greg Ercolano 521a5ef17c Fixes STR #3527: Fl_Tree small drags on open/close icons change selection 2019-08-24 23:07:21 -07:00
ManoloFLTK 1b77967823 Add check useful with macOS 10.15 public beta (Catalina). 2019-08-23 14:17:06 +02:00
ManoloFLTK 33eb87940d Fix a case when fl_read_window() did not capture subwindows correctly.
The case was under macOS with a non-GL parent window mapped to a retina display
containing a GL subwindow and if the app did not call Fl::use_high_res_GL(1).
2019-08-21 12:01:51 +02:00
ManoloFLTK e16eea32be Avoid repetition of the same multiplication. 2019-08-19 09:34:42 +02:00
ManoloFLTK 8c39007b26 Improved implementation of layer-backed views under macOS ≥ 10.14
This new implementation does all screen drawing through the drawRect: method.
The benefit is that [[NSGraphicsContext currentContext] CGContext] provides
a system-built drawing context whose product ultimately appears on screen.
Feed-back from the fldigi FLTK application shows that this procedure is
measurably faster that the previous one when drawing a rapidly changing image.
2019-08-18 21:56:12 +02:00
Albrecht Schlosser 292739664f Support copy function in Fl_Color_Chooser
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.
2019-08-12 19:07:28 +02:00
ManoloFLTK f20c07d757 X11: support copy/paste of image via clipboard within a single app
X11 requires to process differently paste if both copy and paste are within the
same app or are in 2 separate apps. This was implemented for paste of text.
It's now also implemented for paste of image.
2019-07-18 17:46:10 +02:00
ManoloFLTK 3679dd5fbd Fl_GDI_Copy_Surface_Driver: add BITMAP version of graphics to clipboard
When copying graphical data to the clipboard with Fl_Copy_Surface,
both a vectorial and a bitmap versions of the graphics are copied.
2019-07-18 17:11:03 +02:00
ManoloFLTK af5fb2aeb3 Fl_WinAPI_Printer_Driver::end_page(): make sure rotation stops when the page ends 2019-07-13 19:50:46 +02:00
ManoloFLTK 58dad3bda2 Fl_Quartz_Copy_Surface_Driver: minor code reorganisation. 2019-07-08 08:56:07 +02:00
ManoloFLTK 3c41e2d372 Correct guard for adequate version of macOS SDK 2019-07-06 09:22:06 +02:00
ManoloFLTK 71faa15432 Add support for macOS 10.15 "Catalina"
This is relatively to Catalina public beta for now.
2019-07-06 09:16:39 +02:00
Albrecht Schlosser a7c9fd88b3 Fix a subtle bug in Fl_Menu_::menu_end()
This bug could cause memory allocation/free errors and eventually
cause a crash.
2019-07-03 17:35:03 +02:00
ManoloFLTK ef1c937606 Fix a bug appeared in macOS 10.15 Catalina Beta about GUI scaling transient window.
The bug is that the app freezes for a few seconds before the yellow transient window is closed
if the close message is set from within a timer callback.
If the window to close returns NO to the canBecomeKeyWindow message, the bug does not occur.
Anyway it's good that canBecomeKeyWindow returns NO for a window with the OUTPUT flag.
2019-07-03 15:21:31 +02:00
ManoloFLTK 6b03d4a913 Prepare for support of macOS 10.15 Catalina
Drawing the window titlebar to a PDF context does not work with Catalina Beta.
2019-06-29 23:32:30 +02:00
Albrecht Schlosser 42b8cb7bb8 Add method Fl_Menu_::menu_end() (STR 3523)
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. ?
2019-06-27 16:04:03 +02:00
Albrecht Schlosser 44b2b7126c Update dependency system
Try to make `make depend' independent of locale.
2019-06-22 23:42:39 +02:00
ManoloFLTK 35376256e2 Simpler list of virtual member functions of Fl_Gl_Window_Driver 2019-06-21 21:47:00 +02:00
ManoloFLTK 71f645a6ed Fix building for Windows platform when HAVE_GL_OVERLAY is set to 1 2019-06-19 13:11:09 +02:00
ManoloFLTK 8e6ba19e3e Rename variable from txt_buf to alpha_buf 2019-06-19 08:04:48 +02:00
Albrecht Schlosser fb3479aff2 Avoid "uninitialized memory" error in gl_draw
As discussed in fltk.general, valgrind reported errors when gl_draw()
is called and the text is converted to a texture (i.e. when testing
whether the texture already exists).

We need a length check to make sure we don't overrun text buffers.

See threads "gl_draw" and "gl_draw - [General Use]", respectively,
started on Jun 19, 2019.
2019-06-18 17:49:49 +02:00
ManoloFLTK 23484c30a9 Slightly simpler Fl_WinAPI_Screen_Driver::init() 2019-06-18 13:35:39 +02:00
ManoloFLTK 643533b4b8 Windows platform: resize all windows after screen configuration events 2019-06-16 23:41:51 +02:00
ManoloFLTK 62bce5b50a Make FLTK Windows apps "Per-Monitor-V2 DPI Aware"
Per-Monitor V2 awareness mode is supported on Windows 10 1703 or above
and has window title bars correctly scaled on HighDPI screens.
Before this commit, FLTK Windows apps were "Per-Monitor-V1 DPI Aware".

FLTK apps detect at run-time whether the V2 mode is possible.
2019-06-16 12:00:38 +02:00
ManoloFLTK aa9f0a6962 Move Fl_Cocoa_Window_Driver::capture_titlebar_and_borders() to Fl_Cocoa_Window_Driver.cxx from Fl_cocoa.mm 2019-06-12 10:02:11 +02:00
ManoloFLTK b238ec26e5 Fix Fl_WinAPI_Window_Driver::capture_titlebar_and_borders() when window titlebar is partially out of screen 2019-06-11 18:51:10 +02:00
ManoloFLTK 94fffb701c Add one argument to Fl_Screen_Driver::read_win_rectangle()
The new argument gives the window to be captured, or NULL to indicate capture
from the current offscreen.
Calling this function becomes easier because less dependent on global variables.
2019-06-06 18:28:49 +02:00
ManoloFLTK 228f1105ac Fix in Fl_Xlib_Graphics_Driver::font_unscaled() necessary when changing drawing surfaces 2019-06-06 17:41:14 +02:00
ManoloFLTK 5ab26a17b0 Better use of the did_view_resolution_change message sent to FLViewLayer 2019-06-03 21:09:03 +02:00
ManoloFLTK ad1747008c X11+Pango: fix case when function pango_font_get_glyph_extents() fails 2019-06-03 17:22:30 +02:00
ManoloFLTK cb2d9c1212 X11+Pango: font names visible in the fonts and utf8 apps are usable for Fl::set_font(Fl_Font, const char*) 2019-06-02 17:19:35 +02:00
ManoloFLTK e6bccc081f X11+Pango: call pango_font_description_from_string() less often
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.
2019-05-30 15:28:08 +02:00
ManoloFLTK 7c4239915f Fix Fl_X11_Window_Driver::capture_titlebar_and_borders() for scaled, partially visible windows 2019-05-27 13:36:29 +02:00
ManoloFLTK 2cbc743c6a Slightly simplify Fl_X11_Window_Driver::capture_titlebar_and_borders() 2019-05-25 18:43:08 +02:00
ManoloFLTK efbd60cb12 Restore the value of global variable fl_window 2019-05-25 17:43:18 +02:00
ManoloFLTK 0d3a374396 Call virtual member Fl_Surface_Device::end_current() when necessary
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.
2019-05-25 11:59:16 +02:00
ManoloFLTK bf50352afe Remove Fl_Copy_Surface_Driver::draw_decorated_window() that is unnecessary 2019-05-24 14:05:41 +02:00
ManoloFLTK 084c30381d Fix Fl_Cocoa_Printer_Driver::draw_decorated_window() for GUI scaling - cont'd 2019-05-23 21:32:27 +02:00
ManoloFLTK 294875058d Fix Fl_Cocoa_Printer_Driver::draw_decorated_window for scaled GUI.
Support for scaled GUI was missing when the window titlebar is not layer-based.
2019-05-23 16:21:21 +02:00
ManoloFLTK b2c027fa83 Implement Fl_Quartz_Copy_Surface_Driver::draw_decorated_window()
The window title is copied in vectorial form when the titlebar is layer-backed.
2019-05-22 21:33:02 +02:00
ManoloFLTK 277cee73b0 Improve drawing of Fl_RGB_Image's to Fl_Copy_Surface on macOS 2019-05-22 13:37:12 +02:00
ManoloFLTK da6d671d9b Support for fl_scroll() under macOS when GUI is scaled - cont'd
Handles support of non-layered windows
2019-05-22 10:56:19 +02:00
ManoloFLTK 9ad985ce07 Remove warning appeared with Doxygen 1.8.15 2019-05-22 10:26:50 +02:00
ManoloFLTK 9b80a38345 Support for fl_scroll() under macOS when GUI is scaled 2019-05-21 21:17:11 +02:00
ManoloFLTK 07f4fd4380 More accurate implementation of Fl_Cocoa_Window_Driver::decoration_sizes(). 2019-05-20 13:30:57 +02:00
ManoloFLTK 159572785d Remove small duplication of code 2019-05-20 13:16:31 +02:00
ManoloFLTK 30e05510fa Avoid small repetition 2019-05-18 17:40:18 +02:00
ManoloFLTK 99419b2f63 Have Fl_Cocoa_Window_Driver::flush() use the drawRect: method to draw to non-layered views 2019-05-17 15:23:55 +02:00
ManoloFLTK 238c3b7cef Merge remote-tracking branch 'origin/master' 2019-05-15 21:58:26 +02:00
Manolo Gouy 88c2994e20 Restore use for GL windows under macOS 10.14.0 2019-05-15 21:55:10 +02:00
Albrecht Schlosser 5df7a7678a Document Fl_File_Input::errorcolor() as deprecated
Fl_File_Input::errorcolor() and Fl_File_Input::errorcolor(Fl_Color)
have not been used anywhere. Marked as deprecated.
2019-05-15 18:31:46 +02:00
ManoloFLTK fa5c2718da Remove class FLGLViewLayer and get simpler code. 2019-05-15 13:59:29 +02:00
ManoloFLTK e2eabd3056 Remove Fl_Cocoa_Screen_Driver::flush() that is useless 2019-05-13 15:34:26 +02:00
ManoloFLTK e236091a99 Fix GUI rescaling when one window is iconified (macOS) 2019-05-13 15:06:19 +02:00
ManoloFLTK dd687e7fbc Fix GUI scaling in presence of un-show()'n subwindows (macOS) 2019-05-12 19:02:15 +02:00
ManoloFLTK 467e216681 Use more convenient API for function get_window_frame_sizes() 2019-05-09 10:22:31 +02:00
ManoloFLTK 32439ec259 Fix Fl_Cocoa_Window_Driver::capture_titlebar_and_borders() when GUI is scaled down 2019-05-08 16:27:53 +02:00
ManoloFLTK 12dedc26cd Adapt function fake_X_wm() to rescaled GUI. 2019-05-08 12:25:48 +02:00
ManoloFLTK d88ef8f039 Avoid double window redraw after resize 2019-05-08 11:53:25 +02:00
ManoloFLTK 5a57c928a1 Remove unnecessary code 2019-05-07 12:45:44 +02:00
ManoloFLTK c00f31ab10 Slightly simpler code for what is specific to macOS 10.14.0 2019-05-06 16:55:41 +02:00
ManoloFLTK fea125eca9 Restore forcing the position of a window before it's shown 2019-05-06 16:50:42 +02:00
ManoloFLTK 38cf195727 Remove call to Fl_Group::init_sizes() because it's expected from the caller. 2019-05-04 13:25:28 +02:00
ManoloFLTK ef355e2762 Fix control for subwindow leakage in presence of GUI scaling 2019-05-04 09:44:29 +02:00
ManoloFLTK 5fde73b9ea Reworked algorithm to support window moving across screens 2019-05-02 20:53:10 +02:00
ManoloFLTK 61dbac62e7 Minor change in Fl_Cocoa_Window_Driver::shape(const Fl_Image*) 2019-04-30 15:18:40 +02:00