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
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
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
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
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
Before, the fl_find(Window) function was not accessible from .mm source files.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10451 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
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
With this, no public FLTK header includes system header files anymore on the mac.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10443 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Also change our fallback cursors to use this method, so that fallback
cursors are handled in a platform independent manner. STR #2660.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10196 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Added Fl_Image_Surface class to draw into an Fl_Image object.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10159 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Some code is transferred from Fl_cocoa.mm thus reducing somewhat this very large source file.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9885 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
some key opens a window with possible accented characters. This feature is used by the Fl_Input_ and
Fl_Text_Editor widgets. User-defined text input widgets can optionally use this feature, but the default
behavior is to not use it. Fl_Secret_Input turns it off, for example.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9792 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This introduces 3 new functions
static void Fl::screen_work_area(X,Y,W,H)
static void Fl::screen_work_area(X,Y,W,H,mx,my)
static void Fl::screen_work_area(X,Y,W,H,screen_no)
that compute screen work areas and are used by FLTK to position menu windows.
The Fl::x(),y(),w(),h() functions are made consistent across platforms: they return
the origin/size of the work area of the main screen (as far as possible, see below).
On the Mac OS platform, all screen functions reflect changes in screen number and
positions without requiring the application to restart.
On the X11 platform, I did not find an API to compute the main screen work area
in all conditions. What's used does compute the correct work area when there's
a single screen, but not when there are several, because it returns an area that
encompasses all screens. The implemented workaround is that Fl::x(),y(),w(),h()
and Fl::screen_work_area(X,Y,W,H,0) return the exact work area when there's
a single screen, and return the full screen area when there are several.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9084 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
with or without declaring the FL_INTERNALS preprocessor variable.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9035 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Useful when deleting a window because subwindows share their xid with their parent
window (unlike under MSWIn or Xlib), so subwindows should not delete their xid.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8540 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
displays correctly that #include <x.H> is needed for this class.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8381 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Applied Manolo's patch, modified to use FL_INTERNALS for
explicit request in user code to expose class Fl_X.
Also changed X11 and Mac OS to use FL_INTERNALS.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8289 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
client applications without including Mac OS system headers, with a gain in speed of
compilation and portability. The source files of all FLTK libraries must now be compiled with
-DFL_LIBRARY under Mac OS X. Make, CMake and Xcode project support files
have been modified accordingly.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8113 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
(1) adding Fl_Device class (and more) for device abstraction
(2) adding Fl_Pinter class (and more) for printing support.
Todo: Code cleanup, update dependencies, remove/replace test print window.
I'm looking into converting the test window popup in a global shortcut
that would pop up the print dialog now...
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7263 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
contains the correct way to transform x,y,w,h into
a CGRect adequate for clipping
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7035 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
- correct window resize in mandelbrot demo
- clip to 1-pixel and 0-pixel width now work
- modifier key presses are now correctly reported
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7029 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
- listing fonts using ATS instead of QD
- made bold and italic fonts work
- returning correct font metrics
One problem came up though: Quartz renders fonts at subpixel positions,
which is great for the overall look, but unfortunatly 'fl_draw' supports
only integer coordinates for printing. As a result, marking a line of text
makes the rest of the line jump by a fractional pixel. Any suggestions to
solve this problem are greatly appreciated!
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3810 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
- Pixmaps now correctly support transparency/masking
- subimage drawing aligned correctly
- lines with a size over 1 always anti-alias
- fl_begin_points/fl_end_points works
- fixed refresh problem for multiple open windows
Will check Linux compile right after this commit to make sure that
I didn't destroy anything.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3800 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
- made multiple contexts for windows, popups and menus work
- still missing: double buffer handling
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3793 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
- added very crude font support
- added line drawing support
- added line color support
- added filled shapes support
- added some arc and circle support (no ovals)
- attempt at getting the clipping working, however the stack oriented
design of Quartz is starting to become a real hassle
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3784 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
on OSX (to allow FLUID and other apps to register a callback to open files)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3016 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Implemented Fl_RGB_Image alpha blending for MacOS X - others still
get 1-bit screen-door transparency...
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2083 ea41ed52-d2ee-0310-a9c1-e6b18d33e121