Commit Graph

197 Commits

Author SHA1 Message Date
Manolo Gouy
a9e2a78bb0 Improve the documentation of scaling factor-related operations.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13013 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-08-09 11:51:38 +00:00
Manolo Gouy
cd399d9898 Support for GUI scaling: add API to get/set the scaling factor value.
Also, define an FLTK event triggered when the scaling is changed and an option
to disable the transient window showing the new scaling factor.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13011 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-08-08 20:08:10 +00:00
Manolo Gouy
c886fe9c33 Add documentation for Fl::reset_marked_text() and Fl::insertion_point_location().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12930 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-05-24 10:58:47 +00:00
Manolo Gouy
ce71c4b679 Add Fl::screen_scale(int) function to get the scaling factor value of a screen.
This allows to keep class Fl_Screen_Driver away from the public API.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12926 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-05-22 17:00:27 +00:00
Greg Ercolano
309d9a61b9 Added Fl::menu_linespacing() to solve STR# 2927.
Method name follows Fl_Tree::linespacing().
Implemented similarly to Fl::scrollbar_size(), since its use crosses Fl_Menu_Item and 'menuwindow' classes.



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12815 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-03-31 17:17:37 +00:00
Albrecht Schlosser
6dbe7ca8ed Fix a doxygen warning, update copyright.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12773 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-03-18 15:25:08 +00:00
Manolo Gouy
06b925964d Remove Fl::run_also_windowless() and FL::wait_also_windowless() from planned public FLTK 1.4 API.
These were introduced at r12647, that is, during development of the 1.4 API.
These functions provided windowless support only on the MacOS platform,
where this can be obtained without those functions.
Windowless support on other platforms would require changing the event 
loop. There's no evidence from STR's there's a demand for windowless mode
on other platforms.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12680 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-02-20 09:08:38 +00:00
Manolo Gouy
4dde3e5485 Documentation: separate the doc of the 2 versions of Fl::add_fd() as Doxygen mandates.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12662 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-02-10 17:51:17 +00:00
Albrecht Schlosser
52ae3582a2 Replace "WIN32" with "_WIN32" or "Windows".
Replace compiler/preprocessor/platform macro "WIN32" with "_WIN32".
Replace "WIN32" in text and documentation with "Windows".
Replace "MSWindows" with "Windows".

To do: README.Windows.txt (and maybe other documentation as well)
needs updates.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12655 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-02-09 14:39:42 +00:00
Manolo Gouy
0c8ca7944a Documentation: add \version info to new member functions.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12651 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-02-08 07:37:43 +00:00
Manolo Gouy
dcc82d8926 STR#3450: Draw text with OpenGL using textures on all platforms.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12650 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-02-07 15:34:44 +00:00
Manolo Gouy
425ab2e8bc Add support for detection and processing of clean program termination request.
The default handling of cmd-Q/Quit program under MacOS was to terminate the
program if all its windows are closed without returning from FLTK's event loop.
This was running against a strong design feature of FLTK that programs
should always complete their event loop and return from main() when cleanly
terminating.

In the new code for the MacOS platform, cmd-Q/Quit program no longer terminates
the program. Instead, the event loop is interrupted and a call to Fl::program_should_quit()
allows to detect that program termination has been requested, if necessary.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12647 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-02-06 17:26:11 +00:00
Albrecht Schlosser
42d8aba117 Replace FL/x.H with FL/platform.H - step 2 (STR #3435).
This second step replaces FL/x.H with FL/platform.H in all source files.
Dependencies have been adjusted as well.

This commit completes the replacement of FL/x.H with FL/platform.H.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12641 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-31 21:17:17 +00:00
Manolo Gouy
eb440f2d70 Doxygen doc: separate the doc of the getter and the setter member functions.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12525 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-10-25 05:26:49 +00:00
Albrecht Schlosser
db1f29fdb5 Update Fl_Widget_Tracker docs with better example code.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12344 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-07-20 15:06:11 +00:00
Manolo Gouy
75e9a9f55c Documentation: restructure the description of function Fl::paste().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11946 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-09-16 09:27:32 +00:00
Manolo Gouy
048bb2b0f6 Documentation: detail ownership of the image data when pasting from an image-containing clipboard.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11714 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-05-05 08:35:52 +00:00
Manolo Gouy
d47b431750 Fix potential memory leak under X11 when pasted image is not accepted by the receiving app.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11709 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-05-03 14:28:45 +00:00
Manolo Gouy
163c65dc6f Avoid the expression "foreign language" in comments.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11676 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-20 07:19:19 +00:00
Matthias Melcher
769d151a12 Virtualized add_fd and remove_fd into System Driver
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11668 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-19 22:45:22 +00:00
Manolo Gouy
2fcb4f4192 Move platform-dependent implementations of fl_open/close_display() to the Fl_Screen_Driver class
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11619 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-15 15:36:10 +00:00
Manolo Gouy
7508a033c5 Continue moving to Fl_System_Driver the platform_dependent implementations of member functions of the Fl class.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11614 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-15 14:18:37 +00:00
Albrecht Schlosser
d56e2ec9f0 Fix typos.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11560 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-09 10:42:17 +00:00
Albrecht Schlosser
f120334da3 Fix Doxygen warnings.
There was one obvious warning in src/fl_read_image.cxx, but others
have to do with incomplete code and platform specific definitions.

I'm not entirely happy with these changes. Temporary changes have been
marked with 'FIXME' and should be removed later if possible.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11547 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-06 22:20:32 +00:00
Albrecht Schlosser
020a96b4a8 Fix more compiler warnings.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11536 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-05 21:15:45 +00:00
Manolo Gouy
f1a157bdd9 Replace Fl_System_Driver::driver() by Fl::system_driver()
for coherence with the Fl::screen_driver() function.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11494 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-01 10:28:03 +00:00
Manolo Gouy
56e145a1c8 Complete removing platform-dependent code from the Fl.H header file.
Type FL_SOCKET is now declared in Fl_System_Driver.H with all other
platform-dependent public types.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11484 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-31 11:01:07 +00:00
Manolo Gouy
3ca402b609 Continue removing platform-dependent code from the Fl.H header file.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11483 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-31 06:47:15 +00:00
Manolo Gouy
059664e7d4 Begin to remove platform-dependent code from the Fl.H header file.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11482 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-31 06:24:26 +00:00
Albrecht Schlosser
de9dc764f1 Move fl_local_* decl. and short docs back to FL/Fl.H.
Note: these declarations must be in an (official) public header.
FL/Fl_System_Driver.H should not be included in user space.

Maybe move FL/Fl_System_Driver.H to src/drivers ?


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11427 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-26 01:39:22 +00:00
Manolo Gouy
a69133d317 Separating platform-dependent from platform-independent code: make src/Fl.cxx cross-platform.
File src/Fl_win32.cxx is now compiled instead of included in Fl.cxx.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11420 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-25 13:08:48 +00:00
Albrecht Schlosser
c1fe316855 Add localization of modifier key names in shortcut labels.
Modifier key names like Alt, Shift, Ctrl, Meta can now be localized by
setting global string pointers. See documentation of fl_shortcut_label().

Port branch-1.3, svn r 11321.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11354 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-12 17:44:24 +00:00
Matthias Melcher
53859c584f Add support for SDL as a base library on OS X.
This commit adds the basic setup in CMake to allow SDL as a base
library for FLTK on OS X (and probably for other platforms as well).

The SDL library driver set is derived from yet another new driver
set named 'Pico'. 'Pico' is a base class for a driver that will
allow porting of FLTK with the tinyest amount of effort. This 
implementation of the SDL driver shall be documented very well
to explain the porting process.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11262 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-02 00:54:37 +00:00
Manolo Gouy
6097c134d8 Avoid static initializers to allow FLTK usage in static initializers.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11213 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-24 08:07:30 +00:00
Albrecht Schlosser
8630bdbed2 [Cairo] Remove part of the dependency of FL/Fl.H on config.h.
To use Fl_Cairo_Window one did not only need to configure with --enable-cairo,
but also needed to #include <config.h> before #include <FL/Fl.H>.

This commit removes the smaller part of the dependency of the public header
file FL/Fl.H on config.h. This needs a better solution in FLTK 1.4.0.

The user still needs to define FLTK_HAVE_CAIRO _before_ #include <FL/Fl.H>.

Note: This is not compatible with fluid, since fluid _always_ includes
FL/Fl.H as the first statement in generated header files.

See also the discussion in fltk.general:

https://groups.google.com/d/msg/fltkgeneral/_C1OJhMLQl0/pHUFtz9SCwAJ

Note: also fixed a typo in src/drivers/X11/Fl_X11_Screen_Driver.cxx


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11168 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-13 18:02:17 +00:00
Matthias Melcher
d8f96b579d Moed Fl::visual and System_Scheme to the driver
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11166 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-13 16:12:57 +00:00
Matthias Melcher
5d1df0e789 Details on PORTME items. Move fl_parse_color() to screen drivers.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11163 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-13 12:57:00 +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
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
Ian MacArthur
5aefd057d1 Non-changing changes... Attempting to keep the porting branch somehwat in-sync with doc changes in main 1.3.x
None of these changes alter the actual code.



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11076 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-28 17:16:32 +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
Matthias Melcher
b86f2f735a Replaced static initializer with Fl_OpenGL_Display_Device.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11008 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-18 22:55:46 +00:00
Matthias Melcher
884928f68c Fixed stupid typo in variable name
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11007 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-18 21:23:54 +00:00
Matthias Melcher
eb8207ff1b Trying to create a more detaild way to configure the library, added runtime information, added an OpenGL graphics driver that renders a button on top of an OpenGL window (see test/cube).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11006 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-17 00:44:07 +00:00
Matthias Melcher
b1520373ae Created pseudo code for all FL_PORTED section so that FLTK compiles and links (Xcode, hello, other C flags: -D FL_PORTING -U __APPLE__ -U __APPLE_QUARTZ__)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@10993 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-04 23:09:32 +00:00
Matthias Melcher
acf6c881d3 Updated platform specific #if's to report unimplemented code when compiling with FL_PORTING defined and WIN32 and __APPLE__ undefined>
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@10989 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-03 22:54:29 +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
Albrecht Schlosser
43e4f8a661 Fix doxygen comment of Fl::abi_check()
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10875 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-10-24 09:55:18 +00:00
Albrecht Schlosser
4cea3aee0c Fix box background drawing for deactivated widgets (STR #2907).
Two new static methods have been introduced:

  - Fl::box_color(Fl_Color c) returns the bg color dependent on the
    widget's state (inactive_r()).
  - Fl::set_box_color(Fl_Color c) sets the correct bg color dependent
    on the widget's state by calling fl_color(Fl::box_color(c)).


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10781 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-07-09 00:10:44 +00:00