Commit Graph

141 Commits

Author SHA1 Message Date
ManoloFLTK eaf62a99dc Documentation: improve description of how to use drawing surfaces 2024-08-10 23:14:56 +02:00
ManoloFLTK 9472ff546c Implement and document new class Fl_PDF_File_Surface 2024-04-30 10:22:47 +02:00
ManoloFLTK bcc6de5332 Improve the documentation of class Fl_Display_device 2023-10-31 19:07:31 +01:00
ManoloFLTK d028f0b37d Fix fl_read_image() under hybrid Wayland/X11 platform.
Function fl_read_image() obliges to keep a minimal use of global variable fl_window
also under the Wayland platform, even if its type (Window) makes little sense for
the hybrid library because it has its X11 value (given by X11/X.h) which is not
meaningful for the Wayland leg of the hybrid platform.

Virtual member function Fl_Surface_Device::as_image_surface() becomes useless.
2022-09-11 19:45:48 +02:00
ManoloFLTK c720aae515 Make hybrid Wayland/X11 platform. 2022-08-29 12:15:32 +02:00
ManoloFLTK 7deff86b5d Remove FL_EXPORT qualifier from platform-specific class declarations. 2022-08-20 10:16:32 +02:00
ManoloFLTK 995a48dd00 Consistently make Fl_Paged_Device::begin_page call Fl_Surface_Device::push_current. 2021-10-31 14:20:04 +01:00
ManoloFLTK 96034b5657 Add documentation of Fl_Surface_Device::end_current(). 2021-10-31 06:47:28 +01:00
Albrecht Schlosser 6ac305a508 Remove compiler warnings '-Wextra-semi' (see also PR #266)
I compiled with `-Wextra-semi -Werror=extra-semi` on Linux and Windows
(cross-compiled on Linux) and removed all "extra semicolon" warnings
I could find. I didn't check on macOS (yet).

Note: Linux configured with and w/o Pango but not w/o Xft. Compilation
with other options (e.g. Cairo) might still emit such warnings.
2021-08-27 14:52:43 +02:00
Albrecht Schlosser 41266df7ae Remove unnecessary system includes from public headers
Add includes of system headers in the implementation files
where necessary.
2021-03-21 00:42:28 +01:00
ManoloFLTK c83490fe30 Rename forgotten occurrence of fl_remove_scale() in Doxygen data. 2021-02-27 09:08:22 +01:00
ManoloFLTK 5bd467fa17 Add fl_remove_scale()/fl_restore_scale() to transiently draw without scaling factor.
This new API is a response to this message in fltk.general :
Can custom box type functions handle their own high-DPI screen scaling?
2021-02-25 11:07:07 +01:00
Albrecht Schlosser f09e17c3c5 Remove $Id$ tags, update URL's, and more
- remove obsolete svn '$Id$' tags from all source files
- update .fl files and generated files accordingly
- replace 'http://www.fltk.org' URL's with 'https://...'
- replace bug report URL 'str.php' with 'bugs.php'
- remove trailing whitespace
- fix other whitespace errors flagged by Git
- add and/or fix missing or wrong standard headers
- convert tabs to spaces in all source files

The only relevant code changes are in the fluid/ folder where
some .fl files and other source files were used to generate
the '$Id' headers and footers.
2020-07-06 20:28:20 +02:00
ManoloFLTK 8d4b0c15f7 Move class Fl_SVG_File_Surface from libfltk to libfltk_images.
File examples/SVG_File_Surface.cxx is no longer useful because it was a very
partial implementation of what is now class Fl_SVG_File_Surface.
2020-06-29 11:36:09 +02:00
ManoloFLTK 2445797e45 Reorganise use of virtual member function Fl_Surface_Device::end_current() 2019-11-07 14:28:20 +01:00
ManoloFLTK 0d3a374396 Call virtual member Fl_Surface_Device::end_current() when necessary
Rename member function Fl_Surface_Device::end_current_() to end_current(),
set it protected, and make it called by the destructor of all classes
derived from Fl_Surface_Device that re-implement end_current().
This way, end_current() runs equally if Fl_Surface_Device()::pop_current()
is called before or after the drawing surface is deleted.
2019-05-25 11:59:16 +02:00
ManoloFLTK 172063b2ad macOS: yet simpler implementation of window resize and rescale. 2019-04-28 15:31:02 +02:00
ManoloFLTK 52f4aa5546 Doxygen doc: rewording for more clarity. 2019-04-14 19:07:14 +02:00
ManoloFLTK cb7dbc34d7 Make member function Fl_Surface_Device::driver(Fl_Graphics_Driver*) protected. 2019-04-10 15:20:00 +02:00
ManoloFLTK 7a0bebb22f New virtual member function bool Fl_Surface_Device::is_current() 2019-04-10 13:14:04 +02:00
ManoloFLTK c66caf5dce Simpler implementation of Fl_Cocoa_Window_Driver::resize() 2019-04-07 09:09:33 +02:00
ManoloFLTK 3bcb1256bb New static member function: Fl_Device_Plugin *Fl_Device_Plugin::opengl_plugin() 2018-12-05 11:04:58 +01:00
Manolo Gouy c33d3c6aaa Remove unused arguments from the Fl_Device_Plugin::print() member function.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13141 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-11-30 09:01:12 +00:00
Manolo Gouy b511f6a7a4 Use the Fl_Gl_Device_Plugin mechanism to simplify the construction of a layer-backed GL window.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13140 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-11-29 17:50:55 +00:00
Manolo Gouy 51389ca460 Add examples/SVG_File_Surface.cxx and refer to it in the doc of class Fl_Surface_Device
This example code shows how to subclass Fl_Surface_Device and Fl_Graphics_Driver to
endow FLTK with a new kind of graphics output.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12980 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-06-27 09:27:04 +00:00
Manolo Gouy 2b7aac129b Rename Fl_Paged_Device::start_job() to begin_job() and Fl_Paged_Device::start_page() to begin_page().
The new function names begin_job() and begin_page() better match end_job() and end_page() with which
they must be used by pair.
The old names start_job() and start_page() are maintained for API compatibility with FLTK 1.3.x

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12910 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-05-09 14:16:35 +00:00
Manolo Gouy b73ff860cc Make virtual void Fl_Surface_Device::end_current_() have no argument because none is used.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12889 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-05-01 17:09:15 +00:00
Manolo Gouy 2ddc89fb61 Add an argument to the private, virtual member function void Fl_Surface_Device::end_current_().
The X11 platform uses this argument to restore the correct clipping state after
drawing to an Fl_Image_Surface object.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12226 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-04-25 12:42:22 +00:00
Manolo Gouy 43935dffeb Add static void Fl_Surface_Device::push_current(Fl_Surface_Device *new_current) and pop_current() to set/unset the current drawing surface.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12140 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-12-07 15:09:52 +00:00
Manolo Gouy 7f3f3f3e08 Rename Fl_Surface_Device::_surface private member variable to surface_ following the CMP.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12130 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-12-01 06:40:17 +00:00
Manolo Gouy 5bb4e853c7 Remove Fl_Image_Surface::end_current() to be called after usage of the drawing surface.
This ensures API compatibility with FLTK 1.3 where Fl_Surface_Device->set_current()
is used to change the current drawing surface.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12125 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-11-30 07:09:48 +00:00
Manolo Gouy fc62d39db5 Add Doxygen note that class Fl_Device_Plugin is not intended for public use.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@12031 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-10-16 15:12:46 +00:00
Manolo Gouy cccb475fa8 Remove useless forward declaration.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11972 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-09-23 15:22:02 +00:00
Manolo Gouy 6b86d9fbaf Remove static bool Fl_Display_Device::high_resolution() which may not be really useful.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11949 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-09-19 15:10:28 +00:00
Manolo Gouy 25b4076b03 Set more accurately the protections of the members of class Fl_Display_Device.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11697 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-26 05:44:54 +00:00
Manolo Gouy 034cfc94a3 Move Fl_X::set_high_resolution() to classes Fl_Graphics_Driver and Fl_Quartz_Graphics_Driver
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11656 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-19 12:46:07 +00:00
Matthias Melcher b6b99d84e9 Fix PicoSDL.
Fixed some issues with Image_Surface and Copy_Surface for PicoSDL. Still have to virtualize the driver concept.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11307 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-07 20:50:18 +00:00
Matthias Melcher fcdc7f1212 Made Pico/SDL setup compile and run some minimal code.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11274 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-03 00:07:17 +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
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 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
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 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
Matthias Melcher 6e16d033ae Add fl_focus_rect function to driver.
Focus rectangles are dotted lines. The default implementation uses the dotted line style, However, for systems without line stye, we draw many dots instead.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11110 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-01 23:06:14 +00:00
Matthias Melcher 7440ea209a Moved fl_create_bitmask and fl_delete_bitmask functions into driver structure. Tested on OS X.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11100 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-31 13:51:01 +00:00
Matthias Melcher 780f43a4f1 Removed all references to Quartz driver files from library headers in Xcode. Works in Xcode.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11065 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-27 22:35:58 +00:00
Manolo Gouy 8e3f66073f 1) Added a new way to detect whether the drawing operation is using the platform's native driver
and whether we are printing:  virtual int Fl_Graphics_Driver::has_feature(driver_feature feature)
This is also because it is not convenient to derive a printer-specific driver with its own
implementation of virtual functions when this implementation differs only in one line of code.

2) Solved the problem of inclusion of non public header by the public header FL/Fl_Device.H:
bracket this with #if FL_LIBRARY / #endif so this non public header is included only when building
FLTK itself.

3) Removed several (but not all) of the FLTK_ABI_VERSION guards that are no longer
useful for code targeting FLTK 1.4.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11063 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-27 18:11:20 +00:00
Matthias Melcher 1c4661c481 Fixed a few comments
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11062 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-26 22:39:47 +00:00
Matthias Melcher 6694780c2d Moving GDI/WIN32 files to new directroy structure
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11058 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-26 21:10:49 +00:00