Commit Graph

428 Commits

Author SHA1 Message Date
Matthias Melcher
50ee3bcd66 Mark places that need to be refactored with // PORTME:
Searching for __APPLE, WIN32 or X11 did give me many false results. I instead marked most ifdef's that I would like to get rid of with the text // PORTME:, so they can be easily found by a global search.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11155 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-11 12:02:36 +00:00
Matthias Melcher
e83bc2527f Basic Screen Driver Structure. LIMBO!
Creating the basic structure for a screen driver system.
OS X works X11 and WinAPI are in limbo and will be fixed in the next hour or so.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11148 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-10 19:49:35 +00:00
Manolo Gouy
2b36a14d10 Fix Mac OS "Print front window" of the application menu.
This is part of r.10990 committed to the 1.3 branch, still to be replicated
in this branch.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11105 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-01 09:14:08 +00:00
Albrecht Schlosser
0a6be0a83f Fix compiler warnings (STR 2988), porting from branch-1.3.
This commit is the accumulated patch introduced in branch 1.3
in svn r 11094, 11095, and 11096.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11097 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-31 04:33:54 +00:00
Manolo Gouy
1c3c544edf Added Fl_Window::capture_titlebar_and_borders a new private member function
that triggers a warning when FL_PORTING is ON and with a default platform-neutral
implementation.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11074 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-28 11:51:07 +00:00
Matthias Melcher
780f43a4f1 Removed all references to Quartz driver files from library headers in Xcode. Works in Xcode.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11065 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-27 22:35:58 +00:00
Manolo Gouy
8e3f66073f 1) Added a new way to detect whether the drawing operation is using the platform's native driver
and whether we are printing:  virtual int Fl_Graphics_Driver::has_feature(driver_feature feature)
This is also because it is not convenient to derive a printer-specific driver with its own
implementation of virtual functions when this implementation differs only in one line of code.

2) Solved the problem of inclusion of non public header by the public header FL/Fl_Device.H:
bracket this with #if FL_LIBRARY / #endif so this non public header is included only when building
FLTK itself.

3) Removed several (but not all) of the FLTK_ABI_VERSION guards that are no longer
useful for code targeting FLTK 1.4.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11063 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-27 18:11:20 +00:00
Manolo Gouy
eeb65bef23 1) Replicate in branch-1.3-porting all recent changes of branch-1.3
2) Advance branch-1.3-porting with new function Fl_X::capture_titlebar_and_borders()
that contains all the platform-specific code of all operations related to drawing
window borders and title bars. What is platform-specific and what is not
is therefore much clearer, to ease porting.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11002 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-10 19:08:16 +00:00
Manolo Gouy
59823515cf Mac OS: It is not necessary to open the display to send the
+[NSWindow  frameRectForContentRect:styleMask:] message
(checked on 10.11 and 10.3). Therefore fluid -c will run without
opening the display.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10979 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-23 09:33:06 +00:00
Manolo Gouy
527d5943d0 Mac OS: when an app is asked to open a file by Applescript, have it redraw itself
without waiting for the next event to come, because AppleScript does not break the
event loop.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10978 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-23 07:34:49 +00:00
Manolo Gouy
25fc85190e Mac OS: Fix for STR#3268 where a fullscreen window could become relocated
behind the menu bar and dock.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10975 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-21 13:38:49 +00:00
Manolo Gouy
09cd712c0d Allowing to use FLTK objects in static initializers (cont'd).
On the Mac platform, it is also necessary to change the initialization of 
the macKeyLookUp array for keyboard events to work in a static
initializer.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10962 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-13 09:51:07 +00:00
Manolo Gouy
8d1d2df0c2 Mac OS: using true system windows for FLTK sub-Fl_Window's.
Improved handling of the situations where a subwindow is created,
hidden, the parent window resized, and the subwindow shown,
with a new size. This change no longer sends setFrame: or setFrameOrigin:
messages to hidden subwindows. Instead, subwindows acquire their correct
size and position when they are shown again and Fl_X::map() is called.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10954 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-09 12:52:17 +00:00
Manolo Gouy
c7950b30c4 Mac OS: the present code asks the system to build the mini window image when a subwindow-less window is miniaturized,
and builds itself the image when a window with subwindow is miniaturized. That is mostly OK, but it fails when a window
containing a subwindow is miniaturized (a mini image is computed), deminiaturized, the subwindow is removed
or hidden, and the window is miniaturized again: the old mini image is used, and that is not appropriate.
The solution is to remove the FLTK-computed mini image when a window with subwindow is deminiaturized.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10953 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-09 10:13:46 +00:00
Manolo Gouy
ade095f240 Mac OS: added visibility test necessary after a subwindow-containing group was hidden.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10951 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-07 20:10:07 +00:00
Manolo Gouy
caba454f39 Mac OS: removed some code that was duplicated by checkSubwindowFrame run later.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10950 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-07 17:53:26 +00:00
Manolo Gouy
f79f70b96a Removed compilation warning with SDKs 10.3 and 10.4u
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10948 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-03 17:18:33 +00:00
Manolo Gouy
58afd21c73 Mac OS: send the setWantsBestResolutionOpenGLSurface:YES message in
Fl_X::create_GLcontext_for_window() where it is directly relevant.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10947 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-02 14:22:52 +00:00
Manolo Gouy
22af09dae7 Mac OS: support for high resolution OpenGL windows.
Methods Fl::event_x_pixel() and Fl::event_y_pixel() committed at r.10941
are removed. Instead method Fl_Gl_Window::pixels_per_unit() is added.

The documentation explains in more detail how to write cross-platform
FLTK code supporting high resolution OpenGL windows on retina displays.

The examples/OpenGL3test.cxx app exercises Fl_Gl_Window::pixels_per_unit().

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10945 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-02 09:59:37 +00:00
Manolo Gouy
597ac17bda Mac OS: added Fl::event_x_pixel() and Fl::event_y_pixel() that return the mouse event position
in pixel units that differ from FLTK units for OpenGL windows mapped to a retina display.
On non Mac OS platforms, these are synonyms of Fl::event_x() and Fl::event_y().
The example/OpenGL3test demo program is modified to call these new functions.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10941 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-01 16:17:37 +00:00
Manolo Gouy
b2f24781d4 Mac OS: fixed possible crash when closing fullscreen GL window with close button of title bar.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10937 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-11-30 13:06:31 +00:00
Manolo Gouy
d74f373552 Mac OS: allow calling Fl_Gl_Window::pixel_w() before the window is shown.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10936 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-11-30 12:46:42 +00:00
Manolo Gouy
b0696db39a Added new method Fl_Copy_Surface::draw_decorated_window()
that copies a window to the clipboard together with its title bar and borders.
This requires very little new code because the capture of window decorations
is shared with the Fl_Paged_Device::print window() method.
The device test program is changed to call the new method.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10928 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-11-24 14:26:52 +00:00
Manolo Gouy
511ec0bb3d Mac OS: have Fl_Paged_Device::print_widget() print top-level windows with
rounded bottom corners as they appear on screen.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10916 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-11-19 16:33:44 +00:00
Manolo Gouy
364dfaf802 Mac OS. This simpler algorithm is just as good: remove the constraint
altogether for subwindows; keep it unchanged for windows.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10913 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-11-16 16:48:01 +00:00
Manolo Gouy
31c9c98434 Corrected typo.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10912 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-11-16 08:59:33 +00:00
Manolo Gouy
535b477e7c Mac OS: with OS 10.11, the (green) window maximize button turns the window fullscreen so
it covers the dock and the system menu bar. The default behavior of a subwindow of such
a fullscreen window is to be prevented to cover the menu bar (which makes not much sense 
because this bar is covered by the main window). If the location of the subwindow within
its parent window expected by FLTK would have it cover the menu bar, Mac OS moves
it down. The subwindow therefore does not lie where FLTK wants it.
This patch overrides the adequate method of the NSWindow class to prevent this bad behavior.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10911 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-11-16 08:47:18 +00:00
Manolo Gouy
ebffeb8edd Mac OS: Added necessary check because a non-FLTK window can be found
as child of an FLTK window when turning a window full-screen.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10909 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-11-15 10:45:59 +00:00
Manolo Gouy
ba26f2c194 Mac OS X: simplified code for moving and resizing subwindows.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10908 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-11-13 10:55:38 +00:00
Manolo Gouy
647821fa71 Mac OS X: with OS 10.11 "El Capitan" window capture returns an ARGB image (it used to return RGBA)
whereas OpenGL window capture returns RGBA as before. Capturing a window with subwindow(s)
requires ARGB <--> RGBA conversion when Quartz and OpenGL windows are mixed.
The OpenGL-inside-Quartz case was taken care of before.
Here, the Quartz-inside-OpenGL case is properly handled.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10900 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-11-11 07:46:15 +00:00
Manolo Gouy
68f3cc6d88 Mac OS X: added checks that subwindows do not leak out of
enclosing window when they are programmatically resized or moved.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10899 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-11-10 06:39:37 +00:00
Manolo Gouy
f00901534a Mac OS: fixed bad window resizing when presence of sub-sub-window and window
resized by top border.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10898 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-11-09 10:25:16 +00:00
Manolo Gouy
4ad9e7c6b8 Mac OS: improved control that subwindows do not leak outside their parent
after window resize.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10893 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-11-08 19:00:17 +00:00
Manolo Gouy
8a4acc5b05 Mac OS only.
Allow proper initial display of a subwindow-containing window in iconized state
(previously, the subwindow was not displayed in the icon).
Also fixes a problem with subwindows when the screen resolution was changed
while the window was iconized.
Tested with Mac OS 10.11, 10.6 and 10.3.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10891 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-11-07 17:20:33 +00:00
Manolo Gouy
7e025aac22 Added support for OpenGL V3 and higher.
On the X11/MSWindows platforms, this requires external installation of the GLEW library.
This fixes STR#3198 and STR#3257.
Added two new examples programs.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10876 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-10-27 08:40:56 +00:00
Manolo Gouy
accbfd9f66 More careful coding that does not read beyond the end of the image data
when an ARGB system image is converted to the RGBA format.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10870 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-10-20 14:53:37 +00:00
Manolo Gouy
57e603e6bc More detailed comment.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10869 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-10-19 14:41:24 +00:00
Manolo Gouy
2dd9d06818 Make sure the FLTK and the system keep their representations of window coordinates synchronized.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10863 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-09-22 05:43:37 +00:00
Manolo Gouy
bf5822bb8b Mac OS: slightly simpler code that does just the same thing.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10861 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-09-10 14:53:16 +00:00
Manolo Gouy
157eb68eae Mac OS: 1) simpler tracking of window changes between retina/non retina displays.
2) improved window creation in iconized state (child windows still don't show in icon, though).

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10860 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-09-10 13:09:38 +00:00
Manolo Gouy
1e1f1c33bd Mac OS: added missing cast required by some compilers.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10856 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-09-07 10:45:00 +00:00
Manolo Gouy
60ad983b4e Mac OS: properly handle OpenGL profile requests independently from what SDK version is used at compile time.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10855 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-09-07 09:26:19 +00:00
Manolo Gouy
3570777a58 Removed the global variable inputContext_SEL.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10845 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-27 17:10:00 +00:00
Manolo Gouy
16e08ce3a2 Programs compiled with pre-10.7 SDKs can now fully use retina displays.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10844 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-27 12:31:46 +00:00
Manolo Gouy
a3adc0c4ad Improved handling of differences between OS versions in text input.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10843 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-27 08:40:30 +00:00
Manolo Gouy
03cad454d7 It's clearer to implement and use a doNothing: message.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10841 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-25 10:57:16 +00:00
Manolo Gouy
89589d7c9b Remove a compilation warning appearing with Mac OS 10.11 +
explain better the intent of this thread creation.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10840 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-24 19:09:56 +00:00
Manolo Gouy
daeed067c8 Mac OS: simpler algorithm for function NSBitmapImageRep* GL_rect_to_nsbitmap()
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10834 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-17 17:05:32 +00:00
Manolo Gouy
60a78880d5 Mac OS: more efficient handling of ARGB image data produced under
Mac OS 10.11 when capturing screen data.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10833 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-16 16:10:12 +00:00
Manolo Gouy
1e6bc1c73a Improved Mac OS implementation of Fl_Window::wait_for_expose().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10828 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-11 11:47:21 +00:00