Commit Graph

1458 Commits

Author SHA1 Message Date
Manolo Gouy 2d52a3494d Rewrite Fl_Image_Surface with full separation of public API and platform-specific implementation.
File Fl_Image_Surface.cxx still needs to be cut in several platform-specific files.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11273 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-02 22:10:03 +00:00
Albrecht Schlosser 35c4ae5527 Don't expose X11 headers in user space any more (mostly).
Platform headers should not be #include'd in public FLTK header files,
so that user space is not polluted by platform specific definitions.

See discussion and test file in discussion in fltk.general:
https://groups.google.com/forum/#!topic/fltkgeneral/gzmdRk2LvAk
https://groups.google.com/d/msg/fltkgeneral/gzmdRk2LvAk/EOe314ChBgAJ

This commit fixes FL/fl_utf8.h to #include X11 headers only if compiled
in the FLTK library (same as in FLTK 1.3.4, svn r 11266).

Todo (FLTK 1.4): Remove more unnecessary (unwanted) system header #include
statements from FL/x.H and other public header files.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11268 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-02 12:40:53 +00:00
Manolo Gouy 39fdbecd16 Finalize new implementation of Fl_Copy_Surface.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11267 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-02 12:36:37 +00:00
Albrecht Schlosser df94673b61 Fix C++ comment in C header file + typos.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11265 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-02 10:53:25 +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 a3d54d5d6c Correct the headers included by FL/Fl_Copy_Surface.H, following the new implementation of this class.
This change requires other changes in header inclusions by class Fl_Image_Surface.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11258 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-01 18:07:12 +00:00
Manolo Gouy 7decb3d3b2 Rewrite the Fl_Copy_Surface class with strict separation of public API and platform-related code.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11257 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-01 17:20:25 +00:00
Matthias Melcher 95824506fe Moved timer code to screen drivers. Not sure if this should be in System Drivers instead.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11253 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-01 00:54:21 +00:00
Albrecht Schlosser d67e9ccb73 Fix compiler warnings (STR #2988) - final commit.
This commit includes all fixes from branch-1.3 (svn r 11243) and additional
fixes for warnings that crept in during the porting efforts, particularly
C++ ("//") comments in C and included header files, and some more.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11246 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-27 17:27:21 +00:00
Manolo Gouy 0b406baa0f Rewrite all fl_XXX_offscreen() functions so they use an Fl_Image_Surface object.
These functions become therefore platform-independent.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11241 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-27 13:52:27 +00:00
Manolo Gouy 81bd759b53 Remove Fl_Printer::driver() that is already implemented in a parent class.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11236 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-26 20:27:41 +00:00
Manolo Gouy 169e422fee Make the Fl_Widget_Surface's constructor protected.
Because this object is not functional in itself, but needs to be subclassed.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11235 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-26 17:45:13 +00:00
Manolo Gouy 350cca5446 Use the FL_DOXYGEN preprocessor variable to remove all Doxygen warnings
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11232 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-26 17:17:20 +00:00
Manolo Gouy cf4825eedf Move PostScript-support files to src/drivers/PostScript/
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11222 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-26 15:24:08 +00:00
Manolo Gouy 53993d4bd1 Add virtual destructor to Fl_Screen_Driver.
This is safer because Fl_Screen_Driver has virtual member functions and derived classes.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11221 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-26 13:41:48 +00:00
Manolo Gouy 682f950796 Create class Fl_Widget_Surface that supports draw(Fl_Widget *, int, int).
This simplifies the implementation of Fl_Copy_Surface and Fl_Image_Surface
which now are made to derive from Fl_Widget_Surface.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11220 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-26 12:51:47 +00:00
Albrecht Schlosser 44f203e275 Fix Linux and Windows compilation error.
Note: class Fl_Device has been removed.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11218 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-26 11:13:43 +00:00
Manolo Gouy 7f17b915db Remove the useless pseudo run-time type information supported by the Fl_Device class.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11217 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-25 17:56:48 +00:00
Manolo Gouy 31793cbdba Remove the global variable fl_mask_bitmap - put it in the graphics driver's virtual API.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11216 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-25 10:14:28 +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
Manolo Gouy 941c301ceb Fix Fl_RGB_Image::uncache() and Fl_Bitmap::uncache().
It is not possible to use fl_graphics_driver in these functions
because when they are called *fl_graphics_driver may have been
deleted. A solution is to use  Fl_Display_Device::display_device()->driver()
instead which is always valid.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11212 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-23 20:37:22 +00:00
Matthias Melcher 90c42cac3e WinAPI fixes
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11198 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-19 22:46:00 +00:00
Matthias Melcher 093c0c7f73 Fixes for X11
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11197 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-19 22:43:40 +00:00
Matthias Melcher 399501783c Add example code to Fl_Window_Driver.
Some refactoring of a take_focus() function into driver structures (not too happy with it, because it has some kind of bug fix. However, shouldn't *all* Fl_Windows always have an FL_Window_Driver?)

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11196 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-19 22:37:41 +00:00
Matthias Melcher 052401a34e Instantiate the right Fl_Window_Driver.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11195 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-19 22:21:02 +00:00
Matthias Melcher 22d302e242 Add System Driver and Window Driver.
Adding two new driver types for each platform. Fl_..._System_Drivers exist once per application and provide an interface for to file and filename handling, timers, locking, multithreading, etc. .

 The Fl_..._Window_Driver class is instantiated once for every window in the system and corresponds closely to (and actually inherits from) Fl_X. The difference now is, that there is one Fl_X/Fl_Window_Driver base class, and one platform version that derives from it.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11193 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-19 21:41:02 +00:00
Manolo Gouy 1b5e231c90 Rename Fl_Graphics_Driver::set_gc(void*) to gc(void*) and Fl_Graphics_Driver::get_gc() to gc().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11191 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-19 12:40:24 +00:00
Manolo Gouy 6d766cc681 Update the fl_gc global variable also when Fl_Graphics_Driver::set_gc() is called.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11190 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-19 11:52:45 +00:00
Manolo Gouy f33b45f1d3 Remove all uses of the fl_gc global variable. Towards a clean driver model.
fl_gc remains usable by the application as a hook into the system.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11189 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-18 16:21:51 +00:00
Manolo Gouy ec290bc9e0 Remove Fl_X::q_fill_context() used only once.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11171 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-14 06:36:20 +00:00
Manolo Gouy 6439f34ee7 Remove Fl_X::q_clear_clipping() used only once.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11170 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-14 06:19:26 +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
Manolo Gouy 4af616a7a2 New member function Fl_Quartz_Graphics_Driver::draw_CGImage() used internally for all image drawing.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11165 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-13 14:48:13 +00:00
Matthias Melcher c95169ea49 Refactoring get_system_colors() into Fl_Screen_Driver
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11164 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-13 13:17:29 +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
Manolo Gouy bf7c25a1d7 Add Fl_Shared_Image *Fl_Image_Surface::highres_image() to draw into high-resolution bitmap.
Also, change arguments of void Fl_Window::capture_titlebar_and_borders() from
Fl_RGB_Image to F_Shared_Image so, in the future, scaled images having
a drawing size distinct from a pixel size can be returned, to support
high-resolution displays.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11159 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-12 16:17:40 +00:00
Manolo Gouy bc83464b64 Add Fl_Shared_Image *Fl_Image_Surface::highres_image() to draw into high-resolution bitmap.
This new member function returns a high resolution bitmap image scaled to the adequate
 drawing size. This allows to create a bitmap image able to fill all pixels of a high resolution
 display. This is functional only for the Mac OS platform. On other platforms, 
 the new member function returns an unscaled bitmap.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11158 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-12 11:49:32 +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 9a0be2c8df Move platform part of Fl::flush()
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11153 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-11 00:10:49 +00:00
Matthias Melcher 5aa3fc9655 Moving fl_beep into screen driver.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11152 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-10 22:43:45 +00:00
Matthias Melcher c3b3105720 Fix Screen Driver implementation for X11
- moved stuff around to fit X11 file layout
- fixed a few Cocoa variables


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11149 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-10 20:26:51 +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
Matthias Melcher 94f0278d47 Porting efforts, minimal Android stuff, cleanup.
- Moving code around for Fl_Double_Window, but not yet happy
- Tested CMake for Android cross compilation. Very happy!

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11142 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-09 21:54:38 +00:00
Matthias Melcher 7a0fe79f99 Fix MSWindows issues from last refactoring.
During the last refactoring on OS X, a few thing were relocated into new files, mainly to avoid ifdef's and use C++ inheritance in a driver system instead. This commit makes FLTK compile again under VC2013 with IDE files generated by CMake.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11141 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-09 20:15:04 +00:00
Matthias Melcher 4272f32b6b Fix typos for Linux from previous check-in.
- The previous check-in for OS X moved a few files and symbols around
- Fixing for Linux what I broke in my previous commit
- Fixing stuff for MSWindows next
- CodeBlocks IDE file generation via CMake works



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11140 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-09 18:52:21 +00:00
Matthias Melcher e02b3631b3 Remove two files.
- two files were checke in that were misnamed. Removing.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11139 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-09 18:26:05 +00:00
Matthias Melcher 41e22f2f39 Move ifdef's in RGB_Image into driver system.
- change image caching variable types to uintptr_t
- added driver function to uncache image data
- cleaning up (Xlib and GDI will likely throw syntax errors. Trying to fix ASAP)


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11138 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-09 18:25:02 +00:00
Matthias Melcher dee0f5a824 Strip Graphics Driver related ifdefs.
- removed more ifdef's from the graphics drivers
- moved functionality into the driver files themselves
- updated CMakeList.txt



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11137 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-09 12:33:49 +00:00
Albrecht Schlosser 99a6faa513 Fix valgrind warning (uninitialized variable) in Fl_Window.
Regression only with FLTK_ABI_VERSION >= 10303 (since FLTK 1.3.3).
Was fixed in FLTK 1.3.4.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11136 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-09 01:48:08 +00:00