Commit Graph

6368 Commits

Author SHA1 Message Date
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
fa9880e7fe The Fl_Gl_Window public API offers 2 ways to control the OpenGL capabilities of a window:
1) Fl_Gl_Window::mode(int m) is platform-independent and uses an argument containing bit flags
(e.g., FL_DOUBLE, FL_RGB8) to express desired capabilities. The m argument is assigned to
the mode_ private member variable of the Fl_Gl_Window object.
2) Fl_Gl_Window::mode(const int *a) is highly platform-dependent. It uses a zero-ending
array of attributes or attribute-value pairs to express capabilities. This member function
can be used on the X11 and the Mac OS platforms, but not with MSWindows.
Before this patch, the mode_ private member variable of the Fl_Gl_Window object
is assigned 0 by this member function.

The Fl_Gl_Window::flush() member function tests whether the FL_DOUBLE flag
is ON in the mode_ variable, and changes code path accordingly. Therefore,
the second API to control OpenGL capabilities fails when a double-buffered
GL context is required, because the code path followed by Fl_Gl_Window::flush() 
does not match the GL context requirements.

With this patch,  Fl_Gl_Window::mode(const int *a) scans the content of its 
array argument, and sets the FL_DOUBLE bit of the mode_ member variable
if the array requires a double-buffered GL context.

This patch does that for the X11 platform. The same was introduced for the
Mac OS platform at r. 10854.  The MSWindows platform does not use the
Fl_Gl_Window::mode(const int *a) API.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10859 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-09-08 11:43:48 +00:00
Manolo Gouy
a650237edf Moved a few Mac-specific lines from Fl_Gl_Window::show() to Fl_Gl_Window::mode()
where it is more easily understood.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10858 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-09-07 15:52:41 +00:00
Manolo Gouy
d7094249f0 Documentation: better descriptions of Fl_Gl_Window::mode() and Fl_Gl_Window::can_do().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10857 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-09-07 15:48:55 +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
34beb4c4dd Mac OS X: restored the possibility to set a GL context mode with the
Fl_Gl_Window::(const int *a) member function that uses a zero-ending
array of system-dependent attributes.
This procedure failed whenever a double buffer was asked for.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10854 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-09-07 05:52:17 +00:00
Manolo Gouy
dc01deda00 Mac OS platform: Allow compilation of user code with non-Apple compiler.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10853 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-09-05 15:36:28 +00:00
Manolo Gouy
6242bf0513 Extended Mac OS support of gl_draw() functions to old Apple hardware that does not
implement the GL_EXT_texture_rectangle extension.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10852 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-09-03 17:29:25 +00:00
Albrecht Schlosser
298c734201 Fix typos.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10851 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-09-01 15:15:21 +00:00
Albrecht Schlosser
d99d22cf91 Fix confusing argument value to fl_measure() in tooltip handling.
The argument 'draw_symbols' was inconsistently set with the intended
tooltip label alignment. This was confusing, but didn't do any harm
since the value was != 0 anyway.

Also added the 'image' and 'draw_symbols' argument to fl_draw() call.
Defined static constant draw_symbols_ for potential later inclusion in
Fl_Tooltip class and code clarification.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10850 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-09-01 14:27:45 +00:00
Manolo Gouy
e31c8cd758 Mac OS: Use the more standard GL_TEXTURE_RECTANGLE_ARB
extension name instead of old GL_TEXTURE_RECTANGLE_EXT.
Also, use the GL_BGRA format that is preferred for GL textures, 
according to "Optimal Data Formats and Types" from 
"Best Practices for Working with Texture Data".

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10849 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-31 16:59:10 +00:00
Manolo Gouy
feab968e26 Improved use of the gl_texture_reset() function:
it is necessary only if all GL windows have been deleted.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10848 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-31 16:43:41 +00:00
Manolo Gouy
529927e0b8 Fixed bug in Mac OS version of gl_draw() that could produce truncated strings.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10847 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-29 07:04:08 +00:00
Manolo Gouy
5ea322679c Moved Mac-specific type declaration to mac.H
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10846 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-28 14:04:21 +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
Albrecht Schlosser
be81fa0f62 Fix potential Windows GDI leak (STR #3254).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10842 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-25 12:55:59 +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
Albrecht Schlosser
bb3f67ecf7 Avoid strange warnings/error messages from 'make depend'.
Warning was for instance:
"../FL/Fl_Spinner.H":53:  FLTK_ABI_VERSION >= 10301^--- expecting )

Maybe a g++ bug ?


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10839 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-24 15:47:08 +00:00
Manolo Gouy
016fc01805 Added compatibility with Xcode 7.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10838 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-24 15:06:11 +00:00
Manolo Gouy
cc296e50b0 Restore compilability with Mac OS 10.3
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10837 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-24 07:29:17 +00:00
Manolo Gouy
5cc6913cb7 Support for Mac OS 10.11.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10836 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-23 13:58:07 +00:00
Greg Ercolano
5534ce4c57 Small mod to enable highlighting in total cells.
This way someone hitting 'End' can see where the "cursor" is.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10835 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-19 21:38:17 +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
Albrecht Schlosser
9fe9fbe3bc [CMake] Fix missing link libraries for shared FLTK lib (STR #3251).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10832 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-16 14:13:21 +00:00
Albrecht Schlosser
47a678461e Fix compiler warning [-Wsign-compare], remove dead (commented) code.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10831 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-13 11:43:49 +00:00
Albrecht Schlosser
0650563c7b Document Fl_Text_Editor::global_key_bindings and related methods.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10830 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-13 10:07:17 +00:00
Manolo Gouy
9bedf7ab8f More accurate documentation of Fl_Window::wait_for_expose() for Mac OS.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10829 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-11 12:00:49 +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
Manolo Gouy
e9888e09c5 Fixes descriptive comment of the mapped_to_retina_ class variable.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10827 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-09 12:56:24 +00:00
Manolo Gouy
cc36ab53b3 - Implement Fl_Window::wait_for_expose() for Mac OS:
The -[NSWindow makeKeyAndOrderFront:] message used to make the window appear on the screen,
but, starting with 10.10 (approximately), this changed, and it became necessary to query for events
for a new window to appear on the screen. With 10.11 two event messages are needed.
The solution is therefore to implement Fl_Window::wait_for_expose().

- Calling NSDisableScreenUpdates()()/NSEnableScreenUpdates() before and after window updates
greatly accelerates multi-window update operations.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10826 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-07 12:55:56 +00:00
Manolo Gouy
9a38c24d63 The CGContextStrokePath bug has been fixed in Mac OS El Capitan (10.11) public beta 4.
It's no longer necessary to apply a workaround for it.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10825 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-05 20:20:30 +00:00
Albrecht Schlosser
99c536234e Add light gray separator line to fluid widget browser (STR #2997).
Also fix some comments.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10824 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-01 19:04:07 +00:00
Manolo Gouy
68f706b756 Bypass Mac OS 10.11 bug in CGContextStrokePath() - continued
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10823 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-01 18:30:52 +00:00
Manolo Gouy
4388e5635e Simpler code to support copy/paste of image data, that is also valid from Mac OS 10.3.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10822 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-01 17:25:53 +00:00
Manolo Gouy
ca1990c314 Fix for Mac OS 10.11 El Capitan bugged CGContextStrokePath() function:
replace it by CGContextReplacePathWithStrokedPath() + CGContextFillPath()
that does the same without error.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10821 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-01 16:56:04 +00:00
Albrecht Schlosser
eb7d55e218 Document Fl_Window::show() calling Fl_Group::current(0).
Also fix indenting in src/Fl_win32.cxx.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10820 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-07-27 18:13:46 +00:00
Greg Ercolano
a165f1ca3c Fixes STR#3177; item_pathname() supports FL_SUBMENU_POINTER,
and small doc mods.



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10819 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-07-26 21:10:18 +00:00
Manolo Gouy
7819882874 Fixed image copy/paste for Mac OS 10.4 and 10.5 that use different pasteboard type names
from later OS versions.
Unfortunately, it does not work with Mac OS 10.3

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10818 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-07-25 15:57:14 +00:00
Manolo Gouy
491938a4a9 Make Fl_Copy_Surface work on Mac OS 10.3:
use different pasteboard data type names according to running OS.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10817 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-07-25 08:02:03 +00:00
Manolo Gouy
a3e48a4afd Use -(NSGraphicsContext*)[NSWindow graphicsContext] to obtain the adequate
graphics context to draw to a window. This requires Mac OS 10.4.
The advantage is that it is possible for a secondary thread to call 
Fl_Window::make_current() without needing to create an autorelease pool.

We save the native graphics state, and also the state with origin at top. 
Fl_X::q_release_context() restores the graphics state twice to return to
the native state. This allows to use a single graphics context for a single
window and a single thread.

Under 10.3, we have to create a new NSGraphicsContext when Fl_Window::make_current()
is called directly, so that secondary threads cannot call Fl_Window::make_current() without
having created an autorelease pool.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10816 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-07-24 22:17:36 +00:00
Manolo Gouy
80402f622c Restore usability on Mac OS 10.3:
- do not use NSOpenGLPFAMultisample
- do not use -[NSBitmapImageRep bitmapFormat]
that require Mac OS 10.4

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10815 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-07-24 21:30:46 +00:00
Albrecht Schlosser
c788ca2285 Document FL_ABI_VERSION, reformat lists in enumerations.dox.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10814 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-07-24 18:43:20 +00:00
Albrecht Schlosser
a2e13ee3a2 Fix documentation, adjust comments in fluid/Fl_Type.cxx.
No code changes.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10813 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-07-23 00:22:42 +00:00
Albrecht Schlosser
ff1d783162 Add new event name FL_ZOOM_GESTURE to FL/names.h.
I also added some placeholders for yet to be defined events, just in
case they are forgotten to add in FL/names.h. This appears to be better
than to reference a non-existing array element (string pointer).


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10812 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-07-22 23:34:32 +00:00
Albrecht Schlosser
01cbcc8406 Update dependencies.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10811 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-07-22 23:20:47 +00:00