Commit Graph

7977 Commits

Author SHA1 Message Date
Albrecht Schlosser
716924d1d4 Fix remaining issue in FL/porting.H.
This file is not used in the normal build process but was intended to
be used as a template for a platform specific file. This is likely
obsolete anyway since the new driver approach no longer uses #ifdef's
to separate platform specific code.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12643 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-31 22:49:52 +00:00
Albrecht Schlosser
1d97f94e56 Fix broken Windows and macOS builds.
The check whether mac.H or win32.H were included directly was wrong
after the recent rename of x.H to platform.H.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12642 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-31 22:34:48 +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
Albrecht Schlosser
cc595ce4ed Replace FL/x.H with FL/platform.H - step 1.
This first step replaces FL/x.H with FL/platform.H but keeps a small
FL/x.H that #include's FL/platform.H for backwards compatibility.
Documentation sources in documentation/src/*.dox have been fixed,
but references in other source files need to be fixed in another step.
Dependencies have been adjusted.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12640 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-31 17:46:48 +00:00
Manolo Gouy
12a2fc2a4d X11+pango: correct y position of text in line that was bad for some non-latin scripts and some pango versions.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12639 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-18 13:45:45 +00:00
Albrecht Schlosser
18d9891970 Add missing CMake variable FL_VERSION for doxygen docs generation.
Thanks to Jakub Tata-Tyczyński for finding this and reporting it in
fltk.coredev.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12638 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-16 23:45:45 +00:00
Albrecht Schlosser
6408823b3c Remove obsolete replacement of CMAKE_SOURCE_DIR.
The correct fix in the previous commit (svn r12636) would have been to
replace CMAKE_SOURCE_DIR with FLTK_SOURCE_DIR since CMAKE_SOURCE_DIR is
no longer used in doxygen docs generation. Sorry for the noise.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12637 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-16 23:37:14 +00:00
Ian MacArthur
98413277a8 Implement Jakub's patch for the missing FLTK_SOURCE_DIR in
the doxyfile generation of the html docs.



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12636 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-16 22:17:58 +00:00
Manolo Gouy
fab28479c7 Avoid crash in Fl_Pixmap::copy() when the source Fl_Pixmap contains bad pixmap data.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12635 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-16 06:21:16 +00:00
Albrecht Schlosser
a000e12d6c Fix invalid porsche1.xpm file.
test/pixmaps/porsche1.xpm was likely an experimental version of file
test/pixmaps/porsche.xpm. I fixed it instead of removing because it
looks nice as well.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12634 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-16 03:05:35 +00:00
Albrecht Schlosser
fbcd3a908a Clarify documentation of Fl_Boxtype.
Fl_Boxtype enum values with leading underscore are reserved and should
not be used. Use the name w/o leading underscore instead.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12633 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-15 15:02:13 +00:00
Manolo Gouy
8a179b577f configure: add checks to avoid incompatible options --disable-xft and --enable-pango and to detect if pango is found but not Xft.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12632 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-15 07:09:52 +00:00
Albrecht Schlosser
baffc84fa1 CMake: test option compatibility: Pango requires Xft.
Abort CMake configuration/generation if Xft is disabled or not found
but Pango is requested because Pango requires Xft support. A detailed
warning message is issued before the CMake generation is aborted.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12631 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-14 19:34:39 +00:00
Albrecht Schlosser
7aef0cad39 CMake: enable building FLTK in a subdirectory of another project.
Basically replace CMAKE_XXX_DIR with CMAKE_CURRENT_XXX_DIR where
XXX = SOURCE or BINARY.

Patch proposal by cleanrock, FLTK PR #4:
https://github.com/fltk/test-only/pull/4

Patch modified to fix target dirs for test programs and doxygen docs.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12630 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-10 20:49:03 +00:00
Manolo Gouy
b47dc05909 Fl_Sys_Menu_Bar under MacOS: prevent the FLTK object from receiving events.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12629 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-09 21:12:35 +00:00
Manolo Gouy
3b437dae8c Put a default implementation of parse_color() in Fl_Screen_Driver and only Fl_X11_Screen_Driver reimplements it.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12628 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-09 07:26:49 +00:00
Manolo Gouy
9f0e9ff813 MacOS + CMake: restore use of OPTION_APPLE_X11 under MacOS 10.13
It's necessary to compile with -mmacosx-version-min=10.8 
and to link with -lfontconfig when Xft is used

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12627 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-08 20:52:48 +00:00
Manolo Gouy
c462635e88 MacOS configure --enable-x11: add needed compilation option under MacOS 10.13
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12626 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-08 10:19:19 +00:00
Manolo Gouy
46d8ef2c1d MacOS: More accurate coordinate computation in rect_to_NSBitmapImageRep() when GUI is rescaled.
The modified statement uses the window height in graphics coordinates that has been truncated to
integer at window creation and resize.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12625 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-07 18:16:52 +00:00
Manolo Gouy
8befad4dba Make Fl_Quartz_Graphics_Driver treat line width similarly with lines and loops
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12622 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-05 16:01:39 +00:00
Manolo Gouy
32676b5f56 Some cleaning in comments
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12621 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-05 08:16:42 +00:00
Manolo Gouy
b4521fd1bf Add necessary inline implementation of Fl_SVG_Image::copy(void).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12620 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-04 15:45:59 +00:00
Manolo Gouy
1a341391e7 Add Doxygen comments explaining the purpose of Fl_Window_Driver::draw_begin()/draw_end().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12619 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-04 15:23:18 +00:00
Manolo Gouy
8fccb73842 Restore correct fl_overlay_rect() when GUI is scaled (was broken by commit r.12595)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12618 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-03 16:28:00 +00:00
Manolo Gouy
5d97cf1f96 Fix comment.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12617 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-30 10:43:36 +00:00
Greg Ercolano
a7a4098644 Remove the requirement for opengl in fltk-config.
opengl apps were left out of the targets list on purpose
so that only non-opengl apps would build.

TODO: Determine a way to detect the presence of fltk opengl libs
      from within the Makefile using only fltk-config, so as to 
      conditionally build the opengl examples.

      Do NOT use fltk's own build system (../makeinclude or cmake)
      to determine this, so the Makefiles will work as user examples.



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12616 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-29 18:47:28 +00:00
Manolo Gouy
2d7a670e28 Remove 'friend class Fl_PicoSDL_Window_Driver' from Fl_Window.H
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12615 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-29 07:45:27 +00:00
Manolo Gouy
b2ce33fcfd Definition of class Fl_Window: use 'private:' more accurately
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12614 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-29 07:25:50 +00:00
Albrecht Schlosser
cf198735de CMake: Fix missing WIN32 definition on Windows platforms.
Although some Windows compilers still #define WIN32, more and more
standard compliant compilers only #define _WIN32. FLTK *did* #define
WIN32 for all Windows targets with autoconf/configure, but that bit
was lost for CMake builds. This is necessary until we replace WIN32
with _WIN32 throughout the Windows specific code.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12612 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-28 22:59:44 +00:00
Manolo Gouy
d13bb6b40f GUI rescaling under MacOS: fix Fl_Cocoa_Screen_Driver::read_image() - continued
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12610 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-27 13:54:52 +00:00
Manolo Gouy
7abda5a59b GUI rescaling under MacOS: fix Fl_Cocoa_Screen_Driver::read_image() when reading from scaled offscreen buffer
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12609 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-27 13:51:41 +00:00
Manolo Gouy
7aa6b582ee Support for GUI rescaling: fix fl_copy_offscreen() to PostScript surface under X11.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12608 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-27 11:02:14 +00:00
Manolo Gouy
c6045962db Continue support for GUI rescaling under MacOS: fix test/resize() application - continued
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12607 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-27 07:48:52 +00:00
Manolo Gouy
d6a0e4a010 Continue support for GUI rescaling under MacOS: fix test/resize() application
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12606 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-27 07:46:50 +00:00
Manolo Gouy
7758d472c2 Continue support for GUI rescaling under MacOS: fix fl_XXX_offscreen() functions and Fl_Image_Surface class
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12605 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-26 16:07:51 +00:00
Manolo Gouy
8ee87d15e3 Continue support for GUI rescaling under MacOS: fix Fl_Cocoa_Window_Driver::capture_titlebar_and_borders()
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12604 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-24 07:20:25 +00:00
Manolo Gouy
e1893334fd Continue support for GUI rescaling under MacOS: fix Fl_Overlay_Window.
This patch also improves by simplification the code of class Fl_Quartz_Image_Surface_Driver:
because, under the driver model, there's a separate graphics content for the display and for 
each offscreen buffer, it's possible to reverse the drawing orientation (draw from top to bottom) 
once at offscreen creation. It's thus no longer necessary to reverse orientation in 
Fl_Quartz_Graphics_Driver::restore_clip() specifically for offscreen buffers.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12603 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-23 06:34:42 +00:00
Manolo Gouy
c44382e973 Scaling capability under MacOS platform: fix capture of scaled window.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12602 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-19 14:14:42 +00:00
Albrecht Schlosser
d8911c5603 Update .clang-format, improve comments.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12601 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-19 13:26:38 +00:00
Manolo Gouy
5a579962a6 Fix Fl_GDI_Graphics_Driver::uncache(Fl_RGB_Image*,...) that did not delete correctly the cached offscreen object.
This bug was detected by a test program that rotates an SVG image. But it's not related to SVG,
and concerns any Fl_RGB_Image on the WIN32 platform. It was introduced when
image support was modified according to the driver model.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12600 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-19 12:56:24 +00:00
Albrecht Schlosser
52d4fef698 Fix indenting and formatting according to the CMP.
Sorry for the big commit. There were so many indenting and formatting
issues in src/Fl_win32.cxx that I decided to reformat it with clang-format
(see previous commit). However, this commit is not the direct result
of using clang-format - I adjusted some parts of the code manually.

Other manual changes: I ...

 - reordered some #define's and added comments
 - added comments to switch/case/break statements and {} for clarity
 - moved a few 'break' statements inside or outside of braces {}

There should not be any code changes though, i.e. the compiled object
code should be identical.



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12599 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-19 12:52:57 +00:00
Albrecht Schlosser
2c112af865 Add an experimental .clang-format file.
This file can be used with clang-format to format c and c++ source
files according to the FLTK CMP -- at least "almost" in its current
version. It should not (yet) be used without further checking of the
result.

Note: there are some deliberate non-conformant formattings in current
source files, such as formatting like (better readable?) tables with
columns etc.. Such special formatting can be preserved with clang-format
"pragma's" (see documentation in .clang-format), but this needs source
file changes before formatting.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12598 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-19 12:41:47 +00:00
Manolo Gouy
0a4dcddfcd Fix bug when drawing text with Fl_OpenGL_Graphics_Driver and scaled GUI.
The bug appeared in test/cube where the "Text" string was mispositioned
when the app was rescaled.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12597 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-18 16:34:59 +00:00
Manolo Gouy
d361de4d0d STR#3437 : Support display of windows in tabbed form as in MacOS 10.12 Sierra
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12596 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-18 15:19:15 +00:00
Manolo Gouy
f24ee501b9 STR#3320 continued: make sure there's no undrawn space between nested rectangles and images.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12595 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-18 12:13:33 +00:00
Manolo Gouy
3f9f4debbb STR#3444: Add MacOS support for application rescaling (not quite complete)
With this, most MacOS FLTK app can be scaled with command/+/-/0/ keystrokes.
A scaling problem remains, visible in test/cube, where the "Test" string is not positioned correctly.

GLUT apps can also be scaled (across platforms).

SVG images are re-rasterized after app scaling for optimal drawing.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12594 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-18 08:52:55 +00:00
Manolo Gouy
31f16205cb Fl_Window_Driver constructor: initialise wait_for_expose_value to 0.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12593 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-17 06:47:37 +00:00
Manolo Gouy
e3d9c46869 Initialize all member variables in the Fl_Window_Driver constructor.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12592 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-16 13:29:51 +00:00
Albrecht Schlosser
0e1916de51 Remove VS specific #pragma comment (lib, ...).
This Visual Studio specific pragma hides missing library references
on Visual Studio builds, but since comctl32 is not the only necessary
Windows dll and this has never been extended to other libs, this pragma
is unnecessary and potentially confusing, so I removed it.

Documentation of dependencies mentions comctl32 (and more) and future
CMake generation of user project VS IDE files can reference the FLTK
dependencies by internal (CMake) means anyway.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12591 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-15 13:04:07 +00:00
Albrecht Schlosser
0a61f9d739 Improve schemes unittest (add selection colors to buttons).
Use check and radio buttons with different selection colors to
verify selection colors with different schemes.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12590 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-13 18:30:19 +00:00