Commit Graph

6062 Commits

Author SHA1 Message Date
ManoloFLTK
d83d89679b Fix for issue #429 : Segfault with Ctrl+/- with current git version 2022-04-14 11:07:56 +02:00
Albrecht Schlosser
10537b7143 Make Fl_Image::copy() 'const', including all derived classes
Copying an image does not (and must not) change the original object,
hence copy() should always be 'const'.

This is *necessary* if the given Fl_Image object is 'const'.
2022-04-13 16:50:30 +02:00
ManoloFLTK
e25758582e Fix for issue #427 - continued. 2022-04-13 09:30:31 +02:00
ManoloFLTK
bfae813c4e Fix for issue #427: Problems with data_w, data_h, w, h of Fl_Image. 2022-04-12 15:06:21 +02:00
ManoloFLTK
fad867a5d3 Modify test/cairo_test.cxx to show roles of OPTION_CAIRO and OPTION_CAIROEXT.
Also make clear that these options require, for now, Fl_Double_Window to work cross-platform.
2022-04-12 09:20:34 +02:00
ManoloFLTK
0d59e32b84 Fix for issue #426 - cont'd. 2022-04-10 15:09:25 +02:00
ManoloFLTK
223bf6309b Fix for issue #426: "configure --enable-cairoext" flips display upside down 2022-04-08 16:22:22 +02:00
Albrecht Schlosser
385f0d5b4d Rename remaining FLTK_USE_CAIRO to FLTK_HAVE_CAIROEXT
Thanks to Manolo for finding this.
2022-04-07 15:14:30 +02:00
ManoloFLTK
21428bad10 Undo most of f6a93eb that was a bad move. 2022-04-07 11:31:12 +02:00
Albrecht Schlosser
dacf243889 Fix build w/o Xft 2022-04-07 03:40:43 +02:00
ManoloFLTK
d1bffee04a Remove useless instructions. 2022-04-06 13:25:54 +02:00
ManoloFLTK
f6a93eb060 Remove warnings: comparison of integer expressions of different signedness [-Wsign-compare] 2022-04-06 13:25:17 +02:00
ManoloFLTK
6a30f63fe4 Fix for "Fl_Native_File_Chooser_GTK does not respect PREVIEW option" in fltk.general. 2022-04-05 09:19:26 +02:00
ManoloFLTK
2ee27e39db Catch also Fl_Posix_System_Driver after rename stat -> flstat in Fl_System_Driver 2022-04-04 08:30:43 +02:00
Albrecht Schlosser
9a7af11108 Silence compiler warnings [-Wunused-but-set-variable] 2022-04-03 22:30:59 +02:00
Albrecht Schlosser
717a7d266b Remove '#include <sys/stat.h>' from FL/platform_types.h
- Add this include statement only where needed.
- Rename Fl_System_Driver::stat() to flstat().

This fixes an issue when using some (!) MinGW 64-bit build systems
that obviously '#define stat _stat64' or similar. This would
result in compiler problems if 'stat()' is a member function of
Fl_System_Driver.
2022-04-03 22:01:41 +02:00
ManoloFLTK
9aba7c9db0 Fl_Wayland_Window_Driver::scroll() when GUI scaling >= 2. 2022-04-01 14:52:47 +02:00
ManoloFLTK
d992a12403 Merge remote-tracking branch 'refs/remotes/origin/master' 2022-04-01 14:36:41 +02:00
ManoloFLTK
a53efd73d7 Fix regression introduced with d9a6ec8 visible in test/scroll. 2022-04-01 14:36:33 +02:00
Albrecht Schlosser
e91d65cd2f Fix whitespace errors (no code changes) 2022-03-31 16:00:11 +02:00
ManoloFLTK
d9a6ec88e4 Add support of Fl_Region to the Cairo graphics driver
and remove it from the Wayland graphics driver.
2022-03-31 10:36:01 +02:00
Albrecht Schlosser
df4503ea2c Export fl_cmap to be able to build shared FLTK libraries 2022-03-27 17:13:16 +02:00
Albrecht Schlosser
b037472649 Move src/cmap.cxx to util/cmap.cxx (utilities folder)
Regenerated src/fl_cmap.h with less spaces, updated copyright year.
Only whitespace and comments are changed in this file.

Note that src/cmap.cxx is not compiled to build the FLTK libs,
it's only used to generate src/fl_cmap.h.
2022-03-27 17:05:55 +02:00
ManoloFLTK
dc8c4b5676 Wayland: replace public fl_event_time by static wld_event_time. 2022-03-27 09:20:30 +02:00
YX
e9b1c2fed0 Add const to Fl_Image::fail() (PR #415) 2022-03-26 17:55:13 +01:00
Albrecht Schlosser
fc250a3aa2 Update documentation and dependencies 2022-03-25 17:27:46 +01:00
ManoloFLTK
0ab3ca7cf6 Remove documentation of non-existant function return values. 2022-03-25 16:54:53 +01:00
ManoloFLTK
427e4dbc7a Remove platform-dependent type Fl_Bitmask (not in documented public API). 2022-03-24 10:00:01 +01:00
ManoloFLTK
70f61a63f4 Merge remote-tracking branch 'refs/remotes/origin/master' 2022-03-24 06:30:33 +01:00
ManoloFLTK
194164054b Remove useless virtual member function overrides. 2022-03-24 06:30:27 +01:00
ian.macarthur
29c6d6c679 Remove vsscanf_l() call from Win32 driver (it appears to be a BSD-ism and unsupported by the MS tools) and rename several clocale specific methods from "name" to "vname" since they take a va_list not a variable list of arguments. 2022-03-23 19:46:35 +01:00
ManoloFLTK
54ecae9bda Create struct wld_window *Fl_Wayland_Window_Driver::wld_window to replace eventually fl_window. 2022-03-23 14:11:49 +01:00
ManoloFLTK
2d71a95b5d Wayland: replace global fl_display by function struct wl_display *fl_wl_display(). 2022-03-23 11:37:25 +01:00
ManoloFLTK
26a78c4992 Fix for issue #419: Wayland: scale/resize issue. 2022-03-23 07:57:17 +01:00
Albrecht Schlosser
f1b00c6637 Fix driver definitions of vsnprintf() and vsscanf()
These two functions are fully defined in the platform specific driver
methods, there's no need to define them in the base class.

This quick fix returns 0 from the base class method. The main reason
was to avoid a compiler error of MSVC 2010 and earlier, i.e. before
MSVC 2012.

Todo: int Fl_WinAPI_System_Driver::clocale_sscanf() needs to be fixed
because '_vsscanf_l()' (with lower case 'L' for 'locale') does not
exist in MSVC 2010 and earlier. It is not clear yet in which version
it was added - current MS docs show it in MSVC 2015 and later.
2022-03-21 17:16:14 +01:00
Albrecht Schlosser
fa84b58cd5 Fix silly MSVC 2010 parser warnings
Code like "void copy(const char */*stuff*/, ...)" would issue the
warning "'*/' seen outside comment" which is formally true but ...

These warnings don't appear with newer MS compilers, but I fixed them
anyway.
2022-03-21 17:03:13 +01:00
Albrecht Schlosser
35c212ef3b Fix MSVC 2010 warning: using 'this' in initializer list
This is a legitimate warning although it probably didn't do any harm.
2022-03-21 16:57:32 +01:00
Albrecht Schlosser
9e16f3439e Fix MSVC 2010 warning/error: declare variables in C early
... before other code gets executed in a block. The warning or errors
generated were MORE than confusing.
2022-03-21 16:55:07 +01:00
ManoloFLTK
ff4cf80891 Avoid using same name (p) for distinct members of derived classes - cont'd. 2022-03-21 16:10:34 +01:00
ManoloFLTK
d87b62ea69 Avoid using same name (p) for distinct members of derived classes. 2022-03-21 15:56:50 +01:00
ManoloFLTK
bf5b902180 Rename member Fl_Graphics_Driver::p to xpoint to avoid shadowing. 2022-03-21 14:39:00 +01:00
ManoloFLTK
49dae86edf Fix for issue #418 : some warnings about unused functions. 2022-03-21 12:12:07 +01:00
ManoloFLTK
a9412b41bb Issue #359 RFE: access the MacOS windowid . 2022-03-21 11:41:51 +01:00
ManoloFLTK
7e76929aff Fix for issue #416: Fl_Xlib_Graphics_Driver_font_xft.cxx has a libasan error. 2022-03-21 10:31:09 +01:00
ManoloFLTK
19439e8e0a Remove unnecessary constructors. 2022-03-21 10:01:45 +01:00
Albrecht Schlosser
4bcd5c467b Improve documentation of Fl_Image::copy()
Mention the new Fl_Image::release() method to delete all types of
images.
2022-03-20 15:52:08 +01:00
Albrecht Schlosser
7758020edb Fix Fl_Tiled_Image::copy(int W, int H)
Remove false "optimization" that would return the same pointer
if the requested width and height are the same.

Note: copy() must always return a new image (this is the expected
behavior of copy). Otherwise deleting one of the objects (either
the source or the copy) would delete the other one as well.
2022-03-20 15:35:04 +01:00
ManoloFLTK
791fc7d6eb Update description of Fl_Graphics_Driver class hierarchy. 2022-03-20 15:10:43 +01:00
ManoloFLTK
a2229c8b6b Fix typo in comment. 2022-03-20 14:07:33 +01:00
ManoloFLTK
bc606cce57 Simpler updateTrackingAreas method of class FLView is enough. 2022-03-20 14:06:30 +01:00
ManoloFLTK
f5628aa66d Fix issue #413: Commit 29d9e31 creates memory handling problem under macOS. 2022-03-20 08:09:34 +01:00
Albrecht Schlosser
733ffed630 Add missing initialization parts of Fl_SVG_Image 2022-03-19 15:34:45 +01:00
ManoloFLTK
5884d37ee8 Restore default YES value for FLWindow releasedWhenClosed property. 2022-03-19 08:42:09 +01:00
ManoloFLTK
aa955812f9 Fix for issue #411: send FL_ENTER / FL_LEAVE events to Fl_Window objects. 2022-03-18 14:26:44 +01:00
ManoloFLTK
ace51a4b8d More detailed doc of how to change the current drawing surface. 2022-03-18 06:52:06 +01:00
ManoloFLTK
618eb8f105 Improve handling of custom cursor by Wayland platform. 2022-03-17 11:08:02 +01:00
ManoloFLTK
b12ec7d75e Add necessary #include <FL/platform.H> directive. 2022-03-16 08:06:42 +01:00
ManoloFLTK
8bfb0aa75c Remove typo in Fl_Wayland_Image_Surface_Driver.H 2022-03-16 08:04:44 +01:00
ManoloFLTK
6235abf79d Add member variable Window Fl_Wayland_Image_Surface_Driver::pre_window. 2022-03-16 08:00:51 +01:00
ManoloFLTK
576fbcde53 Fix for issue fltk#410 - continued. 2022-03-15 15:58:48 +01:00
ManoloFLTK
7f5ce4d7a9 Fix for issue #410 2022-03-15 05:57:19 +01:00
ManoloFLTK
2d833a54fd Move initialisation of X11 and Wayland built-in font names to fl_???_platform_init.cxx 2022-03-14 15:28:38 +01:00
ManoloFLTK
2500899b09 Remove unnecessary #include directives 2022-03-13 09:44:37 +01:00
ManoloFLTK
b549cfaaea Separate platform init functions from platform-specific driver files 2022-03-13 08:56:35 +01:00
ManoloFLTK
e8461a6191 Document Fl::set_font(Fl_Font, const char *) with platform-specific details. 2022-03-10 19:06:46 +01:00
ManoloFLTK
5b26d2b203 Fix for issue #404 about Fl::get_key(int). 2022-03-10 16:06:04 +01:00
ManoloFLTK
9d869d73c1 Begin documenting the Wayland platform, new in FLTK version 1.4 2022-03-10 15:05:26 +01:00
ManoloFLTK
9e4c7aa77c Restore building for X11 platform + Pango (issue #405). 2022-03-10 09:09:29 +01:00
ManoloFLTK
1e68edddc0 Add safety check in Fl_Wayland_Window_Driver::label(). 2022-03-09 17:04:59 +01:00
Greg Ercolano
6d3071b859 Small doc improvements for Fl_Tree_Item. 2022-03-09 06:12:42 -08:00
ManoloFLTK
f97fbffa7b Move all font stuff to Fl_Cairo_Graphics_Driver from Fl_Wayland_Graphics_Driver. 2022-03-09 08:46:49 +01:00
ManoloFLTK
e3f67b8e56 Add necessary call to Fl_Cairo_Graphics_Driver::needs_commit_tag(). 2022-03-09 08:33:49 +01:00
Albrecht Schlosser
af9cffc2db Fix doxygen warning 2022-03-08 16:00:46 +01:00
ManoloFLTK
5b1d1e2470 Some reformatting and fix else reach in Fl_Cairo_Graphics_Driver::transformed_vertex. 2022-03-08 09:30:32 +01:00
Albrecht Schlosser
53b40f4138 Improve documentation on Fl_Menu_Item's and related methods (#332)
See discussion on GitHub Issue #332.

Summary: don't change FLTK code but document what to do and not to do.
2022-03-07 18:28:32 +01:00
ManoloFLTK
9e7f49f56f Add missing member initialisation in Fl_Cairo_Graphics_Driver constructor. 2022-03-07 08:34:49 +01:00
ManoloFLTK
f8db18597a Complete class Fl_Cairo_Graphics_Driver using Fl_Wayland_Graphics_Driver 2022-03-06 19:47:06 +01:00
Albrecht Schlosser
272bc2560c Fix MSVC compiler warning
warning C4099: 'Fl_Menu_Item': type name first seen using 'struct'
  now seen using 'class'
2022-03-05 16:05:31 +01:00
Albrecht Schlosser
5ebb76050b Fix size_range() - continued (issue #392)
- fix window size of GL windows as reported for test/glpuzzle.cxx
- fix window not resizing on ctrl/+/- (X11 only)

Unfortunately the previous commit "optimized" a necessary X11 message
away. This is now fixed.

Fixes #392.
2022-03-05 15:50:49 +01:00
ManoloFLTK
c2c7795614 Rename Fl_wayland.cxx to fl_wayland_clipboard_dnd.cxx 2022-03-05 12:28:21 +01:00
ManoloFLTK
3718effc43 Add the Wayland platform to FLTK 1.4 2022-03-04 15:41:00 +01:00
Albrecht Schlosser
a773fdc44b Fix whitespace, update dependencies and fluid files 2022-03-03 17:20:24 +01:00
ManoloFLTK
d8cb8ec916 Fix for issue #401. No longer attempt to transiently inactivate the maximize button.
This inactivation works with some window managers, but not with KDE or xfce.
It's probably an issue of these WM rather than of FLTK.
2022-03-03 09:46:37 +01:00
Albrecht Schlosser
47154602dd Simplify internal Fl_WinAPI_Window_Driver::fake_X_wm() method
Add optional arguments 'style' and 'styleEx' to fake_X_wm().

Remove static function fake_X_wm_style() and include its code in the
Window driver method Fl_WinAPI_Window_Driver::fake_X_wm(). This
removes some calls and function arguments.
2022-03-01 13:45:51 +01:00
Albrecht Schlosser
091712bea8 Fix default size_range() calculation (issue #392, STR 3352) 2022-03-01 13:45:51 +01:00
Albrecht Schlosser
fcf89b580e Fix Visual Studio build warnings in OpenGL graphics driver 2022-02-26 19:48:47 +01:00
Albrecht Schlosser
7810cda145 Fix Visual Studio build warnings 2022-02-26 18:19:43 +01:00
Albrecht Schlosser
cdd1933661 X11: Disable "boxcheat" hack
For details see comment in src/Fl_x.cxx: this "Hack to speed up
bg box drawing" is now disabled for several reasons. The code
is still available if the macro ENABLE_BOXCHEAT is defined.
2022-02-22 19:55:11 +01:00
Albrecht Schlosser
406f2c33f4 Update dependencies 2022-02-21 20:44:04 +01:00
Albrecht Schlosser
84c06419bc Remove obsolete/disabled "boxcheat" code
Windows platform: Remove comments about obsolete code and one
exported declaration of the variable 'fl_background_pixel' which
is used only on the X11 platform.

X11 platform: Remove comments.

Other platforms: not affected.
2022-02-21 20:38:33 +01:00
Albrecht Schlosser
fd8170525b Fix typos and copyright 2022-02-19 12:55:06 +01:00
Albrecht Schlosser
1cdd669dc6 Fix "fl_message_icon() regression" (#395)
Some attributes of the default message icon had not been copied to
the new Fl_Message class when opening a new dialog.

Clarify documentation about supported icon attributes.
2022-02-16 14:50:50 +01:00
silverduner
52bfbbc2fa
expose position(int, int), x(), y(), w() and h() from Fl_File_Chooser (#80)
* expose position(int, int), x(), y(), w() and h() from Fl_File_Chooser for positioning

* exposed size() and resize() in Fl_File_Chooser.
2022-02-12 20:46:12 +01:00
Albrecht Schlosser
f6c2531b5b Enable end user to copy standard dialog text to clipboard (#388)
All standard dialogs like fl_message() now handle command-c (macOS)
and ctrl-c (other platforms) to copy the message text of standard
dialogs to the clipboard as requested by GitHub Issue #388.
2022-02-09 16:33:55 +01:00
ManoloFLTK
01db172010 Fix for issue #373 apparent with macOS platform and SDK ≤ 10.13
Many thanks to @CendioOssman for finding the cure.
2022-02-08 07:16:37 +01:00
Matthias Melcher
db0a1f4bae
OpenGL implementation of all fl_ "Drawing Fast Shapes" graphics calls (#385)
* Fix build system for unites,

* Updated unittest to check OpenGL drawing.

Making sure that OpenGL drawing is exactly the same
as native drawing to make FLTK widget rendering
look the same in GL windows.

* Make OpenGL optional.

* Implemented clipping in OpenGL

* unites drawing fast shapes

* Fixed CMake

* Updating unittest.

Added tests for fl_pi and fl_arc (int)
Renamed tab to render complex shapes.

* Improved OpenGL FLTK drawing emulation.

* Fixed GTK ROUND DOWN BOX

* Fixing Makefile for unittest

* Correctly aligning OpenGL text.

* Fixed text alignment in GL windows.

Explained the "FLTK over GL " example in Cube.

* Overlapping test.

* Better GL graphics alignment.

* Drawing the focus rect.

* Adding Alpha Channel support for GL.

* Added FLTK-on-GL documentation.
2022-02-06 15:22:24 +01:00
Albrecht Schlosser
6f09219c43 CMake: Remove unnecessary file from build system
Remove macOS warning "ranlib: file ... has no symbols".
2022-02-05 21:36:48 +01:00
ManoloFLTK
2ef4a81d18 Minor improvement in Fl_Mac_App_Menu::custom_application_menu_items(). 2022-02-05 09:01:51 +01:00
Albrecht Schlosser
e73f9d466d Rearrange "Print Button Window" functions
- Rename Fl_Screen_Driver::print_or_copy_window() to
    fl_print_or_copy_window()
- Add header file src/print_button.h
- Update dependencies
2022-02-03 21:57:47 +01:00
Albrecht Schlosser
c483c4c5de Fl_Preferences (X11): Fix detection of preferences directory
- Fix compiler warning [-Wmaybe-uninitialized] for variable home
- Reformat enum 'Root' for better readability
- Add new enum values CORE_SYSTEM_L and CORE_USER_L
- Improve documentation (deprecated and new enums)
- Initialize internal static variable 'filename' which could be used
  uninitialized and thus return any previous value (type == MEMORY)
2022-02-03 20:46:13 +01:00
Albrecht Schlosser
80a22e97e8 Fl_Timeout: Remove compiler warning [-Wclass-memaccess]
Also: fix doxygen warning
2022-02-03 19:56:47 +01:00
Albrecht Schlosser
4eaa6dfd0d Remove platform #ifdef from macOS native filechooser 2022-02-03 19:38:33 +01:00
ManoloFLTK
2e6e0b9c36 Reorganize classes Fl_System_Driver and Fl_Screen_Driver
These virtual members are moved from Fl_Screen_Driver to Fl_System_Driver
- wait(double)
- ready()

These virtual members are moved from Fl_System_Driver to Fl_Screen_Driver
- copy(const char *stuff, int len, int clipboard, const char *type)
- void paste(Fl_Widget &widget, int clipboard, const char *type)
- clipboard_contains(const char *type)
- clipboard_notify_change()

These members are moved from Fl_X11_Screen_Driver to Fl_X11_System_Driver
- poll_or_select_with_delay(double time_to_wait)
- poll_or_select()
and are made virtual in preparation for the introduction of class
Fl_Unix_System_Driver.
2022-02-03 07:03:44 +01:00
ManoloFLTK
d9451a8669 Add platform-independent Fl_Screen_Driver::print_or_copy_window().
This member function is available for all platforms to print or copy the front window
with or without its titlebar.
2022-02-02 14:55:48 +01:00
ManoloFLTK
895ac51c69 macOS: add "Toggle printing of titlebar" to application menu - cont'd. 2022-02-02 11:19:09 +01:00
ManoloFLTK
935074ba0b macOS: add "Toggle printing of titlebar" to application menu. 2022-02-02 11:05:53 +01:00
Albrecht Schlosser
ec98dc113f CMake: Fix image libraries build if fallback is used
The CMake instructions would use the wrong image libs (png, jpeg, zlib)
if the fallback was active (OPTION_USE_SYSTEM_XXX) was true but the
header files were not present.

This had already been fixed for jpeg but not for the other two libs.
This commit rearranges the logic for all three libs.

Add information about builtin or system libraries to config summary.
2022-02-01 00:54:42 +01:00
Albrecht Schlosser
29d9e31c51
Consolidate timeout handling across platforms (#379)
Add Fl_Timeout class

Move platform independent code of Fl::wait() to main part

- basic timeout handling
- Fl::run_checks()
- Fl::run_idle()
- Fl::idle()
- waiting time calculation (next timeout)
- remove platform dependent "screen driver" stuff
2022-01-31 22:27:17 +01:00
Matthias Melcher
cf4a832e6a
Adding Text_Display color variables. (#384) 2022-01-30 22:14:40 +01:00
Matthias Melcher
cdb51045dd
Background color attribute for Fl_Text_Display. (#378)
* Background color attribute for Fl_Text_Display.

* Adding attributes.

* Avoid clipping horizontal

* Fl_Text_Display underlining.

* Better line positions

* Typos, testing.

* Documentation.
2022-01-27 23:50:06 +01:00
Matthias Melcher
5d9db35386 Fix for #381, backward function crash
when no menu item is selected.
2022-01-26 17:17:24 +01:00
Matthias Melcher
7308bcdb74
Preferences XDG path (#377)
* Preferences: remove CamelCase from public interface.

* Prefs: documentation.

* Prefs: updating Doxygen comments

* XDG conforming preferences path
2022-01-23 22:35:21 +01:00
Albrecht Schlosser
04ccc8cc46 Remove experimental platforms Android, Pico, SDL (PR #376)
... as discussed in fltk.coredev: "FLTK 1.4.0 release schedule"
https://groups.google.com/g/fltkcoredev/c/PDbHTRpXVh0/m/JqboexZ_AwAJ
2022-01-23 18:12:47 +01:00
Albrecht Schlosser
c0f5080cb0 Fix compiler warnings [-Wunused-variable]
... and missing return value [-Wreturn-type]
2022-01-21 13:38:26 +01:00
Matthias Melcher
09eff7243a
Fixing and upgrading Fl_Preferences (#374)
* Added filename function to Fl_Preferences

Static function to get filename before opening.
Member to get filename after opening.
Bug fixes for memory mapped preferences.

* ERROR is a macro on Windows, don't use it

* Added Fl_Preferences::dirty().

User can now check if the database will be written
when flushed or destroyed.
Flush returns a crude error code.

* Fl_Preferences::get binary data returns # of bytes read.

* Verified group deletion code

* Fl_Preferences ignores locale.

This will make .prefs files interchangeable
between different computers.

* Updating the Preferences Mode to ignore locale.

* Fixes in docs.
2022-01-19 16:08:29 +01:00
Albrecht Schlosser
788ca208f7 Rename FL/Fl_String_class.H to FL/Fl_String.H
This is part 2 of the final fix for a previous name clash on case
insensitive file systems (fl_string.h vs. Fl_String.H).
2022-01-16 19:47:16 +01:00
Albrecht Schlosser
92e9181a0a Rename FL/fl_string.h to FL/fl_string_functions.h
This is part 1 of the final fix for a previous name clash on case
insensitive file systems (fl_string.h vs. Fl_String.H).
2022-01-16 19:47:16 +01:00
ManoloFLTK
8213ba94aa Improve Fl_GTK_Native_File_Chooser_Driver in relation to FLTK windows.
Implement a new way to make the GTK file-chooser window modal-like
by preventing any event processing by other FLTK windows.
The new way is also no longer X11-specific.
2022-01-16 18:49:41 +01:00
ManoloFLTK
0f335ab440 Improve kdialog-based native file chooser.
Processing of all FLTK events as well as window resizing while the file chooser runs is suspended,
Normal event processing and resizing is restored when chooser closes.
2022-01-16 12:33:26 +01:00
ManoloFLTK
ebd0c81f7e Move make_transient() to Fl_Posix_System_Driver from Fl_Screen_Driver 2022-01-14 19:25:17 +01:00
Albrecht Schlosser
ab58971bcf Improve focus box drawing and documentation
Add new method
  Fl_Widget::draw_focus(Fl_Boxtype t, int x, int y, int w, int h, Fl_Color bg)

  ... with background color for correct contrast testing (in Fl_Tabs)

Draw the focus box of the "tabs" of Fl_Tabs widgets with the correct
  boxtype and background color.

Make 'unsigned int visible_focus()' const so it can be used in 'const'
  methods.

Do not draw the focus box if the per-widget focus box option is off.
2022-01-14 17:17:09 +01:00
Greg Ercolano
c45bf57c8f Fixes #369 2022-01-13 18:06:40 -08:00
Greg Ercolano
9c55ad4273 Fixes #362 2022-01-13 15:26:27 -08:00
Greg Ercolano
47cd9a11a0 Fixes issue #361. 2022-01-13 07:28:00 -08:00
ManoloFLTK
9a2b3ef798 Input Method support: have the auxiliary window follow when the focus window is moved. 2022-01-08 17:08:39 +01:00
Albrecht Schlosser
b12ed61548 Remove obsolete (dead) code from Fl_Group.cxx
This code had been inactive at least since Mar 29, 2018.
2022-01-08 16:23:01 +01:00
ManoloFLTK
5bab46940c Re-organize cross-platform support for text input methods.
FLTK 1.3 supports complex text input methods (TIMs) for the 3 platforms
(X11, Windows, macOS). This support has an interface with FLTK that is
common for X11 and Windows, via (undocumented) functions fl_set_spot(),
fl_set_status() and fl_reset_spot().
In contrast, and because it's been developed independently, the
interface between the macOS TIM and FLTK 1.3 is completely different :
static functions FL::insertion_point_location() and Fl::reset_marked_text().

The present change implements a single TIM/FLTK interface
used by all platforms based on functions fl_set_spot() and
fl_reset_spot().

The previous macOS-specific functions FL::insertion_point_location() and
Fl::reset_marked_text() are maintained only for compatibility with 1.3
and deprecated.
2022-01-07 16:34:54 +01:00
ManoloFLTK
27c175dad8 Add virtual void Fl_Graphics_Driver::set_status() and implement for X11 platform. 2022-01-07 07:50:36 +01:00
Albrecht Schlosser
9d474dfcdf Fix whitespace and Makefile dependencies
No code changes
2022-01-05 22:00:54 +01:00
ManoloFLTK
e80a2734e8 Fix build error with CMake when libjpeg???-dev package is absent from the system (Linux).
The error was visible under Linux if OPTION_USE_SYSTEM_LIBJPEG and OPTION_BUILD_SHARED_LIBS are  on.
2022-01-04 16:20:49 +01:00
ManoloFLTK
9164e3c489 Text input method for X11: fix for case when text widget is inside subwindow. 2022-01-02 17:44:55 +01:00
ManoloFLTK
eeb3e92eb2 Fix fullscreen window level corner cases on macOS - cont'd
See long discussion in PR#277 at
https://github.com/fltk/fltk/pull/277
2021-12-29 17:18:47 +01:00
Albrecht Schlosser
e186ee0af3 Fix compiler warning [-Wignored-qualifiers]
In function ‘int glutExtensionSupported(const char*)’:
  warning: type qualifiers ignored on cast result type
2021-12-20 02:03:38 +01:00
Matthias Melcher
0d435d51ac GitHub #328: removed stray ';' in Fluid code generation. 2021-12-20 01:23:59 +01:00
Albrecht Schlosser
e8961f10b8 Update fluid generated and .fl files (remove mac_shell...)
Commit updated .cxx files in src/ with fixed indenting

Remove `mac_shell_*' statements from fluid (.fl) files
2021-12-19 22:45:53 +01:00
ManoloFLTK
47164bf954 Fix for issue #344 : New/Delete Type Mismatch on Windows 2021-12-19 19:49:39 +01:00
ManoloFLTK
4d934e003a Add check against NULL pointer (fix for issue #338). 2021-12-19 08:50:25 +01:00
Albrecht Schlosser
5438954d8c Generate FL/fl_config.h rather than FL/abi-version.h
... as discussed in fltk.coredev in thread "RFC: introduce public
config header <FL/fl_config.h>", see:
https://groups.google.com/g/fltkcoredev/c/xLCs1AIXMVo/m/MHZpQggzAQAJ

- Rename abi-version.h to fl_config.h, rename input files,
  update dependencies, .gitignore, CMake, configure and Makefiles.

- Include Cairo options in FL/fl_config.h

- Rename FLTK_USE_CAIRO to FLTK_HAVE_CAIROEXT for consistency.

- Include <FL/fl_config.h> in config.h and wherever necessary,
  fix include order (move FL/Fl.H to the top) and more.

- Move USE_X11 to fl_config.h and rename to FLTK_USE_X11

- Do not include <config.h> in Cairo demo program which is no
  longer required in Cairo programs since FLTK 1.4.0
2021-12-18 22:44:08 +01:00
Matthias Melcher
6efc997a02
Updated Unicode utf8 byte limit in docs. 2021-12-17 21:27:17 +01:00
Matthias Melcher
d13f9e736c
GitHub #233, documenting style buffers and utf8. 2021-12-17 20:28:47 +01:00
Albrecht Schlosser
55e5c74e9e Fix broken build
sorry for the noise
2021-12-17 19:37:48 +01:00
Albrecht Schlosser
311d9a8ad4 Forms compatibility: use as_window() rather than type()
... and some more improvements and minor changes.

No functionality changes.

Note: this code is used in the fltk_forms library.
2021-12-17 19:00:34 +01:00
Albrecht Schlosser
d6ba66ca4b Fix a tiny documentation bug 2021-12-17 19:00:34 +01:00
ManoloFLTK
93a55f64c3 macOS platform: fix for issue #325 Disabling IM disables Greek and Cyrillic layouts
Thanks to Pierre Ossman who gave the fix.
2021-12-17 16:00:57 +01:00
Albrecht Schlosser
f57b074378 Fix trailing whitespace and a MSVC compiler warning
No code changes
2021-12-14 23:55:21 +01:00
ManoloFLTK
f76e579ffe Windows platform and Input Methods: improve GUI scaling support. 2021-12-14 16:06:25 +01:00
ManoloFLTK
3565aa1e60 Windows platform: account for GUI scaling when using input method. 2021-12-13 10:40:05 +01:00
YX
95d862fd5a Fix IME problem (issue #270) 2021-12-12 17:01:30 +01:00
ManoloFLTK
fae9f03cc9 X11 platform: account for GUI scaling in location of input method aux window. 2021-12-12 16:29:48 +01:00
ManoloFLTK
12d699a650 Win32 platform: add support of "PROCESS_PER_MONITOR_DPI_AWARE" set via manifest. 2021-12-11 16:39:11 +01:00
ManoloFLTK
0a8b1845fe Win32 platform: allow use of manifest to set the app's DpiAwareness level.
This fixes issue #309: FLTK 1.4 does not properly size window when using display scaling on Windows 10.

FLTK now tests whether the app's DpiAwareness has been previously set, presumably
via a manifest, before attempting to set it to FLTK's preferred level DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2
2021-12-11 11:40:02 +01:00
Albrecht Schlosser
a8cc340321 Stabilize resizing of common dialogs like fl_choice()
Thanks to Paul D. Hahn for finding these issues on his very old
"CentOS 6 linux with g++ 5.1" system.

For details see the very long thread "fl_choice() dialog apprearance
discrepancy problem in 1.4" (typo intentionally ignored):
https://groups.google.com/g/fltkgeneral/c/UQk3RRf-l4A/m/0GtPNv1CCQAJ
2021-12-10 17:09:28 +01:00
ManoloFLTK
08e59770aa Remove compiler warnings about unused parameters (issue #307) - cont'd 2021-12-09 11:40:55 +01:00
Albrecht Schlosser
b9c0933de2 Update dependencies (no code changes)
Done after the first large commit of fluid changes.
2021-12-08 19:23:01 +01:00
Matthias Melcher
17c8f73a88 STR 3460.C: Code Properties remembers the editor's scroll bar position. 2021-12-08 18:55:44 +01:00
ManoloFLTK
4bc25f7f9d Fix for issue #278 - continued : add CMake OPTION_USE_KDIALOG
Use of the kdialog command by class Fl_Naive_File_Chooser can now be turned off
at build-time through CMake OPTION_USE_KDIALOG.

If building via configure + make, set #define USE_KDIALOG to 0 in config.h before make.
2021-12-08 09:41:06 +01:00
ManoloFLTK
630517049f Fix for issue #278 - continued
Because kdialog can't select multiple directories, run the GTK chooser
when BROWSE_MULTI_DIRECTORY is used.
2021-12-07 12:57:49 +01:00
ManoloFLTK
663b93a807 Fix for issue #278: Can we use the qt/kde file picker instead of gtk?
Under the X11 platform, class Fl_Native_File_Chooser will behave as follows :
- if the KDE desktop is used and if command "kdialog" is available in the path,
the Qt/KDE file chooser is used;
- otherwise, if the GTK library is available at run-time,
the GTK file chooser is used;
- otherwise, the FLTK file chooser is used.

In addition, when Fl::OPTION_FNFC_USES_GTK is off, the FLTK file chooser
is always used.
2021-12-07 11:24:35 +01:00
ManoloFLTK
939d536b66 Fix for fltk.coredev "reentrant calls with Fl_Window::resize" - cont'd 2021-12-07 10:54:41 +01:00
Albrecht Schlosser
8334abe544 Fix whitespace errors (no code changes)
(1) convert tabs to spaces
(2) remove trailing whitespace
2021-12-06 19:56:40 +01:00
Albrecht Schlosser
39b5ae9e6e Fix Fl_Window::size_range() documentation (STR 3352)
"Tiny window problem if child group larger than window"

See Greg's comment 4: "something is wrong here: either the logic or
the docs are incorrect, not sure which."

It turned out that both were incorrect.

Since we fixed the code this commit completes the STR by fixing the
docs as well so they match the behavior.
2021-12-06 19:49:16 +01:00
ManoloFLTK
8bf62c67cf macOS platform: compute the screen number where a top window is mapped. 2021-12-06 10:18:29 +01:00
Albrecht Schlosser
9154291940 Fix filename in doxygen comment, update dependencies 2021-12-06 00:43:24 +01:00
Greg Ercolano
74dd5164d3 Fixes STR #3352: "tiny window problem if child group larger than window" 2021-12-05 12:26:25 -08:00
Albrecht Schlosser
cf58f7ae2b Fix MSVC compiler warnings 2021-12-05 21:00:15 +01:00
Albrecht Schlosser
a0724ab7c4 Add fl_message_icon_label() function (STR #2762)
This message icon label (usually one character) will be used in the
next call of one of the common dialogs.

test/ask.cxx: use fl_message_icon_label()
2021-12-04 20:36:11 +01:00
Albrecht Schlosser
130f864d1d Rename src/Fl_String.cxx to src/Fl_String_class.cxx
Sorry for the noise, still fixing a name class on case-insensitive
file systems (macOS and Windows).
2021-12-04 15:50:10 +01:00
Albrecht Schlosser
7a7e50df6e Rename FL/Fl_String.H to FL/Fl_String_class.H
The previous name existed already with different case (fl_string.h)
in the FL folder which broke the build on macOS and Windows.

This may be a temporary fix - until I find a better way.
2021-12-04 15:34:41 +01:00
Albrecht Schlosser
b6de09cff2 Re-enable nested (aka recursive) common dialogs (STR 3242, #282)
Apply Fl_Dialog_r10831.patch as given in STR 3242:
https://www.fltk.org/strfiles/3242/Fl_Dialog_r10831.patch

Reformat, add missing pieces, rename private members, cleanup...

Improve documentation, add fl_choice_n() (issue #282)

New methods fl_input_str() and fl_password_str() return Fl_String
2021-12-04 14:49:27 +01:00
Albrecht Schlosser
2404656266 Add minimal version of class Fl_String
This class will be used in fl_input_str() and fl_password_str().

Todo: add missing documentation ...
2021-12-04 13:40:29 +01:00
ManoloFLTK
596a937530 PostScript output: initialise member variables in Fl_Cairo_Graphics_Driver constructor.
Also, remove inadequate Fl_Surface_Device::push_current(this) call in Fl_Posix_Printer_Driver::begin_job().
2021-12-02 10:54:40 +01:00
ManoloFLTK
2db94dcb4c Hack to restore "configure --enable-x11" on macOS ≥ 11
Since macOS 11, configure --enable-x11 (and the equivalent with CMake)
fails when compiling fl_write_png.cxx in parsing of time.h.
The error happens only if png.h is included without time.h having
been included before.
The fix is to #include time.h before png.h

A better fix than his hack is desirable.
2021-12-01 13:38:55 +01:00
Greg Ercolano
36af6a5729 Solves Fl_Tree focus box artifacts on linux - fixes issue #299.
Nabbed the current code from Fl_Widget::draw_focus() which solves.
2021-11-27 10:20:47 -08:00
Greg Ercolano
84c09ae7b2 Fixes #297 - improvements for icon.cxx + icon() docs 2021-11-26 13:13:58 -08:00
ManoloFLTK
390fa9caa7 Fix for issue #254: remove hardware overlay support - cont'd. 2021-11-26 15:28:43 +01:00
ManoloFLTK
25eed24172 Removed following removal of support for X11 hardware overlay (issue #254) 2021-11-26 15:21:41 +01:00
ManoloFLTK
eb8b016fab Fix for issue #254: remove hardware overlay support . 2021-11-26 15:16:15 +01:00
ManoloFLTK
84cf249482 Fix for issue #253: Remove xdbe support 2021-11-26 15:01:54 +01:00
ManoloFLTK
2f50640732 X11+XRender platform: more accurate drawing of RGB images when GUI is scaled.
RGB images are now drawn to a size that exactly fit discretised rectangles when non
integral GUI scaling values are used.
2021-11-25 11:19:10 +01:00
ManoloFLTK
bf470919f7 Fix X11 platform bug when drawing transparent RGB image without XRender.
The bug would appear with test/device and when scaling up to 133% or above:
the background of the Porsche pixmap would be truncated.
The bug requires to set OPTION_XRENDERER=0 to appear.
2021-11-25 09:12:08 +01:00
Greg Ercolano
a900411ee2 Better solution for issue #296 2021-11-24 15:13:04 -08:00
Greg Ercolano
e97fd17e04 Solves Fl_Table_Row warning in issue #296 2021-11-24 14:57:44 -08:00
ManoloFLTK
7e484c614c Fix for [fltk.coredev] reentrant calls with Fl_Window::resize 2021-11-24 10:35:18 +01:00
Albrecht Schlosser
1ce3a84e9f Refactor and improve "Print front window" dialog
src/print_button.cxx: "Print front window" implementation (new file)

This is compiled and activated if USE_PRINT_BUTTON is defined.

The feature can be fine controlled by environment variable
  'FLTK_PRINT_BUTTON' (see docs in source file).
2021-11-19 18:50:53 +01:00
Albrecht Schlosser
4d31c5bd4f Fix doxygen docs of fl_draw_check()
.. as pointed out by Ian in fltk.coredev. Thanks.
2021-11-19 14:29:46 +01:00
Albrecht Schlosser
e6683d48e9 Disable check mark debugging 2021-11-18 15:14:22 +01:00
Albrecht Schlosser
0bc06e8f1a Reformat and move clipboard demo from examples to test folder
The clipboard demo is more a test program than an example and very
useful even if the examples are not built.

Also update dependencies.
2021-11-18 13:44:41 +01:00
ManoloFLTK
02754e43ce Fix Fl_Window::decorated_w() in some X11 situations. 2021-11-17 15:00:21 +01:00
ManoloFLTK
397226b75d Add use of fl_capture_window() by test/device
Also, rename fl_capture_window_part() to fl_capture_window().
2021-11-16 15:03:36 +01:00
Albrecht Schlosser
b2979b6425 Reformat to FLTK style, improve documentation
No code changes.

Replace '#define fl_clip ..' with an inline method.
2021-11-16 00:02:16 +01:00
Albrecht Schlosser
e4d8b94102 Add fl_draw_check() to draw better check marks (issue #68)
This new function can and should be used to draw check marks
in widgets that need it, e.g. Fl_Check_Browser (issue #68) and
Fl_Check_Button.
2021-11-15 14:41:31 +01:00
Albrecht Schlosser
d96c980d29 Fix "failed to build with pango libarary" (issue #291)
The error was reported for "centos 6 with devtoolset-6 installed
which contains gcc (GCC) 6.3.1 20170216 (Red Hat 6.3.1-3)".

The fix includes the missing header files *and* makes sure that the
correct conversions (to size_t) take place as in
src/drivers/PostScript/Fl_PostScript_image.cxx.
2021-11-14 13:06:25 +01:00
Albrecht Schlosser
6d1f5608ba Support all image depths (1-4) in fl_write_png() 2021-11-11 20:58:09 +01:00
Albrecht Schlosser
500e470d39 Refactor fluid: make fl_write_png() public
The new function fl_write_png() was moved to its own file and is now
publicly available ("exported") so other programs can use it.

This function was used in fluid to write a window screenshot (.png)
together with a template (.fl) to preferences storage.
2021-11-09 20:36:23 +01:00
ManoloFLTK
76a3ded549 Fix for issue #279 about detecting early retina with GL windows. 2021-11-05 15:21:56 +01:00
Albrecht Schlosser
a0654b59ac Fix X11 build with FLTK_CONSOLIDATE_MOTION turned off 2021-11-05 13:12:52 +01:00
Albrecht Schlosser
0ad192a27b Make "FLTK_CONSOLIDATE_MOTION" user-definable (issue #76)
This undocumented macro is used on X11 and macOS platforms to
consolidate mouse move events, i.e. to collect some events and send
them later as one event. The old macro name CONSOLIDATE_MOTION has been
renamed to FLTK_CONSOLIDATE_MOTION since it is now a "global" symbol.

Users can define FLTK_CONSOLIDATE_MOTION in their build system, e.g.
on the compiler commandline, as 0 or 1 to disable or enable this
feature, respectively.

In FLTK 1.3 the default was 0 (OFF) on macOS and 1 (ON) on X11.
In FLTK 1.4 the default is always 0 (OFF).
2021-11-05 12:46:21 +01:00
ManoloFLTK
995a48dd00 Consistently make Fl_Paged_Device::begin_page call Fl_Surface_Device::push_current. 2021-10-31 14:20:04 +01:00
Albrecht Schlosser
4d88fb6fbc Fix focus box drawing on X11 (partial fix for issue #156)
This fixes focus box drawing on X11 for some broken graphics
drivers with line width zero as discussed on issue #156 titled
"Incorrect rendering on Alpine Linux".

This title is not entirely correct. The issue has been observed on
other Linux distros as well if the "modesetting" driver is in effect.

This does not fix rectangle drawing (missing pixels) in general which
is obviously caused by a similar or the same driver issue.
2021-10-27 21:05:28 +02:00
Albrecht Schlosser
14f842708d Fix indenting, whitespace errors and dependencies
(no code changes)
2021-10-27 20:52:08 +02:00