Commit Graph

141 Commits

Author SHA1 Message Date
Manolo Gouy
d011d5b4f0 Replace src/Fl_Font.H by one file for each platform.
This file contained nearly only platform-specific code.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11507 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-02 13:22:48 +00:00
Manolo Gouy
43d20bd18a Remove now useless Fl_X::window_ref() function.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11505 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-02 09:44:00 +00:00
Manolo Gouy
d0c8ff09f0 Make constant CoreText_threshold local to file Fl_Quartz_Graphcs_Driver_font.cxx
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11504 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-02 09:41:11 +00:00
Manolo Gouy
ab5252071c Move Fl_X::next_marked_length to the Fl_Cocoa_Screen_Driver class.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11503 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-02 09:34:17 +00:00
Manolo Gouy
4d4b43a6bc Move function Fl_X::calc_mac_os_version() to class Fl_Darwin_System_Driver
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11502 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-02 07:29:09 +00:00
Manolo Gouy
77e5a5c11a Move get_carbon_function() to the Fl_Darwin_System_Driver class where it belongs.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11501 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-02 07:03:18 +00:00
Manolo Gouy
7b37960d95 Move intersect_region_and_rect() to the Quartz driver code where it belongs.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11500 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-02 06:42:34 +00:00
Manolo Gouy
5d12ea5ab1 Move marked text-related data to the Fl_Cocoa_Screen_Driver class.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11488 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-31 19:23:38 +00:00
Manolo Gouy
d67f395031 Rewrite functions XRectangleRegion(), XDestroyRegion() under the driver model.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11479 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-30 20:16:40 +00:00
Manolo Gouy
532e564593 Add #include <FL/Fl_Widget.H> needed in mac.H
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11470 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-29 20:10:37 +00:00
Manolo Gouy
9a521b95b9 Remove useless #include <FL/Fl_Device.H>
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11469 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-29 19:59:34 +00:00
Manolo Gouy
08677d0cb6 Clean mac.H of a few useless #include directives.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11468 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-29 19:52:51 +00:00
Manolo Gouy
aacb5277e7 Rewrite Fl_dnd.cxx under the driver model.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11455 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-28 17:36:07 +00:00
Manolo Gouy
915d6c643a Isolate the definition of the 3 public, OS-dependent types (Fl_Offscreen, Fl_Region, Fl_Bitmask).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11432 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-26 14:36:11 +00:00
Manolo Gouy
6e141d14df Fix the "bizarre makefile build error" due to double declarations of fl_clip_region(Fl_Region).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11416 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-24 05:59:35 +00:00
Manolo Gouy
fdaad858ba Rewrite Fl_Window::iconize() under the driver model.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11411 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-23 18:00:37 +00:00
Manolo Gouy
a114e3ab4d Rewrite Fl_Window::handle(int) under the driver model.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11403 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-23 13:13:00 +00:00
Manolo Gouy
fa9a33eaee Beginning of Albrecht's plan for Fl_Window and Fl_Window_Driver classes.
Still unclear whether the implementation of the flush() functions follows the plan.
The Fl_Printer class is fully rewritten under the driver model.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11364 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-18 18:20:11 +00:00
Manolo Gouy
7decb3d3b2 Rewrite the Fl_Copy_Surface class with strict separation of public API and platform-related code.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11257 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-01 17:20:25 +00:00
Manolo Gouy
0b406baa0f Rewrite all fl_XXX_offscreen() functions so they use an Fl_Image_Surface object.
These functions become therefore platform-independent.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11241 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-27 13:52:27 +00:00
Manolo Gouy
7f17b915db Remove the useless pseudo run-time type information supported by the Fl_Device class.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11217 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-25 17:56:48 +00:00
Matthias Melcher
052401a34e Instantiate the right Fl_Window_Driver.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11195 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-19 22:21:02 +00:00
Matthias Melcher
22d302e242 Add System Driver and Window Driver.
Adding two new driver types for each platform. Fl_..._System_Drivers exist once per application and provide an interface for to file and filename handling, timers, locking, multithreading, etc. .

 The Fl_..._Window_Driver class is instantiated once for every window in the system and corresponds closely to (and actually inherits from) Fl_X. The difference now is, that there is one Fl_X/Fl_Window_Driver base class, and one platform version that derives from it.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11193 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-19 21:41:02 +00:00
Manolo Gouy
f33b45f1d3 Remove all uses of the fl_gc global variable. Towards a clean driver model.
fl_gc remains usable by the application as a hook into the system.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11189 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-18 16:21:51 +00:00
Manolo Gouy
ec290bc9e0 Remove Fl_X::q_fill_context() used only once.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11171 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-14 06:36:20 +00:00
Manolo Gouy
6439f34ee7 Remove Fl_X::q_clear_clipping() used only once.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11170 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-14 06:19:26 +00:00
Manolo Gouy
4af616a7a2 New member function Fl_Quartz_Graphics_Driver::draw_CGImage() used internally for all image drawing.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11165 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-13 14:48:13 +00:00
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
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
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
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
689d19cda3 Added necessary forward type declaration.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10934 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-11-26 17:28:55 +00:00
Manolo Gouy
ff65dbb5ae Mac OS only: added the Fl_Mac_App_Menu::custom_application_menu_items() method
that allows customization of the application menu on the Mac platform.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10932 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-11-26 16:34:58 +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
0d2517331c Mac OS only: simpler definition of the pdfdata private member of the Fl_Copy_Surface class.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10915 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-11-18 15:53:46 +00:00
Manolo Gouy
1c16aaced2 The ATSU API (old API for text formatting) has been removed from SDK 10.11.
This fixes STR#3262

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10878 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-11-03 14:36:36 +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
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
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
634ede015d Define NSInteger in FL/mac.H when needed, so it's available to all source files.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10779 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-06-30 02:23:26 +00:00
Manolo Gouy
f9fa74e3af Restored the possibility to call Fl::set_font()
in a global initializer (before main() starts).


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10726 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-04-28 22:02:48 +00:00
Manolo Gouy
5017171db8 Replace gl_xxx() function names by new member functions of the Fl_X class to avoid
collisions with user-defined symbols.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10548 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-02-02 13:08:51 +00:00
Manolo Gouy
8887600f5f Improved Mac OS X Fl_Gl_Window resizing: the GL scene was drawn twice at each resize operation.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10545 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-01-31 15:08:31 +00:00
Manolo Gouy
64ffd414d6 Stop using dynamic_cast when performing text drag (Mac OS only).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10536 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-01-28 17:05:29 +00:00
Manolo Gouy
2d264fa8d5 A few comment changes.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10531 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-01-22 17:45:09 +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