Commit Graph

6752 Commits

Author SHA1 Message Date
Albrecht Schlosser e1f5f5f7ec Update dependencies.
Note: we should really get rid of that!


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11219 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-26 11:17:48 +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 e24f3f79a3 Remove useless declarations.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11215 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-25 07:08:57 +00:00
Manolo Gouy 14759eb387 Mac OS platform: make fl_draw_image() draw correctly depth-4 images with transparent areas.
This simplifies the drawing of Fl_Pixmap's.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11214 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-25 07:01:10 +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
Albrecht Schlosser 0f7e3ac086 Fix unused variable compiler warning.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11209 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-22 17:33:02 +00:00
Albrecht Schlosser 7e94d7650b Fix Fl_Text_Display line numbers and scrolling (STR #3272).
Fix slow scrolling, line number display, and scrollbars (STR #3272).

Optimized wrap mode - removed unnecessary wrap margin calculations.
The speed-up is significant, but there is still room for improvements.

Refactored parts of the code to make the decisions more modular and
(hopefully) obvious.

This commit also fixes some positioning issues with different scrollbar
alignments and the new line number display.

Fix line number display with wrap mode (hiding text behind scrollbars).

Note: same changes as r11202 and r11205 in branch-1.3.



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11208 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-22 17:25:30 +00:00
Albrecht Schlosser f54863db44 Add some test options to test/editor.cxx.
These options are not enabled by default, but you can enable them by
defining macro DEV_TEST. This adds buttons to toggle wrap mode,
scrollbar positions, and to increase or decrease the window size (width).

Note: this can be used to test STR #3272 and the fixes in a follow-up
commit.

Note: same changes as r11204 in branch-1.3.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11207 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-22 17:21:17 +00:00
Albrecht Schlosser 1b5fd476b9 Update copyright and comments of src/cmap.cxx (no code changes).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11201 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-20 16:41:05 +00:00
Albrecht Schlosser 45026bbd8f Document creation of src/fl_cmap.h with src/cmap.cxx.
This is only for developer info.

Note: cmap.cxx is not included in the library. It is only used to
generate fl_cmap.h.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11200 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-20 16:24:11 +00:00
Albrecht Schlosser 07ad8383ed Fix include files.
Note: ../../config_lib.h also includes <config.h>.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11199 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-20 15:56:13 +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 a072a412a1 Typo in X11 part of src/Makefile
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11194 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-19 21:42:46 +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 2b6482263b Fix Fl_X11_Screen_Driver::wait(). The fractals demo is back.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11192 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-19 12:47:45 +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
Albrecht Schlosser 6ce27012a9 Fix Fl::grab(win) under Linux (program crashed in menus).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11187 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-18 01:45:12 +00:00
Albrecht Schlosser b4e57e0e26 Fix flush() call (Linux) - makes drawing work again, but still buggy.
With this fix drawing works again under Linux. Tiny diff, but ...

Known bugs: opening Fl_Choice dropdown menus crashes the program.
In my experience it takes a while (5-10 seconds) before the crash
occurs. Maybe an endless loop that eventually "kills" the stack ?


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11186 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-17 23:54:09 +00:00
Albrecht Schlosser 4a1662f1da Fix compilation under Linux - compiles, but doesn't work :-(
I moved all timer related (X11) stuff from src/Fl.cxx to
src/drivers/X11/Fl_X11_Screen_Driver.cxx and added externals as
done by Ian in a previous commit for the WinAPI screen driver.

I did not (yet) remove the code from Fl_x.cxx though, but disabled it. See:
  #if (0) // *FIXME* moved to src/drivers/X11/Fl_X11_Screen_Driver.cxx

Current state is that FLTK can be compiled and linked again (under Linux)
but doesn't work (shows empty windows only).

I thought it was worth to commit my work, but can't check what's going on
right now - other devs should feel free to continue this.

PS: the new code in src/drivers/X11/Fl_X11_Screen_Driver.cxx was just
dropped in, keeping the right order for usage of static helper functions,
but should be fixed in all regards (order, logic, ...).


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11185 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-17 12:16:59 +00:00
Albrecht Schlosser f7ef143c4f Fix typos.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11184 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-17 11:23:26 +00:00
Manolo Gouy c5994ebb6f Fix drawing of window decoration.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11183 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-16 22:15:47 +00:00
Manolo Gouy 4bdfc28670 Reformatting.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11182 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-15 17:28:50 +00:00
Manolo Gouy 6c33971353 Restore compilability for the WIN32 platform.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11181 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-15 17:25:57 +00:00
Manolo Gouy 88f20cfd15 Improve image drawing to double-resolution Fl_Image_Surface objects (Mac OS only).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11180 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-15 17:21:23 +00:00
Ian MacArthur 5918384879 FL porting Win32 build fix:
Fix a typo. in Fl_WinAPI_Screen_Driver.cxx that was
preventing linking.
Also hack around a build issue by adding some extra
extern calls to Fl_WinAPI_Screen_Driver.cxx.

I suspect that these are also needed in
Fl_X11_Screen_Driver.cxx but do not have an X11 box
here to test with.

In any case, these added externs should probably be
in an internal header somewhere, not in the code
like I have done!

Currently builds/runs OK on Win7 with these changes.



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11178 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-15 13:52:58 +00:00
Albrecht Schlosser 5bc3f5f5a7 Remove all Windows IDE files.
Todo: remove Xcode4 files as well.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11176 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-14 22:57:48 +00:00
Albrecht Schlosser 0c4804270b Fix HTML entities in Fl_Help_View.
Removed obsolete ENC() macro, fixed some encodings that were still
Windows CP-1252: converted to correct Unicode values.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11175 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-14 19:50:57 +00:00
Manolo Gouy 17fc58f6ad Fl_Graphics_Driver::has_feature(Fl_Graphics_Driver::NATIVE) is useful here.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11172 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-14 10:29:54 +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
Manolo Gouy a349dc994e Move Fl_Quartz_Graphics_Driver::draw_CGImage() to Fl_Quartz_Graphics_Driver_image.cxx
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11169 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-14 06:02:12 +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 8deac1e6ba Simpler code to support drawing to high-resolution Fl_Image_Surface object.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11162 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-13 06:25:34 +00:00
Manolo Gouy df0b1dcb07 Fl_Window::capture_titlebar_and_borders() returns a double-resolution top image.
Also, Fl_Image_Surface now can draw a scaled Fl_Shared_Image to 
a double-resolution surface.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11160 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-12 21:15:48 +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 a3c0dac034 Typo in Fl_X11_Screen_Driver::flush header
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11154 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-11 00:18:02 +00:00