Commit Graph

6427 Commits

Author SHA1 Message Date
Albrecht Schlosser
2b6c2bc7af Make VisualC2008/2010 projects create FL/abi-version.h (STR #3249).
First step towards a hopefully clean creation of FL/abi-version.h for all
Windows (Visual Studio) and maybe also Xcode projects (if necessary) in
order to "simulate" configure and CMake methods to create this file.

I could only modify the VisualC2008 and VisualC2010 project files, because
I don't have VisualC6 and/or Xcode. Help needed...

To do for remaining <ide> directories (ide/VisualC6 and maybe ide/Xcode4):

 (1) Remove <ide>/FL folders including <ide>/FL/abi-version.h.
 (2) Add a Pre-Build event or equivalent on project 'fltk' for all
     potential build configurations (Debug, Release, ...)
 (3) Maybe add project dependencies to ensure that the Pre-Build event
     of project 'fltk' is executed before all other projects.

Notes:

 (a) Command line for Pre-Build events of VS2008/2010:
     "copy /Y $(SolutionDir)..\..\abi-version.ide $(SolutionDir)..\..\FL\abi-version.h"
     Something similar should work for VC6 as well.

 (b) While building the projects I found some wrong output settings in zlib
     projects. These have been fixed in this commit as well (unrelated).
     
 (c) .gitignore has been extended to ignore all intermediate build files
     of VS2008/VS2010 ide projects.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@11010 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-19 14:02:10 +00:00
Albrecht Schlosser
797e4d60cc Fix undefined reference building shared cairo library (STR #3276).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@11005 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-16 01:48:04 +00:00
Manolo Gouy
7523748660 Mention new method Fl_Image_Surface::draw_decorated_window().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@11000 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-07 05:09:11 +00:00
Manolo Gouy
739e4a8eaf Mac OS: improved the Fl_Image_Surface class so it returns an RGBA image
allowing to draw exactly windows with rounded corners.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10999 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-06 20:47:39 +00:00
Manolo Gouy
2f642a51c9 Fixed typo.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10998 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-06 20:41:57 +00:00
Manolo Gouy
c9712614df 1) The Fl_Window::decorated_h() computation was incorrect under MSWindows10
because it did not use the correct dwmapi.dll - based implementation.
This commit uses the correct way to compute the width and height of window
borders in Fl_Window::decorated_h() and in Fl_Paged_Device::draw_decorated_window().

2) Fixed the computation of enhanced metafile units that correspond to a given pixel size
used by the Fl_Copy_Surface class on the WIN32 platform.

Tested with MSWindows XP, 7 and 10 using the device test app.



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10997 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-05 11:59:08 +00:00
Manolo Gouy
95fb87eff5 1) For the X11 and the Mac OS platforms, a default font (FL_HELVETICA, FL_NORMAL_SIZE)
is used when fl_draw() is called while no font has been set before. This commit does the same
on the MSWindows platform, for consistency.

2) Slightly improved Fl_Image_Surface::draw_decorated_window() under WIN32.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10996 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-05 05:48:58 +00:00
Manolo Gouy
94e2c48f5f Implemented Fl_Image_Surface::draw_decorated_window().
This gives the same drawing capabilities to all supported drawing 
surfaces: display, printer, clipboard, in-memory bitmap image,
PostScript file.

Also, completed the Mac OS implementation of 
Fl_Copy_Surface::draw_decorated_window(Fl_Window *win, int delta_x=0, int delta_y=0)
that did not honor non-zero last arguments.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10990 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-04 13:16:23 +00:00
Manolo Gouy
d37269a23b The changes introduced at r.10921 destroyed program-controlled window resizing.
This change hopefully repairs that.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10987 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-31 10:39:51 +00:00
Manolo Gouy
69ec698e41 Mac OS: modified CMake config files to allow use of OPTION_APPLE_X11
to build an X11-using version of FLTK on the Mac OS platform.
This matches the recent support of the --enable-x11 option
by the configure script on the mac.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10986 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-31 06:19:59 +00:00
Albrecht Schlosser
3beb45165a [CMake] config.h, part 2 - full compatibility with autoconf.
This commit makes the file config.h generated by CMake 100% compatible
with the one generated by autoconf/configure.

Fixes in this commit:
 - Set FLTK_DATADIR and FLTK_DOCDIR with the same default values.
   Note: needs some cleanup, option values are not clear, '/fltk'
   is currently appended in export.cmake (needs improvement).
 - Simulation of autoconf macro AC_HEADER_DIRENT for correct
   definition of only one 'dirent' header file.
 - Fix more function checks:
    - dlsym
    - png_get_valid
    - png_set_tRNS_to_alpha
 - Improve "Big Endian" check for __APPLE__ (mac_endianness.h).


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10985 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-30 21:13:07 +00:00
Albrecht Schlosser
4f5e6e7732 Harmonize configure and CMake build system (part 1).
The files "config.h" generated by configure and CMake are now almost
identical, except a few comments and some still missing or failing
config tests, for instance checks for some functions in libraries.
[Note: tested and compared on Linux.]

configh.cmake.in: Fixed many #cmakedefine and #cmakedefine01 statements
  so they #define their variables as 0 or 1, or /* #undef */ it, resp.,
  as it is done in the configure build.

Added tests:
  - libXrender

Fixed tests:
  - function glXGetProcAddressARB

Todo (still failing tests in CMake):
  - HAVE_PNG_GET_VALID
  - HAVE_PNG_SET_TRNS_TO_ALPHA
  - HAVE_DLSYM

Other remaining issues:
  - compiler flags introduced in configure/make build
  - HAVE_SYS_NDIR_H - maybe missing test in configure ?
  - HAVE_SYS_DIR_H  - maybe missing test in configure ?
  - HAVE_NDIR_H     - maybe missing test in configure ?
  - WORDS_BIGENDIAN and #include <mac_endianness.h> ...
    i.e. Mac OS X specific #include needed or not ?



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10984 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-30 14:37:35 +00:00
Albrecht Schlosser
17c4817592 Add configure and CMake checks for X11/Xregion.h.
Configure and CMake now both check if X11/Xregion.h exists on the
build system and set HAVE_X11_XREGION_H in config.h accordingly.

src/Fl_Pixmap.cxx: modified to use the configure test as proposed by Manolo
in fltk.coredev on Dec 13 2015 in thread "Using X11 backend on OS X".


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10983 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-30 12:10:15 +00:00
Manolo Gouy
bb4f485708 Mac OS: add if(APPLE condition to Mac OS-specific target property.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10982 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-29 16:50:50 +00:00
Manolo Gouy
8ac33d6b71 Mac OS: Enhanced the application bundle for the editor demo
so it is launchable by dropping any file on its icon. This is
done both for the configure/make and the CMake build systems
(the Xcode build system did that already).
The editor demo is the only one calling fl_open_callback().


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10981 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-29 16:41:15 +00:00
Manolo Gouy
fdd1369292 Mac OS + CMake: this file is used by CMake to build the Info.plist files of the application
bundles it creates. This makes these apps support retina displays, because
the file contains
	<key>NSHighResolutionCapable</key>
	<true/>


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10980 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-26 16:14:19 +00:00
Manolo Gouy
59823515cf Mac OS: It is not necessary to open the display to send the
+[NSWindow  frameRectForContentRect:styleMask:] message
(checked on 10.11 and 10.3). Therefore fluid -c will run without
opening the display.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10979 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-23 09:33:06 +00:00
Manolo Gouy
527d5943d0 Mac OS: when an app is asked to open a file by Applescript, have it redraw itself
without waiting for the next event to come, because AppleScript does not break the
event loop.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10978 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-23 07:34:49 +00:00
Manolo Gouy
ca5811e8bc Documentation only: removed warnings that appeared with Doxygen 1.8.10
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10977 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-22 11:49:03 +00:00
Manolo Gouy
6eb4354996 Doc change only: clearly document that FLTK has at any time a current drawing surface and a current graphics device.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10976 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-22 10:15:28 +00:00
Manolo Gouy
25fc85190e Mac OS: Fix for STR#3268 where a fullscreen window could become relocated
behind the menu bar and dock.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10975 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-21 13:38:49 +00:00
Manolo Gouy
9c2a7e4a72 FLTK code and fluid-generated code can be used in static initializers.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10974 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-19 07:27:11 +00:00
Manolo Gouy
309a76e81c Trying to find how to best write the // "$Id$" lines in src/Fl_File_Chooser.fl
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10973 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-19 06:35:26 +00:00
Manolo Gouy
43bfe74b25 Running FLTK in static initializers (cont'd):
1) Changed the way fluid attaches images to widgets and menu items so
it is compatible with running fluid-generated code containing such images
in a static initializer. Images are now attached calling a function:
  widget->image( image_function_name() );
and this function is defined before in fluid-generated code as:
   static Fl_Image *image_function_name() {
     static Fl_Image *image = new image_type(......);
     return image;
   }

2) Changed src/Fl_File_Chooser.fl so the source code generate by fluid
from it is compatible with running in a static initializer.

3) Changed src/Fl_File_Chooser.cxx and FL/Fl_File_Chooser.H
to the result of running fluid on src/Fl_File_Chooser.fl 

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10972 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-18 18:56:58 +00:00
Manolo Gouy
5c7ef30341 Running FLTK in static initializers (cont'd):
To make sure that fl_graphics_driver is initialized, it is enough to test whether it is null.
This saves the memory cost of a static variable.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10971 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-16 10:22:13 +00:00
Manolo Gouy
1b548ae1d5 Running FLTK in static initializers (cont'd):
the static method Fl_Surface_Device::surface() can be called before main() starts.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10970 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-16 07:18:34 +00:00
Manolo Gouy
ca491166b9 Better description of --enable-x11 by configure --help
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10969 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-15 17:43:50 +00:00
Manolo Gouy
fc89c11ddf Mention the --enable-x11 configure option is now allowed on the Mac OS platform.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10968 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-15 17:34:47 +00:00
Manolo Gouy
872d20ca61 Allow use of ./configure -enable-x11 on the Mac OS platform
to create an X11-using version of FLTK.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10967 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-15 16:53:52 +00:00
Albrecht Schlosser
14669685d8 Fix Fl_Browser if text argument to some methods is NULL (STR #3269).
Fl_Browser::add(), Fl_Browser::insert(), and Fl_Browser::text() didn't
test if the provided text argument was NULL, although this was explicitly
allowed in the documentation.

Also applied some minor documentation fixes.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10966 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-15 10:16:56 +00:00
Manolo Gouy
dd8c33b19a Mac OS: it is clearer to initialize the fl_fonts global variable in font-related code.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10965 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-15 08:31:20 +00:00
Manolo Gouy
291cf838bf Allowing to use FLTK objects in static initializers (cont'd).
Mac OS: a more convenient position where to initialize the fl_fonts global variable.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10964 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-13 13:24:17 +00:00
Manolo Gouy
69644d4032 Allowing to use FLTK objects in static initializers (cont'd).
Case of Fl_Native_File_Chooser.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10963 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-13 10:26:09 +00:00
Manolo Gouy
09cd712c0d Allowing to use FLTK objects in static initializers (cont'd).
On the Mac platform, it is also necessary to change the initialization of 
the macKeyLookUp array for keyboard events to work in a static
initializer.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10962 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-13 09:51:07 +00:00
Manolo Gouy
cf14f77a90 Allowing to use FLTK objects in static initializers (cont'd).
For fl_file_chooser() and Fl_File_Chooser objects.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10961 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-13 09:36:14 +00:00
Manolo Gouy
6bdb661c2a Allowing to use FLTK objects in static initializers (cont'd).
On the Mac platform, it's also necessary to initialize the fl_fonts
global variable.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10960 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-13 08:38:16 +00:00
Manolo Gouy
6a608d4862 Restore the possibility to construct FLTK objects and draw them within static initializers
(which run before main() begins in an uncontrolled order). This was failing because
calls to drawing functions (e.g., fl_font(f,s);) crashed due to uninitialized fl_graphics_driver
global variable.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10959 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-13 06:55:30 +00:00
Manolo Gouy
fe92bbed66 Allow compilation with old Mac OS versions + USE_X11 mode with which
header X11/Xregion.h is not available.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10958 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-12 15:33:56 +00:00
Manolo Gouy
5090e949fa Added eol-style property.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10957 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-10 16:27:03 +00:00
Manolo Gouy
dde14ee174 Added svn:keywords properties.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10956 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-10 16:25:34 +00:00
Manolo Gouy
3e8556195b Added required header and footer for new source files.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10955 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-10 16:20:37 +00:00
Manolo Gouy
8d1d2df0c2 Mac OS: using true system windows for FLTK sub-Fl_Window's.
Improved handling of the situations where a subwindow is created,
hidden, the parent window resized, and the subwindow shown,
with a new size. This change no longer sends setFrame: or setFrameOrigin:
messages to hidden subwindows. Instead, subwindows acquire their correct
size and position when they are shown again and Fl_X::map() is called.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10954 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-09 12:52:17 +00:00
Manolo Gouy
c7950b30c4 Mac OS: the present code asks the system to build the mini window image when a subwindow-less window is miniaturized,
and builds itself the image when a window with subwindow is miniaturized. That is mostly OK, but it fails when a window
containing a subwindow is miniaturized (a mini image is computed), deminiaturized, the subwindow is removed
or hidden, and the window is miniaturized again: the old mini image is used, and that is not appropriate.
The solution is to remove the FLTK-computed mini image when a window with subwindow is deminiaturized.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10953 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-09 10:13:46 +00:00
Manolo Gouy
4bc4736eb7 Replaced call to Fl_Window::resize() by call to Fl_Widget::position() that is enough.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10952 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-08 09:39:42 +00:00
Manolo Gouy
ade095f240 Mac OS: added visibility test necessary after a subwindow-containing group was hidden.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10951 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-07 20:10:07 +00:00
Manolo Gouy
caba454f39 Mac OS: removed some code that was duplicated by checkSubwindowFrame run later.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10950 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-07 17:53:26 +00:00
Manolo Gouy
6ccbedb5db Better deployment targets for the Release configuration.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10949 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-03 17:27:37 +00:00
Manolo Gouy
f79f70b96a Removed compilation warning with SDKs 10.3 and 10.4u
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10948 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-03 17:18:33 +00:00
Manolo Gouy
58afd21c73 Mac OS: send the setWantsBestResolutionOpenGLSurface:YES message in
Fl_X::create_GLcontext_for_window() where it is directly relevant.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10947 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-02 14:22:52 +00:00
Albrecht Schlosser
8a826c257d Fix Doxygen docs of new method Fl_Gl_Window::pixels_per_unit().
Moved the docs up (before #ifdef ...) so they are also generated on
Mac OS X platforms.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10946 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-02 11:56:25 +00:00