Commit Graph

7752 Commits

Author SHA1 Message Date
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
Manolo Gouy
bc4662fd23 SVG images: fix image printing under MacOS when not used as a scaled Fl_Shared_Image
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12589 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-13 15:32:20 +00:00
Manolo Gouy
d9a99c64fd Doxygen doc of class Fl_Shared_Image: add that the SVG format is also supported.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12588 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-12 09:23:48 +00:00
Albrecht Schlosser
31e816786e Fix spelling and clarify documentation.
Add a hint that localization of shortcut modifiers fl_local_ctrl
etc. should not be done in static initializers because random static
initialization order might overwrite strings with internal values.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12587 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-08 12:26:50 +00:00
Manolo Gouy
eb763ae432 Further simpler code to initialise the MacOS-specific implementation of Fl_Sys_Menu_Bar_Driver
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12586 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-07 16:10:21 +00:00
Manolo Gouy
2da4cf8b9f Simpler code to initialise the MacOS-specific implementation of Fl_Sys_Menu_Bar_Driver
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12585 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-07 15:35:07 +00:00
Manolo Gouy
dc569ef8fb Make sure GUI is updated after activation of a menu item from Fl_Sys_Menu_Bar
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12584 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-07 08:43:37 +00:00
Manolo Gouy
24a5fa7632 MacOS: support running fl_open_display() in static initializer.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12583 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-06 07:38:05 +00:00
Manolo Gouy
fdbee3daed Doxygen: remove warning
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12582 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-05 16:17:12 +00:00
Manolo Gouy
0a26b0dd68 Some code simplification for class Fl_Sys_Menu_Bar
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12581 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-05 16:05:35 +00:00
Manolo Gouy
82312ed61b Set svn properties.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12580 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-04 17:41:09 +00:00
Manolo Gouy
8612fea277 Make Fl_Sys_Menu_Bar class usable in static initializers.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12579 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-04 17:39:19 +00:00
Manolo Gouy
6586b77975 Restore possibility to run fl_open_display() within a static initializer.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12578 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-03 15:46:12 +00:00
Manolo Gouy
f609261697 Remove Fl_Sys_Menu_Bar.mm from list of input files
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12577 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-03 14:34:47 +00:00
Manolo Gouy
ad7628afed Set proper properties
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12576 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-02 19:17:31 +00:00
Manolo Gouy
34dd1b15fb Converted class Fl_Sys_Menu_Bar to the driver model.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12575 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-02 16:20:30 +00:00
Manolo Gouy
a8fe10cf88 MacOS: use rounded bottom corners when drawing windows
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12574 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-11-30 16:14:13 +00:00
Manolo Gouy
08f72d626c Fl_Widget_Surface::draw(Fl_Widget *widget,...): clip drawing to the window bounds when widget is a window.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12573 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-11-30 13:55:19 +00:00
Manolo Gouy
c354268f44 Top-level menus should not be inactivated. Their items can be.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12572 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-11-27 20:57:52 +00:00
Greg Ercolano
0fb2a55fc8 Fixes issued raised in STR #3422; Fl_Text_Display constructor order issues;
organize member initialization first, method calls last.

Also: 
    Reorg'ed member initialization to match order in .H
    to detect missing member inits.

    Noticed member mModifyingTabDistance is unused.
    Tagged with XXX: but left in place, since it's
    a protected member, and might be utilized by user code.
    We should probably remove this member.



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12570 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-11-23 19:34:33 +00:00
Manolo Gouy
02d58597e9 MacOS native file chooser: STR#3406 continued - restore broken filename preset in save dialog.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12569 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-11-22 12:42:42 +00:00
Greg Ercolano
310c545179 Fixes STR#3428: allows command line to specify alternate html file on Mac platform
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12568 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-11-19 01:18:16 +00:00
Albrecht Schlosser
a877466a21 Fix illegal memory access after free when closing fluid (STR #3427).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12567 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-11-18 18:13:06 +00:00
Albrecht Schlosser
16db9a0c82 Fix crash when closing fluid with Fl_Table (STR #3427).
Many thanks to Chris for the patch!


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12565 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-11-18 17:55:47 +00:00
Albrecht Schlosser
853a716610 Replace remaining calls of getenv() with fl_getenv().
Note: don't use fl_getenv() in Fl_System_Driver and derived classes.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12563 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-11-17 17:25:33 +00:00
Manolo Gouy
f300e00f79 Proper return value from test window::handle() when the event is not processed.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12562 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-11-17 06:52:27 +00:00