Commit Graph

6382 Commits

Author SHA1 Message Date
Matthias Melcher
c827292ec9 Fix forgotten name change 2022-11-27 15:35:50 +01:00
ManoloFLTK
acf7254fe8 macOS+OpenGL3: remove "warning: gl.h and gl3.h are both included" 2022-11-27 08:06:33 +01:00
Albrecht Schlosser
8ec935b4ce Simplify and improve "oxy" arrow drawing functions
- change drawing arrows from lines to polygons
- remove superfluous functions
- add more comments
2022-11-26 21:56:38 +01:00
Matthias Melcher
87fe29372c
Local undo per Fl_Text_Buffer and Fl_Input_ (#557) 2022-11-26 20:28:12 +01:00
Albrecht Schlosser
191aeefc4a Make the value box size of Fl_Value_Slider user settable (STR 3222)
For a very simple test program see STR 3222, File 2:
https://www.fltk.org/strfiles/3222/value_slider.cxx

Known issues:
 - range checking of the value box size is very limited
 - resizing the widget does not change the value box size
 - drawing issues are possible if the value box size and the widget
   size are not compatible (e.g. value box too large)
2022-11-26 19:56:32 +01:00
Matthias Melcher
6e5c472cf9
Handle Fluid project settings better (#556)
Fix allocation bug in Fl_String
2022-11-26 01:35:50 +01:00
ManoloFLTK
4de491d02e Make Fl_XXX_Graphics_Driver::create_bitmask() a static member function 2022-11-25 15:53:28 +01:00
Albrecht Schlosser
cda501f914 Fix silly Visual Studio compiler warnings in oxy scheme 2022-11-25 15:09:30 +01:00
Matthias Melcher
ffc2caea07 Avoid thin gray line in round box in hires 2022-11-25 12:53:54 +01:00
Matthias Melcher
09697c4738 Fix GDI graphics driver use for bitmasks 2022-11-25 10:52:46 +01:00
Albrecht Schlosser
b1ba37c5ba Add "Oxy" scheme (STR 2675, STR 3477)
This commit is similar to the patch given in STR 3477, oxy_v5.diff:
https://www.fltk.org/strfiles/3477/oxy_v5.diff

... with modifications, and updated to current FLTK code.
2022-11-25 00:00:48 +01:00
Albrecht Schlosser
40f376a6f7 Fix two new Visual Studio compiler warnings 2022-11-24 17:29:26 +01:00
ManoloFLTK
c3011e32e4 Improve text drawing above GL3 scene under macOS 2022-11-24 15:48:39 +01:00
ManoloFLTK
be0f06e791 Remove two "warning: pointer xxx used after void* realloc()" messages 2022-11-24 14:35:47 +01:00
Albrecht Schlosser
c1ba9f31ec Fix two Visual Studio compiler warnings
+ fix trailing whitespace (fluid)
2022-11-24 12:51:26 +01:00
Matthias Melcher
b16309f13e
Refactor code to make rounded rectangles accessible (#553)
This adds fl_rounded_rect and fl_rounded_rectf so the
user can draw rounded rectangles. This uses existing and
optimised code that is rearranged.
2022-11-24 12:47:49 +01:00
Matthias Melcher
12dccaf711
Check boundary conditions in Cocoa scroll code (#554) 2022-11-24 12:44:08 +01:00
ManoloFLTK
e19d2d98ba OpenGL3 under macOS: simpler implementation of support of child widgets 2022-11-24 09:13:40 +01:00
ManoloFLTK
b6c5de7c05 Restore build with HAVE_GL = 1 and HAVE_GL_GLU_H = 0 2022-11-23 18:12:33 +01:00
ManoloFLTK
27a6fd9609 Configure-based build: control presence of GL-related packages 2022-11-23 17:24:59 +01:00
Albrecht Schlosser
b684f70ad7 Update remaining "arrow drawing" in menus
Use the new standard arrow drawing methods (whose style depends on
the active scheme) for "arrows" used in Fl_Menu and Fl_Menu_Button.

To do: maybe we need some "fine tuning" of arrow sizes in some of
the modified widgets using the new "arrow drawing" methods.
2022-11-23 15:21:34 +01:00
Albrecht Schlosser
5e4643621b Save and restore current color when drawing arrows
Make sure we don't change the current color after we finish drawing.
2022-11-23 15:21:34 +01:00
Albrecht Schlosser
bd18d9de26 Fix border size of FL_PLASTIC_UP_BOX 2022-11-23 15:21:34 +01:00
Matthias Melcher
35f2827d1f
Keep indicator that menubar is still active (#551) 2022-11-23 12:33:14 +01:00
ManoloFLTK
42b74919e5 Improve Fl_Cocoa_Gl_Window_Driver::switch_to_GL1() to support multiple GL3 windows 2022-11-23 11:59:49 +01:00
Matthias Melcher
73b24c2104
Add missing FL_RELEASE event after dnd() (#549)
On X11, FLTK would not send a required FL_RELEASE
event to the data source window.
2022-11-23 10:33:34 +01:00
ManoloFLTK
d215ddef81 Fix for issue #412 for the Wayland backend
The problem was that after a drag-n-drop within a window, text selection
by shift+arrow key stopped working.

Also, improves drag-n-drop within a window by leaving insertion point
at end of dragged text.
2022-11-23 09:33:41 +01:00
ManoloFLTK
4dcced5b29 Wayland+CMake: stop forcing GTK_FOUND to 0
This removes the cause of this developer's message
  # FIXME: This needs to be redesigned! Forcing GTK_FOUND to 0 (NO) is a bad
  # FIXME: idea because there could be unwanted side effects. AlbrechtS
2022-11-23 05:59:57 +01:00
Albrecht Schlosser
39bb38447b Update dependencies 2022-11-22 19:35:34 +01:00
Albrecht Schlosser
ecc47d0cc3 Refactor and simplify "arrow drawing" in widgets
"Arrows" in widgets are those GUI elements mostly represented by
triangles pointing in a particular direction as in scrollbars,
choice widgets, some menus, valuators and Fl_Counter widgets.

The code has been simplified and standardized such that all these
GUI elements are drawn identically per FLTK scheme.

Widget authors no longer need to write code to calculate arrow sizes
and draw polygons etc.

Different schemes can and do implement different drawing functions.

Todo: see comments "FIXME_ARROW" in src/Fl_Menu_Button.cxx and
      src/Fl_Menu.cxx
2022-11-22 19:32:54 +01:00
ManoloFLTK
4daec2a940 macOS: Fix release of extra NSView holding child widgets of GL window 2022-11-22 19:18:29 +01:00
Matthias Melcher
495b2395c1
Fix selection extension in Fl_Text_*, issue 196 (#550)
Selecting a text range programmatically would not sync
some variables with the actual selection. This also fixes
a crash bug in macOS when dragging text that was
selected by buffer()->select() only.
2022-11-22 16:18:56 +01:00
Albrecht Schlosser
be928430a6 Fix Fl_Group::insert() and Fl_Scroll::on_move() 2022-11-20 14:11:19 +01:00
ManoloFLTK
8a53fc9611 Replace #if FLTK_USE_X11 by #ifdef FLTK_USE_X11 2022-11-20 07:33:08 +01:00
ManoloFLTK
615b731783 CMake+Wayland: check for presence of required software modules
Also, remove hardcoded path to wayland-protocols when
CMake version ≥ 3.4
2022-11-18 09:10:22 +01:00
Matthias Melcher
72415b534d
Fix rearranging children in Fl_Scroll (#546)
Implement Fl_Scroll::on_move()
Fix indexing in Fl_Group::on_move()
2022-11-17 08:34:06 +01:00
ManoloFLTK
402764f5c1 Remove development stage "Using Wayland backend" message 2022-11-17 07:31:37 +01:00
ManoloFLTK
167a3268c9 Fix "Cairo: Scaled images draw with wrong size" (#537) 2022-11-17 07:14:20 +01:00
Albrecht Schlosser
624eda17bc Fix whitespace errors and dependencies
(no code changes)
2022-11-16 21:10:14 +01:00
ManoloFLTK
7f8f7c5b85 Add support of .svgz image files to fluid
The  prototype of the public Fl_SVG_Image constructor is expanded
to allow construction from in-memory, gzip'ed binary data.
2022-11-15 10:09:01 +01:00
Albrecht Schlosser
d1054c5f6c Fix yet another Visual Studio compiler warning 2022-11-14 19:08:02 +01:00
Matthias Melcher
350038983f Removed FIXME comment that was already solved. 2022-11-12 15:19:08 +01:00
Albrecht Schlosser
8d636d931e Fix Visual Studio compiler warnings 2022-11-11 19:27:00 +01:00
Albrecht Schlosser
74b9d5fb05 Remove redundant doxygen docs of fl_beep()
Also add a comment to all platform driver implementations.
2022-11-11 16:52:08 +01:00
Albrecht Schlosser
a3a60ed27c Improve and clarify documentation of fl_beep() 2022-11-11 16:43:33 +01:00
ManoloFLTK
f41861976b Wayland: remove unneeded friend declarations 2022-11-09 15:49:02 +01:00
Matthias Melcher
3ff8a4ae8a Fixed uninitialised variable. 2022-11-09 01:34:52 +01:00
ManoloFLTK
1a41178e77 Wayland: improve processing of the -display command line argument 2022-11-08 08:16:55 +01:00
ManoloFLTK
402b08cb6e Wayland: show keyboard modifiers during mouse clicks (#534) 2022-11-08 08:09:12 +01:00
ManoloFLTK
9c793a383f Wayland: cancel drag-n-drop after Fl::pushed(0) (#525) 2022-11-08 07:22:16 +01:00
Greg Ercolano
d68f927a13 Document Fl_Multiline_Output keynav and caret cursor 2022-11-07 17:08:14 -08:00
Greg Ercolano
89e1aad897 Removed an obsolete \warning. 2022-11-07 11:28:52 -08:00
Greg Ercolano
2a43a12b7b Added empty(), ensure size() enlarges new vals = 0 2022-11-07 10:33:35 -08:00
ManoloFLTK
38536d8918 Fix initialisation of hybrid Wayland/X11 platform
Also, terminate Wayland drag-and-drop operation after Fl::pushed(0).
2022-11-07 09:02:22 +01:00
ManoloFLTK
089584da9f Remove Fl_X11_System_Driver.{H,o} 2022-11-07 07:08:42 +01:00
ManoloFLTK
6e9f72adce Delete src/drivers/X11/Fl_X11_System_Driver.* 2022-11-07 06:54:09 +01:00
ManoloFLTK
c6a854ef91 Delete src/drivers/Wayland/Fl_Wayland_System_Driver.* 2022-11-07 06:50:59 +01:00
ManoloFLTK
37bf3835b0 Create class Fl_Unix_Screen_Driver used by X11 and Wayland platforms 2022-11-07 06:49:40 +01:00
Greg Ercolano
8b72f0c668 Add doxygen docs for Fl_Int_Vector.
While adding the docs, noticed some things that need modification
for proper public use. These are highlighted as \todo items and
\warning items, which will be fixed in a separate commit forthcoming. -erco
2022-11-06 20:21:46 -08:00
DieSkaarj
38d40365f8
Check for child visibility in Fl_Scroll (#432)
Calculate scroll area only according to visible children.

Note: "visible" means in this context: "not hidden" - as opposed
to being invisible because the widget doesn't have a background
and a label.
2022-11-06 18:34:42 +01:00
Albrecht Schlosser
f904f4c4ec Fix Fl_Help_View <OL> numbers (Issue #153, STR 3290)
Started with @wcout's patch (see Issue #153, STR 3290), modified
patch for CMP conformance, restructured methods, and finally:

- used Fl_Int_Vector instead of 'fl_data_container'
- removed fl_data_container

Thanks for the working patch to @wcout.
2022-11-06 16:40:17 +01:00
Albrecht Schlosser
bb7129dae2 Use the new Fl_Int_Vector class in Fl_Table
Replace local IntVector with Fl_Int_Vector
2022-11-06 16:32:29 +01:00
Albrecht Schlosser
8b92935b1e Add Fl_Int_Vector: "an STL-ish vector without templates"
Code copied from Fl_Table and reformatted.

Thanks to Greg for the original code.
2022-11-06 16:32:29 +01:00
ManoloFLTK
44219594d1 Check return value from call to gtk_init_check() 2022-11-06 08:11:05 +01:00
ManoloFLTK
6ccd71697d Allow using native file chooser on Darwin + XQuartz + (homebrew or fink) 2022-11-06 07:58:38 +01:00
ManoloFLTK
4b945a3086 Wayland/X11 hybrid: use "bool fl_disable_wayland;" declaration. 2022-11-05 19:47:37 +01:00
Albrecht Schlosser
b426a3d7c0 Fix two rare potential bugs (NULL pointer dereferencing)
Both bugs can happen if a widget doesn't have an associated window()
or in similar situations. These fixes returns NULL to prevent crashes.

Bugs observed in special test scenarios, not real-life programs.
2022-11-05 19:31:59 +01:00
ManoloFLTK
918395e091 Wayland: simpler handling of the z-order of subwindows
It's not necessary to call wl_subsurface_place_above() because
"A new sub-surface is initially added as the top-most in the stack of its siblings and parent."
2022-11-05 15:28:39 +01:00
ManoloFLTK
425bd5865d Wayland DnD: make insertion cursor follow DnD cursor. 2022-11-04 15:06:45 +01:00
ManoloFLTK
eb679f99a8 Wayland DnD: allow cancel with Fl::pushed(0) as under X11 (#525)
This is a partial fix of issue #525 that reproduces under Wayland the "unofficial",
X11-specific way to cancel a Dnd operation by calling Fl::pushed(0).
2022-11-04 12:37:26 +01:00
Albrecht Schlosser
2446ec5d62 Implement Fl_Scroll::on_insert()
This fixes the scrollbar order when children are inserted rather than
at some indefinite time later, for instance in draw().

This commit will very likely make Fl_Scroll::fix_scrollbar_order()
obsolete but this method is kept as is for tests and verification.
2022-11-03 19:11:59 +01:00
Albrecht Schlosser
0ebb113584 Implement destructor of Fl_Scroll and fix inconsistencies 2022-11-03 18:58:28 +01:00
ManoloFLTK
a5d2b5ed45 libdecor: update from source git repo (commit e87dcfda)
This brings the GTK plugin inside the master libdecor git repo.
2022-11-03 08:16:49 +01:00
Matthias Melcher
33f01ecb83
Added Fl_Group::on_insert/on_remove/on_move (#527) 2022-11-01 20:45:31 +01:00
Albrecht Schlosser
c570bd8f96 Fix trailing whitespace 2022-11-01 20:06:22 +01:00
Albrecht Schlosser
414ad1dce7 Remove unnecessary include files, update dependencies 2022-11-01 20:04:37 +01:00
Albrecht Schlosser
a09b0e2357 Remove reversal of children in Fl_Group::clear()
See implementation note in src/Fl_Group.cxx: Fl_Group::clear().
2022-11-01 17:25:07 +01:00
Matthias Melcher
93ea93ee2b
Fluid support for Fl_Flex (#523) and some Fl_Flex improvements
* Adding Fluid support for Fl_Flex, margins, and gap.

* Fluid Fl_Flex mostly working. Fixed in Fl_Flex::set_size().

* Fluid Flex live mode works, interactive dragging works

* Fluid Flex: adding check box for fixed children

* Fluid Flex: visual flexibility indicator in guides.

* Fluid Flex: bug in generated code.

* Fix formatting

* Fixing Tooltip, fixing resize issue PR #518.

* Removing unused variables.

Co-authored-by: Albrecht Schlosser <albrechts.fltk@online.de>
2022-11-01 13:30:05 +01:00
ManoloFLTK
31ec6f623a Wayland platform: fix problem with fl_pie() (#512 - cont'd) 2022-10-30 11:46:08 +01:00
ManoloFLTK
7403e333da Wayland platform: fix problem with fl_pie() (#512 - cont'd) 2022-10-30 11:33:10 +01:00
Albrecht Schlosser
a918292547 Fix removal and deletion of the resizable() of Fl_Group
If the resizable() of an Fl_Group is deleted it is automatically
removed from the group.

New: to avoid dangling resizable() pointers the resizable widget
is set to the group itself.
2022-10-28 17:37:18 +02:00
ManoloFLTK
f9acdb6edb Repair commit e0c3fe9 to fix #521 which destroyed DnD from Wayland
It turns out it's necessary to memorize 2 event serial numbers :
- serial changed at each pointer and key event;
- pointer_enter_serial changed when pointer enters a surface
because this one and not any other is needed for exact cursor changes
by wl_pointer_set_cursor() in do_set_cursor().
2022-10-25 19:08:12 +02:00
ManoloFLTK
84cdc1ba12 Fix drag-n-drop from X11 FLTK app to Wayland app (#519) 2022-10-25 15:00:51 +02:00
ManoloFLTK
e0c3fe939f Fix problem with cursor point of action after FL_PUSH (#521) 2022-10-25 10:44:36 +02:00
ManoloFLTK
b0d4c2fd4c Include stdint.h may be needed for uint32_t (#522) 2022-10-24 05:30:33 +02:00
ManoloFLTK
e69d45cde8 Make Fl::display(const char *) active also for the Wayland platform. 2022-10-23 12:19:44 +02:00
Albrecht Schlosser
da11526bb8 Improve and clarify documentation of timeout functions
Some functions didn't document the handling of arguments properly,
particularly Fl::has_timeout() and Fl::remove_timeout().

This is now fixed by documenting the correct behavior that was
preserved (re-implemented) from FLTK 1.3.x in the new class Fl_Timeout.

Unfortunately there have been some inconsistencies (likely unexpected
behavior) which have been preserved and which are now documented.
2022-10-20 19:36:03 +02:00
ManoloFLTK
eca61ab98a Wayland drag-n-drop: send FL_DND_LEAVE when the dragging mouse leaves the window 2022-10-20 08:30:54 +02:00
ManoloFLTK
24c63c0774 Wayland drag-n-drop: handle subwindows as other platforms do (#516)
The d-n-d target window is now always the top-level window even if the
mouse is over a subwindow. That's what all other platforms do.
Global var fl_dnd_target_surface memorise what's the current d-n-d target
surface and follows changes from top-window to subwindows.
2022-10-19 12:28:04 +02:00
ManoloFLTK
857462529b Allow DnD from Wayland FLTK app to X11 FLTK app (#516) 2022-10-17 19:16:01 +02:00
ManoloFLTK
a944758aea Wayland drag-n-drop to Fl_Window: send necessary FL_ENTER event (#516)
Drag-n-drop under Wayland was OK in general except when the drop target is an Fl_Window
because the belowmouse object is not set in this configuration.
Processing an FL_ENTER event before the FL_DND_RELEASE event fixes that.
2022-10-17 10:32:41 +02:00
Albrecht Schlosser
723d8caa9d Fix "Fl::focus() changes Fl_Group::current() to null" (#515)
This issue is caused by setting `Fl_Group::current(0);` in
Fl_Window::show(), i.e. in Fl_X::make_xid(..) in an attempt to
fix a "very common user bug: forgot end()". As long as this is
done, this commit fixes the issue.

For details see GitHub issue #515.
2022-10-16 23:23:04 +02:00
ManoloFLTK
260a446609 macOS + homebrew: restore building with CMake's OPTION_APPLE_X11
These option combinations work:
-DOPTION_APPLE_X11
-DOPTION_APPLE_X11 -DOPTION_USE_CAIRO

But
-DOPTION_APPLE_X11 -DOPTION_USE_PANGO
is not possible because homebrew doesn't provide the pangoxft package.
2022-10-16 08:29:59 +02:00
ManoloFLTK
531ab614e2 Make sure display is open when using native file chooser (#514) 2022-10-14 15:38:22 +02:00
ManoloFLTK
42887c0619 Fix regression in "configure --enable-shared" introduced at c96a4f3 2022-10-13 09:31:49 +02:00
ManoloFLTK
87c8b98a98 Wayland platform: fix for issue #512 with fl_arc(). 2022-10-12 06:12:07 +02:00
ManoloFLTK
1df79078b7 Remove duplications between Fl_Graphics_Driver and derived classes. 2022-10-10 16:58:48 +02:00
ManoloFLTK
e4709b837d Fl_Cairo_Graphics_Driver: fix Fl_Bitmap drawing whatever the endianness. 2022-10-10 11:31:02 +02:00
ManoloFLTK
7fa677f93e Fix for issue #511: allow fl_circle() even without calls to fl_begin/end_loop/polygon(). 2022-10-10 07:08:00 +02:00
ManoloFLTK
cae2b2883b Fl_Cairo_Graphics_Driver: make image drawing correct whatever the host endianness. 2022-10-09 22:45:58 +02:00
Albrecht Schlosser
2a856dafd4 Remove superfluous center alignment from images
Doxygen uses a <div> with center alignment for images, hence
adding HTML center alignment for image is not only superfluous
but was also inconsistent.

Also removed some more unnecessary HTML tags, updated copyright year.
2022-10-09 19:35:20 +02:00
ManoloFLTK
1a5d6572e9 Fix issue #510: image transparency is not properly processed. 2022-10-09 17:43:06 +02:00
Albrecht Schlosser
4d17cf310d Fix documentation of Fl_Timeout::insert() 2022-10-09 14:30:32 +02:00
ManoloFLTK
e9719e5416 Update window icon-related doc in platform-specific section. 2022-10-06 15:07:39 +02:00
ManoloFLTK
5f189aa213 Make Windows-specific HICON-using functions visible in doc. 2022-10-06 13:15:16 +02:00
ManoloFLTK
6732044a07 Fix use of several FLTK widgets above an GL scene.
The code failed with 2 or more widgets when FLTK would trigger
partial redraws of the widgets, unless the Fl_Gl_Window was FL_DAMAGE_ALL.

This commit also adds a second FLTK widget to example/OpenGL3test to
check this multiple widget situation, and fixes an error where operator ! was used
instead of ~ .
2022-10-06 08:43:09 +02:00
ManoloFLTK
206d9b17e0 Fix issue #509: Cairo drawing: unexpected behaviour
This commit fixes " "drawing an fl_pie() with dimension 1x1".
But it does not change "drawing fl_line() with begin position = end position does not show"
because the same behaviour is observed with Windows and macOS.
2022-10-05 08:52:30 +02:00
ManoloFLTK
30efed7fd4 Revert 75016cb because it doesn't work well with macOS < 13.0
The problem is visible with test/tile when moving the sub window's border.
This also fixes issue #508
2022-10-03 10:21:39 +02:00
ManoloFLTK
4b70bc32c5 Add missing return value to Fl_WinAPI_Gl_Window_Driver::create_gl_context() 2022-10-02 21:37:35 +02:00
ManoloFLTK
1fc23f8506 Clean use of virtual GLContext Fl_Gl_Window_Driver::create_gl_context(). 2022-10-02 13:35:53 +02:00
ManoloFLTK
abc6709e8e macOS: simpler way to delete the GL1 context of widgets-using GL3 windows. 2022-10-02 08:40:38 +02:00
ManoloFLTK
63a7942a66 macOS: support 5 more keys as Fl_Sys_Menu_Bar item shortcuts. 2022-10-01 13:28:52 +02:00
ManoloFLTK
4196daa77e macOS: fixed problem in resizing of widget-containing OpenGL 3 window. 2022-10-01 07:31:42 +02:00
ManoloFLTK
0627213a82 FLTK widgets in OpenGL 3 windows: rewrite for driver system. 2022-09-30 19:25:23 +02:00
ManoloFLTK
a61d8fb682 macOS: simpler code for auxiliary NSView supporting widgets on a GL3 window. 2022-09-30 16:20:51 +02:00
ManoloFLTK
4f6965d39f Support of FLTK widgets in OpenGL 3 windows under Windows. 2022-09-30 15:53:05 +02:00
ManoloFLTK
75016cb853 macOS: implement (BOOL)[FLView isOpaque] to improve drawing performance. 2022-09-30 09:03:54 +02:00
ManoloFLTK
63dcdcec0a macOS: support FL_Up,FL_Down,FL_Left,FL_Right system menu item shortcuts 2022-09-30 07:36:07 +02:00
ManoloFLTK
c96a4f3141 macOS platform: rename Fl_Cocoa_Gl_Window_Driver.cxx to .mm 2022-09-29 16:25:14 +02:00
ManoloFLTK
da66e21e1d Support of FLTK widgets in OpenGL 3 windows - cont'd.
This commit allows to switch between FL_DOUBLE / FL_SINGLE modes
in widget-containing GL3 windows.
Demo program examples/OpenGL3test is modified to show FLTK widgets
even if the platform does not support OpenGL 3.
2022-09-29 09:39:21 +02:00
ManoloFLTK
c2efb0d849 macOS: support of FLTK widgets in OpenGL 3 windows - cont'd.
This code is OK under macOS 10 9 and 13.
2022-09-28 17:06:00 +02:00
ManoloFLTK
7d58e23854 macOS: add necessary setWantsBestResolutionOpenGLSurface:YES message. 2022-09-28 08:23:36 +02:00
ManoloFLTK
3225afaeec Remove use of class Fl_Window_Driver inside libfltk_gl 2022-09-27 16:51:35 +02:00
ManoloFLTK
3ba09047e2 Use PR #507 by @ggarra13 to fix issue #85. 2022-09-27 14:48:22 +02:00
ManoloFLTK
59fc60ea4c Simpler code to support FLTK widgets in macOS OpenGL 3 windows.
Also, the application-level code to add widgets to a GL3 window becomes
platform-independent.
2022-09-27 14:12:39 +02:00
ManoloFLTK
2ffd4e4f1a Replace all calls to sprintf() by calls to snprintf(). 2022-09-26 16:12:18 +02:00
ManoloFLTK
53d9614adb Fix crash under macOS 13 Ventura public beta 6 when closing menu window.
Bizarrely, an NSMouseEntered event arrives returning nil to [event window]!
2022-09-26 10:46:50 +02:00
ManoloFLTK
89f9671b40 Add cross-platform support for adding widgets to an OpenGL3-based Fl_Gl_Window.
Under non-macOS platforms, the key is to call glUseProgram(0); after having used OpenGL 3
which allows to then use OpenGL 1 and draw FLTK widgets over the OpenGL3 scene.

Under macOS, this is impossible because macOS GL3 contexts are not compatible
with GL1. The solution implemented here is to create an additional Fl_Gl_Window
placed above and sized as the GL3-based window, to give it a non opaque,
GL1-based context, and to put the FLTK widgets in that additional window.
2022-09-25 16:39:40 +02:00
ManoloFLTK
bfba62a8a2 GL3 for macOS platform: allow creation of GL1 and GL3 contexts by an app. 2022-09-23 18:21:29 +02:00
ManoloFLTK
0fdc88d2d7 GL3 support under X11: ask for compatibility profile if possible. 2022-09-23 18:09:40 +02:00
ManoloFLTK
eb0bba4058 Fix Fl_X11_Window_Driver::fullscreen_on() and Fl_X11_Window_Driver::fullscreen_off(). 2022-09-23 14:25:32 +02:00
ManoloFLTK
4b6468a80c Wayland: process OPTION_USE_WAYLAND for Unix only 2022-09-23 07:42:04 +02:00
ManoloFLTK
8bbedd65a8 Fix issue #501: build error under macOS 10.10 2022-09-22 20:12:40 +02:00
ManoloFLTK
647b0a8008 Wayland: fix window closing with titlelbar close button. 2022-09-22 10:51:46 +02:00
ManoloFLTK
eb314f5653 Allow use of Fl_Window::default_icon() with a scaled image - Part 2.
Default icons are handled according to their scaled size, if there scaled.
2022-09-17 09:03:34 +02:00
ManoloFLTK
699cca8ff4 Make Fl::set_color(r,g,b,a) effective under Wayland and macOS. 2022-09-15 15:01:12 +02:00
ManoloFLTK
700fb1aadd Improve virtual void* Fl_Gl_Window_Driver::GetProcAddress(procName) 2022-09-14 08:53:45 +02:00
ManoloFLTK
f265ca2afc Avoid deprecated glGetString(GL_EXTENSIONS) call when possible. 2022-09-13 18:41:18 +02:00
ManoloFLTK
e43c2f566d Remove forgotten debug code. 2022-09-13 11:24:08 +02:00
ManoloFLTK
87ee126e1f Allow use of Fl_Window::default_icon() with a scaled image. 2022-09-12 11:07:03 +02:00
ManoloFLTK
d028f0b37d Fix fl_read_image() under hybrid Wayland/X11 platform.
Function fl_read_image() obliges to keep a minimal use of global variable fl_window
also under the Wayland platform, even if its type (Window) makes little sense for
the hybrid library because it has its X11 value (given by X11/X.h) which is not
meaningful for the Wayland leg of the hybrid platform.

Virtual member function Fl_Surface_Device::as_image_surface() becomes useless.
2022-09-11 19:45:48 +02:00
ManoloFLTK
98d8a5da0c Fix support of CMake OPTION_WAYLAND_ONLY. 2022-09-11 10:42:56 +02:00
ManoloFLTK
ef243d6c86 Add needed variable for Wayland-only platform. 2022-09-11 09:52:02 +02:00
ManoloFLTK
2ea85ea6d7 Fix regression in fl_read_image() after introduction of hybrid Wayland/X11 platform.
The special use context of fl_read_image() inside the draw() function of an
Fl_Double_Window, where the function should read inside the window's double buffer
rather than the on-screen window, no longer worked.

Removal of all uses of the fl_window global variable from platform-independent
code remains necessary, because this variable is ill-defined in the Wayland/X11
library.
2022-09-11 09:15:42 +02:00
ManoloFLTK
b37576aa55 New configure setting "--enable-wayland --disable-x11" to build pure Wayland platform. 2022-09-10 07:44:23 +02:00
ManoloFLTK
203e7b7098 New OPTION_WAYLAND_ONLY for CMake to build pure Wayland platform. 2022-09-09 15:19:15 +02:00
ManoloFLTK
1b0f21cc8f Wayland: support going from borderless to bordered window. 2022-09-09 08:23:09 +02:00
ManoloFLTK
7800c2f3c3 Wayland: fix handling of fast calls to Fl_Window::flush().
Also fix scaling of borderless windows.
2022-09-09 07:26:19 +02:00
ManoloFLTK
0ff31668a1 Wayland: remove memory leak from missing wl_callback_destroy() call.
This hopefully corresponds to the memory leak mentioned in fltk.general
named "FLTK and Wayland".
2022-09-08 16:11:53 +02:00
ManoloFLTK
71069b8570 Add necessary virtual qualifier to ~Fl_Font_Descriptor() and derived. 2022-09-08 16:04:09 +02:00
ManoloFLTK
13e05f4204 Improve support of child windows that may leak outside their parent window.
1) add Wayland code that prevent subwindows from leaking outside their parent.
This does not cover GL subwindows.

2) add macOS code that prevent GL subwindows from leaking outside their parent.
This fixes issue #494 for the macOS platform.

N.B.: Wayland GL subwindows are not prevented from leaking because no solution
that would not require any change in client applications was found. Code that
would cover Wayland GL subwindows but would require client applications to always
use the FL_ALPHA flag is included in this commit in commented out form.
2022-09-07 14:40:16 +02:00
Albrecht Schlosser
deeb977c2e Wayland: fix memory leak on FL_KEYUP events
The old code would allocate memory on FL_KEYDOWN and FL_KEYUP events
and never free the latter.

The fix is to allocate memory only on FL_KEYDOWN events which will
be free'd later as intended.

Also fix two unrelated whitespace errors.
2022-09-06 20:04:33 +02:00
ManoloFLTK
57e0cdec08 Fix for issue #493 2022-09-03 12:36:50 +02:00
Albrecht Schlosser
76858fc040 Fix compiler warning [-Wunused-function]
warning: ‘int xrender_supported()’ defined but not used

This happens only with certain configure options, particularly if
  FLTK_USE_CAIRO is set, i.e. drawing with Cairo is enabled.
2022-09-02 16:28:53 +02:00
Albrecht Schlosser
e0bf25d911 Remove useless if (...) 2022-09-01 17:12:10 +02:00
ManoloFLTK
b75d7526fd Simplify Fl_Window_Driver::screen_num() member functions. 2022-09-01 11:55:41 +02:00
ManoloFLTK
b4686f0e5b Restore building with --disable-xft 2022-09-01 11:45:27 +02:00
ManoloFLTK
736c20f7a2 Wayland platform: remove redirection of stderr. 2022-08-31 10:43:10 +02:00
ManoloFLTK
5701313340 Hybrid Wayland/X11: remove setenv() call from Fl_Wayland_System_Driver::disable_wayland(). 2022-08-31 08:56:56 +02:00
ManoloFLTK
07fd2628fe Hybrid Wayland/X11 platform: improve control of chosen backend. 2022-08-30 17:37:55 +02:00
ManoloFLTK
fcdc2f0e10 Attempt to improve fl_disable_wayland(). 2022-08-30 12:58:57 +02:00
ManoloFLTK
84af966109 Add FL_EXPORT to Fl_Wayland_Screen_Driver::wl_display member variable. 2022-08-30 08:55:14 +02:00
ManoloFLTK
2c1effc385 Wayland: Fix Fl_Gl_Window_Driver::newGlWindowDriver() for shared libs 2022-08-30 08:15:21 +02:00
ManoloFLTK
95c851fda1 Set Fl_Graphics_Driver::set_color(Fl_Color, unsigned) used by macOS, Wayland and display-cairo. 2022-08-30 07:58:16 +02:00
Albrecht Schlosser
510f711513 Improve selection of Wayland or X11 backend
Calling fl_disable_wayland() at runtime must have highest priority
before environment variables are considered.
2022-08-29 19:56:18 +02:00
Albrecht Schlosser
746135f0ae X11: Fix rescaling of non-resizable window (issue #491) 2022-08-29 18:55:01 +02:00
ManoloFLTK
1ca767eb13 Hybrid Wayland/X11 : more accurate writing of fl_wl_display(). 2022-08-29 18:49:15 +02:00
ManoloFLTK
9276ade07b Wayland/X11 hybrid: fix crash of test program demo. 2022-08-29 18:34:11 +02:00
Albrecht Schlosser
c20e7d9efc Update dependencies, fix trailing whitespace 2022-08-29 14:26:28 +02:00
ManoloFLTK
c720aae515 Make hybrid Wayland/X11 platform. 2022-08-29 12:15:32 +02:00
Albrecht Schlosser
6a546d4e9c Fix dependencies and whitespace errors
No "real" code changes, but dependencies can affect building.
2022-08-25 22:04:59 +02:00
ManoloFLTK
6064518100 Remove unneeded FL_EXPORT declaration. 2022-08-25 15:48:54 +02:00
ManoloFLTK
feac10ec89 Wayland: reduce the number of platform-specific FL_EXPORT directives. 2022-08-25 10:42:58 +02:00
ManoloFLTK
51e9b28f39 Add FL_EXPORT directives to support building shared libs with -no-undefined 2022-08-24 15:09:30 +02:00
ManoloFLTK
80ecf605ec Wayland: Fix obscure problem when closing file dialog under recent OS versions.
The problem is that the app sometimes stops after closing a file dialog window.
It results in fact from a bug in function draw_title_bar of libdecor-gtk.c that erroneously
calls libdecor_frame_set_max_content_size(). This bug is being proposed to be fixed
by a MR to libdecor.

But moving the libdecor_frame_set_min/max_content_size() calls after the capability changes
hides the bug, and the problem with file dialog doesn't show.
2022-08-23 16:20:47 +02:00
ManoloFLTK
4611327672 Comment-only changes. 2022-08-23 09:04:14 +02:00
ManoloFLTK
1631e39187 Add FL_EXPORT directives erroneously removed at 7deff86. 2022-08-23 09:02:06 +02:00
ManoloFLTK
a70bd69cfb Fix argument of glMatrixMode() call. 2022-08-21 10:14:18 +02:00
ManoloFLTK
d5a1e7feb9 Add static Fl_Wayland_Window_Driver::gl_plugin() member function. 2022-08-20 17:26:02 +02:00
ManoloFLTK
7deff86b5d Remove FL_EXPORT qualifier from platform-specific class declarations. 2022-08-20 10:16:32 +02:00
ManoloFLTK
b24379133f Add int Fl::system(const char *command) static member function. 2022-08-20 09:57:00 +02:00
ManoloFLTK
ce2f024bce Fl_Graphics_Driver: remove unused virtual qualifiers. 2022-08-19 10:47:42 +02:00
ManoloFLTK
6194b736eb Add a few missing virtual members to Fl_Cairo_Graphics_Driver. 2022-08-18 16:22:28 +02:00
ManoloFLTK
2cfb5fcc57 Document Fl_Gl_Window::draw_begin() and draw_end(). 2022-08-18 11:21:35 +02:00
ManoloFLTK
f927a3047c Simplify class Fl_OpenGL_Display_Device. 2022-08-18 08:53:19 +02:00
ManoloFLTK
5227ee09a3 Remove un-necessary Fl_Wayland_Gl_Window_Driver::capture_gl_rectangle(). 2022-08-18 08:10:26 +02:00
ManoloFLTK
cc87fd8def Simplify Fl_Wayland_Gl_Window_Driver::make_current_before() member function. 2022-08-17 15:24:05 +02:00
ManoloFLTK
1f53b9e203 Wayland platform: improve Fl_Gl_Window resize operations. 2022-08-17 09:26:40 +02:00
ManoloFLTK
d23963af60 Remove useless Fl_Wayland_Window_Driver::show_with_args_begin/end(). 2022-08-15 19:23:57 +02:00
ManoloFLTK
82fa5ea19c Fix Fl_Wayland_Window_Driver::decoration_sizes(). 2022-08-15 18:40:11 +02:00
ManoloFLTK
d325fa504e Replace call to CreateFont() by call to CreateFontW(). 2022-08-13 12:25:04 +02:00
ManoloFLTK
d1d3cc9afa Add virtual Fl_Cairo_Graphics_Driver::cache_size() member function. 2022-08-12 19:47:04 +02:00
ManoloFLTK
b8c227a8f2 Fix Fl_Xlib_Graphics_Driver for drawing tiled images.
Conflicting demands arise in the implementation of class Fl_Xlib_Graphics_Driver
for drawing images with the XRender library :

1) Issue #163 leads to use a bilinear filter to draw-and-scale images.
2) This tends to blur the edges of drawn areas which is bad for tiled images
(that is because the edges get alpha values, even for an opaque source image).

This commit resolves the conflict adding a means to detect whether the library
is busy drawing a tiled image. If so, the bilinear filter is not applied, drawn areas
don't  have blurred edges, resulting in a nice tiling.

With this commit, these test apps perform correctly:
- tiled_image is correct at all scaling factor values also when modified
to use a depth-3 or a depth-4 Fl_RGB_Image as tile;
- unittests - Drawing Images is correct at all scaling factor values;
- pixmap_browser scales correctly up and down JPEG and PNG images.
2022-08-10 10:53:29 +02:00
ManoloFLTK
92f6962b59 Fix Fl_Xlib_Graphics_Driver for tiled-depth 3 images.
Modifying test/tiled_image to make it use a depth-3 image for
tiling (rather than an Fl_Pixmap) shows the filter does require
to use PictOpOver as the render op in the XRenderComposite call.
2022-08-09 17:43:48 +02:00
ManoloFLTK
1562396ec0 Fix Fl_Xlib_Graphics_Driver for RGB image drawing under XQuartz. 2022-08-09 16:05:53 +02:00
Albrecht Schlosser
d20de5bc0a Fix src/Makefile: add missing directory to 'clean' target 2022-08-08 11:33:45 +02:00
Albrecht Schlosser
713d276b1c Fl_Flex: support different margin sizes, improve docs
Support different margin sizes on all four edges. Default margin
  and gap size is now 0 (compatible with Fl_Pack).

Doxygen: move the description from the constructor to the class
  declaration which constitutes a "description".

Make some methods virtual and/or 'const'.

Clarify demo programs, make them even more "FLTK style".
2022-08-07 16:00:41 +02:00
ManoloFLTK
f5b14397dd Wayland platform: fix declaration of local variable 'scale'. 2022-08-07 10:49:11 +02:00
ManoloFLTK
5dfc64ef32 Wayland platform: move repeated code into Fl_Wayland_Graphics_Driver::buffer_commit(). 2022-08-07 10:43:38 +02:00
ManoloFLTK
b25549ffa7 Wayland: make sure wl_surface_frame() is followed by wl_surface_commit(). 2022-08-06 17:30:44 +02:00