Commit Graph

7939 Commits

Author SHA1 Message Date
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
Manolo Gouy
15750ea378 MacOS: Fix STR#3406 where native file chooser does not show preset file
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12561 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-11-13 21:41:33 +00:00
Manolo Gouy
00eef649ca MacOS: complete commit at r.12559 that contained a typo.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12560 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-11-13 14:47:49 +00:00
Manolo Gouy
b171a28de4 MacOS: make -[FLWindowDelegate windowShouldClose:] more robust by testing for NULL pointer.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12559 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-11-13 14:43:58 +00:00
Albrecht Schlosser
f3896460d6 Replace chdir() with new wrapper fl_chdir().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12558 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-11-12 18:00:45 +00:00
Manolo Gouy
cfdc38f760 MacOS: improve drawing of rounded corners of window titlebar
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12557 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-11-12 08:00:21 +00:00
Albrecht Schlosser
f4f4030cc2 Refactor Fl_WinAPI_System_Driver string conversion and more.
Remove duplicated code by using local (static) string conversion functions.
This makes the code better maintainable and removes redundancies.

Rename some variables (particularly one-letter names) to more useful
names, minor code reformatting to be more compatible with the CMP.

To do: check for potential memory leaks, maybe free temporary buffers.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12556 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-11-11 21:23:15 +00:00
Manolo Gouy
10143bc50a Test commit
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12555 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-11-11 10:54:52 +00:00
Manolo Gouy
9646c04b54 Test commit
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12554 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-11-11 09:46:58 +00:00
Manolo Gouy
6a7008684f Test commit
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12553 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-11-11 09:45:16 +00:00
Manolo Gouy
5ac0d892c1 Test commit
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12552 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-11-11 09:44:09 +00:00
Manolo Gouy
ee929944ce Minor reformatting
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12551 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-11-11 09:04:26 +00:00
Manolo Gouy
7356d4ef21 Make a comment more detailed
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12550 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-11-11 09:01:51 +00:00
Albrecht Schlosser
4a088d28f5 Add missing platform wrapper fl_chdir() for chdir().
Tested under Windows and Linux, but not yet used in library code.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12549 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-11-10 12:56:00 +00:00