Commit Graph

335 Commits

Author SHA1 Message Date
Manolo Gouy
7ad5091dbc Corrected one comment and added one.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10521 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-01-16 07:24:11 +00:00
Manolo Gouy
af42e3cd5f Fixed Fl_Window::resize() on Mac OS because program-generated resize did not work
with new true subwindows.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10520 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-01-15 21:57:27 +00:00
Manolo Gouy
790fc0ce02 Some indentation cleaning.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10519 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-01-14 15:10:16 +00:00
Manolo Gouy
ae9ea6b51f When CGBitmapContextCreate() is used with null 5th argument, it is necessary
to use CGBitmapContextGetBytesPerRow().

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10518 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-01-14 14:21:01 +00:00
Manolo Gouy
bc8a7037eb Avoid compilation warnings appearing with SDK 10.5
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10517 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-01-14 13:29:05 +00:00
Manolo Gouy
56fd2fc9f9 Fl_Paged_Device::print_window() now uses the CALayer class to print in one step
all of the window title bar, when the program is linked with OS X 10.10.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10515 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-01-13 16:36:04 +00:00
Manolo Gouy
335212dacb Better implementation of Fl_Paged_Device::print_window() for Mac OS X Yosemite:
title bar buttons are drawn by the system instead of emulated by FLTK.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10510 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-01-09 17:28:19 +00:00
Manolo Gouy
7f7e84b696 Simplified Fl_X::flush() for GL windows.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10507 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-01-04 14:41:50 +00:00
Ian MacArthur
b2462e9adb Fix typo in Fl_cocoa.mm if the ABI was set to 10304 or greater.
Seems ot be compiling OK again now.



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10505 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-12-21 18:03:03 +00:00
Manolo Gouy
f3a84c0ee5 Changed OpenGL support for the Mac OS X platform: use cocoa instead of deprecated AGL.
All changes are mac-specific, except a very minor change in file src/gl_draw.cxx
where string drawing wrongly claimed to support @symbol, not possible
because symbols are drawn using non-GL primitives.

Unchanged application code can use the new FLTK code.
In addition, the new code allows mac applications to draw OpenGL scenes
at high resolution on so-called 'retina' displays, but this requires some
support from app code. They must call, before opening GL windows,
Fl::use_high_resolution(1);
and change their glViewport() calls as follows
glViewport(0, 0, pxel_w(), pixel_h());
This uses 2 new member functions of the Fl_Gl_Window class,
pixel_w() and pixel_h() returning the window dimensions in pixel
units, that is, twice the w() and h() when the window is mapped
on a retina display.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10498 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-12-20 07:19:23 +00:00
Manolo Gouy
ea279f9354 Avoid double window redraw after deminiaturization.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10495 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-12-19 04:53:01 +00:00
Manolo Gouy
f2cba934cb Restores compilation with SDK’s before 10.7, erroneously broken in a recent commit.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10490 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-12-18 17:32:08 +00:00
Manolo Gouy
d8ddb7b511 Removed compilation warning for unused variable.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10489 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-12-18 08:27:28 +00:00
Manolo Gouy
15d497ebdf Apple-only changes to restore a layout of the Fl_X class identical to that in FLTK 1.3.3.
With true subwindows, several members of Fl_X became useless.
This change recycle two of them for new uses:
- Fl_Region subRegion is used as a pointer to a CGRect
- Fl_X *xidChildren is used to indicate the resolution of the display
containing a window

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10486 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-12-17 09:04:01 +00:00
Manolo Gouy
00dd28afa4 Completed support of retina displays for Fl_Paged_Device::print_window_part().
Case with high resolution parent window and low resolution GL window is now directly processed.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10485 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-12-12 17:12:11 +00:00
Manolo Gouy
e230a34cfd It is necessary to compute Fl_X::mapped_to_retina after the window is mapped
because the windowDidMove notification is not always sent.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10484 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-12-11 22:25:31 +00:00
Manolo Gouy
bf07d892a3 Fix case when show() of a subwindow whose parent is not shown yet.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10483 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-12-11 20:34:47 +00:00
Manolo Gouy
879a8fbabf Propagate Fl_X::mapped_to_retina value from parent to subwindows.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10482 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-12-11 20:09:55 +00:00
Manolo Gouy
68a577e1f6 Improved handling of high resolution ("retina") displays.
The new field bool Fl_X::mapped_to_retina is updated when needed, that is, when the window is moved.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10481 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-12-11 16:54:30 +00:00
Manolo Gouy
2d0670104b Removed one use of dynamic_cast.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10480 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-12-11 13:28:23 +00:00
Manolo Gouy
f1c7d674d2 Improved processing of retina displays: replace [NSWindow backingScaleFactor] that is not recommended.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10477 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-12-05 17:18:19 +00:00
Manolo Gouy
0fdb271a78 Make sure that subwindows won’t leak out of their parent window
even if they have coordinates that would provoke it.  

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10475 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-11-30 12:34:21 +00:00
Manolo Gouy
a482495236 Corrected case when using retina display.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10472 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-11-26 20:42:08 +00:00
Manolo Gouy
d5d6b8ae19 Carbon function TSMGetActiveDocument() and its friends are no longer documented on the Apple web site.
Don’t use them unless Fl::disable_im() is called.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10464 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-11-19 18:20:41 +00:00
Manolo Gouy
f52b457cc2 Added full support of retina displays on the mac platform.
On such displays, one drawing unit equals two pixels.
The fl_xyline() and fl_yxline() functions are modified to perform
extra operations when drawing to a window on a retina display.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10463 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-11-19 16:23:36 +00:00
Manolo Gouy
b8a1618c0a Implement applicationDidUpdate differently according to running OS version.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10459 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-11-17 16:08:23 +00:00
Manolo Gouy
7d6e58acba Improves the cmd-Q handler as discussed in FLTK.coredev "Safe widget deletion ».
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10457 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-11-15 21:59:41 +00:00
Manolo Gouy
cc9b73d97a Invalidate the Quit item of the application menu when running modal.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10455 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-11-15 14:55:15 +00:00
Manolo Gouy
43989ec606 Support for true subwindows under Mac OS X (cont’d).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10454 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-11-13 15:33:33 +00:00
Manolo Gouy
d2072c818c A subwindow in an Fl_Tile did not work well after recent addition of support for true Mac OS X subwindows.
The tile demo program runs correctly again.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10453 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-11-13 13:57:27 +00:00
Manolo Gouy
e4d4f400a4 Added support of true subwindows to the Mac OS X code. With this, a window inside another
window is just another window with Mac OS as it was already with MSWindows and X11.
This requires Mac OS X 10.2. Window nesting to any depth is possible.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10449 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-11-11 16:08:09 +00:00
Manolo Gouy
574e31276e Rewrite Fl_Copy_Surface::complete_copy_pdf_and_tiff() using cocoa APIs.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10442 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-11-08 18:14:31 +00:00
Manolo Gouy
13cd0a16b5 Replace deprecated pasteboard manager by cocoa NSPasteboard.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10438 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-11-07 17:08:13 +00:00
Manolo Gouy
bd1446a6eb Fix for STR#3142 where fl_read_image() correctly reads GL data under X11, but ignores them under MSWindows and Mac OS X.
Moreover, fl_read_image() behaves differently with and without OS virtualization for X11 and MSWindows.
The patched function reads whatever is in the rectangle transmitted in arguments, with and without GL data, with and without subwindows,
on ‘true’ OS or on virtualized OS.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10436 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-11-06 16:48:57 +00:00
Manolo Gouy
f5e023f9c8 Use +(void)initialize method of the NSObject class.
Create classes FLWindowDelegateBefore10_6 and FLViewBefore10_6 to support text input before Mac OS 10.6

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10435 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-11-06 15:35:32 +00:00
Manolo Gouy
aee0ee202f Silence compilation warnings.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10427 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-11-02 21:06:07 +00:00
Manolo Gouy
a11d067d68 Improves FLTK usage on macintosh computers with retina displays.
The editor demo had grey lines between text lines and its cursor left traces behind
when moved. The scroll demo left some faint lines behind also.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10401 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-10-28 13:44:09 +00:00
Manolo Gouy
9d5fde73b6 Fixed uchar arguments of fl_rgb_color() calls.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10392 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-10-23 13:25:55 +00:00
Manolo Gouy
4db77674c3 Removed compilation warnings in fl_rgb_color() calls.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10390 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-10-23 11:08:16 +00:00
Manolo Gouy
69d5e00ce4 Fixed printing of window title bar buttons under Mac OS X 10.10
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10389 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-10-23 09:04:30 +00:00
Albrecht Schlosser
d24a6b2633 Move RGB image scaling algorithm methods in base class Fl_Image.
See also discussion in fltk.coredev of Sept 07, 2014 and later
with subject "Fixing the nearest-neighbour scaling".


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10377 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-10-14 11:53:51 +00:00
Manolo Gouy
a3845fc51d Improved Fl_Paged_Device::print_window() when used on an Apple computer with a retina display:
the window tittle bar is printed at high resolution.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10372 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-10-11 14:33:43 +00:00
Manolo Gouy
6232a298f3 Fixed errors in fl_read_image() and Fl_Paged_Device::print_window_part()
when using Apple computers with retina displays.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10371 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-10-11 13:43:06 +00:00
Manolo Gouy
f1b2c92fce STR#3093 continued: deleted the Fl_Shaped_Window class. Instead, added new member function Fl_Window::shape(Fl_Image*)
that gives a non-rectangular shape to a standard window. The benefit is that it works with Fl_Double_Window and Fl_Menu_Window as well.
It also works for free with Fl_Gl_Window on the X11 platform only.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10325 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-09-21 14:10:36 +00:00
Pierre Ossman
1c7409e0a1 Add methods to enable and disable the system's input methods.
This needs to be done from FLTK as it affects the window interaction,
which FLTK is largely responsible for.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10314 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-09-15 09:44:35 +00:00
Pierre Ossman
e145df2165 Add methods to intercept low level system events.
This gives applications the means to handle some low level
integration with the system that might otherwise not be possible
without modifying FLTK itself.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10310 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-09-15 09:17:56 +00:00
Manolo Gouy
eadd6e87f1 Removed several compilation warnings with OS X SDK 10.10
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10306 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-09-13 16:49:47 +00:00
Manolo Gouy
76418b352b Allow compilation with SDK 10.10 and use new API to discover os version at runtime.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10305 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-09-13 14:29:53 +00:00
Manolo Gouy
6482acf15a Allow compilation with SDK 10.10 and use new API to identify OS version at runtime.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10304 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-09-13 14:18:34 +00:00
Manolo Gouy
aecb3ac594 Fix for STR #3128
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10298 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-09-09 11:02:33 +00:00